rnd-20060518-1-src
authorHolger Schemel <info@artsoft.org>
Wed, 17 May 2006 22:23:00 +0000 (00:23 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:51:52 +0000 (10:51 +0200)
* changed gravity (which only affects the player) from level property
  to player property (only makes a difference in multi-player levels)
* added change events "change when CE value/score changes"
* added change events "change when CE value/score changes of <element>"
* added new "INFO" chunk to level file format for global level settings
* added all element settings from "HEAD" chunk to "CONF" chunk
* added all global level settings from "HEAD" chunk to "INFO" chunk

ChangeLog
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/game.h
src/libgame/misc.c
src/libgame/system.h
src/libgame/toons.c
src/main.h

index e9494daf10fe0015950986486e7c59871dffbe2e..d83a392d96bd68c14a13fbce8b0c395664a1bb04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-05-17
+       * changed gravity (which only affects the player) from level property
+         to player property (only makes a difference in multi-player levels)
+       * added change events "change when CE value/score changes"
+       * added change events "change when CE value/score changes of <element>"
+
+2006-05-16
+       * added new "INFO" chunk to level file format for global level settings
+       * added all element settings from "HEAD" chunk to "CONF" chunk
+       * added all global level settings from "HEAD" chunk to "INFO" chunk
+
 2006-05-09
        * changed level file format by adding two new chunks "CUSX" (for custom
          elements, replacing the previous "CUS4" chunk) and "GRPX" (for group
@@ -12,6 +23,7 @@
          with "CUS1" to "CUS4"); this whole problem now does not exist anymore
 
 2006-05-06
+       * added credits pages to the "credits" section that were really missing
        * added some missing element descriptions to the level editor
        * added down position of switchgate switch to the level editor
          and allowed the use of both switch positions at the same time
index d69483c098d1f23aa00f9ef73a1ced1fc1c36cd0..3d62a1e592eda52b3c8621c5f89bcef2cd8106cf 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-05-17 01:49]"
+#define COMPILE_DATE_STRING "[2006-05-18 00:16]"
index 269f21dcc5d82cb1fcf6fb2250f86528028e8eff..c2ffbcd3dd71397dbb9cbfc4da8edceae1df6556 100644 (file)
 #define GADGET_ID_RANDOM_PERCENTAGE    (GADGET_ID_CHECKBUTTON_FIRST + 0)
 #define GADGET_ID_RANDOM_QUANTITY      (GADGET_ID_CHECKBUTTON_FIRST + 1)
 #define GADGET_ID_RANDOM_RESTRICTED    (GADGET_ID_CHECKBUTTON_FIRST + 2)
-#define GADGET_ID_INITIAL_GRAVITY      (GADGET_ID_CHECKBUTTON_FIRST + 3)
-#define GADGET_ID_STICK_ELEMENT                (GADGET_ID_CHECKBUTTON_FIRST + 4)
-#define GADGET_ID_EM_SLIPPERY_GEMS     (GADGET_ID_CHECKBUTTON_FIRST + 5)
-#define GADGET_ID_USE_SPRING_BUG       (GADGET_ID_CHECKBUTTON_FIRST + 6)
-#define GADGET_ID_USE_TIME_ORB_BUG     (GADGET_ID_CHECKBUTTON_FIRST + 7)
-#define GADGET_ID_RANDOM_BALL_CONTENT  (GADGET_ID_CHECKBUTTON_FIRST + 8)
-#define GADGET_ID_INITIAL_BALL_STATE   (GADGET_ID_CHECKBUTTON_FIRST + 9)
-#define GADGET_ID_GROW_INTO_DIGGABLE   (GADGET_ID_CHECKBUTTON_FIRST + 10)
-#define GADGET_ID_CONTINUOUS_SNAPPING  (GADGET_ID_CHECKBUTTON_FIRST + 11)
-#define GADGET_ID_BLOCK_SNAP_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 12)
-#define GADGET_ID_BLOCK_LAST_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 13)
-#define GADGET_ID_SP_BLOCK_LAST_FIELD  (GADGET_ID_CHECKBUTTON_FIRST + 14)
-#define GADGET_ID_INSTANT_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 15)
-#define GADGET_ID_USE_START_ELEMENT    (GADGET_ID_CHECKBUTTON_FIRST + 16)
-#define GADGET_ID_USE_ARTWORK_ELEMENT  (GADGET_ID_CHECKBUTTON_FIRST + 17)
-#define GADGET_ID_USE_EXPLOSION_ELEMENT        (GADGET_ID_CHECKBUTTON_FIRST + 18)
+#define GADGET_ID_STICK_ELEMENT                (GADGET_ID_CHECKBUTTON_FIRST + 3)
+#define GADGET_ID_EM_SLIPPERY_GEMS     (GADGET_ID_CHECKBUTTON_FIRST + 4)
+#define GADGET_ID_USE_SPRING_BUG       (GADGET_ID_CHECKBUTTON_FIRST + 5)
+#define GADGET_ID_USE_TIME_ORB_BUG     (GADGET_ID_CHECKBUTTON_FIRST + 6)
+#define GADGET_ID_RANDOM_BALL_CONTENT  (GADGET_ID_CHECKBUTTON_FIRST + 7)
+#define GADGET_ID_INITIAL_BALL_STATE   (GADGET_ID_CHECKBUTTON_FIRST + 8)
+#define GADGET_ID_GROW_INTO_DIGGABLE   (GADGET_ID_CHECKBUTTON_FIRST + 9)
+#define GADGET_ID_CONTINUOUS_SNAPPING  (GADGET_ID_CHECKBUTTON_FIRST + 10)
+#define GADGET_ID_BLOCK_SNAP_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_BLOCK_LAST_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_SP_BLOCK_LAST_FIELD  (GADGET_ID_CHECKBUTTON_FIRST + 13)
+#define GADGET_ID_INSTANT_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 14)
+#define GADGET_ID_USE_START_ELEMENT    (GADGET_ID_CHECKBUTTON_FIRST + 15)
+#define GADGET_ID_USE_ARTWORK_ELEMENT  (GADGET_ID_CHECKBUTTON_FIRST + 16)
+#define GADGET_ID_USE_EXPLOSION_ELEMENT        (GADGET_ID_CHECKBUTTON_FIRST + 17)
+#define GADGET_ID_INITIAL_GRAVITY      (GADGET_ID_CHECKBUTTON_FIRST + 18)
 #define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 19)
 #define GADGET_ID_CAN_FALL_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 20)
 #define GADGET_ID_CAN_MOVE_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 21)
 #define ED_GRAPHICBUTTON_ID_CHANGE_LAST   ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE
 
 /* values for checkbutton gadgets */
