slay healing tbi

This commit is contained in:
ntr 2019-12-08 16:34:06 +10:00
parent 8b4b3a56e9
commit f880a2acd7

View File

@ -510,7 +510,16 @@ impl Game {
Value::ColourSkills { construct, colour, mult } => unimplemented!(), Value::ColourSkills { construct, colour, mult } => unimplemented!(),
Value::DamageTaken { construct, colour, mult } => unimplemented!(), Value::DamageTaken { construct, colour, mult } =>
resolutions.iter().fold(0, |dmg, res| match res.event {
Event::Damage { construct: event_construct, amount, mitigation:_, colour: event_colour, display: _ } =>
match *construct == event_construct && *colour == event_colour {
true => dmg + amount,
false => dmg,
}
_ => dmg,
}),
// Skills { construct: Uuid, colour: Colour }, // Skills { construct: Uuid, colour: Colour },
} }
}) })
@ -1681,4 +1690,15 @@ mod tests {
println!("{:?}", game.resolutions); println!("{:?}", game.resolutions);
} }
#[test]
fn slay_test() {
let mut game = create_2v2_test_game();
let player_id = game.players[0].id;
let source = game.players[0].constructs[0].id;
let target = game.players[1].constructs[0].id;
game.resolve(Cast::new(source, player_id, target, Skill::Slay));
println!("{:#?}", game.resolutions);
}
} }