rnd-20070207-2-src
authorHolger Schemel <info@artsoft.org>
Wed, 7 Feb 2007 22:37:28 +0000 (23:37 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:54:21 +0000 (10:54 +0200)
* changed end of game again: do not wait for the user to press a key
  anymore, but directly ask/confirm tape saving and go to hall of fame
* re-enabled quitting of lost game by pressing space or return again
* improved handling of title text messages (initial and for level set)
* added new options "auto-wrap" and "centered" for DC2 style envelopes

ChangeLog
src/conftime.h
src/events.c
src/game.c
src/game.h
src/tools.c

index ae937d76860d9152a468d0bc5f8b748ae126f86c..ec5690717357344ab70f02e63c91136bbfec6e82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-02-07
+       * changed end of game again: do not wait for the user to press a key
+         anymore, but directly ask/confirm tape saving and go to hall of fame
+       * re-enabled quitting of lost game by pressing space or return again
+
+2007-02-05
+       * improved handling of title text messages (initial and for level set)
+
+2007-02-03
+       * added new options "auto-wrap" and "centered" for DC2 style envelopes
+
 2007-01-31
        * fixed displaying and typing of player name when it is centered
        * added special characters to be allowed for player name (not only A-Z)
index 0b9025854d753fa2cf95153c73950172cb27928b..7fbda9438b6c7c6d083b9141ba48595ffa6881ab 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-02-07 01:33"
+#define COMPILE_DATE_STRING "2007-02-07 23:23"
index 7ea4356bc8920f6afaa51f0c7bdc397ad4a64b93..d08de9edf5ce16d679d5667756b4a70aca33bcad 100644 (file)
@@ -717,9 +717,8 @@ void HandleKey(Key key, int key_status)
     return;
   }
 
-#if 1
-  if (game_status == GAME_MODE_PLAYING &&
-      local_player->LevelSolved_GameEnd &&
+#if 0
+  if (game_status == GAME_MODE_PLAYING && local_player->LevelSolved_GameEnd &&
       (key == KSYM_Return || key == setup.shortcut.toggle_pause))
 #else
   if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
@@ -1068,7 +1067,7 @@ void HandleJoystick()
       if (tape.playing || keyboard)
        newbutton = ((joy & JOY_BUTTON) != 0);
 
-#if 1
+#if 0
       if (local_player->LevelSolved_GameEnd && newbutton)
 #else
       if (AllPlayersGone && newbutton)
index 0659bd04c273b6c7dab7c7405c6870004c92b20f..13981e4272118059f4b4433d70024b97f9a677cf 100644 (file)
@@ -86,7 +86,8 @@
 #define EX_TYPE_SINGLE_TILE    (EX_TYPE_CENTER | EX_TYPE_BORDER)
 
 #if 1
-#define        PANEL_DEACTIVATED(p)    ((p)->x < 0 || (p)->y < 0)
+#define PANEL_OFF()            (local_player->LevelSolved_PanelOff)
+#define        PANEL_DEACTIVATED(p)    ((p)->x < 0 || (p)->y < 0 || PANEL_OFF())
 #define PANEL_XPOS(p)          (DX + ALIGNED_MENU_XPOS(p))
 #define PANEL_YPOS(p)          (DY + ALIGNED_MENU_YPOS(p))
 #else
@@ -2242,7 +2243,9 @@ void InitGame()
     player->LevelSolved = FALSE;
     player->GameOver = FALSE;
 
+    player->LevelSolved_GameWon = FALSE;
     player->LevelSolved_GameEnd = FALSE;
+    player->LevelSolved_PanelOff = FALSE;
     player->LevelSolved_SaveTape = FALSE;
     player->LevelSolved_SaveScore = FALSE;
   }
