#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)
#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)
#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)
#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)
#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
#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
{ 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[] =
{
{ MV_ALONG_RIGHT_SIDE, "along right side" },
{ -1, NULL }
};
-static int index_move_pattern = 0;
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[] =
{
{ 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[] =
{
{ EP_WALKABLE_UNDER, "under" },
{ -1, NULL }
};
-static int index_walkable_layer = 0;
+static int value_walkable_layer = 0;
static struct ValueTextInfo options_time_units[] =
{
{ 1, "frames" },
{ -1, NULL }
};
-static int index_time_units = 0;
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[] =
{
{ 5, "pressed by player" },
{ -1, NULL }
};
-static int index_change_cause = 0, value_change_cause = 0;
+static int value_change_cause = 0;
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] =
{
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"
},
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"
},
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"
},
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"
},
"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,
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"
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"
},
{
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"
},
{
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++)
{
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';
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,
{
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;
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 :
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 :
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 :
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 */
{ 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" },
{
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;
-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,
-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
};
-1
};
- static int ep_can_smash[] =
+ static int ep_can_smash_friends[] =
{
EL_ROCK,
EL_BD_ROCK,
-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,
-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,
{
{ 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 },
{ 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 },
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
};
!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