1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-22 13:42:47 +00:00

Use game_rng for NPC splash effect

This commit is contained in:
dawnDus 2022-03-27 08:40:14 -04:00
parent 8b31d0a9ab
commit 2bce0136ff
No known key found for this signature in database
GPG key ID: 972AABDE81848F21

View file

@ -1105,12 +1105,12 @@ impl GameScene {
if npc.flags.water_splash_facing_right() { Direction::Right } else { Direction::Left };
for _ in 0..7 {
droplet.x = npc.x + (state.effect_rng.range(-8..8) * 0x200) as i32;
droplet.x = npc.x + (state.game_rng.range(-8..8) * 0x200) as i32;
droplet.vel_x = npc.vel_x + state.effect_rng.range(-0x200..0x200);
droplet.vel_x = npc.vel_x + state.game_rng.range(-0x200..0x200);
droplet.vel_y = match () {
_ if vertical_splash => state.effect_rng.range(-0x200..0x80) - (npc.vel_y / 2),
_ if horizontal_splash => state.effect_rng.range(-0x200..0x80),
_ if vertical_splash => state.game_rng.range(-0x200..0x80) - (npc.vel_y / 2),
_ if horizontal_splash => state.game_rng.range(-0x200..0x80),
_ => 0,
};