fix siphon resolution

This commit is contained in:
ntr 2019-04-17 12:44:03 +10:00
parent 1874db2902
commit 6153418435

View File

@ -1059,9 +1059,9 @@ fn siphon_tick(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions) -
for e in siphon_events {
match e {
Event::Damage { amount, mitigation: _, colour: _, skill: _ } => {
let dmg = source.deal_green_damage(Skill::Siphon, amount);
for e in dmg {
results.push(Resolution::new(source, target).event(e));
let heal = source.deal_green_damage(Skill::Siphon, amount);
for e in heal {
results.push(Resolution::new(source, source).event(e));
};
},
_ => (),
@ -1299,9 +1299,12 @@ mod tests {
_ => panic!("not siphon"),
};
let Resolution { source: _, target: _, event } = results.remove(0);
let Resolution { source: _, target, event } = results.remove(0);
match event {
Event::Healing { amount, skill: _, overhealing: _ } => assert_eq!(amount, 256),
Event::Healing { amount, skill: _, overhealing: _ } => {
assert_eq!(amount, 256);
assert_eq!(target.id, x.id);
},
_ => panic!("not healing"),
};