rnd-20040322-B-src
authorHolger Schemel <info@artsoft.org>
Mon, 22 Mar 2004 19:58:12 +0000 (20:58 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:46:33 +0000 (10:46 +0200)
* fixed another bug with custom elements digging and leaving elements
* fixed bug with "along left/right side" and automatic start direction
* trigger elements now also displayed when "more custom" deactivated
* fixed bug with clipboard element initialized when loading new level
* added option "drop delay" to set delay before dropping next element

ChangeLog
Makefile
src/Makefile
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/main.h

index 8a71ec2d0ff075cc92f1a57b5de2a62469108866..8d7147eb498fa22bd26fbb7398ac5d8b712834ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-22
+       * fixed another bug with custom elements digging and leaving elements
+       * fixed bug with "along left/right side" and automatic start direction
+       * trigger elements now also displayed when "more custom" deactivated
+       * fixed bug with clipboard element initialized when loading new level
+       * added option "drop delay" to set delay before dropping next element
+
 2004-03-20
        * added copy and paste functions for custom change pages
        * enhanced graphical display and functionality of tape recorder
index 481244f71d62f19aa28798e6d2579a159c37ac06..1ea92b071143a8f34b3ef39b687194fc893a8a00 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,8 +50,8 @@ CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc
 SRC_DIR = src
 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
 
-DEFAULT_TARGET = x11
-DEFAULT_TARGET = sdl
+DEFAULT_TARGET = x11
+DEFAULT_TARGET = sdl
 
 
 # -----------------------------------------------------------------------------
index f065f0b92cfb9a87ba2326f7db908e702e14b04a..ef1f52af1cd9b8b1be223b2036c4533f0076c8b3 100644 (file)
@@ -85,7 +85,8 @@ endif
 
 ifeq ($(TARGET),x11)
 SYS_CFLAGS  = -DTARGET_X11 $(X11_INCL)
-SYS_LDFLAGS = $(X11_LIBS) -lX11
+# SYS_LDFLAGS = $(X11_LIBS) -lX11
+SYS_LDFLAGS = $(XLIB_PATH)/libX11.a
 endif
 
 ifeq ($(TARGET),sdl)
index 3cfe1e83819ff983b49d53c8d9f2cacb620792ff..c6bb17a2b2844d9d6cf47941c5662ff24582586f 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2004-03-22 01:56]"
+#define COMPILE_DATE_STRING "[2004-03-22 20:42]"
index 29ac31db4a56051efc4d555435434fac0952bc0e..7852895b4d85797be41f155461ec36116a7c21ae 100644 (file)
                                         ED_GADGET_DISTANCE - MINI_TILEY)
 /* movement enter/leave element */
 #define ED_AREA_ELEM_CONTENT4a_XPOS    (29 * MINI_TILEX)
-#define ED_AREA_ELEM_CONTENT4a_YPOS    (ED_SETTINGS_YPOS(10) + \
+#define ED_AREA_ELEM_CONTENT4a_YPOS    (ED_SETTINGS_YPOS(11) + \
                                         ED_GADGET_DISTANCE)
 #define ED_AREA_ELEM_CONTENT4b_XPOS    (29 * MINI_TILEX)
-#define ED_AREA_ELEM_CONTENT4b_YPOS    (ED_SETTINGS_YPOS(10) + \
+#define ED_AREA_ELEM_CONTENT4b_YPOS    (ED_SETTINGS_YPOS(11) + \
                                         ED_GADGET_DISTANCE)
 /* custom change trigger element */
 #define ED_AREA_ELEM_CONTENT5_YPOS     (ED_SETTINGS_YPOS(5) + \
 #define GADGET_ID_PUSH_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 42)
 #define GADGET_ID_PUSH_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 43)
 #define GADGET_ID_PUSH_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 44)
