- case EL_EXTRA_TIME:
- RemoveField(x, y);
- if (level.time > 0)
- {
- TimeLeft += 10;
- DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2);
- }
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundStereo(SND_EXTRA_TIME_COLLECTING, SOUND_MIDDLE);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_SHIELD_NORMAL:
- RemoveField(x, y);
- player->shield_normal_time_left += 10;
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_SHIELD_NORMAL_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_SHIELD_DEADLY:
- RemoveField(x, y);
- player->shield_normal_time_left += 10;
- player->shield_deadly_time_left += 10;
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_SHIELD_DEADLY_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_DYNAMITE:
- case EL_SP_DISK_RED:
- RemoveField(x, y);
- player->dynamite++;
- player->use_disk_red_graphic = (element == EL_SP_DISK_RED);
- RaiseScoreElement(EL_DYNAMITE);
- DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(local_player->dynamite, 3),
- FONT_TEXT_2);
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_DYNABOMB_INCREASE_NUMBER:
- RemoveField(x, y);
- player->dynabomb_count++;
- player->dynabombs_left++;
- RaiseScoreElement(EL_DYNAMITE);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_NUMBER_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_DYNABOMB_INCREASE_SIZE:
- RemoveField(x, y);
- player->dynabomb_size++;
- RaiseScoreElement(EL_DYNAMITE);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_SIZE_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_DYNABOMB_INCREASE_POWER:
- RemoveField(x, y);
- player->dynabomb_xl = TRUE;
- RaiseScoreElement(EL_DYNAMITE);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_POWER_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_KEY_1:
- case EL_KEY_2:
- case EL_KEY_3:
- case EL_KEY_4:
- {
- int key_nr = element - EL_KEY_1;
- int graphic = el2edimg(element);
-
- RemoveField(x, y);
- player->key[key_nr] = TRUE;
- RaiseScoreElement(element);
- DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
- DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_CLASS_KEY_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
- }
-
- case EL_EM_KEY_1:
- case EL_EM_KEY_2:
- case EL_EM_KEY_3:
- case EL_EM_KEY_4:
- {
- int key_nr = element - EL_EM_KEY_1;
- int graphic = el2edimg(EL_KEY_1 + key_nr);
-
- RemoveField(x, y);
- player->key[key_nr] = TRUE;
- RaiseScoreElement(element);
- DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
- DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_CLASS_KEY_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
- }
-
- case EL_ROBOT_WHEEL:
- Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
- ZX = x;
- ZY = y;
- DrawLevelField(x, y);
- PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVATING);
- return MF_ACTION;
- break;
-
- case EL_SP_TERMINAL:
- {
- int xx, yy;
-
- PlaySoundLevel(x, y, SND_SP_TERMINAL_ACTIVATING);
-
- for (yy=0; yy<lev_fieldy; yy++)
- {
- for (xx=0; xx<lev_fieldx; xx++)
- {
- if (Feld[xx][yy] == EL_SP_DISK_YELLOW)
- Bang(xx, yy);
- else if (Feld[xx][yy] == EL_SP_TERMINAL)
- Feld[xx][yy] = EL_SP_TERMINAL_ACTIVE;
- }
- }
-
- return MF_ACTION;
- }
- break;
-
- case EL_CONVEYOR_BELT_1_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_1_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_1_SWITCH_RIGHT:
- case EL_CONVEYOR_BELT_2_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_2_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_2_SWITCH_RIGHT:
- case EL_CONVEYOR_BELT_3_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_3_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_3_SWITCH_RIGHT:
- case EL_CONVEYOR_BELT_4_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_4_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_4_SWITCH_RIGHT:
- if (!player->Switching)
- {
- player->Switching = TRUE;
- ToggleBeltSwitch(x, y);
- PlaySoundLevel(x, y, SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING);
- }
- return MF_ACTION;
- break;
-
- case EL_SWITCHGATE_SWITCH_UP:
- case EL_SWITCHGATE_SWITCH_DOWN:
- if (!player->Switching)
- {
- player->Switching = TRUE;
- ToggleSwitchgateSwitch(x, y);
- PlaySoundLevel(x, y, SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING);
- }
- return MF_ACTION;
- break;
-
- case EL_LIGHT_SWITCH:
- case EL_LIGHT_SWITCH_ACTIVE:
- if (!player->Switching)
- {
- player->Switching = TRUE;
- ToggleLightSwitch(x, y);
- PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
- SND_LIGHT_SWITCH_ACTIVATING :
- SND_LIGHT_SWITCH_DEACTIVATING);
- }
- return MF_ACTION;
- break;
-
- case EL_TIMEGATE_SWITCH:
- ActivateTimegateSwitch(x, y);
- PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVATING);
-
- return MF_ACTION;
- break;
-
- case EL_BALLOON_SWITCH_LEFT:
- case EL_BALLOON_SWITCH_RIGHT:
- case EL_BALLOON_SWITCH_UP:
- case EL_BALLOON_SWITCH_DOWN:
- case EL_BALLOON_SWITCH_ANY:
- if (element == EL_BALLOON_SWITCH_ANY)
- game.balloon_dir = move_direction;
- else
- game.balloon_dir = (element == EL_BALLOON_SWITCH_LEFT ? MV_LEFT :
- element == EL_BALLOON_SWITCH_RIGHT ? MV_RIGHT :
- element == EL_BALLOON_SWITCH_UP ? MV_UP :
- element == EL_BALLOON_SWITCH_DOWN ? MV_DOWN :
- MV_NO_MOVING);
- PlaySoundLevel(x, y, SND_CLASS_BALLOON_SWITCH_ACTIVATING);
-
- return MF_ACTION;
- break;
-
- /* the following elements cannot be pushed by "snapping" */
- case EL_ROCK:
- case EL_BOMB:
- case EL_DX_SUPABOMB:
- case EL_NUT:
- case EL_TIME_ORB_EMPTY:
- case EL_SP_ZONK:
- case EL_SP_DISK_ORANGE:
- case EL_SPRING:
- if (mode == DF_SNAP)
- return MF_NO_ACTION;
-
- /* no "break" -- fall through to next case */
-
- /* the following elements can be pushed by "snapping" */
- case EL_BD_ROCK:
- if (dy)
- return MF_NO_ACTION;
-
- player->Pushing = TRUE;
-
-#if 0
- if (element == EL_ROCK)
- printf("::: wanna push [%d] [%d]\n",
- FrameCounter, player->push_delay_value);
-#endif
-
- if (!IN_LEV_FIELD(x+dx, y+dy) || !IS_FREE(x+dx, y+dy))
- return MF_NO_ACTION;
-
- if (!checkDiagonalPushing(player, x, y, real_dx, real_dy))
- return MF_NO_ACTION;
-
- if (player->push_delay == 0)
- player->push_delay = FrameCounter;
-#if 0
- if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !tape.playing &&
- element != EL_SPRING)
- return MF_NO_ACTION;
-#else
- if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !(tape.playing && tape.file_version < FILE_VERSION_2_0) &&
- element != EL_SPRING)
- return MF_NO_ACTION;
-#endif
-
- if (mode == DF_SNAP)
- {
- InitMovingField(x, y, move_direction);
- ContinueMoving(x, y);
- }
- else
- {
- RemoveField(x, y);
- Feld[x + dx][y + dy] = element;
- }
-
- if (element == EL_SPRING)
- {
- Feld[x + dx][y + dy] = EL_SPRING;
- MovDir[x + dx][y + dy] = move_direction;
- }
-
- player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8));
-
- DrawLevelField(x + dx, y + dy);
- PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
- break;
-
- case EL_GATE_1:
- case EL_GATE_2:
- case EL_GATE_3:
- case EL_GATE_4:
- if (!player->key[element - EL_GATE_1])
- return MF_NO_ACTION;
- break;
-
- case EL_GATE_1_GRAY:
- case EL_GATE_2_GRAY:
- case EL_GATE_3_GRAY:
- case EL_GATE_4_GRAY:
- if (!player->key[element - EL_GATE_1_GRAY])
- return MF_NO_ACTION;
- break;
-
- case EL_EM_GATE_1:
- case EL_EM_GATE_2:
- case EL_EM_GATE_3:
- case EL_EM_GATE_4:
- if (!player->key[element - EL_EM_GATE_1])
- return MF_NO_ACTION;
- 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_CLASS_GATE_PASSING);
- break;
-
- case EL_EM_GATE_1_GRAY:
- case EL_EM_GATE_2_GRAY:
- case EL_EM_GATE_3_GRAY:
- case EL_EM_GATE_4_GRAY:
- if (!player->key[element - EL_EM_GATE_1_GRAY])
- return MF_NO_ACTION;
- 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);
-
-#if 1
- PlaySoundLevelAction(x, y, ACTION_PASSING);
-#else
- PlaySoundLevel(x, y, SND_GATE_PASSING);
-#endif
- break;
-
- case EL_SWITCHGATE_OPEN:
- case EL_TIMEGATE_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);
-
- PlaySoundLevelElementAction(x, y, element, ACTION_PASSING);
- break;
-
- case EL_SP_PORT_LEFT:
- case EL_SP_PORT_RIGHT:
- case EL_SP_PORT_UP:
- case EL_SP_PORT_DOWN:
- case EL_SP_PORT_HORIZONTAL:
- case EL_SP_PORT_VERTICAL:
- case EL_SP_PORT_ANY:
- case EL_SP_GRAVITY_PORT_LEFT:
- case EL_SP_GRAVITY_PORT_RIGHT:
- case EL_SP_GRAVITY_PORT_UP:
- case EL_SP_GRAVITY_PORT_DOWN:
- if ((dx == -1 &&
- element != EL_SP_PORT_LEFT &&
- element != EL_SP_GRAVITY_PORT_LEFT &&
- element != EL_SP_PORT_HORIZONTAL &&
- element != EL_SP_PORT_ANY) ||
- (dx == +1 &&
- element != EL_SP_PORT_RIGHT &&
- element != EL_SP_GRAVITY_PORT_RIGHT &&
- element != EL_SP_PORT_HORIZONTAL &&
- element != EL_SP_PORT_ANY) ||
- (dy == -1 &&
- element != EL_SP_PORT_UP &&
- element != EL_SP_GRAVITY_PORT_UP &&
- element != EL_SP_PORT_VERTICAL &&
- element != EL_SP_PORT_ANY) ||
- (dy == +1 &&
- element != EL_SP_PORT_DOWN &&
- element != EL_SP_GRAVITY_PORT_DOWN &&
- element != EL_SP_PORT_VERTICAL &&
- element != EL_SP_PORT_ANY) ||
- !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_CLASS_SP_PORT_PASSING);
- break;
-
- case EL_TUBE_ANY:
- case EL_TUBE_VERTICAL:
- case EL_TUBE_HORIZONTAL:
- case EL_TUBE_VERTICAL_LEFT:
- case EL_TUBE_VERTICAL_RIGHT:
- case EL_TUBE_HORIZONTAL_UP:
- case EL_TUBE_HORIZONTAL_DOWN:
- case EL_TUBE_LEFT_UP:
- case EL_TUBE_LEFT_DOWN:
- case EL_TUBE_RIGHT_UP:
- case EL_TUBE_RIGHT_DOWN: