1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2002 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
18 #define MAX_INVENTORY_SIZE 1000
19 #define STD_NUM_KEYS 4
20 #define MAX_NUM_KEYS 8
35 /* values for control panel */
36 struct GamePanelInfo panel;
38 /* values for engine initialization */
39 int default_push_delay_fixed;
40 int default_push_delay_random;
42 /* constant within running game */
45 int initial_move_delay[MAX_PLAYERS];
46 int initial_move_delay_value[MAX_PLAYERS];
47 int initial_push_delay_value;
49 /* flags to handle bugs in and changes between different engine versions */
50 /* (for the latest engine version, these flags should always be "FALSE") */
51 boolean use_change_when_pushing_bug;
52 boolean use_block_last_field_bug;
53 boolean max_num_changes_per_frame;
54 boolean use_reverse_scan_direction;
56 /* variable within running game */
57 int yamyam_content_nr;
58 boolean magic_wall_active;
59 int magic_wall_time_left;
61 int timegate_time_left;
67 boolean explosions_delayed;
68 boolean envelope_active;
71 /* values for the new EMC elements */
73 int magnify_time_left;
78 /* values for player idle animation (no effect on engine) */
79 int player_boring_delay_fixed;
80 int player_boring_delay_random;
81 int player_sleeping_delay_fixed;
82 int player_sleeping_delay_random;
84 /* values for special game initialization control */
85 boolean restart_level;
87 /* values for special game control */
88 int centered_player_nr;
89 int centered_player_nr_next;
90 boolean set_centered_player;
95 boolean present; /* player present in level playfield */
96 boolean connected; /* player connected (locally or via network) */
97 boolean active; /* player present and connected */
99 int index_nr; /* player number (0 to 3) */
100 int index_bit; /* player number bit (1 << 0 to 1 << 3) */
101 int element_nr; /* element (EL_PLAYER_1 to EL_PLAYER_4) */
102 int client_nr; /* network client identifier */
104 byte action; /* action from local input device */
105 byte effective_action; /* action acknowledged from network server
106 or summarized over all configured input
107 devices when in single player mode */
108 byte programmed_action; /* action forced by game itself (like moving
109 through doors); overrides other actions */
111 int jx, jy, last_jx, last_jy;
112 int MovDir, MovPos, GfxDir, GfxPos;
113 int Frame, StepFrame;
120 boolean block_last_field;
121 int block_delay_adjustment; /* needed for different engine versions */
123 boolean can_fall_into_acid;
127 boolean LevelSolved, GameOver;
129 boolean LevelSolved_GameEnd;
130 boolean LevelSolved_SaveTape;
131 boolean LevelSolved_SaveScore;
139 boolean is_auto_moving;
142 boolean is_collecting;
144 boolean is_switching;
146 boolean is_dropping_pressed;
153 int frame_counter_bored;
154 int frame_counter_sleeping;
156 int anim_delay_counter;
157 int post_delay_counter;
160 int action_waiting, last_action_waiting;
161 int special_action_bored;
162 int special_action_sleeping;
164 int num_special_action_bored;
165 int num_special_action_sleeping;
167 int switch_x, switch_y;
173 int move_delay_value;
174 int move_delay_value_next;
175 int move_delay_reset_counter;
178 int push_delay_value;
180 unsigned long actual_frame_counter;
183 int drop_pressed_delay;
188 int gems_still_needed;
189 int sokobanfields_still_needed;
190 int lights_still_needed;
191 int friends_still_needed;
192 int key[MAX_NUM_KEYS];
193 int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl;
194 int shield_normal_time_left;
195 int shield_deadly_time_left;
197 int inventory_element[MAX_INVENTORY_SIZE];
198 int inventory_infinite_element;
203 extern struct GameInfo game;
204 extern struct PlayerInfo stored_player[], *local_player;
208 void DEBUG_SetMaximumDynamite();
211 void GetPlayerConfig(void);
213 void DrawGameValue_Time(int);
214 void DrawGameDoorValues(void);
216 void InitGameSound();
219 void UpdateEngineValues(int, int);
223 void InitPlayerGfxAnimation(struct PlayerInfo *, int, int);
224 void Moving2Blocked(int, int, int *, int *);
225 void Blocked2Moving(int, int, int *, int *);
226 void DrawDynamite(int, int);
228 void StartGameActions(boolean, boolean, long);
230 void GameActions(void);
231 void GameActions_EM_Main();
232 void GameActions_RND();
234 void ScrollLevel(int, int);
236 void InitPlayLevelSound();
237 void PlayLevelSound_EM(int, int, int, int);
239 void RaiseScore(int);
240 void RaiseScoreElement(int);
241 void RequestQuitGame(boolean);
243 void CreateGameButtons();
244 void FreeGameButtons();
245 void UnmapGameButtons();