rnd-20030429-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 29 Apr 2003 00:33:23 +0000 (02:33 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:41:39 +0000 (10:41 +0200)
CHANGES
src/conftime.h
src/editor.c
src/game.c
src/init.c
src/main.h

diff --git a/CHANGES b/CHANGES
index ef1098c0437a4183cb25e3c5c5614b0323a6f433..4a745648e37a580b4c143cae620fcb7546bae116 100644 (file)
--- 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]
 ------------------------------------------
index f7b76cfec116f5830ad1f500016ed83133adc771..4bca1df549a45d66e25c8079b2d98f63ad4bf170 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-04-28 13:02]"
+#define COMPILE_DATE_STRING "[2003-04-29 02:32]"
index 0c2fc7de127c0d1f32f698ad28f6342b1c939a8e..3f1f49098d7d62bdb91d4409d2597ad543005932 100644 (file)
@@ -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;
index 6674016f718bb97cda0bff364d4a389852842f23..55658d8028daa1452f936a5e4398fe2d89a9db76 100644 (file)
@@ -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;
index d6ede854a841fa36bfa305e99086e7b98e0ab5e7..aba60774b3f5c75e9e1cf2d1245ad468779cb660 100644 (file)
@@ -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 */
 
index 69f758a0ed50a1a4e86ad6a9c030fa566926971a..ff990234d956287476efc9b704d61d1aa91e992e 100644 (file)
 #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
 #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)
 #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)