-#define GADGET_ID_MOVE_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 45)
-#define GADGET_ID_MOVE_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 46)
-#define GADGET_ID_MOVE_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 47)
-#define GADGET_ID_MOVE_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 48)
-#define GADGET_ID_MOVE_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 49)
-#define GADGET_ID_MOVE_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 50)
-#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 51)
-#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 52)
-#define GADGET_ID_EXPLOSION_DELAY_UP   (GADGET_ID_COUNTER_FIRST + 53)
-#define GADGET_ID_IGNITION_DELAY_DOWN  (GADGET_ID_COUNTER_FIRST + 54)
-#define GADGET_ID_IGNITION_DELAY_TEXT  (GADGET_ID_COUNTER_FIRST + 55)
-#define GADGET_ID_IGNITION_DELAY_UP    (GADGET_ID_COUNTER_FIRST + 56)
-#define GADGET_ID_CHANGE_DELAY_FIX_DOWN        (GADGET_ID_COUNTER_FIRST + 57)
-#define GADGET_ID_CHANGE_DELAY_FIX_TEXT        (GADGET_ID_COUNTER_FIRST + 58)
-#define GADGET_ID_CHANGE_DELAY_FIX_UP  (GADGET_ID_COUNTER_FIRST + 59)
-#define GADGET_ID_CHANGE_DELAY_RND_DOWN        (GADGET_ID_COUNTER_FIRST + 60)
-#define GADGET_ID_CHANGE_DELAY_RND_TEXT        (GADGET_ID_COUNTER_FIRST + 61)
-#define GADGET_ID_CHANGE_DELAY_RND_UP  (GADGET_ID_COUNTER_FIRST + 62)
-#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 63)
-#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 64)
-#define GADGET_ID_CHANGE_CONT_RND_UP   (GADGET_ID_COUNTER_FIRST + 65)
-#define GADGET_ID_GROUP_CONTENT_DOWN   (GADGET_ID_COUNTER_FIRST + 66)
-#define GADGET_ID_GROUP_CONTENT_TEXT   (GADGET_ID_COUNTER_FIRST + 67)
-#define GADGET_ID_GROUP_CONTENT_UP     (GADGET_ID_COUNTER_FIRST + 68)
+#define GADGET_ID_DROP_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 45)
+#define GADGET_ID_DROP_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 46)
+#define GADGET_ID_DROP_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 47)
+#define GADGET_ID_DROP_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 48)
+#define GADGET_ID_DROP_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 49)
+#define GADGET_ID_DROP_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 50)
+#define GADGET_ID_MOVE_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 51)
+#define GADGET_ID_MOVE_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 52)
+#define GADGET_ID_MOVE_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 53)
+#define GADGET_ID_MOVE_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 54)
+#define GADGET_ID_MOVE_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 55)
+#define GADGET_ID_MOVE_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 56)
+#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 57)
+#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 58)
+#define GADGET_ID_EXPLOSION_DELAY_UP   (GADGET_ID_COUNTER_FIRST + 59)
+#define GADGET_ID_IGNITION_DELAY_DOWN  (GADGET_ID_COUNTER_FIRST + 60)
+#define GADGET_ID_IGNITION_DELAY_TEXT  (GADGET_ID_COUNTER_FIRST + 61)
+#define GADGET_ID_IGNITION_DELAY_UP    (GADGET_ID_COUNTER_FIRST + 62)
+#define GADGET_ID_CHANGE_DELAY_FIX_DOWN        (GADGET_ID_COUNTER_FIRST + 63)
+#define GADGET_ID_CHANGE_DELAY_FIX_TEXT        (GADGET_ID_COUNTER_FIRST + 64)
+#define GADGET_ID_CHANGE_DELAY_FIX_UP  (GADGET_ID_COUNTER_FIRST + 65)
+#define GADGET_ID_CHANGE_DELAY_RND_DOWN        (GADGET_ID_COUNTER_FIRST + 66)
+#define GADGET_ID_CHANGE_DELAY_RND_TEXT        (GADGET_ID_COUNTER_FIRST + 67)
+#define GADGET_ID_CHANGE_DELAY_RND_UP  (GADGET_ID_COUNTER_FIRST + 68)
+#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 69)
+#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 70)
+#define GADGET_ID_CHANGE_CONT_RND_UP   (GADGET_ID_COUNTER_FIRST + 71)
+#define GADGET_ID_GROUP_CONTENT_DOWN   (GADGET_ID_COUNTER_FIRST + 72)
+#define GADGET_ID_GROUP_CONTENT_TEXT   (GADGET_ID_COUNTER_FIRST + 73)
+#define GADGET_ID_GROUP_CONTENT_UP     (GADGET_ID_COUNTER_FIRST + 74)
 
 /* drawing area identifiers */
