#define ED_SETTINGS_YOFFSET (3 * MINI_TILEY / 2)
#define ED_SETTINGS_XPOS(n) (ED_SETTINGS_XSTART + \
- n * ED_SETTINGS_XOFFSET)
+ (n) * ED_SETTINGS_XOFFSET)
#define ED_SETTINGS_YPOS(n) (ED_SETTINGS_YSTART + \
- n * ED_SETTINGS_YOFFSET)
+ (n) * ED_SETTINGS_YOFFSET)
#define ED_SETTINGS1_YPOS MINI_TILEY
#define ED_SETTINGS2_XPOS MINI_TILEX
#define ED_COUNTER_YSTART (ED_SETTINGS1_YPOS + 2 * TILEY)
#define ED_COUNTER_YDISTANCE (3 * MINI_TILEY)
#define ED_COUNTER_YPOS(n) (ED_COUNTER_YSTART + \
- n * ED_COUNTER_YDISTANCE)
+ (n) * ED_COUNTER_YDISTANCE)
#define ED_COUNTER2_YPOS(n) (ED_COUNTER_YSTART + \
- n * ED_COUNTER_YDISTANCE - 2)
+ (n) * ED_COUNTER_YDISTANCE - 2)
/* values for element content drawing areas */
/* amoeba content */
/* yamyam content */
#define ED_AREA_YAMYAM_CONTENT_XPOS(n) (2 * MINI_TILEX + \
- 5 * (n % 4) * MINI_TILEX)
-#define ED_AREA_YAMYAM_CONTENT_YPOS(n) (22 * MINI_TILEY + \
- 6 * (n / 4) * MINI_TILEY)
+ 5 * ((n) % 4) * MINI_TILEX)
+#define ED_AREA_YAMYAM_CONTENT_YPOS(n) (17 * MINI_TILEY + \
+ 6 * ((n) / 4) * MINI_TILEY)
/* custom change target */
#define ED_AREA_ELEM_CONTENT2_YPOS (ED_SETTINGS_YPOS(1) + \
#define GADGET_ID_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 4)
#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 5)
#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 6)
-#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 7)
-#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 8)
-#define GADGET_ID_CUSTOM_EXPLODE_RESULT (GADGET_ID_CHECKBUTTON_FIRST + 9)
-#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 10)
-#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 11)
-#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 12)
-#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 13)
-#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 14)
-#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 15)
-#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 16)
-#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 17)
-#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 18)
-#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 19)
-#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 20)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 21)
-#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 22)
-#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 23)
-#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 24)
-#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 25)
-#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 26)
-#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 27)
-#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 28)
-#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 29)
+#define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 7)
+#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 8)
+#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 9)
+#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 10)
+#define GADGET_ID_CUSTOM_EXPLODE_RESULT (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 13)
+#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 14)
+#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 15)
+#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 16)
+#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 17)
+#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 18)
+#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 19)
+#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 20)
+#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 21)
+#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 22)
+#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 23)
+#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 24)
+#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 25)
+#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 26)
+#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 27)
+#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 28)
+#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 29)
+#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 30)
+#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 31)
/* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 30)
+#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 32)
#define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \
ED_NUM_ELEMENTLIST_BUTTONS - 1)
#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 2
#define ED_CHECKBUTTON_ID_STICK_ELEMENT 3
#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 4
-#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 5
-#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 6
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 7
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 8
-#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 9
-#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 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_DEADLY 15
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT 16
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 17
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 18
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 19
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 20
-#define ED_CHECKBUTTON_ID_CHANGE_DELAY 21
-#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 22
-#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 23
-#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 24
-#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 25
-#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 26
-#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 27
-
-#define ED_NUM_CHECKBUTTONS 28
+#define ED_CHECKBUTTON_ID_USE_SPRING_BUG 5
+#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 6
+#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 7
+#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 8
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 9
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 10
+#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 11
+#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 12
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 13
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 14
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 15
+#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 16
+#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 17
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT 18
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 19
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 20
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 21
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 22
+#define ED_CHECKBUTTON_ID_CHANGE_DELAY 23
+#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 24
+#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 25
+#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 26
+#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 27
+#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 28
+#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 29
+
+#define ED_NUM_CHECKBUTTONS 30
#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED
#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
NULL, NULL, NULL
},
{
- ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(6),
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(3),
MIN_ELEMENT_CONTENTS, MAX_ELEMENT_CONTENTS,
GADGET_ID_ELEMENT_CONTENT_DOWN, GADGET_ID_ELEMENT_CONTENT_UP,
GADGET_ID_ELEMENT_CONTENT_TEXT, GADGET_ID_NONE,
NULL,
"slip down from certain flat walls","use EM style slipping behaviour"
},
+ {
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0),
+ GADGET_ID_USE_SPRING_BUG, GADGET_ID_NONE,
+ &level.use_spring_bug,
+ NULL,
+ "use spring pushing bug", "use odd spring pushing behaviour"
+ },
{
ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0),
GADGET_ID_BLOCK_LAST_FIELD, GADGET_ID_NONE,
"block last field when moving", "player blocks last field when moving"
},
{
- ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(4),
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0),
GADGET_ID_SP_BLOCK_LAST_FIELD, GADGET_ID_NONE,
&level.sp_block_last_field,
NULL,
"block last field when moving", "player blocks last field when moving"
},
+ {
+ ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0),
+ GADGET_ID_CAN_MOVE_INTO_ACID, GADGET_ID_NONE,
+ &custom_element_properties[EP_CAN_MOVE_INTO_ACID],
+ NULL,
+ "can move into acid", "element can move into acid pool"
+ },
/* ---------- element settings: configure 1 (custom elements) ----------- */
static void DrawLevelInfoWindow();
static void DrawPropertiesWindow();
static void UpdateCustomElementGraphicGadgets();
-static boolean checkPropertiesConfig();
+static boolean checkPropertiesConfig(int);
static void CopyLevelToUndoBuffer(int);
static void HandleDrawingAreas(struct GadgetInfo *);
static void HandleCounterButtons(struct GadgetInfo *);
int x_right = gi->x + gi->width + xoffset_right;
int y = gi->y + yoffset;
- /* special case needed for "sticky" gadget */
- ModifyGadget(gi, GDI_CHECKED, *checkbutton_info[id].value,
- GDI_Y, SY + checkbutton_info[id].y, GDI_END);
- y = gi->y + yoffset;
+ /* special case needed for "stickybutton" and "can move into acid" gadgets */
+ if (id == ED_CHECKBUTTON_ID_STICK_ELEMENT ||
+ id == ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID)
+ {
+ ModifyGadget(gi, GDI_CHECKED, *checkbutton_info[id].value,
+ GDI_Y, SY + checkbutton_info[id].y, GDI_END);
+ y = gi->y + yoffset;
+ }
if (checkbutton_info[id].text_left)
DrawText(x_left, y, checkbutton_info[id].text_left, FONT_TEXT_1);
custom_element = element_info[element]; /* needed for description */
}
+static void CopyClassicElementPropertiesToEditor(int element)
+{
+ if (COULD_MOVE_INTO_ACID(element))
+ {
+ int bit_nr = get_special_property_bit(element, EP_CAN_MOVE_INTO_ACID);
+
+ if (bit_nr > -1)
+ custom_element_properties[EP_CAN_MOVE_INTO_ACID] =
+ ((level.can_move_into_acid & (1 << bit_nr)) != 0);
+ }
+}
+
static void CopyElementPropertiesToEditor(int element)
{
if (IS_CUSTOM_ELEMENT(element))
CopyCustomElementPropertiesToEditor(element);
else if (IS_GROUP_ELEMENT(element))
CopyGroupElementPropertiesToEditor(element);
+ else
+ CopyClassicElementPropertiesToEditor(element);
}
static void CopyCustomElementPropertiesToGame(int element)
element_info[element].modified_settings = TRUE;
}
+static void CopyClassicElementPropertiesToGame(int element)
+{
+ if (COULD_MOVE_INTO_ACID(element))
+ {
+ int bit_nr = get_special_property_bit(element, EP_CAN_MOVE_INTO_ACID);
+
+ if (bit_nr > -1)
+ {
+ level.can_move_into_acid &= ~(1 << bit_nr);
+
+ if (custom_element_properties[EP_CAN_MOVE_INTO_ACID])
+ level.can_move_into_acid |= (1 << bit_nr);
+ }
+ }
+}
+
static void CopyElementPropertiesToGame(int element)
{
if (IS_CUSTOM_ELEMENT(element))
CopyCustomElementPropertiesToGame(element);
else if (IS_GROUP_ELEMENT(element))
CopyGroupElementPropertiesToGame(element);
+ else
+ CopyClassicElementPropertiesToGame(element);
}
void DrawLevelEd()
{ EL_DIAMOND, &level.score[SC_DIAMOND], TEXT_COLLECTING },
{ EL_CRYSTAL, &level.score[SC_CRYSTAL], TEXT_COLLECTING },
{ EL_PEARL, &level.score[SC_PEARL], TEXT_COLLECTING },
+ { EL_BUG, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BUG_RIGHT, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BUG_UP, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BUG_LEFT, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BUG_DOWN, &level.score[SC_BUG], TEXT_SMASHING },
+ { EL_BD_BUTTERFLY, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BD_BUTTERFLY_RIGHT,&level.score[SC_BUG], TEXT_SMASHING },
{ EL_BD_BUTTERFLY_UP, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BD_BUTTERFLY_LEFT, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_BD_BUTTERFLY_DOWN, &level.score[SC_BUG], TEXT_SMASHING },
{ EL_SP_ELECTRON, &level.score[SC_BUG], TEXT_SMASHING },
+ { EL_SPACESHIP, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_SPACESHIP_RIGHT, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_SPACESHIP_UP, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_SPACESHIP_LEFT, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_SPACESHIP_DOWN, &level.score[SC_SPACESHIP], TEXT_SMASHING },
+ { EL_BD_FIREFLY, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_BD_FIREFLY_RIGHT,&level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_BD_FIREFLY_UP, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_BD_FIREFLY_LEFT, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_YAMYAM, &level.score[SC_YAMYAM], TEXT_SMASHING },
{ EL_DARK_YAMYAM, &level.score[SC_YAMYAM], TEXT_SMASHING },
{ EL_ROBOT, &level.score[SC_ROBOT], TEXT_SMASHING },
+ { EL_PACMAN, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_PACMAN_RIGHT, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_PACMAN_UP, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_PACMAN_LEFT, &level.score[SC_PACMAN], TEXT_SMASHING },
{ -1, NULL, NULL }
};
-static boolean checkPropertiesConfig()
+static boolean checkPropertiesConfig(int element)
{
int i;
- if (IS_GEM(properties_element) ||
- IS_CUSTOM_ELEMENT(properties_element) ||
- IS_GROUP_ELEMENT(properties_element) ||
- IS_ENVELOPE(properties_element) ||
- ELEM_IS_PLAYER(properties_element) ||
- HAS_CONTENT(properties_element))
+ if (IS_GEM(element) ||
+ IS_CUSTOM_ELEMENT(element) ||
+ IS_GROUP_ELEMENT(element) ||
+ IS_ENVELOPE(element) ||
+ ELEM_IS_PLAYER(element) ||
+ HAS_CONTENT(element) ||
+ COULD_MOVE_INTO_ACID(element) ||
+ element == EL_SPRING)
return TRUE;
else
for (i = 0; elements_with_counter[i].element != -1; i++)
- if (elements_with_counter[i].element == properties_element)
+ if (elements_with_counter[i].element == element)
return TRUE;
return FALSE;
{
int i;
- if (!checkPropertiesConfig())
+ if (!checkPropertiesConfig(properties_element))
{
PrintInfoText("No configuration options available.", FONT_TEXT_1, 0);
{
int counter_id = ED_COUNTER_ID_ELEMENT_SCORE;
- if (HAS_CONTENT(properties_element)) /* needs stickybutton */
- counterbutton_info[counter_id].y = ED_SETTINGS_YPOS(1);
- else
- counterbutton_info[counter_id].y = ED_SETTINGS_YPOS(0);
+ counterbutton_info[counter_id].y =
+ ED_SETTINGS_YPOS((HAS_CONTENT(properties_element) ? 1 : 0) +
+ (COULD_MOVE_INTO_ACID(properties_element) ? 1 : 0));
counterbutton_info[counter_id].value = elements_with_counter[i].value;
counterbutton_info[counter_id].text_right= elements_with_counter[i].text;
DrawElementContentAreas();
}
- if (IS_GEM(properties_element))
- MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS);
-
if (ELEM_IS_PLAYER(properties_element))
MapCheckbuttonGadget(properties_element == EL_SP_MURPHY ?
ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD :
ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD);
+ if (IS_GEM(properties_element))
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS);
+
+ if (COULD_MOVE_INTO_ACID(properties_element) &&
+ !IS_CUSTOM_ELEMENT(properties_element))
+ {
+ checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].y =
+ ED_SETTINGS_YPOS(HAS_CONTENT(properties_element) ? 1 : 0);
+
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID);
+ }
+
+ if (properties_element == EL_SPRING)
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_SPRING_BUG);
+
if (IS_ENVELOPE(properties_element))
{
int counter1_id = ED_COUNTER_ID_ENVELOPE_XSIZE;
*checkbutton_info[type_id].value ^= TRUE;
- if (((type_id >= ED_CHECKBUTTON_ID_CUSTOM_FIRST &&
- type_id <= ED_CHECKBUTTON_ID_CUSTOM_LAST) ||
- (type_id >= ED_CHECKBUTTON_ID_CHANGE_FIRST &&
- type_id <= ED_CHECKBUTTON_ID_CHANGE_LAST)) &&
- type_id != ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE)
+ if (type_id == ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID ||
+ (((type_id >= ED_CHECKBUTTON_ID_CUSTOM_FIRST &&
+ type_id <= ED_CHECKBUTTON_ID_CUSTOM_LAST) ||
+ (type_id >= ED_CHECKBUTTON_ID_CHANGE_FIRST &&
+ type_id <= ED_CHECKBUTTON_ID_CHANGE_LAST)) &&
+ type_id != ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE))
{
CopyElementPropertiesToGame(properties_element);
}
}
}
+static inline void InitField_WithBug1(int x, int y, boolean init_game)
+{
+ InitField(x, y, init_game);
+
+ /* not needed to call InitMovDir() -- already done by InitField()! */
+ if (game.engine_version < VERSION_IDENT(3,0,9,0) &&
+ CAN_MOVE(Feld[x][y]))
+ InitMovDir(x, y);
+}
+
+static inline void InitField_WithBug2(int x, int y, boolean init_game)
+{
+ int old_element = Feld[x][y];
+
+ InitField(x, y, init_game);
+
+ /* not needed to call InitMovDir() -- already done by InitField()! */
+ if (game.engine_version < VERSION_IDENT(3,0,9,0) &&
+ CAN_MOVE(old_element) &&
+ (old_element < EL_MOLE_LEFT || old_element > EL_MOLE_DOWN))
+ InitMovDir(x, y);
+
+ /* this case is in fact a combination of not less than three bugs:
+ first, it calls InitMovDir() for elements that can move, although this is
+ already done by InitField(); then, it checks the element that was at this
+ field _before_ the call to InitField() (which can change it)
+
+ */
+}
+
void DrawGameDoorValues()
{
int i, j;
ChangeDelay[x][y] = 0;
ChangePage[x][y] = -1;
+#if 1
+ InitField_WithBug2(x, y, FALSE);
+#else
InitField(x, y, FALSE);
#if 1
/* !!! not needed !!! */
+#if 1
+ if (game.engine_version < VERSION_IDENT(3,0,9,0) &&
+ CAN_MOVE(Feld[x][y]) && Feld[x][y] != EL_MOLE)
+ InitMovDir(x, y);
+#else
if (CAN_MOVE(element))
InitMovDir(x, y);
+#endif
+#endif
#endif
DrawLevelField(x, y);
void StartMoving(int x, int y)
{
+#if 0
boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0,0));
+#endif
boolean started_moving = FALSE; /* some elements can fall _and_ move */
int element = Feld[x][y];
Impact(x, y);
}
- else if (IS_FREE(x, y + 1) && element == EL_SPRING && use_spring_bug)
+ else if (IS_FREE(x, y + 1) && element == EL_SPRING && level.use_spring_bug)
{
if (MovDir[x][y] == MV_NO_MOVING)
{
int nextx = newx + dx, nexty = newy + dy;
#endif
#if 1
- boolean pushed = (Pushed[x][y] && IS_PLAYER(x, y));
+ boolean pushed_by_player = (Pushed[x][y] && IS_PLAYER(x, y));
boolean pushed_by_conveyor = (Pushed[x][y] && !IS_PLAYER(x, y));
#else
- boolean pushed = Pushed[x][y];
+ boolean pushed_by_player = Pushed[x][y];
#endif
MovPos[x][y] += getElementMoveStepsize(x, y);
#if 0
- if (pushed && IS_PLAYER(x, y))
+ if (pushed_by_player && IS_PLAYER(x, y))
{
/* special case: moving object pushed by player */
MovPos[x][y] = SIGN(MovPos[x][y]) * (TILEX - ABS(PLAYERINFO(x,y)->MovPos));
}
#else
- if (pushed) /* special case: moving object pushed by player */
+ if (pushed_by_player) /* special case: moving object pushed by player */
MovPos[x][y] = SIGN(MovPos[x][y]) * (TILEX - ABS(PLAYERINFO(x,y)->MovPos));
#endif
Stop[newx][newy] = TRUE; /* ignore this element until the next frame */
/* prevent pushed element from moving on in pushed direction */
- if (pushed && CAN_MOVE(element) &&
+ if (pushed_by_player && CAN_MOVE(element) &&
element_info[element].move_pattern & MV_ANY_DIRECTION &&
!(element_info[element].move_pattern & direction))
TurnRound(newx, newy);
MovDir[newx][newy] = 0;
#endif
- if (!pushed) /* special case: moving object pushed by player */
+ if (!pushed_by_player)
{
WasJustMoving[newx][newy] = 3;
if (element_info[Feld[x][y]].move_direction_initial == MV_START_PREVIOUS)
MovDir[x][y] = previous_move_direction;
+#if 1
+ InitField_WithBug1(x, y, FALSE);
+#else
InitField(x, y, FALSE);
if (CAN_MOVE(Feld[x][y]))
InitMovDir(x, y);
+#endif
DrawLevelField(x, y);
#endif
#if 1
+ /* for downwards compatibility, the following code emulates a fixed bug that
+ occured when pushing elements (causing elements that just made their last
+ pushing step to already (if possible) make their first falling step in the
+ same game frame, which is bad); this code is also needed to use the famous
+ "spring push bug" which is used in older levels and might be wanted to be
+ used also in newer levels, but in this case the buggy pushing code is only
+ affecting the "spring" element and no other elements */
+
+#if 1
+ if (game.engine_version < VERSION_IDENT(2,2,0,7) || level.use_spring_bug)
+#else
if (game.engine_version < VERSION_IDENT(2,2,0,7))
+#endif
{
for (i = 0; i < MAX_PLAYERS; i++)
{
int x = player->jx;
int y = player->jy;
+#if 1
+ if (player->active && player->is_pushing && player->is_moving &&
+ IS_MOVING(x, y) &&
+ (game.engine_version < VERSION_IDENT(2,2,0,7) ||
+ Feld[x][y] == EL_SPRING))
+#else
if (player->active && player->is_pushing && player->is_moving &&
IS_MOVING(x, y))
+#endif
{
ContinueMoving(x, y);
CH_SIDE_BOTTOM, /* moving up */
CH_SIDE_TOP, /* moving down */
};
+#if 0
boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0,0));
+#endif
int jx = oldx, jy = oldy;
int dx = x - jx, dy = y - jy;
int nextx = x + dx, nexty = y + 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))
+ !(element == EL_SPRING && level.use_spring_bug))
return MF_NO_ACTION;
#if 1
if (Feld[jx][jy] == new_element) /* uninitialized unless CE change */
{
+#if 1
+ InitField_WithBug1(jx, jy, FALSE);
+#else
InitField(jx, jy, FALSE);
if (CAN_MOVE(Feld[jx][jy]))
InitMovDir(jx, jy);
+#endif
}
new_element = Feld[jx][jy];