From: Holger Schemel Date: Tue, 29 Apr 2003 00:33:23 +0000 (+0200) Subject: rnd-20030429-1-src X-Git-Tag: 3.0.0^2~75 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2ae75555354aefcf73489a4bb65439fa82358818;p=rocksndiamonds.git rnd-20030429-1-src --- diff --git a/CHANGES b/CHANGES index ef1098c0..4a745648 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Pre-Release Version 2.2.0rc7 [?? ??? ????] ------------------------------------------ + - fixed bug when picking element in the editor + - added more custom elements properties Pre-Release Version 2.2.0rc6 [22 APR 2003] ------------------------------------------ diff --git a/src/conftime.h b/src/conftime.h index f7b76cfe..4bca1df5 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-04-28 13:02]" +#define COMPILE_DATE_STRING "[2003-04-29 02:32]" diff --git a/src/editor.c b/src/editor.c index 0c2fc7de..3f1f4909 100644 --- a/src/editor.c +++ b/src/editor.c @@ -5020,7 +5020,8 @@ static void HandleControlButtons(struct GadgetInfo *gi) case GADGET_ID_FLOOD_FILL: case GADGET_ID_GRAB_BRUSH: case GADGET_ID_PICK_ELEMENT: - last_drawing_function = drawing_function; + if (drawing_function != GADGET_ID_PICK_ELEMENT) + last_drawing_function = drawing_function; drawing_function = id; draw_with_brush = FALSE; break; diff --git a/src/game.c b/src/game.c index 6674016f..55658d80 100644 --- a/src/game.c +++ b/src/game.c @@ -5152,24 +5152,6 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) if (!player->active || (!dx && !dy)) return FALSE; -#if 0 - { - static boolean done = FALSE; - static old_count = -1; - - if (FrameCounter < old_count) - done = FALSE; - - if (FrameCounter < 100) - { - printf("::: wanna move [%d] [%d]\n", - FrameCounter, player->push_delay_value); - done = TRUE; - old_count = FrameCounter; - } - } -#endif - #if 0 if (!FrameReached(&player->move_delay, player->move_delay_value) && !tape.playing) @@ -5756,24 +5738,6 @@ int DigField(struct PlayerInfo *player, dy == +1 ? MV_DOWN : MV_NO_MOVING); int element; -#if 0 - { - static boolean done = FALSE; - - if (FrameCounter < 10) - done = FALSE; - - if (!done && - real_dx == -1 && - FrameCounter > 10) - { - printf("::: wanna move left [%d] [%d]\n", - FrameCounter, player->push_delay_value); - done = TRUE; - } - } -#endif - if (player->MovPos == 0) { player->is_digging = FALSE; @@ -5787,6 +5751,7 @@ int DigField(struct PlayerInfo *player, { player->Switching = FALSE; player->push_delay = 0; + return MF_NO_ACTION; } @@ -5831,6 +5796,12 @@ int DigField(struct PlayerInfo *player, element = Feld[x][y]; +#if 1 + if (mode == DF_SNAP && !IS_SNAPPABLE(element) && + game.engine_version >= VERSION_IDENT(2,2,0)) + return MF_NO_ACTION; +#endif + switch (element) { case EL_EMPTY: @@ -6529,6 +6500,9 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) int jx = player->jx, jy = player->jy; int x = jx + dx, y = jy + dy; + if (player->MovPos && game.engine_version >= VERSION_IDENT(2,2,0)) + return FALSE; + if (!player->active || !IN_LEV_FIELD(x, y)) return FALSE; @@ -6559,7 +6533,7 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) dy < 0 ? MV_UP : dy > 0 ? MV_DOWN : MV_NO_MOVING); - if (!DigField(player, x, y, 0, 0, DF_SNAP)) + if (DigField(player, x, y, 0, 0, DF_SNAP) == MF_NO_ACTION) return FALSE; player->snapped = TRUE; diff --git a/src/init.c b/src/init.c index d6ede854..aba60774 100644 --- a/src/init.c +++ b/src/init.c @@ -1474,6 +1474,37 @@ void InitElementPropertiesStatic() -1 }; + static int ep_switchable[] = + { + EL_ROBOT_WHEEL, + EL_SP_TERMINAL, + EL_CONVEYOR_BELT_1_SWITCH_LEFT, + EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_1_SWITCH_RIGHT, + EL_CONVEYOR_BELT_2_SWITCH_LEFT, + EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_2_SWITCH_RIGHT, + EL_CONVEYOR_BELT_3_SWITCH_LEFT, + EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_3_SWITCH_RIGHT, + EL_CONVEYOR_BELT_4_SWITCH_LEFT, + EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_4_SWITCH_RIGHT, + EL_SWITCHGATE_SWITCH_UP, + EL_SWITCHGATE_SWITCH_DOWN, + EL_LIGHT_SWITCH, + EL_LIGHT_SWITCH_ACTIVE, + EL_TIMEGATE_SWITCH, + EL_BALLOON_SWITCH_LEFT, + EL_BALLOON_SWITCH_RIGHT, + EL_BALLOON_SWITCH_UP, + EL_BALLOON_SWITCH_DOWN, + EL_BALLOON_SWITCH_ANY, + EL_LAMP, + EL_TIME_ORB_FULL, + -1 + }; + static int ep_dont_touch[] = { EL_BUG, @@ -2216,6 +2247,7 @@ void InitElementPropertiesStatic() { ep_can_be_crumbled, EP_CAN_BE_CRUMBLED }, { ep_can_move, EP_CAN_MOVE }, { ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL }, + { ep_switchable, EP_SWITCHABLE }, { ep_dont_touch, EP_DONT_TOUCH }, { ep_enemy, EP_ENEMY }, { ep_dont_go_to, EP_DONT_GO_TO }, @@ -2356,6 +2388,12 @@ void InitElementPropertiesEngine(int engine_version) SET_PROPERTY(i, EP_ACCESSIBLE, (IS_WALKABLE(i) || IS_PASSABLE(i))); + /* ---------- SNAPPABLE ------------------------------------------------ */ + SET_PROPERTY(i, EP_SNAPPABLE, (IS_DIGGABLE(i) || + IS_COLLECTIBLE(i) || + IS_SWITCHABLE(i) || + i == EL_BD_ROCK)); + /* ---------- WALL ----------------------------------------------------- */ SET_PROPERTY(i, EP_WALL, TRUE); /* default: element is wall */ diff --git a/src/main.h b/src/main.h index 69f758a0..ff990234 100644 --- a/src/main.h +++ b/src/main.h @@ -95,43 +95,45 @@ #define EP_CAN_BE_CRUMBLED 27 #define EP_CAN_MOVE 28 #define EP_CAN_PASS_MAGIC_WALL 29 -#define EP_DONT_TOUCH 30 -#define EP_ENEMY 31 -#define EP_DONT_GO_TO 32 -#define EP_CAN_EXPLODE 33 -#define EP_BD_ELEMENT 34 -#define EP_SP_ELEMENT 35 -#define EP_SB_ELEMENT 36 -#define EP_GEM 37 -#define EP_FOOD_DARK_YAMYAM 38 -#define EP_FOOD_PENGUIN 39 -#define EP_FOOD_PIG 40 -#define EP_HISTORIC_WALL 41 -#define EP_HISTORIC_SOLID 42 -#define EP_BELT 43 -#define EP_BELT_ACTIVE 44 -#define EP_BELT_SWITCH 45 -#define EP_TUBE 46 -#define EP_KEYGATE 47 -#define EP_AMOEBOID 48 -#define EP_AMOEBALIVE 49 -#define EP_HAS_CONTENT 50 -#define EP_ACTIVE_BOMB 51 -#define EP_INACTIVE 52 +#define EP_SWITCHABLE 30 +#define EP_DONT_TOUCH 31 +#define EP_ENEMY 32 +#define EP_DONT_GO_TO 33 +#define EP_CAN_EXPLODE 34 +#define EP_BD_ELEMENT 35 +#define EP_SP_ELEMENT 36 +#define EP_SB_ELEMENT 37 +#define EP_GEM 38 +#define EP_FOOD_DARK_YAMYAM 39 +#define EP_FOOD_PENGUIN 40 +#define EP_FOOD_PIG 41 +#define EP_HISTORIC_WALL 42 +#define EP_HISTORIC_SOLID 43 +#define EP_BELT 44 +#define EP_BELT_ACTIVE 45 +#define EP_BELT_SWITCH 46 +#define EP_TUBE 47 +#define EP_KEYGATE 48 +#define EP_AMOEBOID 49 +#define EP_AMOEBALIVE 50 +#define EP_HAS_CONTENT 51 +#define EP_ACTIVE_BOMB 52 +#define EP_INACTIVE 53 /* values for derived properties (determined from properties above) */ -#define EP_ACCESSIBLE_OVER 53 -#define EP_ACCESSIBLE_INSIDE 54 -#define EP_ACCESSIBLE_UNDER 55 -#define EP_WALKABLE 56 -#define EP_PASSABLE 57 -#define EP_ACCESSIBLE 58 -#define EP_WALL 59 -#define EP_SOLID_FOR_PUSHING 60 -#define EP_DRAGONFIRE_PROOF 61 -#define EP_EXPLOSION_PROOF 62 - -#define NUM_ELEMENT_PROPERTIES 63 +#define EP_ACCESSIBLE_OVER 54 +#define EP_ACCESSIBLE_INSIDE 55 +#define EP_ACCESSIBLE_UNDER 56 +#define EP_WALKABLE 57 +#define EP_PASSABLE 58 +#define EP_ACCESSIBLE 59 +#define EP_SNAPPABLE 60 +#define EP_WALL 61 +#define EP_SOLID_FOR_PUSHING 62 +#define EP_DRAGONFIRE_PROOF 63 +#define EP_EXPLOSION_PROOF 64 + +#define NUM_ELEMENT_PROPERTIES 65 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -168,6 +170,7 @@ #define CAN_BE_CRUMBLED(e) HAS_PROPERTY(e, EP_CAN_BE_CRUMBLED) #define CAN_MOVE(e) HAS_PROPERTY(e, EP_CAN_MOVE) #define CAN_PASS_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL) +#define IS_SWITCHABLE(e) HAS_PROPERTY(e, EP_SWITCHABLE) #define DONT_TOUCH(e) HAS_PROPERTY(e, EP_DONT_TOUCH) #define IS_ENEMY(e) HAS_PROPERTY(e, EP_ENEMY) #define DONT_GO_TO(e) HAS_PROPERTY(e, EP_DONT_GO_TO) @@ -196,6 +199,7 @@ #define IS_ACCESSIBLE_OVER(e) HAS_PROPERTY(e, EP_ACCESSIBLE_OVER) #define IS_ACCESSIBLE_INSIDE(e) HAS_PROPERTY(e, EP_ACCESSIBLE_INSIDE) #define IS_ACCESSIBLE_UNDER(e) HAS_PROPERTY(e, EP_ACCESSIBLE_UNDER) +#define IS_SNAPPABLE(e) HAS_PROPERTY(e, EP_SNAPPABLE) #define IS_WALKABLE(e) HAS_PROPERTY(e, EP_WALKABLE) #define IS_PASSABLE(e) HAS_PROPERTY(e, EP_PASSABLE) #define IS_ACCESSIBLE(e) HAS_PROPERTY(e, EP_ACCESSIBLE)