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,
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));
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);
int level_slime_permeability_c64[5]; // Appearing in bd 2
int level_slime_seed_c64[5]; // predictable slime random seed
boolean slime_predictable; // predictable random start for slime. yes for plck.
+ boolean slime_correct_random; // correct random number generator for rendered caves
GdElement slime_eats_1, slime_converts_1; // slime eats element x and converts to element x;
// for example diamond -> falling diamond
GdElement slime_eats_2, slime_converts_2; // this is usually stone -> stone_f
gd_cave_store_rc(cave, x, 0, cave->initial_border, NULL);
gd_cave_store_rc(cave, x, cave->h - 1, cave->initial_border, NULL);
}
+
+ // store if random number generator needs correction for static random seed
+ cave->slime_correct_random = (data->level_rand[level] >= 0);
}
else
{
// initialize c64 predictable random for slime.
// the values were taken from afl bd, see docs/internals.txt
gd_cave_c64_random_set_seed(cave, 0, 0x1e);
+
+ // correct random number generator if cave was rendered with static random seed
+ if (cave->slime_correct_random)
+ {
+ int i;
+
+ // set static random seed used when rendering the cave
+ gd_cave_c64_random_set_seed(cave, 0, data->level_rand[level]);
+
+ for (i = 0; i < cave->w * (cave->h - 2); i++)
+ gd_cave_c64_random(cave);
+ }
}
if (data->level_slime_seed_c64[level] != -1)
boolean bd_voodoo_vanish_by_explosion;// BD voodoo doll can be destroyed by explosions
int bd_voodoo_penalty_time; // BD engine penalty time when voodoo doll destroyed
boolean bd_slime_is_predictable; // BD slime uses predictable random number generator
+ boolean bd_slime_correct_random; // BD slime needs corrected random number generator
int bd_slime_permeability_rate; // BD slime permeability rate for unpredictable slime
int bd_slime_permeability_bits_c64; // BD slime permeability bits for predictable slime
int bd_slime_random_seed_c64; // BD slime random number seed for predictable slime
+ int bd_cave_random_seed_c64; // BD cave random number seed for predictable slime
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