-#define GADGET_ID_DRAWING_AREA_FIRST   (GADGET_ID_COUNTER_FIRST + 69)
+#define GADGET_ID_DRAWING_AREA_FIRST   (GADGET_ID_COUNTER_FIRST + 75)
 
 #define GADGET_ID_DRAWING_LEVEL                (GADGET_ID_DRAWING_AREA_FIRST + 0)
 #define GADGET_ID_ELEMENT_CONTENT_0    (GADGET_ID_DRAWING_AREA_FIRST + 1)
 #define ED_COUNTER_ID_CUSTOM_GEMCOUNT  12
 #define ED_COUNTER_ID_PUSH_DELAY_FIX   13
 #define ED_COUNTER_ID_PUSH_DELAY_RND   14
-#define ED_COUNTER_ID_MOVE_DELAY_FIX   15
-#define ED_COUNTER_ID_MOVE_DELAY_RND   16
-#define ED_COUNTER_ID_EXPLOSION_DELAY  17
-#define ED_COUNTER_ID_IGNITION_DELAY   18
-#define ED_COUNTER_ID_GROUP_CONTENT    19
-#define ED_COUNTER_ID_CHANGE_DELAY_FIX 20
-#define ED_COUNTER_ID_CHANGE_DELAY_RND 21
-#define ED_COUNTER_ID_CHANGE_CONT_RND  22
-
-#define ED_NUM_COUNTERBUTTONS          23
+#define ED_COUNTER_ID_DROP_DELAY_FIX   15
+#define ED_COUNTER_ID_DROP_DELAY_RND   16
+#define ED_COUNTER_ID_MOVE_DELAY_FIX   17
+#define ED_COUNTER_ID_MOVE_DELAY_RND   18
+#define ED_COUNTER_ID_EXPLOSION_DELAY  19
+#define ED_COUNTER_ID_IGNITION_DELAY   20
+#define ED_COUNTER_ID_GROUP_CONTENT    21
+#define ED_COUNTER_ID_CHANGE_DELAY_FIX 22
+#define ED_COUNTER_ID_CHANGE_DELAY_RND 23
+#define ED_COUNTER_ID_CHANGE_CONT_RND  24
+
+#define ED_NUM_COUNTERBUTTONS          25
 
 #define ED_COUNTER_ID_LEVEL_FIRST      ED_COUNTER_ID_LEVEL_XSIZE
 #define ED_COUNTER_ID_LEVEL_LAST       ED_COUNTER_ID_LEVEL_RANDOM
 #define ED_SELECTBOX_ID_LEVEL_LAST     ED_SELECTBOX_ID_TIME_OR_STEPS
 
 #define ED_SELECTBOX_ID_CUSTOM1_FIRST  ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE
-#define ED_SELECTBOX_ID_CUSTOM1_LAST   ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE
-#define ED_SELECTBOX_ID_CUSTOM2_FIRST  ED_SELECTBOX_ID_CUSTOM_DEADLINESS
+#define ED_SELECTBOX_ID_CUSTOM1_LAST   ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE
+#define ED_SELECTBOX_ID_CUSTOM2_FIRST  ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS
 #define ED_SELECTBOX_ID_CUSTOM2_LAST   ED_SELECTBOX_ID_CUSTOM_CONSISTENCY
 #define ED_SELECTBOX_ID_CUSTOM_FIRST   ED_SELECTBOX_ID_CUSTOM1_FIRST
 #define ED_SELECTBOX_ID_CUSTOM_LAST    ED_SELECTBOX_ID_CUSTOM2_LAST
 #define ED_CHECKBUTTON_ID_LEVEL_LAST   ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
 
 #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST        ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC
-#define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY
-#define ED_CHECKBUTTON_ID_CUSTOM2_FIRST        ED_CHECKBUTTON_ID_CUSTOM_DEADLY
+#define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE
+#define ED_CHECKBUTTON_ID_CUSTOM2_FIRST        ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL
 #define ED_CHECKBUTTON_ID_CUSTOM2_LAST ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT
 #define ED_CHECKBUTTON_ID_CUSTOM_FIRST ED_CHECKBUTTON_ID_CUSTOM1_FIRST
 #define ED_CHECKBUTTON_ID_CUSTOM_LAST  ED_CHECKBUTTON_ID_CUSTOM2_LAST