-#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY      0
-#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED    1
-#define ED_CHECKBUTTON_ID_STICK_ELEMENT                2
-#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS     3
-#define ED_CHECKBUTTON_ID_USE_SPRING_BUG       4
-#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG     5
-#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT  6
-#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE   7
-#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE   8
-#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING  9
-#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD     10
-#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD     11
-#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD  12
-#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION   13
-#define ED_CHECKBUTTON_ID_USE_START_ELEMENT    14
-#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT  15
-#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT        16
+#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED    0
+#define ED_CHECKBUTTON_ID_STICK_ELEMENT                1
+#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS     2
+#define ED_CHECKBUTTON_ID_USE_SPRING_BUG       3
+#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG     4
+#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT  5
+#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE   6
+#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE   7
+#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING  8
+#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD     9
+#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD     10
+#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD  11
+#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION   12
+#define ED_CHECKBUTTON_ID_USE_START_ELEMENT    13
+#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT  14
+#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT        15
+#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY      16
 #define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 17
 #define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID   18
 #define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID   19
 
 #define ED_NUM_CHECKBUTTONS                    46
 
-#define ED_CHECKBUTTON_ID_LEVEL_FIRST  ED_CHECKBUTTON_ID_INITIAL_GRAVITY
+#define ED_CHECKBUTTON_ID_LEVEL_FIRST  ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
 #define ED_CHECKBUTTON_ID_LEVEL_LAST   ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
 
 #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST        ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC
@@ -1549,6 +1549,8 @@ static struct ValueTextInfo options_change_direct_action[] =
 #endif
   { CE_IMPACT,                 "impact (on something)"         },
   { CE_SMASHED,                        "smashed (from above)"          },
+  { CE_VALUE_CHANGES,          "CE value changes"              },
+  { CE_SCORE_CHANGES,          "CE score changes"              },
   { CE_VALUE_GETS_ZERO,                "CE value gets 0"               },
   { CE_SCORE_GETS_ZERO,                "CE score gets 0"               },
 
@@ -1576,6 +1578,8 @@ static struct ValueTextInfo options_change_other_action[] =
   { CE_EXPLOSION_OF_X,         "explosion of"                  },
   { CE_MOVE_OF_X,              "move of"                       },
   { CE_CREATION_OF_X,          "creation of"                   },
+  { CE_VALUE_CHANGES_OF_X,     "CE value changes of"           },
+  { CE_SCORE_CHANGES_OF_X,     "CE score changes of"           },
   { CE_VALUE_GETS_ZERO_OF_X,   "CE value gets 0 of"            },
   { CE_SCORE_GETS_ZERO_OF_X,   "CE score gets 0 of"            },
 
@@ -1667,7 +1671,6 @@ static struct ValueTextInfo options_action_type[] =
   { CA_SET_LEVEL_TIME,         "set time"                      },
   { CA_SET_LEVEL_SCORE,                "set score"                     },
   { CA_SET_LEVEL_GEMS,         "set needed gems"               },
-  { CA_SET_LEVEL_GRAVITY,      "set gravity"                   },
   { CA_SET_LEVEL_WIND,         "set wind dir."                 },
   { CA_UNDEFINED,              " "                             },
   { CA_HEADLINE_PLAYER_ACTIONS,        "[player actions]"              },
