increased maximum length for static strings in BD engine
[rocksndiamonds.git] / src / files.c
index 2db82d002cd1829e4f432a940e5cff02cde3c3f9..a150f89146217d1842a5ab5c32157be031638d14 100644 (file)
@@ -310,6 +310,11 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(23),
     &li.bd_gravity_affects_all,                TRUE
   },
+  {
+    -1,                                        -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(24),
+    &li.bd_cave_random_seed_c64,       0
+  },
 
   {
     -1,                                        -1,
@@ -602,6 +607,7 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
   },
 
   // (these values are only valid for BD style levels)
+  // (some values for BD style amoeba following below)
   {
     EL_BD_PLAYER,                      -1,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
@@ -627,6 +633,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(5),
     &li.bd_push_mega_rock_with_sweet,  FALSE
   },
+  {
+    EL_BD_PLAYER,                      -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(6),
+    &li.bd_snap_element,               EL_EMPTY
+  },
 
   {
     EL_BD_DIAMOND,                     -1,
@@ -645,6 +656,59 @@ 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
+  },
+
+  {
+    EL_BD_VOODOO_DOLL,                 -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.bd_voodoo_collects_diamonds,   FALSE
+  },
+  {
+    EL_BD_VOODOO_DOLL,                 -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(2),
+    &li.bd_voodoo_hurt_kills_player,   FALSE
+  },
+  {
+    EL_BD_VOODOO_DOLL,                 -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(3),
+    &li.bd_voodoo_dies_by_rock,                FALSE
+  },
+  {
+    EL_BD_VOODOO_DOLL,                 -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(4),
+    &li.bd_voodoo_vanish_by_explosion, TRUE
+  },
+  {
+    EL_BD_VOODOO_DOLL,                 -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(5),
+    &li.bd_voodoo_penalty_time,                30
+  },
+
+  {
+    EL_BD_SLIME,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.bd_slime_is_predictable,       TRUE
+  },
+  {
+    EL_BD_SLIME,                       -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(2),
+    &li.bd_slime_permeability_rate,    100
+  },
+  {
+    EL_BD_SLIME,                       -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(3),
+    &li.bd_slime_permeability_bits_c64,        0
+  },
+  {
+    EL_BD_SLIME,                       -1,
+    TYPE_INTEGER,                      CONF_VALUE_32_BIT(1),
+    &li.bd_slime_random_seed_c64,      -1
+  },
+
   // (the following values are related to various game elements)
 
   {
@@ -707,6 +771,7 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.score[SC_CRYSTAL],             10
   },
 
+  // (amoeba values used by R'n'D game engine only)
   {
     EL_BD_AMOEBA,                      -1,
     TYPE_ELEMENT,                      CONF_VALUE_16_BIT(1),
@@ -722,6 +787,93 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
     &li.grow_into_diggable,            TRUE
   },
