added support for magic wall settings in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Mon, 11 Mar 2024 22:35:46 +0000 (23:35 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 11 Mar 2024 23:25:35 +0000 (00:25 +0100)
src/editor.c
src/files.c
src/main.h

index 9dbe4982d8acd55ae6cd6c740aed35b7f49b0f87..10c26424a773eef72e69314963d91b72c85e4475 100644 (file)
@@ -708,6 +708,8 @@ enum
   GADGET_ID_BD_DIAGONAL_MOVEMENTS,
   GADGET_ID_BD_TOPMOST_PLAYER_ACTIVE,
   GADGET_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET,
+  GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING,
+  GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA,
   GADGET_ID_ENVELOPE_AUTOWRAP,
   GADGET_ID_ENVELOPE_CENTERED,
   GADGET_ID_MM_LASER_RED,
@@ -1043,6 +1045,8 @@ enum
   ED_CHECKBUTTON_ID_BD_DIAGONAL_MOVEMENTS,
   ED_CHECKBUTTON_ID_BD_TOPMOST_PLAYER_ACTIVE,
   ED_CHECKBUTTON_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET,
+  ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING,
+  ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA,
   ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP,
   ED_CHECKBUTTON_ID_ENVELOPE_CENTERED,
   ED_CHECKBUTTON_ID_MM_LASER_RED,
@@ -3688,6 +3692,22 @@ static struct
     NULL, NULL,
     "mega rocks pushable with sweet",  "push mega rocks after eating sweet"
   },
+  {
+    ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING,
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(1),
+    GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING, GADGET_ID_NONE,
+    &level.bd_magic_wall_wait_hatching,
+    NULL, NULL,
+    "wait for player's birth",         "timer start waits for player's birth"
+  },
+  {
+    ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA,
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(2),
+    GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA, GADGET_ID_NONE,
+    &level.bd_magic_wall_stops_amoeba,
+    NULL, NULL,
+    "turn amoeba to diamonds",         "activation changes amoeba to diamonds"
+  },
   {
     ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP,
     ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(1),
@@ -11130,6 +11150,12 @@ static void DrawPropertiesConfig(void)
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET);
   }
 
+  if (properties_element == EL_BD_MAGIC_WALL)
+  {
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING);
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA);
+  }
+
   // special case: slippery walls option for gems only available in R'n'D game engine
   if (IS_GEM(properties_element) && level.game_engine_type == GAME_ENGINE_TYPE_RND)
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS);
index 87ad27a9cecea8597be335f520a24da9db422ee7..2db82d002cd1829e4f432a940e5cff02cde3c3f9 100644 (file)
@@ -634,6 +634,17 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.score[SC_DIAMOND_EXTRA],       20
   },
 
+  {
+    EL_BD_MAGIC_WALL,                  -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.bd_magic_wall_wait_hatching,   FALSE
+  },
+  {
+    EL_BD_MAGIC_WALL,                  -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(2),
+    &li.bd_magic_wall_stops_amoeba,    TRUE
+  },
+
   // (the following values are related to various game elements)
 
   {
@@ -3797,6 +3808,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
 
   // element properties
   cave->level_magic_wall_time[0]       = level->time_magic_wall;
+  cave->magic_timer_wait_for_hatching  = level->bd_magic_wall_wait_hatching;
+  cave->magic_wall_stops_amoeba                = level->bd_magic_wall_stops_amoeba;
 
   // level name
   strncpy(cave->name, level->name, sizeof(GdString));
@@ -3853,6 +3866,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
 
   // element properties
   level->time_magic_wall               = cave->level_magic_wall_time[bd_level_nr];
+  level->bd_magic_wall_wait_hatching   = cave->magic_timer_wait_for_hatching;
+  level->bd_magic_wall_stops_amoeba    = cave->magic_wall_stops_amoeba;
 
   // level name
   char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);
index 31e926fee481c8ccf24717be4d5cf703ccf1da8e..5d03cb54cccd6d0e44008bcab8288caffbb72596 100644 (file)
@@ -3496,6 +3496,8 @@ struct LevelInfo
   int bd_pushing_prob;                 // BD player probability to push rocks
   int bd_pushing_prob_with_sweet;      // BD player probability to push rocks after eating sweet
   boolean bd_push_mega_rock_with_sweet;        // BD player can push mega rocks after eating sweet
+  boolean bd_magic_wall_wait_hatching; // BD magic wall waits for player's birth
+  boolean bd_magic_wall_stops_amoeba;  // BD magic wall turns amoeba to diamonds
   boolean em_slippery_gems;            // EM style "gems slip from wall" behaviour
   boolean em_explodes_by_fire;         // EM style chain explosion behaviour
   boolean use_spring_bug;              // for compatibility with old levels