mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-09-29 21:49:33 +00:00
Drowning fixes
This commit is contained in:
parent
38efa5ded9
commit
e6632a845d
|
@ -170,8 +170,11 @@ impl Player {
|
||||||
} else if state.get_flag(4000) {
|
} else if state.get_flag(4000) {
|
||||||
state.textscript_vm.start_script(1100);
|
state.textscript_vm.start_script(1100);
|
||||||
} else {
|
} else {
|
||||||
|
// Switch uses player sprite for drowned effect
|
||||||
|
if !state.constants.is_switch {
|
||||||
self.cond.set_hidden(true);
|
self.cond.set_hidden(true);
|
||||||
state.create_caret(self.x, self.y, CaretType::DrownedQuote, self.direction);
|
state.create_caret(self.x, self.y, CaretType::DrownedQuote, self.direction);
|
||||||
|
}
|
||||||
state.textscript_vm.start_script(41);
|
state.textscript_vm.start_script(41);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -778,6 +781,12 @@ impl Player {
|
||||||
} else {
|
} else {
|
||||||
PlayerAppearanceState::Default
|
PlayerAppearanceState::Default
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if state.constants.is_switch && self.air == 0 && self.flags.in_water() && !state.get_flag(4000) {
|
||||||
|
self.skin.set_appearance(PlayerAppearanceState::Default);
|
||||||
|
self.skin.set_state(PlayerAnimationState::Drowned);
|
||||||
|
}
|
||||||
|
|
||||||
self.anim_rect = self.skin.animation_frame();
|
self.anim_rect = self.skin.animation_frame();
|
||||||
|
|
||||||
self.tick = self.tick.wrapping_add(1);
|
self.tick = self.tick.wrapping_add(1);
|
||||||
|
|
|
@ -138,6 +138,7 @@ impl PlayerSkin for BasicPlayerSkin {
|
||||||
PlayerAnimationState::FallingLookingUp => 4,
|
PlayerAnimationState::FallingLookingUp => 4,
|
||||||
PlayerAnimationState::FallingLookingDown => 6,
|
PlayerAnimationState::FallingLookingDown => 6,
|
||||||
PlayerAnimationState::FallingUpsideDown => 10,
|
PlayerAnimationState::FallingUpsideDown => 10,
|
||||||
|
PlayerAnimationState::Drowned => 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
let y_offset = if direction == Direction::Left { 0 } else { self.metadata.frame_size_height }
|
let y_offset = if direction == Direction::Left { 0 } else { self.metadata.frame_size_height }
|
||||||
|
|
|
@ -28,6 +28,7 @@ pub enum PlayerAnimationState {
|
||||||
FallingLookingUp,
|
FallingLookingUp,
|
||||||
FallingLookingDown,
|
FallingLookingDown,
|
||||||
FallingUpsideDown,
|
FallingUpsideDown,
|
||||||
|
Drowned,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents an alternative appearance of player eg. wearing a Mimiga Mask
|
/// Represents an alternative appearance of player eg. wearing a Mimiga Mask
|
||||||
|
|
|
@ -1587,6 +1587,9 @@ impl TextScriptVM {
|
||||||
exec_state = TextScriptExecutionState::Running(event, cursor.position() as u32);
|
exec_state = TextScriptExecutionState::Running(event, cursor.position() as u32);
|
||||||
}
|
}
|
||||||
TSCOpCode::INI => {
|
TSCOpCode::INI => {
|
||||||
|
game_scene.player1.flags.0 = 0;
|
||||||
|
game_scene.player2.flags.0 = 0;
|
||||||
|
|
||||||
exec_state = TextScriptExecutionState::Reset;
|
exec_state = TextScriptExecutionState::Reset;
|
||||||
}
|
}
|
||||||
TSCOpCode::ESC => {
|
TSCOpCode::ESC => {
|
||||||
|
@ -1601,6 +1604,9 @@ impl TextScriptVM {
|
||||||
exec_state = TextScriptExecutionState::SaveProfile(event, cursor.position() as u32);
|
exec_state = TextScriptExecutionState::SaveProfile(event, cursor.position() as u32);
|
||||||
}
|
}
|
||||||
TSCOpCode::LDP => {
|
TSCOpCode::LDP => {
|
||||||
|
game_scene.player1.flags.0 = 0;
|
||||||
|
game_scene.player2.flags.0 = 0;
|
||||||
|
|
||||||
state.control_flags.set_tick_world(false);
|
state.control_flags.set_tick_world(false);
|
||||||
state.control_flags.set_control_enabled(false);
|
state.control_flags.set_control_enabled(false);
|
||||||
state.control_flags.set_interactions_disabled(true);
|
state.control_flags.set_interactions_disabled(true);
|
||||||
|
|
Loading…
Reference in a new issue