#define SND_CLASS_DEFAULT_SNAPPING 2
#define SND_CLASS_DEFAULT_PUSHING 3
#define SND_CLASS_DEFAULT_IMPACT 4
-#define SND_CLASS_DEFAULT_PASSING 5
-#define SND_CLASS_DEFAULT_DYING 6
-#define SND_CLASS_DEFAULT_EXPLODING 7
-#define SND_CLASS_SP_DEFAULT_EXPLODING 8
-#define SND_BD_DIAMOND_COLLECTING 9
-#define SND_BD_DIAMOND_IMPACT 10
-#define SND_BD_ROCK_PUSHING 11
-#define SND_BD_ROCK_IMPACT 12
-#define SND_BD_MAGIC_WALL_ACTIVATING 13
-#define SND_BD_MAGIC_WALL_ACTIVE 14
-#define SND_BD_MAGIC_WALL_FILLING 15
-#define SND_BD_AMOEBA_WAITING 16
-#define SND_BD_AMOEBA_GROWING 17
-#define SND_BD_AMOEBA_TURNING_TO_GEM 18
-#define SND_BD_AMOEBA_TURNING_TO_ROCK 19
-#define SND_BD_BUTTERFLY_MOVING 20
-#define SND_BD_BUTTERFLY_WAITING 21
-#define SND_BD_FIREFLY_MOVING 22
-#define SND_BD_FIREFLY_WAITING 23
-#define SND_SP_BASE_DIGGING 24
-#define SND_SP_BUGGY_BASE_DIGGING 25
-#define SND_SP_BUGGY_BASE_ACTIVE 26
-#define SND_SP_INFOTRON_COLLECTING 27
-#define SND_SP_INFOTRON_IMPACT 28
-#define SND_SP_ZONK_PUSHING 29
-#define SND_SP_ZONK_IMPACT 30
-#define SND_SP_DISK_RED_COLLECTING 31
-#define SND_SP_DISK_ORANGE_PUSHING 32
-#define SND_SP_DISK_YELLOW_PUSHING 33
-#define SND_CLASS_SP_PORT_PASSING 34
-#define SND_CLASS_SP_EXIT_PASSING 35
-#define SND_CLASS_SP_EXIT_OPENING 36
-#define SND_SP_SNIKSNAK_MOVING 37
-#define SND_SP_SNIKSNAK_WAITING 38
-#define SND_SP_ELECTRON_MOVING 39
-#define SND_SP_ELECTRON_WAITING 40
-#define SND_SP_TERMINAL_ACTIVATING 41
-#define SND_SP_TERMINAL_ACTIVE 42
-#define SND_CLASS_SOKOBAN_PUSHING 43
-#define SND_CLASS_SOKOBAN_FILLING 44
-#define SND_CLASS_SOKOBAN_EMPTYING 45
-#define SND_CLASS_PLAYER_MOVING 46
-#define SND_SAND_DIGGING 47
-#define SND_EMERALD_COLLECTING 48
-#define SND_EMERALD_IMPACT 49
-#define SND_DIAMOND_COLLECTING 50
-#define SND_DIAMOND_IMPACT 51
-#define SND_DIAMOND_BREAKING 52
-#define SND_ROCK_PUSHING 53
-#define SND_ROCK_IMPACT 54
-#define SND_BOMB_PUSHING 55
-#define SND_NUT_PUSHING 56
-#define SND_NUT_BREAKING 57
-#define SND_NUT_IMPACT 58
-#define SND_CLASS_DYNAMITE_COLLECTING 59
-#define SND_CLASS_DYNAMITE_DROPPING 60
-#define SND_CLASS_DYNAMITE_ACTIVE 61
-#define SND_CLASS_KEY_COLLECTING 62
-#define SND_CLASS_GATE_PASSING 63
-#define SND_BUG_MOVING 64
-#define SND_BUG_WAITING 65
-#define SND_SPACESHIP_MOVING 66
-#define SND_SPACESHIP_WAITING 67
-#define SND_YAMYAM_MOVING 68
-#define SND_YAMYAM_WAITING 69
-#define SND_YAMYAM_DIGGING 70
-#define SND_ROBOT_MOVING 71
-#define SND_ROBOT_WAITING 72
-#define SND_ROBOT_WHEEL_ACTIVATING 73
-#define SND_ROBOT_WHEEL_ACTIVE 74
-#define SND_MAGIC_WALL_ACTIVATING 75
-#define SND_MAGIC_WALL_ACTIVE 76
-#define SND_MAGIC_WALL_FILLING 77
-#define SND_CLASS_AMOEBA_WAITING 78
-#define SND_CLASS_AMOEBA_GROWING 79
-#define SND_CLASS_AMOEBA_DROPPING 80
-#define SND_ACID_SPLASHING 81
-#define SND_CLASS_QUICKSAND_FILLING 82
-#define SND_CLASS_QUICKSAND_EMPTYING 83
-#define SND_CLASS_EXIT_OPENING 84
-#define SND_CLASS_EXIT_PASSING 85
-#define SND_PENGUIN_PASSING 86
-#define SND_BALLOON_MOVING 87
-#define SND_BALLOON_WAITING 88
-#define SND_BALLOON_PUSHING 89
-#define SND_CLASS_BALLOON_SWITCH_ACTIVATING 90
-#define SND_SPRING_MOVING 91
-#define SND_SPRING_PUSHING 92
-#define SND_SPRING_IMPACT 93
-#define SND_CLASS_WALL_GROWING 94
-#define SND_PEARL_COLLECTING 95
-#define SND_PEARL_BREAKING 96
-#define SND_PEARL_IMPACT 97
-#define SND_CRYSTAL_COLLECTING 98
-#define SND_CRYSTAL_IMPACT 99
-#define SND_ENVELOPE_COLLECTING 100
-#define SND_INVISIBLE_SAND_DIGGING 101
-#define SND_SHIELD_NORMAL_COLLECTING 102
-#define SND_SHIELD_NORMAL_ACTIVE 103
-#define SND_SHIELD_DEADLY_COLLECTING 104
-#define SND_SHIELD_DEADLY_ACTIVE 105
-#define SND_EXTRA_TIME_COLLECTING 106
-#define SND_MOLE_MOVING 107
-#define SND_MOLE_WAITING 108
-#define SND_MOLE_DIGGING 109
-#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 110
-#define SND_CLASS_SWITCHGATE_OPENING 111
-#define SND_CLASS_SWITCHGATE_CLOSING 112
-#define SND_CLASS_SWITCHGATE_PASSING 113
-#define SND_TIMEGATE_SWITCH_ACTIVATING 114
-#define SND_TIMEGATE_SWITCH_ACTIVE 115
-#define SND_TIMEGATE_SWITCH_DEACTIVATING 116
-#define SND_TIMEGATE_OPENING 117
-#define SND_CLASS_TIMEGATE_CLOSING 118
-#define SND_CLASS_TIMEGATE_PASSING 119
-#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 120
-#define SND_CLASS_CONVEYOR_BELT_ACTIVE 121
-#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 122
-#define SND_LIGHT_SWITCH_ACTIVATING 123
-#define SND_LIGHT_SWITCH_DEACTIVATING 124
-#define SND_DX_SUPABOMB_PUSHING 125
-#define SND_TRAP_DIGGING 126
-#define SND_TRAP_ACTIVATING 127
-#define SND_CLASS_TUBE_PASSING 128
-#define SND_AMOEBA_TURNING_TO_GEM 129
-#define SND_AMOEBA_TURNING_TO_ROCK 130
-#define SND_SPEED_PILL_COLLECTING 131
-#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 132
-#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 133
-#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 134
-#define SND_CLASS_DYNABOMB_DROPPING 135
-#define SND_CLASS_DYNABOMB_ACTIVE 136
-#define SND_SATELLITE_MOVING 137
-#define SND_SATELLITE_WAITING 138
-#define SND_SATELLITE_PUSHING 139
-#define SND_LAMP_ACTIVATING 140
-#define SND_LAMP_DEACTIVATING 141
-#define SND_TIME_ORB_FULL_COLLECTING 142
-#define SND_TIME_ORB_FULL_IMPACT 143
-#define SND_TIME_ORB_EMPTY_PUSHING 144
-#define SND_TIME_ORB_EMPTY_IMPACT 145
-#define SND_GAME_OF_LIFE_WAITING 146
-#define SND_GAME_OF_LIFE_GROWING 147
-#define SND_BIOMAZE_WAITING 148
-#define SND_BIOMAZE_GROWING 149
-#define SND_PACMAN_MOVING 150
-#define SND_PACMAN_WAITING 151
-#define SND_PACMAN_DIGGING 152
-#define SND_DARK_YAMYAM_MOVING 153
-#define SND_DARK_YAMYAM_WAITING 154
-#define SND_DARK_YAMYAM_DIGGING 155
-#define SND_PENGUIN_MOVING 156
-#define SND_PENGUIN_WAITING 157
-#define SND_PIG_MOVING 158
-#define SND_PIG_WAITING 159
-#define SND_PIG_DIGGING 160
-#define SND_DRAGON_MOVING 161
-#define SND_DRAGON_WAITING 162
-#define SND_DRAGON_ATTACKING 163
-#define SND_GAME_STARTING 164
-#define SND_GAME_RUNNING_OUT_OF_TIME 165
-#define SND_GAME_LEVELTIME_BONUS 166
-#define SND_GAME_LOSING 167
-#define SND_GAME_WINNING 168
-#define SND_GAME_SOKOBAN_SOLVING 169
-#define SND_DOOR_OPENING 170
-#define SND_DOOR_CLOSING 171
-#define SND_BACKGROUND_SCORES 172
-#define SND_BACKGROUND_INFO 173
+#define SND_CLASS_DEFAULT_WALKING 5
+#define SND_CLASS_DEFAULT_PASSING 6
+#define SND_CLASS_DEFAULT_DYING 7
+#define SND_CLASS_DEFAULT_EXPLODING 8
+#define SND_CLASS_SP_DEFAULT_EXPLODING 9
+#define SND_BD_DIAMOND_COLLECTING 10
+#define SND_BD_DIAMOND_IMPACT 11
+#define SND_BD_ROCK_PUSHING 12
+#define SND_BD_ROCK_IMPACT 13
+#define SND_BD_MAGIC_WALL_ACTIVATING 14
+#define SND_BD_MAGIC_WALL_ACTIVE 15
+#define SND_BD_MAGIC_WALL_FILLING 16
+#define SND_BD_AMOEBA_WAITING 17
+#define SND_BD_AMOEBA_GROWING 18
+#define SND_BD_AMOEBA_TURNING_TO_GEM 19
+#define SND_BD_AMOEBA_TURNING_TO_ROCK 20
+#define SND_BD_BUTTERFLY_MOVING 21
+#define SND_BD_BUTTERFLY_WAITING 22
+#define SND_BD_FIREFLY_MOVING 23
+#define SND_BD_FIREFLY_WAITING 24
+#define SND_SP_BASE_DIGGING 25
+#define SND_SP_BUGGY_BASE_DIGGING 26
+#define SND_SP_BUGGY_BASE_ACTIVE 27
+#define SND_SP_INFOTRON_COLLECTING 28
+#define SND_SP_INFOTRON_IMPACT 29
+#define SND_SP_ZONK_PUSHING 30
+#define SND_SP_ZONK_IMPACT 31
+#define SND_SP_DISK_RED_COLLECTING 32
+#define SND_SP_DISK_ORANGE_PUSHING 33
+#define SND_SP_DISK_YELLOW_PUSHING 34
+#define SND_CLASS_SP_PORT_PASSING 35
+#define SND_CLASS_SP_EXIT_PASSING 36
+#define SND_CLASS_SP_EXIT_OPENING 37
+#define SND_SP_SNIKSNAK_MOVING 38
+#define SND_SP_SNIKSNAK_WAITING 39
+#define SND_SP_ELECTRON_MOVING 40
+#define SND_SP_ELECTRON_WAITING 41
+#define SND_SP_TERMINAL_ACTIVATING 42
+#define SND_SP_TERMINAL_ACTIVE 43
+#define SND_CLASS_SOKOBAN_PUSHING 44
+#define SND_CLASS_SOKOBAN_FILLING 45
+#define SND_CLASS_SOKOBAN_EMPTYING 46
+#define SND_CLASS_PLAYER_MOVING 47
+#define SND_SAND_DIGGING 48
+#define SND_EMERALD_COLLECTING 49
+#define SND_EMERALD_IMPACT 50
+#define SND_DIAMOND_COLLECTING 51
+#define SND_DIAMOND_IMPACT 52
+#define SND_DIAMOND_BREAKING 53
+#define SND_ROCK_PUSHING 54
+#define SND_ROCK_IMPACT 55
+#define SND_BOMB_PUSHING 56
+#define SND_NUT_PUSHING 57
+#define SND_NUT_BREAKING 58
+#define SND_NUT_IMPACT 59
+#define SND_CLASS_DYNAMITE_COLLECTING 60
+#define SND_CLASS_DYNAMITE_DROPPING 61
+#define SND_CLASS_DYNAMITE_ACTIVE 62
+#define SND_CLASS_KEY_COLLECTING 63
+#define SND_CLASS_GATE_PASSING 64
+#define SND_BUG_MOVING 65
+#define SND_BUG_WAITING 66
+#define SND_SPACESHIP_MOVING 67
+#define SND_SPACESHIP_WAITING 68
+#define SND_YAMYAM_MOVING 69
+#define SND_YAMYAM_WAITING 70
+#define SND_YAMYAM_DIGGING 71
+#define SND_ROBOT_MOVING 72
+#define SND_ROBOT_WAITING 73
+#define SND_ROBOT_WHEEL_ACTIVATING 74
+#define SND_ROBOT_WHEEL_ACTIVE 75
+#define SND_MAGIC_WALL_ACTIVATING 76
+#define SND_MAGIC_WALL_ACTIVE 77
+#define SND_MAGIC_WALL_FILLING 78
+#define SND_CLASS_AMOEBA_WAITING 79
+#define SND_CLASS_AMOEBA_GROWING 80
+#define SND_CLASS_AMOEBA_DROPPING 81
+#define SND_ACID_SPLASHING 82
+#define SND_CLASS_QUICKSAND_FILLING 83
+#define SND_CLASS_QUICKSAND_EMPTYING 84
+#define SND_CLASS_EXIT_OPENING 85
+#define SND_CLASS_EXIT_PASSING 86
+#define SND_PENGUIN_PASSING 87
+#define SND_BALLOON_MOVING 88
+#define SND_BALLOON_WAITING 89
+#define SND_BALLOON_PUSHING 90
+#define SND_CLASS_BALLOON_SWITCH_ACTIVATING 91
+#define SND_SPRING_MOVING 92
+#define SND_SPRING_PUSHING 93
+#define SND_SPRING_IMPACT 94
+#define SND_CLASS_WALL_GROWING 95
+#define SND_PEARL_COLLECTING 96
+#define SND_PEARL_BREAKING 97
+#define SND_PEARL_IMPACT 98
+#define SND_CRYSTAL_COLLECTING 99
+#define SND_CRYSTAL_IMPACT 100
+#define SND_ENVELOPE_COLLECTING 101
+#define SND_INVISIBLE_SAND_DIGGING 102
+#define SND_SHIELD_NORMAL_COLLECTING 103
+#define SND_SHIELD_NORMAL_ACTIVE 104
+#define SND_SHIELD_DEADLY_COLLECTING 105
+#define SND_SHIELD_DEADLY_ACTIVE 106
+#define SND_EXTRA_TIME_COLLECTING 107
+#define SND_MOLE_MOVING 108
+#define SND_MOLE_WAITING 109
+#define SND_MOLE_DIGGING 110
+#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 111
+#define SND_CLASS_SWITCHGATE_OPENING 112
+#define SND_CLASS_SWITCHGATE_CLOSING 113
+#define SND_CLASS_SWITCHGATE_PASSING 114
+#define SND_TIMEGATE_SWITCH_ACTIVATING 115
+#define SND_TIMEGATE_SWITCH_ACTIVE 116
+#define SND_TIMEGATE_SWITCH_DEACTIVATING 117
+#define SND_TIMEGATE_OPENING 118
+#define SND_CLASS_TIMEGATE_CLOSING 119
+#define SND_CLASS_TIMEGATE_PASSING 120
+#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 121
+#define SND_CLASS_CONVEYOR_BELT_ACTIVE 122
+#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 123
+#define SND_LIGHT_SWITCH_ACTIVATING 124
+#define SND_LIGHT_SWITCH_DEACTIVATING 125
+#define SND_DX_SUPABOMB_PUSHING 126
+#define SND_TRAP_DIGGING 127
+#define SND_TRAP_ACTIVATING 128
+#define SND_CLASS_TUBE_WALKING 129
+#define SND_AMOEBA_TURNING_TO_GEM 130
+#define SND_AMOEBA_TURNING_TO_ROCK 131
+#define SND_SPEED_PILL_COLLECTING 132
+#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 133
+#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 134
+#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 135
+#define SND_CLASS_DYNABOMB_DROPPING 136
+#define SND_CLASS_DYNABOMB_ACTIVE 137
+#define SND_SATELLITE_MOVING 138
+#define SND_SATELLITE_WAITING 139
+#define SND_SATELLITE_PUSHING 140
+#define SND_LAMP_ACTIVATING 141
+#define SND_LAMP_DEACTIVATING 142
+#define SND_TIME_ORB_FULL_COLLECTING 143
+#define SND_TIME_ORB_FULL_IMPACT 144
+#define SND_TIME_ORB_EMPTY_PUSHING 145
+#define SND_TIME_ORB_EMPTY_IMPACT 146
+#define SND_GAME_OF_LIFE_WAITING 147
+#define SND_GAME_OF_LIFE_GROWING 148
+#define SND_BIOMAZE_WAITING 149
+#define SND_BIOMAZE_GROWING 150
+#define SND_PACMAN_MOVING 151
+#define SND_PACMAN_WAITING 152
+#define SND_PACMAN_DIGGING 153
+#define SND_DARK_YAMYAM_MOVING 154
+#define SND_DARK_YAMYAM_WAITING 155
+#define SND_DARK_YAMYAM_DIGGING 156
+#define SND_PENGUIN_MOVING 157
+#define SND_PENGUIN_WAITING 158
+#define SND_PIG_MOVING 159
+#define SND_PIG_WAITING 160
+#define SND_PIG_DIGGING 161
+#define SND_DRAGON_MOVING 162
+#define SND_DRAGON_WAITING 163
+#define SND_DRAGON_ATTACKING 164
+#define SND_GAME_STARTING 165
+#define SND_GAME_RUNNING_OUT_OF_TIME 166
+#define SND_GAME_LEVELTIME_BONUS 167
+#define SND_GAME_LOSING 168
+#define SND_GAME_WINNING 169
+#define SND_GAME_SOKOBAN_SOLVING 170
+#define SND_DOOR_OPENING 171
+#define SND_DOOR_CLOSING 172
+#define SND_BACKGROUND_SCORES 173
+#define SND_BACKGROUND_INFO 174
-#define NUM_SOUND_FILES 174
+#define NUM_SOUND_FILES 175
#endif /* CONF_SND_H */
}
};
+struct
+{
+ int element;
+ int push_delay_fixed, push_delay_random;
+}
+push_delay_list[] =
+{
+ { EL_SPRING, 0, 0 },
+ { EL_BALLOON, 0, 0 },
+
+ { EL_SOKOBAN_OBJECT, 2, 0 },
+ { EL_SOKOBAN_FIELD_FULL, 2, 0 },
+ { EL_SATELLITE, 2, 0 },
+ { EL_SP_DISK_YELLOW, 2, 0 },
+
+ { EL_UNDEFINED, 0, 0 },
+};
+
+struct
+{
+ int element;
+ int gem_count;
+}
+gem_count_list[] =
+{
+ { EL_EMERALD, 1 },
+ { EL_BD_DIAMOND, 1 },
+ { EL_EMERALD_YELLOW, 1 },
+ { EL_EMERALD_RED, 1 },
+ { EL_EMERALD_PURPLE, 1 },
+ { EL_DIAMOND, 3 },
+ { EL_SP_INFOTRON, 1 },
+ { EL_PEARL, 5 },
+ { EL_CRYSTAL, 8 },
+
+ { EL_UNDEFINED, 0 },
+};
+
static struct ChangingElementInfo changing_element[MAX_NUM_ELEMENTS];
static unsigned long trigger_events[MAX_NUM_ELEMENTS];
+static int gem_count[MAX_NUM_ELEMENTS];
#define IS_AUTO_CHANGING(e) (changing_element[e].base_element != EL_UNDEFINED)
#define IS_JUST_CHANGING(x, y) (ChangeDelay[x][y] != 0)
printf(" => game.engine_version == %06d\n", game.engine_version);
#endif
+ /* ---------- initialize player's initial move delay --------------------- */
+
/* dynamically adjust player properties according to game engine version */
game.initial_move_delay =
(game.engine_version <= VERSION_IDENT(2,0,1) ? INITIAL_MOVE_DELAY_ON :
game.initial_move_delay_value =
(level.double_speed ? MOVE_DELAY_HIGH_SPEED : MOVE_DELAY_NORMAL_SPEED);
+ /* ---------- initialize changing elements ------------------------------- */
+
/* initialize changing elements information */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
}
/* add changing elements from pre-defined list */
- i = 0;
- while (changing_element_list[i].base_element != EL_UNDEFINED)
+ for (i=0; changing_element_list[i].base_element != EL_UNDEFINED; i++)
{
struct ChangingElementInfo *ce = &changing_element_list[i];
int element = ce->base_element;
changing_element[element].pre_change_function = ce->pre_change_function;
changing_element[element].change_function = ce->change_function;
changing_element[element].post_change_function = ce->post_change_function;
-
- i++;
}
/* add changing elements from custom element configuration */
change->delay_frames);
}
+ /* ---------- initialize trigger events ---------------------------------- */
+
/* initialize trigger events information */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
trigger_events[i] = EP_BITMASK_DEFAULT;
trigger_events[element_info[i].change.trigger] |=
element_info[i].change.events;
- /* set push delay value for all non-custom elements */
+ /* ---------- initialize push delay -------------------------------------- */
+
+ /* initialize push delay values to default */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
if (!IS_CUSTOM_ELEMENT(i))
{
- if (i == EL_SPRING ||
- i == EL_BALLOON)
- {
- element_info[i].push_delay_fixed = 0;
- element_info[i].push_delay_random = 0;
- }
- else if (i == EL_SOKOBAN_OBJECT ||
- i == EL_SOKOBAN_FIELD_FULL ||
- i == EL_SATELLITE ||
- i == EL_SP_DISK_YELLOW)
- {
- element_info[i].push_delay_fixed = 2;
- element_info[i].push_delay_random = 0;
- }
- else
- {
- element_info[i].push_delay_fixed = 2;
- element_info[i].push_delay_random = 8;
- }
+ element_info[i].push_delay_fixed = 2;
+ element_info[i].push_delay_random = 8;
}
}
+
+ /* set push delay value for certain elements from pre-defined list */
+ for (i=0; push_delay_list[i].element != EL_UNDEFINED; i++)
+ {
+ int e = push_delay_list[i].element;
+
+ element_info[e].push_delay_fixed = push_delay_list[i].push_delay_fixed;
+ element_info[e].push_delay_random = push_delay_list[i].push_delay_random;
+ }
+
+ /* ---------- initialize gem count --------------------------------------- */
+
+ /* initialize gem count values for each element */
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ gem_count[i] = 0;
+
+ /* add gem count values for all elements from pre-defined list */
+ for (i=0; gem_count_list[i].element != EL_UNDEFINED; i++)
+ gem_count[gem_count_list[i].element] = gem_count_list[i].gem_count;
}
int horiz_move = (dx != 0);
int newx = x + dx, newy = y + dy;
int step = (horiz_move ? dx : dy) * TILEX / MOVE_DELAY_NORMAL_SPEED;
+#if 1
+ boolean pushed = Pushed[x][y];
+#else
struct PlayerInfo *player = (IS_PLAYER(x, y) ? PLAYERINFO(x, y) : NULL);
#if 0
boolean pushing = (player != NULL && player->Pushing && player->MovPos != 0);
#else
boolean pushing = (player != NULL && player->Pushing && player->is_moving);
#endif
+#endif
#if 0
if (player && player->is_moving && player->MovPos == 0)
#if 1
#if 1
- if (Pushed[x][y]) /* special case: moving object pushed by player */
+ if (pushed) /* special case: moving object pushed by player */
#else
if (pushing) /* special case: moving object pushed by player */
#endif
#endif
Stop[newx][newy] = TRUE; /* ignore this element until the next frame */
#if 1
- if (!pushing)
+ if (!pushed) /* special case: moving object pushed by player */
#endif
JustStopped[newx][newy] = 3;
break;
#endif
+#if 0
+
case EL_EMERALD:
case EL_BD_DIAMOND:
case EL_EMERALD_YELLOW:
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
+#endif
+
+#if 0
+
case EL_SPEED_PILL:
RemoveField(x, y);
player->move_delay_value = MOVE_DELAY_HIGH_SPEED;
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
+#endif
+
+
#if 0
case EL_ENVELOPE:
Feld[x][y] = EL_EMPTY;
break;
#endif
+#if 0
+
case EL_EXTRA_TIME:
RemoveField(x, y);
if (level.time > 0)
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
+#endif
+
+#if 0
case EL_SHIELD_NORMAL:
RemoveField(x, y);
player->shield_normal_time_left += 10;
#endif
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
+#endif
+#if 0
case EL_DYNAMITE:
case EL_SP_DISK_RED:
RemoveField(x, y);
PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
+#endif
+#if 0
case EL_DYNABOMB_INCREASE_NUMBER:
RemoveField(x, y);
player->dynabomb_count++;
#endif
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
+#endif
+#if 0
case EL_KEY_1:
case EL_KEY_2:
case EL_KEY_3:
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
break;
}
+#endif
case EL_ROBOT_WHEEL:
Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
#endif
+#if 0
case EL_GATE_1:
case EL_GATE_2:
case EL_GATE_3:
PlaySoundLevel(x, y, SND_GATE_PASSING);
#endif
break;
+#endif
+#if 0
case EL_SWITCHGATE_OPEN:
case EL_TIMEGATE_OPEN:
if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
PlaySoundLevelElementAction(x, y, element, ACTION_PASSING);
break;
+#endif
case EL_SP_PORT_LEFT:
case EL_SP_PORT_RIGHT:
if (!(tube_enter_directions[i][1] & move_direction))
return MF_NO_ACTION; /* tube has no opening in this direction */
- PlaySoundLevel(x, y, SND_CLASS_TUBE_PASSING);
+ PlaySoundLevel(x, y, SND_CLASS_TUBE_WALKING);
}
break;
+#if 0
case EL_EXIT_CLOSED:
case EL_SP_EXIT_CLOSED:
case EL_EXIT_OPENING:
return MF_NO_ACTION;
break;
+#endif
+#if 0
case EL_EXIT_OPEN:
case EL_SP_EXIT_OPEN:
if (mode == DF_SNAP)
PlaySoundLevel(x, y, SND_CLASS_SP_EXIT_PASSING);
break;
+#endif
case EL_LAMP:
Feld[x][y] = EL_LAMP_ACTIVE;
#endif
+#if 0
case EL_PENGUIN:
case EL_PIG:
case EL_DRAGON:
break;
+#endif
default:
if (IS_WALKABLE(element))
{
- PlaySoundLevelElementAction(x, y, player->element_nr, ACTION_MOVING);
+ int sound_action = ACTION_WALKING;
+
+ if (element >= EL_GATE_1 && element <= EL_GATE_4)
+ {
+ if (!player->key[element - EL_GATE_1])
+ return MF_NO_ACTION;
+ }
+ else if (element >= EL_GATE_1_GRAY && element <= EL_GATE_4_GRAY)
+ {
+ if (!player->key[element - EL_GATE_1_GRAY])
+ return MF_NO_ACTION;
+ }
+ else if (element == EL_EXIT_OPEN || element == EL_SP_EXIT_OPEN)
+ {
+ sound_action = ACTION_PASSING; /* player is passing exit */
+ }
+ else if (element == EL_EMPTY)
+ {
+ sound_action = ACTION_MOVING; /* nothing to walk on */
+ }
+
+ /* play sound from background or player, whatever is available */
+ if (element_info[element].sound[sound_action] != SND_UNDEFINED)
+ PlaySoundLevelElementAction(x, y, element, sound_action);
+ else
+ PlaySoundLevelElementAction(x, y, player->element_nr, sound_action);
+
+ break;
+ }
+ else if (IS_PASSABLE(element))
+ {
+ if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
+ return MF_NO_ACTION;
+
+ if (element >= EL_EM_GATE_1 && element <= EL_EM_GATE_4)
+ {
+ if (!player->key[element - EL_EM_GATE_1])
+ return MF_NO_ACTION;
+ }
+ else if (element >= EL_EM_GATE_1_GRAY && element <= EL_EM_GATE_4_GRAY)
+ {
+ if (!player->key[element - EL_EM_GATE_1_GRAY])
+ return MF_NO_ACTION;
+ }
+
+ /* automatically move to the next field with double speed */
+ player->programmed_action = move_direction;
+ DOUBLE_PLAYER_SPEED(player);
+
+ PlaySoundLevelAction(x, y, ACTION_PASSING);
+
break;
}
else if (IS_DIGGABLE(element))
player->is_collecting = TRUE;
}
- RaiseScoreElement(element);
+ if (element == EL_SPEED_PILL)
+ player->move_delay_value = MOVE_DELAY_HIGH_SPEED;
+ else if (element == EL_EXTRA_TIME && level.time > 0)
+ {
+ TimeLeft += 10;
+ DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2);
+ }
+ else if (element == EL_SHIELD_NORMAL || element == EL_SHIELD_DEADLY)
+ {
+ player->shield_normal_time_left += 10;
+ if (element == EL_SHIELD_DEADLY)
+ player->shield_deadly_time_left += 10;
+ }
+ else if (element == EL_DYNAMITE || element == EL_SP_DISK_RED)
+ {
+ player->dynamite++;
+ player->use_disk_red_graphic = (element == EL_SP_DISK_RED);
+
+ DrawText(DX_DYNAMITE, DY_DYNAMITE,
+ int2str(local_player->dynamite, 3), FONT_TEXT_2);
+ }
+ else if (element == EL_DYNABOMB_INCREASE_NUMBER)
+ {
+ player->dynabomb_count++;
+ player->dynabombs_left++;
+ }
+ else if (element == EL_DYNABOMB_INCREASE_SIZE)
+ {
+ player->dynabomb_size++;
+ }
+ else if (element == EL_DYNABOMB_INCREASE_POWER)
+ {
+ player->dynabomb_xl = TRUE;
+ }
+ else if ((element >= EL_KEY_1 && element <= EL_KEY_4) ||
+ (element >= EL_EM_KEY_1 && element <= EL_EM_KEY_4))
+ {
+ int key_nr = (element >= EL_KEY_1 && element <= EL_KEY_4 ?
+ element - EL_KEY_1 : element - EL_EM_KEY_1);
+
+ player->key[key_nr] = TRUE;
+ DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
+ el2edimg(EL_KEY_1 + key_nr));
+ redraw_mask |= REDRAW_DOOR_1;
+ }
+ else if (gem_count[element] > 0)
+ {
+ local_player->gems_still_needed -= gem_count[element];
+ if (local_player->gems_still_needed < 0)
+ local_player->gems_still_needed = 0;
+
+ DrawText(DX_EMERALDS, DY_EMERALDS,
+ int2str(local_player->gems_still_needed, 3), FONT_TEXT_2);
+ }
+
+ RaiseScoreElement(element);
PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
RaiseScore(level.score[SC_NUT]);
break;
case EL_DYNAMITE:
+ case EL_SP_DISK_RED:
case EL_DYNABOMB_INCREASE_NUMBER:
case EL_DYNABOMB_INCREASE_SIZE:
case EL_DYNABOMB_INCREASE_POWER: