rnd-20030417-3-src
authorHolger Schemel <info@artsoft.org>
Thu, 17 Apr 2003 17:26:33 +0000 (19:26 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:41:18 +0000 (10:41 +0200)
src/conftime.h
src/editor.c
src/events.c
src/game.c
src/init.c
src/main.h
src/tools.c

index bf53cc5405e7f6d9ae10b91c4aa031e183c2e030..735034f644ffb94b2c0d9137aa31da06357a189b 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-04-17 10:03]"
+#define COMPILE_DATE_STRING "[2003-04-17 19:21]"
index df3db706e31ba03f7fce6d18943144d25ba9631d..41c17e2094af616f8c810b4604a4718277242110 100644 (file)
@@ -3706,8 +3706,7 @@ static void DrawPropertiesInfo()
     { EP_HAS_CONTENT,          "- has content"                 },
     { EP_DIGGABLE,             "- diggable"                    },
     { EP_SP_ELEMENT,           "- SB style"                    },
-    { EP_WALKABLE_THROUGH,     "- walkable through"            },
-    { EP_OVER_PLAYER,          "- over player"                 },
+    { EP_WALKABLE_INSIDE,      "- walkable inside"             },
     { EP_ACTIVE_BOMB,          "- active bomb"                 },
     { EP_BELT,                 "- belt"                        },
     { EP_BELT_ACTIVE,          "- active belt"                 },
index ffe1d4f0b09b306762c9560bab9a8ccf66a264c7..1f78e6b2559b1a814425ef7d2072c9ce420219f8 100644 (file)
@@ -431,6 +431,7 @@ void HandleButton(int mx, int my, int button)
          printf("      MovPos[%d][%d] == %d\n", x,y, MovPos[x][y]);
          printf("      MovDir[%d][%d] == %d\n", x,y, MovDir[x][y]);
          printf("      MovDelay[%d][%d] == %d\n", x,y, MovDelay[x][y]);
+         printf("      GfxElement[%d][%d] == %d\n", x,y, GfxElement[x][y]);
          printf("\n");
        }
       }
index fb479b0e964d2086a206fd79e217ab23fc2ae3fb..bf1000db0c1b794f93bc6a1d3ac744f519bbbddd 100644 (file)
@@ -1378,7 +1378,7 @@ static int MovingOrBlocked2ElementIfNotLeaving(int x, int y)
 static void RemoveField(int x, int y)
 {
   Feld[x][y] = EL_EMPTY;
-  GfxElement[x][y] = EL_EMPTY;
+  GfxElement[x][y] = EL_UNDEFINED;
   MovPos[x][y] = 0;
   MovDir[x][y] = 0;
   MovDelay[x][y] = 0;
@@ -1525,7 +1525,8 @@ void Explode(int ex, int ey, int phase, int mode)
        RemoveMovingField(x, y);
       }
 
-      if (IS_INDESTRUCTIBLE(element) || element == EL_FLAMES)
+      if ((IS_INDESTRUCTIBLE(element) && !IS_ACCESSIBLE(element)) ||
+         element == EL_FLAMES)
        continue;
 
       if (IS_PLAYER(x, y) && SHIELD_ON(PLAYERINFO(x, y)))
@@ -1543,6 +1544,11 @@ void Explode(int ex, int ey, int phase, int mode)
       if (element == EL_EXPLOSION)
        element = Store2[x][y];
 
