cooldown fix

This commit is contained in:
ntr 2019-12-13 15:15:21 +10:00
parent f63a8b3f8f
commit 5555c930e2
2 changed files with 3 additions and 5 deletions

View File

@ -590,6 +590,7 @@ impl Game {
fn add_resolution(&mut self, cast: &Cast, event: &Event) -> &mut Game { fn add_resolution(&mut self, cast: &Cast, event: &Event) -> &mut Game {
let last = self.resolutions.len() - 1; let last = self.resolutions.len() - 1;
println!("{:?}", event);
self.resolutions[last].push(Resolution::new(cast.clone(), event.clone())); self.resolutions[last].push(Resolution::new(cast.clone(), event.clone()));
self self
} }
@ -1227,7 +1228,6 @@ mod tests {
game = game.resolve_phase_start(); game = game.resolve_phase_start();
// println!("{:?}", game.player_by_id(x_player.id).unwrap().constructs[0]);
assert!(game.player_by_id(x_player.id).unwrap().constructs[0].skill_on_cd(Skill::Stun).is_some()); assert!(game.player_by_id(x_player.id).unwrap().constructs[0].skill_on_cd(Skill::Stun).is_some());
assert!(game.player_by_id(y_player.id).unwrap().constructs[0].skill_on_cd(Skill::Block).is_none()); assert!(game.player_by_id(y_player.id).unwrap().constructs[0].skill_on_cd(Skill::Block).is_none());
} }

View File

@ -48,13 +48,11 @@ impl Cast {
} }
pub fn resolve(self, game: &mut Game) { pub fn resolve(self, game: &mut Game) {
let mut actions = vec![];
if !self.skill.aoe() { if !self.skill.aoe() {
if self.skill.cast_animation() { if self.skill.cast_animation() {
actions.push(Action::Cast); game.action(self, Action::Cast);
} }
actions.push(Action::Hit); game.action(self, Action::Hit);
} }
match self.skill { match self.skill {