mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-09-28 21:19:24 +00:00
Reset invicibility timer (#30)
This commit is contained in:
parent
be91851952
commit
e27cde67c7
|
@ -835,6 +835,10 @@ impl GameEntity<&NPCList> for Player {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
if state.textscript_vm.reset_invicibility {
|
||||
self.shock_counter = 0;
|
||||
}
|
||||
|
||||
if self.damage_counter != 0 {
|
||||
self.damage_counter -= 1;
|
||||
}
|
||||
|
|
|
@ -1203,6 +1203,7 @@ impl GameScene {
|
|||
};
|
||||
self.player1.tick(state, &self.npc_list)?;
|
||||
self.player2.tick(state, &self.npc_list)?;
|
||||
state.textscript_vm.reset_invicibility = false;
|
||||
|
||||
if self.player1.damage > 0 {
|
||||
let xp_loss = self.player1.damage * if self.player1.equip.has_arms_barrier() { 1 } else { 2 };
|
||||
|
|
|
@ -119,6 +119,7 @@ pub struct TextScriptVM {
|
|||
/// while parsing no one noticed them.
|
||||
pub strict_mode: bool,
|
||||
pub suspend: bool,
|
||||
pub reset_invicibility: bool,
|
||||
pub numbers: [u16; 4],
|
||||
pub face: u16,
|
||||
pub item: u16,
|
||||
|
@ -184,6 +185,7 @@ impl TextScriptVM {
|
|||
executor_player: TargetPlayer::Player1,
|
||||
strict_mode: false,
|
||||
suspend: true,
|
||||
reset_invicibility: false,
|
||||
numbers: [0; 4],
|
||||
face: 0,
|
||||
item: 0,
|
||||
|
@ -253,6 +255,7 @@ impl TextScriptVM {
|
|||
|
||||
pub fn start_script(&mut self, event_num: u16) {
|
||||
self.reset();
|
||||
self.reset_invicibility = true;
|
||||
self.state = TextScriptExecutionState::Running(event_num, 0);
|
||||
|
||||
log::info!("Started script: #{:04}", event_num);
|
||||
|
|
Loading…
Reference in a new issue