X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=f5b3ab7b883d783c088bd11a20379611c4fc3a75;hb=ddaae9de458b7f07b05461101655a1da4c63b380;hp=5a859675c607b680a25fdb11b29cedea4ede51ac;hpb=4386c0ac1665619412148f1eb907f6d366a70d7d;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 5a859675..f5b3ab7b 100644 --- a/src/game.c +++ b/src/game.c @@ -1032,6 +1032,7 @@ void InitGame() game.switchgate_pos = 0; game.balloon_dir = MV_NO_MOVING; game.explosions_delayed = TRUE; + game.current_gravity = level.initial_gravity; for (i=0; i<4; i++) { @@ -2215,6 +2216,7 @@ void DynaExplode(int ex, int ey) Explode(x, y, EX_PHASE_START, EX_BORDER); + /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */ if (element != EL_EMPTY && element != EL_SAND && element != EL_EXPLOSION && @@ -2525,14 +2527,16 @@ static int getInvisibleActiveFromInvisibleElement(int element) { return (element == EL_INVISIBLE_STEELWALL ? EL_INVISIBLE_STEELWALL_ACTIVE : element == EL_INVISIBLE_WALL ? EL_INVISIBLE_WALL_ACTIVE : - EL_INVISIBLE_SAND_ACTIVE); + element == EL_INVISIBLE_SAND ? EL_INVISIBLE_SAND_ACTIVE : + element); } static int getInvisibleFromInvisibleActiveElement(int element) { return (element == EL_INVISIBLE_STEELWALL_ACTIVE ? EL_INVISIBLE_STEELWALL : element == EL_INVISIBLE_WALL_ACTIVE ? EL_INVISIBLE_WALL : - EL_INVISIBLE_SAND); + element == EL_INVISIBLE_SAND_ACTIVE ? EL_INVISIBLE_SAND : + element); } static void RedrawAllLightSwitchesAndInvisibleElements() @@ -3843,9 +3847,10 @@ void StartMoving(int x, int y) return; } -#if 0 - GfxAction[x][y] = ACTION_MOVING; -#endif + /* special case of "moving" animation of waiting elements (FIX THIS !!!); + for all other elements GfxAction will be set by InitMovingField() */ + if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY) + GfxAction[x][y] = ACTION_MOVING; } /* now make next step */ @@ -4058,7 +4063,7 @@ void StartMoving(int x, int y) TurnRound(x, y); #if 1 - if (GFX_ELEMENT(element) != EL_SAND) + if (GFX_ELEMENT(element) != EL_SAND) /* !!! FIX THIS (crumble) !!! */ DrawLevelElementAnimation(x, y, element); #else if (element == EL_BUG || @@ -4553,6 +4558,7 @@ void AmoebeAbleger(int ax, int ay) if (!IN_LEV_FIELD(x, y)) return; + /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */ if (IS_FREE(x, y) || Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY) { @@ -4577,6 +4583,7 @@ void AmoebeAbleger(int ax, int ay) if (!IN_LEV_FIELD(x, y)) continue; + /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */ if (IS_FREE(x, y) || Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY) { @@ -4721,6 +4728,7 @@ void Life(int ax, int ay) changed = TRUE; } } + /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */ else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_SAND) { /* free border field */ if (nachbarn >= life[2] && nachbarn <= life[3]) @@ -5810,6 +5818,7 @@ void GameActions() #endif element = Feld[x][y]; + /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */ if (!IS_PLAYER(x,y) && (element == EL_EMPTY || element == EL_SAND || @@ -6079,7 +6088,7 @@ void ScrollLevel(int dx, int dy) static void CheckGravityMovement(struct PlayerInfo *player) { - if (level.gravity && !player->programmed_action) + if (game.current_gravity && !player->programmed_action) { int move_dir_vertical = player->action & (MV_UP | MV_DOWN); int move_dir_horizontal = player->action & (MV_LEFT | MV_RIGHT); @@ -6097,6 +6106,7 @@ static void CheckGravityMovement(struct PlayerInfo *player) (IN_LEV_FIELD(new_jx, new_jy) && (Feld[new_jx][new_jy] == EL_SP_BASE || Feld[new_jx][new_jy] == EL_SAND)); + /* !!! extend EL_SAND to anything diggable !!! */ if (field_under_player_is_free && !player_is_moving_to_valid_field && @@ -7072,6 +7082,12 @@ int DigField(struct PlayerInfo *player, !IS_FREE(nextx, nexty)) return MF_NO_ACTION; + if (element == EL_SP_GRAVITY_PORT_LEFT || + element == EL_SP_GRAVITY_PORT_RIGHT || + element == EL_SP_GRAVITY_PORT_UP || + element == EL_SP_GRAVITY_PORT_DOWN) + game.current_gravity = !game.current_gravity; + /* automatically move to the next field with double speed */ player->programmed_action = move_direction; DOUBLE_PLAYER_SPEED(player);