From: Holger Schemel Date: Sat, 4 Oct 2003 02:38:51 +0000 (+0200) Subject: rnd-20031004-1-src X-Git-Tag: 3.0.6^2~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3494549d6f5c8d1d5497ec7eb9fa80a7ca6579ee;p=rocksndiamonds.git rnd-20031004-1-src * 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) --- diff --git a/ChangeLog b/ChangeLog index 44de1e5d..8f53fa16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +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. diff --git a/src/conftime.h b/src/conftime.h index d981d600..1d8c0e62 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-09-29 02:43]" +#define COMPILE_DATE_STRING "[2003-10-04 03:08]" diff --git a/src/editor.c b/src/editor.c index b3495358..0b9ad878 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1114,6 +1114,7 @@ static struct ValueTextInfo options_change_direct_action[] = { { 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 ..." }, @@ -1128,6 +1129,7 @@ static struct ValueTextInfo options_change_other_action[] = { { 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 ..." }, @@ -4589,6 +4591,7 @@ static void CopyCustomElementPropertiesToEditor(int element) 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 : @@ -4602,6 +4605,7 @@ static void CopyCustomElementPropertiesToEditor(int element) 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 : @@ -4705,6 +4709,7 @@ static void CopyCustomElementPropertiesToGame(int element) /* 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; @@ -4718,6 +4723,7 @@ static void CopyCustomElementPropertiesToGame(int element) /* 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; diff --git a/src/events.c b/src/events.c index f060c0ff..96f4624d 100644 --- a/src/events.c +++ b/src/events.c @@ -424,6 +424,7 @@ void HandleButton(int mx, int my, int button) 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]); diff --git a/src/game.c b/src/game.c index 3b06f485..2062caa8 100644 --- a/src/game.c +++ b/src/game.c @@ -2479,7 +2479,11 @@ void Bang(int x, int 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); @@ -4491,6 +4495,12 @@ void ContinueMoving(int x, int 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; @@ -5545,6 +5555,8 @@ static boolean ChangeElementNow(int x, int y, int element, int page) 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; @@ -6696,6 +6708,10 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) #if 1 player->snapped = FALSE; #endif + +#if 1 + player->Switching = FALSE; +#endif } else { @@ -7645,6 +7661,11 @@ int DigField(struct PlayerInfo *player, 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]) @@ -7797,13 +7818,6 @@ int DigField(struct PlayerInfo *player, 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) @@ -7899,8 +7913,20 @@ int DigField(struct PlayerInfo *player, 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 diff --git a/src/init.c b/src/init.c index 8ec25b1d..c7a19911 100644 --- a/src/init.c +++ b/src/init.c @@ -291,8 +291,13 @@ void InitFontGraphicInfo() /* ---------- 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++) @@ -665,6 +670,34 @@ void InitElementGraphicInfo() } } +#if 1 + /* set animation mode to "none" for each graphic with only 1 frame */ + for (i=0; i 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); diff --git a/src/main.h b/src/main.h index 4e64205b..e860375c 100644 --- a/src/main.h +++ b/src/main.h @@ -179,11 +179,10 @@ #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