{ 4, "normal" },
{ 8, "fast" },
{ 16, "very fast" },
+#if 1
+ { 32, "even faster" },
+#endif
{ -1, NULL }
};
static struct ValueTextInfo options_consistency[] =
{
{ EP_CAN_EXPLODE_3X3, "can explode 3x3" },
- { EP_CAN_EXPLODE_DYNA, "can explode 3+3" },
+ { EP_CAN_EXPLODE_CROSS, "can explode 3+3" },
{ EP_CAN_EXPLODE_1X1, "can explode 1x1" },
{ EP_INDESTRUCTIBLE, "indestructible" },
static void copy_custom_element_settings(int element_from, int element_to)
{
-#if 1
+#if 0
struct ElementInfo ei_to_old = element_info[element_to];
struct ElementInfo *ei_from = &element_info[element_from];
struct ElementInfo *ei_to = &element_info[element_to];
for (i = 0; i < MAX_ELEMENT_NAME_LEN + 1; i++)
ei_to->description[i] = ei_from->description[i];
- /* ---------- copy element properties ---------- */
+ /* ---------- copy element base properties ---------- */
Properties[element_to][EP_BITFIELD_BASE] =
Properties[element_from][EP_BITFIELD_BASE];
ei_to->use_gfx_element = ei_from->use_gfx_element;
ei_to->gfx_element = ei_from->gfx_element;
+ ei_to->access_direction = ei_from->access_direction;
+
ei_to->collect_score = ei_from->collect_score;
ei_to->collect_count = ei_from->collect_count;
ei_to->move_direction_initial = ei_from->move_direction_initial;
ei_to->move_stepsize = ei_from->move_stepsize;
+ ei_to->move_enter_element = ei_from->move_enter_element;
+ ei_to->move_leave_element = ei_from->move_leave_element;
+ ei_to->move_leave_type = ei_from->move_leave_type;
+
ei_to->slippery_type = ei_from->slippery_type;
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
ei_to->content[x][y] = ei_from->content[x][y];
- ei_to->num_change_pages = ei_from->num_change_pages;
- setElementChangePages(ei_to, ei_to->num_change_pages);
-
- for (i=0; i < ei_to->num_change_pages; i++)
- {
- struct ElementChangeInfo *change_to = &ei_to->change_page[i];
- struct ElementChangeInfo *change_from = &ei_from->change_page[i];
-
- /* always start with reliable default values */
- setElementChangeInfoToDefaults(change_to);
-
- change_to->events = change_from->events;
+ ei_to->explosion_delay = ei_from->explosion_delay;
+ ei_to->ignition_delay = ei_from->ignition_delay;
- change_to->target_element = change_from->target_element;
-
- change_to->delay_fixed = change_from->delay_fixed;
- change_to->delay_random = change_from->delay_random;
- change_to->delay_frames = change_from->delay_frames;
-
- change_to->trigger_element = change_from->trigger_element;
+ /* ---------- reinitialize and copy change pages ---------- */
- change_to->explode = change_from->explode;
- change_to->use_content = change_from->use_content;
- change_to->only_if_complete = change_from->only_if_complete;
- change_to->use_random_change = change_from->use_random_change;
+ ei_to->num_change_pages = ei_from->num_change_pages;
+ ei_to->current_change_page = ei_from->current_change_page;
- change_to->random_percentage = change_from->random_percentage;
- change_to->replace_when = change_from->replace_when;
+ setElementChangePages(ei_to, ei_to->num_change_pages);
- for (y = 0; y < 3; y++)
- for (x = 0; x < 3; x++)
- change_to->target_content[x][y] = change_from->target_content[x][y];
+ for (i=0; i < ei_to->num_change_pages; i++)
+ ei_to->change_page[i] = ei_from->change_page[i];
- change_to->can_change = change_from->can_change;
+ /* ---------- copy group element info ---------- */
+ if (ei_from->group != NULL && ei_to->group != NULL) /* group or internal */
+ *ei_to->group = *ei_from->group;
- change_to->trigger_side = change_from->trigger_side;
- }
#endif
/* mark this custom element as modified */
(IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE :
CAN_EXPLODE_1X1(element) ? EP_CAN_EXPLODE_1X1 :
CAN_EXPLODE_3X3(element) ? EP_CAN_EXPLODE_3X3 :
- CAN_EXPLODE_DYNA(element) ? EP_CAN_EXPLODE_DYNA :
+ CAN_EXPLODE_CROSS(element) ? EP_CAN_EXPLODE_CROSS :
custom_element.consistency);
custom_element_properties[EP_EXPLODE_RESULT] =
(IS_INDESTRUCTIBLE(element) ||
CAN_EXPLODE_1X1(element) ||
CAN_EXPLODE_3X3(element) ||
- CAN_EXPLODE_DYNA(element));
+ CAN_EXPLODE_CROSS(element));
/* special case: sub-settings dependent from main setting */
if (CAN_EXPLODE_BY_FIRE(element))
custom_element_properties[EP_INDESTRUCTIBLE] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_1X1] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_3X3] = FALSE;
- custom_element_properties[EP_CAN_EXPLODE_DYNA] = FALSE;
+ custom_element_properties[EP_CAN_EXPLODE_CROSS] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_SMASHED] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_IMPACT] = FALSE;
/* special case: sub-settings dependent from main setting */
if (custom_element_properties[EP_CAN_EXPLODE_1X1] ||
custom_element_properties[EP_CAN_EXPLODE_3X3] ||
- custom_element_properties[EP_CAN_EXPLODE_DYNA])
+ custom_element_properties[EP_CAN_EXPLODE_CROSS])
{
custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] =
custom_element.can_explode_by_fire;
/* for Explode() */
#define EX_PHASE_START 0
-#define EX_NO_EXPLOSION 0
-#define EX_NORMAL 1
-#define EX_CENTER 2
-#define EX_BORDER 3
+#define EX_TYPE_NONE 0
+#define EX_TYPE_NORMAL (1 << 0)
+#define EX_TYPE_CENTER (1 << 1)
+#define EX_TYPE_BORDER (1 << 2)
+#define EX_TYPE_CROSS (1 << 3)
+#define EX_TYPE_SINGLE_TILE (EX_TYPE_CENTER | EX_TYPE_BORDER)
/* special positions in the game control window (relative to control window) */
#define XX_LEVEL 37
ExplodePhase[x][y] = 0;
ExplodeDelay[x][y] = 0;
- ExplodeField[x][y] = EX_NO_EXPLOSION;
+ ExplodeField[x][y] = EX_TYPE_NONE;
RunnerVisit[x][y] = 0;
PlayerVisit[x][y] = 0;
/* --- This is only really needed (and now handled) in "Impact()". --- */
/* do not explode moving elements that left the explode field in time */
if (game.engine_version >= VERSION_IDENT(2,2,0,7) &&
- center_element == EL_EMPTY && (mode == EX_NORMAL || mode == EX_CENTER))
+ center_element == EL_EMPTY &&
+ (mode == EX_TYPE_NORMAL || mode == EX_TYPE_CENTER))
return;
#endif
- if (mode == EX_NORMAL || mode == EX_CENTER)
+ if (mode == EX_TYPE_NORMAL || mode == EX_TYPE_CENTER)
PlayLevelSoundAction(ex, ey, ACTION_EXPLODING);
/* remove things displayed in background while burning dynamite */
int element;
#if 1
- if (!IN_LEV_FIELD(x, y) || (mode != EX_NORMAL && (x != ex || y != ey)))
+#if 1
+ if (!IN_LEV_FIELD(x, y) ||
+ (mode & EX_TYPE_SINGLE_TILE && (x != ex || y != ey)) ||
+ (mode == EX_TYPE_CROSS && (x != ex && y != ey)))
continue;
#else
if (!IN_LEV_FIELD(x, y) ||
- ((mode != EX_NORMAL || center_element == EL_AMOEBA_TO_DIAMOND) &&
+ (mode != EX_TYPE_NORMAL && (x != ex || y != ey)))
+ continue;
+#endif
+#else
+ if (!IN_LEV_FIELD(x, y) ||
+ ((mode != EX_TYPE_NORMAL ||
+ center_element == EL_AMOEBA_TO_DIAMOND) &&
(x != ex || y != ey)))
continue;
#endif
Store[x][y] = EL_EMPTY;
if (x != ex || y != ey ||
- center_element == EL_AMOEBA_TO_DIAMOND || mode == EX_BORDER)
+ center_element == EL_AMOEBA_TO_DIAMOND || mode == EX_TYPE_BORDER)
Store2[x][y] = element;
#if 0
player->dynabombs_left++;
}
- Explode(ex, ey, EX_PHASE_START, EX_CENTER);
+ Explode(ex, ey, EX_PHASE_START, EX_TYPE_CENTER);
for (i = 0; i < NUM_DIRECTIONS; i++)
{
if (element == EL_EXPLOSION && IS_ACTIVE_BOMB(Store2[x][y]))
continue;
- Explode(x, y, EX_PHASE_START, EX_BORDER);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_BORDER);
/* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
if (element != EL_EMPTY &&
case EL_PACMAN:
case EL_MOLE:
RaiseScoreElement(element);
- Explode(x, y, EX_PHASE_START, EX_NORMAL);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_NORMAL);
break;
case EL_DYNABOMB_PLAYER_1_ACTIVE:
case EL_DYNABOMB_PLAYER_2_ACTIVE:
case EL_AMOEBA_TO_DIAMOND:
#endif
if (IS_PLAYER(x, y))
- Explode(x, y, EX_PHASE_START, EX_NORMAL);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_NORMAL);
else
- Explode(x, y, EX_PHASE_START, EX_CENTER);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_CENTER);
break;
default:
- if (CAN_EXPLODE_DYNA(element))
+ if (CAN_EXPLODE_CROSS(element))
+#if 1
+ Explode(x, y, EX_PHASE_START, EX_TYPE_CROSS);
+#else
DynaExplode(x, y);
+#endif
else if (CAN_EXPLODE_1X1(element))
- Explode(x, y, EX_PHASE_START, EX_CENTER);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_CENTER);
else
- Explode(x, y, EX_PHASE_START, EX_NORMAL);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_NORMAL);
break;
}
CheckDynamite(x, y);
#if 0
else if (element == EL_EXPLOSION && !game.explosions_delayed)
- Explode(x, y, ExplodePhase[x][y], EX_NORMAL);
+ Explode(x, y, ExplodePhase[x][y], EX_TYPE_NORMAL);
#endif
else if (element == EL_AMOEBA_GROWING)
AmoebeWaechst(x, y);
if (ExplodeField[x][y])
Explode(x, y, EX_PHASE_START, ExplodeField[x][y]);
else if (element == EL_EXPLOSION)
- Explode(x, y, ExplodePhase[x][y], EX_NORMAL);
+ Explode(x, y, ExplodePhase[x][y], EX_TYPE_NORMAL);
- ExplodeField[x][y] = EX_NO_EXPLOSION;
+ ExplodeField[x][y] = EX_TYPE_NONE;
}
game.explosions_delayed = TRUE;
int leave_side = trigger_sides[MV_DIR_BIT(move_direction)][1];
#if 1
+ CheckTriggeredElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy],
+ CE_OTHER_GETS_LEFT,
+ player->index_bit, leave_side);
+
if (IS_CUSTOM_ELEMENT(Feld[old_jx][old_jy]))
- {
- CheckTriggeredElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy],
- CE_OTHER_GETS_LEFT,
- player->index_bit, leave_side);
CheckElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy],
CE_LEFT_BY_PLAYER,
player->index_bit, leave_side);
- }
+
+ CheckTriggeredElementChangePlayer(jx, jy, Feld[jx][jy],
+ CE_OTHER_GETS_ENTERED,
+ player->index_bit, enter_side);
if (IS_CUSTOM_ELEMENT(Feld[jx][jy]))
- {
- CheckTriggeredElementChangePlayer(jx, jy, Feld[jx][jy],
- CE_OTHER_GETS_ENTERED,
- player->index_bit, enter_side);
CheckElementChangePlayer(jx, jy, Feld[jx][jy], CE_ENTERED_BY_PLAYER,
player->index_bit, enter_side);
- }
#endif
}
int old_jy = last_jy;
#if 1
+ CheckTriggeredElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy],
+ CE_OTHER_GETS_LEFT,
+ player->index_bit, leave_side);
+
if (IS_CUSTOM_ELEMENT(Feld[old_jx][old_jy]))
- {
- CheckTriggeredElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy],
- CE_OTHER_GETS_LEFT,
- player->index_bit, leave_side);
CheckElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy],
CE_LEFT_BY_PLAYER,
player->index_bit, leave_side);
- }
+
+ CheckTriggeredElementChangePlayer(jx, jy, Feld[jx][jy],
+ CE_OTHER_GETS_ENTERED,
+ player->index_bit, enter_side);
if (IS_CUSTOM_ELEMENT(Feld[jx][jy]))
- {
- CheckTriggeredElementChangePlayer(jx, jy, Feld[jx][jy],
- CE_OTHER_GETS_ENTERED,
- player->index_bit, enter_side);
CheckElementChangePlayer(jx, jy, Feld[jx][jy], CE_ENTERED_BY_PLAYER,
player->index_bit, enter_side);
- }
#endif
}
PlayLevelSoundElementAction(x, y, element, ACTION_DIGGING);
CheckTriggeredElementChangePlayer(x, y, element, CE_OTHER_GETS_DIGGED,
- player->index_bit, CH_SIDE_ANY);
+ player->index_bit, dig_side);
#if 1
if (mode == DF_SNAP)
CheckTriggeredElementChangePlayer(x, y, element,
CE_OTHER_GETS_COLLECTED,
- player->index_bit, CH_SIDE_ANY);
+ player->index_bit, dig_side);
#if 1
if (mode == DF_SNAP)
boolean DropElement(struct PlayerInfo *player)
{
+ static int trigger_sides[4] =
+ {
+ CH_SIDE_LEFT, /* dropping left */
+ CH_SIDE_RIGHT, /* dropping right */
+ CH_SIDE_TOP, /* dropping up */
+ CH_SIDE_BOTTOM, /* dropping down */
+ };
int jx = player->jx, jy = player->jy;
+ int drop_direction = player->MovDir;
+ int drop_side = trigger_sides[MV_DIR_BIT(drop_direction)];
int old_element = Feld[jx][jy];
int new_element = (player->inventory_size > 0 ?
player->inventory_element[player->inventory_size - 1] :
CheckTriggeredElementChangePlayer(jx, jy, new_element,
CE_OTHER_GETS_DROPPED,
- player->index_bit, CH_SIDE_ANY);
+ player->index_bit, drop_side);
CheckElementChangePlayer(jx, jy, new_element, CE_DROPPED_BY_PLAYER,
- player->index_bit, CH_SIDE_ANY);
+ player->index_bit, drop_side);
TestIfElementTouchesCustomElement(jx, jy);
}