+#if 1
+      if (IS_INDESTRUCTIBLE(Store[x][y]))      /* hard element under bomb */
+       element = Store[x][y];
+#endif
+
       if (IS_PLAYER(ex, ey) && !PLAYER_PROTECTED(ex, ey))
       {
        switch(StorePlayer[ex][ey])
@@ -1595,8 +1601,15 @@ void Explode(int ex, int ey, int phase, int mode)
        Store[x][y] = EL_PEARL;
       else if (element == EL_WALL_CRYSTAL)
        Store[x][y] = EL_CRYSTAL;
+#if 1
+      else if (IS_INDESTRUCTIBLE(element))
+       Store[x][y] = element;
+      else
+       Store[x][y] = EL_EMPTY;
+#else
       else if (!IS_PFORTE(Store[x][y]))
        Store[x][y] = EL_EMPTY;
+#endif
 
       if (x != ex || y != ey ||
          center_element == EL_AMOEBA_TO_DIAMOND || mode == EX_BORDER)
@@ -1612,7 +1625,7 @@ void Explode(int ex, int ey, int phase, int mode)
       }
 
       Feld[x][y] = EL_EXPLOSION;
-      GfxElement[x][y] = EL_EMPTY;
+      GfxElement[x][y] = EL_UNDEFINED;
       MovDir[x][y] = MovPos[x][y] = 0;
       AmoebaNr[x][y] = 0;
       ExplodePhase[x][y] = 1;
@@ -1686,6 +1699,20 @@ void Explode(int ex, int ey, int phase, int mode)
     if (phase == delay)
       DrawLevelFieldCrumbledSand(x, y);
 
+#if 1
+    if (IS_ACCESSIBLE_OVER(Store[x][y]))
+    {
+      DrawLevelElement(x, y, Store[x][y]);
+      DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame);
+    }
+    else if (IS_ACCESSIBLE_UNDER(Store[x][y]))
+    {
+      DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+      DrawLevelElementThruMask(x, y, Store[x][y]);
+    }
+    else if (!IS_ACCESSIBLE_INSIDE(Store[x][y]))
+      DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+#else
     if (IS_PFORTE(Store[x][y]))
     {
       DrawLevelElement(x, y, Store[x][y]);
@@ -1693,6 +1720,7 @@ void Explode(int ex, int ey, int phase, int mode)
     }
     else
       DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+#endif
   }
 }
 
@@ -5030,7 +5058,7 @@ static void CheckGravityMovement(struct PlayerInfo *player)
 
     if (field_under_player_is_free &&
        !player_is_moving_to_valid_field &&
-       !IS_WALKABLE_THROUGH(Feld[jx][jy]))
+       !IS_WALKABLE_INSIDE(Feld[jx][jy]))
       player->programmed_action = MV_DOWN;
   }
 }
@@ -5604,8 +5632,11 @@ void KillHero(struct PlayerInfo *player)
   if (!player->active)
     return;
 
+#if 1
+#else
   if (IS_PFORTE(Feld[jx][jy]))
     Feld[jx][jy] = EL_EMPTY;
+#endif
 
   /* deactivate shield (else Bang()/Explode() would not work right) */
   player->shield_normal_time_left = 0;
index 34d4ef14d51ae6093f72a112805563e3f51263ab..5a16867bac61e49d7ca9ed0949a60231fe75590c 100644 (file)
@@ -1949,15 +1949,24 @@ void InitElementProperties()
   {
     EL_EMPTY_SPACE,
     EL_SP_EMPTY_SPACE,
-    /* !!! EL_GATE_[1-4],    EL_GATE_[1-4]_GRAY    !!! */
-    /* !!! EL_EM_GATE_[1-4], EL_EM_GATE_[1-4]_GRAY !!! */
     EL_SOKOBAN_FIELD_EMPTY,
     EL_EXIT_OPEN,
     EL_SP_EXIT_OPEN,
+#if 1
+    /* !!! CHANGE THIS TO "EL_GATE_1_OPEN" etc. !!! */
+    EL_GATE_1,
+    EL_GATE_2,
+    EL_GATE_3,
+    EL_GATE_4,
+    EL_GATE_1_GRAY,
+    EL_GATE_2_GRAY,
+    EL_GATE_3_GRAY,
+    EL_GATE_4_GRAY,
+#endif
     -1
   };
 
-  static int ep_walkable_through[] =
+  static int ep_walkable_inside[] =
   {
     EL_TUBE_ANY,
     EL_TUBE_VERTICAL,
@@ -1993,7 +2002,7 @@ void InitElementProperties()
     -1
   };
 