@@ -1677,11 +1680,12 @@ static struct ValueTextInfo options_action_type[] =
   { CA_SET_PLAYER_KEYS,                "set keys"                      },
   { CA_SET_PLAYER_SPEED,       "set speed"                     },
   { CA_SET_PLAYER_SHIELD,      "set shield"                    },
+  { CA_SET_PLAYER_GRAVITY,     "set gravity"                   },
   { CA_SET_PLAYER_ARTWORK,     "set artwork"                   },
   { CA_UNDEFINED,              " "                             },
   { CA_HEADLINE_CE_ACTIONS,    "[CE actions]"                  },
-  { CA_SET_CE_SCORE,           "set CE score"                  },
   { CA_SET_CE_VALUE,           "set CE value"                  },
+  { CA_SET_CE_SCORE,           "set CE score"                  },
   { CA_UNDEFINED,              " "                             },
   { CA_HEADLINE_ENGINE_ACTIONS,        "[engine actions]"              },
   { CA_SET_ENGINE_SCAN_MODE,   "set scan mode"                 },
@@ -1761,9 +1765,9 @@ static struct ValueTextInfo options_action_arg_number[] =
   { CA_ARG_UNDEFINED,          " "                             },
   { CA_ARG_NUMBER_RESET,       "reset"                         },
   { CA_ARG_UNDEFINED,          " "                             },
-  { CA_ARG_NUMBER_CE_DELAY,    "CE delay"                      },
-  { CA_ARG_NUMBER_CE_SCORE,    "CE score"                      },
   { CA_ARG_NUMBER_CE_VALUE,    "CE value"                      },
+  { CA_ARG_NUMBER_CE_SCORE,    "CE score"                      },
+  { CA_ARG_NUMBER_CE_DELAY,    "CE delay"                      },
   { CA_ARG_UNDEFINED,          " "                             },
   { CA_ARG_NUMBER_LEVEL_TIME,  "time"                          },
   { CA_ARG_NUMBER_LEVEL_GEMS,  "gems"                          },
@@ -1798,9 +1802,9 @@ static struct ValueTextInfo options_action_arg_value[] =
   { CA_ARG_UNDEFINED,          " "                             },
   { CA_ARG_NUMBER_RESET,       "reset"                         },
   { CA_ARG_UNDEFINED,          " "                             },
-  { CA_ARG_NUMBER_CE_DELAY,    "CE delay"                      },
-  { CA_ARG_NUMBER_CE_SCORE,    "CE score"                      },
   { CA_ARG_NUMBER_CE_VALUE,    "CE value"                      },
+  { CA_ARG_NUMBER_CE_SCORE,    "CE score"                      },
+  { CA_ARG_NUMBER_CE_DELAY,    "CE delay"                      },
   { CA_ARG_UNDEFINED,          " "                             },
   { CA_ARG_NUMBER_LEVEL_TIME,  "time"                          },
   { CA_ARG_NUMBER_LEVEL_GEMS,  "gems"                          },
@@ -1970,14 +1974,14 @@ action_arg_options[] =
   { CA_SET_LEVEL_TIME,         3,      options_action_arg_number,      },
   { CA_SET_LEVEL_GEMS,         3,      options_action_arg_number,      },
   { CA_SET_LEVEL_SCORE,                3,      options_action_arg_number,      },
-  { CA_SET_LEVEL_GRAVITY,      1,      options_action_arg_gravity,     },
   { CA_SET_LEVEL_WIND,         1,      options_action_arg_direction,   },
   { CA_SET_PLAYER_KEYS,                2,      options_action_arg_key,         },
   { CA_SET_PLAYER_SPEED,       1,      options_action_arg_speed,       },
   { CA_SET_PLAYER_SHIELD,      1,      options_action_arg_shield,      },
+  { CA_SET_PLAYER_GRAVITY,     1,      options_action_arg_gravity,     },
   { CA_SET_PLAYER_ARTWORK,     1,      options_action_arg_artwork,     },
-  { CA_SET_CE_SCORE,           3,      options_action_arg_value,       },
   { CA_SET_CE_VALUE,           3,      options_action_arg_value,       },
+  { CA_SET_CE_SCORE,           3,      options_action_arg_value,       },
   { CA_SET_ENGINE_SCAN_MODE,   1,      options_action_arg_scan_mode,   },
 
   { -1,                                FALSE,  NULL                            }
