added support for skeleton settings in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Sun, 24 Mar 2024 20:28:34 +0000 (21:28 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 24 Mar 2024 20:28:34 +0000 (21:28 +0100)
src/editor.c
src/files.c
src/main.h

index 092ecac0a95f408d2e826fa488f9c2c780fd22d3..b5bfa2723c141bc2fc5be647352b69db842fdd77 100644 (file)
@@ -11299,6 +11299,8 @@ static void DrawPropertiesInfo(void)
 #define TEXT_REPLICATION_DELAY         "Create delay (BD frames)"
 #define TEXT_HAMMER_BREAK_DELAY                "Delay for breaking walls"
 #define TEXT_HAMMER_REAPPEAR_DELAY     "Delay for reappearing walls"
+#define TEXT_SKELETONS_NEEDED          "Amount needed to use a pot"
+#define TEXT_SKELETONS_WORTH           "Counts as this many diamonds"
 
 static struct
 {
@@ -11439,6 +11441,10 @@ static struct
                                1, 100                                                          },
   { EL_BD_PNEUMATIC_HAMMER,    &level.bd_hammer_walls_reappear_delay,  TEXT_HAMMER_REAPPEAR_DELAY,
                                1, 200                                                          },
+  { EL_BD_SKELETON,            &level.bd_num_skeletons_needed_for_pot, TEXT_SKELETONS_NEEDED,
+                               0, 50                                                           },
+  { EL_BD_SKELETON,            &level.bd_skeleton_worth_num_diamonds,  TEXT_SKELETONS_WORTH,
+                               0, 10                                                           },
   { EL_EXTRA_TIME,             &level.extra_time,                      TEXT_TIME_BONUS         },
   { EL_TIME_ORB_FULL,          &level.time_orb_time,                   TEXT_TIME_BONUS         },
   { EL_GAME_OF_LIFE,           &level.game_of_life[0],                 TEXT_GAME_OF_LIFE_1,0,8 },
index 6831c11216db58821ab43076a440c926ff0536b6..628f577e34ab29bca43fdba3ea10c7ba0ebb2d77 100644 (file)
@@ -863,6 +863,17 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.bd_hammer_walls_reappear_delay,        100
   },
 
+  {
+    EL_BD_SKELETON,                    -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(1),
+    &li.bd_num_skeletons_needed_for_pot, 5
+  },
+  {
+    EL_BD_SKELETON,                    -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(2),
+    &li.bd_skeleton_worth_num_diamonds,        0
+  },
+
   // (the following values are related to various game elements)
 
   {
@@ -4189,6 +4200,9 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
   cave->hammered_walls_reappear                = level->bd_hammer_walls_reappear;
   cave->hammered_wall_reappear_frame   = level->bd_hammer_walls_reappear_delay;
 
+  cave->skeletons_needed_for_pot       = level->bd_num_skeletons_needed_for_pot;
+  cave->skeletons_worth_diamonds       = level->bd_skeleton_worth_num_diamonds;
+
   // level name
   strncpy(cave->name, level->name, sizeof(GdString));
   cave->name[sizeof(GdString) - 1] = '\0';
@@ -4319,6 +4333,9 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->bd_hammer_walls_reappear      = cave->hammered_walls_reappear;
   level->bd_hammer_walls_reappear_delay        = cave->hammered_wall_reappear_frame;
 
+  level->bd_num_skeletons_needed_for_pot= cave->skeletons_needed_for_pot;
+  level->bd_skeleton_worth_num_diamonds        = cave->skeletons_worth_diamonds;
+
   // level name
   char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);
 
index e89e2d1f15aa1611f8e70e5b1109e86c83c95dfc..1abf844f2ff2132b1b26536d080136b7dbaa568e 100644 (file)
@@ -3679,6 +3679,8 @@ struct LevelInfo
   int bd_hammer_walls_break_delay;     // BD hammer time for breaking walls (in BD frames)
   boolean bd_hammer_walls_reappear;    // BD hammered walls are reappearing after some delay
   int bd_hammer_walls_reappear_delay;  // BD hammer time for reappearing walls (in BD frames)
+  int bd_num_skeletons_needed_for_pot; // BD skeletons amount must be collected to use a pot
+  int bd_skeleton_worth_num_diamonds;  // BD skeleton collected is worth this number of diamonds
 
   boolean em_slippery_gems;            // EM style "gems slip from wall" behaviour
   boolean em_explodes_by_fire;         // EM style chain explosion behaviour