fix stun test

This commit is contained in:
ntr 2019-05-08 14:26:52 +10:00
parent 25fecf09ae
commit 0b6f609aad

View File

@ -1133,7 +1133,7 @@ mod tests {
// second round
// now we block and it should go back on cd
game.add_skill(x_player.id, x_cryp.id, Some(y_cryp.id), Skill::Stun).unwrap();
// game.add_skill(x_player.id, x_cryp.id, Some(y_cryp.id), Skill::Stun).unwrap();
game.add_skill(y_player.id, y_cryp.id, Some(x_cryp.id), Skill::TestTouch).unwrap();
game.player_ready(x_player.id).unwrap();
@ -1430,13 +1430,16 @@ mod tests {
let y_cryp = y_player.cryps[0].clone();
game.cryp_by_id(x_cryp.id).unwrap().learn_mut(Skill::Decay);
while game.cryp_by_id(x_cryp.id).unwrap().skill_on_cd(Skill::Decay).is_some() {
game.cryp_by_id(x_cryp.id).unwrap().reduce_cooldowns();
}
game.cryp_by_id(y_cryp.id).unwrap().learn_mut(Skill::Purify);
game.cryp_by_id(x_cryp.id).unwrap().learn_mut(Skill::Siphon);
while game.cryp_by_id(x_cryp.id).unwrap().skill_on_cd(Skill::Siphon).is_some() {
game.cryp_by_id(x_cryp.id).unwrap().reduce_cooldowns();
}
game.cryp_by_id(y_cryp.id).unwrap().learn_mut(Skill::Purify);
while game.cryp_by_id(y_cryp.id).unwrap().skill_on_cd(Skill::Purify).is_some() {
game.cryp_by_id(y_cryp.id).unwrap().reduce_cooldowns();
}
@ -1464,10 +1467,30 @@ mod tests {
while let Some(Resolution { source: _, target: _, event }) = game.resolved.pop() {
match event {
Event::Damage { amount: _, skill, mitigation: _, colour: _ } => panic!("{:?} damage event", event),
Event::Damage { amount: _, skill: _, mitigation: _, colour: _ } => panic!("{:?} damage event", event),
_ => (),
}
};
game.add_skill(y_player.id, x_cryp.id, Some(y_cryp.id), Skill::Siphon).unwrap();
game.player_ready(x_player.id).unwrap();
game.player_ready(y_player.id).unwrap();
game = game.resolve_phase_start();
game.resolved.clear();
game.add_skill(y_player.id, y_cryp.id, Some(y_cryp.id), Skill::Purify).unwrap();
game.player_ready(x_player.id).unwrap();
game.player_ready(y_player.id).unwrap();
game = game.resolve_phase_start();
while let Some(Resolution { source: _, target: _, event }) = game.resolved.pop() {
match event {
Event::Damage { amount: _, skill: _, mitigation: _, colour: _ } => panic!("{:?} damage event", event),
_ => (),
}
};
}
#[test]