@@ -1026,7 +1034,7 @@ static struct
   },
   {
     ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(7),
-    0,                                 999,
+    0,                                 255,
     GADGET_ID_PUSH_DELAY_FIX_DOWN,     GADGET_ID_PUSH_DELAY_FIX_UP,
     GADGET_ID_PUSH_DELAY_FIX_TEXT,     GADGET_ID_NONE,
     &custom_element.push_delay_fixed,
@@ -1034,14 +1042,30 @@ static struct
   },
   {
     -1,                                        ED_SETTINGS_YPOS(7),
-    0,                                 999,
+    0,                                 255,
     GADGET_ID_PUSH_DELAY_RND_DOWN,     GADGET_ID_PUSH_DELAY_RND_UP,
     GADGET_ID_PUSH_DELAY_RND_TEXT,     GADGET_ID_PUSH_DELAY_FIX_UP,
     &custom_element.push_delay_random,
     NULL,                              "+random", NULL
   },
   {
-    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(12),
+    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(8),
+    0,                                 255,
+    GADGET_ID_DROP_DELAY_FIX_DOWN,     GADGET_ID_DROP_DELAY_FIX_UP,
+    GADGET_ID_DROP_DELAY_FIX_TEXT,     GADGET_ID_NONE,
+    &custom_element.drop_delay_fixed,
+    NULL,                              "drop delay", NULL
+  },
+  {
+    -1,                                        ED_SETTINGS_YPOS(8),
+    0,                                 255,
+    GADGET_ID_DROP_DELAY_RND_DOWN,     GADGET_ID_DROP_DELAY_RND_UP,
+    GADGET_ID_DROP_DELAY_RND_TEXT,     GADGET_ID_DROP_DELAY_FIX_UP,
+    &custom_element.drop_delay_random,
+    NULL,                              "+random", NULL
+  },
+  {
+    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(13),
     0,                                 999,
     GADGET_ID_MOVE_DELAY_FIX_DOWN,     GADGET_ID_MOVE_DELAY_FIX_UP,
     GADGET_ID_MOVE_DELAY_FIX_TEXT,     GADGET_ID_NONE,
@@ -1049,7 +1073,7 @@ static struct
     NULL,                              "move delay", NULL
   },
   {
-    -1,                                        ED_SETTINGS_YPOS(12),
+    -1,                                        ED_SETTINGS_YPOS(13),
     0,                                 999,
     GADGET_ID_MOVE_DELAY_RND_DOWN,     GADGET_ID_MOVE_DELAY_RND_UP,
     GADGET_ID_MOVE_DELAY_RND_TEXT,     GADGET_ID_MOVE_DELAY_FIX_UP,
@@ -1536,7 +1560,7 @@ static struct
     NULL, NULL,                                "diggable/collectible/pushable"
   },
   {
-    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(8),
+    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(9),
     GADGET_ID_CUSTOM_MOVE_PATTERN,     GADGET_ID_NONE,
     -1,
     options_move_pattern,
@@ -1544,7 +1568,7 @@ static struct
     "can move", NULL,                  "element move direction"
   },
   {
-    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(9),
+    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(10),
     GADGET_ID_CUSTOM_MOVE_DIRECTION,   GADGET_ID_NONE,
     -1,
     options_move_direction,
@@ -1552,7 +1576,7 @@ static struct
     "starts moving", NULL,             "initial element move direction"
   },
   {
-    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(11),
+    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(12),
     GADGET_ID_CUSTOM_MOVE_STEPSIZE,    GADGET_ID_NONE,
     -1,
     options_move_stepsize,
@@ -1560,7 +1584,7 @@ static struct
     "move/fall speed", NULL,           "speed of element movement"
   },
   {
-    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(10),
+    ED_SETTINGS_XPOS(1),               ED_SETTINGS_YPOS(11),
     GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE,  GADGET_ID_NONE,
     -1,
     options_move_leave_type,
@@ -2036,7 +2060,7 @@ static struct
     NULL, NULL,                                "player can dig/collect/push element"
   },
   {
-    ED_SETTINGS_XPOS(0),               ED_SETTINGS_YPOS(8),
+    ED_SETTINGS_XPOS(0),               ED_SETTINGS_YPOS(9),
     GADGET_ID_CUSTOM_CAN_MOVE,         GADGET_ID_NONE,
     &custom_element_properties[EP_CAN_MOVE],
     NULL, NULL,                                "element can move in some direction"
@@ -3340,17 +3364,28 @@ static int editor_el_custom_more[] =
   EL_CUSTOM_START + 252,
   EL_CUSTOM_START + 253,
   EL_CUSTOM_START + 254,
-  EL_CUSTOM_START + 255,
+  EL_CUSTOM_START + 255
+};
+static int *editor_hl_custom_more_ptr = editor_hl_custom_more;
+static int *editor_el_custom_more_ptr = editor_el_custom_more;
+static int num_editor_hl_custom_more = SIZEOF_ARRAY_INT(editor_hl_custom_more);
+static int num_editor_el_custom_more = SIZEOF_ARRAY_INT(editor_el_custom_more);
 
