{
if (!tape.playing && !setup.sound_loops)
PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE);
- if (TimeLeft > 0 && !(TimeLeft % 10))
- RaiseScore(level.score[SC_TIME_BONUS]);
- if (TimeLeft > 100 && !(TimeLeft % 10))
+
+ if (TimeLeft > 100 && TimeLeft % 10 == 0)
+ {
TimeLeft -= 10;
+ RaiseScore(level.score[SC_TIME_BONUS] * 10);
+ }
else
+ {
TimeLeft--;
+ RaiseScore(level.score[SC_TIME_BONUS]);
+ }
DrawGameValue_Time(TimeLeft);
{
if (!tape.playing && !setup.sound_loops)
PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE);
- if (TimePlayed < 999 && !(TimePlayed % 10))
- RaiseScore(level.score[SC_TIME_BONUS]);
- if (TimePlayed < 900 && !(TimePlayed % 10))
+
+ if (TimePlayed < 900 && TimePlayed % 10 == 0)
+ {
TimePlayed += 10;
+ RaiseScore(level.score[SC_TIME_BONUS] * 10);
+ }
else
+ {
TimePlayed++;
+ RaiseScore(level.score[SC_TIME_BONUS]);
+ }
DrawGameValue_Time(TimePlayed);
if (!change->has_action)
return;
- /* ---------- determine action paramater values ---------- */
+ /* ---------- determine action paramater values -------------------------- */
+
+ int level_time_value =
+ (level.time > 0 ? TimeLeft :
+ TimePlayed);
int action_arg_element =
(action_arg == CA_ARG_PLAYER_TRIGGER ? change->actual_trigger_player :
action_arg == CA_ARG_NUMBER_CE_VALUE ? ei->custom_value_initial :
#endif
action_arg == CA_ARG_NUMBER_CE_DELAY ? GET_CHANGE_DELAY(change) :
+ action_arg == CA_ARG_NUMBER_LEVEL_TIME ? level_time_value :
+ action_arg == CA_ARG_NUMBER_LEVEL_GEMS ? local_player->gems_still_needed :
+ action_arg == CA_ARG_NUMBER_LEVEL_SCORE ? local_player->score :
action_arg == CA_ARG_ELEMENT_TARGET ? GET_NEW_CUSTOM_VALUE(change->target_element) :
action_arg == CA_ARG_ELEMENT_TRIGGER ? change->actual_trigger_ce_value :
-1);
action_arg == CA_ARG_PLAYER_TRIGGER ? trigger_player_bits :
PLAYER_BITS_ANY);
- /* ---------- execute action ---------- */
+ /* ---------- execute action -------------------------------------------- */
switch(action_type)
{
return;
}
- case CA_EXIT_PLAYER:
+ /* ---------- level actions ------------------------------------------- */
+
+ case CA_RESTART_LEVEL:
{
- for (i = 0; i < MAX_PLAYERS; i++)
- if (action_arg_player_bits & (1 << i))
- stored_player[i].LevelSolved = stored_player[i].GameOver = TRUE;
+ game.restart_level = TRUE;
break;
}
- case CA_KILL_PLAYER:
+ case CA_SHOW_ENVELOPE:
{
- for (i = 0; i < MAX_PLAYERS; i++)
- if (action_arg_player_bits & (1 << i))
- KillPlayer(&stored_player[i]);
+ int element = getSpecialActionElement(action_arg_element,
+ action_arg_number, EL_ENVELOPE_1);
+
+ if (IS_ENVELOPE(element))
+ local_player->show_envelope = element;
+
+ break;
+ }
+
+ case CA_SET_LEVEL_TIME:
+ {
+ if (level.time > 0) /* only modify limited time value */
+ {
+ TimeLeft = action_arg_number_new;
+
+ DrawGameValue_Time(TimeLeft);
+
+ if (!TimeLeft && setup.time_limit)
+ for (i = 0; i < MAX_PLAYERS; i++)
+ KillPlayer(&stored_player[i]);
+ }
+
+ break;
+ }
+
+ case CA_SET_LEVEL_SCORE:
+ {
+ local_player->score = action_arg_number_new;
+
+ DrawGameValue_Score(local_player->score);
+
+ break;
+ }
+
+ case CA_SET_LEVEL_GEMS:
+ {
+ local_player->gems_still_needed = action_arg_number_new;
+
+ DrawGameValue_Emeralds(local_player->gems_still_needed);
+
+ break;
+ }
+
+ case CA_SET_LEVEL_GRAVITY:
+ {
+ game.gravity = (action_arg == CA_ARG_GRAVITY_OFF ? FALSE :
+ action_arg == CA_ARG_GRAVITY_ON ? TRUE :
+ action_arg == CA_ARG_GRAVITY_TOGGLE ? !game.gravity :
+ game.gravity);
+ break;
+ }
+
+ case CA_SET_LEVEL_WIND:
+ {
+ game.wind_direction = action_arg_direction;
break;
}
+ /* ---------- player actions ------------------------------------------ */
+
case CA_MOVE_PLAYER:
{
/* automatically move to the next field in specified direction */
break;
}
- case CA_RESTART_LEVEL:
+ case CA_EXIT_PLAYER:
{
- game.restart_level = TRUE;
+ for (i = 0; i < MAX_PLAYERS; i++)
+ if (action_arg_player_bits & (1 << i))
+ stored_player[i].LevelSolved = stored_player[i].GameOver = TRUE;
break;
}
- case CA_SHOW_ENVELOPE:
+ case CA_KILL_PLAYER:
{
- int element = getSpecialActionElement(action_arg_element,
- action_arg_number, EL_ENVELOPE_1);
-
- if (IS_ENVELOPE(element))
- local_player->show_envelope = element;
+ for (i = 0; i < MAX_PLAYERS; i++)
+ if (action_arg_player_bits & (1 << i))
+ KillPlayer(&stored_player[i]);
break;
}
break;
}
- case CA_SET_LEVEL_GRAVITY:
- {
- game.gravity = (action_arg == CA_ARG_GRAVITY_OFF ? FALSE :
- action_arg == CA_ARG_GRAVITY_ON ? TRUE :
- action_arg == CA_ARG_GRAVITY_TOGGLE ? !game.gravity :
- game.gravity);
- break;
- }
-
- case CA_SET_LEVEL_WIND:
- {
- game.wind_direction = action_arg_direction;
-
- break;
- }
-
- case CA_SET_LEVEL_GEMS:
- {
- local_player->gems_still_needed = action_arg_number_new;
-
- DrawGameValue_Emeralds(local_player->gems_still_needed);
-
- break;
- }
-
- case CA_SET_LEVEL_TIME:
- {
- if (level.time > 0) /* only modify limited time value */
- {
- TimeLeft = action_arg_number_new;
-
- DrawGameValue_Time(TimeLeft);
-
- if (!TimeLeft && setup.time_limit)
- for (i = 0; i < MAX_PLAYERS; i++)
- KillPlayer(&stored_player[i]);
- }
-
- break;
- }
-
- case CA_SET_LEVEL_SCORE:
- {
- local_player->score = action_arg_number_new;
-
- DrawGameValue_Score(local_player->score);
-
- break;
- }
+ /* ---------- CE actions ---------------------------------------------- */
case CA_SET_CE_SCORE:
{
RaiseScore(level.score[SC_SHIELD]);
break;
case EL_EXTRA_TIME:
- RaiseScore(level.score[SC_TIME_BONUS]);
+ RaiseScore(level.extra_time_score);
break;
case EL_KEY_1:
case EL_KEY_2: