diff --git a/core/src/effect.rs b/core/src/effect.rs index 9c58f2b9..d65a518c 100644 --- a/core/src/effect.rs +++ b/core/src/effect.rs @@ -75,6 +75,7 @@ impl Effect { match self { Effect::Banish => true, + // delete sustain immunitiy??? Effect::Sustain => [ Skill::Stun, Skill::Silence, @@ -198,7 +199,10 @@ impl Effect { } } - pub fn colour(&self) -> Option { + // 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 { match self { // physical Effect::Stun => Some(Colour::Red), @@ -245,5 +249,5 @@ impl Effect { Effect::Countered => None, Effect::Ko => None, } - } + }*/ } diff --git a/core/src/game.rs b/core/src/game.rs index 8f7e01c8..f53b6700 100644 --- a/core/src/game.rs +++ b/core/src/game.rs @@ -1970,6 +1970,28 @@ mod tests { })); } + #[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.new_resolve(Cast::new(source, player, target, Skill::Attack)); + 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.new_resolve(Cast::new(source, player, target, Skill::Sustain)); + game.new_resolve(Cast::new(source, player, target, Skill::Attack)); + assert!(game.players[1].constructs[0].is_ko() == false); + } + #[test] fn tick_consistency_test() { let mut game = create_test_game();