From: Holger Schemel Date: Thu, 17 Apr 2003 17:26:33 +0000 (+0200) Subject: rnd-20030417-3-src X-Git-Tag: 3.0.0^2~93 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=72e44014938c9042261b67213a6cd37b7a17488f;p=rocksndiamonds.git rnd-20030417-3-src --- diff --git a/src/conftime.h b/src/conftime.h index bf53cc54..735034f6 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-04-17 10:03]" +#define COMPILE_DATE_STRING "[2003-04-17 19:21]" diff --git a/src/editor.c b/src/editor.c index df3db706..41c17e20 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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" }, diff --git a/src/events.c b/src/events.c index ffe1d4f0..1f78e6b2 100644 --- a/src/events.c +++ b/src/events.c @@ -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"); } } diff --git a/src/game.c b/src/game.c index fb479b0e..bf1000db 100644 --- a/src/game.c +++ b/src/game.c @@ -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; diff --git a/src/init.c b/src/init.c index 34d4ef14..5a16867b 100644 --- a/src/init.c +++ b/src/init.c @@ -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; ishield_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)) diff --git a/src/tools.c b/src/tools.c index f0a26776..ab66bdf2 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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)