-#define COMPILE_DATE_STRING "[2003-04-17 10:03]"
+#define COMPILE_DATE_STRING "[2003-04-17 19:21]"
{ 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" },
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");
}
}
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;
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)))
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])
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)
}
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;
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]);
}
else
DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+#endif
}
}
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;
}
}
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;
{
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,
-1
};
- static int ep_passable_through[] =
+ static int ep_passable_inside[] =
{
EL_SP_PORT_LEFT,
EL_SP_PORT_RIGHT,
-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,
{ 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 },
EP_PLAYER,
EP_HAS_CONTENT,
EP_DIGGABLE,
- EP_PASSABLE_THROUGH,
+ EP_PASSABLE_INSIDE,
EP_OVER_PLAYER,
EP_ACTIVE_BOMB,
/* 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
#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))
/* ----------------------------------------------------------------------- */
/* 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)