rnd-20040927-2-src
[rocksndiamonds.git] / src / game_em / main_em.h
1 #ifndef MAIN_EM_H
2 #define MAIN_EM_H
3
4 /* 2000-07-30T11:06:03Z ---------------------------------------------------- */
5
6 #define EM_MAX_CAVE_WIDTH               102
7 #define EM_MAX_CAVE_HEIGHT              102
8
9 /* define these for backwards compatibility */
10 #define EM_ENGINE_BAD_ROLL
11 #define EM_ENGINE_BAD_SPRING
12
13 enum
14 {
15   Xblank = 0,           /* still */
16   Yacid_splash_eB,      /* hmm */
17   Yacid_splash_wB,      /* hmm */
18
19 #ifdef EM_ENGINE_BAD_ROLL
20   Xstone_force_e,       /* only use these in eater */
21   Xstone_force_w,
22   Xnut_force_e,
23   Xnut_force_w,
24   Xspring_force_e,
25   Xspring_force_w,
26   Xemerald_force_e,
27   Xemerald_force_w,
28   Xdiamond_force_e,
29   Xdiamond_force_w,
30   Xbomb_force_e,
31   Xbomb_force_w,
32 #endif
33
34   Xstone,
35   Xstone_pause,
36   Xstone_fall,
37   Ystone_s,
38   Ystone_sB,
39   Ystone_e,
40   Ystone_eB,
41   Ystone_w,
42   Ystone_wB,
43   Xnut,
44   Xnut_pause,
45   Xnut_fall,
46   Ynut_s,
47   Ynut_sB,
48   Ynut_e,
49   Ynut_eB,
50   Ynut_w,
51   Ynut_wB,
52   Xbug_n,
53   Xbug_e,
54   Xbug_s,
55   Xbug_w,
56   Xbug_gon,
57   Xbug_goe,
58   Xbug_gos,
59   Xbug_gow,
60   Ybug_n,
61   Ybug_nB,
62   Ybug_e,
63   Ybug_eB,
64   Ybug_s,
65   Ybug_sB,
66   Ybug_w,
67   Ybug_wB,
68   Ybug_w_n,
69   Ybug_n_e,
70   Ybug_e_s,
71   Ybug_s_w,
72   Ybug_e_n,
73   Ybug_s_e,
74   Ybug_w_s,
75   Ybug_n_w,
76   Ybug_stone,
77   Ybug_spring,
78   Xtank_n,
79   Xtank_e,
80   Xtank_s,
81   Xtank_w,
82   Xtank_gon,
83   Xtank_goe,
84   Xtank_gos,
85   Xtank_gow,
86   Ytank_n,
87   Ytank_nB,
88   Ytank_e,
89   Ytank_eB,
90   Ytank_s,
91   Ytank_sB,
92   Ytank_w,
93   Ytank_wB,
94   Ytank_w_n,
95   Ytank_n_e,
96   Ytank_e_s,
97   Ytank_s_w,
98   Ytank_e_n,
99   Ytank_s_e,
100   Ytank_w_s,
101   Ytank_n_w,
102   Ytank_stone,
103   Ytank_spring,
104   Xandroid,
105   Xandroid_1_n,
106   Xandroid_2_n,
107   Xandroid_1_e,
108   Xandroid_2_e,
109   Xandroid_1_w,
110   Xandroid_2_w,
111   Xandroid_1_s,
112   Xandroid_2_s,
113   Yandroid_n,
114   Yandroid_nB,
115   Yandroid_ne,
116   Yandroid_neB,
117   Yandroid_e,
118   Yandroid_eB,
119   Yandroid_se,
120   Yandroid_seB,
121   Yandroid_s,
122   Yandroid_sB,
123   Yandroid_sw,
124   Yandroid_swB,
125   Yandroid_w,
126   Yandroid_wB,
127   Yandroid_nw,
128   Yandroid_nwB,
129   Xspring,
130   Xspring_pause,
131   Xspring_e,
132   Xspring_w,
133   Xspring_fall,
134   Yspring_s,
135   Yspring_sB,
136   Yspring_e,
137   Yspring_eB,
138   Yspring_w,
139   Yspring_wB,
140   Yspring_kill_e,
141   Yspring_kill_eB,
142   Yspring_kill_w,
143   Yspring_kill_wB,
144   Xeater_n,
145   Xeater_e,
146   Xeater_w,
147   Xeater_s,
148   Yeater_n,
149   Yeater_nB,
150   Yeater_e,
151   Yeater_eB,
152   Yeater_s,
153   Yeater_sB,
154   Yeater_w,
155   Yeater_wB,
156   Yeater_stone,
157   Yeater_spring,
158   Xalien,
159   Xalien_pause,
160   Yalien_n,
161   Yalien_nB,
162   Yalien_e,
163   Yalien_eB,
164   Yalien_s,
165   Yalien_sB,
166   Yalien_w,
167   Yalien_wB,
168   Yalien_stone,
169   Yalien_spring,
170   Xemerald,
171   Xemerald_pause,
172   Xemerald_fall,
173   Xemerald_shine,
174   Yemerald_s,
175   Yemerald_sB,
176   Yemerald_e,
177   Yemerald_eB,
178   Yemerald_w,
179   Yemerald_wB,
180   Yemerald_eat,
181   Yemerald_stone,
182   Xdiamond,
183   Xdiamond_pause,
184   Xdiamond_fall,
185   Xdiamond_shine,
186   Ydiamond_s,
187   Ydiamond_sB,
188   Ydiamond_e,
189   Ydiamond_eB,
190   Ydiamond_w,
191   Ydiamond_wB,
192   Ydiamond_eat,
193   Ydiamond_stone,
194   Xdrip_fall,
195   Xdrip_stretch,
196   Xdrip_stretchB,
197   Xdrip_eat,
198   Ydrip_s1,
199   Ydrip_s1B,
200   Ydrip_s2,
201   Ydrip_s2B,
202   Xbomb,
203   Xbomb_pause,
204   Xbomb_fall,
205   Ybomb_s,
206   Ybomb_sB,
207   Ybomb_e,
208   Ybomb_eB,
209   Ybomb_w,
210   Ybomb_wB,
211   Ybomb_eat,
212   Xballoon,
213   Yballoon_n,
214   Yballoon_nB,
215   Yballoon_e,
216   Yballoon_eB,
217   Yballoon_s,
218   Yballoon_sB,
219   Yballoon_w,
220   Yballoon_wB,
221   Xgrass,
222   Ygrass_nB,
223   Ygrass_eB,
224   Ygrass_sB,
225   Ygrass_wB,
226   Xdirt,
227   Ydirt_nB,
228   Ydirt_eB,
229   Ydirt_sB,
230   Ydirt_wB,
231   Xacid_ne,
232   Xacid_se,
233   Xacid_s,
234   Xacid_sw,
235   Xacid_nw,
236   Xacid_1,
237   Xacid_2,
238   Xacid_3,
239   Xacid_4,
240   Xacid_5,
241   Xacid_6,
242   Xacid_7,
243   Xacid_8,
244   Xball_1,
245   Xball_1B,
246   Xball_2,
247   Xball_2B,
248   Yball_eat,
249   Xgrow_ns,
250   Ygrow_ns_eat,
251   Xgrow_ew,
252   Ygrow_ew_eat,
253   Xwonderwall,
254   XwonderwallB,
255   Xamoeba_1,
256   Xamoeba_2,
257   Xamoeba_3,
258   Xamoeba_4,
259   Xamoeba_5,
260   Xamoeba_6,
261   Xamoeba_7,
262   Xamoeba_8,
263   Xdoor_1,
264   Xdoor_2,
265   Xdoor_3,
266   Xdoor_4,
267   Xdoor_5,
268   Xdoor_6,
269   Xdoor_7,
270   Xdoor_8,
271   Xkey_1,
272   Xkey_2,
273   Xkey_3,
274   Xkey_4,
275   Xkey_5,
276   Xkey_6,
277   Xkey_7,
278   Xkey_8,
279   Xwind_n,
280   Xwind_e,
281   Xwind_s,
282   Xwind_w,
283   Xwind_nesw,
284   Xwind_stop,
285   Xexit,
286   Xexit_1,
287   Xexit_2,
288   Xexit_3,
289   Xdynamite,
290   Ydynamite_eat,
291   Xdynamite_1,
292   Xdynamite_2,
293   Xdynamite_3,
294   Xdynamite_4,
295   Xbumper,
296   XbumperB,
297   Xwheel,
298   XwheelB,
299   Xswitch,
300   XswitchB,
301   Xsand,
302   Xsand_stone,
303   Xsand_stonein_1,
304   Xsand_stonein_2,
305   Xsand_stonein_3,
306   Xsand_stonein_4,
307   Xsand_stonesand_1,
308   Xsand_stonesand_2,
309   Xsand_stonesand_3,
310   Xsand_stonesand_4,
311   Xsand_stoneout_1,
312   Xsand_stoneout_2,
313   Xsand_sandstone_1,
314   Xsand_sandstone_2,
315   Xsand_sandstone_3,
316   Xsand_sandstone_4,
317   Xplant,
318   Yplant,
319   Xlenses,
320   Xmagnify,
321   Xdripper,
322   XdripperB,
323   Xfake_blank,
324   Xfake_blankB,
325   Xfake_grass,
326   Xfake_grassB,
327   Xfake_door_1,
328   Xfake_door_2,
329   Xfake_door_3,
330   Xfake_door_4,
331   Xfake_door_5,
332   Xfake_door_6,
333   Xfake_door_7,
334   Xfake_door_8,
335   Xsteel_1,
336   Xsteel_2,
337   Xsteel_3,
338   Xsteel_4,
339   Xwall_1,
340   Xwall_2,
341   Xwall_3,
342   Xwall_4,
343   Xround_wall_1,
344   Xround_wall_2,
345   Xround_wall_3,
346   Xround_wall_4,
347   Xdecor_1,
348   Xdecor_2,
349   Xdecor_3,
350   Xdecor_4,
351   Xdecor_5,
352   Xdecor_6,
353   Xdecor_7,
354   Xdecor_8,
355   Xdecor_9,
356   Xdecor_10,
357   Xdecor_11,
358   Xdecor_12,
359   Xalpha_0,
360   Xalpha_1,
361   Xalpha_2,
362   Xalpha_3,
363   Xalpha_4,
364   Xalpha_5,
365   Xalpha_6,
366   Xalpha_7,
367   Xalpha_8,
368   Xalpha_9,
369   Xalpha_excla,
370   Xalpha_quote,
371   Xalpha_comma,
372   Xalpha_minus,
373   Xalpha_perio,
374   Xalpha_colon,
375   Xalpha_quest,
376   Xalpha_a,
377   Xalpha_b,
378   Xalpha_c,
379   Xalpha_d,
380   Xalpha_e,
381   Xalpha_f,
382   Xalpha_g,
383   Xalpha_h,
384   Xalpha_i,
385   Xalpha_j,
386   Xalpha_k,
387   Xalpha_l,
388   Xalpha_m,
389   Xalpha_n,
390   Xalpha_o,
391   Xalpha_p,
392   Xalpha_q,
393   Xalpha_r,
394   Xalpha_s,
395   Xalpha_t,
396   Xalpha_u,
397   Xalpha_v,
398   Xalpha_w,
399   Xalpha_x,
400   Xalpha_y,
401   Xalpha_z,
402   Xalpha_arrow_e,
403   Xalpha_arrow_w,
404   Xalpha_copyr,
405
406   Xboom_bug,            /* passed from explode to synchro (linked explosion);
407                            transition to explode_normal */
408   Xboom_bomb,           /* passed from explode to synchro (linked explosion);
409                            transition to explode_normal */
410   Xboom_android,        /* passed from explode to synchro;
411                            transition to boom_2 */
412   Xboom_1,              /* passed from explode to synchro;
413                            transition to boom_2 */
414   Xboom_2,              /* transition to boom[] */
415
416   Znormal,              /* passed from synchro to explode, only in next[];
417                            no picture */
418   Zdynamite,            /* passed from synchro to explode, only in next[];
419                            no picture */
420   Zplayer,              /* special code to indicate player;
421                            no picture */
422   ZBORDER,              /* special code to indicate border;
423                            no picture */
424
425   TILE_MAX
426 };
427
428 struct LEVEL
429 {
430   unsigned int home_initial;          /* number of players (initial) */
431   unsigned int home;                  /* number of players not yet at home */
432                                       /* 0 == all players at home */
433
434   unsigned int width;                 /* playfield width */
435   unsigned int height;                /* playfield height */
436   unsigned int time_initial;          /* time remaining (initial) */
437   unsigned int time;                  /* time remaining (runtime) */
438   unsigned int required_initial;      /* emeralds needed (initial) */
439   unsigned int required;              /* emeralds needed (runtime) */
440   unsigned int score;                 /* score */
441
442   /* fill in all below /every/ time you read a level */
443   unsigned int alien_score;           /* alien popped by stone/spring score */
444   unsigned int amoeba_time;           /* amoeba speed */
445   unsigned int android_move_cnt_initial; /* android move time counter (initial) */
446   unsigned int android_move_cnt;      /* android move time counter */
447   unsigned int android_move_time;     /* android move reset time */
448   unsigned int android_clone_cnt_initial; /* android clone time counter (initial) */
449   unsigned int android_clone_cnt;     /* android clone time counter */
450   unsigned int android_clone_time;    /* android clone reset time */
451   unsigned int ball_cnt;              /* ball time counter */
452   unsigned int ball_pos;              /* ball array pos counter */
453   unsigned int ball_random;           /* ball is random flag */
454   unsigned int ball_state_initial;    /* ball currently on flag (initial) */
455   unsigned int ball_state;            /* ball currently on flag */
456   unsigned int ball_time;             /* ball reset time */
457   unsigned int bug_score;             /* bug popped by stone/spring score */
458   unsigned int diamond_score;         /* diamond collect score */
459   unsigned int dynamite_score;        /* dynamite collect scoer*/
460   unsigned int eater_pos;             /* eater array pos */
461   unsigned int eater_score;           /* eater popped by stone/spring score */
462   unsigned int emerald_score;         /* emerald collect score */
463   unsigned int exit_score;            /* exit score */
464   unsigned int key_score;             /* key collect score */
465   unsigned int lenses_cnt_initial;    /* lenses time counter (initial) */
466   unsigned int lenses_cnt;            /* lenses time counter */
467   unsigned int lenses_score;          /* lenses collect score */
468   unsigned int lenses_time;           /* lenses reset time */
469   unsigned int magnify_cnt_initial;   /* magnify time counter (initial) */
470   unsigned int magnify_cnt;           /* magnify time counter */
471   unsigned int magnify_score;         /* magnify collect score */
472   unsigned int magnify_time;          /* magnify reset time */
473   unsigned int nut_score;             /* nut crack score */
474   unsigned int shine_cnt;             /* shine counter for emerald/diamond */
475   unsigned int slurp_score;           /* slurp alien score */
476   unsigned int tank_score;            /* tank popped by stone/spring */
477   unsigned int wheel_cnt_initial;     /* wheel time counter (initial) */
478   unsigned int wheel_cnt;             /* wheel time counter */
479   unsigned int wheel_x_initial;       /* wheel x pos (initial) */
480   unsigned int wheel_x;               /* wheel x pos */
481   unsigned int wheel_y_initial;       /* wheel y pos (initial) */
482   unsigned int wheel_y;               /* wheel y pos */
483   unsigned int wheel_time;            /* wheel reset time */
484   unsigned int wind_cnt_initial;      /* wind time counter (initial) */
485   unsigned int wind_cnt;              /* wind time counter */
486   unsigned int wind_direction_initial;/* wind direction (initial) */
487   unsigned int wind_direction;        /* wind direction */
488   unsigned int wind_time;             /* wind reset time */
489   unsigned int wonderwall_state_initial; /* wonderwall currently on flag (initial) */
490   unsigned int wonderwall_state;      /* wonderwall currently on flag */
491   unsigned int wonderwall_time_initial;/* wonderwall time (initial) */
492   unsigned int wonderwall_time;       /* wonderwall time */
493   unsigned short eater_array[8][9];   /* eater data */
494   unsigned short ball_array[8][8];    /* ball data */
495   unsigned short android_array[TILE_MAX]; /* android clone table */
496 };
497
498 struct PLAYER
499 {
500   unsigned int num;
501   unsigned int alive_initial;
502   unsigned int alive;
503
504   unsigned int dynamite;
505   unsigned int dynamite_cnt;
506   unsigned int keys;
507   unsigned int anim;
508
509   unsigned int x_initial;
510   unsigned int y_initial;
511   unsigned int x;
512   unsigned int y;
513   unsigned int oldx;
514   unsigned int oldy;
515
516   unsigned joy_n:1;
517   unsigned joy_e:1;
518   unsigned joy_s:1;
519   unsigned joy_w:1;
520   unsigned joy_fire:1;
521   unsigned joy_stick:1;
522   unsigned joy_spin:1;
523 };
524
525 struct LevelInfo_EM
526 {
527   struct LEVEL *lev;
528   struct PLAYER *ply1, *ply2;
529
530   unsigned short cave[EM_MAX_CAVE_WIDTH][EM_MAX_CAVE_HEIGHT];
531 };
532
533 #endif  /* MAIN_EM_H */