From: Holger Schemel Date: Sat, 20 Jan 2001 17:38:03 +0000 (+0100) Subject: rnd-20010120-2-src X-Git-Tag: 2.0.1^2~28 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=6269ea8e89e9dea338b286bc6cb3a48388a43ad7;p=rocksndiamonds.git rnd-20010120-2-src --- diff --git a/src/game.c b/src/game.c index 07c8a77c..af833f15 100644 --- a/src/game.c +++ b/src/game.c @@ -1196,9 +1196,13 @@ void RemoveMovingField(int x, int y) return; } - if (Feld[x][y] == EL_BLOCKED && - (Store[oldx][oldy] == EL_MORAST_LEER || - Store[oldx][oldy] == EL_MAGIC_WALL_EMPTY || + if (Feld[x][y] == EL_BLOCKED && Feld[oldx][oldy] == EL_QUICKSAND_EMPTYING) + { + Feld[oldx][oldy] = EL_MORAST_LEER; + Store[oldx][oldy] = Store2[oldx][oldy] = 0; + } + else if (Feld[x][y] == EL_BLOCKED && + (Store[oldx][oldy] == EL_MAGIC_WALL_EMPTY || Store[oldx][oldy] == EL_MAGIC_WALL_BD_EMPTY || Store[oldx][oldy] == EL_AMOEBE_NASS)) { @@ -2455,8 +2459,8 @@ void StartMoving(int x, int y) if (IS_FREE(x, y+1)) { InitMovingField(x, y, MV_DOWN); - Feld[x][y] = EL_FELSBROCKEN; - Store[x][y] = EL_MORAST_LEER; + Feld[x][y] = EL_QUICKSAND_EMPTYING; + Store[x][y] = EL_FELSBROCKEN; } else if (Feld[x][y+1] == EL_MORAST_LEER) { @@ -2472,13 +2476,16 @@ void StartMoving(int x, int y) Feld[x][y] = EL_MORAST_LEER; Feld[x][y+1] = EL_MORAST_VOLL; + Store[x][y+1] = Store[x][y]; + Store[x][y] = 0; } } else if ((element == EL_FELSBROCKEN || element == EL_BD_ROCK) && Feld[x][y+1] == EL_MORAST_LEER) { InitMovingField(x, y, MV_DOWN); - Store[x][y] = EL_MORAST_VOLL; + Feld[x][y] = EL_QUICKSAND_FILLING; + Store[x][y] = element; } else if (element == EL_MAGIC_WALL_FULL) { @@ -2565,12 +2572,18 @@ void StartMoving(int x, int y) /* Store[x][y+1] must be zero, because: (EL_MORAST_VOLL -> EL_FELSBROCKEN): Store[x][y+1] == EL_MORAST_LEER */ +#if 0 #if OLD_GAME_BEHAVIOUR else if (IS_SLIPPERY(Feld[x][y+1]) && !Store[x][y+1]) #else else if (IS_SLIPPERY(Feld[x][y+1]) && !Store[x][y+1] && !IS_FALLING(x, y+1) && !JustStopped[x][y+1] && element != EL_DX_SUPABOMB) +#endif +#else + else if (IS_SLIPPERY(Feld[x][y+1]) && + !IS_FALLING(x, y+1) && !JustStopped[x][y+1] && + element != EL_DX_SUPABOMB) #endif { boolean left = (x>0 && IS_FREE(x-1, y) && @@ -2929,7 +2942,7 @@ void ContinueMoving(int x, int y) if (element == EL_TROPFEN) step /= 2; - else if (Store[x][y] == EL_MORAST_VOLL || Store[x][y] == EL_MORAST_LEER) + else if (element == EL_QUICKSAND_FILLING || element == EL_QUICKSAND_EMPTYING) step /= 4; else if (CAN_FALL(element) && horiz_move && y < lev_fieldy-1 && IS_BELT(Feld[x][y+1])) @@ -2975,16 +2988,17 @@ void ContinueMoving(int x, int y) } } - if (Store[x][y] == EL_MORAST_VOLL) + if (element == EL_QUICKSAND_FILLING) { + element = Feld[newx][newy] = EL_MORAST_VOLL; + Store[newx][newy] = Store[x][y]; Store[x][y] = 0; - Feld[newx][newy] = EL_MORAST_VOLL; - element = EL_MORAST_VOLL; } - else if (Store[x][y] == EL_MORAST_LEER) + else if (element == EL_QUICKSAND_EMPTYING) { - Store[x][y] = 0; Feld[x][y] = EL_MORAST_LEER; + element = Feld[newx][newy] = Store[x][y]; + Store[x][y] = 0; } else if (Store[x][y] == EL_MAGIC_WALL_FULL) { diff --git a/src/init.c b/src/init.c index 45817f5b..a2cae6bc 100644 --- a/src/init.c +++ b/src/init.c @@ -574,7 +574,7 @@ void InitElementProperties() EL_MORAST_VOLL, EL_MORAST_LEER, EL_QUICKSAND_FILLING, - EL_QUICKSAND_DROPPING, + EL_QUICKSAND_EMPTYING, EL_MAGIC_WALL_OFF, EL_MAGIC_WALL_EMPTY, EL_MAGIC_WALL_FULL, diff --git a/src/main.h b/src/main.h index 9239810f..4e68b379 100644 --- a/src/main.h +++ b/src/main.h @@ -908,7 +908,7 @@ extern int num_element_info; #define EL_SPRING_MOVING 523 #define EL_SP_MURPHY_CLONE 524 #define EL_QUICKSAND_FILLING 525 -#define EL_QUICKSAND_DROPPING 526 +#define EL_QUICKSAND_EMPTYING 526 /* "unreal" (and therefore not drawable) runtime elements */ #define EL_BLOCKED 600 diff --git a/src/tools.c b/src/tools.c index aafd430e..f7a67afb 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1336,7 +1336,7 @@ void DrawLevelElement(int x, int y, int element) void DrawScreenField(int x, int y) { int ux = LEVELX(x), uy = LEVELY(y); - int element; + int element, content; if (!IN_LEV_FIELD(ux, uy)) { @@ -1350,33 +1350,44 @@ void DrawScreenField(int x, int y) } element = Feld[ux][uy]; + content = Store[ux][uy]; if (IS_MOVING(ux, uy)) { int horiz_move = (MovDir[ux][uy] == MV_LEFT || MovDir[ux][uy] == MV_RIGHT); boolean cut_mode = NO_CUTTING; - if (Store[ux][uy] == EL_MORAST_LEER || - Store[ux][uy] == EL_MAGIC_WALL_EMPTY || - Store[ux][uy] == EL_MAGIC_WALL_BD_EMPTY || - Store[ux][uy] == EL_AMOEBE_NASS) + if (element == EL_QUICKSAND_EMPTYING || + content == EL_MAGIC_WALL_EMPTY || + content == EL_MAGIC_WALL_BD_EMPTY || + content == EL_AMOEBE_NASS) cut_mode = CUT_ABOVE; - else if (Store[ux][uy] == EL_MORAST_VOLL || - Store[ux][uy] == EL_MAGIC_WALL_FULL || - Store[ux][uy] == EL_MAGIC_WALL_BD_FULL) + else if (element == EL_QUICKSAND_FILLING || + content == EL_MAGIC_WALL_FULL || + content == EL_MAGIC_WALL_BD_FULL) cut_mode = CUT_BELOW; if (cut_mode == CUT_ABOVE) - DrawScreenElementShifted(x, y, 0, 0, Store[ux][uy], NO_CUTTING); + { + if (element == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING); + else + DrawScreenElementShifted(x, y, 0, 0, content, NO_CUTTING); + } else DrawScreenElement(x, y, EL_LEERRAUM); if (horiz_move) DrawScreenElementShifted(x, y, MovPos[ux][uy], 0, element, NO_CUTTING); else - DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + { + if (element == EL_QUICKSAND_FILLING || element == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], content, cut_mode); + else + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + } - if (Store[ux][uy] == EL_SALZSAEURE) + if (content == EL_SALZSAEURE) DrawLevelElementThruMask(ux, uy + 1, EL_SALZSAEURE); } else if (IS_BLOCKED(ux, uy)) @@ -1385,6 +1396,7 @@ void DrawScreenField(int x, int y) int sx, sy; int horiz_move; boolean cut_mode = NO_CUTTING; + int element_old, content_old; Blocked2Moving(ux, uy, &oldx, &oldy); sx = SCREENX(oldx); @@ -1392,19 +1404,29 @@ void DrawScreenField(int x, int y) horiz_move = (MovDir[oldx][oldy] == MV_LEFT || MovDir[oldx][oldy] == MV_RIGHT); - if (Store[oldx][oldy] == EL_MORAST_LEER || - Store[oldx][oldy] == EL_MAGIC_WALL_EMPTY || - Store[oldx][oldy] == EL_MAGIC_WALL_BD_EMPTY || - Store[oldx][oldy] == EL_AMOEBE_NASS) + element_old = Feld[oldx][oldy]; + content_old = Store[oldx][oldy]; + + if (element_old == EL_QUICKSAND_EMPTYING || + content_old == EL_MAGIC_WALL_EMPTY || + content_old == EL_MAGIC_WALL_BD_EMPTY || + content_old == EL_AMOEBE_NASS) cut_mode = CUT_ABOVE; DrawScreenElement(x, y, EL_LEERRAUM); - element = Feld[oldx][oldy]; if (horiz_move) - DrawScreenElementShifted(sx,sy, MovPos[oldx][oldy],0,element,NO_CUTTING); + DrawScreenElementShifted(sx, sy, MovPos[oldx][oldy], 0, element_old, + NO_CUTTING); else - DrawScreenElementShifted(sx,sy, 0,MovPos[oldx][oldy],element,cut_mode); + { + if (element_old == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], content_old, + cut_mode); + else + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], element_old, + cut_mode); + } } else if (IS_DRAWABLE(element)) DrawScreenElement(x, y, element); @@ -2388,6 +2410,7 @@ int el2gfx(int element) case EL_DIAMANT: return GFX_DIAMANT; case EL_MORAST_LEER: return GFX_MORAST_LEER; case EL_MORAST_VOLL: return GFX_MORAST_VOLL; + case EL_QUICKSAND_EMPTYING: return GFX_MORAST_LEER; case EL_TROPFEN: return GFX_TROPFEN; case EL_BOMBE: return GFX_BOMBE; case EL_MAGIC_WALL_OFF: return GFX_MAGIC_WALL_OFF;