added support for bladder settings in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Wed, 20 Mar 2024 23:26:49 +0000 (00:26 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 20 Mar 2024 23:26:49 +0000 (00:26 +0100)
src/editor.c
src/files.c
src/init.c
src/main.h

index 4411b1996cc7a8f802395696869bf2f82558ab33..2ca3dfba9b78b79f44b409c4af2b4a7cbdba8258 100644 (file)
@@ -566,6 +566,7 @@ enum
   GADGET_ID_BD_ACID_EATS_ELEMENT,
   GADGET_ID_BD_ACID_TURNS_TO_ELEMENT,
   GADGET_ID_BD_BITER_EATS_ELEMENT,
+  GADGET_ID_BD_BLADDER_CONVERTS_BY_ELEMENT,
   GADGET_ID_START_ELEMENT,
   GADGET_ID_ARTWORK_ELEMENT,
   GADGET_ID_EXPLOSION_ELEMENT,
@@ -1178,6 +1179,7 @@ enum
   ED_DRAWING_ID_BD_ACID_EATS_ELEMENT,
   ED_DRAWING_ID_BD_ACID_TURNS_TO_ELEMENT,
   ED_DRAWING_ID_BD_BITER_EATS_ELEMENT,
+  ED_DRAWING_ID_BD_BLADDER_CONVERTS_BY_ELEMENT,
   ED_DRAWING_ID_START_ELEMENT,
   ED_DRAWING_ID_ARTWORK_ELEMENT,
   ED_DRAWING_ID_EXPLOSION_ELEMENT,
@@ -4367,6 +4369,14 @@ static struct
     &level.bd_biter_eats_element,      1, 1,
     "Can eat:", NULL, NULL, NULL,      "Eats this element when moving"
   },
+  {
+    ED_DRAWING_ID_BD_BLADDER_CONVERTS_BY_ELEMENT,
+    ED_AREA_1X1_SETTINGS_XPOS(0),      ED_AREA_1X1_SETTINGS_YPOS(1),
+    ED_AREA_1X1_SETTINGS_XOFF,         ED_AREA_1X1_SETTINGS_YOFF,
+    GADGET_ID_BD_BLADDER_CONVERTS_BY_ELEMENT, GADGET_ID_NONE,
+    &level.bd_bladder_converts_by_element,     1, 1,
+    "Turns to clock by touching:", NULL, NULL, NULL,   "Turns to clock by touching element"
+  },
 
   // ---------- level start element -------------------------------------------
 
@@ -11263,6 +11273,10 @@ static void DrawPropertiesConfig(void)
     {
       MapDrawingArea(ED_DRAWING_ID_BD_BITER_EATS_ELEMENT);
     }
+    else if (properties_element == EL_BD_BLADDER)
+    {
+      MapDrawingArea(ED_DRAWING_ID_BD_BLADDER_CONVERTS_BY_ELEMENT);
+    }
     else if (properties_element == EL_YAMYAM ||
             properties_element == EL_YAMYAM_LEFT ||
             properties_element == EL_YAMYAM_RIGHT ||
index 3f2f69dd4aac97e027504c46031a45d7fb0b76d9..1128b9e093d312e5ab53f639540189e65179d915 100644 (file)
@@ -736,6 +736,12 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.bd_biter_eats_element,         EL_BD_DIAMOND
   },
 
+  {
+    EL_BD_BLADDER,                     -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(1),
+    &li.bd_bladder_converts_by_element,        EL_BD_VOODOO_DOLL
+  },
+
   // (the following values are related to various game elements)
 
   {
@@ -4029,6 +4035,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
   cave->biter_delay_frame              = level->bd_biter_move_delay;
   cave->biter_eat                      = map_element_RND_to_BD(level->bd_biter_eats_element);
 
+  cave->bladder_converts_by        = map_element_RND_to_BD(level->bd_bladder_converts_by_element);
+
   // level name
   strncpy(cave->name, level->name, sizeof(GdString));
   cave->name[sizeof(GdString) - 1] = '\0';
@@ -4126,6 +4134,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->bd_biter_move_delay           = cave->biter_delay_frame;
   level->bd_biter_eats_element         = map_element_BD_to_RND(cave->biter_eat);
 
+  level->bd_bladder_converts_by_element        = map_element_BD_to_RND(cave->bladder_converts_by);
+
   // level name
   char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);
 
index ba509b7ba3f09310422674e8c4709c6fd5c70c10..0233351ef97334680be67441f9c4178fafa5e6d8 100644 (file)
@@ -4285,6 +4285,7 @@ void InitElementPropertiesStatic(void)
     EL_BD_BITER_UP,
     EL_BD_BITER_LEFT,
     EL_BD_BITER_DOWN,
+    EL_BD_BLADDER,
     EL_EMC_MAGIC_BALL,
     EL_EMC_ANDROID,
     EL_MM_GRAY_BALL,
index cf694a786359b81480fb9111407055a856b702a2..8f53e89daf091101eac19c2396f4c4df7f49b119 100644 (file)
@@ -3539,6 +3539,7 @@ struct LevelInfo
   int bd_acid_turns_to_element;                // BD acid target element after spreading
   int bd_biter_move_delay;             // BD biter delay between movements (in BD frames)
   int bd_biter_eats_element;           // BD biter eats this game element when moving
+  int bd_bladder_converts_by_element;  // BD bladder converts to clock by touching this element
 
   boolean em_slippery_gems;            // EM style "gems slip from wall" behaviour
   boolean em_explodes_by_fire;         // EM style chain explosion behaviour