Bug Fixes

This commit is contained in:
dawnDus 2022-04-26 23:23:14 -04:00
parent 7dcf30f854
commit 7e793e09a8
No known key found for this signature in database
GPG Key ID: 972AABDE81848F21
5 changed files with 15 additions and 12 deletions

View File

@ -63,7 +63,7 @@ impl NikumaruCounter {
let mut random_list: [u8; 4] = [0; 4];
for iter in 0..=3 {
random_list[iter] = state.game_rng.range(0..250) as u8 + iter as u8;
random_list[iter] = state.effect_rng.range(0..250) as u8 + iter as u8;
ticks[iter] = u32::from_le_bytes([
ticks[iter].to_le_bytes()[0].wrapping_add(random_list[iter]),

View File

@ -1130,9 +1130,9 @@ impl NPC {
}
if player.x > self.x + 0x28000
&& player.x < self.x - 0x28000
&& player.y > self.y + 0x1e000
&& player.y < self.y - 0x1e000
|| player.x < self.x - 0x28000
|| player.y > self.y + 0x1e000
|| player.y < self.y - 0x1e000
{
self.action_num = 0;
}

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.game_rng.range(-8..8) * 0x200) as i32;
droplet.x = npc.x + (npc.rng.range(-8..8) * 0x200) as i32;
droplet.vel_x = npc.vel_x + state.game_rng.range(-0x200..0x200);
droplet.vel_x = npc.vel_x + npc.rng.range(-0x200..0x200);
droplet.vel_y = match () {
_ if vertical_splash => state.game_rng.range(-0x200..0x80) - (npc.vel_y / 2),
_ if horizontal_splash => state.game_rng.range(-0x200..0x80),
_ if vertical_splash => npc.rng.range(-0x200..0x80) - (npc.vel_y / 2),
_ if horizontal_splash => npc.rng.range(-0x200..0x80),
_ => 0,
};
@ -1656,6 +1656,8 @@ impl Scene for GameScene {
// I'd personally set it to something higher but left it as is for accuracy.
state.water_level = 0x1e0000;
state.carets.clear();
self.lighting_mode = match () {
_ if self.intro_mode => LightingMode::None,
_ if !state.constants.is_switch

View File

@ -51,6 +51,7 @@ pub struct Settings {
#[serde(default = "default_vsync")]
pub vsync_mode: VSyncMode,
pub debug_mode: bool,
#[serde(skip)]
pub noclip: bool,
}

View File

@ -204,7 +204,7 @@ impl Bullet {
if self.action_num == 0 {
self.action_num = 1;
self.anim_num = state.game_rng.range(0..2) as u16;
self.anim_num = state.effect_rng.range(0..2) as u16;
match self.direction {
Direction::Left => self.vel_x = -0x600,
@ -235,7 +235,7 @@ impl Bullet {
if self.action_num == 0 {
self.action_num = 1;
self.anim_num = state.game_rng.range(0..2) as u16;
self.anim_num = state.effect_rng.range(0..2) as u16;
match self.direction {
Direction::Left => {
@ -1959,8 +1959,8 @@ impl PhysicalEntity for Bullet {
npc.y = (y * 16 + 8) * 0x200;
for _ in 0..4 {
npc.vel_x = state.game_rng.range(-0x200..0x200) as i32;
npc.vel_y = state.game_rng.range(-0x200..0x200) as i32;
npc.vel_x = npc.rng.range(-0x200..0x200) as i32;
npc.vel_y = npc.rng.range(-0x200..0x200) as i32;
let _ = npc_list.spawn(0x100, npc.clone());
}