From: Holger Schemel Date: Tue, 10 Jun 2003 00:19:05 +0000 (+0200) Subject: rnd-20030610-1-src X-Git-Tag: 3.0.0^2~54 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=85279bc51ad11bce89beae5b0e02f1faec520afa;p=rocksndiamonds.git rnd-20030610-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 57e08e7b..76000455 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-06-07 19:45]" +#define COMPILE_DATE_STRING "[2003-06-10 02:16]" diff --git a/src/editor.c b/src/editor.c index 10a59ce5..6e7edd10 100644 --- a/src/editor.c +++ b/src/editor.c @@ -71,6 +71,7 @@ #define ED_BORDER_SIZE 3 #define ED_BORDER2_SIZE 5 #define ED_GADGET_DISTANCE 2 +#define ED_GADGET_TEXT_DISTANCE (2 * ED_GADGET_DISTANCE) /* values for the setting windows */ #define ED_SETTINGS_XSTART (3 * MINI_TILEX / 2) @@ -117,7 +118,7 @@ #if 1 #define ED_AREA_ELEM_CONTENT4_XPOS (29 * MINI_TILEX) -#define ED_AREA_ELEM_CONTENT4_YPOS (ED_SETTINGS_YPOS(3) + \ +#define ED_AREA_ELEM_CONTENT4_YPOS (ED_SETTINGS_YPOS(2) + \ ED_GADGET_DISTANCE - MINI_TILEY) #else #define ED_AREA_ELEM_CONTENT4_XPOS (17 * MINI_TILEX) @@ -361,13 +362,15 @@ #define GADGET_ID_CUSTOM_DEADLINESS (GADGET_ID_SELECTBOX_FIRST + 2) #define GADGET_ID_CUSTOM_MOVE_PATTERN (GADGET_ID_SELECTBOX_FIRST + 3) #define GADGET_ID_CUSTOM_MOVE_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 4) -#define GADGET_ID_CUSTOM_WALKABLE_LAYER (GADGET_ID_SELECTBOX_FIRST + 5) -#define GADGET_ID_CHANGE_TIME_UNITS (GADGET_ID_SELECTBOX_FIRST + 6) -#define GADGET_ID_CHANGE_PLAYER_ACTION (GADGET_ID_SELECTBOX_FIRST + 7) -#define GADGET_ID_CHANGE_CAUSE (GADGET_ID_SELECTBOX_FIRST + 8) +#define GADGET_ID_CUSTOM_MOVE_STEPSIZE (GADGET_ID_SELECTBOX_FIRST + 5) +#define GADGET_ID_CUSTOM_SMASH_TARGETS (GADGET_ID_SELECTBOX_FIRST + 6) +#define GADGET_ID_CUSTOM_WALKABLE_LAYER (GADGET_ID_SELECTBOX_FIRST + 7) +#define GADGET_ID_CHANGE_TIME_UNITS (GADGET_ID_SELECTBOX_FIRST + 8) +#define GADGET_ID_CHANGE_PLAYER_ACTION (GADGET_ID_SELECTBOX_FIRST + 9) +#define GADGET_ID_CHANGE_CAUSE (GADGET_ID_SELECTBOX_FIRST + 10) /* textbutton identifiers */ -#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 9) +#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 11) #define GADGET_ID_PROPERTIES_INFO (GADGET_ID_TEXTBUTTON_FIRST + 0) #define GADGET_ID_PROPERTIES_CONFIG (GADGET_ID_TEXTBUTTON_FIRST + 1) @@ -402,21 +405,24 @@ #define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 5) #define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 6) #define GADGET_ID_CUSTOM_EXPLODE_RESULT (GADGET_ID_CHECKBUTTON_FIRST + 7) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 8) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 9) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 10) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 11) -#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 12) -#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 13) -#define GADGET_ID_CUSTOM_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 14) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 15) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 16) -#define GADGET_ID_CUSTOM_CHANGEABLE (GADGET_ID_CHECKBUTTON_FIRST + 17) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 18) -#define GADGET_ID_CHANGE_BY_PLAYER (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 8) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 9) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 10) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 11) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 12) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 13) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 14) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 15) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 16) +#define GADGET_ID_CUSTOM_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 17) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 18) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_CHANGE_BY_PLAYER (GADGET_ID_CHECKBUTTON_FIRST + 22) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 23) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -494,12 +500,14 @@ #define ED_SELECTBOX_ID_CUSTOM_DEADLINESS 2 #define ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN 3 #define ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION 4 -#define ED_SELECTBOX_ID_CUSTOM_WALKABLE_LAYER 5 -#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS 6 -#define ED_SELECTBOX_ID_CHANGE_PLAYER_ACTION 7 -#define ED_SELECTBOX_ID_CHANGE_CAUSE 8 +#define ED_SELECTBOX_ID_CUSTOM_MOVE_STEPSIZE 5 +#define ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS 6 +#define ED_SELECTBOX_ID_CUSTOM_WALKABLE_LAYER 7 +#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS 8 +#define ED_SELECTBOX_ID_CHANGE_PLAYER_ACTION 9 +#define ED_SELECTBOX_ID_CHANGE_CAUSE 10 -#define ED_NUM_SELECTBOX 9 +#define ED_NUM_SELECTBOX 11 #define ED_SELECTBOX_ID_CUSTOM_FIRST ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION #define ED_SELECTBOX_ID_CUSTOM_LAST ED_SELECTBOX_ID_CUSTOM_WALKABLE_LAYER @@ -522,20 +530,23 @@ #define ED_CHECKBUTTON_ID_STICK_ELEMENT 3 #define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 4 #define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT 5 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 6 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 7 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 8 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 9 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 10 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 11 -#define ED_CHECKBUTTON_ID_CUSTOM_WALKABLE 12 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 13 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 14 -#define ED_CHECKBUTTON_ID_CUSTOM_CHANGEABLE 15 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 16 -#define ED_CHECKBUTTON_ID_CHANGE_BY_PLAYER 17 - -#define ED_NUM_CHECKBUTTONS 18 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 6 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 7 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 8 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 9 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 10 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 11 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 12 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 13 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 14 +#define ED_CHECKBUTTON_ID_CUSTOM_WALKABLE 15 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 16 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 17 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 18 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 19 +#define ED_CHECKBUTTON_ID_CHANGE_BY_PLAYER 20 + +#define ED_NUM_CHECKBUTTONS 21 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -816,7 +827,7 @@ static struct ValueTextInfo options_walk_to_action[] = { EP_PUSHABLE, "pushable" }, { -1, NULL } }; -static int index_walk_to_action = 0; +static int value_walk_to_action = 0; static struct ValueTextInfo options_move_pattern[] = { @@ -833,7 +844,6 @@ static struct ValueTextInfo options_move_pattern[] = { MV_ALONG_RIGHT_SIDE, "along right side" }, { -1, NULL } }; -static int index_move_pattern = 0; static struct ValueTextInfo options_move_direction[] = { @@ -844,17 +854,24 @@ static struct ValueTextInfo options_move_direction[] = { MV_DOWN, "down" }, { -1, NULL } }; -static int index_move_direction = 0; + +static struct ValueTextInfo options_move_stepsize[] = +{ + { 1, "very slow" }, + { 2, "slow" }, + { 4, "normal" }, + { 8, "fast" }, + { 16, "very fast" }, + { -1, NULL } +}; static struct ValueTextInfo options_consistency[] = { + { EP_CAN_EXPLODE, "can explode" }, { EP_INDESTRUCTIBLE, "indestructible" }, - { EP_CAN_EXPLODE_BY_FIRE, "can explode by fire" }, - { EP_CAN_EXPLODE_SMASHED, "can explode when smashed" }, - { EP_CAN_EXPLODE_IMPACT, "can explode on impact" }, { -1, NULL } }; -static int index_consistency = 0; +static int value_consistency = 0; static struct ValueTextInfo options_deadliness[] = { @@ -863,7 +880,16 @@ static struct ValueTextInfo options_deadliness[] = { EP_DONT_TOUCH, "touching" }, { -1, NULL } }; -static int index_deadliness = 0; +static int value_deadliness = 0; + +static struct ValueTextInfo options_smash_targets[] = +{ + { EP_CAN_SMASH_FRIENDS, "friends" }, + { EP_CAN_SMASH_ENEMIES, "enemies" }, + { EP_CAN_SMASH_EXPLOSIVES, "explosives" }, + { -1, NULL } +}; +static int value_smash_targets = 0; static struct ValueTextInfo options_walkable_layer[] = { @@ -872,7 +898,7 @@ static struct ValueTextInfo options_walkable_layer[] = { EP_WALKABLE_UNDER, "under" }, { -1, NULL } }; -static int index_walkable_layer = 0; +static int value_walkable_layer = 0; static struct ValueTextInfo options_time_units[] = { @@ -880,7 +906,6 @@ static struct ValueTextInfo options_time_units[] = { 1, "frames" }, { -1, NULL } }; -static int index_time_units = 0; static struct ValueTextInfo options_change_player_action[] = { @@ -888,7 +913,7 @@ static struct ValueTextInfo options_change_player_action[] = { CE_TOUCHED_BY_PLAYER, "touched" }, { -1, NULL } }; -static int index_change_player_action = 0, value_change_player_action = 0; +static int value_change_player_action = 0; static struct ValueTextInfo options_change_cause[] = { @@ -899,7 +924,7 @@ static struct ValueTextInfo options_change_cause[] = { 5, "pressed by player" }, { -1, NULL } }; -static int index_change_cause = 0, value_change_cause = 0; +static int value_change_cause = 0; static struct { @@ -907,7 +932,7 @@ static struct int gadget_id; int size; /* char size of selectbox or '-1' (dynamically determined) */ struct ValueTextInfo *options; - int *index, *value; + int *value; char *text_left, *text_right, *infotext; } selectbox_info[ED_NUM_SELECTBOX] = { @@ -915,31 +940,31 @@ static struct ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), GADGET_ID_CUSTOM_WALK_TO_ACTION, -1, - options_walk_to_action, &index_walk_to_action, - &custom_element.walk_to_action, + options_walk_to_action, + &value_walk_to_action, NULL, NULL, "diggable/collectible/pushable" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2), GADGET_ID_CUSTOM_CONSISTENCY, -1, - options_consistency, &index_consistency, - &custom_element.consistency, - NULL, "to", "consistency/destructibility" + options_consistency, + &value_consistency, + NULL, "explodes to:", "consistency/destructibility" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_DEADLINESS, -1, - options_deadliness, &index_deadliness, - &custom_element.deadliness, + options_deadliness, + &value_deadliness, "deadly when", NULL, "deadliness of element" }, { ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(6), GADGET_ID_CUSTOM_MOVE_PATTERN, -1, - options_move_pattern, &index_move_pattern, + options_move_pattern, &custom_element.move_pattern, "can move", NULL, "element move direction" }, @@ -947,23 +972,39 @@ static struct ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_MOVE_DIRECTION, -1, - options_move_direction, &index_move_direction, + options_move_direction, &custom_element.move_direction_initial, "starts moving", NULL, "initial element move direction" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(13), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(9), + GADGET_ID_CUSTOM_MOVE_STEPSIZE, + -1, + options_move_stepsize, + &custom_element.move_stepsize, + "move speed", NULL, "speed of element movement" + }, + { + ED_SETTINGS_XPOS(7), ED_SETTINGS_YPOS(10), + GADGET_ID_CUSTOM_SMASH_TARGETS, + -1, + options_smash_targets, + &value_smash_targets, + "can smash", NULL, "elements that can be smashed" + }, + { + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(12), GADGET_ID_CUSTOM_WALKABLE_LAYER, -1, - options_walkable_layer, &index_walkable_layer, - &custom_element.walkable_layer, + options_walkable_layer, + &value_walkable_layer, "player can walk", NULL, "layer where player can walk" }, { ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(4), GADGET_ID_CHANGE_TIME_UNITS, -1, - options_time_units, &index_time_units, + options_time_units, &custom_element.change.delay_frames, "delay time given in", NULL, "delay time units for change" }, @@ -971,7 +1012,7 @@ static struct ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(5), GADGET_ID_CHANGE_PLAYER_ACTION, -1, - options_change_player_action, &index_change_player_action, + options_change_player_action, &value_change_player_action, NULL, "by player", "type of player contact" }, @@ -979,7 +1020,7 @@ static struct ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10), GADGET_ID_CHANGE_CAUSE, -1, - options_change_cause, &index_change_cause, + options_change_cause, &value_change_cause, "test:", NULL, "test-selectbox entry" }, @@ -1162,11 +1203,29 @@ static struct "slip down from certain flat walls","use EM style slipping behaviour" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(3), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), GADGET_ID_CUSTOM_EXPLODE_RESULT, &custom_element_properties[EP_EXPLODE_RESULT], NULL, "set consistency/destructibility" }, + { + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3), + GADGET_ID_CUSTOM_EXPLODE_FIRE, + &custom_element_properties[EP_CAN_EXPLODE_BY_FIRE], + "by fire", "element can explode by fire/explosion" + }, + { + ED_SETTINGS_XPOS(7), ED_SETTINGS_YPOS(3), + GADGET_ID_CUSTOM_EXPLODE_SMASH, + &custom_element_properties[EP_CAN_EXPLODE_SMASHED], + "smashed", "element can explode when smashed" + }, + { + ED_SETTINGS_XPOS(13), ED_SETTINGS_YPOS(3), + GADGET_ID_CUSTOM_EXPLODE_IMPACT, + &custom_element_properties[EP_CAN_EXPLODE_IMPACT], + "impact", "element can explode on impact" + }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(4), GADGET_ID_CUSTOM_WALK_TO_OBJECT, @@ -1174,7 +1233,7 @@ static struct NULL, "player can dig/collect/push element" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_DEADLY, &custom_element_properties[EP_DEADLY], NULL, "element can kill the player" @@ -1186,25 +1245,25 @@ static struct NULL, "element can move in some direction" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(9), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10), GADGET_ID_CUSTOM_CAN_FALL, &custom_element_properties[EP_CAN_FALL], "can fall", "element can fall down" }, { - ED_SETTINGS_XPOS(6), ED_SETTINGS_YPOS(9), + ED_SETTINGS_XPOS(6), ED_SETTINGS_YPOS(10), GADGET_ID_CUSTOM_CAN_SMASH, &custom_element_properties[EP_CAN_SMASH], - "can smash on impact", "element can smash other elements" + NULL, "element can smash other elements" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_SLIPPERY, &custom_element_properties[EP_SLIPPERY], "slippery", "other elements can fall down from it" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(13), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(12), GADGET_ID_CUSTOM_WALKABLE, &custom_element_properties[EP_WALKABLE], NULL, "player can walk on the same field" @@ -1223,8 +1282,8 @@ static struct }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), - GADGET_ID_CUSTOM_CHANGEABLE, - &custom_element_properties[EP_CHANGEABLE], + GADGET_ID_CUSTOM_CAN_CHANGE, + &custom_element_properties[EP_CAN_CHANGE], "element changes to after/when:","element can change to other element" }, { @@ -2428,7 +2487,7 @@ static void CreateCounterButtons() if (counterbutton_info[i].text_left != NULL) xoffset = (getFontWidth(FONT_TEXT_1) * strlen(counterbutton_info[i].text_left) + - 2 * ED_GADGET_DISTANCE); + ED_GADGET_TEXT_DISTANCE); for (j=0; j<2; j++) { @@ -2796,7 +2855,7 @@ static void CreateSelectboxGadgets() if (selectbox_info[i].text_left != NULL) xoffset = (getFontWidth(FONT_TEXT_1) * strlen(selectbox_info[i].text_left) + - 2 * ED_GADGET_DISTANCE); + ED_GADGET_TEXT_DISTANCE); sprintf(infotext, "Select %s", selectbox_info[i].infotext); infotext[max_infotext_len] = '\0'; @@ -2808,7 +2867,6 @@ static void CreateSelectboxGadgets() GDI_Y, SY + selectbox_info[i].y, GDI_TYPE, GD_TYPE_SELECTBOX, GDI_SELECTBOX_OPTIONS, selectbox_info[i].options, - GDI_SELECTBOX_INDEX, selectbox_info[i].index, GDI_TEXT_SIZE, selectbox_info[i].size, GDI_TEXT_FONT, FONT_INPUT_1, GDI_TEXT_FONT_ACTIVE, FONT_INPUT_1_ACTIVE, @@ -3179,7 +3237,7 @@ static void MapSelectboxGadget(int id) { int xoffset_left = 0; int yoffset_left = ED_BORDER_SIZE; - int xoffset_right = ED_BORDER_SIZE; + int xoffset_right = ED_GADGET_TEXT_DISTANCE; int yoffset_right = ED_BORDER_SIZE; int x = selectbox_info[id].x + xoffset_left; int y = selectbox_info[id].y + yoffset_left; @@ -3357,7 +3415,7 @@ static void CopyCustomElementPropertiesToEditor(int element) custom_element_change_events[i] = HAS_CHANGE_EVENT(element, i); /* set walk-to-object action selectbox help value */ - custom_element.walk_to_action = + value_walk_to_action = (IS_DIGGABLE(element) ? EP_DIGGABLE : IS_COLLECTIBLE(element) ? EP_COLLECTIBLE : IS_PUSHABLE(element) ? EP_PUSHABLE : @@ -3368,16 +3426,16 @@ static void CopyCustomElementPropertiesToEditor(int element) IS_PUSHABLE(element)); /* set consistency selectbox help value */ - custom_element.consistency = - (IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE : - CAN_EXPLODE_BY_FIRE(element) ? EP_CAN_EXPLODE_BY_FIRE : - EP_INDESTRUCTIBLE); + value_consistency = + (CAN_EXPLODE(element) ? EP_CAN_EXPLODE : + IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE : + EP_CAN_EXPLODE); custom_element_properties[EP_EXPLODE_RESULT] = - (IS_INDESTRUCTIBLE(element) || - CAN_EXPLODE_BY_FIRE(element)); + (CAN_EXPLODE(element) || + IS_INDESTRUCTIBLE(element)); /* set deadliness selectbox help value */ - custom_element.deadliness = + value_deadliness = (DONT_TOUCH(element) ? EP_DONT_TOUCH : DONT_COLLIDE_WITH(element) ? EP_DONT_COLLIDE_WITH : DONT_RUN_INTO(element) ? EP_DONT_RUN_INTO : @@ -3387,8 +3445,19 @@ static void CopyCustomElementPropertiesToEditor(int element) DONT_COLLIDE_WITH(element) || DONT_RUN_INTO(element)); + /* set smash targets selectbox help value */ + value_smash_targets = + (CAN_SMASH_EXPLOSIVES(element) ? EP_CAN_SMASH_EXPLOSIVES : + CAN_SMASH_ENEMIES(element) ? EP_CAN_SMASH_ENEMIES : + CAN_SMASH_FRIENDS(element) ? EP_CAN_SMASH_FRIENDS : + EP_CAN_SMASH_FRIENDS); + custom_element_properties[EP_CAN_SMASH] = + (CAN_SMASH_EXPLOSIVES(element) || + CAN_SMASH_ENEMIES(element) || + CAN_SMASH_FRIENDS(element)); + /* set walkable layer selectbox help value */ - custom_element.walkable_layer = + value_walkable_layer = (IS_WALKABLE_OVER(element) ? EP_WALKABLE_OVER : IS_WALKABLE_INSIDE(element) ? EP_WALKABLE_INSIDE : IS_WALKABLE_UNDER(element) ? EP_WALKABLE_UNDER : @@ -3415,27 +3484,34 @@ static void CopyCustomElementPropertiesToGame(int element) custom_element_properties[EP_DIGGABLE] = FALSE; custom_element_properties[EP_COLLECTIBLE] = FALSE; custom_element_properties[EP_PUSHABLE] = FALSE; - custom_element_properties[custom_element.walk_to_action] = + custom_element_properties[value_walk_to_action] = custom_element_properties[EP_WALK_TO_OBJECT]; /* set consistency property from checkbox and selectbox */ + custom_element_properties[EP_CAN_EXPLODE] = FALSE; custom_element_properties[EP_INDESTRUCTIBLE] = FALSE; - custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] = FALSE; - custom_element_properties[custom_element.consistency] = + custom_element_properties[value_consistency] = custom_element_properties[EP_EXPLODE_RESULT]; /* set deadliness property from checkbox and selectbox */ custom_element_properties[EP_DONT_RUN_INTO] = FALSE; custom_element_properties[EP_DONT_COLLIDE_WITH] = FALSE; custom_element_properties[EP_DONT_TOUCH] = FALSE; - custom_element_properties[custom_element.deadliness] = + custom_element_properties[value_deadliness] = custom_element_properties[EP_DEADLY]; + /* set smash property from checkbox and selectbox */ + custom_element_properties[EP_CAN_SMASH_FRIENDS] = FALSE; + custom_element_properties[EP_CAN_SMASH_ENEMIES] = FALSE; + custom_element_properties[EP_CAN_SMASH_EXPLOSIVES] = FALSE; + custom_element_properties[value_smash_targets] = + custom_element_properties[EP_CAN_SMASH]; + /* set walkable property from checkbox and selectbox */ custom_element_properties[EP_WALKABLE_OVER] = FALSE; custom_element_properties[EP_WALKABLE_INSIDE] = FALSE; custom_element_properties[EP_WALKABLE_UNDER] = FALSE; - custom_element_properties[custom_element.walkable_layer] = + custom_element_properties[value_walkable_layer] = custom_element_properties[EP_WALKABLE]; /* set player change event from checkbox and selectbox */ @@ -4174,8 +4250,16 @@ static void DrawPropertiesInfo() { EP_CAN_MOVE, "- can move" }, { EP_CAN_FALL, "- can fall" }, - { EP_CAN_SMASH, "- can smash other objects" }, - { EP_CAN_EXPLODE_BY_FIRE, "- can explode (by fire/explosion)" }, +#if 0 + { EP_CAN_SMASH, "- can smash" }, +#endif + { EP_CAN_SMASH_FRIENDS, "- can smash player and friends" }, + { EP_CAN_SMASH_ENEMIES, "- can smash good and bad guys" }, + { EP_CAN_SMASH_EXPLOSIVES, "- can smash everything smashable" }, + { EP_CAN_EXPLODE, "- can explode" }, + { EP_CAN_EXPLODE_BY_FIRE, " - by fire or explosions" }, + { EP_CAN_EXPLODE_SMASHED, " - when smashed" }, + { EP_CAN_EXPLODE_IMPACT, " - on impact" }, { EP_DONT_RUN_INTO, "- deadly when running into" }, { EP_DONT_COLLIDE_WITH, "- deadly when colliding with" }, @@ -5483,7 +5567,6 @@ static void HandleSelectboxGadgets(struct GadgetInfo *gi) { int type_id = gi->custom_type_id; - *selectbox_info[type_id].index = gi->selectbox.index; *selectbox_info[type_id].value = selectbox_info[type_id].options[gi->selectbox.index].value; diff --git a/src/files.c b/src/files.c index c835a734..d6611204 100644 --- a/src/files.c +++ b/src/files.c @@ -101,7 +101,9 @@ static void setLevelInfoToDefaults() element_info[element].use_gfx_element = FALSE; element_info[element].gfx_element = EL_EMPTY_SPACE; - element_info[element].move_pattern = MV_NO_MOVING; + element_info[element].move_pattern = MV_ALL_DIRECTIONS; + element_info[element].move_direction_initial = MV_NO_MOVING; + element_info[element].move_stepsize = TILEX / 8; for(x=0; x<3; x++) for(y=0; y<3; y++) diff --git a/src/game.c b/src/game.c index 7af0d617..c4764283 100644 --- a/src/game.c +++ b/src/game.c @@ -674,7 +674,7 @@ static void InitGameEngine() struct ElementChangeInfo *change = &element_info[element].change; /* only add custom elements that change after fixed/random frame delay */ - if (!IS_CHANGEABLE(element) || !HAS_CHANGE_EVENT(element, CE_DELAY)) + if (!CAN_CHANGE(element) || !HAS_CHANGE_EVENT(element, CE_DELAY)) continue; changing_element[element].base_element = element; @@ -2316,8 +2316,9 @@ void Impact(int x, int y) { boolean lastline = (y == lev_fieldy-1); boolean object_hit = FALSE; + boolean impact = (lastline || object_hit); int element = Feld[x][y]; - int smashed = 0; + int smashed = EL_UNDEFINED; if (!lastline) /* check if element below was hit */ { @@ -2337,16 +2338,20 @@ void Impact(int x, int y) return; } - if (lastline || object_hit) + if (impact) { ResetGfxAnimation(x, y); DrawLevelField(x, y); } +#if 1 + if (impact && CAN_EXPLODE_IMPACT(element)) +#else if ((element == EL_BOMB || element == EL_SP_DISK_ORANGE || element == EL_DX_SUPABOMB) && (lastline || object_hit)) /* element is bomb */ +#endif { Bang(x, y); return; @@ -2358,7 +2363,7 @@ void Impact(int x, int y) return; } - if (element == EL_AMOEBA_DROP && (lastline || object_hit)) + if (impact && element == EL_AMOEBA_DROP) { if (object_hit && IS_PLAYER(x, y+1)) KillHeroUnlessProtected(x, y+1); @@ -3708,7 +3713,7 @@ void ContinueMoving(int x, int y) int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); int horiz_move = (dx != 0); int newx = x + dx, newy = y + dy; - int step = (horiz_move ? dx : dy) * TILEX / 8; + int step = (horiz_move ? dx : dy) * TILEX / MOVE_DELAY_NORMAL_SPEED; if (element == EL_AMOEBA_DROP || element == EL_AMOEBA_DROPPING) step /= 2; @@ -3725,6 +3730,8 @@ void ContinueMoving(int x, int y) step /= 2; else if (element == EL_SPRING && horiz_move) step *= 2; + else if (IS_CUSTOM_ELEMENT(element)) + step = SIGN(step) * element_info[element].move_stepsize; #if OLD_GAME_BEHAVIOUR else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element)) diff --git a/src/init.c b/src/init.c index 5274a2ac..11100842 100644 --- a/src/init.c +++ b/src/init.c @@ -1143,6 +1143,62 @@ void InitElementPropertiesStatic() -1 }; + static int ep_dont_run_into[] = + { + /* same elements as in 'ep_dont_touch' */ + EL_BUG, + EL_SPACESHIP, + EL_BD_BUTTERFLY, + EL_BD_FIREFLY, + + /* same elements as in 'ep_dont_collide_with' */ + EL_YAMYAM, + EL_DARK_YAMYAM, + EL_ROBOT, + EL_PACMAN, + EL_SP_SNIKSNAK, + EL_SP_ELECTRON, + + /* new elements */ + EL_AMOEBA_DROP, + EL_ACID, + + /* !!! maybe this should better be handled by 'ep_diggable' !!! */ +#if 1 + EL_SP_BUGGY_BASE_ACTIVE, + EL_TRAP_ACTIVE, + EL_LANDMINE, +#endif + -1 + }; + + static int ep_dont_collide_with[] = + { + /* same elements as in 'ep_dont_touch' */ + EL_BUG, + EL_SPACESHIP, + EL_BD_BUTTERFLY, + EL_BD_FIREFLY, + + /* new elements */ + EL_YAMYAM, + EL_DARK_YAMYAM, + EL_ROBOT, + EL_PACMAN, + EL_SP_SNIKSNAK, + EL_SP_ELECTRON, + -1 + }; + + static int ep_dont_touch[] = + { + EL_BUG, + EL_SPACESHIP, + EL_BD_BUTTERFLY, + EL_BD_FIREFLY, + -1 + }; + static int ep_indestructible[] = { EL_STEELWALL, @@ -1272,31 +1328,8 @@ void InitElementPropertiesStatic() -1 }; - static int ep_can_explode_by_fire[] = + static int ep_can_change[] = { - EL_BOMB, - EL_DYNAMITE_ACTIVE, - EL_DYNAMITE, - EL_DYNABOMB_PLAYER_1_ACTIVE, - EL_DYNABOMB_PLAYER_2_ACTIVE, - EL_DYNABOMB_PLAYER_3_ACTIVE, - EL_DYNABOMB_PLAYER_4_ACTIVE, - EL_DYNABOMB_INCREASE_NUMBER, - EL_DYNABOMB_INCREASE_SIZE, - EL_DYNABOMB_INCREASE_POWER, - EL_SP_DISK_RED_ACTIVE, - EL_BUG, - EL_MOLE, - EL_PENGUIN, - EL_PIG, - EL_DRAGON, - EL_SATELLITE, - EL_SP_DISK_RED, - EL_SP_DISK_ORANGE, - EL_SP_DISK_YELLOW, - EL_SP_SNIKSNAK, - EL_SP_ELECTRON, - EL_DX_SUPABOMB, -1 }; @@ -1350,7 +1383,7 @@ void InitElementPropertiesStatic() -1 }; - static int ep_can_smash[] = + static int ep_can_smash_friends[] = { EL_ROCK, EL_BD_ROCK, @@ -1375,6 +1408,78 @@ void InitElementPropertiesStatic() -1 }; + static int ep_can_smash_enemies[] = + { + EL_ROCK, + EL_BD_ROCK, + EL_SP_ZONK, + -1 + }; + + static int ep_can_smash_explosives[] = + { + EL_ROCK, + EL_BD_ROCK, + EL_SP_ZONK, + -1 + }; + + static int ep_can_explode_by_fire[] = + { + /* same elements as in 'ep_can_explode_impact' */ + EL_BOMB, + EL_SP_DISK_ORANGE, + EL_DX_SUPABOMB, + + /* same elements as in 'ep_can_explode_smashed' */ + EL_SATELLITE, + EL_PIG, + EL_DRAGON, + EL_MOLE, + + /* new elements */ + EL_DYNAMITE_ACTIVE, + EL_DYNAMITE, + EL_DYNABOMB_PLAYER_1_ACTIVE, + EL_DYNABOMB_PLAYER_2_ACTIVE, + EL_DYNABOMB_PLAYER_3_ACTIVE, + EL_DYNABOMB_PLAYER_4_ACTIVE, + EL_DYNABOMB_INCREASE_NUMBER, + EL_DYNABOMB_INCREASE_SIZE, + EL_DYNABOMB_INCREASE_POWER, + EL_SP_DISK_RED_ACTIVE, + EL_BUG, + EL_PENGUIN, + EL_SP_DISK_RED, + EL_SP_DISK_YELLOW, + EL_SP_SNIKSNAK, + EL_SP_ELECTRON, + -1 + }; + + static int ep_can_explode_smashed[] = + { + /* same elements as in 'ep_can_explode_impact' */ + EL_BOMB, + EL_SP_DISK_ORANGE, + EL_DX_SUPABOMB, + + /* new elements */ + EL_SATELLITE, + EL_PIG, + EL_DRAGON, + EL_MOLE, + -1 + }; + + static int ep_can_explode_impact[] = + { + EL_BOMB, + EL_SP_DISK_ORANGE, + EL_DX_SUPABOMB, + -1 + }; + static int ep_walkable_over[] = { EL_EMPTY_SPACE, @@ -1531,57 +1636,6 @@ void InitElementPropertiesStatic() -1 }; - static int ep_dont_touch[] = - { - EL_BUG, - EL_SPACESHIP, - EL_BD_BUTTERFLY, - EL_BD_FIREFLY, - -1 - }; - - static int ep_dont_collide_with[] = - { - EL_BUG, - EL_SPACESHIP, - EL_BD_BUTTERFLY, - EL_BD_FIREFLY, - - EL_YAMYAM, - EL_DARK_YAMYAM, - EL_ROBOT, - EL_PACMAN, - EL_SP_SNIKSNAK, - EL_SP_ELECTRON, - -1 - }; - - static int ep_dont_run_into[] = - { - EL_BUG, - EL_SPACESHIP, - EL_BD_BUTTERFLY, - EL_BD_FIREFLY, - - EL_YAMYAM, - EL_DARK_YAMYAM, - EL_ROBOT, - EL_PACMAN, - EL_SP_SNIKSNAK, - EL_SP_ELECTRON, - - EL_AMOEBA_DROP, - EL_ACID, - - /* !!! maybe this should better be handled by 'ep_diggable' !!! */ -#if 1 - EL_SP_BUGGY_BASE_ACTIVE, - EL_TRAP_ACTIVE, - EL_LANDMINE, -#endif - -1 - }; - static int ep_bd_element[] = { EL_EMPTY, @@ -2248,10 +2302,20 @@ void InitElementPropertiesStatic() { { ep_diggable, EP_DIGGABLE }, { ep_collectible, EP_COLLECTIBLE }, + { ep_dont_run_into, EP_DONT_RUN_INTO }, + { ep_dont_collide_with, EP_DONT_COLLIDE_WITH }, + { ep_dont_touch, EP_DONT_TOUCH }, { ep_indestructible, EP_INDESTRUCTIBLE }, { ep_slippery, EP_SLIPPERY }, + { ep_can_change, EP_CAN_CHANGE }, + { ep_can_move, EP_CAN_MOVE }, { ep_can_fall, EP_CAN_FALL }, - { ep_can_smash, EP_CAN_SMASH }, + { ep_can_smash_friends, EP_CAN_SMASH_FRIENDS }, + { ep_can_smash_enemies, EP_CAN_SMASH_ENEMIES }, + { ep_can_smash_explosives, EP_CAN_SMASH_EXPLOSIVES }, + { ep_can_explode_by_fire, EP_CAN_EXPLODE_BY_FIRE }, + { ep_can_explode_smashed, EP_CAN_EXPLODE_SMASHED }, + { ep_can_explode_impact, EP_CAN_EXPLODE_IMPACT }, { ep_walkable_over, EP_WALKABLE_OVER }, { ep_walkable_inside, EP_WALKABLE_INSIDE }, { ep_walkable_under, EP_WALKABLE_UNDER }, @@ -2260,15 +2324,11 @@ void InitElementPropertiesStatic() { ep_passable_under, EP_PASSABLE_UNDER }, { ep_pushable, EP_PUSHABLE }, - { ep_player, EP_PLAYER }, { ep_can_be_crumbled, EP_CAN_BE_CRUMBLED }, - { ep_can_move, EP_CAN_MOVE }, + + { ep_player, EP_PLAYER }, { ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL }, { ep_switchable, EP_SWITCHABLE }, - { ep_dont_touch, EP_DONT_TOUCH }, - { ep_dont_collide_with, EP_DONT_COLLIDE_WITH }, - { ep_dont_run_into, EP_DONT_RUN_INTO }, - { ep_can_explode_by_fire, EP_CAN_EXPLODE_BY_FIRE }, { ep_bd_element, EP_BD_ELEMENT }, { ep_sp_element, EP_SP_ELEMENT }, { ep_sb_element, EP_SB_ELEMENT }, @@ -2384,26 +2444,31 @@ void InitElementPropertiesEngine(int engine_version) static int no_wall_properties[] = { - EP_AMOEBALIVE, - EP_AMOEBOID, - EP_CAN_BE_CRUMBLED, + EP_DIGGABLE, + EP_COLLECTIBLE, + EP_DONT_RUN_INTO, EP_DONT_COLLIDE_WITH, - EP_CAN_FALL, - EP_CAN_SMASH, EP_CAN_MOVE, - EP_DONT_RUN_INTO, - EP_FOOD_DARK_YAMYAM, - EP_GEM, - EP_FOOD_PENGUIN, + EP_CAN_FALL, + EP_CAN_SMASH_FRIENDS, + EP_CAN_SMASH_ENEMIES, + EP_CAN_SMASH_EXPLOSIVES, EP_PUSHABLE, + + EP_CAN_BE_CRUMBLED, + EP_PLAYER, - EP_ACCESSIBLE, - EP_DIGGABLE, - EP_COLLECTIBLE, - EP_ACTIVE_BOMB, + EP_GEM, + EP_FOOD_DARK_YAMYAM, + EP_FOOD_PENGUIN, EP_BELT, EP_BELT_ACTIVE, EP_TUBE, + EP_AMOEBOID, + EP_AMOEBALIVE, + EP_ACTIVE_BOMB, + + EP_ACCESSIBLE, -1 }; @@ -2489,13 +2554,30 @@ void InitElementPropertiesEngine(int engine_version) !IS_WALKABLE_OVER(i) && !IS_WALKABLE_UNDER(i))); - /* ---------- DONT_COLLIDE_WITH ---------------------------------------- */ - if (DONT_TOUCH(i)) /* dont_touch => dont_collide_with */ - SET_PROPERTY(i, EP_DONT_COLLIDE_WITH, TRUE); + if (IS_CUSTOM_ELEMENT(i)) + { + /* ---------- DONT_COLLIDE_WITH / DONT_RUN_INTO ---------------------- */ + if (DONT_TOUCH(i)) + SET_PROPERTY(i, EP_DONT_COLLIDE_WITH, TRUE); + if (DONT_COLLIDE_WITH(i)) + SET_PROPERTY(i, EP_DONT_RUN_INTO, TRUE); + + /* ---------- CAN_SMASH_ENEMIES / CAN_SMASH_FRIENDS ------------------ */ + if (CAN_SMASH_EXPLOSIVES(i)) + SET_PROPERTY(i, EP_CAN_SMASH_ENEMIES, TRUE); + if (CAN_SMASH_ENEMIES(i)) + SET_PROPERTY(i, EP_CAN_SMASH_FRIENDS, TRUE); + } + + /* ---------- CAN_SMASH ------------------------------------------------ */ + SET_PROPERTY(i, EP_CAN_SMASH, (CAN_SMASH_FRIENDS(i) || + CAN_SMASH_ENEMIES(i) || + CAN_SMASH_EXPLOSIVES(i))); - /* ---------- DONT_RUN_INTO -------------------------------------------- */ - if (DONT_COLLIDE_WITH(i)) /* dont_collide_with => dont_run_into */ - SET_PROPERTY(i, EP_DONT_RUN_INTO, TRUE); + /* ---------- CAN_EXPLODE ---------------------------------------------- */ + SET_PROPERTY(i, EP_CAN_EXPLODE, (CAN_EXPLODE_BY_FIRE(i) || + CAN_EXPLODE_SMASHED(i) || + CAN_EXPLODE_BY_FIRE(i))); } #if 0 diff --git a/src/main.h b/src/main.h index daec3962..239e6afb 100644 --- a/src/main.h +++ b/src/main.h @@ -68,21 +68,21 @@ #define EP_DONT_TOUCH 4 #define EP_INDESTRUCTIBLE 5 #define EP_SLIPPERY 6 -#define EP_CAN_EXPLODE_BY_FIRE 7 +#define EP_CAN_CHANGE 7 #define EP_CAN_MOVE 8 #define EP_CAN_FALL 9 -#define EP_CAN_SMASH 10 -#define EP_WALKABLE_OVER 11 -#define EP_WALKABLE_INSIDE 12 -#define EP_WALKABLE_UNDER 13 -#define EP_PASSABLE_OVER 14 -#define EP_PASSABLE_INSIDE 15 -#define EP_PASSABLE_UNDER 16 -#define EP_CHANGEABLE 17 -#define EP_CAN_EXPLODE_SMASHED 18 -#define EP_CAN_EXPLODE_IMPACT 19 -#define EP_UNUSED_20 20 -#define EP_UNUSED_21 21 +#define EP_CAN_SMASH_FRIENDS 10 +#define EP_CAN_SMASH_ENEMIES 11 +#define EP_CAN_SMASH_EXPLOSIVES 12 +#define EP_CAN_EXPLODE_BY_FIRE 13 +#define EP_CAN_EXPLODE_SMASHED 14 +#define EP_CAN_EXPLODE_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_UNUSED_22 22 #define EP_UNUSED_23 23 #define EP_PUSHABLE 24 @@ -130,13 +130,15 @@ #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 /* values for internal purpose only (level editor) */ -#define EP_EXPLODE_RESULT 61 -#define EP_WALK_TO_OBJECT 62 -#define EP_DEADLY 63 +#define EP_EXPLODE_RESULT 63 +#define EP_WALK_TO_OBJECT 64 +#define EP_DEADLY 65 -#define NUM_ELEMENT_PROPERTIES 64 +#define NUM_ELEMENT_PROPERTIES 66 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -182,17 +184,21 @@ #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_CHANGE(e) HAS_PROPERTY(e, EP_CAN_CHANGE) #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 CAN_SMASH_FRIENDS(e) HAS_PROPERTY(e, EP_CAN_SMASH_FRIENDS) +#define CAN_SMASH_ENEMIES(e) HAS_PROPERTY(e, EP_CAN_SMASH_ENEMIES) +#define CAN_SMASH_EXPLOSIVES(e) HAS_PROPERTY(e, EP_CAN_SMASH_EXPLOSIVES) +#define CAN_EXPLODE_BY_FIRE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_FIRE) +#define CAN_EXPLODE_SMASHED(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_SMASHED) +#define CAN_EXPLODE_IMPACT(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_IMPACT) #define IS_WALKABLE_OVER(e) HAS_PROPERTY(e, EP_WALKABLE_OVER) #define IS_WALKABLE_INSIDE(e) HAS_PROPERTY(e, EP_WALKABLE_INSIDE) #define IS_WALKABLE_UNDER(e) HAS_PROPERTY(e, EP_WALKABLE_UNDER) #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_CHANGEABLE(e) HAS_PROPERTY(e, EP_CHANGEABLE) #define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE) /* macros for special configurable properties */ @@ -238,7 +244,10 @@ #define IS_SOLID_FOR_PUSHING(e) HAS_PROPERTY(e, EP_SOLID_FOR_PUSHING) #define IS_DRAGONFIRE_PROOF(e) HAS_PROPERTY(e, EP_DRAGONFIRE_PROOF) #define IS_EXPLOSION_PROOF(e) HAS_PROPERTY(e, EP_EXPLOSION_PROOF) +#define CAN_SMASH(e) HAS_PROPERTY(e, EP_CAN_SMASH) +#define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE) +/* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ (e) <= EL_CUSTOM_END) @@ -1180,11 +1189,7 @@ struct ElementInfo 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 move_stepsize; /* step size element moves with */ int content[3][3]; /* new elements after explosion */