@@ -2974,10 +2977,12 @@ void GameWon()
 {
   static int time, time_final;
   static int score, score_final;
-  static int game_over_delay = 0;
-  int game_over_delay_value = 50;
+  static int game_over_delay_1 = 0;
+  static int game_over_delay_2 = 0;
+  int game_over_delay_value_1 = 50;
+  int game_over_delay_value_2 = 50;
 
-  if (!local_player->LevelSolved_GameEnd)
+  if (!local_player->LevelSolved_GameWon)
   {
     int i;
 
@@ -2985,7 +2990,7 @@ void GameWon()
     if (local_player->MovPos)
       return;
 
-    local_player->LevelSolved_GameEnd = TRUE;
+    local_player->LevelSolved_GameWon = TRUE;
     local_player->LevelSolved_SaveTape = tape.recording;
     local_player->LevelSolved_SaveScore = !tape.playing;
 
@@ -2996,7 +3001,8 @@ void GameWon()
     TapeStop();
 #endif
 
-    game_over_delay = game_over_delay_value;
+    game_over_delay_1 = game_over_delay_value_1;
+    game_over_delay_2 = game_over_delay_value_2;
 
     time = time_final = (level.time == 0 ? TimePlayed : TimeLeft);
     score = score_final = local_player->score_final;
@@ -3078,9 +3084,9 @@ void GameWon()
     PlaySound(SND_GAME_WINNING);
   }
 
-  if (game_over_delay > 0)
+  if (game_over_delay_1 > 0)
   {
-    game_over_delay--;
+    game_over_delay_1--;
 
     return;
   }
@@ -3103,7 +3109,22 @@ void GameWon()
       PlaySoundLoop(SND_GAME_LEVELTIME_BONUS);
     else
       PlaySound(SND_GAME_LEVELTIME_BONUS);
+
+    return;
+  }
+
+  local_player->LevelSolved_PanelOff = TRUE;
+
+  if (game_over_delay_2 > 0)
+  {
+    game_over_delay_2--;
+
+    return;
   }
+
+#if 1
+  GameEnd();
+#endif
 }
 
 void GameEnd()
@@ -3111,6 +3132,8 @@ void GameEnd()
   int hi_pos;
   boolean raise_level = FALSE;
 
+  local_player->LevelSolved_GameEnd = TRUE;
+
   CloseDoor(DOOR_CLOSE_1);
 
   if (local_player->LevelSolved_SaveTape)
@@ -9870,7 +9893,7 @@ void GameActions()
       AllPlayersGone = TRUE;
   }
 
-  if (local_player->LevelSolved)
+  if (local_player->LevelSolved && !local_player->LevelSolved_GameEnd)
     GameWon();
 
   if (AllPlayersGone && !TAPE_IS_STOPPED(tape))
index e7c7d89c56e4cf1dceb7d0e658fe39b38da82d47..92ab3451d4a3d65fe75d15d5bf95d41d90bda541 100644 (file)
@@ -142,7 +142,9 @@ struct PlayerInfo
 
   boolean LevelSolved, GameOver;
 
+  boolean LevelSolved_GameWon;
   boolean LevelSolved_GameEnd;
+  boolean LevelSolved_PanelOff;
   boolean LevelSolved_SaveTape;
   boolean LevelSolved_SaveScore;
 
index 84198618ee2a7baad4d783662277f6f49f6ad158..2970cfa911c0e6b5dcbe6a6eafb4ec1497993063 100644 (file)
@@ -2791,6 +2791,23 @@ boolean Request(char *text, unsigned int req_state)
        result = 0;
     }
 
+#if 1
+
+    if (game_status == GAME_MODE_PLAYING && local_player->LevelSolved_GameEnd)
+    {
+      HandleGameActions();
+      BackToFront();
+    }
+    else
+    {
+      DoAnimation();
+
+      if (!PendingEvent())     /* delay only if no pending events */
+       Delay(10);
+    }
+
+#else
+
     DoAnimation();
 
 #if 1
@@ -2799,6 +2816,8 @@ boolean Request(char *text, unsigned int req_state)
 #else
     /* don't eat all CPU time */
     Delay(10);
+#endif
+
 #endif
   }