Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. /Handles Game Over menu.
  2.  
  3. ffc script Game_Over_Menu{
  4. void run(){
  5. if(!SamusVars[GAME_OVER_TIME]){
  6. SamusVars[IS_INVISIBLE]= 0;
  7. SamusVars[IS_FROZEN]=0;
  8. if ( GetGameRestoreStation()!=128 )
  9. WarpSamusForced( GetGameRestoreStation(), 0);
  10. else
  11. this->Data = CM_AUTOWARPD;
  12. }
  13. SamusVars[IS_INVISIBLE]=1;
  14. SamusVars[IS_FROZEN]= 1;
  15. bool pressed;
  16. int choice;
  17. int Message[]= "Find the Metroid Larva";
  18. int Message2[]= "Press Ex4";
  19. while ( true ) {
  20. //If this station is active....
  21.  
  22. while ( ( !pressed && !Tango_MenuIsActive() ) ) {
  23. if ( Link->PressEx4 ) {
  24. pressed = true;
  25. Link->PressEx4= false;
  26. Link->InputEx4 = false;
  27. }
  28. Screen->DrawString( 7, 32, 32, FONT_SUBSCREEN3 ,0x01,-1,TF_NORMAL, Message, 128 );
  29. Screen->DrawString( 7, 32, 48, FONT_SUBSCREEN3 ,0x01,-1,TF_NORMAL, Message2, 128 );
  30. Waitframe();
  31. }
  32.  
  33. if ( pressed ) {
  34. pressed = false;
  35. //Set coordinates for this station:
  36.  
  37. choice = GameOver_Menu();
  38. if(choice!=0)
  39. break;
  40. }
  41. Waitframe(); //Main while loop.
  42. }
  43. SamusVars[IS_INVISIBLE]=0;
  44. SamusVars[IS_FROZEN]= 0;
  45. SamusVars[GAME_OVER_TIME]= 0;
  46. if ( GetGameRestoreStation()!=128 )
  47. WarpSamusForced( GetGameRestoreStation(), 0);
  48. else
  49. this->Data = CM_AUTOWARPD;
  50. }
  51. }
  52.  
  53. //Menu called by the save station ffc.
  54. int GameOver_Menu() {
  55. int lineBreak[]="@26";
  56. int line1[]="@choice(1)Continue@26";
  57. int line2[]="@choice(2)Save and Continue@26";
  58. int line3[]="@choice(4)Quit";
  59. int line4[]="@choice(3)Save and Quit@26";
  60. int initmenu[]="@domenu(1)@suspend()";
  61.  
  62. SetUpWindow(WINDOW_SLOT_1, WINDOW_STYLE_1, 32, 16, SIZE_WIDE);
  63. Tango_LoadString(WINDOW_SLOT_1, line1);
  64. Tango_AppendString(WINDOW_SLOT_1, line2);
  65. Tango_AppendString(WINDOW_SLOT_1, line4);
  66. Tango_AppendString(WINDOW_SLOT_1, line3);
  67. Tango_AppendString(WINDOW_SLOT_1, initmenu);
  68. Tango_ActivateSlot(WINDOW_SLOT_1);
  69.  
  70. while(!Tango_MenuIsActive()){
  71.  
  72. Waitframe();
  73. }
  74.  
  75. // Save the state again...
  76. int slotState[278];
  77. int menuState[960];
  78. int cursorPos;
  79. Tango_SaveSlotState(WINDOW_SLOT_1, slotState);
  80. Tango_SaveMenuState(menuState);
  81.  
  82. int done = 0;
  83. int choice;
  84. while(true){
  85.  
  86. while( Tango_MenuIsActive() ) {
  87. if ( Link->PressEx4 ) {
  88. Link->PressEx4= false;
  89. Link->InputEx4 = false;
  90. }
  91. cursorPos=Tango_GetMenuCursorPosition();
  92. Waitframe();
  93. }
  94.  
  95. choice = Tango_GetLastMenuChoice();
  96. if ( choice == 1)//Continue
  97. done= -999;
  98.  
  99. else if ( choice == 3){//Save and Quit
  100. SamusVars[IS_INVISIBLE]=0;
  101. SamusVars[IS_FROZEN]= 0;
  102. SamusVars[GAME_OVER_TIME]= 0;
  103. SaveGame(GetGameRestoreStation());
  104. Game->End();
  105. }
  106. else if ( choice == 2){//Save and Continue
  107. SamusVars[IS_INVISIBLE]=0;
  108. SamusVars[IS_FROZEN]= 0;
  109. SamusVars[GAME_OVER_TIME]= 0;
  110. SaveGame(GetGameRestoreStation());
  111. done= -999;
  112. }
  113. else if ( choice == 4){//Quit
  114. SamusVars[IS_INVISIBLE]=0;
  115. SamusVars[IS_FROZEN]= 0;
  116. SamusVars[GAME_OVER_TIME]= 0;
  117. Game->End();
  118. }
  119.  
  120. if ( done )
  121. break;
  122. // return choice;
  123. else {
  124. Tango_RestoreSlotState(WINDOW_SLOT_1, slotState);
  125. Tango_RestoreMenuState(menuState);
  126. Tango_SetMenuCursorPosition(cursorPos);
  127. }
  128. }
  129.  
  130. Tango_ClearSlot(WINDOW_SLOT_1);
  131. //if ( DEBUG_MENUS ) DebugMetroidSaveStationMenu(done);
  132. return done;
  133. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement