#define GADGET_ID_RANDOM_PERCENTAGE (GADGET_ID_CHECKBUTTON_FIRST + 0)
#define GADGET_ID_RANDOM_QUANTITY (GADGET_ID_CHECKBUTTON_FIRST + 1)
#define GADGET_ID_RANDOM_RESTRICTED (GADGET_ID_CHECKBUTTON_FIRST + 2)
-#define GADGET_ID_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 3)
-#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 4)
-#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 5)
-#define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 6)
-#define GADGET_ID_USE_TIME_ORB_BUG (GADGET_ID_CHECKBUTTON_FIRST + 7)
-#define GADGET_ID_RANDOM_BALL_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 8)
-#define GADGET_ID_INITIAL_BALL_STATE (GADGET_ID_CHECKBUTTON_FIRST + 9)
-#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 10)
-#define GADGET_ID_CONTINUOUS_SNAPPING (GADGET_ID_CHECKBUTTON_FIRST + 11)
-#define GADGET_ID_BLOCK_SNAP_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 12)
-#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 13)
-#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 14)
-#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 15)
-#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16)
-#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17)
-#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 18)
+#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 3)
+#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 4)
+#define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 5)
+#define GADGET_ID_USE_TIME_ORB_BUG (GADGET_ID_CHECKBUTTON_FIRST + 6)
+#define GADGET_ID_RANDOM_BALL_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 7)
+#define GADGET_ID_INITIAL_BALL_STATE (GADGET_ID_CHECKBUTTON_FIRST + 8)
+#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 9)
+#define GADGET_ID_CONTINUOUS_SNAPPING (GADGET_ID_CHECKBUTTON_FIRST + 10)
+#define GADGET_ID_BLOCK_SNAP_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 13)
+#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 14)
+#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 15)
+#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16)
+#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17)
+#define GADGET_ID_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 18)
#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 19)
#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 20)
#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 21)
#define ED_GRAPHICBUTTON_ID_CHANGE_LAST ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE
/* values for checkbutton gadgets */
-#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY 0
-#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 1
-#define ED_CHECKBUTTON_ID_STICK_ELEMENT 2
-#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 3
-#define ED_CHECKBUTTON_ID_USE_SPRING_BUG 4
-#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG 5
-#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT 6
-#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE 7
-#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 8
-#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING 9
-#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD 10
-#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 11
-#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 12
-#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 13
-#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 14
-#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 15
-#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 16
+#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 0
+#define ED_CHECKBUTTON_ID_STICK_ELEMENT 1
+#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 2
+#define ED_CHECKBUTTON_ID_USE_SPRING_BUG 3
+#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG 4
+#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT 5
+#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE 6
+#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 7
+#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING 8
+#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD 9
+#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 10
+#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 11
+#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 12
+#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 13
+#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 14
+#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 15
+#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY 16
#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 17
#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 18
#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 19
#define ED_NUM_CHECKBUTTONS 46
-#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_INITIAL_GRAVITY
+#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
#define ED_CHECKBUTTON_ID_CUSTOM1_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC
#endif
{ CE_IMPACT, "impact (on something)" },
{ CE_SMASHED, "smashed (from above)" },
+ { CE_VALUE_CHANGES, "CE value changes" },
+ { CE_SCORE_CHANGES, "CE score changes" },
{ CE_VALUE_GETS_ZERO, "CE value gets 0" },
{ CE_SCORE_GETS_ZERO, "CE score gets 0" },
{ CE_EXPLOSION_OF_X, "explosion of" },
{ CE_MOVE_OF_X, "move of" },
{ CE_CREATION_OF_X, "creation of" },
+ { CE_VALUE_CHANGES_OF_X, "CE value changes of" },
+ { CE_SCORE_CHANGES_OF_X, "CE score changes of" },
{ CE_VALUE_GETS_ZERO_OF_X, "CE value gets 0 of" },
{ CE_SCORE_GETS_ZERO_OF_X, "CE score gets 0 of" },
{ CA_SET_LEVEL_TIME, "set time" },
{ CA_SET_LEVEL_SCORE, "set score" },
{ CA_SET_LEVEL_GEMS, "set needed gems" },
- { CA_SET_LEVEL_GRAVITY, "set gravity" },
{ CA_SET_LEVEL_WIND, "set wind dir." },
{ CA_UNDEFINED, " " },
{ CA_HEADLINE_PLAYER_ACTIONS, "[player actions]" },
{ CA_SET_PLAYER_KEYS, "set keys" },
{ CA_SET_PLAYER_SPEED, "set speed" },
{ CA_SET_PLAYER_SHIELD, "set shield" },
+ { CA_SET_PLAYER_GRAVITY, "set gravity" },
{ CA_SET_PLAYER_ARTWORK, "set artwork" },
{ CA_UNDEFINED, " " },
{ CA_HEADLINE_CE_ACTIONS, "[CE actions]" },
- { CA_SET_CE_SCORE, "set CE score" },
{ CA_SET_CE_VALUE, "set CE value" },
+ { CA_SET_CE_SCORE, "set CE score" },
{ CA_UNDEFINED, " " },
{ CA_HEADLINE_ENGINE_ACTIONS, "[engine actions]" },
{ CA_SET_ENGINE_SCAN_MODE, "set scan mode" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_RESET, "reset" },
{ CA_ARG_UNDEFINED, " " },
- { CA_ARG_NUMBER_CE_DELAY, "CE delay" },
- { CA_ARG_NUMBER_CE_SCORE, "CE score" },
{ CA_ARG_NUMBER_CE_VALUE, "CE value" },
+ { CA_ARG_NUMBER_CE_SCORE, "CE score" },
+ { CA_ARG_NUMBER_CE_DELAY, "CE delay" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_LEVEL_TIME, "time" },
{ CA_ARG_NUMBER_LEVEL_GEMS, "gems" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_RESET, "reset" },
{ CA_ARG_UNDEFINED, " " },
- { CA_ARG_NUMBER_CE_DELAY, "CE delay" },
- { CA_ARG_NUMBER_CE_SCORE, "CE score" },
{ CA_ARG_NUMBER_CE_VALUE, "CE value" },
+ { CA_ARG_NUMBER_CE_SCORE, "CE score" },
+ { CA_ARG_NUMBER_CE_DELAY, "CE delay" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_LEVEL_TIME, "time" },
{ CA_ARG_NUMBER_LEVEL_GEMS, "gems" },
{ CA_SET_LEVEL_TIME, 3, options_action_arg_number, },
{ CA_SET_LEVEL_GEMS, 3, options_action_arg_number, },
{ CA_SET_LEVEL_SCORE, 3, options_action_arg_number, },
- { CA_SET_LEVEL_GRAVITY, 1, options_action_arg_gravity, },
{ CA_SET_LEVEL_WIND, 1, options_action_arg_direction, },
{ CA_SET_PLAYER_KEYS, 2, options_action_arg_key, },
{ CA_SET_PLAYER_SPEED, 1, options_action_arg_speed, },
{ CA_SET_PLAYER_SHIELD, 1, options_action_arg_shield, },
+ { CA_SET_PLAYER_GRAVITY, 1, options_action_arg_gravity, },
{ CA_SET_PLAYER_ARTWORK, 1, options_action_arg_artwork, },
- { CA_SET_CE_SCORE, 3, options_action_arg_value, },
{ CA_SET_CE_VALUE, 3, options_action_arg_value, },
+ { CA_SET_CE_SCORE, 3, options_action_arg_value, },
{ CA_SET_ENGINE_SCAN_MODE, 1, options_action_arg_scan_mode, },
{ -1, FALSE, NULL }
{
/* ---------- level and editor settings ---------------------------------- */
- {
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11),
- GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE,
- &level.initial_gravity,
- NULL,
- "initial gravity", "set initial level gravity"
- },
{
ED_LEVEL_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(9) - MINI_TILEY,
GADGET_ID_RANDOM_RESTRICTED, GADGET_ID_NONE,
NULL,
"use explosion from element:", "use explosion properties from element"
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(11),
+ GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE,
+ &level.initial_player_gravity[0],
+ NULL,
+ "use initial gravity", "set initial player gravity"
+ },
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4),
GADGET_ID_CAN_PASS_TO_WALKABLE, GADGET_ID_NONE,
/* ---------- custom change content (extended change target) ------------- */
{
- -1, ED_AREA_3X3_SETTINGS_YPOS(10),
+ -1, ED_AREA_3X3_SETTINGS_YPOS(9),
GADGET_ID_CUSTOM_CHANGE_CONTENT, GADGET_ID_NONE, /* align three rows */
&custom_element_change.target_content.e[0][0], 3, 3,
NULL, NULL, NULL, "new extended elements after change"
HAS_CHANGE_EVENT(element, CE_BLOCKED) ? CE_BLOCKED :
HAS_CHANGE_EVENT(element, CE_IMPACT) ? CE_IMPACT :
HAS_CHANGE_EVENT(element, CE_SMASHED) ? CE_SMASHED :
+ HAS_CHANGE_EVENT(element, CE_VALUE_CHANGES) ? CE_VALUE_CHANGES :
+ HAS_CHANGE_EVENT(element, CE_SCORE_CHANGES) ? CE_SCORE_CHANGES :
HAS_CHANGE_EVENT(element, CE_VALUE_GETS_ZERO) ? CE_VALUE_GETS_ZERO :
HAS_CHANGE_EVENT(element, CE_SCORE_GETS_ZERO) ? CE_SCORE_GETS_ZERO :
custom_element_change.direct_action);
HAS_CHANGE_EVENT(element, CE_EXPLOSION_OF_X) ? CE_EXPLOSION_OF_X :
HAS_CHANGE_EVENT(element, CE_MOVE_OF_X) ? CE_MOVE_OF_X :
HAS_CHANGE_EVENT(element, CE_CREATION_OF_X) ? CE_CREATION_OF_X :
+ HAS_CHANGE_EVENT(element, CE_VALUE_CHANGES_OF_X) ? CE_VALUE_CHANGES_OF_X :
+ HAS_CHANGE_EVENT(element, CE_SCORE_CHANGES_OF_X) ? CE_SCORE_CHANGES_OF_X :
HAS_CHANGE_EVENT(element, CE_VALUE_GETS_ZERO_OF_X) ? CE_VALUE_GETS_ZERO_OF_X :
HAS_CHANGE_EVENT(element, CE_SCORE_GETS_ZERO_OF_X) ? CE_SCORE_GETS_ZERO_OF_X :
custom_element_change.other_action);
custom_element_change_events[CE_BLOCKED] = FALSE;
custom_element_change_events[CE_IMPACT] = FALSE;
custom_element_change_events[CE_SMASHED] = FALSE;
+ custom_element_change_events[CE_VALUE_CHANGES] = FALSE;
+ custom_element_change_events[CE_SCORE_CHANGES] = FALSE;
custom_element_change_events[CE_VALUE_GETS_ZERO] = FALSE;
custom_element_change_events[CE_SCORE_GETS_ZERO] = FALSE;
custom_element_change_events[custom_element_change.direct_action] =
custom_element_change_events[CE_EXPLOSION_OF_X] = FALSE;
custom_element_change_events[CE_MOVE_OF_X] = FALSE;
custom_element_change_events[CE_CREATION_OF_X] = FALSE;
+ custom_element_change_events[CE_VALUE_CHANGES_OF_X] = FALSE;
+ custom_element_change_events[CE_SCORE_CHANGES_OF_X] = FALSE;
custom_element_change_events[CE_VALUE_GETS_ZERO_OF_X] = FALSE;
custom_element_change_events[CE_SCORE_GETS_ZERO_OF_X] = FALSE;
custom_element_change_events[custom_element_change.other_action] =
&level.use_artwork_element[player_nr];
checkbutton_info[ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT].value =
&level.use_explosion_element[player_nr];
+ checkbutton_info[ED_CHECKBUTTON_ID_INITIAL_GRAVITY].value =
+ &level.initial_player_gravity[player_nr];
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID);
MapCheckbuttonGadget(properties_element == EL_SP_MURPHY ?
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_START_ELEMENT);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_GRAVITY);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE);
MapDrawingArea(ED_DRAWING_ID_START_ELEMENT);
TYPE_BOOLEAN, CONF_VALUE_8_BIT(5),
&li.can_pass_to_walkable, FALSE
},
+ {
+ EL_PLAYER_1,
+ TYPE_BOOLEAN, CONF_VALUE_8_BIT(6),
+ &li.initial_player_gravity[0], FALSE
+ },
{
EL_PLAYER_1,
TYPE_BOOLEAN, CONF_VALUE_8_BIT(9),
&li.continuous_snapping, TRUE
},
+ {
+ EL_PLAYER_2,
+ TYPE_BOOLEAN, CONF_VALUE_8_BIT(6),
+ &li.initial_player_gravity[1], FALSE
+ },
{
EL_PLAYER_2,
TYPE_BOOLEAN, CONF_VALUE_8_BIT(10),
&li.explosion_element[1], EL_PLAYER_2
},
+ {
+ EL_PLAYER_3,
+ TYPE_BOOLEAN, CONF_VALUE_8_BIT(6),
+ &li.initial_player_gravity[2], FALSE
+ },
{
EL_PLAYER_3,
TYPE_BOOLEAN, CONF_VALUE_8_BIT(10),
&li.explosion_element[2], EL_PLAYER_3
},
+ {
+ EL_PLAYER_4,
+ TYPE_BOOLEAN, CONF_VALUE_8_BIT(6),
+ &li.initial_player_gravity[3], FALSE
+ },
{
EL_PLAYER_4,
TYPE_BOOLEAN, CONF_VALUE_8_BIT(10),
&li.use_spring_bug, FALSE
},
- {
- EL_BALLOON,
- TYPE_BITFIELD, CONF_VALUE_8_BIT(1),
- &li.wind_direction_initial, MV_NONE
- },
-
{
EL_EMC_ANDROID,
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
{
-1,
- TYPE_BOOLEAN, CONF_VALUE_8_BIT(4),
- &li.em_slippery_gems, FALSE
+ TYPE_BITFIELD, CONF_VALUE_8_BIT(4),
+ &li.wind_direction_initial, MV_NONE
},
{
-1,
TYPE_BOOLEAN, CONF_VALUE_8_BIT(5),
+ &li.em_slippery_gems, FALSE
+ },
+
+ {
+ -1,
+ TYPE_BOOLEAN, CONF_VALUE_8_BIT(6),
&li.use_custom_template, FALSE
},
{
-1,
- TYPE_BITFIELD, CONF_VALUE_8_BIT(6),
+ TYPE_BITFIELD, CONF_VALUE_8_BIT(7),
&li.dont_collide_with_bits, ~0 /* default: always deadly */
},
putFile8Bit(file, level->author[i]);
}
+#if 0
static void SaveLevel_TITL(FILE *file, struct LevelInfo *level)
{
int i;
for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
putFile8Bit(file, level->name[i]);
}
+#endif
static void SaveLevel_BODY(FILE *file, struct LevelInfo *level)
{
}
#endif
+#if 0
static void SaveLevel_CNT2(FILE *file, struct LevelInfo *level, int element)
{
int i, x, y;
for (x = 0; x < 3; x++)
putFile16BitBE(file, content_array[i][x][y]);
}
+#endif
static void SaveLevel_CNT3(FILE *file, struct LevelInfo *level, int element)
{
/* check if non-default element settings need to be saved */
if (cusx_chunk_size > cusx_chunk_size_no_changes)
{
-#if 1
+#if 0
printf("::: SAVING CE %d\n", i + 1);
#endif
/* check if non-default element settings need to be saved */
if (grpx_chunk_size > grpx_chunk_size_no_changes)
{
-#if 1
+#if 0
printf("::: SAVING GE %d\n", i + 1);
#endif
#define USE_NEW_CONTINUOUS_SNAPPING (USE_NEW_STUFF * 1)
#define USE_GFX_RESET_GFX_ANIMATION (USE_NEW_STUFF * 1)
#define USE_BOTH_SWITCHGATE_SWITCHES (USE_NEW_STUFF * 1)
+#define USE_PLAYER_GRAVITY (USE_NEW_STUFF * 1)
#define USE_QUICKSAND_IMPACT_BUGFIX (USE_NEW_STUFF * 0)
player->block_last_field = FALSE; /* initialized in InitPlayerField() */
player->block_delay_adjustment = 0; /* initialized in InitPlayerField() */
+ player->gravity = level.initial_player_gravity[i];
+
player->can_fall_into_acid = CAN_MOVE_INTO_ACID(player->element_nr);
player->actual_frame_counter = 0;
GfxFrame[x][y] = CustomValue[x][y];
else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
GfxFrame[x][y] = element_info[element].collect_score;
+ else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+ GfxFrame[x][y] = ChangeDelay[x][y];
if (redraw && GfxFrame[x][y] != last_gfx_frame)
DrawLevelGraphicAnimation(x, y, graphic);
GfxFrame[x][y] = CustomValue[x][y];
else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
GfxFrame[x][y] = element_info[element].collect_score;
+ else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+ GfxFrame[x][y] = ChangeDelay[x][y];
#endif
#if USE_GFX_RESET_GFX_ANIMATION
GfxFrame[x][y] = CustomValue[x][y];
else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
GfxFrame[x][y] = element_info[element].collect_score;
+ else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+ GfxFrame[x][y] = ChangeDelay[x][y];
#endif
/* this is needed for CEs with property "can move" / "not moving" */
GfxFrame[x][y] = CustomValue[x][y];
else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
GfxFrame[x][y] = element_info[element].collect_score;
+ else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+ GfxFrame[x][y] = ChangeDelay[x][y];
#endif
}
break;
}
+#if !USE_PLAYER_GRAVITY
case CA_SET_LEVEL_GRAVITY:
{
game.gravity = (action_arg == CA_ARG_GRAVITY_OFF ? FALSE :
game.gravity);
break;
}
+#endif
case CA_SET_LEVEL_WIND:
{
break;
}
+#if USE_PLAYER_GRAVITY
+ case CA_SET_PLAYER_GRAVITY:
+ {
+ for (i = 0; i < MAX_PLAYERS; i++)
+ {
+ if (trigger_player_bits & (1 << i))
+ {
+ stored_player[i].gravity =
+ (action_arg == CA_ARG_GRAVITY_OFF ? FALSE :
+ action_arg == CA_ARG_GRAVITY_ON ? TRUE :
+ action_arg == CA_ARG_GRAVITY_TOGGLE ? !stored_player[i].gravity :
+ stored_player[i].gravity);
+ }
+ }
+
+ break;
+ }
+#endif
+
case CA_SET_PLAYER_ARTWORK:
{
for (i = 0; i < MAX_PLAYERS; i++)
printf("::: CE value == %d\n", CustomValue[x][y]);
#endif
- if (CustomValue[x][y] == 0 && last_ce_value > 0)
+ if (CustomValue[x][y] != last_ce_value)
{
+ CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_CHANGES);
+ CheckTriggeredElementChange(x, y, element, CE_VALUE_CHANGES_OF_X);
+
+ if (CustomValue[x][y] == 0)
+ {
#if 0
- printf("::: CE_VALUE_GETS_ZERO\n");
+ printf("::: CE_VALUE_GETS_ZERO\n");
#endif
- CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_GETS_ZERO);
- CheckTriggeredElementChange(x, y, element, CE_VALUE_GETS_ZERO_OF_X);
+ CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_GETS_ZERO);
+ CheckTriggeredElementChange(x, y, element, CE_VALUE_GETS_ZERO_OF_X);
#if 0
- printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
+ printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
#endif
+ }
}
+
#endif
break;
printf("::: CE score == %d\n", ei->collect_score);
#endif
- if (ei->collect_score == 0 && last_ce_score > 0)
+ if (ei->collect_score != last_ce_score)
{
+ CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_CHANGES);
+ CheckTriggeredElementChange(x, y, element, CE_SCORE_CHANGES_OF_X);
+
+ if (ei->collect_score == 0)
+ {
#if 0
- printf("::: CE_SCORE_GETS_ZERO\n");
+ printf("::: CE_SCORE_GETS_ZERO\n");
#endif
- CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO);
- CheckTriggeredElementChange(x, y, element, CE_SCORE_GETS_ZERO_OF_X);
+ CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO);
+ CheckTriggeredElementChange(x, y, element, CE_SCORE_GETS_ZERO_OF_X);
#if 0
- printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
+ printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
#endif
+ }
}
+
#endif
break;
GfxFrame[x][y] = element_info[element].collect_score;
+#if 1
+ if (GfxFrame[x][y] != old_gfx_frame)
+#endif
+ DrawLevelGraphicAnimation(x, y, graphic);
+ }
+ else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+ {
+ int old_gfx_frame = GfxFrame[x][y];
+
+ GfxFrame[x][y] = ChangeDelay[x][y];
+
#if 1
if (GfxFrame[x][y] != old_gfx_frame)
#endif
static void CheckGravityMovement(struct PlayerInfo *player)
{
+#if USE_PLAYER_GRAVITY
+ if (player->gravity && !player->programmed_action)
+#else
if (game.gravity && !player->programmed_action)
+#endif
{
int move_dir_horizontal = player->effective_action & MV_HORIZONTAL;
int move_dir_vertical = player->effective_action & MV_VERTICAL;
{
return CheckGravityMovement(player);
+#if USE_PLAYER_GRAVITY
+ if (player->gravity && !player->programmed_action)
+#else
if (game.gravity && !player->programmed_action)
+#endif
{
int jx = player->jx, jy = player->jy;
boolean field_under_player_is_free =
last_field_block_delay += player->move_delay_value;
/* when blocking enabled, prevent moving up despite gravity */
+#if USE_PLAYER_GRAVITY
+ if (player->gravity && player->MovDir == MV_UP)
+ block_delay_adjustment = -1;
+#else
if (game.gravity && player->MovDir == MV_UP)
block_delay_adjustment = -1;
+#endif
}
/* add block delay adjustment (also possible when not blocking) */
return MP_NO_ACTION;
}
+#if USE_PLAYER_GRAVITY
+ if (player->gravity && is_player && !player->is_auto_moving &&
+ canFallDown(player) && move_direction != MV_DOWN &&
+ !canMoveToValidFieldWithGravity(jx, jy, move_direction))
+ return MP_NO_ACTION; /* player cannot walk here due to gravity */
+#else
if (game.gravity && is_player && !player->is_auto_moving &&
canFallDown(player) && move_direction != MV_DOWN &&
!canMoveToValidFieldWithGravity(jx, jy, move_direction))
return MP_NO_ACTION; /* player cannot walk here due to gravity */
+#endif
if (player_can_move &&
IS_WALKABLE(element) && ACCESS_FROM(element, opposite_direction))
element == EL_SP_GRAVITY_PORT_RIGHT ||
element == EL_SP_GRAVITY_PORT_UP ||
element == EL_SP_GRAVITY_PORT_DOWN)
+#if USE_PLAYER_GRAVITY
+ player->gravity = !player->gravity;
+#else
game.gravity = !game.gravity;
+#endif
else if (element == EL_SP_GRAVITY_ON_PORT_LEFT ||
element == EL_SP_GRAVITY_ON_PORT_RIGHT ||
element == EL_SP_GRAVITY_ON_PORT_UP ||
element == EL_SP_GRAVITY_ON_PORT_DOWN)
+#if USE_PLAYER_GRAVITY
+ player->gravity = TRUE;
+#else
game.gravity = TRUE;
+#endif
else if (element == EL_SP_GRAVITY_OFF_PORT_LEFT ||
element == EL_SP_GRAVITY_OFF_PORT_RIGHT ||
element == EL_SP_GRAVITY_OFF_PORT_UP ||
element == EL_SP_GRAVITY_OFF_PORT_DOWN)
+#if USE_PLAYER_GRAVITY
+ player->gravity = FALSE;
+#else
game.gravity = FALSE;
+#endif
}
/* automatically move to the next field with double speed */