/* values for configurable properties (custom elem's only, else pre-defined) */
#define EP_DIGGABLE 0
#define EP_COLLECTIBLE 1
-#define EP_UNUSED_2 2
-#define EP_UNUSED_3 3
-#define EP_UNUSED_4 4
+#define EP_DONT_RUN_INTO 2
+#define EP_DONT_COLLIDE_WITH 3
+#define EP_DONT_TOUCH 4
#define EP_INDESTRUCTIBLE 5
#define EP_SLIPPERY 6
-#define EP_UNUSED_7 7
-#define EP_UNUSED_8 8
+#define EP_CAN_EXPLODE_BY_FIRE 7
+#define EP_CAN_MOVE 8
#define EP_CAN_FALL 9
#define EP_CAN_SMASH 10
#define EP_WALKABLE_OVER 11
#define EP_PASSABLE_INSIDE 15
#define EP_PASSABLE_UNDER 16
#define EP_CHANGEABLE 17
-#define EP_UNUSED_18 18
-#define EP_UNUSED_19 19
+#define EP_CAN_EXPLODE_SMASHED 18
+#define EP_CAN_EXPLODE_IMPACT 19
#define EP_UNUSED_20 20
#define EP_UNUSED_21 21
#define EP_UNUSED_22 22
/* values for special configurable properties (depending on level settings) */
#define EP_EM_SLIPPERY_WALL 25
+/* values for special graphics properties (no effect on game engine) */
+#define EP_CAN_BE_CRUMBLED 26
+
/* values for pre-defined properties */
-#define EP_PLAYER 26
-#define EP_CAN_BE_CRUMBLED 27
-#define EP_CAN_MOVE 28
-#define EP_CAN_PASS_MAGIC_WALL 29
-#define EP_SWITCHABLE 30
-#define EP_DONT_TOUCH 31
-#define EP_ENEMY 32
-#define EP_DONT_GO_TO 33
-#define EP_CAN_EXPLODE 34
-#define EP_BD_ELEMENT 35
-#define EP_SP_ELEMENT 36
-#define EP_SB_ELEMENT 37
-#define EP_GEM 38
-#define EP_FOOD_DARK_YAMYAM 39
-#define EP_FOOD_PENGUIN 40
-#define EP_FOOD_PIG 41
-#define EP_HISTORIC_WALL 42
-#define EP_HISTORIC_SOLID 43
-#define EP_BELT 44
-#define EP_BELT_ACTIVE 45
-#define EP_BELT_SWITCH 46
-#define EP_TUBE 47
-#define EP_KEYGATE 48
-#define EP_AMOEBOID 49
-#define EP_AMOEBALIVE 50
-#define EP_HAS_CONTENT 51
-#define EP_ACTIVE_BOMB 52
-#define EP_INACTIVE 53
+#define EP_PLAYER 27
+#define EP_CAN_PASS_MAGIC_WALL 28
+#define EP_SWITCHABLE 29
+#define EP_BD_ELEMENT 30
+#define EP_SP_ELEMENT 31
+#define EP_SB_ELEMENT 32
+#define EP_GEM 33
+#define EP_FOOD_DARK_YAMYAM 34
+#define EP_FOOD_PENGUIN 35
+#define EP_FOOD_PIG 36
+#define EP_HISTORIC_WALL 37
+#define EP_HISTORIC_SOLID 38
+#define EP_CLASSIC_ENEMY 39
+#define EP_BELT 40
+#define EP_BELT_ACTIVE 41
+#define EP_BELT_SWITCH 42
+#define EP_TUBE 43
+#define EP_KEYGATE 44
+#define EP_AMOEBOID 45
+#define EP_AMOEBALIVE 46
+#define EP_HAS_CONTENT 47
+#define EP_ACTIVE_BOMB 48
+#define EP_INACTIVE 49
/* values for derived properties (determined from properties above) */
-#define EP_ACCESSIBLE_OVER 54
-#define EP_ACCESSIBLE_INSIDE 55
-#define EP_ACCESSIBLE_UNDER 56
-#define EP_WALKABLE 57
-#define EP_PASSABLE 58
-#define EP_ACCESSIBLE 59
-#define EP_SNAPPABLE 60
-#define EP_WALL 61
-#define EP_SOLID_FOR_PUSHING 62
-#define EP_DRAGONFIRE_PROOF 63
-#define EP_EXPLOSION_PROOF 64
-
-#define NUM_ELEMENT_PROPERTIES 65
+#define EP_ACCESSIBLE_OVER 50
+#define EP_ACCESSIBLE_INSIDE 51
+#define EP_ACCESSIBLE_UNDER 52
+#define EP_WALKABLE 53
+#define EP_PASSABLE 54
+#define EP_ACCESSIBLE 55
+#define EP_SNAPPABLE 56
+#define EP_WALL 57
+#define EP_SOLID_FOR_PUSHING 58
+#define EP_DRAGONFIRE_PROOF 59
+#define EP_EXPLOSION_PROOF 60
+
+/* values for internal purpose only (level editor) */
+#define EP_EXPLODE_RESULT 61
+#define EP_WALK_TO_OBJECT 62
+#define EP_DEADLY 63
+
+#define NUM_ELEMENT_PROPERTIES 64
#define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32)
#define EP_BITFIELD_BASE 0
/* values for change events for custom elements */
-#define CE_DELAY_FIXED 0
-#define CE_DELAY_RANDOM 1
+#define CE_DELAY 0
+#define CE_PRESSED_BY_PLAYER 1
+#define CE_TOUCHED_BY_PLAYER 2
-#define NUM_CHANGE_EVENTS 2
+/* values for internal purpose only (level editor) */
+#define CE_BY_PLAYER 3
-#define CE_BITMASK_DEFAULT 0
+#define NUM_CHANGE_EVENTS 4
-#define CUSTOM_ELEMENT_INFO(e) (level.custom_element[(e) - EL_CUSTOM_START])
+#define CE_BITMASK_DEFAULT 0
#define CH_EVENT_BIT(c) (1 << (c))
-#define CH_EVENT_VAR(e) (CUSTOM_ELEMENT_INFO(e).change.events)
+#define CH_EVENT_VAR(e) (element_info[e].change.events)
#define HAS_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \
(CH_EVENT_VAR(e) & CH_EVENT_BIT(c)) != 0)
/* macros for configurable properties */
#define IS_DIGGABLE(e) HAS_PROPERTY(e, EP_DIGGABLE)
#define IS_COLLECTIBLE(e) HAS_PROPERTY(e, EP_COLLECTIBLE)
+#define DONT_RUN_INTO(e) HAS_PROPERTY(e, EP_DONT_RUN_INTO)
+#define DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_DONT_COLLIDE_WITH)
+#define DONT_TOUCH(e) HAS_PROPERTY(e, EP_DONT_TOUCH)
#define IS_INDESTRUCTIBLE(e) HAS_PROPERTY(e, EP_INDESTRUCTIBLE)
#define IS_SLIPPERY(e) HAS_PROPERTY(e, EP_SLIPPERY)
+#define CAN_EXPLODE_BY_FIRE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_FIRE)
+#define CAN_MOVE(e) HAS_PROPERTY(e, EP_CAN_MOVE)
#define CAN_FALL(e) HAS_PROPERTY(e, EP_CAN_FALL)
#define CAN_SMASH(e) HAS_PROPERTY(e, EP_CAN_SMASH)
#define IS_WALKABLE_OVER(e) HAS_PROPERTY(e, EP_WALKABLE_OVER)
#define IS_PASSABLE_OVER(e) HAS_PROPERTY(e, EP_PASSABLE_OVER)
#define IS_PASSABLE_INSIDE(e) HAS_PROPERTY(e, EP_PASSABLE_INSIDE)
#define IS_PASSABLE_UNDER(e) HAS_PROPERTY(e, EP_PASSABLE_UNDER)
-#define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE)
#define IS_CHANGEABLE(e) HAS_PROPERTY(e, EP_CHANGEABLE)
+#define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE)
/* macros for special configurable properties */
#define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL)
+/* macros for special graphics properties */
+#define CAN_BE_CRUMBLED(e) HAS_PROPERTY(GFX_ELEMENT(e),EP_CAN_BE_CRUMBLED)
+
/* macros for pre-defined properties */
#define ELEM_IS_PLAYER(e) HAS_PROPERTY(e, EP_PLAYER)
-#define CAN_BE_CRUMBLED(e) HAS_PROPERTY(e, EP_CAN_BE_CRUMBLED)
-#define CAN_MOVE(e) HAS_PROPERTY(e, EP_CAN_MOVE)
#define CAN_PASS_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL)
#define IS_SWITCHABLE(e) HAS_PROPERTY(e, EP_SWITCHABLE)
-#define DONT_TOUCH(e) HAS_PROPERTY(e, EP_DONT_TOUCH)
-#define IS_ENEMY(e) HAS_PROPERTY(e, EP_ENEMY)
-#define DONT_GO_TO(e) HAS_PROPERTY(e, EP_DONT_GO_TO)
-#define IS_CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE)
#define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT)
#define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT)
#define IS_SB_ELEMENT(e) HAS_PROPERTY(e, EP_SB_ELEMENT)
#define IS_FOOD_PIG(e) HAS_PROPERTY(e, EP_FOOD_PIG)
#define IS_HISTORIC_WALL(e) HAS_PROPERTY(e, EP_HISTORIC_WALL)
#define IS_HISTORIC_SOLID(e) HAS_PROPERTY(e, EP_HISTORIC_SOLID)
+#define IS_CLASSIC_ENEMY(e) HAS_PROPERTY(e, EP_CLASSIC_ENEMY)
#define IS_BELT(e) HAS_PROPERTY(e, EP_BELT)
#define IS_BELT_ACTIVE(e) HAS_PROPERTY(e, EP_BELT_ACTIVE)
#define IS_BELT_SWITCH(e) HAS_PROPERTY(e, EP_BELT_SWITCH)
#define IS_DRAGONFIRE_PROOF(e) HAS_PROPERTY(e, EP_DRAGONFIRE_PROOF)
#define IS_EXPLOSION_PROOF(e) HAS_PROPERTY(e, EP_EXPLOSION_PROOF)
-#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \
+#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \
(e) <= EL_CUSTOM_END)
+#define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \
+ element_info[e].gfx_element : e)
+
#define IS_PLAYER(x,y) (ELEM_IS_PLAYER(StorePlayer[x][y]))
#define IS_FREE(x,y) (Feld[x][y] == EL_EMPTY && !IS_PLAYER(x,y))
#define IS_LOOP_SOUND(s) (sound_info[s].loop)
-#if 0
-
-/* Bitmaps with graphic file */
-#define PIX_BACK 0
-#define PIX_DOOR 1
-#define PIX_TOONS 2
-#define PIX_FONT_BIG 3
-#define PIX_FONT_SMALL 4
-#define PIX_FONT_MEDIUM 5
-#define PIX_FONT_EM 6
-/* Bitmaps without graphic file */
-#define PIX_DB_DOOR 7
-#define PIX_DB_FIELD 8
-
-#define NUM_PICTURES 7
-#define NUM_BITMAPS 9
-
-#else
-
-/* Bitmaps with graphic file */
-#define PIX_BACK 0
-#define PIX_ELEMENTS 1
-#define PIX_DOOR 2
-#define PIX_HEROES 3
-#define PIX_TOONS 4
-#define PIX_SP 5
-#define PIX_DC 6
-#define PIX_MORE 7
-#define PIX_FONT_BIG 8
-#define PIX_FONT_SMALL 9
-#define PIX_FONT_MEDIUM 10
-#define PIX_FONT_EM 11
-/* Bitmaps without graphic file */
-#define PIX_DB_DOOR 12
-#define PIX_DB_FIELD 13
-
-#define NUM_PICTURES 12
-#define NUM_BITMAPS 14
-
-#endif
-
/* boundaries of arrays etc. */
#define MAX_LEVEL_NAME_LEN 32
#define MAX_LEVEL_AUTHOR_LEN 32
#define MAX_TAPELEN (1000 * 50) /* max. time * framerate */
#define MAX_SCORE_ENTRIES 100
-#if 0
-#define MAX_ELEMENTS 700 /* 500 static + 200 runtime */
-#define MAX_GRAPHICS 1536 /* see below: NUM_TILES */
-#endif
#define MAX_NUM_AMOEBA 100
/* values for elements with content */
#define PROGRAM_VERSION_MAJOR 2
#define PROGRAM_VERSION_MINOR 2
#define PROGRAM_VERSION_PATCH 0
+#define PROGRAM_VERSION_RELEASE 7
#define PROGRAM_VERSION_STRING "2.2.0rc7"
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define GAME_VERSION_1_4 FILE_VERSION_1_4
#define GAME_VERSION_2_0 FILE_VERSION_2_0
-#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
+#define GAME_VERSION_ACTUAL RELEASE_IDENT(PROGRAM_VERSION_MAJOR, \
PROGRAM_VERSION_MINOR, \
- PROGRAM_VERSION_PATCH)
+ PROGRAM_VERSION_PATCH, \
+ PROGRAM_VERSION_RELEASE)
/* values for game_emulation */
#define EMU_NONE 0
int shield_deadly_time_left;
};
-struct CustomElementChangeInfo
-{
- unsigned long events; /* bitfield for change events */
-
- short successor; /* new custom element after change */
-
- int delay_fixed; /* added frame delay before changed (fixed) */
- int delay_random; /* added frame delay before changed (random) */
-};
-
-struct CustomElementInfo
-{
- struct CustomElementChangeInfo change;
-};
-
struct LevelInfo
{
int file_version; /* file format version the level is stored with */
char name[MAX_LEVEL_NAME_LEN + 1];
char author[MAX_LEVEL_AUTHOR_LEN + 1];
int score[LEVEL_SCORE_ELEMENTS];
- int yam_content[MAX_ELEMENT_CONTENTS][3][3];
- int num_yam_contents;
+ int yamyam_content[MAX_ELEMENT_CONTENTS][3][3];
+ int num_yamyam_contents;
int amoeba_speed;
int amoeba_content;
int time_magic_wall;
boolean gravity;
boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */
- struct CustomElementInfo custom_element[NUM_CUSTOM_ELEMENTS];
-
boolean no_level_file;
};
int initial_move_delay_value;
/* variable within running game */
- int yam_content_nr;
+ int yamyam_content_nr;
boolean magic_wall_active;
int magic_wall_time_left;
int light_time_left;
int step_delay;
};
+struct ElementChangeInfo
+{
+ unsigned long events; /* bitfield for change events */
+
+ int delay_fixed; /* added frame delay before changed (fixed) */
+ int delay_random; /* added frame delay before changed (random) */
+ int delay_frames; /* either 1 (frames) or 50 (seconds; 50 fps) */
+
+ short successor; /* new custom element after change */
+};
+
struct ElementInfo
{
+ /* ---------- token and description strings ---------- */
+
char *token_name; /* element token used in config files */
char *class_name; /* element class used in config files */
char *editor_description; /* short description for level editor */
char *custom_description; /* custom description for level editor */
+ /* ---------- graphic and sound definitions ---------- */
+
int graphic[NUM_ACTIONS]; /* default graphics for several actions */
int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
/* special graphics for left/right/up/down */
/* special graphics for certain screens */
int sound[NUM_ACTIONS]; /* default sounds for several actions */
+
+ /* ---------- special element property values ---------- */
+
+ boolean use_template; /* use all properties from template file */
+
+ boolean use_gfx_element;
+ short gfx_element; /* optional custom graphic element */
+
+ int score; /* score for collection, smashing, ... */
+
+ int push_delay_fixed; /* constant frame delay for pushing */
+ int push_delay_random; /* additional random frame delay for pushing */
+ int move_delay_fixed; /* constant frame delay for moving */
+ int move_delay_random; /* additional random frame delay for moving */
+
+ int move_pattern; /* direction movable element moves to */
+ int move_direction_initial; /* initial direction element moves to */
+
+ int consistency; /* only for level editor; not stored */
+ int walk_to_action; /* only for level editor; not stored */
+ int deadliness; /* only for level editor; not stored */
+ int walkable_layer; /* only for level editor; not stored */
+
+ int content[3][3]; /* new elements after explosion */
+
+ struct ElementChangeInfo change;
};
struct FontInfo