+static int editor_hl_custom_special[] =
+{
+};
+
+static int editor_el_custom_special[] =
+{
   EL_TRIGGER_ELEMENT,
   EL_TRIGGER_PLAYER,
   EL_EMPTY,
   EL_EMPTY
 };
-static int *editor_hl_custom_more_ptr = editor_hl_custom_more;
-static int *editor_el_custom_more_ptr = editor_el_custom_more;
-static int num_editor_hl_custom_more = SIZEOF_ARRAY_INT(editor_hl_custom_more);
-static int num_editor_el_custom_more = SIZEOF_ARRAY_INT(editor_el_custom_more);
+static int *editor_hl_custom_special_ptr = editor_hl_custom_special;
+static int *editor_el_custom_special_ptr = editor_el_custom_special;
+static int num_editor_hl_custom_special = SIZEOF_ARRAY_INT(editor_hl_custom_special);
+static int num_editor_el_custom_special = SIZEOF_ARRAY_INT(editor_el_custom_special);
 
 static int editor_hl_group[] =
 {
@@ -3533,6 +3568,11 @@ editor_elements_info[] =
     &editor_hl_custom_more_ptr,                &num_editor_hl_custom_more,
     &editor_el_custom_more_ptr,                &num_editor_el_custom_more
   },
+  {
+    &setup.editor.el_custom,
+    &editor_hl_custom_special_ptr,     &num_editor_hl_custom_special,
+    &editor_el_custom_special_ptr,     &num_editor_el_custom_special
+  },
   {
     &setup.editor.el_custom,
     &editor_hl_group_ptr,              &num_editor_hl_group,
@@ -5573,6 +5613,8 @@ static void copy_custom_element_settings(int element_from, int element_to)
 
   ei_to->push_delay_fixed = ei_from->push_delay_fixed;
   ei_to->push_delay_random = ei_from->push_delay_random;
+  ei_to->drop_delay_fixed = ei_from->drop_delay_fixed;
+  ei_to->drop_delay_random = ei_from->drop_delay_random;
   ei_to->move_delay_fixed = ei_from->move_delay_fixed;
   ei_to->move_delay_random = ei_from->move_delay_random;
 
@@ -6992,6 +7034,7 @@ static void DrawPropertiesConfig()
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS);
 
   if (COULD_MOVE_INTO_ACID(properties_element) &&
+      !ELEM_IS_PLAYER(properties_element) &&
       (!IS_CUSTOM_ELEMENT(properties_element) ||
        edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2))
   {
index dcb087609de6880642453374e2536c0265534bca..cfce89f8b639a74d7d16f5d8fb8a6d4a1fff3de1 100644 (file)
@@ -126,6 +126,8 @@ void setElementChangeInfoToDefaults(struct ElementChangeInfo *change)
 
 static void setLevelInfoToDefaults(struct LevelInfo *level)
 {
+  static boolean clipboard_elements_initialized = FALSE;
+
   int i, j, x, y;
 
   level->file_version = FILE_VERSION_ACTUAL;
@@ -201,6 +203,10 @@ static void setLevelInfoToDefaults(struct LevelInfo *level)
   {
     int element = i;
 
+    /* never initialize clipboard elements after the very first time */
+    if (IS_CLIPBOARD_ELEMENT(element) && clipboard_elements_initialized)
+      continue;
+
     setElementChangePages(&element_info[element], 1);
     setElementChangeInfoToDefaults(element_info[element].change);
 
@@ -232,6 +238,8 @@ static void setLevelInfoToDefaults(struct LevelInfo *level)
 
       element_info[element].push_delay_fixed = -1;     /* initialize later */
       element_info[element].push_delay_random = -1;    /* initialize later */
+      element_info[element].drop_delay_fixed = 0;
+      element_info[element].drop_delay_random = 0;
       element_info[element].move_delay_fixed = 0;
       element_info[element].move_delay_random = 0;
 
@@ -293,6 +301,8 @@ static void setLevelInfoToDefaults(struct LevelInfo *level)
     }
   }
 
+  clipboard_elements_initialized = TRUE;
+
   BorderElement = EL_STEELWALL;
 
   level->no_valid_file = FALSE;
@@ -1043,8 +1053,10 @@ static int LoadLevel_CUS4(FILE *file, int chunk_size, struct LevelInfo *level)
   ei->collect_score = getFile8Bit(file);
   ei->collect_count = getFile8Bit(file);
 
-  ei->push_delay_fixed = getFile16BitBE(file);
-  ei->push_delay_random = getFile16BitBE(file);
+  ei->drop_delay_fixed = getFile8Bit(file);
+  ei->push_delay_fixed = getFile8Bit(file);
+  ei->drop_delay_random = getFile8Bit(file);
+  ei->push_delay_random = getFile8Bit(file);
   ei->move_delay_fixed = getFile16BitBE(file);
   ei->move_delay_random = getFile16BitBE(file);
 
@@ -2707,8 +2719,10 @@ static void SaveLevel_CUS4(FILE *file, struct LevelInfo *level, int element)
   putFile8Bit(file, ei->collect_score);
   putFile8Bit(file, ei->collect_count);
 
-  putFile16BitBE(file, ei->push_delay_fixed);
-  putFile16BitBE(file, ei->push_delay_random);
+  putFile8Bit(file, ei->drop_delay_fixed);
+  putFile8Bit(file, ei->push_delay_fixed);
+  putFile8Bit(file, ei->drop_delay_random);
+  putFile8Bit(file, ei->push_delay_random);
   putFile16BitBE(file, ei->move_delay_fixed);
   putFile16BitBE(file, ei->move_delay_random);
 
index 0c4100d2f6da2afb37174b7c373eaf1341b2590e..6fc7f7bdc7dbd196ecfd616c94935a282f716466 100644 (file)
 
 #define GET_NEW_PUSH_DELAY(e)  (   (element_info[e].push_delay_fixed) + \
                                 RND(element_info[e].push_delay_random))
