clutch delta hps
This commit is contained in:
parent
8bdf2d576d
commit
d814e20656
@ -504,10 +504,12 @@ impl Cryp {
|
|||||||
},
|
},
|
||||||
true => {
|
true => {
|
||||||
// there is no green shield (yet)
|
// there is no green shield (yet)
|
||||||
|
let current_hp = self.hp();
|
||||||
self.reduce_hp(modified_healing);
|
self.reduce_hp(modified_healing);
|
||||||
|
let delta = current_hp - self.hp();
|
||||||
|
|
||||||
return ResolutionResult::Inversion {
|
return ResolutionResult::Inversion {
|
||||||
damage: modified_healing,
|
damage: delta,
|
||||||
healing: 0,
|
healing: 0,
|
||||||
recharge: 0,
|
recharge: 0,
|
||||||
category: Category::GreenDamage,
|
category: Category::GreenDamage,
|
||||||
@ -552,10 +554,12 @@ impl Cryp {
|
|||||||
self.red_shield.reduce(mitigation);
|
self.red_shield.reduce(mitigation);
|
||||||
|
|
||||||
// deal remainder to hp
|
// deal remainder to hp
|
||||||
|
let current_hp = self.hp();
|
||||||
self.reduce_hp(remainder);
|
self.reduce_hp(remainder);
|
||||||
|
let delta = current_hp - self.hp();
|
||||||
|
|
||||||
return ResolutionResult::Damage {
|
return ResolutionResult::Damage {
|
||||||
amount: remainder,
|
amount: delta,
|
||||||
mitigation,
|
mitigation,
|
||||||
category: Category::RedDamage,
|
category: Category::RedDamage,
|
||||||
immunity,
|
immunity,
|
||||||
@ -610,10 +614,13 @@ impl Cryp {
|
|||||||
let mitigation = modified_damage.saturating_sub(remainder);
|
let mitigation = modified_damage.saturating_sub(remainder);
|
||||||
|
|
||||||
self.blue_shield.reduce(mitigation);
|
self.blue_shield.reduce(mitigation);
|
||||||
|
|
||||||
|
let current_hp = self.hp();
|
||||||
self.reduce_hp(remainder);
|
self.reduce_hp(remainder);
|
||||||
|
let delta = current_hp - self.hp();
|
||||||
|
|
||||||
return ResolutionResult::Damage {
|
return ResolutionResult::Damage {
|
||||||
amount: remainder,
|
amount: delta,
|
||||||
mitigation,
|
mitigation,
|
||||||
category: Category::BlueDamage,
|
category: Category::BlueDamage,
|
||||||
immunity,
|
immunity,
|
||||||
@ -811,6 +818,4 @@ mod tests {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -984,9 +984,13 @@ mod tests {
|
|||||||
clutch(&mut y.clone(), &mut y, Resolution::new(Skill::Clutch));
|
clutch(&mut y.clone(), &mut y, Resolution::new(Skill::Clutch));
|
||||||
assert!(y.is_clutch());
|
assert!(y.is_clutch());
|
||||||
|
|
||||||
attack(&mut x, &mut y, Resolution::new(Skill::Attack));
|
let res = attack(&mut x, &mut y, Resolution::new(Skill::Attack));
|
||||||
|
|
||||||
assert!(y.hp() == 1);
|
assert!(y.hp() == 1);
|
||||||
|
|
||||||
|
match res.results[0] {
|
||||||
|
ResolutionResult::Damage { amount, mitigation: _, category: _, immunity: _ } => assert_eq!(amount, 1023),
|
||||||
|
_ => panic!("not damage"),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user