-  static int ep_passable_through[] =
+  static int ep_passable_inside[] =
   {
     EL_SP_PORT_LEFT,
     EL_SP_PORT_RIGHT,
@@ -2063,33 +2072,6 @@ void InitElementProperties()
     -1
   };
 
-  static int ep_over_player[] =
-  {
-    EL_SP_PORT_LEFT,
-    EL_SP_PORT_RIGHT,
-    EL_SP_PORT_UP,
-    EL_SP_PORT_DOWN,
-    EL_SP_PORT_HORIZONTAL,
-    EL_SP_PORT_VERTICAL,
-    EL_SP_PORT_ANY,
-    EL_SP_GRAVITY_PORT_LEFT,
-    EL_SP_GRAVITY_PORT_RIGHT,
-    EL_SP_GRAVITY_PORT_UP,
-    EL_SP_GRAVITY_PORT_DOWN,
-    EL_TUBE_LEFT_UP,
-    EL_TUBE_LEFT_DOWN,
-    EL_TUBE_RIGHT_UP,
-    EL_TUBE_RIGHT_DOWN,
-    EL_TUBE_HORIZONTAL,
-    EL_TUBE_HORIZONTAL_UP,
-    EL_TUBE_HORIZONTAL_DOWN,
-    EL_TUBE_VERTICAL,
-    EL_TUBE_VERTICAL_LEFT,
-    EL_TUBE_VERTICAL_RIGHT,
-    EL_TUBE_ANY,
-    -1
-  };
-
   static int ep_active_bomb[] =
   {
     EL_DYNAMITE_ACTIVE,
@@ -2260,15 +2242,14 @@ void InitElementProperties()
     { ep_pushable,             EP_PUSHABLE             },
     { ep_player,               EP_PLAYER               },
     { ep_walkable_over,                EP_WALKABLE_OVER        },
-    { ep_walkable_through,     EP_WALKABLE_THROUGH     },
+    { ep_walkable_inside,      EP_WALKABLE_INSIDE      },
     { ep_walkable_under,       EP_WALKABLE_UNDER       },
     { ep_passable_over,                EP_PASSABLE_OVER        },
-    { ep_passable_through,     EP_PASSABLE_THROUGH     },
+    { ep_passable_inside,      EP_PASSABLE_INSIDE      },
     { ep_passable_under,       EP_PASSABLE_UNDER       },
 
     { ep_diggable,             EP_DIGGABLE             },
     { ep_collectible,          EP_COLLECTIBLE          },
-    { ep_over_player,          EP_OVER_PLAYER          },
     { ep_active_bomb,          EP_ACTIVE_BOMB          },
     { ep_belt,                 EP_BELT                 },
     { ep_belt_active,          EP_BELT_ACTIVE          },
@@ -2301,7 +2282,7 @@ void InitElementProperties()
     EP_PLAYER,
     EP_HAS_CONTENT,
     EP_DIGGABLE,
-    EP_PASSABLE_THROUGH,
+    EP_PASSABLE_INSIDE,
     EP_OVER_PLAYER,
     EP_ACTIVE_BOMB,
 
@@ -2332,20 +2313,23 @@ void InitElementProperties()
   /* set properties derived from other properties */
   for (i=0; i<MAX_NUM_ELEMENTS; i++)
   {
-    if (IS_WALKABLE_OVER(i) || IS_WALKABLE_THROUGH(i) || IS_WALKABLE_UNDER(i))
+    if (IS_WALKABLE_OVER(i) || IS_WALKABLE_INSIDE(i) || IS_WALKABLE_UNDER(i))
       SET_PROPERTY(i, EP_WALKABLE, TRUE);
 
-    if (IS_PASSABLE_OVER(i) || IS_PASSABLE_THROUGH(i) || IS_PASSABLE_UNDER(i))
+    if (IS_PASSABLE_OVER(i) || IS_PASSABLE_INSIDE(i) || IS_PASSABLE_UNDER(i))
       SET_PROPERTY(i, EP_PASSABLE, TRUE);
 
     if (IS_WALKABLE_OVER(i) || IS_PASSABLE_OVER(i))
-      SET_PROPERTY(i, EP_PLAYER_OVER, TRUE);
+      SET_PROPERTY(i, EP_ACCESSIBLE_OVER, TRUE);
 
-    if (IS_WALKABLE_THROUGH(i) || IS_PASSABLE_THROUGH(i))
-      SET_PROPERTY(i, EP_PLAYER_INSIDE, TRUE);
+    if (IS_WALKABLE_INSIDE(i) || IS_PASSABLE_INSIDE(i))
+      SET_PROPERTY(i, EP_ACCESSIBLE_INSIDE, TRUE);
 
     if (IS_WALKABLE_UNDER(i) || IS_PASSABLE_UNDER(i))
-      SET_PROPERTY(i, EP_PLAYER_UNDER, TRUE);
+      SET_PROPERTY(i, EP_ACCESSIBLE_UNDER, TRUE);
+
+    if (IS_WALKABLE(i) || IS_PASSABLE(i))
+      SET_PROPERTY(i, EP_ACCESSIBLE, TRUE);
   }
 
 #if 0
index 2d5910757ccec644e94ab7e673cb12adbacf178f..6448eb4bed7a296376e6c3549f447d6222485936 100644 (file)
 #define EP_PUSHABLE            24
 #define EP_PLAYER              25
 #define EP_WALKABLE_OVER       26
-#define EP_WALKABLE_THROUGH    27
+#define EP_WALKABLE_INSIDE     27
 #define EP_WALKABLE_UNDER      28
 #define EP_PASSABLE_OVER       29
-#define EP_PASSABLE_THROUGH    30
+#define EP_PASSABLE_INSIDE     30
 #define EP_PASSABLE_UNDER      31
 
 /* values for runtime properties (non-storable) */
-#define EP_WALKABLE            32
-#define EP_PASSABLE            33
-#define EP_PLAYER_OVER         34
-#define EP_PLAYER_INSIDE       35
-#define EP_PLAYER_UNDER                36
-#define EP_DIGGABLE            37
-#define EP_COLLECTIBLE         38
-#define EP_OVER_PLAYER         39
+#define EP_ACCESSIBLE_OVER     32
+#define EP_ACCESSIBLE_INSIDE   33
+#define EP_ACCESSIBLE_UNDER    34
+#define EP_WALKABLE            35
+#define EP_PASSABLE            36
+#define EP_ACCESSIBLE          37
+#define EP_DIGGABLE            38
+#define EP_COLLECTIBLE         39
 #define EP_ACTIVE_BOMB         40
 #define EP_BELT                        41
 #define EP_BELT_ACTIVE         42
 #define IS_PUSHABLE(e)         HAS_PROPERTY(e, EP_PUSHABLE)
 #define ELEM_IS_PLAYER(e)      HAS_PROPERTY(e, EP_PLAYER)
 #define IS_WALKABLE_OVER(e)    HAS_PROPERTY(e, EP_WALKABLE_OVER)
-#define IS_WALKABLE_THROUGH(e) HAS_PROPERTY(e, EP_WALKABLE_THROUGH)
+#define IS_WALKABLE_INSIDE(e)  HAS_PROPERTY(e, EP_WALKABLE_INSIDE)
 #define IS_WALKABLE_UNDER(e)   HAS_PROPERTY(e, EP_WALKABLE_UNDER)
 #define IS_PASSABLE_OVER(e)    HAS_PROPERTY(e, EP_PASSABLE_OVER)
-#define IS_PASSABLE_THROUGH(e) HAS_PROPERTY(e, EP_PASSABLE_THROUGH)
+#define IS_PASSABLE_INSIDE(e)  HAS_PROPERTY(e, EP_PASSABLE_INSIDE)
 #define IS_PASSABLE_UNDER(e)   HAS_PROPERTY(e, EP_PASSABLE_UNDER)
 
 /* macros for runtime properties */
+#define IS_ACCESSIBLE_OVER(e)  HAS_PROPERTY(e, EP_ACCESSIBLE_OVER)
+#define IS_ACCESSIBLE_INSIDE(e)        HAS_PROPERTY(e, EP_ACCESSIBLE_INSIDE)
+#define IS_ACCESSIBLE_UNDER(e) HAS_PROPERTY(e, EP_ACCESSIBLE_UNDER)
 #define IS_WALKABLE(e)         HAS_PROPERTY(e, EP_WALKABLE)
 #define IS_PASSABLE(e)         HAS_PROPERTY(e, EP_PASSABLE)
-#define IS_PLAYER_OVER(e)      HAS_PROPERTY(e, EP_PLAYER_OVER)
-#define IS_PLAYER_INSIDE(e)    HAS_PROPERTY(e, EP_PLAYER_INSIDE)
-#define IS_PLAYER_UNDER(e)     HAS_PROPERTY(e, EP_PLAYER_UNDER)
+#define IS_ACCESSIBLE(e)       HAS_PROPERTY(e, EP_ACCESSIBLE)
 #define IS_DIGGABLE(e)         HAS_PROPERTY(e, EP_DIGGABLE)
 #define IS_COLLECTIBLE(e)      HAS_PROPERTY(e, EP_COLLECTIBLE)
-#define IS_OVER_PLAYER(e)      HAS_PROPERTY(e, EP_OVER_PLAYER)
 #define IS_ACTIVE_BOMB(e)      HAS_PROPERTY(e, EP_ACTIVE_BOMB)
 #define IS_BELT(e)             HAS_PROPERTY(e, EP_BELT)
 #define IS_BELT_ACTIVE(e)      HAS_PROPERTY(e, EP_BELT_ACTIVE)
 
 #define PLAYERINFO(x,y)                (&stored_player[StorePlayer[x][y]-EL_PLAYER_1])
 #define SHIELD_ON(p)           ((p)->shield_normal_time_left > 0)
-#define PROTECTED_FIELD(x,y)   (IS_WALKABLE_THROUGH(Feld[x][y]) &&     \
+#define PROTECTED_FIELD(x,y)   (IS_ACCESSIBLE_INSIDE(Feld[x][y]) &&    \
                                 IS_INDESTRUCTIBLE(Feld[x][y]))
 #define PLAYER_PROTECTED(x,y)  (SHIELD_ON(PLAYERINFO(x, y)) ||         \
                                 PROTECTED_FIELD(x, y))
index f0a2677636c8a7a18f2b576b1b5ba5da96aa89b8..ab66bdf21921c5f72f565bc67fea60ec5f2cafbb 100644 (file)
@@ -749,15 +749,15 @@ void DrawPlayer(struct PlayerInfo *player)
   /* ----------------------------------------------------------------------- */
 
   /* handle the field the player is leaving ... */
-  if (player_is_moving && IS_PLAYER_INSIDE(last_element))
+  if (player_is_moving && IS_ACCESSIBLE_INSIDE(last_element))
     DrawLevelField(last_jx, last_jy);
-  else if (player_is_moving && IS_PLAYER_UNDER(last_element))
+  else if (player_is_moving && IS_ACCESSIBLE_UNDER(last_element))
     DrawLevelFieldThruMask(last_jx, last_jy);
 
   /* ... and the field the player is entering */
-  if (IS_PLAYER_INSIDE(element))
+  if (IS_ACCESSIBLE_INSIDE(element))
     DrawLevelField(jx, jy);
-  else if (IS_PLAYER_UNDER(element))
+  else if (IS_ACCESSIBLE_UNDER(element))
     DrawLevelFieldThruMask(jx, jy);
 
   if (setup.direct_draw)