+#define GET_NEW_DROP_DELAY(e)  (   (element_info[e].drop_delay_fixed) + \
+                                RND(element_info[e].drop_delay_random))
 #define GET_NEW_MOVE_DELAY(e)  (   (element_info[e].move_delay_fixed) + \
                                 RND(element_info[e].move_delay_random))
 #define GET_MAX_MOVE_DELAY(e)  (   (element_info[e].move_delay_fixed) + \
@@ -2092,6 +2094,11 @@ void InitMovDir(int x, int y)
 
              break;
            }
+
+#if 1
+           if (MovDir[x][y] == MV_NO_MOVING)   /* no start direction found */
+             MovDir[x][y] = 1 << RND(4);       /* => use random direction */
+#endif
          }
        }                
       }
@@ -5559,10 +5566,16 @@ void StartMoving(int x, int y)
       }
 
 #if 1
+#if 1
+      Store[newx][newy] = EL_EMPTY;
+      if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)))
+       Store[newx][newy] = element_info[element].move_leave_element;
+#else
       Store[newx][newy] = EL_EMPTY;
       if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)) ||
          element_info[element].move_leave_type == LEAVE_TYPE_UNLIMITED)
        Store[newx][newy] = element_info[element].move_leave_element;
+#endif
 #else
       if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)))
        element_info[element].can_leave_element = TRUE;
@@ -5875,11 +5888,13 @@ void ContinueMoving(int x, int y)
   }
 #if 1
   else if (IS_CUSTOM_ELEMENT(element) && !IS_PLAYER(x, y) &&
-          ei->move_leave_element != EL_EMPTY && Store[x][y] != EL_EMPTY)
+          ei->move_leave_element != EL_EMPTY &&
+          (ei->move_leave_type == LEAVE_TYPE_UNLIMITED ||
+           Store[x][y] != EL_EMPTY))
   {
     /* some elements can leave other elements behind after moving */
 
-    Feld[x][y] = Store[x][y];
+    Feld[x][y] = ei->move_leave_element;
     InitField(x, y, FALSE);
 
     if (GFX_CRUMBLED(Feld[x][y]))
@@ -8757,7 +8772,9 @@ boolean MovePlayerOneStep(struct PlayerInfo *player,
 
   player->step_counter++;
 
+#if 0
   player->drop_delay = 0;
+#endif
 
   PlayerVisit[jx][jy] = FrameCounter;
 
@@ -10776,13 +10793,14 @@ boolean DropElement(struct PlayerInfo *player)
   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] :
-                    player->inventory_infinite_element != EL_UNDEFINED ?
-                    player->inventory_infinite_element :
-                    player->dynabombs_left > 0 ?
-                    EL_DYNABOMB_PLAYER_1_ACTIVE + player->index_nr :
-                    EL_UNDEFINED);
+  int drop_element = (player->inventory_size > 0 ?
+                     player->inventory_element[player->inventory_size - 1] :
+                     player->inventory_infinite_element != EL_UNDEFINED ?
+                     player->inventory_infinite_element :
+                     player->dynabombs_left > 0 ?
+                     EL_DYNABOMB_PLAYER_1_ACTIVE + player->index_nr :
+                     EL_UNDEFINED);
+  int new_element = drop_element;      /* default: element does not change */
 
   /* check if player is active, not moving and ready to drop */
   if (!player->active || player->MovPos || player->drop_delay > 0)