+  // (amoeba values used by BD game engine only)
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(2),
+    &li.bd_amoeba_wait_for_hatching,   FALSE
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(3),
+    &li.bd_amoeba_start_immediately,   TRUE
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(4),
+    &li.bd_amoeba_2_explode_by_amoeba, TRUE
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_INTEGER,                      CONF_VALUE_16_BIT(3),
+    &li.bd_amoeba_threshold_too_big,   200
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_INTEGER,                      CONF_VALUE_16_BIT(4),
+    &li.bd_amoeba_slow_growth_time,    200
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(5),
+    &li.bd_amoeba_slow_growth_rate,    3
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(6),
+    &li.bd_amoeba_fast_growth_rate,    25
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(5),
+    &li.bd_amoeba_content_too_big,     EL_BD_ROCK
+  },
+  {
+    EL_BD_AMOEBA,                      -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(6),
+    &li.bd_amoeba_content_enclosed,    EL_BD_DIAMOND
+  },
+
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_INTEGER,                      CONF_VALUE_16_BIT(3),
+    &li.bd_amoeba_2_threshold_too_big, 200
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_INTEGER,                      CONF_VALUE_16_BIT(4),
+    &li.bd_amoeba_2_slow_growth_time,  200
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(5),
+    &li.bd_amoeba_2_slow_growth_rate,  3
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(6),
+    &li.bd_amoeba_2_fast_growth_rate,  25
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(5),
+    &li.bd_amoeba_2_content_too_big,   EL_BD_ROCK
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(6),
+    &li.bd_amoeba_2_content_enclosed,  EL_BD_DIAMOND
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(7),
+    &li.bd_amoeba_2_content_exploding, EL_EMPTY
+  },
+  {
+    EL_BD_AMOEBA_2,                    -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(8),
+    &li.bd_amoeba_2_content_looks_like,        EL_BD_AMOEBA_2
+  },
 
   {
     EL_YAMYAM,                         -1,
@@ -3805,11 +3957,43 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
   cave->pushing_stone_prob             = level->bd_pushing_prob            * 10000;
   cave->pushing_stone_prob_sweet       = level->bd_pushing_prob_with_sweet * 10000;
   cave->mega_stones_pushable_with_sweet        = level->bd_push_mega_rock_with_sweet;
+  cave->snap_element                   = map_element_RND_to_BD(level->bd_snap_element);
 
   // element properties
+  cave->level_bonus_time[0]            = level->bd_clock_extra_time;
+  cave->voodoo_collects_diamonds       = level->bd_voodoo_collects_diamonds;
+  cave->voodoo_any_hurt_kills_player   = level->bd_voodoo_hurt_kills_player;
+  cave->voodoo_dies_by_stone           = level->bd_voodoo_dies_by_rock;
+  cave->voodoo_disappear_in_explosion  = level->bd_voodoo_vanish_by_explosion;
+  cave->level_penalty_time[0]          = level->bd_voodoo_penalty_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;
+  cave->amoeba_timer_wait_for_hatching = level->bd_amoeba_wait_for_hatching;
+  cave->amoeba_timer_started_immediately= level->bd_amoeba_start_immediately;
+  cave->amoeba_2_explodes_by_amoeba    = level->bd_amoeba_2_explode_by_amoeba;
+  cave->level_amoeba_threshold[0]      = level->bd_amoeba_threshold_too_big;
+  cave->level_amoeba_time[0]           = level->bd_amoeba_slow_growth_time;
+  cave->amoeba_growth_prob             = level->bd_amoeba_slow_growth_rate * 10000;
+  cave->amoeba_fast_growth_prob                = level->bd_amoeba_fast_growth_rate * 10000;
+  cave->level_amoeba_2_threshold[0]    = level->bd_amoeba_2_threshold_too_big;
+  cave->level_amoeba_2_time[0]         = level->bd_amoeba_2_slow_growth_time;
+  cave->amoeba_2_growth_prob           = level->bd_amoeba_2_slow_growth_rate * 10000;
+  cave->amoeba_2_fast_growth_prob      = level->bd_amoeba_2_fast_growth_rate * 10000;
+
+  cave->amoeba_too_big_effect      = map_element_RND_to_BD(level->bd_amoeba_content_too_big);
+  cave->amoeba_enclosed_effect     = map_element_RND_to_BD(level->bd_amoeba_content_enclosed);
+  cave->amoeba_2_too_big_effect     = map_element_RND_to_BD(level->bd_amoeba_2_content_too_big);
+  cave->amoeba_2_enclosed_effect    = map_element_RND_to_BD(level->bd_amoeba_2_content_enclosed);
+  cave->amoeba_2_explosion_effect   = map_element_RND_to_BD(level->bd_amoeba_2_content_exploding);
+  cave->amoeba_2_looks_like        = map_element_RND_to_BD(level->bd_amoeba_2_content_looks_like);
+
+  cave->slime_predictable              = level->bd_slime_is_predictable;
+  cave->slime_correct_random           = level->bd_slime_correct_random;
+  cave->level_slime_permeability[0]    = level->bd_slime_permeability_rate * 10000;
+  cave->level_slime_permeability_c64[0]        = level->bd_slime_permeability_bits_c64;
+  cave->level_slime_seed_c64[0]                = level->bd_slime_random_seed_c64;
+  cave->level_rand[0]                  = level->bd_cave_random_seed_c64;
 
   // level name
   strncpy(cave->name, level->name, sizeof(GdString));
@@ -3863,11 +4047,43 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->bd_pushing_prob               = cave->pushing_stone_prob       / 10000;
   level->bd_pushing_prob_with_sweet    = cave->pushing_stone_prob_sweet / 10000;
   level->bd_push_mega_rock_with_sweet  = cave->mega_stones_pushable_with_sweet;
+  level->bd_snap_element               = map_element_BD_to_RND(cave->snap_element);
 
   // element properties
+  level->bd_clock_extra_time           = cave->level_bonus_time[bd_level_nr];
+  level->bd_voodoo_collects_diamonds   = cave->voodoo_collects_diamonds;
+  level->bd_voodoo_hurt_kills_player   = cave->voodoo_any_hurt_kills_player;
+  level->bd_voodoo_dies_by_rock                = cave->voodoo_dies_by_stone;
+  level->bd_voodoo_vanish_by_explosion = cave->voodoo_disappear_in_explosion;
+  level->bd_voodoo_penalty_time                = cave->level_penalty_time[bd_level_nr];
   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->bd_amoeba_wait_for_hatching   = cave->amoeba_timer_wait_for_hatching;
+  level->bd_amoeba_start_immediately   = cave->amoeba_timer_started_immediately;
+  level->bd_amoeba_2_explode_by_amoeba = cave->amoeba_2_explodes_by_amoeba;
+  level->bd_amoeba_threshold_too_big   = cave->level_amoeba_threshold[bd_level_nr];
+  level->bd_amoeba_slow_growth_time    = cave->level_amoeba_time[bd_level_nr];
+  level->bd_amoeba_slow_growth_rate    = cave->amoeba_growth_prob      / 10000;
+  level->bd_amoeba_fast_growth_rate    = cave->amoeba_fast_growth_prob / 10000;
+  level->bd_amoeba_2_threshold_too_big = cave->level_amoeba_2_threshold[bd_level_nr];
+  level->bd_amoeba_2_slow_growth_time  = cave->level_amoeba_2_time[bd_level_nr];
+  level->bd_amoeba_2_slow_growth_rate  = cave->amoeba_2_growth_prob      / 10000;
+  level->bd_amoeba_2_fast_growth_rate  = cave->amoeba_2_fast_growth_prob / 10000;
+
+  level->bd_amoeba_content_too_big     = map_element_BD_to_RND(cave->amoeba_too_big_effect);
+  level->bd_amoeba_content_enclosed    = map_element_BD_to_RND(cave->amoeba_enclosed_effect);
+  level->bd_amoeba_2_content_too_big   = map_element_BD_to_RND(cave->amoeba_2_too_big_effect);
+  level->bd_amoeba_2_content_enclosed  = map_element_BD_to_RND(cave->amoeba_2_enclosed_effect);
+  level->bd_amoeba_2_content_exploding = map_element_BD_to_RND(cave->amoeba_2_explosion_effect);
+  level->bd_amoeba_2_content_looks_like        = map_element_BD_to_RND(cave->amoeba_2_looks_like);
+
+  level->bd_slime_is_predictable       = cave->slime_predictable;
+  level->bd_slime_correct_random       = cave->slime_correct_random;
+  level->bd_slime_permeability_rate    = cave->level_slime_permeability[bd_level_nr] / 10000;
+  level->bd_slime_permeability_bits_c64        = cave->level_slime_permeability_c64[bd_level_nr];
+  level->bd_slime_random_seed_c64      = cave->level_slime_seed_c64[bd_level_nr];
+  level->bd_cave_random_seed_c64       = cave->level_rand[bd_level_nr];
 
   // level name
   char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);