Merge branch 'master' of ssh://cryps.gg:40022/~/cryps
This commit is contained in:
commit
21988ccc77
@ -129,6 +129,7 @@ impl CrypStat {
|
||||
pub fn force(&mut self, v: u64) -> &mut CrypStat {
|
||||
self.base = v;
|
||||
self.value = v;
|
||||
self.max = v;
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
@ -973,6 +973,33 @@ mod tests {
|
||||
assert!(y.hp() > prev_hp);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn recharge_test() {
|
||||
let mut x = Cryp::new()
|
||||
.named(&"muji".to_string());
|
||||
|
||||
let mut y = Cryp::new()
|
||||
.named(&"pretaliation".to_string());
|
||||
|
||||
y.red_shield.force(50);
|
||||
y.blue_shield.force(50);
|
||||
|
||||
y.deal_red_damage(Skill::Attack, 5);
|
||||
y.deal_blue_damage(Skill::Blast, 5);
|
||||
|
||||
let mut res = Resolution::new(Skill::Recharge);
|
||||
res = recharge(&mut x, &mut y, res);
|
||||
|
||||
match res.results[0] {
|
||||
ResolutionResult::Recharge { red, blue, immunity: _ } => {
|
||||
assert!(red == 5);
|
||||
assert!(blue == 5);
|
||||
}
|
||||
_ => panic!("result was not recharge"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn silence_test() {
|
||||
let mut x = Cryp::new()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user