fix tests with stat change

This commit is contained in:
Mashy 2019-09-06 14:28:42 +10:00
parent 547127b9eb
commit b633820ca1
2 changed files with 6 additions and 2 deletions

View File

@ -1152,7 +1152,8 @@ mod tests {
// should not be stunned because of counter
assert!(game.player_by_id(x_player.id).unwrap().constructs[0].is_stunned() == false);
// riposte
assert_eq!(game.player_by_id(y_player.id).unwrap().constructs[0].green_life(), (1024 - x_construct.red_power().pct(Skill::CounterAttack.multiplier())));
assert_eq!(game.player_by_id(y_player.id).unwrap().constructs[0].green_life(), (
y_construct.green_life() - x_construct.red_power().pct(Skill::CounterAttack.multiplier())));
}
#[test]
@ -1235,7 +1236,7 @@ mod tests {
assert_eq!(target.id, y_construct.id);
match event {
Event::Damage { amount, skill: _, mitigation: _, colour: _} =>
assert_eq!(amount, 256.pct(Skill::Attack.multiplier()) >> 1),
assert_eq!(amount, x_construct.red_power().pct(Skill::Attack.multiplier()) >> 1),
_ => panic!("not damage link"),
};
}

View File

@ -1872,6 +1872,7 @@ mod tests {
.named(&"camel".to_string());
x.red_power.force(10000000000000); // multiplication of int max will cause overflow
y.green_life.force(1024); // make tests more flexible if we change stats
sustain(&mut y.clone(), &mut y, vec![], Skill::Sustain);
assert!(y.affected(Effect::Sustain));
@ -1968,6 +1969,8 @@ mod tests {
let mut y = Construct::new()
.named(&"camel".to_string());
x.blue_power.force(256);
x.green_life.force(1024);
x.green_life.reduce(512);
let mut results = resolve(Skill::Siphon, &mut x, &mut y, vec![]);