minor code formatting changes
[rocksndiamonds.git] / src / game_bd / bd_elements.h
1 /*
2  * Copyright (c) 2007, 2008, 2009, Czirkos Zoltan <cirix@fw.hu>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #ifndef BD_ELEMENTS_H
18 #define BD_ELEMENTS_H
19
20
21 // These are the objects in caves.
22 typedef enum _element
23 {
24   O_SPACE,
25   O_DIRT,
26   O_DIRT_SLOPED_UP_RIGHT,
27   O_DIRT_SLOPED_UP_LEFT,
28   O_DIRT_SLOPED_DOWN_LEFT,
29   O_DIRT_SLOPED_DOWN_RIGHT,
30   O_DIRT_BALL,
31   O_DIRT_BALL_F,
32   O_DIRT_LOOSE,
33   O_DIRT_LOOSE_F,
34   O_DIRT2,
35   O_BRICK,
36   O_BRICK_SLOPED_UP_RIGHT,
37   O_BRICK_SLOPED_UP_LEFT,
38   O_BRICK_SLOPED_DOWN_LEFT,
39   O_BRICK_SLOPED_DOWN_RIGHT,
40   O_BRICK_NON_SLOPED,
41   O_MAGIC_WALL,
42   O_PRE_OUTBOX,
43   O_OUTBOX,
44   O_PRE_INVIS_OUTBOX,
45   O_INVIS_OUTBOX,
46   O_STEEL,
47   O_STEEL_SLOPED_UP_RIGHT,
48   O_STEEL_SLOPED_UP_LEFT,
49   O_STEEL_SLOPED_DOWN_LEFT,
50   O_STEEL_SLOPED_DOWN_RIGHT,
51   O_STEEL_EXPLODABLE,
52   O_STEEL_EATABLE,
53   O_BRICK_EATABLE,
54   O_STONE,
55   O_STONE_F,
56   O_FLYING_STONE,
57   O_FLYING_STONE_F,
58   O_MEGA_STONE,
59   O_MEGA_STONE_F,
60   O_DIAMOND,
61   O_DIAMOND_F,
62   O_FLYING_DIAMOND,
63   O_FLYING_DIAMOND_F,
64   O_NUT,
65   O_NUT_F,
66   O_BLADDER_SPENDER,
67   O_INBOX,
68   O_H_EXPANDING_WALL,
69   O_V_EXPANDING_WALL,
70   O_EXPANDING_WALL,
71   O_H_EXPANDING_STEEL_WALL,
72   O_V_EXPANDING_STEEL_WALL,
73   O_EXPANDING_STEEL_WALL,
74   O_EXPANDING_WALL_SWITCH,
75   O_CREATURE_SWITCH,
76   O_BITER_SWITCH,
77   O_REPLICATOR_SWITCH,
78   O_CONVEYOR_SWITCH,
79   O_CONVEYOR_DIR_SWITCH,
80   O_ACID,
81   O_FALLING_WALL,
82   O_FALLING_WALL_F,
83   O_BOX,
84   O_TIME_PENALTY,
85   O_GRAVESTONE,
86   O_STONE_GLUED,
87   O_DIAMOND_GLUED,
88   O_DIAMOND_KEY,
89   O_TRAPPED_DIAMOND,
90   O_CLOCK,
91   O_DIRT_GLUED,
92   O_KEY_1,
93   O_KEY_2,
94   O_KEY_3,
95   O_DOOR_1,
96   O_DOOR_2,
97   O_DOOR_3,
98
99   O_POT,
100   O_GRAVITY_SWITCH,
101   O_PNEUMATIC_HAMMER,
102   O_TELEPORTER,
103   O_SKELETON,
104   O_WATER,
105   O_WATER_1,
106   O_WATER_2,
107   O_WATER_3,
108   O_WATER_4,
109   O_WATER_5,
110   O_WATER_6,
111   O_WATER_7,
112   O_WATER_8,
113   O_WATER_9,
114   O_WATER_10,
115   O_WATER_11,
116   O_WATER_12,
117   O_WATER_13,
118   O_WATER_14,
119   O_WATER_15,
120   O_WATER_16,
121   O_COW_1,
122   O_COW_2,
123   O_COW_3,
124   O_COW_4,
125   O_COW_ENCLOSED_1,
126   O_COW_ENCLOSED_2,
127   O_COW_ENCLOSED_3,
128   O_COW_ENCLOSED_4,
129   O_COW_ENCLOSED_5,
130   O_COW_ENCLOSED_6,
131   O_COW_ENCLOSED_7,
132   O_WALLED_DIAMOND,
133   O_WALLED_KEY_1,
134   O_WALLED_KEY_2,
135   O_WALLED_KEY_3,
136
137   O_AMOEBA,
138   O_AMOEBA_2,
139   O_REPLICATOR,
140   O_CONVEYOR_LEFT,
141   O_CONVEYOR_RIGHT,
142   O_LAVA,
143   O_SWEET,
144   O_VOODOO,
145   O_SLIME,
146   O_BLADDER,
147   O_BLADDER_1,
148   O_BLADDER_2,
149   O_BLADDER_3,
150   O_BLADDER_4,
151   O_BLADDER_5,
152   O_BLADDER_6,
153   O_BLADDER_7,
154   O_BLADDER_8,
155
156   O_WAITING_STONE,
157   O_CHASING_STONE,
158   O_GHOST,
159   O_FIREFLY_1,
160   O_FIREFLY_2,
161   O_FIREFLY_3,
162   O_FIREFLY_4,
163   O_ALT_FIREFLY_1,
164   O_ALT_FIREFLY_2,
165   O_ALT_FIREFLY_3,
166   O_ALT_FIREFLY_4,
167   O_BUTTER_1,
168   O_BUTTER_2,
169   O_BUTTER_3,
170   O_BUTTER_4,
171   O_ALT_BUTTER_1,
172   O_ALT_BUTTER_2,
173   O_ALT_BUTTER_3,
174   O_ALT_BUTTER_4,
175   O_STONEFLY_1,
176   O_STONEFLY_2,
177   O_STONEFLY_3,
178   O_STONEFLY_4,
179   O_BITER_1,
180   O_BITER_2,
181   O_BITER_3,
182   O_BITER_4,
183   O_DRAGONFLY_1,
184   O_DRAGONFLY_2,
185   O_DRAGONFLY_3,
186   O_DRAGONFLY_4,
187
188   O_PRE_PL_1,
189   O_PRE_PL_2,
190   O_PRE_PL_3,
191   O_PLAYER,
192   O_PLAYER_BOMB,
193   O_PLAYER_ROCKET_LAUNCHER,
194   O_PLAYER_GLUED,
195   O_PLAYER_STIRRING,
196
197   O_ROCKET_LAUNCHER,
198   O_ROCKET_1,
199   O_ROCKET_2,
200   O_ROCKET_3,
201   O_ROCKET_4,
202
203   O_BOMB,
204   O_BOMB_TICK_1,
205   O_BOMB_TICK_2,
206   O_BOMB_TICK_3,
207   O_BOMB_TICK_4,
208   O_BOMB_TICK_5,
209   O_BOMB_TICK_6,
210   O_BOMB_TICK_7,
211
212   O_NITRO_PACK,
213   O_NITRO_PACK_F,
214   O_NITRO_PACK_EXPLODE,
215
216   O_PRE_CLOCK_1,
217   O_PRE_CLOCK_2,
218   O_PRE_CLOCK_3,
219   O_PRE_CLOCK_4,
220   O_PRE_DIA_1,
221   O_PRE_DIA_2,
222   O_PRE_DIA_3,
223   O_PRE_DIA_4,
224   O_PRE_DIA_5,
225   O_EXPLODE_1,
226   O_EXPLODE_2,
227   O_EXPLODE_3,
228   O_EXPLODE_4,
229   O_EXPLODE_5,
230   O_PRE_STONE_1,
231   O_PRE_STONE_2,
232   O_PRE_STONE_3,
233   O_PRE_STONE_4,
234   O_PRE_STEEL_1,
235   O_PRE_STEEL_2,
236   O_PRE_STEEL_3,
237   O_PRE_STEEL_4,
238   O_GHOST_EXPL_1,
239   O_GHOST_EXPL_2,
240   O_GHOST_EXPL_3,
241   O_GHOST_EXPL_4,
242   O_BOMB_EXPL_1,
243   O_BOMB_EXPL_2,
244   O_BOMB_EXPL_3,
245   O_BOMB_EXPL_4,
246   O_NITRO_EXPL_1,
247   O_NITRO_EXPL_2,
248   O_NITRO_EXPL_3,
249   O_NITRO_EXPL_4,
250   O_AMOEBA_2_EXPL_1,
251   O_AMOEBA_2_EXPL_2,
252   O_AMOEBA_2_EXPL_3,
253   O_AMOEBA_2_EXPL_4,
254   O_NUT_EXPL_1,
255   O_NUT_EXPL_2,
256   O_NUT_EXPL_3,
257   O_NUT_EXPL_4,
258
259   // these are used internally for the pneumatic hammer, and should not be used in the editor!
260   // (not even as an effect destination or something like that)
261   O_PLAYER_PNEUMATIC_LEFT,
262   O_PLAYER_PNEUMATIC_RIGHT,
263   O_PNEUMATIC_ACTIVE_LEFT,
264   O_PNEUMATIC_ACTIVE_RIGHT,
265
266   O_UNKNOWN,    // unknown element imported or read from bdcff
267   O_NONE,       // do not draw this element when creating cave; can be used,
268                 // for example, to skip drawing a maze's path
269
270   O_MAX,        // remembering last index: this should get an integer value
271                 // which is 1 more than the one above.
272
273   // fake elements to help drawing
274   O_FAKE_BONUS,
275   O_INBOX_CLOSED,
276   O_INBOX_OPEN,
277   O_OUTBOX_CLOSED,
278   O_OUTBOX_OPEN,
279   O_COVERED,
280   O_PLAYER_LEFT,
281   O_PLAYER_RIGHT,
282   O_PLAYER_TAP,
283   O_PLAYER_BLINK,
284   O_PLAYER_TAP_BLINK,
285   O_CREATURE_SWITCH_ON,
286   O_EXPANDING_WALL_SWITCH_HORIZ,
287   O_EXPANDING_WALL_SWITCH_VERT,
288   O_GRAVITY_SWITCH_ACTIVE,
289   O_REPLICATOR_SWITCH_ON,
290   O_REPLICATOR_SWITCH_OFF,
291   O_CONVEYOR_DIR_NORMAL,
292   O_CONVEYOR_DIR_CHANGED,
293   O_CONVEYOR_SWITCH_OFF,
294   O_CONVEYOR_SWITCH_ON,
295
296   O_MAGIC_WALL_ACTIVE,
297   O_REPLICATOR_ACTIVE,
298   O_CONVEYOR_LEFT_ACTIVE,
299   O_CONVEYOR_RIGHT_ACTIVE,
300   O_BITER_SWITCH_1,
301   O_BITER_SWITCH_2,
302   O_BITER_SWITCH_3,
303   O_BITER_SWITCH_4,
304
305   O_QUESTION_MARK,
306   O_EATABLE,
307   O_DOWN_ARROW,
308   O_LEFTRIGHT_ARROW,
309   O_EVERYDIR_ARROW,
310   O_GLUED,
311   O_OUT,
312   O_EXCLAMATION_MARK,
313
314   O_MAX_ALL,
315
316   SCANNED = 0x100,
317   COVERED = 0x200,
318   SKIPPED = 0x400,
319
320   // binary AND this to elements to get rid of properties above.
321   O_MASK = ~(SCANNED | COVERED | SKIPPED)
322 } GdElement;
323
324 typedef enum _sound
325 {
326   GD_S_NONE,
327
328   GD_S_STONE_PUSHING,
329   GD_S_STONE_FALLING,
330   GD_S_STONE_IMPACT,
331   GD_S_MEGA_STONE_PUSHING,
332   GD_S_MEGA_STONE_FALLING,
333   GD_S_MEGA_STONE_IMPACT,
334   GD_S_FLYING_STONE_PUSHING,
335   GD_S_FLYING_STONE_FALLING,
336   GD_S_FLYING_STONE_IMPACT,
337   GD_S_WAITING_STONE_PUSHING,
338   GD_S_CHASING_STONE_PUSHING,
339   GD_S_NUT_PUSHING,
340   GD_S_NUT_FALLING,
341   GD_S_NUT_IMPACT,
342   GD_S_NUT_CRACKING,
343   GD_S_DIRT_BALL_FALLING,
344   GD_S_DIRT_BALL_IMPACT,
345   GD_S_DIRT_LOOSE_FALLING,
346   GD_S_DIRT_LOOSE_IMPACT,
347   GD_S_NITRO_PACK_PUSHING,
348   GD_S_NITRO_PACK_FALLING,
349   GD_S_NITRO_PACK_IMPACT,
350   GD_S_FALLING_WALL_FALLING,
351   GD_S_FALLING_WALL_IMPACT,
352   GD_S_EXPANDING_WALL,
353   GD_S_WALL_REAPPEARING,
354   GD_S_DIAMOND_FALLING_RANDOM,          // randomly select a diamond falling sound
355   GD_S_DIAMOND_FALLING_1,
356   GD_S_DIAMOND_FALLING_2,
357   GD_S_DIAMOND_FALLING_3,
358   GD_S_DIAMOND_FALLING_4,
359   GD_S_DIAMOND_FALLING_5,
360   GD_S_DIAMOND_FALLING_6,
361   GD_S_DIAMOND_FALLING_7,
362   GD_S_DIAMOND_FALLING_8,
363   GD_S_DIAMOND_IMPACT_RANDOM,           // randomly select a diamond impact sound
364   GD_S_DIAMOND_IMPACT_1,
365   GD_S_DIAMOND_IMPACT_2,
366   GD_S_DIAMOND_IMPACT_3,
367   GD_S_DIAMOND_IMPACT_4,
368   GD_S_DIAMOND_IMPACT_5,
369   GD_S_DIAMOND_IMPACT_6,
370   GD_S_DIAMOND_IMPACT_7,
371   GD_S_DIAMOND_IMPACT_8,
372   GD_S_FLYING_DIAMOND_FALLING_RANDOM,   // randomly select a flying diamond falling sound
373   GD_S_FLYING_DIAMOND_FALLING_1,
374   GD_S_FLYING_DIAMOND_FALLING_2,
375   GD_S_FLYING_DIAMOND_FALLING_3,
376   GD_S_FLYING_DIAMOND_FALLING_4,
377   GD_S_FLYING_DIAMOND_FALLING_5,
378   GD_S_FLYING_DIAMOND_FALLING_6,
379   GD_S_FLYING_DIAMOND_FALLING_7,
380   GD_S_FLYING_DIAMOND_FALLING_8,
381   GD_S_FLYING_DIAMOND_IMPACT_RANDOM,    // randomly select a flying diamond impact sound
382   GD_S_FLYING_DIAMOND_IMPACT_1,
383   GD_S_FLYING_DIAMOND_IMPACT_2,
384   GD_S_FLYING_DIAMOND_IMPACT_3,
385   GD_S_FLYING_DIAMOND_IMPACT_4,
386   GD_S_FLYING_DIAMOND_IMPACT_5,
387   GD_S_FLYING_DIAMOND_IMPACT_6,
388   GD_S_FLYING_DIAMOND_IMPACT_7,
389   GD_S_FLYING_DIAMOND_IMPACT_8,
390   GD_S_DIAMOND_COLLECTING,
391   GD_S_FLYING_DIAMOND_COLLECTING,
392   GD_S_SKELETON_COLLECTING,
393   GD_S_PNEUMATIC_COLLECTING,
394   GD_S_BOMB_COLLECTING,
395   GD_S_CLOCK_COLLECTING,
396   GD_S_SWEET_COLLECTING,
397   GD_S_KEY_COLLECTING,
398   GD_S_DIAMOND_KEY_COLLECTING,
399   GD_S_SLIME,
400   GD_S_LAVA,
401   GD_S_REPLICATOR,
402   GD_S_ACID_SPREADING,
403   GD_S_BLADDER_MOVING,
404   GD_S_BLADDER_PUSHING,
405   GD_S_BLADDER_CONVERTING,
406   GD_S_BLADDER_SPENDER,
407   GD_S_BITER_EATING,
408
409   GD_S_DOOR_OPENING,
410   GD_S_DIRT_WALKING,
411   GD_S_EMPTY_WALKING,
412   GD_S_STIRRING,
413   GD_S_BOX_PUSHING,
414   GD_S_TELEPORTER,
415   GD_S_TIMEOUT_10,
416   GD_S_TIMEOUT_9,
417   GD_S_TIMEOUT_8,
418   GD_S_TIMEOUT_7,
419   GD_S_TIMEOUT_6,
420   GD_S_TIMEOUT_5,
421   GD_S_TIMEOUT_4,
422   GD_S_TIMEOUT_3,
423   GD_S_TIMEOUT_2,
424   GD_S_TIMEOUT_1,
425   GD_S_TIMEOUT_0,
426   GD_S_EXPLODING,
427   GD_S_BOMB_EXPLODING,
428   GD_S_GHOST_EXPLODING,
429   GD_S_VOODOO_EXPLODING,
430   GD_S_NITRO_PACK_EXPLODING,
431   GD_S_BOMB_PLACING,
432   GD_S_FINISHED,                // loop
433   GD_S_SWITCH_BITER,
434   GD_S_SWITCH_CREATURES,
435   GD_S_SWITCH_GRAVITY,
436   GD_S_SWITCH_EXPANDING,
437   GD_S_SWITCH_CONVEYOR,
438   GD_S_SWITCH_REPLICATOR,
439
440   GD_S_AMOEBA,                  // loop
441   GD_S_AMOEBA_MAGIC,            // loop
442   GD_S_MAGIC_WALL,              // loop
443   GD_S_COVERING,                // loop
444   GD_S_PNEUMATIC_HAMMER,        // loop
445   GD_S_WATER,                   // loop
446
447   GD_S_CRACKING,
448   GD_S_GRAVITY_CHANGING,
449   GD_S_BONUS_LIFE,
450
451   GD_S_MAX,
452 } GdSound;
453
454 #endif  // BD_ELEMENTS_H