diff --git a/src/engine_constants/mod.rs b/src/engine_constants/mod.rs index c1ac745..d5cd6ce 100644 --- a/src/engine_constants/mod.rs +++ b/src/engine_constants/mod.rs @@ -54,6 +54,7 @@ pub struct GameConsts { pub new_game_stage: u16, pub new_game_event: u16, pub new_game_player_pos: (i16, i16), + pub tile_offset_x: i32, } #[derive(Debug)] @@ -311,6 +312,7 @@ impl EngineConstants { new_game_stage: 13, new_game_event: 200, new_game_player_pos: (10, 8), + tile_offset_x: 0, }, player: PlayerConsts { life: 3, @@ -1581,6 +1583,7 @@ impl EngineConstants { self.textscript.text_speed_fast = 0; self.soundtracks.insert("Famitracks".to_owned(), "/base/ogg17/".to_owned()); self.soundtracks.insert("Ridiculon".to_owned(), "/base/ogg_ridic/".to_owned()); + self.game.tile_offset_x = 3; } pub fn apply_constant_json_files(&mut self) {} diff --git a/src/npc/ai/mimiga_village.rs b/src/npc/ai/mimiga_village.rs index e85ad26..47914f4 100644 --- a/src/npc/ai/mimiga_village.rs +++ b/src/npc/ai/mimiga_village.rs @@ -627,7 +627,7 @@ impl NPC { if self.action_counter % 6 == 0 { let mut npc = NPC::create(314, &state.npc_table); npc.cond.set_alive(true); - npc.x = self.rng.range(4..16) * 0x2000; + npc.x = (self.rng.range(4..16) + state.constants.game.tile_offset_x) * 0x2000; npc.y = 0x2000; let _ = npc_list.spawn(0x100, npc); @@ -697,7 +697,7 @@ impl NPC { if self.action_counter % 6 == 0 { let mut npc = NPC::create(315, &state.npc_table); npc.cond.set_alive(true); - npc.x = self.rng.range(4..16) * 0x2000; + npc.x = (self.rng.range(4..16) + state.constants.game.tile_offset_x) * 0x2000; let _ = npc_list.spawn(0x100, npc); } diff --git a/src/npc/boss/heavy_press.rs b/src/npc/boss/heavy_press.rs index 8d4addc..2b29b89 100644 --- a/src/npc/boss/heavy_press.rs +++ b/src/npc/boss/heavy_press.rs @@ -88,7 +88,7 @@ impl BossNPC { if self.parts[0].action_num == 20 { self.parts[0].action_num = 21; self.parts[0].damage = 0; - self.parts[0].x = if !state.constants.is_switch { 0x14000 } else { 0x1A000 }; + self.parts[0].x = 0x14000 + (state.constants.game.tile_offset_x * 0x2000); self.parts[0].y = 0x33A00; self.parts[0].npc_flags.set_solid_hard(false); self.parts[1].cond.set_alive(false); @@ -110,7 +110,7 @@ impl BossNPC { if self.parts[0].action_num == 30 { self.parts[0].action_num = 31; self.parts[0].anim_num = 2; - self.parts[0].x = if !state.constants.is_switch { 0x14000 } else { 0x1A000 }; + self.parts[0].x = 0x14000 + (state.constants.game.tile_offset_x * 0x2000); self.parts[0].y = 0x8000; } self.parts[0].y += 0x800; diff --git a/src/npc/boss/ironhead.rs b/src/npc/boss/ironhead.rs index e4d2168..8b276b0 100644 --- a/src/npc/boss/ironhead.rs +++ b/src/npc/boss/ironhead.rs @@ -224,7 +224,7 @@ impl BossNPC { } 250 | 251 => { let player = self.parts[0].get_closest_player_ref(&players); - let switch_buffer = if state.constants.is_switch { 0x6000 } else { 0 }; // Buffer to stop Ironhead's teleport to be visible + let switch_buffer = state.constants.game.tile_offset_x * 0x2000; // Buffer to stop Ironhead's teleport to be visible if self.parts[0].action_num == 250 { self.parts[0].action_num = 251; if self.parts[0].direction == Direction::Right { diff --git a/src/npc/boss/sisters.rs b/src/npc/boss/sisters.rs index 7b47bc3..81222f4 100644 --- a/src/npc/boss/sisters.rs +++ b/src/npc/boss/sisters.rs @@ -21,7 +21,7 @@ impl BossNPC { self.parts[0].direction = Direction::Left; self.parts[0].action_num = 10; self.parts[0].exp = 0; - self.parts[0].x = if !state.constants.is_switch { 0x14000 } else { 0x1A000 }; + self.parts[0].x = 0x14000 + (state.constants.game.tile_offset_x * 0x2000); self.parts[0].y = 0x10000; self.parts[0].display_bounds = Rect::new(0x1000, 0x1000, 0x10000, 0x1000); self.parts[0].hit_bounds = Rect::new(0x1000, 0x1000, 0x1000, 0x1000);