#include <fcntl.h>
#include "libgame/libgame.h"
+#include "game_em/game_em.h"
#include "conf_gfx.h" /* include auto-generated data structure definitions */
#include "conf_snd.h" /* include auto-generated data structure definitions */
#include "conf_mus.h" /* include auto-generated data structure definitions */
-#define IMG_UNDEFINED (-1)
-#define IMG_EMPTY IMG_EMPTY_SPACE
-#define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE
-#define IMG_EXPLOSION IMG_DEFAULT_EXPLODING
-#define IMG_CHAR_START IMG_CHAR_SPACE
-#define IMG_CUSTOM_START IMG_CUSTOM_1
-
-#define SND_UNDEFINED (-1)
-#define MUS_UNDEFINED (-1)
-
-#define WIN_XSIZE 672
-#define WIN_YSIZE 560
-
-#define SCR_FIELDX 17
-#define SCR_FIELDY 17
-#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
-#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
-#define MIN_LEV_FIELDX 3
-#define MIN_LEV_FIELDY 3
-#define STD_LEV_FIELDX 64
-#define STD_LEV_FIELDY 32
-#define MAX_LEV_FIELDX 128
-#define MAX_LEV_FIELDY 128
-
-#define SCREENX(a) ((a) - scroll_x)
-#define SCREENY(a) ((a) - scroll_y)
-#define LEVELX(a) ((a) + scroll_x)
-#define LEVELY(a) ((a) + scroll_y)
+#define IMG_UNDEFINED (-1)
+#define IMG_EMPTY IMG_EMPTY_SPACE
+#define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE
+#define IMG_EXPLOSION IMG_DEFAULT_EXPLODING
+#define IMG_CHAR_START IMG_CHAR_SPACE
+#define IMG_CUSTOM_START IMG_CUSTOM_1
+
+#define SND_UNDEFINED (-1)
+#define MUS_UNDEFINED (-1)
+
+#define WIN_XSIZE 672
+#define WIN_YSIZE 560
+
+#define SCR_FIELDX 17
+#define SCR_FIELDY 17
+#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
+#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
+#define MIN_LEV_FIELDX 3
+#define MIN_LEV_FIELDY 3
+#define STD_LEV_FIELDX 64
+#define STD_LEV_FIELDY 32
+#define MAX_LEV_FIELDX 128
+#define MAX_LEV_FIELDY 128
+
+#define SCREENX(a) ((a) - scroll_x)
+#define SCREENY(a) ((a) - scroll_y)
+#define LEVELX(a) ((a) + scroll_x)
+#define LEVELY(a) ((a) + scroll_y)
#define IN_VIS_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
#define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2)
#define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
/* values for configurable properties (custom elem's only, else pre-defined) */
-#define EP_DIGGABLE 0
-#define EP_COLLECTIBLE_ONLY 1
-#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_CAN_CHANGE 7
-#define EP_CAN_MOVE 8
-#define EP_CAN_FALL 9
-#define EP_CAN_SMASH_PLAYER 10
-#define EP_CAN_SMASH_ENEMIES 11
-#define EP_CAN_SMASH_EVERYTHING 12
-#define EP_EXPLODES_BY_FIRE 13
-#define EP_EXPLODES_SMASHED 14
-#define EP_EXPLODES_IMPACT 15
-#define EP_WALKABLE_OVER 16
-#define EP_WALKABLE_INSIDE 17
-#define EP_WALKABLE_UNDER 18
-#define EP_PASSABLE_OVER 19
-#define EP_PASSABLE_INSIDE 20
-#define EP_PASSABLE_UNDER 21
-#define EP_DROPPABLE 22
-#define EP_EXPLODES_1X1_OLD 23
-#define EP_PUSHABLE 24
-#define EP_EXPLODES_CROSS_OLD 25
-#define EP_PROTECTED 26
-#define EP_CAN_MOVE_INTO_ACID 27
-#define EP_THROWABLE 28
-#define EP_CAN_EXPLODE 29
+#define EP_DIGGABLE 0
+#define EP_COLLECTIBLE_ONLY 1
+#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_CAN_CHANGE 7
+#define EP_CAN_MOVE 8
+#define EP_CAN_FALL 9
+#define EP_CAN_SMASH_PLAYER 10
+#define EP_CAN_SMASH_ENEMIES 11
+#define EP_CAN_SMASH_EVERYTHING 12
+#define EP_EXPLODES_BY_FIRE 13
+#define EP_EXPLODES_SMASHED 14
+#define EP_EXPLODES_IMPACT 15
+#define EP_WALKABLE_OVER 16
+#define EP_WALKABLE_INSIDE 17
+#define EP_WALKABLE_UNDER 18
+#define EP_PASSABLE_OVER 19
+#define EP_PASSABLE_INSIDE 20
+#define EP_PASSABLE_UNDER 21
+#define EP_DROPPABLE 22
+#define EP_EXPLODES_1X1_OLD 23
+#define EP_PUSHABLE 24
+#define EP_EXPLODES_CROSS_OLD 25
+#define EP_PROTECTED 26
+#define EP_CAN_MOVE_INTO_ACID 27
+#define EP_THROWABLE 28
+#define EP_CAN_EXPLODE 29
+#define EP_GRAVITY_REACHABLE 30
/* values for pre-defined properties */
-#define EP_PLAYER 32
-#define EP_CAN_PASS_MAGIC_WALL 33
-#define EP_SWITCHABLE 34
-#define EP_BD_ELEMENT 35
-#define EP_SP_ELEMENT 36
-#define EP_SB_ELEMENT 37
-#define EP_SP_BUGGY_BASE 38
-#define EP_GEM 39
-#define EP_FOOD_DARK_YAMYAM 40
-#define EP_FOOD_PENGUIN 41
-#define EP_FOOD_PIG 42
-#define EP_HISTORIC_WALL 43
-#define EP_HISTORIC_SOLID 44
-#define EP_CLASSIC_ENEMY 45
-#define EP_BELT 46
-#define EP_BELT_ACTIVE 47
-#define EP_BELT_SWITCH 48
-#define EP_TUBE 49
-#define EP_KEYGATE 50
-#define EP_AMOEBOID 51
-#define EP_AMOEBALIVE 52
-#define EP_HAS_CONTENT 53
-#define EP_CAN_TURN_EACH_MOVE 54
-#define EP_CAN_GROW 55
-#define EP_ACTIVE_BOMB 56
-#define EP_INACTIVE 57
+#define EP_PLAYER 32
+#define EP_CAN_PASS_MAGIC_WALL 33
+#define EP_SWITCHABLE 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_CLASSIC_ENEMY 44
+#define EP_BELT 45
+#define EP_BELT_ACTIVE 46
+#define EP_BELT_SWITCH 47
+#define EP_TUBE 48
+#define EP_KEYGATE 49
+#define EP_AMOEBOID 50
+#define EP_AMOEBALIVE 51
+#define EP_HAS_CONTENT 52
+#define EP_CAN_TURN_EACH_MOVE 53
+#define EP_CAN_GROW 54
+#define EP_ACTIVE_BOMB 55
+#define EP_INACTIVE 56
/* values for special configurable properties (depending on level settings) */
-#define EP_EM_SLIPPERY_WALL 58
+#define EP_EM_SLIPPERY_WALL 57
/* values for special graphics properties (no effect on game engine) */
-#define EP_GFX_CRUMBLED 59
+#define EP_GFX_CRUMBLED 58
/* values for derived properties (determined from properties above) */
-#define EP_ACCESSIBLE_OVER 60
-#define EP_ACCESSIBLE_INSIDE 61
-#define EP_ACCESSIBLE_UNDER 62
-#define EP_WALKABLE 63
-#define EP_PASSABLE 64
-#define EP_ACCESSIBLE 65
-#define EP_COLLECTIBLE 66
-#define EP_SNAPPABLE 67
-#define EP_WALL 68
-#define EP_SOLID_FOR_PUSHING 69
-#define EP_DRAGONFIRE_PROOF 70
-#define EP_EXPLOSION_PROOF 71
-#define EP_CAN_SMASH 72
-#define EP_EXPLODES_3X3_OLD 73
-#define EP_CAN_EXPLODE_BY_FIRE 74
-#define EP_CAN_EXPLODE_SMASHED 75
-#define EP_CAN_EXPLODE_IMPACT 76
-#define EP_SP_PORT 77
-#define EP_CAN_EXPLODE_BY_DRAGONFIRE 78
-#define EP_CAN_EXPLODE_BY_EXPLOSION 79
-#define EP_COULD_MOVE_INTO_ACID 80
-#define EP_MAYBE_DONT_COLLIDE_WITH 81
-#define EP_DIGGABLE_WITH_GRAVITY 82
+#define EP_ACCESSIBLE_OVER 59
+#define EP_ACCESSIBLE_INSIDE 60
+#define EP_ACCESSIBLE_UNDER 61
+#define EP_WALKABLE 62
+#define EP_PASSABLE 63
+#define EP_ACCESSIBLE 64
+#define EP_COLLECTIBLE 65
+#define EP_SNAPPABLE 66
+#define EP_WALL 67
+#define EP_SOLID_FOR_PUSHING 68
+#define EP_DRAGONFIRE_PROOF 69
+#define EP_EXPLOSION_PROOF 70
+#define EP_CAN_SMASH 71
+#define EP_EXPLODES_3X3_OLD 72
+#define EP_CAN_EXPLODE_BY_FIRE 73
+#define EP_CAN_EXPLODE_SMASHED 74
+#define EP_CAN_EXPLODE_IMPACT 75
+#define EP_SP_PORT 76
+#define EP_CAN_EXPLODE_BY_DRAGONFIRE 77
+#define EP_CAN_EXPLODE_BY_EXPLOSION 78
+#define EP_COULD_MOVE_INTO_ACID 79
+#define EP_MAYBE_DONT_COLLIDE_WITH 80
/* values for internal purpose only (level editor) */
-#define EP_WALK_TO_OBJECT 83
-#define EP_DEADLY 84
+#define EP_WALK_TO_OBJECT 81
+#define EP_DEADLY 82
-#define NUM_ELEMENT_PROPERTIES 85
+/* values for internal purpose only (game engine) */
+#define EP_HAS_ACTION 83
+#define EP_CAN_CHANGE_OR_HAS_ACTION 84
-#define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32)
-#define EP_BITFIELD_BASE 0
+#define NUM_ELEMENT_PROPERTIES 85
-#define EP_BITMASK_DEFAULT 0
+#define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32)
+#define EP_BITFIELD_BASE 0
-#define PROPERTY_BIT(p) (1 << ((p) % 32))
-#define PROPERTY_VAR(e,p) (Properties[e][(p) / 32])
+#define EP_BITMASK_DEFAULT 0
+
+#define PROPERTY_BIT(p) (1 << ((p) % 32))
+#define PROPERTY_VAR(e,p) (Properties[e][(p) / 32])
#define HAS_PROPERTY(e,p) ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0)
#define SET_PROPERTY(e,p,v) ((v) ? \
(PROPERTY_VAR(e,p) |= PROPERTY_BIT(p)) : \
/* values for change events for custom elements (stored in level file) */
-#define CE_DELAY 0
-#define CE_TOUCHED_BY_PLAYER 1
-#define CE_PRESSED_BY_PLAYER 2
-#define CE_PUSHED_BY_PLAYER 3
-#define CE_DROPPED_BY_PLAYER 4
-#define CE_HITTING_SOMETHING 5
-#define CE_IMPACT 6
-#define CE_SMASHED 7
-#define CE_OTHER_IS_TOUCHING 8
-#define CE_OTHER_IS_CHANGING 9
-#define CE_OTHER_IS_EXPLODING 10
-#define CE_OTHER_GETS_TOUCHED 11
-#define CE_OTHER_GETS_PRESSED 12
-#define CE_OTHER_GETS_PUSHED 13
-#define CE_OTHER_GETS_COLLECTED 14
-#define CE_OTHER_GETS_DROPPED 15
-#define CE_BY_PLAYER_OBSOLETE 16 /* obsolete; now CE_BY_DIRECT_ACTION */
-#define CE_BY_COLLISION_OBSOLETE 17 /* obsolete; now CE_BY_DIRECT_ACTION */
-#define CE_BY_OTHER_ACTION 18 /* activates other element events */
-#define CE_BY_DIRECT_ACTION 19 /* activates direct element events */
-#define CE_OTHER_GETS_DIGGED 20
-#define CE_ENTERED_BY_PLAYER 21
-#define CE_LEFT_BY_PLAYER 22
-#define CE_OTHER_GETS_ENTERED 23
-#define CE_OTHER_GETS_LEFT 24
-#define CE_SWITCHED 25
-#define CE_OTHER_IS_SWITCHING 26
-#define CE_HIT_BY_SOMETHING 27
-#define CE_OTHER_IS_HITTING 28
-#define CE_OTHER_GETS_HIT 29
-#define CE_BLOCKED 30
-
-#define NUM_CHANGE_EVENTS 31
-
-#define CE_BITMASK_DEFAULT 0
-
-#define CH_EVENT_BIT(c) (1 << (c))
-#define CH_EVENT_VAR(e) (element_info[e].change->events)
-#define CH_ANY_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)
-#define HAS_ANY_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \
- (CH_ANY_EVENT_VAR(e) & CH_EVENT_BIT(c)) != 0)
-#define SET_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \
- ((v) ? \
- (CH_EVENT_VAR(e) |= CH_EVENT_BIT(c)) : \
- (CH_EVENT_VAR(e) &= ~CH_EVENT_BIT(c))) : 0)
+#define CE_DELAY 0
+#define CE_TOUCHED_BY_PLAYER 1
+#define CE_PRESSED_BY_PLAYER 2
+#define CE_PUSHED_BY_PLAYER 3
+#define CE_DROPPED_BY_PLAYER 4
+#define CE_HITTING_SOMETHING 5
+#define CE_IMPACT 6
+#define CE_SMASHED 7
+#define CE_TOUCHING_X 8
+#define CE_CHANGE_OF_X 9
+#define CE_EXPLOSION_OF_X 10
+#define CE_PLAYER_TOUCHES_X 11
+#define CE_PLAYER_PRESSES_X 12
+#define CE_PLAYER_PUSHES_X 13
+#define CE_PLAYER_COLLECTS_X 14
+#define CE_PLAYER_DROPS_X 15
+#define CE_VALUE_GETS_ZERO 16
+#define CE_VALUE_GETS_ZERO_OF_X 17
+#define CE_BY_OTHER_ACTION 18
+#define CE_BY_DIRECT_ACTION 19
+#define CE_PLAYER_DIGS_X 20
+#define CE_ENTERED_BY_PLAYER 21
+#define CE_LEFT_BY_PLAYER 22
+#define CE_PLAYER_ENTERS_X 23
+#define CE_PLAYER_LEAVES_X 24
+#define CE_SWITCHED 25
+#define CE_SWITCH_OF_X 26
+#define CE_HIT_BY_SOMETHING 27
+#define CE_HITTING_X 28
+#define CE_HIT_BY_X 29
+#define CE_BLOCKED 30
+#define CE_SWITCHED_BY_PLAYER 31
+#define CE_PLAYER_SWITCHES_X 32
+#define CE_SNAPPED_BY_PLAYER 33
+#define CE_PLAYER_SNAPS_X 34
+#define CE_MOVE_OF_X 35
+
+#define NUM_CHANGE_EVENTS 36
+
+#define CE_BITMASK_DEFAULT 0
+
+#define CH_EVENT_VAR(e,c) (element_info[e].change->has_event[c])
+#define CH_ANY_EVENT_VAR(e,c) (element_info[e].has_change_event[c])
+
+#define PAGE_HAS_CHANGE_EVENT(p,c) ((p)->has_event[c])
+#define HAS_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \
+ CH_EVENT_VAR(e,c))
+#define HAS_ANY_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \
+ CH_ANY_EVENT_VAR(e,c))
+
+#define SET_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \
+ CH_EVENT_VAR(e,c) = (v) : 0)
+#define SET_ANY_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \
+ CH_ANY_EVENT_VAR(e,c) = (v) : 0)
+
+/* values for player bitmasks */
+#define PLAYER_BITS_NONE 0
+#define PLAYER_BITS_1 (1 << 0)
+#define PLAYER_BITS_2 (1 << 1)
+#define PLAYER_BITS_3 (1 << 2)
+#define PLAYER_BITS_4 (1 << 3)
+#define PLAYER_BITS_ANY (PLAYER_BITS_1 | \
+ PLAYER_BITS_2 | \
+ PLAYER_BITS_3 | \
+ PLAYER_BITS_4)
+#define PLAYER_BITS_TRIGGER (1 << 4)
+
+/* values for move directions (bits 0 - 3: basic move directions) */
+#define MV_BIT_PREVIOUS 4
+#define MV_BIT_TRIGGER 5
+#define MV_BIT_TRIGGER_BACK 6
+
+#define MV_PREVIOUS (1 << MV_BIT_PREVIOUS)
+#define MV_TRIGGER (1 << MV_BIT_TRIGGER)
+#define MV_TRIGGER_BACK (1 << MV_BIT_TRIGGER_BACK)
/* values for change side for custom elements */
-#define CH_SIDE_NONE MV_NO_MOVING
-#define CH_SIDE_LEFT MV_LEFT
-#define CH_SIDE_RIGHT MV_RIGHT
-#define CH_SIDE_TOP MV_UP
-#define CH_SIDE_BOTTOM MV_DOWN
-#define CH_SIDE_LEFT_RIGHT MV_HORIZONTAL
-#define CH_SIDE_TOP_BOTTOM MV_VERTICAL
-#define CH_SIDE_ANY MV_ANY_DIRECTION
+#define CH_SIDE_NONE MV_NONE
+#define CH_SIDE_LEFT MV_LEFT
+#define CH_SIDE_RIGHT MV_RIGHT
+#define CH_SIDE_TOP MV_UP
+#define CH_SIDE_BOTTOM MV_DOWN
+#define CH_SIDE_LEFT_RIGHT MV_HORIZONTAL
+#define CH_SIDE_TOP_BOTTOM MV_VERTICAL
+#define CH_SIDE_ANY MV_ANY_DIRECTION
/* values for change player for custom elements */
-#define CH_PLAYER_NONE 0
-#define CH_PLAYER_1 (1 << 0)
-#define CH_PLAYER_2 (1 << 1)
-#define CH_PLAYER_3 (1 << 2)
-#define CH_PLAYER_4 (1 << 3)
-#define CH_PLAYER_ANY (CH_PLAYER_1 | CH_PLAYER_2 | CH_PLAYER_3 | \
- CH_PLAYER_4)
+#define CH_PLAYER_NONE PLAYER_BITS_NONE
+#define CH_PLAYER_1 PLAYER_BITS_1
+#define CH_PLAYER_2 PLAYER_BITS_2
+#define CH_PLAYER_3 PLAYER_BITS_3
+#define CH_PLAYER_4 PLAYER_BITS_4
+#define CH_PLAYER_ANY PLAYER_BITS_ANY
/* values for change page for custom elements */
-#define CH_PAGE_ANY_FILE (0xff)
-#define CH_PAGE_ANY (0xffffffff)
+#define CH_PAGE_ANY_FILE (0xff)
+#define CH_PAGE_ANY (0xffffffff)
/* values for change power for custom elements */
-#define CP_WHEN_EMPTY 0
-#define CP_WHEN_DIGGABLE 1
-#define CP_WHEN_DESTRUCTIBLE 2
-#define CP_WHEN_COLLECTIBLE 3
-#define CP_WHEN_REMOVABLE 4
-#define CP_WHEN_WALKABLE 5
+#define CP_WHEN_EMPTY 0
+#define CP_WHEN_DIGGABLE 1
+#define CP_WHEN_DESTRUCTIBLE 2
+#define CP_WHEN_COLLECTIBLE 3
+#define CP_WHEN_REMOVABLE 4
+#define CP_WHEN_WALKABLE 5
+
+/* values for change actions for custom elements */
+#define CA_NO_ACTION 0
+#define CA_EXIT_PLAYER 1
+#define CA_KILL_PLAYER 2
+#define CA_MOVE_PLAYER 3
+#define CA_RESTART_LEVEL 4
+#define CA_SHOW_ENVELOPE 5
+#define CA_SET_LEVEL_TIME 6
+#define CA_SET_LEVEL_GEMS 7
+#define CA_SET_LEVEL_SCORE 8
+#define CA_SET_LEVEL_WIND 9
+#define CA_SET_LEVEL_GRAVITY 10
+#define CA_SET_PLAYER_KEYS 11
+#define CA_SET_PLAYER_SPEED 12
+#define CA_SET_PLAYER_SHIELD 13
+#define CA_SET_PLAYER_ARTWORK 14
+#define CA_SET_CE_SCORE 15
+#define CA_SET_CE_VALUE 16
+
+#define CA_HEADLINE_LEVEL_ACTIONS 250
+#define CA_HEADLINE_PLAYER_ACTIONS 251
+#define CA_HEADLINE_CE_ACTIONS 252
+#define CA_UNDEFINED 255
+
+/* values for change action mode for custom elements */
+#define CA_MODE_UNDEFINED 0
+#define CA_MODE_SET 1
+#define CA_MODE_ADD 2
+#define CA_MODE_SUBTRACT 3
+#define CA_MODE_MULTIPLY 4
+#define CA_MODE_DIVIDE 5
+#define CA_MODE_MODULO 6
+
+/* values for change action parameters for custom elements */
+#define CA_ARG_MIN 0
+#define CA_ARG_0 0
+#define CA_ARG_1 1
+#define CA_ARG_2 2
+#define CA_ARG_3 3
+#define CA_ARG_4 4
+#define CA_ARG_5 5
+#define CA_ARG_6 6
+#define CA_ARG_7 7
+#define CA_ARG_8 8
+#define CA_ARG_9 9
+#define CA_ARG_10 10
+#define CA_ARG_100 100
+#define CA_ARG_1000 1000
+#define CA_ARG_MAX 9999
+#define CA_ARG_PLAYER 10000
+#define CA_ARG_PLAYER_1 (CA_ARG_PLAYER + PLAYER_BITS_1)
+#define CA_ARG_PLAYER_2 (CA_ARG_PLAYER + PLAYER_BITS_2)
+#define CA_ARG_PLAYER_3 (CA_ARG_PLAYER + PLAYER_BITS_3)
+#define CA_ARG_PLAYER_4 (CA_ARG_PLAYER + PLAYER_BITS_4)
+#define CA_ARG_PLAYER_ANY (CA_ARG_PLAYER + PLAYER_BITS_ANY)
+#define CA_ARG_PLAYER_TRIGGER (CA_ARG_PLAYER + PLAYER_BITS_TRIGGER)
+#define CA_ARG_PLAYER_HEADLINE (CA_ARG_PLAYER + 999)
+#define CA_ARG_NUMBER 11000
+#define CA_ARG_NUMBER_MIN (CA_ARG_NUMBER + 0)
+#define CA_ARG_NUMBER_MAX (CA_ARG_NUMBER + 1)
+#define CA_ARG_NUMBER_RESET (CA_ARG_NUMBER + 2)
+#define CA_ARG_NUMBER_CE_SCORE (CA_ARG_NUMBER + 3)
+#define CA_ARG_NUMBER_CE_VALUE (CA_ARG_NUMBER + 4)
+#define CA_ARG_NUMBER_CE_DELAY (CA_ARG_NUMBER + 5)
+#define CA_ARG_NUMBER_LEVEL_TIME (CA_ARG_NUMBER + 6)
+#define CA_ARG_NUMBER_LEVEL_GEMS (CA_ARG_NUMBER + 7)
+#define CA_ARG_NUMBER_LEVEL_SCORE (CA_ARG_NUMBER + 8)
+#define CA_ARG_NUMBER_HEADLINE (CA_ARG_NUMBER + 999)
+#define CA_ARG_ELEMENT 12000
+#define CA_ARG_ELEMENT_RESET (CA_ARG_ELEMENT + 0)
+#define CA_ARG_ELEMENT_TARGET (CA_ARG_ELEMENT + 1)
+#define CA_ARG_ELEMENT_TRIGGER (CA_ARG_ELEMENT + 2)
+#define CA_ARG_ELEMENT_HEADLINE (CA_ARG_ELEMENT + 999)
+#define CA_ARG_SPEED 13000
+#define CA_ARG_SPEED_NOT_MOVING (CA_ARG_SPEED + 0)
+#define CA_ARG_SPEED_VERY_SLOW (CA_ARG_SPEED + 1)
+#define CA_ARG_SPEED_SLOW (CA_ARG_SPEED + 2)
+#define CA_ARG_SPEED_NORMAL (CA_ARG_SPEED + 4)
+#define CA_ARG_SPEED_FAST (CA_ARG_SPEED + 8)
+#define CA_ARG_SPEED_VERY_FAST (CA_ARG_SPEED + 16)
+#define CA_ARG_SPEED_EVEN_FASTER (CA_ARG_SPEED + 32)
+#define CA_ARG_SPEED_SLOWER (CA_ARG_SPEED + 50)
+#define CA_ARG_SPEED_FASTER (CA_ARG_SPEED + 200)
+#define CA_ARG_SPEED_RESET (CA_ARG_SPEED + 100)
+#define CA_ARG_SPEED_HEADLINE (CA_ARG_SPEED + 999)
+#define CA_ARG_GRAVITY 14000
+#define CA_ARG_GRAVITY_OFF (CA_ARG_GRAVITY + 0)
+#define CA_ARG_GRAVITY_ON (CA_ARG_GRAVITY + 1)
+#define CA_ARG_GRAVITY_TOGGLE (CA_ARG_GRAVITY + 2)
+#define CA_ARG_GRAVITY_HEADLINE (CA_ARG_GRAVITY + 999)
+#define CA_ARG_DIRECTION 15000
+#define CA_ARG_DIRECTION_NONE (CA_ARG_DIRECTION + MV_NONE)
+#define CA_ARG_DIRECTION_LEFT (CA_ARG_DIRECTION + MV_LEFT)
+#define CA_ARG_DIRECTION_RIGHT (CA_ARG_DIRECTION + MV_RIGHT)
+#define CA_ARG_DIRECTION_UP (CA_ARG_DIRECTION + MV_UP)
+#define CA_ARG_DIRECTION_DOWN (CA_ARG_DIRECTION + MV_DOWN)
+#define CA_ARG_DIRECTION_TRIGGER (CA_ARG_DIRECTION + MV_TRIGGER)
+#define CA_ARG_DIRECTION_TRIGGER_BACK (CA_ARG_DIRECTION + MV_TRIGGER_BACK)
+#define CA_ARG_DIRECTION_HEADLINE (CA_ARG_DIRECTION + 999)
+#define CA_ARG_SHIELD 16000
+#define CA_ARG_SHIELD_OFF (CA_ARG_SHIELD + 0)
+#define CA_ARG_SHIELD_NORMAL (CA_ARG_SHIELD + 1)
+#define CA_ARG_SHIELD_DEADLY (CA_ARG_SHIELD + 2)
+#define CA_ARG_SHIELD_HEADLINE (CA_ARG_SHIELD + 999)
+#define CA_ARG_UNDEFINED 19999
/* values for custom 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
-#define MV_BIT_WHEN_PUSHED 10
-#define MV_BIT_MAZE_RUNNER 11
-#define MV_BIT_MAZE_HUNTER 12
-#define MV_BIT_WHEN_DROPPED 13
-#define MV_BIT_TURNING_LEFT_RIGHT 14
-#define MV_BIT_TURNING_RIGHT_LEFT 15
-#define MV_BIT_TURNING_RANDOM 16
+#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
+#define MV_BIT_WHEN_PUSHED 10
+#define MV_BIT_MAZE_RUNNER 11
+#define MV_BIT_MAZE_HUNTER 12
+#define MV_BIT_WHEN_DROPPED 13
+#define MV_BIT_TURNING_LEFT_RIGHT 14
+#define MV_BIT_TURNING_RIGHT_LEFT 15
+#define MV_BIT_TURNING_RANDOM 16
+#define MV_BIT_WIND_DIRECTION 17
/* values for custom move patterns */
-#define MV_HORIZONTAL (MV_LEFT | MV_RIGHT)
-#define MV_VERTICAL (MV_UP | MV_DOWN)
-#define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
-#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)
-#define MV_WHEN_PUSHED (1 << MV_BIT_WHEN_PUSHED)
-#define MV_MAZE_RUNNER (1 << MV_BIT_MAZE_RUNNER)
-#define MV_MAZE_HUNTER (1 << MV_BIT_MAZE_HUNTER)
-#define MV_MAZE_RUNNER_STYLE (MV_MAZE_RUNNER | MV_MAZE_HUNTER)
-#define MV_WHEN_DROPPED (1 << MV_BIT_WHEN_DROPPED)
-#define MV_TURNING_LEFT_RIGHT (1 << MV_BIT_TURNING_LEFT_RIGHT)
-#define MV_TURNING_RIGHT_LEFT (1 << MV_BIT_TURNING_RIGHT_LEFT)
-#define MV_TURNING_RANDOM (1 << MV_BIT_TURNING_RANDOM)
-
-/* values for initial move direction (bits 0 - 3: basic move directions) */
-#define MV_START_BIT_PREVIOUS 4
+#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)
+#define MV_WHEN_PUSHED (1 << MV_BIT_WHEN_PUSHED)
+#define MV_MAZE_RUNNER (1 << MV_BIT_MAZE_RUNNER)
+#define MV_MAZE_HUNTER (1 << MV_BIT_MAZE_HUNTER)
+#define MV_MAZE_RUNNER_STYLE (MV_MAZE_RUNNER | MV_MAZE_HUNTER)
+#define MV_WHEN_DROPPED (1 << MV_BIT_WHEN_DROPPED)
+#define MV_TURNING_LEFT_RIGHT (1 << MV_BIT_TURNING_LEFT_RIGHT)
+#define MV_TURNING_RIGHT_LEFT (1 << MV_BIT_TURNING_RIGHT_LEFT)
+#define MV_TURNING_RANDOM (1 << MV_BIT_TURNING_RANDOM)
+#define MV_WIND_DIRECTION (1 << MV_BIT_WIND_DIRECTION)
/* values for initial move direction */
-#define MV_START_AUTOMATIC (MV_NO_MOVING)
-#define MV_START_LEFT (MV_LEFT)
-#define MV_START_RIGHT (MV_RIGHT)
-#define MV_START_UP (MV_UP)
-#define MV_START_DOWN (MV_DOWN)
-#define MV_START_RANDOM (MV_ALL_DIRECTIONS)
-#define MV_START_PREVIOUS (1 << MV_START_BIT_PREVIOUS)
+#define MV_START_NONE (MV_NONE)
+#define MV_START_AUTOMATIC (MV_NONE)
+#define MV_START_LEFT (MV_LEFT)
+#define MV_START_RIGHT (MV_RIGHT)
+#define MV_START_UP (MV_UP)
+#define MV_START_DOWN (MV_DOWN)
+#define MV_START_RANDOM (MV_ALL_DIRECTIONS)
+#define MV_START_PREVIOUS (MV_PREVIOUS)
/* values for elements left behind by custom elements */
-#define LEAVE_TYPE_UNLIMITED 0
-#define LEAVE_TYPE_LIMITED 1
+#define LEAVE_TYPE_UNLIMITED 0
+#define LEAVE_TYPE_LIMITED 1
/* 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
+#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
/* values for explosion type for custom elements */
-#define EXPLODES_3X3 0
-#define EXPLODES_1X1 1
-#define EXPLODES_CROSS 2
+#define EXPLODES_3X3 0
+#define EXPLODES_1X1 1
+#define EXPLODES_CROSS 2
/* macros for configurable properties */
#define IS_DIGGABLE(e) HAS_PROPERTY(e, EP_DIGGABLE)
#define CAN_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_CAN_MOVE_INTO_ACID)
#define IS_THROWABLE(e) HAS_PROPERTY(e, EP_THROWABLE)
#define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE)
+#define IS_GRAVITY_REACHABLE(e) HAS_PROPERTY(e, EP_GRAVITY_REACHABLE)
/* macros for special configurable properties */
#define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL)
#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_SP_BUGGY_BASE(e) HAS_PROPERTY(e, EP_SP_BUGGY_BASE)
#define IS_GEM(e) HAS_PROPERTY(e, EP_GEM)
#define IS_FOOD_DARK_YAMYAM(e) HAS_PROPERTY(e, EP_FOOD_DARK_YAMYAM)
#define IS_FOOD_PENGUIN(e) HAS_PROPERTY(e, EP_FOOD_PENGUIN)
HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION)
#define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID)
#define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH)
-#define IS_DIGGABLE_WITH_GRAVITY(e) HAS_PROPERTY(e, EP_DIGGABLE_WITH_GRAVITY)
+#define HAS_ACTION(e) HAS_PROPERTY(e, EP_HAS_ACTION)
+#define CAN_CHANGE_OR_HAS_ACTION(e) \
+ HAS_PROPERTY(e, EP_CAN_CHANGE_OR_HAS_ACTION)
/* special macros used in game engine */
#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \
#define IS_ENVELOPE(e) ((e) >= EL_ENVELOPE_1 && \
(e) <= EL_ENVELOPE_4)
-#define IS_GATE(e) ((e) >= EL_GATE_1 && \
+#define IS_RND_KEY(e) ((e) >= EL_KEY_1 && \
+ (e) <= EL_KEY_4)
+#define IS_EM_KEY(e) ((e) >= EL_EM_KEY_1 && \
+ (e) <= EL_EM_KEY_4)
+#define IS_EMC_KEY(e) ((e) >= EL_EMC_KEY_5 && \
+ (e) <= EL_EMC_KEY_8)
+#define IS_KEY(e) (IS_RND_KEY(e) || \
+ IS_EM_KEY(e) || \
+ IS_EMC_KEY(e))
+#define RND_KEY_NR(e) ((e) - EL_KEY_1)
+#define EM_KEY_NR(e) ((e) - EL_EM_KEY_1)
+#define EMC_KEY_NR(e) ((e) - EL_EMC_KEY_5 + 4)
+#define KEY_NR(e) (IS_RND_KEY(e) ? RND_KEY_NR(e) : \
+ IS_EM_KEY(e) ? EM_KEY_NR(e) : \
+ IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0)
+
+#define IS_RND_GATE(e) ((e) >= EL_GATE_1 && \
(e) <= EL_GATE_4)
-
-#define IS_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \
- (e) <= EL_GATE_4_GRAY)
-
#define IS_EM_GATE(e) ((e) >= EL_EM_GATE_1 && \
(e) <= EL_EM_GATE_4)
-
+#define IS_EMC_GATE(e) ((e) >= EL_EMC_GATE_5 && \
+ (e) <= EL_EMC_GATE_8)
+#define IS_GATE(e) (IS_RND_GATE(e) || \
+ IS_EM_GATE(e) || \
+ IS_EMC_GATE(e))
+#define RND_GATE_NR(e) ((e) - EL_GATE_1)
+#define EM_GATE_NR(e) ((e) - EL_EM_GATE_1)
+#define EMC_GATE_NR(e) ((e) - EL_EMC_GATE_5 + 4)
+#define GATE_NR(e) (IS_RND_GATE(e) ? RND_GATE_NR(e) : \
+ IS_EM_GATE(e) ? EM_GATE_NR(e) : \
+ IS_EMC_GATE(e) ? EMC_GATE_NR(e) : 0)
+
+#define IS_RND_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \
+ (e) <= EL_GATE_4_GRAY)
+#define IS_RND_GATE_GRAY_ACTIVE(e) ((e) >= EL_GATE_1_GRAY_ACTIVE && \
+ (e) <= EL_GATE_4_GRAY_ACTIVE)
#define IS_EM_GATE_GRAY(e) ((e) >= EL_EM_GATE_1_GRAY && \
(e) <= EL_EM_GATE_4_GRAY)
+#define IS_EM_GATE_GRAY_ACTIVE(e) ((e) >= EL_EM_GATE_1_GRAY_ACTIVE && \
+ (e) <= EL_EM_GATE_4_GRAY_ACTIVE)
+#define IS_EMC_GATE_GRAY(e) ((e) >= EL_EMC_GATE_5_GRAY && \
+ (e) <= EL_EMC_GATE_8_GRAY)
+#define IS_EMC_GATE_GRAY_ACTIVE(e) ((e) >= EL_EMC_GATE_5_GRAY_ACTIVE && \
+ (e) <= EL_EMC_GATE_8_GRAY_ACTIVE)
+#define IS_GATE_GRAY(e) (IS_RND_GATE_GRAY(e) || \
+ IS_EM_GATE_GRAY(e) || \
+ IS_EMC_GATE_GRAY(e))
+#define IS_GATE_GRAY_ACTIVE(e) (IS_RND_GATE_GRAY_ACTIVE(e) || \
+ IS_EM_GATE_GRAY_ACTIVE(e) || \
+ IS_EMC_GATE_GRAY_ACTIVE(e))
+#define RND_GATE_GRAY_NR(e) ((e) - EL_GATE_1_GRAY)
+#define RND_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_GATE_1_GRAY_ACTIVE)
+#define EM_GATE_GRAY_NR(e) ((e) - EL_EM_GATE_1_GRAY)
+#define EM_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_EM_GATE_1_GRAY_ACTIVE)
+#define EMC_GATE_GRAY_NR(e) ((e) - EL_EMC_GATE_5_GRAY + 4)
+#define EMC_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_EMC_GATE_5_GRAY_ACTIVE + 4)
+#define GATE_GRAY_NR(e) (IS_RND_GATE_GRAY(e) ? RND_GATE_GRAY_NR(e) : \
+ IS_EM_GATE_GRAY(e) ? EM_GATE_GRAY_NR(e) : \
+ IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0)
#define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \
element_info[e].gfx_element : e)
+/* !!! "use sound" deactivated due to problems with level "bug machine" !!! */
+/* (solution: add separate "use sound of element" to level file and editor) */
+#if 0
+#define SND_ELEMENT(e) GFX_ELEMENT(e)
+#else
+#define SND_ELEMENT(e) (e)
+#endif
+
#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 PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_PLAYER_1])
#define SHIELD_ON(p) ((p)->shield_normal_time_left > 0)
-#if 1
-
#define ENEMY_PROTECTED_FIELD(x,y) (IS_PROTECTED(Feld[x][y]) || \
IS_PROTECTED(Back[x][y]))
#define EXPLOSION_PROTECTED_FIELD(x,y) (IS_EXPLOSION_PROOF(Feld[x][y]))
#define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \
EXPLOSION_PROTECTED_FIELD(x, y))
-#else
-
-#define PROTECTED_FIELD(x,y) (IS_ACCESSIBLE_INSIDE(Feld[x][y]) && \
- IS_INDESTRUCTIBLE(Feld[x][y]))
-#define PLAYER_ENEMY_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \
- PROTECTED_FIELD(x, y))
-#define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \
- PROTECTED_FIELD(x, y))
-#endif
-
#define PLAYER_SWITCHING(p,x,y) ((p)->is_switching && \
(p)->switch_x == (x) && (p)->switch_y == (y))
+#define PLAYER_DROPPING(p,x,y) ((p)->is_dropping && \
+ (p)->drop_x == (x) && (p)->drop_y == (y))
+
#define PLAYER_NR_GFX(g,i) ((g) + i * (IMG_PLAYER_2 - IMG_PLAYER_1))
+#define GET_PLAYER_ELEMENT(e) ((e) >= EL_PLAYER_1 && (e) <= EL_PLAYER_4 ? \
+ (e) : EL_PLAYER_1)
+
+#define GET_PLAYER_NR(e) (GET_PLAYER_ELEMENT(e) - EL_PLAYER_1)
+
#define ANIM_FRAMES(g) (graphic_info[g].anim_frames)
#define ANIM_DELAY(g) (graphic_info[g].anim_delay)
#define ANIM_MODE(g) (graphic_info[g].anim_mode)
#define MAX_LEVEL_NAME_LEN 32
#define MAX_LEVEL_AUTHOR_LEN 32
#define MAX_ELEMENT_NAME_LEN 32
-#define MAX_TAPELEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */
+#define MAX_TAPE_LEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */
+#define MAX_TAPES_PER_SET 1024
#define MAX_SCORE_ENTRIES 100
#define MAX_NUM_AMOEBA 100
#define MAX_INVENTORY_SIZE 1000
-#define MAX_KEYS 4
+#define STD_NUM_KEYS 4
+#define MAX_NUM_KEYS 8
#define NUM_BELTS 4
#define NUM_BELT_PARTS 3
#define MIN_ENVELOPE_XSIZE 1
#define VY 400
#define EX DX
#define EY (VY - 44)
-#define TILEX 32
-#define TILEY 32
-#define MINI_TILEX (TILEX / 2)
-#define MINI_TILEY (TILEY / 2)
-#define MICRO_TILEX (TILEX / 8)
-#define MICRO_TILEY (TILEY / 8)
+#define TILESIZE 32
+#define TILEX TILESIZE
+#define TILEY TILESIZE
+#define MINI_TILESIZE (TILESIZE / 2)
+#define MINI_TILEX MINI_TILESIZE
+#define MINI_TILEY MINI_TILESIZE
+#define MICRO_TILESIZE (TILESIZE / 8)
+#define MICRO_TILEX MICRO_TILESIZE
+#define MICRO_TILEY MICRO_TILESIZE
#define MIDPOSX (SCR_FIELDX / 2)
#define MIDPOSY (SCR_FIELDY / 2)
#define SXSIZE (SCR_FIELDX * TILEX)
#define EYSIZE (VYSIZE + 44)
#define FULL_SXSIZE (2 + SXSIZE + 2)
#define FULL_SYSIZE (2 + SYSIZE + 2)
-#define MICROLEV_XSIZE ((STD_LEV_FIELDX + 2) * MICRO_TILEX)
-#define MICROLEV_YSIZE ((STD_LEV_FIELDY + 2) * MICRO_TILEY)
-#define MICROLEV_XPOS (SX + (SXSIZE - MICROLEV_XSIZE) / 2)
-#define MICROLEV_YPOS (SX + 12 * TILEY - MICRO_TILEY)
-#define MICROLABEL_YPOS (MICROLEV_YPOS + MICROLEV_YSIZE + 7)
+#define MICROLEVEL_XSIZE ((STD_LEV_FIELDX + 2) * MICRO_TILEX)
+#define MICROLEVEL_YSIZE ((STD_LEV_FIELDY + 2) * MICRO_TILEY)
+#define MICROLEVEL_XPOS (SX + (SXSIZE - MICROLEVEL_XSIZE) / 2)
+#define MICROLEVEL_YPOS (SX + 12 * TILEY - MICRO_TILEY)
+#define MICROLABEL1_YPOS (MICROLEVEL_YPOS - 36)
+#define MICROLABEL2_YPOS (MICROLEVEL_YPOS + MICROLEVEL_YSIZE + 7)
/* score for elements */
#define EL_TRIGGER_ELEMENT 657
#define EL_TRIGGER_PLAYER 658
-#define NUM_FILE_ELEMENTS 659
+#define EL_SP_GRAVITY_ON_PORT_RIGHT 659
+#define EL_SP_GRAVITY_ON_PORT_DOWN 660
+#define EL_SP_GRAVITY_ON_PORT_LEFT 661
+#define EL_SP_GRAVITY_ON_PORT_UP 662
+#define EL_SP_GRAVITY_OFF_PORT_RIGHT 663
+#define EL_SP_GRAVITY_OFF_PORT_DOWN 664
+#define EL_SP_GRAVITY_OFF_PORT_LEFT 665
+#define EL_SP_GRAVITY_OFF_PORT_UP 666
+
+
+/* the following EMC style elements are currently not implemented in R'n'D */
+#define EL_BALLOON_SWITCH_NONE 667
+#define EL_EMC_GATE_5 668
+#define EL_EMC_GATE_6 669
+#define EL_EMC_GATE_7 670
+#define EL_EMC_GATE_8 671
+#define EL_EMC_GATE_5_GRAY 672
+#define EL_EMC_GATE_6_GRAY 673
+#define EL_EMC_GATE_7_GRAY 674
+#define EL_EMC_GATE_8_GRAY 675
+#define EL_EMC_KEY_5 676
+#define EL_EMC_KEY_6 677
+#define EL_EMC_KEY_7 678
+#define EL_EMC_KEY_8 679
+#define EL_EMC_ANDROID 680
+#define EL_EMC_GRASS 681
+#define EL_EMC_MAGIC_BALL 682
+#define EL_EMC_MAGIC_BALL_ACTIVE 683
+#define EL_EMC_MAGIC_BALL_SWITCH 684
+#define EL_EMC_MAGIC_BALL_SWITCH_ACTIVE 685
+#define EL_EMC_SPRING_BUMPER 686
+#define EL_EMC_PLANT 687
+#define EL_EMC_LENSES 688
+#define EL_EMC_MAGNIFIER 689
+#define EL_EMC_WALL_9 690
+#define EL_EMC_WALL_10 691
+#define EL_EMC_WALL_11 692
+#define EL_EMC_WALL_12 693
+#define EL_EMC_WALL_13 694
+#define EL_EMC_WALL_14 695
+#define EL_EMC_WALL_15 696
+#define EL_EMC_WALL_16 697
+#define EL_EMC_WALL_SLIPPERY_1 698
+#define EL_EMC_WALL_SLIPPERY_2 699
+#define EL_EMC_WALL_SLIPPERY_3 700
+#define EL_EMC_WALL_SLIPPERY_4 701
+#define EL_EMC_FAKE_GRASS 702
+#define EL_EMC_FAKE_ACID 703
+#define EL_EMC_DRIPPER 704
+
+#define NUM_FILE_ELEMENTS 705
/* "real" (and therefore drawable) runtime elements */
#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 42)
#define EL_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 43)
#define EL_BD_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 44)
+#define EL_EMC_FAKE_GRASS_ACTIVE (EL_FIRST_RUNTIME_REAL + 45)
+#define EL_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 46)
+#define EL_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 47)
+#define EL_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 48)
+#define EL_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 49)
+#define EL_EM_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 50)
+#define EL_EM_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 51)
+#define EL_EM_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 52)
+#define EL_EM_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 53)
+#define EL_EMC_GATE_5_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 54)
+#define EL_EMC_GATE_6_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 55)
+#define EL_EMC_GATE_7_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 56)
+#define EL_EMC_GATE_8_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 57)
+#define EL_EMC_DRIPPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 58)
/* "unreal" (and therefore not drawable) runtime elements */
-#define EL_FIRST_RUNTIME_UNREAL (EL_FIRST_RUNTIME_REAL + 45)
+#define EL_FIRST_RUNTIME_UNREAL (EL_FIRST_RUNTIME_REAL + 59)
#define EL_BLOCKED (EL_FIRST_RUNTIME_UNREAL + 0)
#define EL_EXPLOSION (EL_FIRST_RUNTIME_UNREAL + 1)
#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 15)
#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 16)
#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 17)
+#define EL_ELEMENT_SNAPPING (EL_FIRST_RUNTIME_UNREAL + 18)
/* dummy elements (never used as game elements, only used as graphics) */
-#define EL_FIRST_DUMMY (EL_FIRST_RUNTIME_UNREAL + 18)
-
-#define EL_STEELWALL_TOPLEFT (EL_FIRST_DUMMY + 0)
-#define EL_STEELWALL_TOPRIGHT (EL_FIRST_DUMMY + 1)
-#define EL_STEELWALL_BOTTOMLEFT (EL_FIRST_DUMMY + 2)
-#define EL_STEELWALL_BOTTOMRIGHT (EL_FIRST_DUMMY + 3)
-#define EL_STEELWALL_HORIZONTAL (EL_FIRST_DUMMY + 4)
-#define EL_STEELWALL_VERTICAL (EL_FIRST_DUMMY + 5)
-#define EL_INVISIBLE_STEELWALL_TOPLEFT (EL_FIRST_DUMMY + 6)
-#define EL_INVISIBLE_STEELWALL_TOPRIGHT (EL_FIRST_DUMMY + 7)
-#define EL_INVISIBLE_STEELWALL_BOTTOMLEFT (EL_FIRST_DUMMY + 8)
-#define EL_INVISIBLE_STEELWALL_BOTTOMRIGHT (EL_FIRST_DUMMY + 9)
-#define EL_INVISIBLE_STEELWALL_HORIZONTAL (EL_FIRST_DUMMY + 10)
-#define EL_INVISIBLE_STEELWALL_VERTICAL (EL_FIRST_DUMMY + 11)
-#define EL_DYNABOMB (EL_FIRST_DUMMY + 12)
-#define EL_DYNABOMB_ACTIVE (EL_FIRST_DUMMY + 13)
-#define EL_DYNABOMB_PLAYER_1 (EL_FIRST_DUMMY + 14)
-#define EL_DYNABOMB_PLAYER_2 (EL_FIRST_DUMMY + 15)
-#define EL_DYNABOMB_PLAYER_3 (EL_FIRST_DUMMY + 16)
-#define EL_DYNABOMB_PLAYER_4 (EL_FIRST_DUMMY + 17)
-#define EL_SHIELD_NORMAL_ACTIVE (EL_FIRST_DUMMY + 18)
-#define EL_SHIELD_DEADLY_ACTIVE (EL_FIRST_DUMMY + 19)
-#define EL_AMOEBA (EL_FIRST_DUMMY + 20)
-#define EL_DEFAULT (EL_FIRST_DUMMY + 21)
-#define EL_BD_DEFAULT (EL_FIRST_DUMMY + 22)
-#define EL_SP_DEFAULT (EL_FIRST_DUMMY + 23)
-#define EL_SB_DEFAULT (EL_FIRST_DUMMY + 24)
+#define EL_FIRST_DUMMY (EL_FIRST_RUNTIME_UNREAL + 19)
+
+#define EL_STEELWALL_TOPLEFT (EL_FIRST_DUMMY + 0)
+#define EL_STEELWALL_TOPRIGHT (EL_FIRST_DUMMY + 1)
+#define EL_STEELWALL_BOTTOMLEFT (EL_FIRST_DUMMY + 2)
+#define EL_STEELWALL_BOTTOMRIGHT (EL_FIRST_DUMMY + 3)
+#define EL_STEELWALL_HORIZONTAL (EL_FIRST_DUMMY + 4)
+#define EL_STEELWALL_VERTICAL (EL_FIRST_DUMMY + 5)
+#define EL_INVISIBLE_STEELWALL_TOPLEFT (EL_FIRST_DUMMY + 6)
+#define EL_INVISIBLE_STEELWALL_TOPRIGHT (EL_FIRST_DUMMY + 7)
+#define EL_INVISIBLE_STEELWALL_BOTTOMLEFT (EL_FIRST_DUMMY + 8)
+#define EL_INVISIBLE_STEELWALL_BOTTOMRIGHT (EL_FIRST_DUMMY + 9)
+#define EL_INVISIBLE_STEELWALL_HORIZONTAL (EL_FIRST_DUMMY + 10)
+#define EL_INVISIBLE_STEELWALL_VERTICAL (EL_FIRST_DUMMY + 11)
+#define EL_DYNABOMB (EL_FIRST_DUMMY + 12)
+#define EL_DYNABOMB_ACTIVE (EL_FIRST_DUMMY + 13)
+#define EL_DYNABOMB_PLAYER_1 (EL_FIRST_DUMMY + 14)
+#define EL_DYNABOMB_PLAYER_2 (EL_FIRST_DUMMY + 15)
+#define EL_DYNABOMB_PLAYER_3 (EL_FIRST_DUMMY + 16)
+#define EL_DYNABOMB_PLAYER_4 (EL_FIRST_DUMMY + 17)
+#define EL_SHIELD_NORMAL_ACTIVE (EL_FIRST_DUMMY + 18)
+#define EL_SHIELD_DEADLY_ACTIVE (EL_FIRST_DUMMY + 19)
+#define EL_AMOEBA (EL_FIRST_DUMMY + 20)
+#define EL_DEFAULT (EL_FIRST_DUMMY + 21)
+#define EL_BD_DEFAULT (EL_FIRST_DUMMY + 22)
+#define EL_SP_DEFAULT (EL_FIRST_DUMMY + 23)
+#define EL_SB_DEFAULT (EL_FIRST_DUMMY + 24)
/* internal elements (only used for internal purposes like copying) */
-#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 25)
+#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 25)
-#define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0)
-#define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1)
-#define EL_INTERNAL_CLIPBOARD_GROUP (EL_FIRST_INTERNAL + 2)
-#define EL_INTERNAL_DUMMY (EL_FIRST_INTERNAL + 3)
+#define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0)
+#define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1)
+#define EL_INTERNAL_CLIPBOARD_GROUP (EL_FIRST_INTERNAL + 2)
+#define EL_INTERNAL_DUMMY (EL_FIRST_INTERNAL + 3)
-#define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0)
-#define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2)
-#define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0)
-#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 3)
+#define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0)
+#define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2)
+#define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0)
+#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 3)
-#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 4)
+#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 4)
/* values for graphics/sounds action types */
-#define ACTION_DEFAULT 0
-#define ACTION_WAITING 1
-#define ACTION_FALLING 2
-#define ACTION_MOVING 3
-#define ACTION_DIGGING 4
-#define ACTION_SNAPPING 5
-#define ACTION_COLLECTING 6
-#define ACTION_DROPPING 7
-#define ACTION_PUSHING 8
-#define ACTION_WALKING 9
-#define ACTION_PASSING 10
-#define ACTION_IMPACT 11
-#define ACTION_BREAKING 12
-#define ACTION_ACTIVATING 13
-#define ACTION_DEACTIVATING 14
-#define ACTION_OPENING 15
-#define ACTION_CLOSING 16
-#define ACTION_ATTACKING 17
-#define ACTION_GROWING 18
-#define ACTION_SHRINKING 19
-#define ACTION_ACTIVE 20
-#define ACTION_FILLING 21
-#define ACTION_EMPTYING 22
-#define ACTION_CHANGING 23
-#define ACTION_EXPLODING 24
-#define ACTION_BORING 25
-#define ACTION_BORING_1 26
-#define ACTION_BORING_2 27
-#define ACTION_BORING_3 28
-#define ACTION_BORING_4 29
-#define ACTION_BORING_5 30
-#define ACTION_BORING_6 31
-#define ACTION_BORING_7 32
-#define ACTION_BORING_8 33
-#define ACTION_BORING_9 34
-#define ACTION_BORING_10 35
-#define ACTION_SLEEPING 36
-#define ACTION_SLEEPING_1 37
-#define ACTION_SLEEPING_2 38
-#define ACTION_SLEEPING_3 39
-#define ACTION_AWAKENING 40
-#define ACTION_DYING 41
-#define ACTION_TURNING 42
-#define ACTION_TURNING_FROM_LEFT 43
-#define ACTION_TURNING_FROM_RIGHT 44
-#define ACTION_TURNING_FROM_UP 45
-#define ACTION_TURNING_FROM_DOWN 46
-#define ACTION_OTHER 47
-
-#define NUM_ACTIONS 48
-
-#define ACTION_BORING_LAST ACTION_BORING_10
-#define ACTION_SLEEPING_LAST ACTION_SLEEPING_3
+#define ACTION_DEFAULT 0
+#define ACTION_WAITING 1
+#define ACTION_FALLING 2
+#define ACTION_MOVING 3
+#define ACTION_DIGGING 4
+#define ACTION_SNAPPING 5
+#define ACTION_COLLECTING 6
+#define ACTION_DROPPING 7
+#define ACTION_PUSHING 8
+#define ACTION_WALKING 9
+#define ACTION_PASSING 10
+#define ACTION_IMPACT 11
+#define ACTION_BREAKING 12
+#define ACTION_ACTIVATING 13
+#define ACTION_DEACTIVATING 14
+#define ACTION_OPENING 15
+#define ACTION_CLOSING 16
+#define ACTION_ATTACKING 17
+#define ACTION_GROWING 18
+#define ACTION_SHRINKING 19
+#define ACTION_ACTIVE 20
+#define ACTION_FILLING 21
+#define ACTION_EMPTYING 22
+#define ACTION_CHANGING 23
+#define ACTION_EXPLODING 24
+#define ACTION_BORING 25
+#define ACTION_BORING_1 26
+#define ACTION_BORING_2 27
+#define ACTION_BORING_3 28
+#define ACTION_BORING_4 29
+#define ACTION_BORING_5 30
+#define ACTION_BORING_6 31
+#define ACTION_BORING_7 32
+#define ACTION_BORING_8 33
+#define ACTION_BORING_9 34
+#define ACTION_BORING_10 35
+#define ACTION_SLEEPING 36
+#define ACTION_SLEEPING_1 37
+#define ACTION_SLEEPING_2 38
+#define ACTION_SLEEPING_3 39
+#define ACTION_AWAKENING 40
+#define ACTION_DYING 41
+#define ACTION_TURNING 42
+#define ACTION_TURNING_FROM_LEFT 43
+#define ACTION_TURNING_FROM_RIGHT 44
+#define ACTION_TURNING_FROM_UP 45
+#define ACTION_TURNING_FROM_DOWN 46
+#define ACTION_SMASHED_BY_ROCK 47
+#define ACTION_SMASHED_BY_SPRING 48
+#define ACTION_SLURPED_BY_SPRING 49
+#define ACTION_TWINKLING 50
+#define ACTION_SPLASHING 51
+#define ACTION_PAGE_1 52
+#define ACTION_PAGE_2 53
+#define ACTION_PAGE_3 54
+#define ACTION_PAGE_4 55
+#define ACTION_PAGE_5 56
+#define ACTION_PAGE_6 57
+#define ACTION_PAGE_7 58
+#define ACTION_PAGE_8 59
+#define ACTION_PAGE_9 60
+#define ACTION_PAGE_10 61
+#define ACTION_PAGE_11 62
+#define ACTION_PAGE_12 63
+#define ACTION_PAGE_13 64
+#define ACTION_PAGE_14 65
+#define ACTION_PAGE_15 66
+#define ACTION_PAGE_16 67
+#define ACTION_PAGE_17 68
+#define ACTION_PAGE_18 69
+#define ACTION_PAGE_19 70
+#define ACTION_PAGE_20 71
+#define ACTION_PAGE_21 72
+#define ACTION_PAGE_22 73
+#define ACTION_PAGE_23 74
+#define ACTION_PAGE_24 75
+#define ACTION_PAGE_25 76
+#define ACTION_PAGE_26 77
+#define ACTION_PAGE_27 78
+#define ACTION_PAGE_28 79
+#define ACTION_PAGE_29 80
+#define ACTION_PAGE_30 81
+#define ACTION_PAGE_31 82
+#define ACTION_PAGE_32 83
+#define ACTION_OTHER 84
+
+#define NUM_ACTIONS 85
+
+#define ACTION_BORING_LAST ACTION_BORING_10
+#define ACTION_SLEEPING_LAST ACTION_SLEEPING_3
/* values for special image configuration suffixes (must match game mode) */
-#define GFX_SPECIAL_ARG_DEFAULT 0
-#define GFX_SPECIAL_ARG_MAIN 1
-#define GFX_SPECIAL_ARG_LEVELS 2
-#define GFX_SPECIAL_ARG_SCORES 3
-#define GFX_SPECIAL_ARG_EDITOR 4
-#define GFX_SPECIAL_ARG_INFO 5
-#define GFX_SPECIAL_ARG_SETUP 6
-#define GFX_SPECIAL_ARG_PLAYING 7
-#define GFX_SPECIAL_ARG_DOOR 8
-#define GFX_SPECIAL_ARG_PREVIEW 9
-#define GFX_SPECIAL_ARG_CRUMBLED 10
+#define GFX_SPECIAL_ARG_DEFAULT 0
+#define GFX_SPECIAL_ARG_MAIN 1
+#define GFX_SPECIAL_ARG_LEVELS 2
+#define GFX_SPECIAL_ARG_SCORES 3
+#define GFX_SPECIAL_ARG_EDITOR 4
+#define GFX_SPECIAL_ARG_INFO 5
+#define GFX_SPECIAL_ARG_SETUP 6
+#define GFX_SPECIAL_ARG_PLAYING 7
+#define GFX_SPECIAL_ARG_DOOR 8
+#define GFX_SPECIAL_ARG_PREVIEW 9
+#define GFX_SPECIAL_ARG_CRUMBLED 10
-#define NUM_SPECIAL_GFX_ARGS 11
+#define NUM_SPECIAL_GFX_ARGS 11
/* values for image configuration suffixes */
-#define GFX_ARG_X 0
-#define GFX_ARG_Y 1
-#define GFX_ARG_XPOS 2
-#define GFX_ARG_YPOS 3
-#define GFX_ARG_WIDTH 4
-#define GFX_ARG_HEIGHT 5
-#define GFX_ARG_OFFSET 6
-#define GFX_ARG_VERTICAL 7
-#define GFX_ARG_XOFFSET 8
-#define GFX_ARG_YOFFSET 9
-#define GFX_ARG_FRAMES 10
-#define GFX_ARG_FRAMES_PER_LINE 11
-#define GFX_ARG_START_FRAME 12
-#define GFX_ARG_DELAY 13
-#define GFX_ARG_ANIM_MODE 14
-#define GFX_ARG_GLOBAL_SYNC 15
-#define GFX_ARG_CRUMBLED_LIKE 16
-#define GFX_ARG_DIGGABLE_LIKE 17
-#define GFX_ARG_BORDER_SIZE 18
-#define GFX_ARG_STEP_OFFSET 19
-#define GFX_ARG_STEP_DELAY 20
-#define GFX_ARG_DIRECTION 21
-#define GFX_ARG_POSITION 22
-#define GFX_ARG_DRAW_XOFFSET 23
-#define GFX_ARG_DRAW_YOFFSET 24
-#define GFX_ARG_DRAW_MASKED 25
-#define GFX_ARG_ANIM_DELAY_FIXED 26
-#define GFX_ARG_ANIM_DELAY_RANDOM 27
-#define GFX_ARG_POST_DELAY_FIXED 28
-#define GFX_ARG_POST_DELAY_RANDOM 29
-#define GFX_ARG_NAME 30
-
-#define NUM_GFX_ARGS 31
+#define GFX_ARG_X 0
+#define GFX_ARG_Y 1
+#define GFX_ARG_XPOS 2
+#define GFX_ARG_YPOS 3
+#define GFX_ARG_WIDTH 4
+#define GFX_ARG_HEIGHT 5
+#define GFX_ARG_VERTICAL 6
+#define GFX_ARG_OFFSET 7
+#define GFX_ARG_XOFFSET 8
+#define GFX_ARG_YOFFSET 9
+#define GFX_ARG_2ND_MOVEMENT_TILE 10
+#define GFX_ARG_2ND_VERTICAL 11
+#define GFX_ARG_2ND_OFFSET 12
+#define GFX_ARG_2ND_XOFFSET 13
+#define GFX_ARG_2ND_YOFFSET 14
+#define GFX_ARG_2ND_SWAP_TILES 15
+#define GFX_ARG_FRAMES 16
+#define GFX_ARG_FRAMES_PER_LINE 17
+#define GFX_ARG_START_FRAME 18
+#define GFX_ARG_DELAY 19
+#define GFX_ARG_ANIM_MODE 20
+#define GFX_ARG_GLOBAL_SYNC 21
+#define GFX_ARG_CRUMBLED_LIKE 22
+#define GFX_ARG_DIGGABLE_LIKE 23
+#define GFX_ARG_BORDER_SIZE 24
+#define GFX_ARG_STEP_OFFSET 25
+#define GFX_ARG_STEP_DELAY 26
+#define GFX_ARG_DIRECTION 27
+#define GFX_ARG_POSITION 28
+#define GFX_ARG_DRAW_XOFFSET 29
+#define GFX_ARG_DRAW_YOFFSET 30
+#define GFX_ARG_DRAW_MASKED 31
+#define GFX_ARG_ANIM_DELAY_FIXED 32
+#define GFX_ARG_ANIM_DELAY_RANDOM 33
+#define GFX_ARG_POST_DELAY_FIXED 34
+#define GFX_ARG_POST_DELAY_RANDOM 35
+#define GFX_ARG_NAME 36
+#define GFX_ARG_SCALE_UP_FACTOR 37
+#define GFX_ARG_CLONE_FROM 38
+
+#define NUM_GFX_ARGS 39
/* values for sound configuration suffixes */
-#define SND_ARG_MODE_LOOP 0
+#define SND_ARG_MODE_LOOP 0
+#define SND_ARG_VOLUME 1
+#define SND_ARG_PRIORITY 2
-#define NUM_SND_ARGS 1
+#define NUM_SND_ARGS 3
/* values for music configuration suffixes */
-#define MUS_ARG_MODE_LOOP 0
+#define MUS_ARG_MODE_LOOP 0
-#define NUM_MUS_ARGS 1
+#define NUM_MUS_ARGS 1
/* values for font configuration */
-#define FONT_INITIAL_1 0
-#define FONT_INITIAL_2 1
-#define FONT_INITIAL_3 2
-#define FONT_INITIAL_4 3
-#define FONT_TITLE_1 4
-#define FONT_TITLE_2 5
-#define FONT_MENU_1 6
-#define FONT_MENU_2 7
-#define FONT_TEXT_1_ACTIVE 8
-#define FONT_TEXT_2_ACTIVE 9
-#define FONT_TEXT_3_ACTIVE 10
-#define FONT_TEXT_4_ACTIVE 11
-#define FONT_TEXT_1 12
-#define FONT_TEXT_2 13
-#define FONT_TEXT_3 14
-#define FONT_TEXT_4 15
-#define FONT_ENVELOPE_1 16
-#define FONT_ENVELOPE_2 17
-#define FONT_ENVELOPE_3 18
-#define FONT_ENVELOPE_4 19
-#define FONT_INPUT_1_ACTIVE 20
-#define FONT_INPUT_2_ACTIVE 21
-#define FONT_INPUT_1 22
-#define FONT_INPUT_2 23
-#define FONT_OPTION_OFF 24
-#define FONT_OPTION_ON 25
-#define FONT_VALUE_1 26
-#define FONT_VALUE_2 27
-#define FONT_VALUE_OLD 28
-#define FONT_LEVEL_NUMBER 29
-#define FONT_TAPE_RECORDER 30
-#define FONT_GAME_INFO 31
-
-#define NUM_FONTS 32
-#define NUM_INITIAL_FONTS 4
+#define FONT_INITIAL_1 0
+#define FONT_INITIAL_2 1
+#define FONT_INITIAL_3 2
+#define FONT_INITIAL_4 3
+#define FONT_TITLE_1 4
+#define FONT_TITLE_2 5
+#define FONT_MENU_1 6
+#define FONT_MENU_2 7
+#define FONT_TEXT_1_ACTIVE 8
+#define FONT_TEXT_2_ACTIVE 9
+#define FONT_TEXT_3_ACTIVE 10
+#define FONT_TEXT_4_ACTIVE 11
+#define FONT_TEXT_1 12
+#define FONT_TEXT_2 13
+#define FONT_TEXT_3 14
+#define FONT_TEXT_4 15
+#define FONT_ENVELOPE_1 16
+#define FONT_ENVELOPE_2 17
+#define FONT_ENVELOPE_3 18
+#define FONT_ENVELOPE_4 19
+#define FONT_INPUT_1_ACTIVE 20
+#define FONT_INPUT_2_ACTIVE 21
+#define FONT_INPUT_1 22
+#define FONT_INPUT_2 23
+#define FONT_OPTION_OFF 24
+#define FONT_OPTION_ON 25
+#define FONT_VALUE_1 26
+#define FONT_VALUE_2 27
+#define FONT_VALUE_OLD 28
+#define FONT_LEVEL_NUMBER 29
+#define FONT_TAPE_RECORDER 30
+#define FONT_GAME_INFO 31
+
+#define NUM_FONTS 32
+#define NUM_INITIAL_FONTS 4
/* values for game_status (must match special image configuration suffixes) */
-#define GAME_MODE_DEFAULT 0
-#define GAME_MODE_MAIN 1
-#define GAME_MODE_LEVELS 2
-#define GAME_MODE_SCORES 3
-#define GAME_MODE_EDITOR 4
-#define GAME_MODE_INFO 5
-#define GAME_MODE_SETUP 6
-#define GAME_MODE_PLAYING 7
-#define GAME_MODE_PSEUDO_DOOR 8
-#define GAME_MODE_PSEUDO_PREVIEW 9
-#define GAME_MODE_PSEUDO_CRUMBLED 10
+#define GAME_MODE_DEFAULT 0
+#define GAME_MODE_MAIN 1
+#define GAME_MODE_LEVELS 2
+#define GAME_MODE_SCORES 3
+#define GAME_MODE_EDITOR 4
+#define GAME_MODE_INFO 5
+#define GAME_MODE_SETUP 6
+#define GAME_MODE_PLAYING 7
+#define GAME_MODE_PSEUDO_DOOR 8
+#define GAME_MODE_PSEUDO_PREVIEW 9
+#define GAME_MODE_PSEUDO_CRUMBLED 10
/* there are no special config file suffixes for these modes */
-#define GAME_MODE_PSEUDO_TYPENAME 11
-#define GAME_MODE_QUIT 12
+#define GAME_MODE_PSEUDO_TYPENAME 11
+#define GAME_MODE_QUIT 12
/* special definitions currently only used for custom artwork configuration */
-#define MUSIC_PREFIX_BACKGROUND 0
-#define NUM_MUSIC_PREFIXES 1
-#define MAX_LEVELS 1000
+#define MUSIC_PREFIX_BACKGROUND 0
+#define NUM_MUSIC_PREFIXES 1
+#define MAX_LEVELS 1000
/* definitions for demo animation lists */
-#define HELPANIM_LIST_NEXT -1
-#define HELPANIM_LIST_END -999
+#define HELPANIM_LIST_NEXT -1
+#define HELPANIM_LIST_END -999
/* program information and versioning definitions */
-#define PROGRAM_VERSION_MAJOR 3
-#define PROGRAM_VERSION_MINOR 1
-#define PROGRAM_VERSION_PATCH 0
-#define PROGRAM_VERSION_BUILD 3
+#define RELEASE_3_1_2 FALSE
-#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
-#define PROGRAM_AUTHOR_STRING "Holger Schemel"
-#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2003 by Holger Schemel"
+#if RELEASE_3_1_2
+#define PROGRAM_VERSION_MAJOR 3
+#define PROGRAM_VERSION_MINOR 1
+#define PROGRAM_VERSION_PATCH 2
+#define PROGRAM_VERSION_BUILD 0
+#else
+/* !!! make sure that packaging script can find unique version number !!! */
+#define PROGRAM_VERSION_MAJOR 3
+#define PROGRAM_VERSION_MINOR 2
+#define PROGRAM_VERSION_PATCH 0
+#define PROGRAM_VERSION_BUILD 6
+#endif
+
+#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
+#define PROGRAM_AUTHOR_STRING "Holger Schemel"
+#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2005 by Holger Schemel"
-#define ICON_TITLE_STRING PROGRAM_TITLE_STRING
-#define COOKIE_PREFIX "ROCKSNDIAMONDS"
-#define FILENAME_PREFIX "Rocks"
+#define ICON_TITLE_STRING PROGRAM_TITLE_STRING
+#define COOKIE_PREFIX "ROCKSNDIAMONDS"
+#define FILENAME_PREFIX "Rocks"
#if defined(PLATFORM_UNIX)
-#define USERDATA_DIRECTORY ".rocksndiamonds"
+#define USERDATA_DIRECTORY ".rocksndiamonds"
#elif defined(PLATFORM_WIN32)
-#define USERDATA_DIRECTORY PROGRAM_TITLE_STRING
+#define USERDATA_DIRECTORY PROGRAM_TITLE_STRING
#else
-#define USERDATA_DIRECTORY "userdata"
+#define USERDATA_DIRECTORY "userdata"
#endif
-#define X11_ICON_FILENAME "rocks_icon.xbm"
-#define X11_ICONMASK_FILENAME "rocks_iconmask.xbm"
-#define MSDOS_POINTER_FILENAME "mouse.pcx"
+#define X11_ICON_FILENAME "rocks_icon.xbm"
+#define X11_ICONMASK_FILENAME "rocks_iconmask.xbm"
+#define MSDOS_POINTER_FILENAME "mouse.pcx"
/* file version numbers for resource files (levels, tapes, score, setup, etc.)
** currently supported/known file version numbers:
** 1.4 (still in use)
** 2.0 (actual)
*/
-#define FILE_VERSION_1_0 VERSION_IDENT(1,0,0,0)
-#define FILE_VERSION_1_2 VERSION_IDENT(1,2,0,0)
-#define FILE_VERSION_1_4 VERSION_IDENT(1,4,0,0)
-#define FILE_VERSION_2_0 VERSION_IDENT(2,0,0,0)
+#define FILE_VERSION_1_0 VERSION_IDENT(1,0,0,0)
+#define FILE_VERSION_1_2 VERSION_IDENT(1,2,0,0)
+#define FILE_VERSION_1_4 VERSION_IDENT(1,4,0,0)
+#define FILE_VERSION_2_0 VERSION_IDENT(2,0,0,0)
/* file version does not change for every program version, but is changed
when new features are introduced that are incompatible with older file
versions, so that they can be treated accordingly */
-#define FILE_VERSION_ACTUAL FILE_VERSION_2_0
+#define FILE_VERSION_ACTUAL FILE_VERSION_2_0
-#define GAME_VERSION_1_0 FILE_VERSION_1_0
-#define GAME_VERSION_1_2 FILE_VERSION_1_2
-#define GAME_VERSION_1_4 FILE_VERSION_1_4
-#define GAME_VERSION_2_0 FILE_VERSION_2_0
+#define GAME_VERSION_1_0 FILE_VERSION_1_0
+#define GAME_VERSION_1_2 FILE_VERSION_1_2
+#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, \
- PROGRAM_VERSION_MINOR, \
- PROGRAM_VERSION_PATCH, \
- PROGRAM_VERSION_BUILD)
+#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
+ PROGRAM_VERSION_MINOR, \
+ PROGRAM_VERSION_PATCH, \
+ PROGRAM_VERSION_BUILD)
/* values for game_emulation */
-#define EMU_NONE 0
-#define EMU_BOULDERDASH 1
-#define EMU_SOKOBAN 2
-#define EMU_SUPAPLEX 3
+#define EMU_NONE 0
+#define EMU_BOULDERDASH 1
+#define EMU_SOKOBAN 2
+#define EMU_SUPAPLEX 3
+
+/* values for level file type identifier */
+#define LEVEL_FILE_TYPE_UNKNOWN 0
+#define LEVEL_FILE_TYPE_RND 1
+#define LEVEL_FILE_TYPE_BD 2
+#define LEVEL_FILE_TYPE_EM 3
+#define LEVEL_FILE_TYPE_SP 4
+#define LEVEL_FILE_TYPE_DX 5
+#define LEVEL_FILE_TYPE_SB 6
+#define LEVEL_FILE_TYPE_DC 7
+
+#define NUM_LEVEL_FILE_TYPES 8
+
+/* values for game engine type identifier */
+#define GAME_ENGINE_TYPE_UNKNOWN LEVEL_FILE_TYPE_UNKNOWN
+#define GAME_ENGINE_TYPE_RND LEVEL_FILE_TYPE_RND
+#define GAME_ENGINE_TYPE_EM LEVEL_FILE_TYPE_EM
+
+#define NUM_ENGINE_TYPES 3
+
struct MenuInfo
{
- int draw_xoffset_default;
- int draw_yoffset_default;
int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
int scrollbar_xoffset;
- int list_size_default;
int list_size[NUM_SPECIAL_GFX_ARGS];
int sound[NUM_SPECIAL_GFX_ARGS];
int Score;
};
+struct Content
+{
+ int e[3][3];
+};
+
struct PlayerInfo
{
boolean present; /* player present in level playfield */
int GfxAction;
- boolean use_murphy_graphic;
+ boolean use_murphy;
+ int artwork_element;
boolean block_last_field;
+ int block_delay_adjustment; /* needed for different engine versions */
+
boolean can_fall_into_acid;
boolean LevelSolved, GameOver;
boolean is_bored;
boolean is_sleeping;
+ boolean cannot_move;
+
int frame_counter_bored;
int frame_counter_sleeping;
int num_special_action_sleeping;
int switch_x, switch_y;
+ int drop_x, drop_y;
int show_envelope;
- unsigned long move_delay;
+ int move_delay;
int move_delay_value;
-
+ int move_delay_value_next;
int move_delay_reset_counter;
- unsigned long push_delay;
- unsigned long push_delay_value;
+ int push_delay;
+ int push_delay_value;
unsigned long actual_frame_counter;
int sokobanfields_still_needed;
int lights_still_needed;
int friends_still_needed;
- int key[4];
+ int key[MAX_NUM_KEYS];
int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl;
int shield_normal_time_left;
int shield_deadly_time_left;
struct LevelInfo
{
+ struct LevelFileInfo file_info;
+
+ int game_engine_type;
+
+ /* level stored in native format for the alternative native game engines */
+ struct LevelInfo_EM *native_em_level;
+
int file_version; /* file format version the level is stored with */
int game_version; /* game release version the level was created with */
int fieldx, fieldy;
- int time;
+ int time; /* available time (seconds) */
int gems_needed;
char name[MAX_LEVEL_NAME_LEN + 1];
int score[LEVEL_SCORE_ELEMENTS];
- int yamyam_content[MAX_ELEMENT_CONTENTS][3][3];
+ struct Content yamyam_content[MAX_ELEMENT_CONTENTS];
int num_yamyam_contents;
int amoeba_speed;
int amoeba_content;
+ int game_of_life[4];
+ int biomaze[4];
+
int time_magic_wall;
int time_wheel;
int time_light;
int time_timegate;
+ int shield_normal_time;
+ int shield_deadly_time;
+
+ int extra_time;
+ int time_orb_time;
+
+ int extra_time_score;
+
+ int start_element[MAX_PLAYERS];
+ boolean use_start_element[MAX_PLAYERS];
+
+#if 1
+ /* values for the new EMC elements */
+ int android_move_time;
+ int android_clone_time;
+ boolean ball_random;
+ boolean ball_state_initial;
+ int ball_time;
+ int lenses_score;
+ int magnify_score;
+ int slurp_score;
+ int lenses_time;
+ int magnify_time;
+ int wind_direction_initial;
+ struct Content ball_content[MAX_ELEMENT_CONTENTS];
+ boolean android_array[16];
+#endif
+
int can_move_into_acid_bits; /* bitfield to store property for elements */
int dont_collide_with_bits; /* bitfield to store property for elements */
boolean double_speed;
boolean initial_gravity;
boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */
- boolean block_last_field; /* player blocks previous field while moving */
- boolean sp_block_last_field; /* player blocks previous field while moving */
boolean use_spring_bug; /* for compatibility with old levels */
+ boolean use_time_orb_bug; /* for compatibility with old levels */
boolean instant_relocation; /* no visual delay when relocating player */
boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */
boolean grow_into_diggable; /* amoeba can grow into anything diggable */
+ boolean block_snap_field; /* snapping blocks field to show animation */
+ boolean block_last_field; /* player blocks previous field while moving */
+ boolean sp_block_last_field; /* player blocks previous field while moving */
+
/* ('int' instead of 'boolean' because used as selectbox value in editor) */
int use_step_counter; /* count steps instead of seconds for level */
boolean use_custom_template; /* use custom properties from template file */
boolean no_valid_file; /* set when level file missing or invalid */
+
+ boolean changed; /* set when level was changed in the editor */
};
struct TapeInfo
{
byte action[MAX_PLAYERS];
byte delay;
- } pos[MAX_TAPELEN];
+ } pos[MAX_TAPE_LEN];
boolean no_valid_file; /* set when tape file missing or invalid */
};
int initial_move_delay_value;
int initial_push_delay_value;
+ /* flags to handle bugs in and changes between different engine versions */
+ /* (for the latest engine version, these flags should always be "FALSE") */
+ boolean use_change_when_pushing_bug;
+ boolean use_block_last_field_bug;
+
/* variable within running game */
int yamyam_content_nr;
boolean magic_wall_active;
int belt_dir[4];
int belt_dir_nr[4];
int switchgate_pos;
- int balloon_dir;
+ int wind_direction;
boolean gravity;
boolean explosions_delayed;
boolean envelope_active;
+#if 1
+ /* values for the new EMC elements */
+ int lenses_time_left;
+ int magnify_time_left;
+#endif
+
/* values for player idle animation (no effect on engine) */
int player_boring_delay_fixed;
int player_boring_delay_random;
int player_sleeping_delay_fixed;
int player_sleeping_delay_random;
+
+ /* values for special game initialization control */
+ boolean restart_level;
};
struct GlobalInfo
{
char *autoplay_leveldir;
- int autoplay_level_nr;
+ int autoplay_level[MAX_TAPES_PER_SET];
+ boolean autoplay_all;
+
+ char *convert_leveldir;
+ int convert_level_nr;
int num_toons;
{
boolean can_change; /* use or ignore this change info */
- unsigned long events; /* change events */
+ boolean has_event[NUM_CHANGE_EVENTS]; /* change events */
int trigger_player; /* player triggering change */
int trigger_side; /* side triggering change */
int trigger_page; /* page triggering change */
- short target_element; /* target element after change */
+ int 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_element; /* element triggering change */
+ int trigger_element; /* element triggering change */
- int target_content[3][3]; /* elements for extended change target */
+ struct Content target_content;/* elements for extended change target */
boolean use_target_content; /* use extended change target */
boolean only_if_complete; /* only use complete target content */
boolean use_random_replace; /* use random value for replacing elements */
boolean explode; /* explode instead of change */
+ boolean has_action; /* execute action on specified condition */
+ int action_type; /* type of action */
+ int action_mode; /* mode of action */
+ int action_arg; /* parameter of action */
+
/* ---------- internal values used at runtime when playing ---------- */
/* functions that are called before, while and after the change of an
void (*post_change_function)(int x, int y);
short actual_trigger_element; /* element that actually triggered change */
+ int actual_trigger_side; /* element side that triggered the change */
int actual_trigger_player; /* player which actually triggered change */
+ int actual_trigger_ce_value; /* CE value of element that triggered change */
+
+ boolean can_change_or_has_action; /* can_change | has_action */
/* ---------- internal values used in level editor ---------- */
struct ElementGroupInfo
{
int num_elements; /* number of elements in this group */
- short element[MAX_ELEMENTS_IN_GROUP]; /* list of elements in this group */
+ int element[MAX_ELEMENTS_IN_GROUP]; /* list of elements in this group */
int choice_mode; /* how to choose element from group */
int choice_pos; /* current element choice position */
};
+struct ElementNameInfo
+{
+ /* ---------- 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; /* pre-defined description for level editor */
+};
+
struct ElementInfo
{
/* ---------- token and description strings ---------- */
/* ---------- special element property values ---------- */
boolean use_gfx_element; /* use custom graphic element */
- short gfx_element; /* optional custom graphic element */
+ int gfx_element; /* optional custom graphic element */
int access_direction; /* accessible from which direction */
- int collect_score; /* score value for collecting */
- int collect_count; /* count value for collecting */
+ int collect_score_initial; /* initial score value for collecting */
+ int collect_count_initial; /* initial count value for collecting */
+
+ int ce_value_fixed_initial; /* initial value for custom variable (fix) */
+ int ce_value_random_initial; /* initial value for custom variable (rnd) */
+ boolean use_last_ce_value; /* use value from element before change */
int push_delay_fixed; /* constant delay before pushing */
int push_delay_random; /* additional random delay before pushing */
int move_pattern; /* direction movable element moves to */
int move_direction_initial; /* initial direction element moves to */
int move_stepsize; /* step size element moves with */
+
int move_enter_element; /* element that can be entered (and removed) */
int move_leave_element; /* element that can be left behind */
int move_leave_type; /* change (limited) or leave (unlimited) */
int slippery_type; /* how/where other elements slip away */
- int content[3][3]; /* new elements after explosion */
+ struct Content content; /* new elements after explosion */
int explosion_type; /* type of explosion, like 3x3, 3+3 or 1x1 */
int explosion_delay; /* duration of explosion of this element */
/* ---------- internal values used at runtime when playing ---------- */
- unsigned long change_events; /* bitfield for combined change events */
+ boolean has_change_event[NUM_CHANGE_EVENTS];
int event_page_nr[NUM_CHANGE_EVENTS]; /* page number for each event */
struct ElementChangeInfo *event_page[NUM_CHANGE_EVENTS]; /* page for event */
boolean in_group[NUM_GROUP_ELEMENTS];
-#if 0
- boolean can_leave_element; /* element can leave other element behind */
- boolean can_leave_element_last;
-#endif
+ int collect_score; /* runtime score value for collecting */
/* ---------- internal values used in level editor ---------- */
struct GraphicInfo
{
Bitmap *bitmap;
+ int src_image_width; /* scaled bitmap size, but w/o small images */
+ int src_image_height; /* scaled bitmap size, but w/o small images */
+
int src_x, src_y; /* start position of animation frames */
int width, height; /* width/height of each animation frame */
int offset_x, offset_y; /* x/y offset to next animation frame */
+ int offset2_x, offset2_y; /* x/y offset to second movement tile */
+ boolean double_movement; /* animation has second movement tile */
+ int swap_double_tiles; /* explicitely force or forbid tile swapping */
int anim_frames;
int anim_frames_per_line;
int anim_start_frame;
int crumbled_like; /* element for cloning crumble graphics */
int diggable_like; /* element for cloning digging graphics */
int border_size; /* border size for "crumbled" graphics */
+ int scale_up_factor; /* optional factor for scaling image up */
+ int clone_from; /* graphic for cloning *all* settings */
int anim_delay_fixed; /* optional delay values for bored and */
int anim_delay_random; /* sleeping player animations (animation */
struct SoundInfo
{
boolean loop;
+ int volume;
+ int priority;
};
struct MusicInfo
};
-#if 0
-extern GC tile_clip_gc;
-extern Bitmap *pix[];
-#endif
extern Bitmap *bitmap_db_field, *bitmap_db_door;
extern Pixmap tile_clipmask[];
extern DrawBuffer *fieldbuffer;
extern boolean level_editor_test_game;
extern boolean network_playing;
+#if defined(TARGET_SDL)
+extern boolean network_server;
+extern SDL_Thread *server_thread;
+#endif
+
extern int key_joystick_mapping;
extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern boolean Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern unsigned long Changed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern unsigned long ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern boolean Changed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern struct MenuInfo menu;
extern struct DoorInfo door_1, door_2;
extern struct ElementInfo element_info[];
+extern struct ElementNameInfo element_name_info[];
extern struct ElementActionInfo element_action_info[];
extern struct ElementDirectionInfo element_direction_info[];
extern struct SpecialSuffixInfo special_suffix_info[];
extern struct MusicFileInfo *music_file_info;
extern struct HelpAnimInfo *helpanim_info;
extern SetupFileHash *helptext_info;
+extern struct ConfigTypeInfo image_config_suffix[];
+extern struct ConfigTypeInfo sound_config_suffix[];
+extern struct ConfigTypeInfo music_config_suffix[];
extern struct ConfigInfo image_config[];
extern struct ConfigInfo sound_config[];
extern struct ConfigInfo music_config[];
-extern struct ConfigInfo image_config_suffix[];
-extern struct ConfigInfo sound_config_suffix[];
-extern struct ConfigInfo music_config_suffix[];
extern struct ConfigInfo helpanim_config[];
extern struct ConfigInfo helptext_config[];