From 1c3065c351ef8a8637af5540dea2b39c1d86e80f Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 19 Apr 2003 11:38:58 +0200 Subject: [PATCH] rnd-20030419-1-src --- src/conftime.h | 2 +- src/game.c | 76 ++++++++++++++++++++++++++++++++++++++++---------- src/main.c | 1 + src/main.h | 1 + src/tools.c | 8 +++--- 5 files changed, 69 insertions(+), 19 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 5f436e47..373f0948 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-04-18 23:00]" +#define COMPILE_DATE_STRING "[2003-04-19 11:38]" diff --git a/src/game.c b/src/game.c index 1691c692..aad27578 100644 --- a/src/game.c +++ b/src/game.c @@ -723,7 +723,7 @@ void InitGame() { Feld[x][y] = Ur[x][y]; MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0; - Store[x][y] = Store2[x][y] = StorePlayer[x][y] = 0; + Store[x][y] = Store2[x][y] = StorePlayer[x][y] = Back[x][y] = 0; AmoebaNr[x][y] = 0; JustStopped[x][y] = 0; Stop[x][y] = FALSE; @@ -1433,13 +1433,18 @@ void DrawDynamite(int x, int y) if (!IN_SCR_FIELD(sx, sy) || IS_PLAYER(x, y)) return; - if (Store[x][y]) + if (IS_WALKABLE_INSIDE(Back[x][y])) + return; + + if (Back[x][y]) + DrawGraphic(sx, sy, el2img(Back[x][y]), 0); + else if (Store[x][y]) DrawGraphic(sx, sy, el2img(Store[x][y]), 0); frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]); #if 1 - if (Store[x][y]) + if (Back[x][y] || Store[x][y]) DrawGraphicThruMask(sx, sy, graphic, frame); else DrawGraphic(sx, sy, graphic, frame); @@ -1500,6 +1505,10 @@ void Explode(int ex, int ey, int phase, int mode) { int center_element = Feld[ex][ey]; + /* remove things displayed in background while burnig dynamite */ + if (!IS_INDESTRUCTIBLE(Back[x][y])) + Back[x][y] = 0; + if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey)) { /* put moving element to center field (and let it explode there) */ @@ -1548,17 +1557,24 @@ void Explode(int ex, int ey, int phase, int mode) continue; } +#if 1 + /* save walkable background elements while explosion on same tile */ + if (IS_INDESTRUCTIBLE(element)) + Back[x][y] = element; +#endif + + /* ignite explodable elements reached by other explosion */ if (element == EL_EXPLOSION) element = Store2[x][y]; -#if 1 - if (IS_INDESTRUCTIBLE(Store[x][y])) /* hard element under bomb */ - element = Store[x][y]; +#if 0 + else if (IS_INDESTRUCTIBLE(Store2[x][y])) /* hard element under bomb */ + element = Store2[x][y]; #endif #if 0 - if (!IS_INDESTRUCTIBLE(Store[x][y]) != !IS_PFORTE(Store[x][y])) - printf("\n::: %d\n", Store[x][y]); + else if (IS_INDESTRUCTIBLE(Store[x][y])) /* hard element under bomb */ + element = Store[x][y]; #endif if (IS_PLAYER(ex, ey) && !PLAYER_PROTECTED(ex, ey)) @@ -1583,6 +1599,18 @@ void Explode(int ex, int ey, int phase, int mode) if (game.emulation == EMU_SUPAPLEX) Store[x][y] = EL_EMPTY; } +#if 0 + else if (IS_INDESTRUCTIBLE(Store[x][y])) + ; +#endif +#if 0 + else if (IS_INDESTRUCTIBLE(element)) + Store[x][y] = element; +#endif +#if 0 + else if (IS_INDESTRUCTIBLE(element) && IS_ACCESSIBLE(element)) + Store[x][y] = element; +#endif else if (center_element == EL_MOLE) Store[x][y] = EL_EMERALD_RED; else if (center_element == EL_PENGUIN) @@ -1614,13 +1642,20 @@ void Explode(int ex, int ey, int phase, int mode) else if (element == EL_WALL_CRYSTAL) Store[x][y] = EL_CRYSTAL; #if 1 +#if 0 +#if 0 else if (IS_INDESTRUCTIBLE(element) && IS_ACCESSIBLE(element)) Store[x][y] = element; +#else + else if (IS_INDESTRUCTIBLE(element)) + Store[x][y] = element; +#endif +#endif else Store[x][y] = EL_EMPTY; #else -#if 1 +#if 0 else if (IS_PFORTE(element)) Store[x][y] = element; else @@ -1700,6 +1735,13 @@ void Explode(int ex, int ey, int phase, int mode) element = Feld[x][y] = Store[x][y]; Store[x][y] = Store2[x][y] = 0; + +#if 1 + if (Back[x][y] && IS_INDESTRUCTIBLE(Back[x][y])) + element = Feld[x][y] = Back[x][y]; + Back[x][y] = 0; +#endif + MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0; InitField(x, y, FALSE); if (CAN_MOVE(element) || COULD_MOVE(element)) @@ -1721,17 +1763,17 @@ void Explode(int ex, int ey, int phase, int mode) DrawLevelFieldCrumbledSand(x, y); #if 1 - if (IS_WALKABLE_OVER(Store[x][y])) + if (IS_WALKABLE_OVER(Back[x][y])) { - DrawLevelElement(x, y, Store[x][y]); + DrawLevelElement(x, y, Back[x][y]); DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame); } - else if (IS_WALKABLE_UNDER(Store[x][y])) + else if (IS_WALKABLE_UNDER(Back[x][y])) { DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); - DrawLevelElementThruMask(x, y, Store[x][y]); + DrawLevelElementThruMask(x, y, Back[x][y]); } - else + else if (!IS_WALKABLE_INSIDE(Back[x][y])) DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); #else if (IS_PFORTE(Store[x][y])) @@ -6528,7 +6570,13 @@ boolean PlaceBomb(struct PlayerInfo *player) return FALSE; if (element != EL_EMPTY) + { +#if 0 Store[jx][jy] = element; +#else + Back[jx][jy] = element; +#endif + } MovDelay[jx][jy] = 96; diff --git a/src/main.c b/src/main.c index dcd6301f..836b436f 100644 --- a/src/main.c +++ b/src/main.c @@ -47,6 +47,7 @@ short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; diff --git a/src/main.h b/src/main.h index 6448eb4b..796179bc 100644 --- a/src/main.h +++ b/src/main.h @@ -1203,6 +1203,7 @@ extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; diff --git a/src/tools.c b/src/tools.c index ab66bdf2..5bba1c10 100644 --- a/src/tools.c +++ b/src/tools.c @@ -575,9 +575,9 @@ void DrawPlayer(struct PlayerInfo *player) if (player_is_moving) { - if (Store[last_jx][last_jy] && IS_DRAWABLE(last_element)) + if (Back[last_jx][last_jy] && IS_DRAWABLE(last_element)) { - DrawLevelElement(last_jx, last_jy, Store[last_jx][last_jy]); + DrawLevelElement(last_jx, last_jy, Back[last_jx][last_jy]); if (last_element == EL_DYNAMITE_ACTIVE || last_element == EL_SP_DISK_RED_ACTIVE) @@ -615,8 +615,8 @@ void DrawPlayer(struct PlayerInfo *player) /* draw things behind the player, if needed */ /* ----------------------------------------------------------------------- */ - if (Store[jx][jy]) - DrawLevelElement(jx, jy, Store[jx][jy]); + if (Back[jx][jy]) + DrawLevelElement(jx, jy, Back[jx][jy]); else if (IS_ACTIVE_BOMB(element)) DrawLevelElement(jx, jy, EL_EMPTY); else -- 2.34.1