fix tests with stat change
This commit is contained in:
parent
547127b9eb
commit
b633820ca1
@ -1152,7 +1152,8 @@ mod tests {
|
|||||||
// should not be stunned because of counter
|
// should not be stunned because of counter
|
||||||
assert!(game.player_by_id(x_player.id).unwrap().constructs[0].is_stunned() == false);
|
assert!(game.player_by_id(x_player.id).unwrap().constructs[0].is_stunned() == false);
|
||||||
// riposte
|
// 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]
|
#[test]
|
||||||
@ -1235,7 +1236,7 @@ mod tests {
|
|||||||
assert_eq!(target.id, y_construct.id);
|
assert_eq!(target.id, y_construct.id);
|
||||||
match event {
|
match event {
|
||||||
Event::Damage { amount, skill: _, mitigation: _, colour: _} =>
|
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"),
|
_ => panic!("not damage link"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1872,6 +1872,7 @@ mod tests {
|
|||||||
.named(&"camel".to_string());
|
.named(&"camel".to_string());
|
||||||
|
|
||||||
x.red_power.force(10000000000000); // multiplication of int max will cause overflow
|
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);
|
sustain(&mut y.clone(), &mut y, vec![], Skill::Sustain);
|
||||||
assert!(y.affected(Effect::Sustain));
|
assert!(y.affected(Effect::Sustain));
|
||||||
@ -1968,6 +1969,8 @@ mod tests {
|
|||||||
let mut y = Construct::new()
|
let mut y = Construct::new()
|
||||||
.named(&"camel".to_string());
|
.named(&"camel".to_string());
|
||||||
|
|
||||||
|
x.blue_power.force(256);
|
||||||
|
x.green_life.force(1024);
|
||||||
x.green_life.reduce(512);
|
x.green_life.reduce(512);
|
||||||
|
|
||||||
let mut results = resolve(Skill::Siphon, &mut x, &mut y, vec![]);
|
let mut results = resolve(Skill::Siphon, &mut x, &mut y, vec![]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user