ED_GADGET_DISTANCE)
/* custom element content */
#define ED_AREA_ELEM_CONTENT4_XPOS (29 * MINI_TILEX)
-#define ED_AREA_ELEM_CONTENT4_YPOS (ED_SETTINGS_YPOS(2) + \
+#define ED_AREA_ELEM_CONTENT4_YPOS (ED_SETTINGS_YPOS(12) + \
ED_GADGET_DISTANCE - MINI_TILEY)
/* custom change trigger element */
#define ED_AREA_ELEM_CONTENT5_XPOS (30 * MINI_TILEX + MINI_TILEX / 2)
#define GADGET_ID_ELEMENT_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 24)
#define GADGET_ID_ELEMENT_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 25)
#define GADGET_ID_ELEMENT_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 26)
-#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 27)
-#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 28)
-#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 29)
-#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 30)
-#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 31)
-#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 32)
-#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 33)
-#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 34)
-#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 35)
-#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 36)
-#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 37)
-#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 38)
-#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 39)
-#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 40)
-#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 41)
-#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 42)
-#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 43)
-#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 44)
-#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 45)
-#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 46)
-#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 47)
+#define GADGET_ID_COLLECT_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 27)
+#define GADGET_ID_COLLECT_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 28)
+#define GADGET_ID_COLLECT_SCORE_UP (GADGET_ID_COUNTER_FIRST + 29)
+#define GADGET_ID_COLLECT_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 30)
+#define GADGET_ID_COLLECT_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 31)
+#define GADGET_ID_COLLECT_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 32)
+#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 33)
+#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 34)
+#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 35)
+#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 36)
+#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 37)
+#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 38)
+#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 39)
+#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 40)
+#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 41)
+#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 42)
+#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 43)
+#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 44)
+#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 45)
+#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 46)
+#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 47)
+#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 48)
+#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 49)
+#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 50)
/* drawing area identifiers */
-#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 48)
+#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 51)
#define GADGET_ID_DRAWING_LEVEL (GADGET_ID_DRAWING_AREA_FIRST + 0)
#define GADGET_ID_ELEMENT_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 1)
#define GADGET_ID_CUSTOM_MOVE_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 4)
#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_IMPACT_ACTION (GADGET_ID_SELECTBOX_FIRST + 10)
-#define GADGET_ID_CHANGE_OTHER_ACTION (GADGET_ID_SELECTBOX_FIRST + 11)
+#define GADGET_ID_CUSTOM_ACCESS_TYPE (GADGET_ID_SELECTBOX_FIRST + 7)
+#define GADGET_ID_CUSTOM_ACCESS_LAYER (GADGET_ID_SELECTBOX_FIRST + 8)
+#define GADGET_ID_CHANGE_TIME_UNITS (GADGET_ID_SELECTBOX_FIRST + 9)
+#define GADGET_ID_CHANGE_PLAYER_ACTION (GADGET_ID_SELECTBOX_FIRST + 10)
+#define GADGET_ID_CHANGE_IMPACT_ACTION (GADGET_ID_SELECTBOX_FIRST + 11)
+#define GADGET_ID_CHANGE_OTHER_ACTION (GADGET_ID_SELECTBOX_FIRST + 12)
/* textbutton identifiers */
-#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 12)
+#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 13)
#define GADGET_ID_PROPERTIES_INFO (GADGET_ID_TEXTBUTTON_FIRST + 0)
#define GADGET_ID_PROPERTIES_CONFIG (GADGET_ID_TEXTBUTTON_FIRST + 1)
#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_ACCESSIBLE (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 ED_COUNTER_ID_LEVEL_RANDOM 6
#define ED_COUNTER_ID_ELEMENT_SCORE 7
#define ED_COUNTER_ID_ELEMENT_CONTENT 8
-#define ED_COUNTER_ID_CUSTOM_SCORE 9
-#define ED_COUNTER_ID_PUSH_DELAY_FIX 10
-#define ED_COUNTER_ID_PUSH_DELAY_RND 11
-#define ED_COUNTER_ID_MOVE_DELAY_FIX 12
-#define ED_COUNTER_ID_MOVE_DELAY_RND 13
-#define ED_COUNTER_ID_CHANGE_DELAY_FIX 14
-#define ED_COUNTER_ID_CHANGE_DELAY_RND 15
+#define ED_COUNTER_ID_COLLECT_SCORE 9
+#define ED_COUNTER_ID_COLLECT_GEMCOUNT 10
+#define ED_COUNTER_ID_PUSH_DELAY_FIX 11
+#define ED_COUNTER_ID_PUSH_DELAY_RND 12
+#define ED_COUNTER_ID_MOVE_DELAY_FIX 13
+#define ED_COUNTER_ID_MOVE_DELAY_RND 14
+#define ED_COUNTER_ID_CHANGE_DELAY_FIX 15
+#define ED_COUNTER_ID_CHANGE_DELAY_RND 16
-#define ED_NUM_COUNTERBUTTONS 16
+#define ED_NUM_COUNTERBUTTONS 17
#define ED_COUNTER_ID_LEVEL_FIRST ED_COUNTER_ID_LEVEL_XSIZE
#define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM
-#define ED_COUNTER_ID_CUSTOM_FIRST ED_COUNTER_ID_CUSTOM_SCORE
+#define ED_COUNTER_ID_CUSTOM_FIRST ED_COUNTER_ID_COLLECT_SCORE
#define ED_COUNTER_ID_CUSTOM_LAST ED_COUNTER_ID_MOVE_DELAY_RND
#define ED_COUNTER_ID_CHANGE_FIRST ED_COUNTER_ID_CHANGE_DELAY_FIX
#define ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION 4
#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_IMPACT_ACTION 10
-#define ED_SELECTBOX_ID_CHANGE_OTHER_ACTION 11
+#define ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE 7
+#define ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER 8
+#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS 9
+#define ED_SELECTBOX_ID_CHANGE_PLAYER_ACTION 10
+#define ED_SELECTBOX_ID_CHANGE_IMPACT_ACTION 11
+#define ED_SELECTBOX_ID_CHANGE_OTHER_ACTION 12
-#define ED_NUM_SELECTBOX 12
+#define ED_NUM_SELECTBOX 13
#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_SELECTBOX_ID_CUSTOM_LAST ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER
#define ED_SELECTBOX_ID_CHANGE_FIRST ED_SELECTBOX_ID_CHANGE_TIME_UNITS
#define ED_SELECTBOX_ID_CHANGE_LAST ED_SELECTBOX_ID_CHANGE_OTHER_ACTION
#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_ACCESSIBLE 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_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
#define ED_CHECKBUTTON_ID_CUSTOM_FIRST ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT
-#define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM_WALKABLE
+#define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE
#define ED_CHECKBUTTON_ID_CHANGE_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC
#define ED_CHECKBUTTON_ID_CHANGE_LAST ED_CHECKBUTTON_ID_CHANGE_BY_OTHER
#define MIN_SCORE 0
#define MAX_SCORE 255
+/* values for elements with gem count */
+#define MIN_GEM_COUNT 0
+#define MAX_GEM_COUNT 100
+
/* values for random placement */
#define RANDOM_USE_PERCENTAGE 0
#define RANDOM_USE_QUANTITY 1
char *text_above, *text_left, *text_right;
} counterbutton_info[ED_NUM_COUNTERBUTTONS] =
{
+ /* ---------- level and editor settings ---------------------------------- */
+
{
DX + 5 - SX, DY + 3 - SY,
1, 100,
&random_placement_value,
"random element placement", NULL, "in"
},
+
+ /* ---------- element settings: configure (various elements) ------------- */
+
{
ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0),
MIN_SCORE, MAX_SCORE,
&level.num_yamyam_contents,
NULL, NULL, "number of content areas"
},
+
+ /* ---------- element settings: configure (custom elements) ------------- */
+
{
- ED_SETTINGS_XPOS(9), ED_SETTINGS_YPOS(4),
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3),
MIN_SCORE, MAX_SCORE,
- GADGET_ID_CUSTOM_SCORE_DOWN, GADGET_ID_CUSTOM_SCORE_UP,
- GADGET_ID_CUSTOM_SCORE_TEXT,
- &custom_element.score,
- NULL, "score", NULL
+ GADGET_ID_COLLECT_SCORE_DOWN, GADGET_ID_COLLECT_SCORE_UP,
+ GADGET_ID_COLLECT_SCORE_TEXT,
+ &custom_element.collect_score,
+ NULL, "collect score", NULL
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5),
+ ED_SETTINGS_XPOS(13) + 10, ED_SETTINGS_YPOS(3),
+ MIN_GEM_COUNT, MAX_GEM_COUNT,
+ GADGET_ID_COLLECT_GEMCOUNT_DOWN, GADGET_ID_COLLECT_GEMCOUNT_UP,
+ GADGET_ID_COLLECT_GEMCOUNT_TEXT,
+ &custom_element.collect_gem_count,
+ NULL, "gems", NULL
+ },
+ {
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4),
0, 999,
GADGET_ID_PUSH_DELAY_FIX_DOWN, GADGET_ID_PUSH_DELAY_FIX_UP,
GADGET_ID_PUSH_DELAY_FIX_TEXT,
NULL, "push delay", NULL
},
{
- ED_COUNT_PUSH_DELAY_RND_XPOS, ED_SETTINGS_YPOS(5),
+ ED_COUNT_PUSH_DELAY_RND_XPOS, ED_SETTINGS_YPOS(4),
0, 999,
GADGET_ID_PUSH_DELAY_RND_DOWN, GADGET_ID_PUSH_DELAY_RND_UP,
GADGET_ID_PUSH_DELAY_RND_TEXT,
NULL, "+random", NULL
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(8),
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(7),
0, 999,
GADGET_ID_MOVE_DELAY_FIX_DOWN, GADGET_ID_MOVE_DELAY_FIX_UP,
GADGET_ID_MOVE_DELAY_FIX_TEXT,
NULL, "move delay", NULL
},
{
- ED_COUNT_MOVE_DELAY_RND_XPOS, ED_SETTINGS_YPOS(8),
+ ED_COUNT_MOVE_DELAY_RND_XPOS, ED_SETTINGS_YPOS(7),
0, 999,
GADGET_ID_MOVE_DELAY_RND_DOWN, GADGET_ID_MOVE_DELAY_RND_UP,
GADGET_ID_MOVE_DELAY_RND_TEXT,
&custom_element.move_delay_random,
NULL, "+random", NULL
},
+
+ /* ---------- element settings: advanced (custom elements) --------------- */
+
{
ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(3),
0, 999,
};
static int value_smash_targets = 0;
-static struct ValueTextInfo options_walkable_layer[] =
+static struct ValueTextInfo options_access_type[] =
{
- { EP_WALKABLE_OVER, "over" },
- { EP_WALKABLE_INSIDE, "inside" },
- { EP_WALKABLE_UNDER, "under" },
+ { EP_WALKABLE, "walk" },
+ { EP_PASSABLE, "pass" },
{ -1, NULL }
};
-static int value_walkable_layer = 0;
+static int value_access_type = 0;
+
+static struct ValueTextInfo options_access_layer[] =
+{
+ { EP_ACCESSIBLE_OVER, "over" },
+ { EP_ACCESSIBLE_INSIDE, "inside" },
+ { EP_ACCESSIBLE_UNDER, "under" },
+ { -1, NULL }
+};
+static int value_access_layer = 0;
static struct ValueTextInfo options_time_units[] =
{
char *text_left, *text_right, *infotext;
} selectbox_info[ED_NUM_SELECTBOX] =
{
+ /* ---------- element settings: configure (custom elements) ------------- */
+
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4),
- GADGET_ID_CUSTOM_WALK_TO_ACTION,
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(1),
+ GADGET_ID_CUSTOM_ACCESS_TYPE,
-1,
- options_walk_to_action,
- &value_walk_to_action,
- NULL, NULL, "diggable/collectible/pushable"
+ options_access_type,
+ &value_access_type,
+ "player can", NULL, "type of access to this field"
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2),
- GADGET_ID_CUSTOM_CONSISTENCY,
+ ED_SETTINGS_XPOS(11), ED_SETTINGS_YPOS(1),
+ GADGET_ID_CUSTOM_ACCESS_LAYER,
-1,
- options_consistency,
- &value_consistency,
- NULL, "explodes to:", "consistency/destructibility"
+ options_access_layer,
+ &value_access_layer,
+ NULL, NULL, "layer of access for this field"
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(1),
- GADGET_ID_CUSTOM_DEADLINESS,
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2),
+ GADGET_ID_CUSTOM_WALK_TO_ACTION,
-1,
- options_deadliness,
- &value_deadliness,
- "deadly when", NULL, "deadliness of element"
+ options_walk_to_action,
+ &value_walk_to_action,
+ NULL, NULL, "diggable/collectible/pushable"
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(6),
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5),
GADGET_ID_CUSTOM_MOVE_PATTERN,
-1,
options_move_pattern,
"can move", NULL, "element move direction"
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(7),
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(6),
GADGET_ID_CUSTOM_MOVE_DIRECTION,
-1,
options_move_direction,
"starts moving", NULL, "initial element move direction"
},
{
- ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(9),
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(8),
GADGET_ID_CUSTOM_MOVE_STEPSIZE,
-1,
options_move_stepsize,
&custom_element.move_stepsize,
- "move speed", NULL, "speed of element movement"
+ "move/fall speed", NULL, "speed of element movement"
},
{
- ED_SETTINGS_XPOS(7), ED_SETTINGS_YPOS(10),
+ ED_SETTINGS_XPOS(7), ED_SETTINGS_YPOS(9),
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(11),
+ GADGET_ID_CUSTOM_DEADLINESS,
+ -1,
+ options_deadliness,
+ &value_deadliness,
+ "deadly when", NULL, "deadliness of element"
+ },
{
ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(12),
- GADGET_ID_CUSTOM_WALKABLE_LAYER,
+ GADGET_ID_CUSTOM_CONSISTENCY,
-1,
- options_walkable_layer,
- &value_walkable_layer,
- "player can walk", NULL, "layer where player can walk"
+ options_consistency,
+ &value_consistency,
+ NULL, "explodes to:", "consistency/destructibility"
},
+
+ /* ---------- element settings: advanced (custom elements) --------------- */
+
{
ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(4),
GADGET_ID_CHANGE_TIME_UNITS,
char *text_right, *infotext;
} checkbutton_info[ED_NUM_CHECKBUTTONS] =
{
+ /* ---------- level and editor settings ---------------------------------- */
+
{
ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(6) - MINI_TILEY,
GADGET_ID_DOUBLE_SPEED,
&random_placement_background_restricted,
"restrict random placement to", "set random placement restriction"
},
+
+ /* ---------- element settings: configure (various elements) ------------- */
+
{
ED_SETTINGS_XPOS(0), 0, /* set at runtime */
GADGET_ID_STICK_ELEMENT,
&level.em_slippery_gems,
"slip down from certain flat walls","use EM style slipping behaviour"
},
+
+ /* ---------- element settings: configure (custom elements) ------------- */
+
{
- 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(1),
+ GADGET_ID_CUSTOM_ACCESSIBLE,
+ &custom_element_properties[EP_ACCESSIBLE],
+ NULL, "player can walk to or pass this field"
},
{
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(4),
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2),
GADGET_ID_CUSTOM_WALK_TO_OBJECT,
&custom_element_properties[EP_WALK_TO_OBJECT],
NULL, "player can dig/collect/push element"
},
{
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1),
- GADGET_ID_CUSTOM_DEADLY,
- &custom_element_properties[EP_DEADLY],
- NULL, "element can kill the player"
- },
- {
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(6),
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(5),
GADGET_ID_CUSTOM_CAN_MOVE,
&custom_element_properties[EP_CAN_MOVE],
NULL, "element can move in some direction"
},
{
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10),
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(9),
GADGET_ID_CUSTOM_CAN_FALL,
&custom_element_properties[EP_CAN_FALL],
"can fall", "element can fall down"
},
{
- ED_SETTINGS_XPOS(6), ED_SETTINGS_YPOS(10),
+ ED_SETTINGS_XPOS(6), ED_SETTINGS_YPOS(9),
GADGET_ID_CUSTOM_CAN_SMASH,
&custom_element_properties[EP_CAN_SMASH],
NULL, "element can smash other elements"
},
{
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(11),
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10),
GADGET_ID_CUSTOM_SLIPPERY,
&custom_element_properties[EP_SLIPPERY],
"slippery", "other elements can fall down from it"
},
+ {
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(11),
+ GADGET_ID_CUSTOM_DEADLY,
+ &custom_element_properties[EP_DEADLY],
+ NULL, "element can kill the player"
+ },
{
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"
+ GADGET_ID_CUSTOM_EXPLODE_RESULT,
+ &custom_element_properties[EP_EXPLODE_RESULT],
+ NULL, "set consistency/destructibility"
+ },
+ {
+ ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(13),
+ 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(13),
+ 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(13),
+ GADGET_ID_CUSTOM_EXPLODE_IMPACT,
+ &custom_element_properties[EP_CAN_EXPLODE_IMPACT],
+ "impact", "element can explode on impact"
},
+
+ /* ---------- element settings: advanced (custom elements) --------------- */
+
{
ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1),
GADGET_ID_CUSTOM_USE_GRAPHIC,
&custom_element.use_gfx_element,
"use graphic of element:", "use graphic for custom element"
},
- {
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(12),
- GADGET_ID_CUSTOM_USE_TEMPLATE,
- &custom_element.use_template,
- "use template", "use template for custom properties"
- },
{
ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2),
GADGET_ID_CUSTOM_CAN_CHANGE,
&custom_element_change_events[CE_BY_OTHER],
NULL, "element changes by other element"
},
+ {
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(12),
+ GADGET_ID_CUSTOM_USE_TEMPLATE,
+ &custom_element.use_template,
+ "use template", "use template for custom properties"
+ },
};
CAN_SMASH_ENEMIES(element) ||
CAN_SMASH_PLAYER(element));
- /* set walkable layer selectbox help value */
- value_walkable_layer =
- (IS_WALKABLE_OVER(element) ? EP_WALKABLE_OVER :
- IS_WALKABLE_INSIDE(element) ? EP_WALKABLE_INSIDE :
- IS_WALKABLE_UNDER(element) ? EP_WALKABLE_UNDER :
- EP_WALKABLE_OVER);
- custom_element_properties[EP_WALKABLE] =
- (IS_WALKABLE_OVER(element) ||
- IS_WALKABLE_INSIDE(element) ||
- IS_WALKABLE_UNDER(element));
+ /* set accessible layer selectbox help value */
+ value_access_type =
+ (IS_WALKABLE(element) ? EP_WALKABLE :
+ IS_PASSABLE(element) ? EP_PASSABLE :
+ EP_WALKABLE);
+ value_access_layer =
+ (IS_ACCESSIBLE_OVER(element) ? EP_ACCESSIBLE_OVER :
+ IS_ACCESSIBLE_INSIDE(element) ? EP_ACCESSIBLE_INSIDE :
+ IS_ACCESSIBLE_UNDER(element) ? EP_ACCESSIBLE_UNDER :
+ EP_ACCESSIBLE_OVER);
+ custom_element_properties[EP_ACCESSIBLE] =
+ (IS_ACCESSIBLE_OVER(element) ||
+ IS_ACCESSIBLE_INSIDE(element) ||
+ IS_ACCESSIBLE_UNDER(element));
/* set change by player selectbox help value */
value_change_player_action =
custom_element_properties[value_smash_targets] =
custom_element_properties[EP_CAN_SMASH];
- /* set walkable property from checkbox and selectbox */
+ /* set accessible 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[value_walkable_layer] =
- custom_element_properties[EP_WALKABLE];
+ custom_element_properties[EP_PASSABLE_OVER] = FALSE;
+ custom_element_properties[EP_PASSABLE_INSIDE] = FALSE;
+ custom_element_properties[EP_PASSABLE_UNDER] = FALSE;
+ custom_element_properties[((value_access_type == EP_WALKABLE ?
+ EP_WALKABLE_OVER : EP_PASSABLE_OVER) +
+ (value_access_layer - EP_ACCESSIBLE_OVER))] =
+ custom_element_properties[EP_ACCESSIBLE];
/* set player change event from checkbox and selectbox */
custom_element_change_events[CE_TOUCHED_BY_PLAYER] = FALSE;
(draw_level || drawing_function == GADGET_ID_PICK_ELEMENT ?
drawing_function : GADGET_ID_SINGLE_ITEMS);
+ /* clicking into drawing area with pressed Control key picks element */
+ if (GetKeyModState() & KMOD_Control)
+ actual_drawing_function = GADGET_ID_PICK_ELEMENT;
+
switch (actual_drawing_function)
{
case GADGET_ID_SINGLE_ITEMS:
if (id < ED_NUM_CTRL1_BUTTONS && id != GADGET_ID_PROPERTIES &&
id != GADGET_ID_PICK_ELEMENT && edit_mode != ED_MODE_DRAWING &&
- drawing_function != GADGET_ID_PICK_ELEMENT)
+ drawing_function != GADGET_ID_PICK_ELEMENT &&
+ !(GetKeyModState() & KMOD_Control))
{
DrawDrawingWindow();
edit_mode = ED_MODE_DRAWING;
PickDrawingElement(button, new_element);
if (!stick_element_properties_window &&
- drawing_function != GADGET_ID_PICK_ELEMENT)
+ drawing_function != GADGET_ID_PICK_ELEMENT &&
+ !(GetKeyModState() & KMOD_Control))
{
properties_element = new_element;
if (edit_mode == ED_MODE_PROPERTIES)
{
if (gi->custom_id == GADGET_ID_SINGLE_ITEMS) /* special case 1 */
sprintf(shortcut, " ('.' or '%c')", key);
- else if (gi->custom_id == GADGET_ID_TEST) /* special case 2 */
+ else if (gi->custom_id == GADGET_ID_PICK_ELEMENT) /* special case 2 */
+ sprintf(shortcut, " ('%c' or 'Ctrl')", key);
+ else if (gi->custom_id == GADGET_ID_TEST) /* special case 3 */
sprintf(shortcut, " ('Enter' or 'Shift-%c')", key);
else /* normal case */
sprintf(shortcut, " ('%s%c')",
int min_sx = 0, min_sy = 0;
int max_sx = gi->drawing.area_xsize - 1;
int max_sy = gi->drawing.area_ysize - 1;
+ int actual_drawing_function = drawing_function;
+
+ /* pressed Control key: simulate picking element */
+ if (GetKeyModState() & KMOD_Control)
+ actual_drawing_function = GADGET_ID_PICK_ELEMENT;
ClearEditorGadgetInfoText();
start_ly = ly;
}
- switch (drawing_function)
+ switch (actual_drawing_function)
{
case GADGET_ID_SINGLE_ITEMS:
infotext = "Drawing single items";
break;
}
- if (drawing_function == GADGET_ID_PICK_ELEMENT)
+ if (actual_drawing_function == GADGET_ID_PICK_ELEMENT)
DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_TEXT_2,
"%s: %d, %d", infotext, lx, ly);
else
"%s: %d, %d", infotext,
ABS(lx - start_lx) + 1, ABS(ly - start_ly) + 1);
}
- else if (drawing_function == GADGET_ID_PICK_ELEMENT)
+ else if (actual_drawing_function == GADGET_ID_PICK_ELEMENT)
DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_TEXT_2,
"%s", getElementInfoText(Feld[lx][ly]));
else
DeleteBrushFromCursor();
}
}
- else if (drawing_function == GADGET_ID_PICK_ELEMENT)
+ else if (actual_drawing_function == GADGET_ID_PICK_ELEMENT)
{
if (id == GADGET_ID_AMOEBA_CONTENT)
DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_TEXT_2,
int element;
int gem_count;
}
-gem_count_list[] =
+collect_gem_count_list[] =
{
{ EL_EMERALD, 1 },
{ EL_BD_DIAMOND, 1 },
static struct ChangingElementInfo changing_element[MAX_NUM_ELEMENTS];
static unsigned long trigger_events[MAX_NUM_ELEMENTS];
-static int gem_count[MAX_NUM_ELEMENTS];
#define IS_AUTO_CHANGING(e) (changing_element[e].base_element != EL_UNDEFINED)
#define IS_JUST_CHANGING(x, y) (ChangeDelay[x][y] != 0)
/* initialize gem count values for each element */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
- gem_count[i] = 0;
+ if (!IS_CUSTOM_ELEMENT(i))
+ element_info[i].collect_gem_count = 0;
/* add gem count values for all elements from pre-defined list */
- for (i=0; gem_count_list[i].element != EL_UNDEFINED; i++)
- gem_count[gem_count_list[i].element] = gem_count_list[i].gem_count;
+ for (i=0; collect_gem_count_list[i].element != EL_UNDEFINED; i++)
+ element_info[collect_gem_count_list[i].element].collect_gem_count =
+ collect_gem_count_list[i].gem_count;
}
}
/*
+ =============================================================================
checkDiagonalPushing()
-----------------------------------------------------------------------------
check if diagonal input device direction results in pushing of object
(by checking if the alternative direction is walkable, diggable, ...)
+ =============================================================================
*/
static boolean checkDiagonalPushing(struct PlayerInfo *player,
}
/*
+ =============================================================================
DigField()
-----------------------------------------------------------------------------
x, y: field next to player (non-diagonal) to try to dig to
real_dx, real_dy: direction as read from input device (can be diagonal)
+ =============================================================================
*/
int DigField(struct PlayerInfo *player,
element = Feld[x][y];
-#if 1
if (mode == DF_SNAP && !IS_SNAPPABLE(element) &&
game.engine_version >= VERSION_IDENT(2,2,0))
return MF_NO_ACTION;
-#endif
switch (element)
{
-#if 0
- case EL_EMPTY:
- PlaySoundLevelElementAction(x, y, player->element_nr, ACTION_MOVING);
- break;
-#endif
-
-#if 0
- case EL_SAND:
- case EL_INVISIBLE_SAND:
- case EL_INVISIBLE_SAND_ACTIVE:
- case EL_TRAP:
- case EL_SP_BASE:
- case EL_SP_BUGGY_BASE:
- case EL_SP_BUGGY_BASE_ACTIVATING:
- RemoveField(x, y);
-
- if (mode != DF_SNAP && element != EL_EMPTY)
- {
- GfxElement[x][y] = (CAN_BE_CRUMBLED(element) ? EL_SAND : element);
- player->is_digging = TRUE;
- }
-
- PlaySoundLevelElementAction(x, y, element, ACTION_DIGGING);
- break;
-#endif
-
-#if 0
-
- case EL_EMERALD:
- case EL_BD_DIAMOND:
- case EL_EMERALD_YELLOW:
- case EL_EMERALD_RED:
- case EL_EMERALD_PURPLE:
- case EL_DIAMOND:
- case EL_SP_INFOTRON:
- case EL_PEARL:
- case EL_CRYSTAL:
- RemoveField(x, y);
-
- if (mode != DF_SNAP)
- {
- GfxElement[x][y] = element;
- player->is_collecting = TRUE;
- }
-
- local_player->gems_still_needed -= (element == EL_DIAMOND ? 3 :
- element == EL_PEARL ? 5 :
- element == EL_CRYSTAL ? 8 : 1);
- if (local_player->gems_still_needed < 0)
- local_player->gems_still_needed = 0;
- RaiseScoreElement(element);
- DrawText(DX_EMERALDS, DY_EMERALDS,
- int2str(local_player->gems_still_needed, 3), FONT_TEXT_2);
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
-#endif
-
-#if 0
-
- case EL_SPEED_PILL:
- RemoveField(x, y);
- player->move_delay_value = MOVE_DELAY_HIGH_SPEED;
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_SPEED_PILL_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
-#endif
-
-
-#if 0
- case EL_ENVELOPE:
- Feld[x][y] = EL_EMPTY;
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_ENVELOPE_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-#endif
-
-#if 0
-
- case EL_EXTRA_TIME:
- RemoveField(x, y);
- if (level.time > 0)
- {
- TimeLeft += 10;
- DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2);
- }
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundStereo(SND_EXTRA_TIME_COLLECTING, SOUND_MIDDLE);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
-#endif
-
-#if 0
- case EL_SHIELD_NORMAL:
- RemoveField(x, y);
- player->shield_normal_time_left += 10;
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_SHIELD_NORMAL_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_SHIELD_DEADLY:
- RemoveField(x, y);
- player->shield_normal_time_left += 10;
- player->shield_deadly_time_left += 10;
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_SHIELD_DEADLY_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-#endif
-
-#if 0
- case EL_DYNAMITE:
- case EL_SP_DISK_RED:
- RemoveField(x, y);
- player->dynamite++;
- player->use_disk_red_graphic = (element == EL_SP_DISK_RED);
- RaiseScoreElement(EL_DYNAMITE);
- DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(local_player->dynamite, 3),
- FONT_TEXT_2);
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-#endif
-
-#if 0
- case EL_DYNABOMB_INCREASE_NUMBER:
- RemoveField(x, y);
- player->dynabomb_count++;
- player->dynabombs_left++;
- RaiseScoreElement(EL_DYNAMITE);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_NUMBER_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_DYNABOMB_INCREASE_SIZE:
- RemoveField(x, y);
- player->dynabomb_size++;
- RaiseScoreElement(EL_DYNAMITE);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_SIZE_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-
- case EL_DYNABOMB_INCREASE_POWER:
- RemoveField(x, y);
- player->dynabomb_xl = TRUE;
- RaiseScoreElement(EL_DYNAMITE);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_POWER_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
-#endif
-
-#if 0
- case EL_KEY_1:
- case EL_KEY_2:
- case EL_KEY_3:
- case EL_KEY_4:
- {
- int key_nr = element - EL_KEY_1;
- int graphic = el2edimg(element);
-
- RemoveField(x, y);
- player->key[key_nr] = TRUE;
- RaiseScoreElement(element);
- DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
- DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_CLASS_KEY_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
- }
-
- case EL_EM_KEY_1:
- case EL_EM_KEY_2:
- case EL_EM_KEY_3:
- case EL_EM_KEY_4:
- {
- int key_nr = element - EL_EM_KEY_1;
- int graphic = el2edimg(EL_KEY_1 + key_nr);
-
- RemoveField(x, y);
- player->key[key_nr] = TRUE;
- RaiseScoreElement(element);
- DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
- DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- graphic);
-#if 1
- PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
-#else
- PlaySoundLevel(x, y, SND_CLASS_KEY_COLLECTING);
-#endif
- CheckTriggeredElementChange(element, CE_OTHER_COLLECTING);
- break;
- }
-#endif
-
case EL_ROBOT_WHEEL:
Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
ZX = x;
return MF_ACTION;
break;
-#if 0
-
- /* the following elements cannot be pushed by "snapping" */
- case EL_ROCK:
- case EL_BOMB:
- case EL_DX_SUPABOMB:
- case EL_NUT:
- case EL_TIME_ORB_EMPTY:
- case EL_SP_ZONK:
- case EL_SP_DISK_ORANGE:
- case EL_SPRING:
- if (mode == DF_SNAP)
- return MF_NO_ACTION;
-
- /* no "break" -- fall through to next case */
-
- /* the following elements can be pushed by "snapping" */
- case EL_BD_ROCK:
- if (dy)
- return MF_NO_ACTION;
-
- if (CAN_FALL(element) && IN_LEV_FIELD(x, y + 1) && IS_FREE(x, y + 1) &&
- !(element == EL_SPRING && use_spring_bug))
- return MF_NO_ACTION;
-
- player->Pushing = TRUE;
-
-#if 0
- if (element == EL_ROCK)
- printf("::: wanna push [%d] [%d]\n",
- FrameCounter, player->push_delay_value);
-#endif
-
- if (!IN_LEV_FIELD(x+dx, y+dy) || !IS_FREE(x+dx, y+dy))
- return MF_NO_ACTION;
-
- if (!checkDiagonalPushing(player, x, y, real_dx, real_dy))
- return MF_NO_ACTION;
-
-
- if (player->push_delay == 0)
- player->push_delay = FrameCounter;
-
-#if 0
- printf("want push... %d [%d]\n", FrameCounter, player->push_delay_value);
-#endif
-
-#if 0
- if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !tape.playing &&
- element != EL_SPRING)
- return MF_NO_ACTION;
-#else
- if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !(tape.playing && tape.file_version < FILE_VERSION_2_0) &&
- element != EL_SPRING)
- return MF_NO_ACTION;
-#endif
-
- if (mode == DF_SNAP)
- {
- InitMovingField(x, y, move_direction);
- ContinueMoving(x, y);
- }
- else
- {
-#if 1
- InitMovingField(x, y, (dx < 0 ? MV_LEFT :
- dx > 0 ? MV_RIGHT :
- dy < 0 ? MV_UP : MV_DOWN));
- MovPos[x][y] = (dx != 0 ? dx : dy);
-#else
- RemoveField(x, y);
- Feld[x + dx][y + dy] = element;
-#endif
- }
-
-#if 0
- printf("pushing %d/%d ... %d [%d]\n", dx, dy,
- FrameCounter, player->push_delay_value);
-#endif
-
-#if 0
- if (element == EL_SPRING)
- {
- Feld[x + dx][y + dy] = EL_SPRING;
- MovDir[x + dx][y + dy] = move_direction;
- }
-#endif
-
- player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8));
-
- DrawLevelField(x + dx, y + dy);
- PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
-
- CheckTriggeredElementChange(element, CE_OTHER_PUSHING);
-
- break;
-
-#endif
-
-#if 0
- case EL_GATE_1:
- case EL_GATE_2:
- case EL_GATE_3:
- case EL_GATE_4:
- if (!player->key[element - EL_GATE_1])
- return MF_NO_ACTION;
- break;
-
- case EL_GATE_1_GRAY:
- case EL_GATE_2_GRAY:
- case EL_GATE_3_GRAY:
- case EL_GATE_4_GRAY:
- if (!player->key[element - EL_GATE_1_GRAY])
- return MF_NO_ACTION;
- break;
-
- case EL_EM_GATE_1:
- case EL_EM_GATE_2:
- case EL_EM_GATE_3:
- case EL_EM_GATE_4:
- if (!player->key[element - EL_EM_GATE_1])
- return MF_NO_ACTION;
- if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
- return MF_NO_ACTION;
-
- /* automatically move to the next field with double speed */
- player->programmed_action = move_direction;
- DOUBLE_PLAYER_SPEED(player);
-
- PlaySoundLevel(x, y, SND_CLASS_GATE_PASSING);
- break;
-
- case EL_EM_GATE_1_GRAY:
- case EL_EM_GATE_2_GRAY:
- case EL_EM_GATE_3_GRAY:
- case EL_EM_GATE_4_GRAY:
- if (!player->key[element - EL_EM_GATE_1_GRAY])
- return MF_NO_ACTION;
- if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
- return MF_NO_ACTION;
-
- /* automatically move to the next field with double speed */
- player->programmed_action = move_direction;
- DOUBLE_PLAYER_SPEED(player);
-
-#if 1
- PlaySoundLevelAction(x, y, ACTION_PASSING);
-#else
- PlaySoundLevel(x, y, SND_GATE_PASSING);
-#endif
- break;
-#endif
-
-#if 0
- case EL_SWITCHGATE_OPEN:
- case EL_TIMEGATE_OPEN:
- if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
- return MF_NO_ACTION;
-
- /* automatically move to the next field with double speed */
- player->programmed_action = move_direction;
- DOUBLE_PLAYER_SPEED(player);
-
- PlaySoundLevelElementAction(x, y, element, ACTION_PASSING);
- break;
-#endif
-
case EL_SP_PORT_LEFT:
case EL_SP_PORT_RIGHT:
case EL_SP_PORT_UP:
}
break;
-#if 0
- case EL_EXIT_CLOSED:
- case EL_SP_EXIT_CLOSED:
- case EL_EXIT_OPENING:
- return MF_NO_ACTION;
- break;
-#endif
-
-#if 0
- case EL_EXIT_OPEN:
- case EL_SP_EXIT_OPEN:
- if (mode == DF_SNAP)
- return MF_NO_ACTION;
-
- if (element == EL_EXIT_OPEN)
- PlaySoundLevel(x, y, SND_CLASS_EXIT_PASSING);
- else
- PlaySoundLevel(x, y, SND_CLASS_SP_EXIT_PASSING);
-
- break;
-#endif
-
case EL_LAMP:
Feld[x][y] = EL_LAMP_ACTIVE;
local_player->lights_still_needed--;
return MF_ACTION;
break;
-#if 0
-
-#if 0
- case EL_SOKOBAN_FIELD_EMPTY:
- break;
-#endif
-
- case EL_SOKOBAN_OBJECT:
- case EL_SOKOBAN_FIELD_FULL:
- case EL_SATELLITE:
- case EL_SP_DISK_YELLOW:
- case EL_BALLOON:
- if (mode == DF_SNAP)
- return MF_NO_ACTION;
-
- player->Pushing = TRUE;
-
- if (!IN_LEV_FIELD(x+dx, y+dy)
- || (!IS_FREE(x+dx, y+dy)
- && (Feld[x+dx][y+dy] != EL_SOKOBAN_FIELD_EMPTY
- || !IS_SB_ELEMENT(element))))
- return MF_NO_ACTION;
-
- if (!checkDiagonalPushing(player, x, y, real_dx, real_dy))
- return MF_NO_ACTION;
-
- if (player->push_delay == 0)
- player->push_delay = FrameCounter;
-#if 0
- if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !tape.playing && element != EL_BALLOON)
- return MF_NO_ACTION;
-#else
- if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !(tape.playing && tape.file_version < FILE_VERSION_2_0) &&
- element != EL_BALLOON)
- return MF_NO_ACTION;
-#endif
-
- if (IS_SB_ELEMENT(element))
- {
-#if 1
- if (element == EL_SOKOBAN_FIELD_FULL)
- {
- Back[x][y] = EL_SOKOBAN_FIELD_EMPTY;
- local_player->sokobanfields_still_needed++;
- }
-
- if (Feld[x + dx][y + dy] == EL_SOKOBAN_FIELD_EMPTY)
- {
- Back[x + dx][y + dy] = EL_SOKOBAN_FIELD_EMPTY;
- local_player->sokobanfields_still_needed--;
- }
-
- Feld[x][y] = EL_SOKOBAN_OBJECT;
-
- if (Back[x][y] == Back[x + dx][y + dy])
- PlaySoundLevelAction(x, y, ACTION_PUSHING);
- else if (Back[x][y] != 0)
- PlaySoundLevelElementAction(x, y, EL_SOKOBAN_FIELD_FULL,
- ACTION_EMPTYING);
- else
- PlaySoundLevelElementAction(x + dx, y + dy, EL_SOKOBAN_FIELD_EMPTY,
- ACTION_FILLING);
-
- InitMovingField(x, y, (dx < 0 ? MV_LEFT :
- dx > 0 ? MV_RIGHT :
- dy < 0 ? MV_UP : MV_DOWN));
- MovPos[x][y] = (dx != 0 ? dx : dy);
-
-#if 0
- printf("::: %s -> %s [%s -> %s]\n",
- element_info[Feld[x][y]].token_name,
- element_info[Feld[x + dx][y + dy]].token_name,
- element_info[Back[x][y]].token_name,
- element_info[Back[x + dx][y + dy]].token_name);
-#endif
-
-#else
- if (element == EL_SOKOBAN_FIELD_FULL)
- {
- Feld[x][y] = EL_SOKOBAN_FIELD_EMPTY;
- local_player->sokobanfields_still_needed++;
- }
- else
- RemoveField(x, y);
-
- if (Feld[x+dx][y+dy] == EL_SOKOBAN_FIELD_EMPTY)
- {
- Feld[x+dx][y+dy] = EL_SOKOBAN_FIELD_FULL;
- local_player->sokobanfields_still_needed--;
- if (element == EL_SOKOBAN_OBJECT)
-#if 1
- PlaySoundLevelAction(x+dx, y+dy, ACTION_FILLING);
-#else
- PlaySoundLevel(x, y, SND_CLASS_SOKOBAN_FIELD_FILLING);
-#endif
- else
-#if 1
- PlaySoundLevelAction(x+dx, y+dy, ACTION_PUSHING);
-#else
- PlaySoundLevel(x, y, SND_SOKOBAN_OBJECT_PUSHING);
-#endif
- }
- else
- {
- Feld[x+dx][y+dy] = EL_SOKOBAN_OBJECT;
- if (element == EL_SOKOBAN_FIELD_FULL)
-#if 1
- PlaySoundLevelAction(x+dx, y+dy, ACTION_EMPTYING);
-#else
- PlaySoundLevel(x, y, SND_SOKOBAN_FIELD_EMPTYING);
-#endif
- else
-#if 1
- PlaySoundLevelAction(x+dx, y+dy, ACTION_PUSHING);
-#else
- PlaySoundLevel(x, y, SND_SOKOBAN_OBJECT_PUSHING);
-#endif
- }
-#endif
- }
- else
- {
-#if 1
- InitMovingField(x, y, (dx < 0 ? MV_LEFT :
- dx > 0 ? MV_RIGHT :
- dy < 0 ? MV_UP : MV_DOWN));
- MovPos[x][y] = (dx != 0 ? dx : dy);
-#else
- RemoveField(x, y);
- Feld[x + dx][y + dy] = element;
-#endif
- PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
- }
-
- player->push_delay_value = (element == EL_BALLOON ? 0 : 2);
-
- DrawLevelField(x, y);
- DrawLevelField(x + dx, y + dy);
-
- if (IS_SB_ELEMENT(element) &&
- local_player->sokobanfields_still_needed == 0 &&
- game.emulation == EMU_SOKOBAN)
- {
- player->LevelSolved = player->GameOver = TRUE;
- PlaySoundLevel(x, y, SND_GAME_SOKOBAN_SOLVING);
- }
-
- CheckTriggeredElementChange(element, CE_OTHER_PUSHING);
-
- break;
-
-#endif
-
-#if 0
- case EL_PENGUIN:
- case EL_PIG:
- case EL_DRAGON:
- break;
-#endif
-
default:
if (IS_WALKABLE(element))
el2edimg(EL_KEY_1 + key_nr));
redraw_mask |= REDRAW_DOOR_1;
}
- else if (gem_count[element] > 0)
+ else if (element_info[element].collect_gem_count > 0)
{
- local_player->gems_still_needed -= gem_count[element];
+ local_player->gems_still_needed -=
+ element_info[element].collect_gem_count;
if (local_player->gems_still_needed < 0)
local_player->gems_still_needed = 0;
RaiseScore(level.score[SC_KEY]);
break;
default:
- RaiseScore(element_info[element].score);
+ RaiseScore(element_info[element].collect_score);
break;
}
}