rnd-20060103-2-src
authorHolger Schemel <info@artsoft.org>
Tue, 3 Jan 2006 12:47:31 +0000 (13:47 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:50:15 +0000 (10:50 +0200)
src/conftime.h
src/game.c
src/main.h

index 98ec6265f41e2a6a2467a3e47e0e91f64bc69258..be0053f6f07b42cc79ba20f2e009e3fb3d7cb2c8 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-01-03 09:36]"
+#define COMPILE_DATE_STRING "[2006-01-03 12:32]"
index c7b5d242fb06e19efa0b304093dad93284efa03b..74f80df2311e4d468ed46791877a8405307d7063 100644 (file)
@@ -3065,21 +3065,7 @@ void Explode(int ex, int ey, int phase, int mode)
   if (phase == EX_PHASE_START)         /* initialize 'Store[][]' field */
   {
     int center_element = Feld[ex][ey];
-    int artwork_element = center_element;      /* for custom player artwork */
-    int explosion_element = center_element;    /* for custom player artwork */
-
-    if (IS_PLAYER(ex, ey))
-    {
-      int player_nr = GET_PLAYER_NR(StorePlayer[ex][ey]);
-
-      artwork_element = stored_player[player_nr].artwork_element;
-
-      if (level.use_explosion_element[player_nr])
-      {
-       explosion_element = level.explosion_element[player_nr];
-       artwork_element = explosion_element;
-      }
-    }
+    int artwork_element, explosion_element;    /* set these values later */
 
 #if 0
     /* --- This is only really needed (and now handled) in "Impact()". --- */
@@ -3090,10 +3076,13 @@ void Explode(int ex, int ey, int phase, int mode)
       return;
 #endif
 
+#if 0
+    /* !!! at this place, the center element may be EL_BLOCKED !!! */
     if (mode == EX_TYPE_NORMAL ||
        mode == EX_TYPE_CENTER ||
        mode == EX_TYPE_CROSS)
       PlayLevelSoundElementAction(ex, ey, artwork_element, ACTION_EXPLODING);
+#endif
 
     /* remove things displayed in background while burning dynamite */
     if (Back[ex][ey] != EL_EMPTY && !IS_INDESTRUCTIBLE(Back[ex][ey]))
@@ -3107,7 +3096,35 @@ void Explode(int ex, int ey, int phase, int mode)
       Feld[ex][ey] = center_element;
     }
 
+    /* now "center_element" is finally determined -- set related values now */
+    artwork_element = center_element;          /* for custom player artwork */
+    explosion_element = center_element;                /* for custom player artwork */
+
+    if (IS_PLAYER(ex, ey))
+    {
+      int player_nr = GET_PLAYER_NR(StorePlayer[ex][ey]);
+
+      artwork_element = stored_player[player_nr].artwork_element;
+
+      if (level.use_explosion_element[player_nr])
+      {
+       explosion_element = level.explosion_element[player_nr];
+       artwork_element = explosion_element;
+      }
+    }
+
+#if 1
+    if (mode == EX_TYPE_NORMAL ||
+       mode == EX_TYPE_CENTER ||
+       mode == EX_TYPE_CROSS)
+      PlayLevelSoundElementAction(ex, ey, artwork_element, ACTION_EXPLODING);
+#endif
+
+#if 1
     last_phase = element_info[explosion_element].explosion_delay + 1;
+#else
+    last_phase = element_info[center_element].explosion_delay + 1;
+#endif
 
     for (y = ey - 1; y <= ey + 1; y++) for (x = ex - 1; x <= ex + 1; x++)
     {
@@ -3180,11 +3197,11 @@ void Explode(int ex, int ey, int phase, int mode)
 
       if (IS_PLAYER(ex, ey) && !PLAYER_EXPLOSION_PROTECTED(ex, ey))
       {
+#if 1
        int player_nr = StorePlayer[ex][ey] - EL_PLAYER_1;
 
        Store[x][y] = EL_PLAYER_IS_EXPLODING_1 + player_nr;
-
-#if 0
+#else
        switch(StorePlayer[ex][ey])
        {
          case EL_PLAYER_2:
@@ -3207,6 +3224,10 @@ void Explode(int ex, int ey, int phase, int mode)
          Store[x][y] = EL_EMPTY;
       }
 #if 1
+      /* !!! check this case -- currently needed for rnd_rado_negundo_v,
+        !!! levels 015 018 019 020 021 022 023 026 027 028 !!! */
+      else if (ELEM_IS_PLAYER(center_element))
+       Store[x][y] = EL_EMPTY;
       else if (center_element == EL_YAMYAM)
        Store[x][y] = level.yamyam_content[game.yamyam_content_nr].e[xx][yy];
       else if (element_info[center_element].content.e[xx][yy] != EL_EMPTY)
@@ -3363,28 +3384,16 @@ void Explode(int ex, int ey, int phase, int mode)
     if (element >= EL_PLAYER_IS_EXPLODING_1 &&
        element <= EL_PLAYER_IS_EXPLODING_4)
     {
-      static int player_death_elements[] =
-      {
-       EL_EMERALD_YELLOW,
-       EL_EMERALD_RED,
-       EL_EMERALD,
-       EL_EMERALD_PURPLE
-      };
       int player_nr = element - EL_PLAYER_IS_EXPLODING_1;
-      int player_death_element = player_death_elements[player_nr];
+      int explosion_element = EL_PLAYER_1 + player_nr;
+      int xx = MIN(MAX(0, x - stored_player[player_nr].jx + 1), 2);
+      int yy = MIN(MAX(0, y - stored_player[player_nr].jy + 1), 2);
 
       if (level.use_explosion_element[player_nr])
-      {
-       int explosion_element = level.explosion_element[player_nr];
-       int xx = MIN(MAX(0, x - stored_player[player_nr].jx + 1), 2);
-       int yy = MIN(MAX(0, y - stored_player[player_nr].jy + 1), 2);
-
-       player_death_element =
-         element_info[explosion_element].content.e[xx][yy];
-      }
+       explosion_element = level.explosion_element[player_nr];
 
       Feld[x][y] = (stored_player[player_nr].active ? EL_EMPTY :
-                   player_death_element);
+                   element_info[explosion_element].content.e[xx][yy]);
     }
 
     /* restore probably existing indestructible background element */
index 6032e7779325562e9f71b0d49d3bab2099648bf1..360895f55616dd004669f0ea6ecfccbb8ab72673 100644 (file)
 #define EL_CASCADE_TOGGLE(e)   (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 :    \
                                 IS_EDITOR_CASCADE_ACTIVE(e)   ? (e) - 1 : (e))
 
+#define EL_NAME(e)             (element_info[e].token_name)
 
 /* fundamental game speed values */
 #define ONE_SECOND_DELAY       1000    /* delay value for one second */