sustain test
This commit is contained in:
parent
1708e02057
commit
46e8da5ba9
@ -73,6 +73,7 @@ impl Effect {
|
||||
match self {
|
||||
Effect::Banish => true,
|
||||
|
||||
// delete sustain immunitiy???
|
||||
Effect::Sustain => [
|
||||
Skill::Stun,
|
||||
Skill::Silence,
|
||||
@ -201,7 +202,10 @@ impl Effect {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn colour(&self) -> Option<Colour> {
|
||||
// Old colour matching system for buffs / debuffs
|
||||
// Had issues as some effects will be considered as both a buff and debuff e.g. invert,
|
||||
// Ended up being confusing with mismatch skills that have red / blue e.g. amplify, haste, hybrid
|
||||
/* pub fn colour(&self) -> Option<Colour> {
|
||||
match self {
|
||||
// physical
|
||||
Effect::Stun => Some(Colour::Red),
|
||||
@ -247,5 +251,5 @@ impl Effect {
|
||||
Effect::Siphoned => None,
|
||||
Effect::Ko => None,
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@ -1963,7 +1963,30 @@ mod tests {
|
||||
construct == interceptor && (amount > 0 || mitigation > 0) && colour == Colour::Red,
|
||||
_ => false,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sustain_test() {
|
||||
|
||||
// Standard case where construct gets ko from a big hit
|
||||
let mut game = create_2v2_test_game();
|
||||
let player = game.players[0].id;
|
||||
let source = game.players[0].constructs[0].id;
|
||||
let target = game.players[1].constructs[0].id;
|
||||
game.players[0].constructs[0].red_power.force(1000000);
|
||||
game.resolve(Cast::new(source, player, target, Skill::Attack), vec![]);
|
||||
assert!(game.players[1].constructs[0].is_ko() == true);
|
||||
|
||||
// Sustain case where construct survives
|
||||
let mut game = create_2v2_test_game();
|
||||
let player = game.players[0].id;
|
||||
let source = game.players[0].constructs[0].id;
|
||||
let target = game.players[1].constructs[0].id;
|
||||
game.players[0].constructs[0].red_power.force(1000000);
|
||||
game.resolve(Cast::new(source, player, target, Skill::Sustain), vec![]);
|
||||
game.resolve(Cast::new(source, player, target, Skill::Attack), vec![]);
|
||||
assert!(game.players[1].constructs[0].is_ko() == false);
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user