+2003-10-03
+ * fixed bug when initializing font graphic structure
+ * fixed bug with animation mode "pingpong" when using only 1 frame
+ * fixed bug with extended change target introduced in 3.0.5
+ * fixed bug where passing over moving element doubles player speed
+ * fixed bug with elements continuing to move into push direction
+ * fixed bug with duplicated player when dropping bomb with shield on
+ * added "switching" event for custom elements ("pressing" only once)
+ * fixed switching bug (resetting flag when not switching but not idle)
+
2003-09-29
* fixed element tokens for certain file elements with ".active" etc.
-#define COMPILE_DATE_STRING "[2003-09-29 02:43]"
+#define COMPILE_DATE_STRING "[2003-10-04 03:08]"
{
{ CE_TOUCHED_BY_PLAYER, "touched by player ..." },
{ CE_PRESSED_BY_PLAYER, "pressed by player ..." },
+ { CE_SWITCHED_BY_PLAYER, "switched by player ..." },
{ CE_PUSHED_BY_PLAYER, "pushed by player ..." },
{ CE_ENTERED_BY_PLAYER, "entered by player ..." },
{ CE_LEFT_BY_PLAYER, "left by player ..." },
{
{ CE_OTHER_GETS_TOUCHED, "player touches ..." },
{ CE_OTHER_GETS_PRESSED, "player presses ..." },
+ { CE_OTHER_GETS_SWITCHED, "player switches ..." },
{ CE_OTHER_GETS_PUSHED, "player pushes ..." },
{ CE_OTHER_GETS_ENTERED, "player enters ..." },
{ CE_OTHER_GETS_LEFT, "player leaves ..." },
custom_element_change.direct_action =
(HAS_CHANGE_EVENT(element, CE_TOUCHED_BY_PLAYER) ? CE_TOUCHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PRESSED_BY_PLAYER) ? CE_PRESSED_BY_PLAYER :
+ HAS_CHANGE_EVENT(element, CE_SWITCHED_BY_PLAYER) ? CE_SWITCHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PUSHED_BY_PLAYER) ? CE_PUSHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_ENTERED_BY_PLAYER) ? CE_ENTERED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_LEFT_BY_PLAYER) ? CE_LEFT_BY_PLAYER :
custom_element_change.other_action =
(HAS_CHANGE_EVENT(element, CE_OTHER_GETS_TOUCHED) ? CE_OTHER_GETS_TOUCHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_PRESSED) ? CE_OTHER_GETS_PRESSED :
+ HAS_CHANGE_EVENT(element, CE_OTHER_GETS_SWITCHED) ? CE_OTHER_GETS_SWITCHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_PUSHED) ? CE_OTHER_GETS_PUSHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_ENTERED) ? CE_OTHER_GETS_ENTERED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_LEFT) ? CE_OTHER_GETS_LEFT :
/* set player change event from checkbox and selectbox */
custom_element_change_events[CE_TOUCHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PRESSED_BY_PLAYER] = FALSE;
+ custom_element_change_events[CE_SWITCHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PUSHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_ENTERED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_LEFT_BY_PLAYER] = FALSE;
/* set other element action change event from checkbox and selectbox */
custom_element_change_events[CE_OTHER_GETS_TOUCHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_PRESSED] = FALSE;
+ custom_element_change_events[CE_OTHER_GETS_SWITCHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_PUSHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_ENTERED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_LEFT] = FALSE;
printf(" Feld[%d][%d] == %d ('%s')\n", x,y, Feld[x][y],
element_info[Feld[x][y]].token_name);
+ printf(" Back[%d][%d] == %d\n", x,y, Back[x][y]);
printf(" Store[%d][%d] == %d\n", x,y, Store[x][y]);
printf(" Store2[%d][%d] == %d\n", x,y, Store2[x][y]);
printf(" StorePlayer[%d][%d] == %d\n", x,y, StorePlayer[x][y]);
int element = Feld[x][y];
#endif
+#if 1
+ if (IS_PLAYER(x, y) && !PLAYER_PROTECTED(x, y))
+#else
if (IS_PLAYER(x, y))
+#endif
{
struct PlayerInfo *player = PLAYERINFO(x, y);
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) &&
+ element_info[element].move_pattern & MV_ANY_DIRECTION &&
+ !(element_info[element].move_pattern & MovDir[newx][newy]))
+ TurnRound(newx, newy);
+
if (!pushed) /* special case: moving object pushed by player */
JustStopped[newx][newy] = 3;
if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey))
RemoveMovingField(ex, ey);
+ ChangeEvent[ex][ey] = ChangeEvent[x][y];
+
ChangeElementNowExt(ex, ey, change->content[xx][yy]);
something_has_changed = TRUE;
#if 1
player->snapped = FALSE;
#endif
+
+#if 1
+ player->Switching = FALSE;
+#endif
}
else
{
if (!IN_LEV_FIELD(nextx, nexty) || !IS_FREE(nextx, nexty))
return MF_NO_ACTION;
+#if 1
+ if (CAN_MOVE(element)) /* only fixed elements can be passed! */
+ return MF_NO_ACTION;
+#endif
+
if (element >= EL_EM_GATE_1 && element <= EL_EM_GATE_4)
{
if (!player->key[element - EL_EM_GATE_1])
return MF_NO_ACTION;
#if 1
- /*
- printf("::: %d [%d,%d,%d => %d]\n", MovDir[x][y],
- CAN_MOVE(element), move_direction, getElementMoveStepsize(x, y),
- (CAN_MOVE(element) && MovDir[x][y] == move_direction &&
- getElementMoveStepsize(x, y) > MOVE_STEPSIZE_NORMAL) );
- */
-
/* do not push elements already moving away faster than player */
if (CAN_MOVE(element) && MovDir[x][y] == move_direction &&
ABS(getElementMoveStepsize(x, y)) > MOVE_STEPSIZE_NORMAL)
else
{
#if 1
+
+#if 1
+ if (!player->Switching)
+ {
+ player->Switching = TRUE;
+ CheckTriggeredElementSideChange(x, y, element, dig_side,
+ CE_OTHER_GETS_SWITCHED);
+ CheckElementSideChange(x, y, element, dig_side,
+ CE_SWITCHED_BY_PLAYER, -1);
+ }
+#endif
+
CheckTriggeredElementSideChange(x, y, element, dig_side,
- CE_OTHER_GETS_PRESSED);
+ CE_OTHER_GETS_PRESSED);
CheckElementSideChange(x, y, element, dig_side,
CE_PRESSED_BY_PLAYER, -1);
#else
/* ---------- initialize font graphic definitions ---------- */
/* always start with reliable default values (normal font graphics) */
+#if 1
+ for (i=0; i < NUM_FONTS; i++)
+ font_info[i].graphic = IMG_FONT_INITIAL_1;
+#else
for (i=0; i < NUM_FONTS; i++)
font_info[i].graphic = FONT_INITIAL_1;
+#endif
/* initialize normal font/graphic mapping from static configuration */
for (i=0; font_to_graphic[i].font_nr > -1; i++)
}
}
+#if 1
+ /* set animation mode to "none" for each graphic with only 1 frame */
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ {
+ for (act=0; act<NUM_ACTIONS; act++)
+ {
+ int graphic = element_info[i].graphic[act];
+ int crumbled = element_info[i].crumbled[act];
+
+ if (graphic_info[graphic].anim_frames == 1)
+ graphic_info[graphic].anim_mode = ANIM_NONE;
+ if (graphic_info[crumbled].anim_frames == 1)
+ graphic_info[crumbled].anim_mode = ANIM_NONE;
+
+ for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ {
+ graphic = element_info[i].direction_graphic[act][dir];
+ crumbled = element_info[i].direction_crumbled[act][dir];
+
+ if (graphic_info[graphic].anim_frames == 1)
+ graphic_info[graphic].anim_mode = ANIM_NONE;
+ if (graphic_info[crumbled].anim_frames == 1)
+ graphic_info[crumbled].anim_mode = ANIM_NONE;
+ }
+ }
+ }
+#endif
+
#if 0
#if DEBUG
if (options.verbose)
graphic_info[graphic].anim_delay = 1;
graphic_info[graphic].anim_mode = parameter[GFX_ARG_ANIM_MODE];
+#if 0
+ if (graphic_info[graphic].anim_frames == 1)
+ graphic_info[graphic].anim_mode = ANIM_NONE;
+#endif
/* automatically determine correct start frame, if not defined */
if (parameter[GFX_ARG_START_FRAME] == ARG_UNDEFINED_VALUE)
}
else if (mode & ANIM_PINGPONG) /* oscillate (border frames once) */
{
+#if 1
+ int max_anim_frames = (num_frames > 1 ? 2 * num_frames - 2 : 1);
+#else
int max_anim_frames = 2 * num_frames - 2;
+#endif
frame = (sync_frame % (delay * max_anim_frames)) / delay;
frame = (frame < num_frames ? frame : max_anim_frames - frame);
#define CE_LEFT_BY_PLAYER 22
#define CE_OTHER_GETS_ENTERED 23
#define CE_OTHER_GETS_LEFT 24
+#define CE_SWITCHED_BY_PLAYER 25
+#define CE_OTHER_GETS_SWITCHED 26
-/* values for derived change events (determined from properties above) */
-#define CE_TOUCHING_SOME_SIDE 25 /* summarized left/right/up/down/any */
-
-#define NUM_CHANGE_EVENTS 26
+#define NUM_CHANGE_EVENTS 27
#define CE_BITMASK_DEFAULT 0