added support for clock settings in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Wed, 13 Mar 2024 08:15:12 +0000 (09:15 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 13 Mar 2024 08:15:12 +0000 (09:15 +0100)
src/editor.c
src/files.c
src/main.h

index 14c5d86c88accd68a93fa004846995767b35e066..1aad7ba5e8d8ffdd6e2d846827bb4b9eee83b2e5 100644 (file)
@@ -10893,6 +10893,7 @@ static struct
   { EL_LIGHT_SWITCH_ACTIVE,    &level.time_light,              TEXT_DURATION           },
   { EL_SHIELD_NORMAL,          &level.shield_normal_time,      TEXT_DURATION           },
   { EL_SHIELD_DEADLY,          &level.shield_deadly_time,      TEXT_DURATION           },
+  { EL_BD_CLOCK,               &level.bd_clock_extra_time,     TEXT_TIME_BONUS         },
   { 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     },
index 35597a4d5f9d88b563024f7991dc19674783073b..78c47b9fe8a81cbbd8f0ae8d1d7804819d361576 100644 (file)
@@ -646,6 +646,12 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.bd_magic_wall_stops_amoeba,    TRUE
   },
 
+  {
+    EL_BD_CLOCK,                       -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(1),
+    &li.bd_clock_extra_time,           30
+  },
+
   // (the following values are related to various game elements)
 
   {
@@ -3896,6 +3902,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
   cave->mega_stones_pushable_with_sweet        = level->bd_push_mega_rock_with_sweet;
 
   // element properties
+  cave->level_bonus_time[0]            = level->bd_clock_extra_time;
   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;
@@ -3972,6 +3979,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->bd_push_mega_rock_with_sweet  = cave->mega_stones_pushable_with_sweet;
 
   // element properties
+  level->bd_clock_extra_time           = cave->level_bonus_time[0];
   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;
index 999c24a74205ca8ffd96cbf69df9a50936161fb9..45b045f19f7c5a4d02df8388a5734f307053e513 100644 (file)
@@ -3515,6 +3515,7 @@ struct LevelInfo
   int bd_amoeba_2_content_enclosed;    // BD amoeba 2 changes to this element if enclosed
   int bd_amoeba_2_content_exploding;   // BD amoeba 2 changes to this element if exploding
   int bd_amoeba_2_content_looks_like;  // BD amoeba 2 looks like this other game element
+  int bd_clock_extra_time;             // BD engine extra time when collecting clock
   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