1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-22 21:52:46 +00:00

Universal offset for hardcoded bosses (Switch)

This commit is contained in:
dawnDus 2022-01-26 18:51:05 -05:00
parent b99cb8a34d
commit 654cbfb814
No known key found for this signature in database
GPG key ID: 972AABDE81848F21
5 changed files with 9 additions and 6 deletions

View file

@ -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) {}

View file

@ -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);
}

View file

@ -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;

View file

@ -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 {

View file

@ -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);