@@ -2465,13 +2469,6 @@ static struct
 {
   /* ---------- level and editor settings ---------------------------------- */
 
-  {
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(11),
-    GADGET_ID_INITIAL_GRAVITY,         GADGET_ID_NONE,
-    &level.initial_gravity,
-    NULL,
-    "initial gravity",                 "set initial level gravity"
-  },
   {
     ED_LEVEL_SETTINGS_XPOS(0),         ED_COUNTER2_YPOS(9) - MINI_TILEY,
     GADGET_ID_RANDOM_RESTRICTED,       GADGET_ID_NONE,
@@ -2587,6 +2584,13 @@ static struct
     NULL,
     "use explosion from element:",     "use explosion properties from element"
   },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(11),
+    GADGET_ID_INITIAL_GRAVITY,         GADGET_ID_NONE,
+    &level.initial_player_gravity[0],
+    NULL,
+    "use initial gravity",             "set initial player gravity"
+  },
   {
     ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(4),
     GADGET_ID_CAN_PASS_TO_WALKABLE,    GADGET_ID_NONE,
@@ -2999,7 +3003,7 @@ static struct
   /* ---------- custom change content (extended change target) ------------- */
 
   {
-    -1,                                        ED_AREA_3X3_SETTINGS_YPOS(10),
+    -1,                                        ED_AREA_3X3_SETTINGS_YPOS(9),
     GADGET_ID_CUSTOM_CHANGE_CONTENT,   GADGET_ID_NONE, /* align three rows */
     &custom_element_change.target_content.e[0][0], 3, 3,
     NULL, NULL, NULL,                  "new extended elements after change"
@@ -6726,6 +6730,8 @@ static void CopyCustomElementPropertiesToEditor(int element)
      HAS_CHANGE_EVENT(element, CE_BLOCKED) ? CE_BLOCKED :
      HAS_CHANGE_EVENT(element, CE_IMPACT) ? CE_IMPACT :
      HAS_CHANGE_EVENT(element, CE_SMASHED) ? CE_SMASHED :
+     HAS_CHANGE_EVENT(element, CE_VALUE_CHANGES) ? CE_VALUE_CHANGES :
+     HAS_CHANGE_EVENT(element, CE_SCORE_CHANGES) ? CE_SCORE_CHANGES :
      HAS_CHANGE_EVENT(element, CE_VALUE_GETS_ZERO) ? CE_VALUE_GETS_ZERO :
      HAS_CHANGE_EVENT(element, CE_SCORE_GETS_ZERO) ? CE_SCORE_GETS_ZERO :
      custom_element_change.direct_action);
@@ -6751,6 +6757,8 @@ static void CopyCustomElementPropertiesToEditor(int element)
      HAS_CHANGE_EVENT(element, CE_EXPLOSION_OF_X) ? CE_EXPLOSION_OF_X :
      HAS_CHANGE_EVENT(element, CE_MOVE_OF_X) ? CE_MOVE_OF_X :
      HAS_CHANGE_EVENT(element, CE_CREATION_OF_X) ? CE_CREATION_OF_X :
+     HAS_CHANGE_EVENT(element, CE_VALUE_CHANGES_OF_X) ? CE_VALUE_CHANGES_OF_X :
+     HAS_CHANGE_EVENT(element, CE_SCORE_CHANGES_OF_X) ? CE_SCORE_CHANGES_OF_X :
      HAS_CHANGE_EVENT(element, CE_VALUE_GETS_ZERO_OF_X) ? CE_VALUE_GETS_ZERO_OF_X :
      HAS_CHANGE_EVENT(element, CE_SCORE_GETS_ZERO_OF_X) ? CE_SCORE_GETS_ZERO_OF_X :
      custom_element_change.other_action);
@@ -6869,6 +6877,8 @@ static void CopyCustomElementPropertiesToGame(int element)
   custom_element_change_events[CE_BLOCKED] = FALSE;
   custom_element_change_events[CE_IMPACT] = FALSE;
   custom_element_change_events[CE_SMASHED] = FALSE;
+  custom_element_change_events[CE_VALUE_CHANGES] = FALSE;
+  custom_element_change_events[CE_SCORE_CHANGES] = FALSE;
   custom_element_change_events[CE_VALUE_GETS_ZERO] = FALSE;
   custom_element_change_events[CE_SCORE_GETS_ZERO] = FALSE;
   custom_element_change_events[custom_element_change.direct_action] =
@@ -6894,6 +6904,8 @@ static void CopyCustomElementPropertiesToGame(int element)
   custom_element_change_events[CE_EXPLOSION_OF_X] = FALSE;
   custom_element_change_events[CE_MOVE_OF_X] = FALSE;
   custom_element_change_events[CE_CREATION_OF_X] = FALSE;
+  custom_element_change_events[CE_VALUE_CHANGES_OF_X] = FALSE;
+  custom_element_change_events[CE_SCORE_CHANGES_OF_X] = FALSE;
   custom_element_change_events[CE_VALUE_GETS_ZERO_OF_X] = FALSE;
   custom_element_change_events[CE_SCORE_GETS_ZERO_OF_X] = FALSE;
   custom_element_change_events[custom_element_change.other_action] =
@@ -7949,6 +7961,8 @@ static void DrawPropertiesConfig()
       &level.use_artwork_element[player_nr];
     checkbutton_info[ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT].value =
       &level.use_explosion_element[player_nr];
+    checkbutton_info[ED_CHECKBUTTON_ID_INITIAL_GRAVITY].value =
+      &level.initial_player_gravity[player_nr];
 
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID);
     MapCheckbuttonGadget(properties_element == EL_SP_MURPHY ?
@@ -7960,6 +7974,7 @@ static void DrawPropertiesConfig()
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_START_ELEMENT);
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT);
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT);
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_GRAVITY);
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE);
 
     MapDrawingArea(ED_DRAWING_ID_START_ELEMENT);
index 19c6bd9af48d3cd35b5d375d64028bd9b874b822..e96f86364e3345f5863bd9d4889bb94a0f939b14 100644 (file)
@@ -211,6 +211,11 @@ static struct LevelFileConfigInfo chunk_config_CONF[] =
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(5),
     &li.can_pass_to_walkable,          FALSE
   },
+  {
+    EL_PLAYER_1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(6),
+    &li.initial_player_gravity[0],     FALSE
+  },
   {
     EL_PLAYER_1,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(9),
@@ -252,6 +257,11 @@ static struct LevelFileConfigInfo chunk_config_CONF[] =
     &li.continuous_snapping,           TRUE
   },
 
+  {
+    EL_PLAYER_2,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(6),
+    &li.initial_player_gravity[1],     FALSE
+  },
   {
     EL_PLAYER_2,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(10),
@@ -283,6 +293,11 @@ static struct LevelFileConfigInfo chunk_config_CONF[] =
     &li.explosion_element[1],          EL_PLAYER_2
   },
 
+  {
+    EL_PLAYER_3,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(6),
+    &li.initial_player_gravity[2],     FALSE
+  },
   {
     EL_PLAYER_3,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(10),
@@ -314,6 +329,11 @@ static struct LevelFileConfigInfo chunk_config_CONF[] =
     &li.explosion_element[2],          EL_PLAYER_3
   },
 
+  {
+    EL_PLAYER_4,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(6),
+    &li.initial_player_gravity[3],     FALSE
+  },
   {
     EL_PLAYER_4,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(10),
@@ -560,12 +580,6 @@ static struct LevelFileConfigInfo chunk_config_CONF[] =
     &li.use_spring_bug,                        FALSE
   },
 
-  {
-    EL_BALLOON,
-    TYPE_BITFIELD,                     CONF_VALUE_8_BIT(1),
-    &li.wind_direction_initial,                MV_NONE
-  },
-
   {
     EL_EMC_ANDROID,
     TYPE_INTEGER,                      CONF_VALUE_16_BIT(1),
@@ -694,13 +708,19 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
 
   {
     -1,
-    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(4),
-    &li.em_slippery_gems,              FALSE
+    TYPE_BITFIELD,                     CONF_VALUE_8_BIT(4),
+    &li.wind_direction_initial,                MV_NONE
   },
 
   {
     -1,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(5),
+    &li.em_slippery_gems,              FALSE
+  },
+
+  {
+    -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(6),
     &li.use_custom_template,           FALSE
   },
 
@@ -712,7 +732,7 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
 
   {
     -1,
-    TYPE_BITFIELD,                     CONF_VALUE_8_BIT(6),
+    TYPE_BITFIELD,                     CONF_VALUE_8_BIT(7),
     &li.dont_collide_with_bits,                ~0      /* default: always deadly */
   },
 
@@ -4954,6 +4974,7 @@ static void SaveLevel_AUTH(FILE *file, struct LevelInfo *level)
     putFile8Bit(file, level->author[i]);
 }
 
+#if 0
 static void SaveLevel_TITL(FILE *file, struct LevelInfo *level)
 {
   int i;
@@ -4961,6 +4982,7 @@ static void SaveLevel_TITL(FILE *file, struct LevelInfo *level)
   for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
     putFile8Bit(file, level->name[i]);
 }
+#endif
 
 static void SaveLevel_BODY(FILE *file, struct LevelInfo *level)
 {
@@ -4994,6 +5016,7 @@ static void SaveLevel_CONT(FILE *file, struct LevelInfo *level)
 }
 #endif
 
+#if 0
 static void SaveLevel_CNT2(FILE *file, struct LevelInfo *level, int element)
 {
   int i, x, y;
@@ -5044,6 +5067,7 @@ static void SaveLevel_CNT2(FILE *file, struct LevelInfo *level, int element)
       for (x = 0; x < 3; x++)
        putFile16BitBE(file, content_array[i][x][y]);
 }
+#endif
 
 static void SaveLevel_CNT3(FILE *file, struct LevelInfo *level, int element)
 {
@@ -5868,7 +5892,7 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename)
       /* check if non-default element settings need to be saved */
       if (cusx_chunk_size > cusx_chunk_size_no_changes)
       {
-#if 1
+#if 0
        printf("::: SAVING CE %d\n", i + 1);
 #endif
 
@@ -5885,7 +5909,7 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename)
       /* check if non-default element settings need to be saved */
       if (grpx_chunk_size > grpx_chunk_size_no_changes)
       {
-#if 1
+#if 0
        printf("::: SAVING GE %d\n", i + 1);
 #endif
 
index 4f06b38e67c4ded3e2563c1b9fa3155e76102d56..769cde25f8c20ec18ca56e289678368d32994b4d 100644 (file)
@@ -43,6 +43,7 @@
 #define USE_NEW_CONTINUOUS_SNAPPING    (USE_NEW_STUFF          * 1)
 #define USE_GFX_RESET_GFX_ANIMATION    (USE_NEW_STUFF          * 1)
 #define USE_BOTH_SWITCHGATE_SWITCHES   (USE_NEW_STUFF          * 1)
+#define USE_PLAYER_GRAVITY             (USE_NEW_STUFF          * 1)
 
 #define USE_QUICKSAND_IMPACT_BUGFIX    (USE_NEW_STUFF          * 0)
 
@@ -1964,6 +1965,8 @@ void InitGame()
     player->block_last_field = FALSE;  /* initialized in InitPlayerField() */
     player->block_delay_adjustment = 0;        /* initialized in InitPlayerField() */
 
+    player->gravity = level.initial_player_gravity[i];
+
     player->can_fall_into_acid = CAN_MOVE_INTO_ACID(player->element_nr);
 
     player->actual_frame_counter = 0;
@@ -3038,6 +3041,8 @@ static void ResetGfxFrame(int x, int y, boolean redraw)
     GfxFrame[x][y] = CustomValue[x][y];
   else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
     GfxFrame[x][y] = element_info[element].collect_score;
+  else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+    GfxFrame[x][y] = ChangeDelay[x][y];
 
   if (redraw && GfxFrame[x][y] != last_gfx_frame)
     DrawLevelGraphicAnimation(x, y, graphic);
@@ -3064,6 +3069,8 @@ static void ResetGfxAnimation(int x, int y)
     GfxFrame[x][y] = CustomValue[x][y];
   else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
     GfxFrame[x][y] = element_info[element].collect_score;
+  else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+    GfxFrame[x][y] = ChangeDelay[x][y];
 #endif
 
 #if USE_GFX_RESET_GFX_ANIMATION
@@ -3104,6 +3111,8 @@ void InitMovingField(int x, int y, int direction)
     GfxFrame[x][y] = CustomValue[x][y];
   else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
     GfxFrame[x][y] = element_info[element].collect_score;
+  else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+    GfxFrame[x][y] = ChangeDelay[x][y];
 #endif
 
   /* this is needed for CEs with property "can move" / "not moving" */
@@ -5772,6 +5781,8 @@ static void TurnRound(int x, int y)
     GfxFrame[x][y] = CustomValue[x][y];
   else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
     GfxFrame[x][y] = element_info[element].collect_score;
+  else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+    GfxFrame[x][y] = ChangeDelay[x][y];
 #endif
 }
 
@@ -8117,6 +8128,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       break;
     }
 
+#if !USE_PLAYER_GRAVITY
     case CA_SET_LEVEL_GRAVITY:
     {
       game.gravity = (action_arg == CA_ARG_GRAVITY_OFF    ? FALSE         :
@@ -8125,6 +8137,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
                      game.gravity);
       break;
     }
+#endif
 
     case CA_SET_LEVEL_WIND:
     {
@@ -8263,6 +8276,25 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       break;
     }
 
+#if USE_PLAYER_GRAVITY
+    case CA_SET_PLAYER_GRAVITY:
+    {
+      for (i = 0; i < MAX_PLAYERS; i++)
+      {
+       if (trigger_player_bits & (1 << i))
+       {
+         stored_player[i].gravity =
+           (action_arg == CA_ARG_GRAVITY_OFF    ? FALSE                     :
+            action_arg == CA_ARG_GRAVITY_ON     ? TRUE                      :
+            action_arg == CA_ARG_GRAVITY_TOGGLE ? !stored_player[i].gravity :
+            stored_player[i].gravity);
+       }
+      }
+
+      break;
+    }
+#endif
+
     case CA_SET_PLAYER_ARTWORK:
     {
       for (i = 0; i < MAX_PLAYERS; i++)
@@ -8306,19 +8338,26 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       printf("::: CE value == %d\n", CustomValue[x][y]);
 #endif
 
-      if (CustomValue[x][y] == 0 && last_ce_value > 0)
+      if (CustomValue[x][y] != last_ce_value)
       {
+       CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_CHANGES);
+       CheckTriggeredElementChange(x, y, element, CE_VALUE_CHANGES_OF_X);
+
+       if (CustomValue[x][y] == 0)
+       {
 #if 0
-       printf("::: CE_VALUE_GETS_ZERO\n");
+         printf("::: CE_VALUE_GETS_ZERO\n");
 #endif
 
-       CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_GETS_ZERO);
-       CheckTriggeredElementChange(x, y, element, CE_VALUE_GETS_ZERO_OF_X);
+         CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_GETS_ZERO);
+         CheckTriggeredElementChange(x, y, element, CE_VALUE_GETS_ZERO_OF_X);
 
 #if 0
-       printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
+         printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
 #endif
+       }
       }
+
 #endif
 
       break;
