/* FINAL DRAGON DEATH MODULE 4/25/05
JESSE HARRIS
DISPLAYS YOU ARE DEAD MESSAGES AND ALLOWS YOU TO START FROM LAST SAVE
*/
#include <mygba.h>
#include <hel.h>
#include <iostream.h>
#include "drawtextbox.h"

extern u16 delay;
extern u8 sprites[127];
extern TCustomTextInfo g_TextInfo;
u8 displayed = 0;

//add laid down death sprite upon revision

int myDeath()
{
    hel_PadReadState();
    if(delay && !displayed)
    {   //turn off monster
        ham_DeleteObj(sprites[120]);
        ham_DeleteObj(sprites[121]);
        ham_DeleteObj(sprites[122]);
        ham_DeleteObj(sprites[123]);
        //main border and blank out screen
        drawTextBox(g_TextInfo,0,0,29,19);
        for (int x = 1; x < 19; x++)
        {
            hel_CustomTextPrint(&g_TextInfo, 1, x, "                            ");
        }
        //say it like it is
        hel_CustomTextPrint(&g_TextInfo, 9, 9, "Your dead.");
        hel_CustomTextPrint(&g_TextInfo, 7, 10, "Press A to start");
        hel_CustomTextPrint(&g_TextInfo, 7, 11, "from last save.");
        displayed = 1;
    }
    if(delay > 0)
    {
        delay--;
    }
    //if hit A then load from last save
    if((delay == 0) && hel_Pad.Held.A)
    {
        displayed = 0;
        return 1;
    }
    return 0;

}

/* END OF FILE */
