rnd-20080129-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 29 Jan 2008 18:56:03 +0000 (19:56 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:56:52 +0000 (10:56 +0200)
* added possibility to reanimate player immediately after his death
  (for example, by "change to <player> when explosion of <player>")

ChangeLog
src/conftime.h
src/game.c

index 3c9830190b8854c2f4409fbf0c6e894eb1084897..7cb65b0a434760098e237a62f368148f48e0a95a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-27
+       * added possibility to reanimate player immediately after his death
+         (for example, by "change to <player> when explosion of <player>")
+
 2008-01-25
        * fixed bug with "gray" white door not being uncovered by magnifier
        * added score for collecting (any) key to the white key config page
index f01b9d18555131ec6e0ae9780d55d4a9fac6a769..baee88bca03dff95ff7c747e537cdb317f780076 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2008-01-26 01:58"
+#define COMPILE_DATE_STRING "2008-01-27 02:01"
index 9097cb1fe26ae68fe8df79475d4e42def0a9e2f1..101855843b7c0f39165d2ace5b430bbddb7e395b 100644 (file)
@@ -60,6 +60,8 @@
 #define USE_FIX_IMPACT_COLLISION       (USE_NEW_STUFF          * 1)
 #define USE_FIX_CE_ACTION_WITH_PLAYER  (USE_NEW_STUFF          * 1)
 
+#define USE_PLAYER_REANIMATION         (USE_NEW_STUFF          * 1)
+
 #define USE_GFX_RESET_WHEN_NOT_MOVING  (USE_NEW_STUFF          * 1)
 
 #define USE_DELAYED_GFX_REDRAW         (USE_NEW_STUFF          * 0)
@@ -1781,6 +1783,17 @@ static void InitPlayerField(int x, int y, int element, boolean init_game)
     player->jx = player->last_jx = x;
     player->jy = player->last_jy = y;
   }
+
+#if USE_PLAYER_REANIMATION
+  if (!init_game)
+  {
+    int player_nr = GET_PLAYER_NR(element);
+    struct PlayerInfo *player = &stored_player[player_nr];
+
+    if (player->active)
+      player->killed = FALSE;  /* if player was just killed, reanimate him */
+  }
+#endif
 }
 
 static void InitField(int x, int y, boolean init_game)
@@ -12684,7 +12697,7 @@ void ScrollLevel(int dx, int dy)
   int softscroll_offset = (setup.soft_scrolling ? TILEX : 0);
   int x, y;
 #else
-  int i, x, y;
+  int x, y;
 #endif
 
 #if 0
@@ -13604,6 +13617,8 @@ void TestIfElementTouchesCustomElement(int x, int y)
     /* check for change of border element */
     CheckElementChangeBySide(xx, yy, border_element, center_element,
                             CE_TOUCHING_X, center_side);
+
+    /* (center element cannot be player, so we dont have to check this here) */
   }
 
   for (i = 0; i < NUM_DIRECTIONS; i++)
@@ -14137,7 +14152,13 @@ void KillPlayer(struct PlayerInfo *player)
   player->shield_deadly_time_left = 0;
 
   Bang(jx, jy);
+
+#if USE_PLAYER_REANIMATION
+  if (player->killed)          /* player may have been reanimated */
+    BuryPlayer(player);
+#else
   BuryPlayer(player);
+#endif
 }
 
 static void KillPlayerUnlessEnemyProtected(int x, int y)