From bfc88f3e57855aae408fd5013485b68fa1c8256c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 16 Sep 2024 01:47:48 +0200 Subject: [PATCH] changed BD engine to match new GDash code (slime) --- src/game_bd/bd_caveengine.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index f2753a1c..e059e17b 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -3486,24 +3486,13 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, break; case O_SLIME: -#if 1 - ; // to make compilers happy ... -#else - Info("Step[%03d]", cave->frame); // XXX -#endif - int rrr = gd_cave_c64_random(cave); -#if 1 -#else - Info(".Rand[%03d].Perm[%03d].Result[%d]\n", rrr, cave->slime_permeability_c64, - (rrr & cave->slime_permeability_c64) == 0); -#endif - /* - * unpredictable: gd_rand_int - * predictable: c64 predictable random generator. - * for predictable, a random number is generated, - * whether or not it is even possible that the stone will be able to pass. - */ - if (cave->slime_predictable ? ((rrr /* XXX */ & cave->slime_permeability_c64) == 0) : gd_rand_int_range(cave->random, 0, 1000000) < cave->slime_permeability) + // unpredictable: gd_rand_int_range + // predictable: c64 predictable random generator. + // for predictable, a random number is generated, + // whether or not it is even possible that the stone will be able to pass. + if (cave->slime_predictable ? + ((gd_cave_c64_random(cave) & cave->slime_permeability_c64) == 0) : + gd_rand_int_range(cave->random, 0, 1000000) < cave->slime_permeability) { GdDirection grav = cave->gravity; GdDirection oppos = opposite[cave->gravity]; @@ -3515,7 +3504,6 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, { // output a falling xy under store_dir(cave, x, y, grav, cave->slime_converts_1); - store_dir(cave, x, y, oppos, O_SPACE); play_sound_of_element(cave, O_SLIME, x, y); } -- 2.34.1