{
{ CE_TOUCHED_BY_PLAYER, "touched by player ..." },
{ CE_PRESSED_BY_PLAYER, "pressed by player ..." },
- { CE_SWITCHED_BY_PLAYER, "switched by player ..." },
{ CE_PUSHED_BY_PLAYER, "pushed by player ..." },
{ CE_ENTERED_BY_PLAYER, "entered by player ..." },
{ CE_LEFT_BY_PLAYER, "left by player ..." },
{ CE_DROPPED_BY_PLAYER, "dropped by player" },
+ { CE_SWITCHED, "switched ..." },
{ CE_COLLISION, "collision ..." },
{ CE_IMPACT, "impact" },
{ CE_SMASHED, "smashed" },
{
{ CE_OTHER_GETS_TOUCHED, "player touches ..." },
{ CE_OTHER_GETS_PRESSED, "player presses ..." },
- { CE_OTHER_GETS_SWITCHED, "player switches ..." },
{ CE_OTHER_GETS_PUSHED, "player pushes ..." },
{ CE_OTHER_GETS_ENTERED, "player enters ..." },
{ CE_OTHER_GETS_LEFT, "player leaves ..." },
{ CE_OTHER_GETS_COLLECTED, "player collects" },
{ CE_OTHER_GETS_DROPPED, "player drops" },
{ CE_OTHER_IS_TOUCHING, "touching ..." },
+ { CE_OTHER_IS_SWITCHING, "switch of ..." },
{ CE_OTHER_IS_CHANGING, "change of" },
{ CE_OTHER_IS_EXPLODING, "explosion of" },
{ -1, NULL }
custom_element_change.direct_action =
(HAS_CHANGE_EVENT(element, CE_TOUCHED_BY_PLAYER) ? CE_TOUCHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PRESSED_BY_PLAYER) ? CE_PRESSED_BY_PLAYER :
- HAS_CHANGE_EVENT(element, CE_SWITCHED_BY_PLAYER) ? CE_SWITCHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PUSHED_BY_PLAYER) ? CE_PUSHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_ENTERED_BY_PLAYER) ? CE_ENTERED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_LEFT_BY_PLAYER) ? CE_LEFT_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_DROPPED_BY_PLAYER) ? CE_DROPPED_BY_PLAYER :
+ HAS_CHANGE_EVENT(element, CE_SWITCHED) ? CE_SWITCHED :
HAS_CHANGE_EVENT(element, CE_COLLISION) ? CE_COLLISION :
HAS_CHANGE_EVENT(element, CE_IMPACT) ? CE_IMPACT :
HAS_CHANGE_EVENT(element, CE_SMASHED) ? CE_SMASHED :
custom_element_change.other_action =
(HAS_CHANGE_EVENT(element, CE_OTHER_GETS_TOUCHED) ? CE_OTHER_GETS_TOUCHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_PRESSED) ? CE_OTHER_GETS_PRESSED :
- HAS_CHANGE_EVENT(element, CE_OTHER_GETS_SWITCHED) ? CE_OTHER_GETS_SWITCHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_PUSHED) ? CE_OTHER_GETS_PUSHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_ENTERED) ? CE_OTHER_GETS_ENTERED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_LEFT) ? CE_OTHER_GETS_LEFT :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_COLLECTED) ? CE_OTHER_GETS_COLLECTED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_DROPPED) ? CE_OTHER_GETS_DROPPED :
HAS_CHANGE_EVENT(element, CE_OTHER_IS_TOUCHING) ? CE_OTHER_IS_TOUCHING :
+ HAS_CHANGE_EVENT(element, CE_OTHER_IS_SWITCHING) ? CE_OTHER_IS_SWITCHING :
HAS_CHANGE_EVENT(element, CE_OTHER_IS_CHANGING) ? CE_OTHER_IS_CHANGING :
HAS_CHANGE_EVENT(element, CE_OTHER_IS_EXPLODING) ? CE_OTHER_IS_EXPLODING :
custom_element_change.other_action);
/* set player change event from checkbox and selectbox */
custom_element_change_events[CE_TOUCHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PRESSED_BY_PLAYER] = FALSE;
- custom_element_change_events[CE_SWITCHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PUSHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_ENTERED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_LEFT_BY_PLAYER] = FALSE;
custom_element_change_events[CE_DROPPED_BY_PLAYER] = FALSE;
+ custom_element_change_events[CE_SWITCHED] = FALSE;
custom_element_change_events[CE_COLLISION] = FALSE;
custom_element_change_events[CE_IMPACT] = FALSE;
custom_element_change_events[CE_SMASHED] = FALSE;
/* set other element action change event from checkbox and selectbox */
custom_element_change_events[CE_OTHER_GETS_TOUCHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_PRESSED] = FALSE;
- custom_element_change_events[CE_OTHER_GETS_SWITCHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_PUSHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_ENTERED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_LEFT] = FALSE;
custom_element_change_events[CE_OTHER_GETS_COLLECTED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_DROPPED] = FALSE;
custom_element_change_events[CE_OTHER_IS_TOUCHING] = FALSE;
+ custom_element_change_events[CE_OTHER_IS_SWITCHING] = FALSE;
custom_element_change_events[CE_OTHER_IS_CHANGING] = FALSE;
custom_element_change_events[CE_OTHER_IS_EXPLODING] = FALSE;
custom_element_change_events[custom_element_change.other_action] =
player->Frame = 0;
player->StepFrame = 0;
+ player->switch_x = -1;
+ player->switch_y = -1;
+
player->use_murphy_graphic = FALSE;
player->use_disk_red_graphic = FALSE;
else
{
CheckElementChange(x, y + 1, smashed, CE_SMASHED);
+
+ CheckTriggeredElementSideChange(x, y + 1, smashed, CH_SIDE_TOP,
+ CE_OTHER_IS_SWITCHING);
+ CheckElementSideChange(x, y + 1, smashed, CH_SIDE_TOP,
+ CE_SWITCHED, -1);
}
}
else
switch (element)
{
+#if 0
case EL_ROBOT_WHEEL:
Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
ZX = x;
PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVATING);
return MF_ACTION;
break;
+#endif
+#if 0
case EL_SP_TERMINAL:
{
int xx, yy;
return MF_ACTION;
}
break;
+#endif
+#if 0
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_4_SWITCH_LEFT:
case EL_CONVEYOR_BELT_4_SWITCH_MIDDLE:
case EL_CONVEYOR_BELT_4_SWITCH_RIGHT:
+#if 1
+ if (!PLAYER_SWITCHING(player, x, y))
+#else
if (!player->Switching)
+#endif
{
player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
ToggleBeltSwitch(x, y);
PlaySoundLevel(x, y, SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING);
}
return MF_ACTION;
break;
+#endif
+#if 0
case EL_SWITCHGATE_SWITCH_UP:
case EL_SWITCHGATE_SWITCH_DOWN:
+#if 1
+ if (!PLAYER_SWITCHING(player, x, y))
+#else
if (!player->Switching)
+#endif
{
player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
ToggleSwitchgateSwitch(x, y);
PlaySoundLevel(x, y, SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING);
}
return MF_ACTION;
break;
+#endif
+#if 0
case EL_LIGHT_SWITCH:
case EL_LIGHT_SWITCH_ACTIVE:
+#if 1
+ if (!PLAYER_SWITCHING(player, x, y))
+#else
if (!player->Switching)
+#endif
{
player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
ToggleLightSwitch(x, y);
PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
SND_LIGHT_SWITCH_ACTIVATING :
}
return MF_ACTION;
break;
+#endif
+#if 0
case EL_TIMEGATE_SWITCH:
ActivateTimegateSwitch(x, y);
PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVATING);
return MF_ACTION;
break;
+#endif
+#if 0
case EL_BALLOON_SWITCH_LEFT:
case EL_BALLOON_SWITCH_RIGHT:
case EL_BALLOON_SWITCH_UP:
return MF_ACTION;
break;
+#endif
case EL_SP_PORT_LEFT:
case EL_SP_PORT_RIGHT:
}
break;
+#if 0
case EL_LAMP:
Feld[x][y] = EL_LAMP_ACTIVE;
local_player->lights_still_needed--;
PlaySoundLevel(x, y, SND_LAMP_ACTIVATING);
return MF_ACTION;
break;
+#endif
+#if 0
case EL_TIME_ORB_FULL:
Feld[x][y] = EL_TIME_ORB_EMPTY;
TimeLeft += 10;
PlaySoundStereo(SND_TIME_ORB_FULL_COLLECTING, SOUND_MIDDLE);
return MF_ACTION;
break;
+#endif
default:
break;
}
- else
+ else if (IS_SWITCHABLE(element))
{
+ if (PLAYER_SWITCHING(player, x, y))
+ return MF_ACTION;
+
#if 1
+ PlaySoundLevelElementAction(x, y, element, ACTION_ACTIVATING);
+#endif
+
+ if (element == EL_ROBOT_WHEEL)
+ {
+ Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
+ ZX = x;
+ ZY = y;
+
+ DrawLevelField(x, y);
+
+#if 0
+ PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVATING);
+#endif
+ }
+ else if (element == EL_SP_TERMINAL)
+ {
+ int xx, yy;
+
+#if 0
+ PlaySoundLevel(x, y, SND_SP_TERMINAL_ACTIVATING);
+#endif
+
+ 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;
+ }
+ }
+ }
+ else if (IS_BELT_SWITCH(element))
+ {
+#if 0
+ if (!PLAYER_SWITCHING(player, x, y))
+#endif
+ {
+ player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
+ ToggleBeltSwitch(x, y);
+
+#if 0
+ PlaySoundLevel(x, y, SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING);
+#endif
+ }
+ }
+ else if (element == EL_SWITCHGATE_SWITCH_UP ||
+ element == EL_SWITCHGATE_SWITCH_DOWN)
+ {
+#if 0
+ if (!PLAYER_SWITCHING(player, x, y))
+#endif
+ {
+ player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
+ ToggleSwitchgateSwitch(x, y);
+
+#if 0
+ PlaySoundLevel(x, y, SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING);
+#endif
+ }
+ }
+ else if (element == EL_LIGHT_SWITCH ||
+ element == EL_LIGHT_SWITCH_ACTIVE)
+ {
+#if 0
+ if (!PLAYER_SWITCHING(player, x, y))
+#endif
+ {
+ player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
+ ToggleLightSwitch(x, y);
+
+#if 0
+ PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
+ SND_LIGHT_SWITCH_ACTIVATING :
+ SND_LIGHT_SWITCH_DEACTIVATING);
+#endif
+ }
+ }
+ else if (element == EL_TIMEGATE_SWITCH)
+ {
+ ActivateTimegateSwitch(x, y);
+
+#if 0
+ PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVATING);
+#endif
+ }
+ else if (element == EL_BALLOON_SWITCH_LEFT ||
+ element == EL_BALLOON_SWITCH_RIGHT ||
+ element == EL_BALLOON_SWITCH_UP ||
+ element == EL_BALLOON_SWITCH_DOWN ||
+ element == 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);
+#if 0
+ PlaySoundLevel(x, y, SND_CLASS_BALLOON_SWITCH_ACTIVATING);
+#endif
+ }
+ else if (element == EL_LAMP)
+ {
+ Feld[x][y] = EL_LAMP_ACTIVE;
+ local_player->lights_still_needed--;
+
+ DrawLevelField(x, y);
+
+#if 0
+ PlaySoundLevel(x, y, SND_LAMP_ACTIVATING);
+#endif
+ }
+ else if (element == EL_TIME_ORB_FULL)
+ {
+ Feld[x][y] = EL_TIME_ORB_EMPTY;
+ TimeLeft += 10;
+ DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2);
+
+ DrawLevelField(x, y);
+
+#if 0
+ PlaySoundStereo(SND_TIME_ORB_FULL_COLLECTING, SOUND_MIDDLE);
+#endif
+ }
+
+ return MF_ACTION;
+ }
+ else
+ {
#if 1
+ if (!PLAYER_SWITCHING(player, x, y))
+#else
if (!player->Switching)
+#endif
{
player->Switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
CheckTriggeredElementSideChange(x, y, element, dig_side,
- CE_OTHER_GETS_SWITCHED);
- CheckElementSideChange(x, y, element, dig_side,
- CE_SWITCHED_BY_PLAYER, -1);
+ CE_OTHER_IS_SWITCHING);
+ CheckElementSideChange(x, y, element, dig_side, CE_SWITCHED, -1);
}
-#endif
CheckTriggeredElementSideChange(x, y, element, dig_side,
CE_OTHER_GETS_PRESSED);
CheckElementSideChange(x, y, element, dig_side,
CE_PRESSED_BY_PLAYER, -1);
-#else
- CheckTriggeredElementChange(x, y, element, CE_OTHER_GETS_PRESSED);
- CheckElementChange(x, y, element, CE_PRESSED_BY_PLAYER);
-#endif
}
return MF_NO_ACTION;