@@ -10890,12 +10908,14 @@ boolean DropElement(struct PlayerInfo *player)
 #endif
   }
 
-  new_element = Feld[jx][jy];
+  new_element = Feld[jx][jy];          /* element might have changed */
 
   if (IS_CUSTOM_ELEMENT(new_element) && CAN_MOVE(new_element) &&
       element_info[new_element].move_pattern == MV_WHEN_DROPPED)
   {
+#if 0
     int move_stepsize = element_info[new_element].move_stepsize;
+#endif
     int direction, dx, dy, nextx, nexty;
 
     if (element_info[new_element].move_direction_initial == MV_START_AUTOMATIC)
@@ -10928,13 +10948,19 @@ boolean DropElement(struct PlayerInfo *player)
 #endif
     }
 
+#if 0
     player->drop_delay = 2 * TILEX / move_stepsize + 1;
+#endif
   }
 
 #if 0
   player->drop_delay = 8 + 8 + 8;
 #endif
 
+#if 1
+  player->drop_delay = GET_NEW_DROP_DELAY(drop_element);
+#endif
+
 #endif
 
   player->is_dropping = TRUE;
index 2ed487072ace5f740f9f8167b50da7bd19a4afc4..682f9247774e054e111439d9f17556845f1015b1 100644 (file)
 #define IS_GROUP_ELEMENT(e)    ((e) >= EL_GROUP_START &&               \
                                 (e) <= EL_GROUP_END)
 
+#define IS_CLIPBOARD_ELEMENT(e)        ((e) >= EL_INTERNAL_CLIPBOARD_START &&  \
+                                (e) <= EL_INTERNAL_CLIPBOARD_END)
+
 #define IS_INTERNAL_ELEMENT(e) ((e) >= EL_INTERNAL_START &&            \
                                 (e) <= EL_INTERNAL_END)
 
 #define EL_INTERNAL_CLIPBOARD_GROUP            (EL_FIRST_INTERNAL + 2)
 #define EL_INTERNAL_DUMMY                      (EL_FIRST_INTERNAL + 3)
 
+#define EL_INTERNAL_CLIPBOARD_START            (EL_FIRST_INTERNAL + 0)
+#define EL_INTERNAL_CLIPBOARD_END              (EL_FIRST_INTERNAL + 2)
 #define EL_INTERNAL_START                      (EL_FIRST_INTERNAL + 0)
 #define EL_INTERNAL_END                                (EL_FIRST_INTERNAL + 3)
 
@@ -1635,10 +1640,12 @@ struct ElementInfo
   int collect_score;           /* score value for collecting */
   int collect_count;           /* count value for collecting */
 
-  int push_delay_fixed;                /* constant frame delay for pushing */
-  int push_delay_random;       /* additional random frame delay for pushing */
-  int move_delay_fixed;                /* constant frame delay for moving */
-  int move_delay_random;       /* additional random frame delay for moving */
+  int push_delay_fixed;                /* constant delay before pushing */
+  int push_delay_random;       /* additional random delay before pushing */
+  int drop_delay_fixed;                /* constant delay after dropping */
+  int drop_delay_random;       /* additional random delay after dropping */
+  int move_delay_fixed;                /* constant delay after moving */
+  int move_delay_random;       /* additional random delay after moving */
 
   int move_pattern;            /* direction movable element moves to */
   int move_direction_initial;  /* initial direction element moves to */