Advertisement
ZoriaRPG

No F6 Save on Death

Feb 23rd, 2018
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.84 KB | None | 0 0
  1. global script noF6
  2. {
  3.      void run()
  4.      {
  5.           int quit = 0; int deathframe; bool cur_selection;
  6.           while(Link->HP > 0)
  7.           {
  8.                Waitdraw(); Waitframe();
  9.           }
  10.           while(!quit)
  11.           {
  12.                //Set game music to a silent MIDI.
  13.  
  14.                Link->HP = 1;
  15.                Link->Invisible = true;
  16.                Link->CollDetection = false;
  17.                //Clean up screen objects
  18.                if ( Screen->NumNPCs() )
  19.                {
  20.                     for ( int q = Screen->NumNPCs(); q > 0; --q )
  21.                     { npc n = Screen->LoadNPC(q); Remove(n); }
  22.                }
  23.                if ( Screen->NumLWeapons() )
  24.                {
  25.                     for ( int q = Screen->NumLWeapons(); q > 0; --q )
  26.                     { lweapon n = Screen->LoadLWeapon(q); Remove(n); }
  27.                }
  28.                if ( Screen->NumEWeapons() )
  29.                {
  30.                     for ( int q = Screen->NumEWeapons(); q > 0; --q )
  31.                     { eweapon n = Screen->LoadEWeapon(q); Remove(n); }
  32.                }
  33.                if ( Screen->NumItems() )
  34.                {
  35.                     for ( int q = Screen->NumItems(); q > 0; --q )
  36.                     { item n = Screen->LoadItem(q); Remove(n); }
  37.                }
  38.                //clear all ffcs
  39.                for ( int q = 1; q < 33; ++q )
  40.                {
  41.                     ffc f = Screen->LoadFFC(q);
  42.                     f->Data = 0; f->Script = 0;
  43.                }
  44.                //Do Link Death animation
  45.                if ( deathframe == 0 ) Game->PlaySound(SFX_LINKDEATH);
  46.                while ( ++deathframe < MAX_DEATHFRAME )
  47.                {
  48.                     //spin Link around by drawing his tiles, then make the wink out.
  49.                     Waitdraw(); Waitframe();
  50.                }
  51.                
  52.                //    GAME OVER SCREEN
  53.                //Play game over midi.
  54.                //Draw black background with Quad()
  55.                //Draw text SAVE / DON'T SAVE
  56.                //Draw cursor, with SAVE as the default.
  57.                cur_selection = true;
  58.                if ( Link->PressDown || Link->PressUp )
  59.                {
  60.                     cur_selection = !cur_selection; //flip its state
  61.                     Game->PlaySound(SFX_GAMEOVERSCREEN_CURSOR);
  62.                }
  63.                if ( Link->PressStart )
  64.                {
  65.                     Link->PressStart = false; Link->InputStart = false;
  66.                     Game->PlaySound(SFX_GAMEOVERSCREEN_SELECTION);
  67.                     if ( cur_selection ) quit = 1;
  68.                     else quit = 2; //no save
  69.                }
  70.                Waitdraw(); Waitframe();
  71.           }
  72.           if ( quit == 1 )
  73.           {
  74.                Game->Save();
  75.                Game->End();
  76.           }
  77.           else Game->End();
  78.      }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement