Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int DYING = 1;
- const int DEAD = 2;
- int frame;
- global script foo
- {
- void run()
- {
- int quit = 0;
- while(quit)
- {
- ++frame;
- //stuff
- if ( Link->HP <=0 )
- {
- if ( LinkCanResurrect() )
- {
- //stuff that can refill life for one frame,
- //such as auto-refull systems, goes here
- }
- else quit = DYING;
- }
- Waitdraw();
- //
- Waitframe();
- }
- Link->HP = 1; Link->CollDetection = false;
- //Screen cleanup
- Link->Action = LA_NONE;
- for ( int q = Screen->NumNPCs(); q > 0; --q)
- {
- npc n = Screen->LoadNPC(q); n->Stun = 214747;
- }
- for ( int q = Screen->NumLWeapons(); q > 0; --q)
- {
- lweapon l = Screen->LoadLWeapon(q); Remove(l);
- }
- for ( int q = Screen->NumEWeapons(); q > 0; --q)
- {
- eweapon l = Screen->LoadEWeapon(q); Remove(l);
- }
- frame = 0;
- while(quit)
- {
- if ( quit == DYING )
- {
- //Animation sequence of death
- Link->ScriptTile = DEATH_TILE + (frame / NUM_FRAMES_PER_TILE_IN_SEQUENCE );
- if ( frame >= NUM_FRAMES_IN_SEQUENCE )
- {
- frame = 0; quit = DEAD;
- }
- }
- if ( quit == DEAD )
- {
- /*Game over screen, drawing backdrop
- text, and menu, goes here. */
- /* choice to save, or quit. */
- }
- Waitdraw(); Waitframe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement