#define EP_PUSHABLE 24
/* values for special configurable properties (depending on level settings) */
-#define EP_EM_SLIPPERY_WALL 25
+#define EP_EM_SLIPPERY_WALL 32
/* values for special graphics properties (no effect on game engine) */
-#define EP_CAN_BE_CRUMBLED 26
+#define EP_CAN_BE_CRUMBLED 33
/* values for pre-defined properties */
-#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
+#define EP_PLAYER 34
+#define EP_CAN_PASS_MAGIC_WALL 35
+#define EP_SWITCHABLE 36
+#define EP_BD_ELEMENT 37
+#define EP_SP_ELEMENT 38
+#define EP_SB_ELEMENT 39
+#define EP_GEM 40
+#define EP_FOOD_DARK_YAMYAM 41
+#define EP_FOOD_PENGUIN 42
+#define EP_FOOD_PIG 43
+#define EP_HISTORIC_WALL 44
+#define EP_HISTORIC_SOLID 45
+#define EP_CLASSIC_ENEMY 46
+#define EP_BELT 47
+#define EP_BELT_ACTIVE 48
+#define EP_BELT_SWITCH 49
+#define EP_TUBE 50
+#define EP_KEYGATE 51
+#define EP_AMOEBOID 52
+#define EP_AMOEBALIVE 53
+#define EP_HAS_CONTENT 54
+#define EP_ACTIVE_BOMB 55
+#define EP_INACTIVE 56
/* values for derived properties (determined from properties above) */
-#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
-#define EP_CAN_SMASH 61
-#define EP_CAN_EXPLODE 62
+#define EP_ACCESSIBLE_OVER 57
+#define EP_ACCESSIBLE_INSIDE 58
+#define EP_ACCESSIBLE_UNDER 59
+#define EP_WALKABLE 60
+#define EP_PASSABLE 61
+#define EP_ACCESSIBLE 62
+#define EP_SNAPPABLE 63
+#define EP_WALL 64
+#define EP_SOLID_FOR_PUSHING 65
+#define EP_DRAGONFIRE_PROOF 66
+#define EP_EXPLOSION_PROOF 67
+#define EP_CAN_SMASH 68
+#define EP_CAN_EXPLODE 69
/* values for internal purpose only (level editor) */
-#define EP_EXPLODE_RESULT 63
-#define EP_WALK_TO_OBJECT 64
-#define EP_DEADLY 65
+#define EP_EXPLODE_RESULT 70
+#define EP_WALK_TO_OBJECT 71
+#define EP_DEADLY 72
-#define NUM_ELEMENT_PROPERTIES 66
+#define NUM_ELEMENT_PROPERTIES 73
#define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32)
#define EP_BITFIELD_BASE 0
#define CE_TOUCHED_BY_PLAYER 1
#define CE_PRESSED_BY_PLAYER 2
#define CE_PUSHED_BY_PLAYER 3
-#define CE_IMPACT 4
-#define CE_SMASHED 5
-#define CE_OTHER_COLLECTING 6
-#define CE_OTHER_PUSHING 7
-#define CE_OTHER_CHANGING 8
-#define CE_OTHER_EXPLODING 9
+#define CE_COLLISION 4
+#define CE_IMPACT 5
+#define CE_SMASHED 6
+#define CE_OTHER_IS_TOUCHING 7
+#define CE_OTHER_IS_CHANGING 8
+#define CE_OTHER_IS_EXPLODING 9
+#define CE_OTHER_GETS_TOUCHED 10
+#define CE_OTHER_GETS_PRESSED 11
+#define CE_OTHER_GETS_PUSHED 12
+#define CE_OTHER_GETS_COLLECTED 13
/* values for internal purpose only (level editor) */
-#define CE_BY_PLAYER 10
-#define CE_IMPACT_SMASHED 11
-#define CE_BY_OTHER 12
+#define CE_BY_PLAYER 14
+#define CE_BY_COLLISION 15
+#define CE_BY_OTHER 16
-#define NUM_CHANGE_EVENTS 13
+#define NUM_CHANGE_EVENTS 17
#define CE_BITMASK_DEFAULT 0
(CH_EVENT_VAR(e) |= CH_EVENT_BIT(c)) : \
(CH_EVENT_VAR(e) &= ~CH_EVENT_BIT(c))) : 0)
+/* values for change power for custom elements */
+#define CP_NON_DESTRUCTIVE 0
+#define CP_HALF_DESTRUCTIVE 1
+#define CP_FULL_DESTRUCTIVE 2
+
+/* values for special move patterns (bits 0-3: basic move directions) */
+#define MV_BIT_TOWARDS_PLAYER 4
+#define MV_BIT_AWAY_FROM_PLAYER 5
+#define MV_BIT_ALONG_LEFT_SIDE 6
+#define MV_BIT_ALONG_RIGHT_SIDE 7
+#define MV_BIT_TURNING_LEFT 8
+#define MV_BIT_TURNING_RIGHT 9
+
+/* values for special move patterns for custom elements */
+#define MV_HORIZONTAL (MV_LEFT | MV_RIGHT)
+#define MV_VERTICAL (MV_UP | MV_DOWN)
+#define MV_ALL_DIRECTIONS (MV_HORIZONTAL | MV_VERTICAL)
+#define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS)
+#define MV_TOWARDS_PLAYER (1 << MV_BIT_TOWARDS_PLAYER)
+#define MV_AWAY_FROM_PLAYER (1 << MV_BIT_AWAY_FROM_PLAYER)
+#define MV_ALONG_LEFT_SIDE (1 << MV_BIT_ALONG_LEFT_SIDE)
+#define MV_ALONG_RIGHT_SIDE (1 << MV_BIT_ALONG_RIGHT_SIDE)
+#define MV_TURNING_LEFT (1 << MV_BIT_TURNING_LEFT)
+#define MV_TURNING_RIGHT (1 << MV_BIT_TURNING_RIGHT)
+
+/* values for slippery property for custom elements */
+#define SLIPPERY_ANY_RANDOM 0
+#define SLIPPERY_ANY_LEFT_RIGHT 1
+#define SLIPPERY_ANY_RIGHT_LEFT 2
+#define SLIPPERY_ONLY_LEFT 3
+#define SLIPPERY_ONLY_RIGHT 4
/* macros for configurable properties */
#define IS_DIGGABLE(e) HAS_PROPERTY(e, EP_DIGGABLE)
/* boundaries of arrays etc. */
#define MAX_LEVEL_NAME_LEN 32
#define MAX_LEVEL_AUTHOR_LEN 32
+#define MAX_ELEMENT_NAME_LEN 32
#define MAX_TAPELEN (1000 * 50) /* max. time * framerate */
#define MAX_SCORE_ENTRIES 100
#define MAX_NUM_AMOEBA 100
boolean gravity;
boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */
+ short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+
+ boolean use_custom_template; /* use custom properties from template file */
+
boolean no_level_file;
};
{
unsigned long events; /* bitfield for change events */
+ short target_element; /* target element after change */
+
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 trigger; /* custom element triggering change */
+ short trigger_element; /* custom element triggering change */
+
+ int content[3][3]; /* new elements after extended change */
+ boolean use_content; /* use extended change content */
+ boolean only_complete; /* only use complete content */
+ boolean use_random_change; /* use random value for setting content */
+ int random; /* random value for setting content */
+ int power; /* power of extended change */
- short successor; /* new custom element after change */
+ boolean explode; /* explode instead of change */
+
+ /* functions that are called before, while and after the change of an
+ element -- currently only used for non-custom elements */
+ void (*pre_change_function)(int x, int y);
+ void (*change_function)(int x, int y);
+ void (*post_change_function)(int x, int y);
};
struct ElementInfo
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 */
+ char *editor_description; /* pre-defined description for level editor */
+ char *custom_description; /* alternative description from config file */
+ char description[MAX_ELEMENT_NAME_LEN + 1]; /* for custom elements */
/* ---------- graphic and sound definitions ---------- */
/* ---------- special element property values ---------- */
- boolean use_template; /* use all properties from template file */
-
- boolean use_gfx_element;
+ boolean use_gfx_element; /* use custom graphic element */
short gfx_element; /* optional custom graphic element */
- int score; /* score for collection, smashing, ... */
+ int score; /* score value for collecting */
+ int gem_count; /* gem count value for collecting */
int push_delay_fixed; /* constant frame delay for pushing */
int push_delay_random; /* additional random frame delay for pushing */
int move_direction_initial; /* initial direction element moves to */
int move_stepsize; /* step size element moves with */
+ int slippery_type; /* how/where other elements slip away */
+
int content[3][3]; /* new elements after explosion */
struct ElementChangeInfo change;
+
+ /* ---------- internal values used in level editor ---------- */
+
+ int access_type; /* walkable or passable */
+ int access_layer; /* accessible over/inside/under */
+ int walk_to_action; /* diggable/collectible/pushable */
+ int smash_targets; /* can smash player/enemies/everything */
+ int deadliness; /* deadly when running/colliding/touching */
+ int consistency; /* indestructible/can explode */
+ int change_player_action; /* touched/pressed/pushed by player */
+ int change_collide_action; /* collision/impact/smashed */
+ int change_other_action; /* various change actions */
+
+ boolean can_explode_by_fire; /* element explodes by fire */
+ boolean can_explode_smashed; /* element explodes when smashed */
+ boolean can_explode_impact; /* element explodes on impact */
};
struct FontInfo
extern int redraw_x1, redraw_y1;
extern short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int graphics_action_mapping[];
-extern struct LevelInfo level;
+extern struct LevelInfo level, level_template;
extern struct PlayerInfo stored_player[], *local_player;
extern struct HiScore highscore[];
extern struct TapeInfo tape;