X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame.c;h=a9c903cceb5bab85072c08f8cb43cf9fcb632eea;hp=2fd57d065386332b48ac485ef92cf707fec8edd2;hb=2fe139696892ee39f804b5c7315b8f0977ab01ec;hpb=12d604d7378a05f91df4b061195a9943f2214da8 diff --git a/src/game.c b/src/game.c index 2fd57d06..a9c903cc 100644 --- a/src/game.c +++ b/src/game.c @@ -394,6 +394,18 @@ static void InitField(int x, int y, boolean init_game) Feld[x][y] = Feld[x][y] - belt_dir_nr + game.belt_dir_nr[belt_nr]; } } + break; + + case EL_SWITCHGATE_SWITCH_2: /* always start with same switch pos */ + if (init_game) + Feld[x][y] = EL_SWITCHGATE_SWITCH_1; + break; + + case EL_LIGHT_SWITCH_ON: + if (init_game) + game.light_time_left = 10 * FRAMES_PER_SECOND; + break; + default: break; } @@ -495,10 +507,12 @@ void InitGame() AllPlayersGone = FALSE; game.magic_wall_active = FALSE; game.magic_wall_time_left = 0; + game.switchgate_pos = 0; + game.light_time_left = 0; for (i=0; i<4; i++) { game.belt_dir[i] = MV_NO_MOVING; - game.belt_dir_nr[i] = 3; /* no moving, next switch left */ + game.belt_dir_nr[i] = 3; /* not moving, next moving left */ } for (i=0; i 0) + { + game.light_time_left--; + + if (game.light_time_left == 0) + { + for (y=0; y= (1000 / GameFrameDelay) && !tape.pausing) { TimeFrames = 0; @@ -4493,6 +4588,7 @@ int DigField(struct PlayerInfo *player, break; case EL_ERDREICH: + case EL_SAND_INVISIBLE: Feld[x][y] = EL_LEERRAUM; PlaySoundLevel(x, y, SND_SCHLURF); break; @@ -4530,6 +4626,11 @@ int DigField(struct PlayerInfo *player, PlaySoundLevel(x, y, SND_PONG); break; + case EL_ENVELOPE: + Feld[x][y] = EL_LEERRAUM; + PlaySoundLevel(x, y, SND_PONG); + break; + case EL_DYNAMITE_INACTIVE: case EL_SP_DISK_RED: RemoveField(x, y); @@ -4669,21 +4770,23 @@ int DigField(struct PlayerInfo *player, if (player->Switching) return MF_ACTION; + player->Switching = TRUE; + game.belt_dir_nr[belt_nr] = belt_dir_nr; game.belt_dir[belt_nr] = belt_dir; if (belt_dir_nr == 3) belt_dir_nr = 1; - player->Switching = TRUE; - for (yy=0; yySwitching) + return MF_ACTION; + + player->Switching = TRUE; + + game.switchgate_pos = !game.switchgate_pos; + + for (yy=0; yySwitching) + return MF_ACTION; + + player->Switching = TRUE; + + game.light_time_left = + (element == EL_LIGHT_SWITCH_OFF ? 10 * FRAMES_PER_SECOND : 0); + + for (yy=0; yy 0) + { + Feld[xx][yy] = EL_LIGHT_SWITCH_ON; + DrawLevelField(xx, yy); + } + else if (element == EL_LIGHT_SWITCH_ON && + game.light_time_left == 0) + { + Feld[xx][yy] = EL_LIGHT_SWITCH_OFF; + DrawLevelField(xx, yy); + } + + if (element == EL_INVISIBLE_STEEL || + element == EL_UNSICHTBAR || + element == EL_SAND_INVISIBLE) + DrawLevelField(xx, yy); + } + } + + return MF_ACTION; + } + break; + case EL_SP_EXIT: if (local_player->gems_still_needed > 0) return MF_NO_ACTION; @@ -4805,6 +4994,18 @@ int DigField(struct PlayerInfo *player, break; + case EL_SWITCHGATE_OPEN: + if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy)) + return MF_NO_ACTION; + + /* automatically move to the next field with double speed */ + player->programmed_action = move_direction; + DOUBLE_PLAYER_SPEED(player); + + PlaySoundLevel(x, y, SND_GATE); + + break; + case EL_SP_PORT1_LEFT: case EL_SP_PORT2_LEFT: case EL_SP_PORT1_RIGHT: