added "effects" game elements for native BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Sat, 23 Mar 2024 13:43:55 +0000 (14:43 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 23 Mar 2024 13:43:55 +0000 (14:43 +0100)
src/editor.c
src/files.c
src/init.c
src/libgame/system.h
src/main.c
src/main.h

index fd5d546370bbbd76fd2fd30b70ff2bcc8fc7683f..721f4afe78e8e660381d31edddf6c5801051bdae 100644 (file)
@@ -4924,6 +4924,141 @@ static int *editor_el_boulderdash_native_ptr = editor_el_boulderdash_native;
 static int num_editor_hl_boulderdash_native = ARRAY_SIZE(editor_hl_boulderdash_native);
 static int num_editor_el_boulderdash_native = ARRAY_SIZE(editor_el_boulderdash_native);
 
+static int editor_hl_boulderdash_effects[] =
+{
+  EL_INTERNAL_CASCADE_BD_EFFECTS_ACTIVE,
+  EL_CHAR('B'),
+  EL_CHAR('D'),
+  EL_CHAR('E'),
+};
+
+static int editor_el_boulderdash_effects[] =
+{
+  EL_BD_DIAMOND_FALLING,
+  EL_BD_ROCK_FALLING,
+  EL_BD_MEGA_ROCK_FALLING,
+  EL_BD_FLYING_DIAMOND_FLYING,
+
+  EL_BD_FLYING_ROCK_FLYING,
+  EL_BD_FALLING_WALL_FALLING,
+  EL_BD_NITRO_PACK_FALLING,
+  EL_BD_NUT_FALLING,
+
+  EL_BD_PLAYER_GROWING_1,
+  EL_BD_PLAYER_GROWING_2,
+  EL_BD_PLAYER_GROWING_3,
+  EL_BD_PLAYER,
+
+  EL_BD_PLAYER_WITH_BOMB,
+  EL_BD_PLAYER_STIRRING,
+  EL_BD_EXIT_OPEN,
+  EL_BD_INVISIBLE_EXIT_OPEN,
+
+  EL_BD_BLADDER_1,
+  EL_BD_BLADDER_2,
+  EL_BD_BLADDER_3,
+  EL_BD_BLADDER_4,
+
+  EL_BD_BLADDER_5,
+  EL_BD_BLADDER_6,
+  EL_BD_BLADDER_7,
+  EL_BD_BLADDER_8,
+
+  EL_BD_SAND_2,
+  EL_BD_COW_ENCLOSED_1,
+  EL_BD_COW_ENCLOSED_2,
+  EL_BD_COW_ENCLOSED_3,
+
+  EL_BD_COW_ENCLOSED_4,
+  EL_BD_COW_ENCLOSED_5,
+  EL_BD_COW_ENCLOSED_6,
+  EL_BD_COW_ENCLOSED_7,
+
+  EL_BD_WATER_1,
+  EL_BD_WATER_2,
+  EL_BD_WATER_3,
+  EL_BD_WATER_4,
+
+  EL_BD_WATER_5,
+  EL_BD_WATER_6,
+  EL_BD_WATER_7,
+  EL_BD_WATER_8,
+
+  EL_BD_WATER_9,
+  EL_BD_WATER_10,
+  EL_BD_WATER_11,
+  EL_BD_WATER_12,
+
+  EL_BD_WATER_13,
+  EL_BD_WATER_14,
+  EL_BD_WATER_15,
+  EL_BD_WATER_16,
+
+  EL_BD_BOMB_TICKING_1,
+  EL_BD_BOMB_TICKING_2,
+  EL_BD_BOMB_TICKING_3,
+  EL_BD_BOMB_TICKING_4,
+
+  EL_BD_BOMB_TICKING_5,
+  EL_BD_BOMB_TICKING_6,
+  EL_BD_BOMB_TICKING_7,
+  EL_EMPTY,
+
+  EL_BD_BOMB_EXPLODING_1,
+  EL_BD_BOMB_EXPLODING_2,
+  EL_BD_BOMB_EXPLODING_3,
+  EL_BD_BOMB_EXPLODING_4,
+
+  EL_BD_NUT_BREAKING_1,
+  EL_BD_NUT_BREAKING_2,
+  EL_BD_NUT_BREAKING_3,
+  EL_BD_NUT_BREAKING_4,
+
+  EL_BD_EXPLODING_1,
+  EL_BD_EXPLODING_2,
+  EL_BD_EXPLODING_3,
+  EL_BD_EXPLODING_4,
+
+  EL_BD_EXPLODING_5,
+  EL_BD_TIME_PENALTY,
+  EL_BD_DIAMOND_GROWING_1,
+  EL_BD_DIAMOND_GROWING_2,
+
+  EL_BD_DIAMOND_GROWING_3,
+  EL_BD_DIAMOND_GROWING_4,
+  EL_BD_DIAMOND_GROWING_5,
+  EL_BD_NITRO_PACK_EXPLODING,
+
+  EL_BD_NITRO_PACK_EXPLODING_1,
+  EL_BD_NITRO_PACK_EXPLODING_2,
+  EL_BD_NITRO_PACK_EXPLODING_3,
+  EL_BD_NITRO_PACK_EXPLODING_4,
+
+  EL_BD_ROCK_GROWING_1,
+  EL_BD_ROCK_GROWING_2,
+  EL_BD_ROCK_GROWING_3,
+  EL_BD_ROCK_GROWING_4,
+
+  EL_BD_STEELWALL_GROWING_1,
+  EL_BD_STEELWALL_GROWING_2,
+  EL_BD_STEELWALL_GROWING_3,
+  EL_BD_STEELWALL_GROWING_4,
+
+  EL_BD_CLOCK_GROWING_1,
+  EL_BD_CLOCK_GROWING_2,
+  EL_BD_CLOCK_GROWING_3,
+  EL_BD_CLOCK_GROWING_4,
+
+  EL_BD_GHOST_EXPLODING_1,
+  EL_BD_GHOST_EXPLODING_2,
+  EL_BD_GHOST_EXPLODING_3,
+  EL_BD_GHOST_EXPLODING_4,
+};
+static int *editor_hl_boulderdash_effects_ptr = editor_hl_boulderdash_effects;
+static int *editor_el_boulderdash_effects_ptr = editor_el_boulderdash_effects;
+static int num_editor_hl_boulderdash_effects = ARRAY_SIZE(editor_hl_boulderdash_effects);
+static int num_editor_el_boulderdash_effects = ARRAY_SIZE(editor_el_boulderdash_effects);
+
 static int editor_hl_emerald_mine[] =
 {
   EL_INTERNAL_CASCADE_EM_ACTIVE,
@@ -6335,6 +6470,7 @@ static boolean setup_editor_cascade_never = FALSE;
 static boolean setup_editor_el_players                 = TRUE;
 static boolean setup_editor_el_boulderdash             = TRUE;
 static boolean setup_editor_el_boulderdash_native      = TRUE;
+static boolean setup_editor_el_boulderdash_effects     = TRUE;
 static boolean setup_editor_el_emerald_mine            = TRUE;
 static boolean setup_editor_el_emerald_mine_club       = TRUE;
 static boolean setup_editor_el_more                    = TRUE;
@@ -6387,6 +6523,12 @@ editor_elements_info[] =
     &editor_hl_boulderdash_native_ptr, &num_editor_hl_boulderdash_native,
     &editor_el_boulderdash_native_ptr, &num_editor_el_boulderdash_native
   },
+  {
+    &setup_editor_el_boulderdash_effects,
+    &setup.editor_cascade.el_bd_effects,
+    &editor_hl_boulderdash_effects_ptr,        &num_editor_hl_boulderdash_effects,
+    &editor_el_boulderdash_effects_ptr,        &num_editor_el_boulderdash_effects
+  },
   {
     &setup_editor_el_emerald_mine,
     &setup.editor_cascade.el_em,
@@ -6687,6 +6829,7 @@ static void ReinitializeElementList_EnableSections(void)
   setup_editor_el_players              = TRUE;
   setup_editor_el_boulderdash          = TRUE;
   setup_editor_el_boulderdash_native   = TRUE;
+  setup_editor_el_boulderdash_effects  = TRUE;
   setup_editor_el_emerald_mine         = TRUE;
   setup_editor_el_emerald_mine_club    = TRUE;
   setup_editor_el_more                 = TRUE;
@@ -6710,6 +6853,7 @@ static void ReinitializeElementList_EnableSections(void)
     setup_editor_el_players            = FALSE;
     setup_editor_el_boulderdash                = FALSE;
     setup_editor_el_boulderdash_native = FALSE;
+    setup_editor_el_boulderdash_effects        = FALSE;
     setup_editor_el_emerald_mine       = FALSE;
     setup_editor_el_emerald_mine_club  = FALSE;
     setup_editor_el_more               = FALSE;
@@ -6741,6 +6885,7 @@ static void ReinitializeElementList_EnableSections(void)
   if (level.game_engine_type == GAME_ENGINE_TYPE_RND)
   {
     setup_editor_el_boulderdash_native = FALSE;
+    setup_editor_el_boulderdash_effects        = FALSE;
     setup_editor_el_mirror_magic       = FALSE;
     setup_editor_el_deflektor          = FALSE;
   }
@@ -6766,6 +6911,7 @@ static void ReinitializeElementList_EnableSections(void)
   {
     setup_editor_el_boulderdash                = FALSE;
     setup_editor_el_boulderdash_native = FALSE;
+    setup_editor_el_boulderdash_effects        = FALSE;
     setup_editor_el_more               = FALSE;
     setup_editor_el_sokoban            = FALSE;
     setup_editor_el_supaplex           = FALSE;
@@ -6782,6 +6928,7 @@ static void ReinitializeElementList_EnableSections(void)
     setup_editor_el_players            = FALSE;
     setup_editor_el_boulderdash                = FALSE;
     setup_editor_el_boulderdash_native = FALSE;
+    setup_editor_el_boulderdash_effects        = FALSE;
     setup_editor_el_emerald_mine       = FALSE;
     setup_editor_el_emerald_mine_club  = FALSE;
     setup_editor_el_more               = FALSE;
@@ -6800,6 +6947,7 @@ static void ReinitializeElementList_EnableSections(void)
     setup_editor_el_players            = FALSE;
     setup_editor_el_boulderdash                = FALSE;
     setup_editor_el_boulderdash_native = FALSE;
+    setup_editor_el_boulderdash_effects        = FALSE;
     setup_editor_el_emerald_mine       = FALSE;
     setup_editor_el_emerald_mine_club  = FALSE;
     setup_editor_el_more               = FALSE;
index 3e6d25f3d13c190ba502b1443cdf32992b957095..8197672ac21cf85370818650e8d31c725fe95319 100644 (file)
@@ -10532,6 +10532,10 @@ static struct TokenInfo editor_cascade_setup_tokens[] =
     TYPE_SWITCH,
     &setup.editor_cascade.el_bd_native,                "editor.cascade.el_bd_native"
   },
+  {
+    TYPE_SWITCH,
+    &setup.editor_cascade.el_bd_effects,       "editor.cascade.el_bd_effects"
+  },
   {
     TYPE_SWITCH,
     &setup.editor_cascade.el_em,               "editor.cascade.el_em"
@@ -11226,6 +11230,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
 
   si->editor.el_boulderdash            = TRUE;
   si->editor.el_boulderdash_native     = TRUE;
+  si->editor.el_boulderdash_effects    = TRUE;
   si->editor.el_emerald_mine           = TRUE;
   si->editor.el_emerald_mine_club      = TRUE;
   si->editor.el_more                   = TRUE;
@@ -11400,6 +11405,7 @@ static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si)
 {
   si->editor_cascade.el_bd             = TRUE;
   si->editor_cascade.el_bd_native      = TRUE;
+  si->editor_cascade.el_bd_effects     = FALSE;
   si->editor_cascade.el_em             = TRUE;
   si->editor_cascade.el_emc            = TRUE;
   si->editor_cascade.el_rnd            = TRUE;
index 0233351ef97334680be67441f9c4178fafa5e6d8..28d8aae2271a5bc73202fd4a0e10e25e891bf84f 100644 (file)
@@ -4582,6 +4582,7 @@ void InitElementPropertiesStatic(void)
   {
     EL_INTERNAL_CASCADE_BD_ACTIVE,
     EL_INTERNAL_CASCADE_BD_NATIVE_ACTIVE,
+    EL_INTERNAL_CASCADE_BD_EFFECTS_ACTIVE,
     EL_INTERNAL_CASCADE_EM_ACTIVE,
     EL_INTERNAL_CASCADE_EMC_ACTIVE,
     EL_INTERNAL_CASCADE_RND_ACTIVE,
@@ -4607,6 +4608,7 @@ void InitElementPropertiesStatic(void)
   {
     EL_INTERNAL_CASCADE_BD,
     EL_INTERNAL_CASCADE_BD_NATIVE,
+    EL_INTERNAL_CASCADE_BD_EFFECTS,
     EL_INTERNAL_CASCADE_EM,
     EL_INTERNAL_CASCADE_EMC,
     EL_INTERNAL_CASCADE_RND,
index cc17c73019d5ea21027cd234fb99c8a3ed465bfd..d4999b46c1250ef92fa4303e124430962d6faa08 100644 (file)
@@ -1290,6 +1290,7 @@ struct SetupEditorInfo
 {
   boolean el_boulderdash;
   boolean el_boulderdash_native;
+  boolean el_boulderdash_effects;
   boolean el_emerald_mine;
   boolean el_emerald_mine_club;
   boolean el_more;
@@ -1335,6 +1336,7 @@ struct SetupEditorCascadeInfo
 {
   boolean el_bd;
   boolean el_bd_native;
+  boolean el_bd_effects;
   boolean el_em;
   boolean el_emc;
   boolean el_rnd;
index 783ecf42a1be436923a21b3dae3f542d921e0667..b9967e3046ba3e2772059b9f95a28dd14684ac7b 100644 (file)
@@ -8383,6 +8383,16 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
     "internal",
     "Hide native Boulder Dash elements"
   },
+  {
+    "internal_cascade_bd_effects",
+    "internal",
+    "Show Boulder Dash effect elements"
+  },
+  {
+    "internal_cascade_bd_effects.active",
+    "internal",
+    "Hide Boulder Dash effect elements"
+  },
   {
     "internal_cascade_em",
     "internal",
index f9836d97183ad9c9065f14dbdd1c845002e3e05a..3b735c4cfff99697897e3eb9351dd61a5e353c5e 100644 (file)
 #define EL_INTERNAL_CASCADE_BD_ACTIVE          (EL_FIRST_INTERNAL + 5)
 #define EL_INTERNAL_CASCADE_BD_NATIVE          (EL_FIRST_INTERNAL + 6)
 #define EL_INTERNAL_CASCADE_BD_NATIVE_ACTIVE   (EL_FIRST_INTERNAL + 7)
-#define EL_INTERNAL_CASCADE_EM                 (EL_FIRST_INTERNAL + 8)
-#define EL_INTERNAL_CASCADE_EM_ACTIVE          (EL_FIRST_INTERNAL + 9)
-#define EL_INTERNAL_CASCADE_EMC                        (EL_FIRST_INTERNAL + 10)
-#define EL_INTERNAL_CASCADE_EMC_ACTIVE         (EL_FIRST_INTERNAL + 11)
-#define EL_INTERNAL_CASCADE_RND                        (EL_FIRST_INTERNAL + 12)
-#define EL_INTERNAL_CASCADE_RND_ACTIVE         (EL_FIRST_INTERNAL + 13)
-#define EL_INTERNAL_CASCADE_SB                 (EL_FIRST_INTERNAL + 14)
-#define EL_INTERNAL_CASCADE_SB_ACTIVE          (EL_FIRST_INTERNAL + 15)
-#define EL_INTERNAL_CASCADE_SP                 (EL_FIRST_INTERNAL + 16)
-#define EL_INTERNAL_CASCADE_SP_ACTIVE          (EL_FIRST_INTERNAL + 17)
-#define EL_INTERNAL_CASCADE_DC                 (EL_FIRST_INTERNAL + 18)
-#define EL_INTERNAL_CASCADE_DC_ACTIVE          (EL_FIRST_INTERNAL + 19)
-#define EL_INTERNAL_CASCADE_DX                 (EL_FIRST_INTERNAL + 20)
-#define EL_INTERNAL_CASCADE_DX_ACTIVE          (EL_FIRST_INTERNAL + 21)
-#define EL_INTERNAL_CASCADE_MM                 (EL_FIRST_INTERNAL + 22)
-#define EL_INTERNAL_CASCADE_MM_ACTIVE          (EL_FIRST_INTERNAL + 23)
-#define EL_INTERNAL_CASCADE_DF                 (EL_FIRST_INTERNAL + 24)
-#define EL_INTERNAL_CASCADE_DF_ACTIVE          (EL_FIRST_INTERNAL + 25)
-#define EL_INTERNAL_CASCADE_CHARS              (EL_FIRST_INTERNAL + 26)
-#define EL_INTERNAL_CASCADE_CHARS_ACTIVE       (EL_FIRST_INTERNAL + 27)
-#define EL_INTERNAL_CASCADE_STEEL_CHARS                (EL_FIRST_INTERNAL + 28)
-#define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE (EL_FIRST_INTERNAL + 29)
-#define EL_INTERNAL_CASCADE_CE                 (EL_FIRST_INTERNAL + 30)
-#define EL_INTERNAL_CASCADE_CE_ACTIVE          (EL_FIRST_INTERNAL + 31)
-#define EL_INTERNAL_CASCADE_GE                 (EL_FIRST_INTERNAL + 32)
-#define EL_INTERNAL_CASCADE_GE_ACTIVE          (EL_FIRST_INTERNAL + 33)
-#define EL_INTERNAL_CASCADE_ES                 (EL_FIRST_INTERNAL + 34)
-#define EL_INTERNAL_CASCADE_ES_ACTIVE          (EL_FIRST_INTERNAL + 35)
-#define EL_INTERNAL_CASCADE_REF                        (EL_FIRST_INTERNAL + 36)
-#define EL_INTERNAL_CASCADE_REF_ACTIVE         (EL_FIRST_INTERNAL + 37)
-#define EL_INTERNAL_CASCADE_USER               (EL_FIRST_INTERNAL + 38)
-#define EL_INTERNAL_CASCADE_USER_ACTIVE                (EL_FIRST_INTERNAL + 39)
-#define EL_INTERNAL_CASCADE_DYNAMIC            (EL_FIRST_INTERNAL + 40)
-#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE     (EL_FIRST_INTERNAL + 41)
+#define EL_INTERNAL_CASCADE_BD_EFFECTS         (EL_FIRST_INTERNAL + 8)
+#define EL_INTERNAL_CASCADE_BD_EFFECTS_ACTIVE  (EL_FIRST_INTERNAL + 9)
+#define EL_INTERNAL_CASCADE_EM                 (EL_FIRST_INTERNAL + 10)
+#define EL_INTERNAL_CASCADE_EM_ACTIVE          (EL_FIRST_INTERNAL + 11)
+#define EL_INTERNAL_CASCADE_EMC                        (EL_FIRST_INTERNAL + 12)
+#define EL_INTERNAL_CASCADE_EMC_ACTIVE         (EL_FIRST_INTERNAL + 13)
+#define EL_INTERNAL_CASCADE_RND                        (EL_FIRST_INTERNAL + 14)
+#define EL_INTERNAL_CASCADE_RND_ACTIVE         (EL_FIRST_INTERNAL + 15)
+#define EL_INTERNAL_CASCADE_SB                 (EL_FIRST_INTERNAL + 16)
+#define EL_INTERNAL_CASCADE_SB_ACTIVE          (EL_FIRST_INTERNAL + 17)
+#define EL_INTERNAL_CASCADE_SP                 (EL_FIRST_INTERNAL + 18)
+#define EL_INTERNAL_CASCADE_SP_ACTIVE          (EL_FIRST_INTERNAL + 19)
+#define EL_INTERNAL_CASCADE_DC                 (EL_FIRST_INTERNAL + 20)
+#define EL_INTERNAL_CASCADE_DC_ACTIVE          (EL_FIRST_INTERNAL + 21)
+#define EL_INTERNAL_CASCADE_DX                 (EL_FIRST_INTERNAL + 22)
+#define EL_INTERNAL_CASCADE_DX_ACTIVE          (EL_FIRST_INTERNAL + 23)
+#define EL_INTERNAL_CASCADE_MM                 (EL_FIRST_INTERNAL + 24)
+#define EL_INTERNAL_CASCADE_MM_ACTIVE          (EL_FIRST_INTERNAL + 25)
+#define EL_INTERNAL_CASCADE_DF                 (EL_FIRST_INTERNAL + 26)
+#define EL_INTERNAL_CASCADE_DF_ACTIVE          (EL_FIRST_INTERNAL + 27)
+#define EL_INTERNAL_CASCADE_CHARS              (EL_FIRST_INTERNAL + 28)
+#define EL_INTERNAL_CASCADE_CHARS_ACTIVE       (EL_FIRST_INTERNAL + 29)
+#define EL_INTERNAL_CASCADE_STEEL_CHARS                (EL_FIRST_INTERNAL + 30)
+#define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE (EL_FIRST_INTERNAL + 31)
+#define EL_INTERNAL_CASCADE_CE                 (EL_FIRST_INTERNAL + 32)
+#define EL_INTERNAL_CASCADE_CE_ACTIVE          (EL_FIRST_INTERNAL + 33)
+#define EL_INTERNAL_CASCADE_GE                 (EL_FIRST_INTERNAL + 34)
+#define EL_INTERNAL_CASCADE_GE_ACTIVE          (EL_FIRST_INTERNAL + 35)
+#define EL_INTERNAL_CASCADE_ES                 (EL_FIRST_INTERNAL + 36)
+#define EL_INTERNAL_CASCADE_ES_ACTIVE          (EL_FIRST_INTERNAL + 37)
+#define EL_INTERNAL_CASCADE_REF                        (EL_FIRST_INTERNAL + 38)
+#define EL_INTERNAL_CASCADE_REF_ACTIVE         (EL_FIRST_INTERNAL + 39)
+#define EL_INTERNAL_CASCADE_USER               (EL_FIRST_INTERNAL + 40)
+#define EL_INTERNAL_CASCADE_USER_ACTIVE                (EL_FIRST_INTERNAL + 41)
+#define EL_INTERNAL_CASCADE_DYNAMIC            (EL_FIRST_INTERNAL + 42)
+#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE     (EL_FIRST_INTERNAL + 43)
 
 #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 + 41)
+#define EL_INTERNAL_END                                (EL_FIRST_INTERNAL + 43)
 
-#define MAX_NUM_ELEMENTS                       (EL_FIRST_INTERNAL + 42)
+#define MAX_NUM_ELEMENTS                       (EL_FIRST_INTERNAL + 44)
 
 
 // values for graphics/sounds action types