@@ -8335,19 +8374,26 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       printf("::: CE score == %d\n", ei->collect_score);
 #endif
 
-      if (ei->collect_score == 0 && last_ce_score > 0)
+      if (ei->collect_score != last_ce_score)
       {
+       CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_CHANGES);
+       CheckTriggeredElementChange(x, y, element, CE_SCORE_CHANGES_OF_X);
+
+       if (ei->collect_score == 0)
+       {
 #if 0
-       printf("::: CE_SCORE_GETS_ZERO\n");
+         printf("::: CE_SCORE_GETS_ZERO\n");
 #endif
 
-       CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO);
-       CheckTriggeredElementChange(x, y, element, CE_SCORE_GETS_ZERO_OF_X);
+         CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO);
+         CheckTriggeredElementChange(x, y, element, CE_SCORE_GETS_ZERO_OF_X);
 
 #if 0
-       printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
+         printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]);
 #endif
+       }
       }
+
 #endif
 
       break;
@@ -9816,6 +9862,17 @@ void GameActions_RND()
 
       GfxFrame[x][y] = element_info[element].collect_score;
 
+#if 1
+      if (GfxFrame[x][y] != old_gfx_frame)
+#endif
+       DrawLevelGraphicAnimation(x, y, graphic);
+    }
+    else if (ANIM_MODE(graphic) == ANIM_CE_DELAY)
+    {
+      int old_gfx_frame = GfxFrame[x][y];
+
+      GfxFrame[x][y] = ChangeDelay[x][y];
+
 #if 1
       if (GfxFrame[x][y] != old_gfx_frame)
 #endif
@@ -10268,7 +10325,11 @@ static boolean canMoveToValidFieldWithGravity(int x, int y, int move_dir)
 
 static void CheckGravityMovement(struct PlayerInfo *player)
 {
+#if USE_PLAYER_GRAVITY
+  if (player->gravity && !player->programmed_action)
+#else
   if (game.gravity && !player->programmed_action)
+#endif
   {
     int move_dir_horizontal = player->effective_action & MV_HORIZONTAL;
     int move_dir_vertical   = player->effective_action & MV_VERTICAL;
@@ -10290,7 +10351,11 @@ static void CheckGravityMovementWhenNotMoving(struct PlayerInfo *player)
 {
   return CheckGravityMovement(player);
 
+#if USE_PLAYER_GRAVITY
+  if (player->gravity && !player->programmed_action)
+#else
   if (game.gravity && !player->programmed_action)
+#endif
   {
     int jx = player->jx, jy = player->jy;
     boolean field_under_player_is_free =
@@ -10673,8 +10738,13 @@ void ScrollPlayer(struct PlayerInfo *player, int mode)
        last_field_block_delay += player->move_delay_value;
 
        /* when blocking enabled, prevent moving up despite gravity */
+#if USE_PLAYER_GRAVITY
+       if (player->gravity && player->MovDir == MV_UP)
+         block_delay_adjustment = -1;
+#else
        if (game.gravity && player->MovDir == MV_UP)
          block_delay_adjustment = -1;
+#endif
       }
 
       /* add block delay adjustment (also possible when not blocking) */
@@ -11702,10 +11772,17 @@ int DigField(struct PlayerInfo *player,
     return MP_NO_ACTION;
   }
 
+#if USE_PLAYER_GRAVITY
+  if (player->gravity && is_player && !player->is_auto_moving &&
+      canFallDown(player) && move_direction != MV_DOWN &&
+      !canMoveToValidFieldWithGravity(jx, jy, move_direction))
+    return MP_NO_ACTION;       /* player cannot walk here due to gravity */
+#else
   if (game.gravity && is_player && !player->is_auto_moving &&
       canFallDown(player) && move_direction != MV_DOWN &&
       !canMoveToValidFieldWithGravity(jx, jy, move_direction))
     return MP_NO_ACTION;       /* player cannot walk here due to gravity */
+#endif
 
   if (player_can_move &&
       IS_WALKABLE(element) && ACCESS_FROM(element, opposite_direction))
@@ -11775,17 +11852,29 @@ int DigField(struct PlayerInfo *player,
          element == EL_SP_GRAVITY_PORT_RIGHT ||
          element == EL_SP_GRAVITY_PORT_UP ||
          element == EL_SP_GRAVITY_PORT_DOWN)
+#if USE_PLAYER_GRAVITY
+       player->gravity = !player->gravity;
+#else
        game.gravity = !game.gravity;
+#endif
       else if (element == EL_SP_GRAVITY_ON_PORT_LEFT ||
               element == EL_SP_GRAVITY_ON_PORT_RIGHT ||
               element == EL_SP_GRAVITY_ON_PORT_UP ||
               element == EL_SP_GRAVITY_ON_PORT_DOWN)
+#if USE_PLAYER_GRAVITY
+       player->gravity = TRUE;
+#else
        game.gravity = TRUE;
+#endif
       else if (element == EL_SP_GRAVITY_OFF_PORT_LEFT ||
               element == EL_SP_GRAVITY_OFF_PORT_RIGHT ||
               element == EL_SP_GRAVITY_OFF_PORT_UP ||
               element == EL_SP_GRAVITY_OFF_PORT_DOWN)
+#if USE_PLAYER_GRAVITY
+       player->gravity = FALSE;
+#else
        game.gravity = FALSE;
+#endif
     }
 
     /* automatically move to the next field with double speed */
index dadb6735f86859b5aaa45d834090444c74254c80..d46982d7f33c6f9219ebbd90d0be7c244e1b7617 100644 (file)
@@ -109,6 +109,8 @@ struct PlayerInfo
 
   boolean can_fall_into_acid;
 
+  boolean gravity;
+
   boolean LevelSolved, GameOver;
 
   int last_move_dir;
index 2cf6bd84e8b7a8f7b335a0f76e238ce4e223dabb..10996510b7f8c29a4b4b22520558cf4ceab86b86 100644 (file)
@@ -1779,6 +1779,7 @@ int get_parameter_value(char *value_raw, char *suffix, int type)
              string_has_parameter(value, "random")     ? ANIM_RANDOM :
              string_has_parameter(value, "ce_value")   ? ANIM_CE_VALUE :
              string_has_parameter(value, "ce_score")   ? ANIM_CE_SCORE :
+             string_has_parameter(value, "ce_delay")   ? ANIM_CE_DELAY :
              string_has_parameter(value, "horizontal") ? ANIM_HORIZONTAL :
              string_has_parameter(value, "vertical")   ? ANIM_VERTICAL :
              ANIM_DEFAULT);
index 21068dbc417c8a3b2c47fdc94db895e337593957..ac10e75c3c94948b85450be4a224ecb8eecd100a 100644 (file)
 #define ANIM_RANDOM            (1 << 4)
 #define ANIM_CE_VALUE          (1 << 5)
 #define ANIM_CE_SCORE          (1 << 6)
-#define ANIM_REVERSE           (1 << 7)
-#define ANIM_OPAQUE_PLAYER     (1 << 8)
+#define ANIM_CE_DELAY          (1 << 7)
+#define ANIM_REVERSE           (1 << 8)
+#define ANIM_OPAQUE_PLAYER     (1 << 9)
 
 /* values for special (non game element) animation modes */
-#define ANIM_HORIZONTAL                (1 << 9)
-#define ANIM_VERTICAL          (1 << 10)
-#define ANIM_STATIC_PANEL      (1 << 11)
+#define ANIM_HORIZONTAL                (1 << 10)
+#define ANIM_VERTICAL          (1 << 11)
+#define ANIM_STATIC_PANEL      (1 << 12)
 
 #define ANIM_DEFAULT           ANIM_LOOP
 
index 2eb805bd7c2a8a3c00dad8a5d804fc8d9ec8e36b..855e54f74192ce194174007d061c10afba9f79e9 100644 (file)
@@ -69,7 +69,7 @@ int getAnimationFrame(int num_frames, int delay, int mode, int start_frame,
     else
       frame = gfx.anim_random_frame % num_frames;
   }
-  else if (mode & (ANIM_CE_VALUE | ANIM_CE_SCORE))
+  else if (mode & (ANIM_CE_VALUE | ANIM_CE_SCORE | ANIM_CE_DELAY))
   {
     frame = sync_frame % num_frames;
   }
index 3f14bd078a22984c3bb4b8f76987c83a6a141785..5d1d97c2a39ebce8db2023396c42cc439cbe2f5a 100644 (file)
 #define CE_CREATION_OF_X               37
 #define CE_SCORE_GETS_ZERO             38
 #define CE_SCORE_GETS_ZERO_OF_X                39
+#define CE_VALUE_CHANGES               40
+#define CE_VALUE_CHANGES_OF_X          41
+#define CE_SCORE_CHANGES               42
+#define CE_SCORE_CHANGES_OF_X          43
 
-#define NUM_CHANGE_EVENTS              40
+#define NUM_CHANGE_EVENTS              44
 
 #define NUM_CE_BITFIELDS               ((NUM_CHANGE_EVENTS + 31) / 32)
 
 #define CA_SET_LEVEL_GEMS              7
 #define CA_SET_LEVEL_SCORE             8
 #define CA_SET_LEVEL_WIND              9
-#define CA_SET_LEVEL_GRAVITY           10
+#define CA_SET_PLAYER_GRAVITY          10
 #define CA_SET_PLAYER_KEYS             11
 #define CA_SET_PLAYER_SPEED            12
 #define CA_SET_PLAYER_SHIELD           13
@@ -1915,6 +1919,8 @@ struct LevelInfo
   int initial_player_stepsize; /* initial player speed */
 
   boolean initial_gravity;
+  boolean initial_player_gravity[MAX_PLAYERS];
+
   boolean em_slippery_gems;    /* EM style "gems slip from wall" behaviour */
   boolean use_spring_bug;      /* for compatibility with old levels */
   boolean use_time_orb_bug;    /* for compatibility with old levels */