mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
dies triggers improves:
* tests: added additional tests and verify/runtime checks for wrong die trigger settings; * refactor: removed some usage of short LKI ; * fixed dies events support in "or trigger" and "conditional trigger" (use cases like sacrifice cost); * fixed dies events support in shared triggered abilities (use cases like sacrifice cost);
This commit is contained in:
parent
a2ed52b8de
commit
66b338c6fc
18 changed files with 233 additions and 63 deletions
|
|
@ -7,6 +7,7 @@ import mage.ObjectColor;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.AbilityImpl;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.*;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
|
@ -1979,10 +1980,23 @@ public class VerifyCardDataTest {
|
|||
fail(card, "abilities", "legendary nonpermanent cards need to have LegendarySpellAbility");
|
||||
}
|
||||
|
||||
// special check: mutate is not supported yet, so must be removed from sets
|
||||
if (card.getAbilities().containsClass(MutateAbility.class)) {
|
||||
fail(card, "abilities", "mutate cards aren't implemented and shouldn't be available");
|
||||
}
|
||||
|
||||
// special check: wrong dies triggers
|
||||
card.getAbilities().stream()
|
||||
.filter(a -> a instanceof TriggeredAbility)
|
||||
.map(a -> (TriggeredAbility) a)
|
||||
.filter(a -> a.getRule().contains("whenever") || a.getRule().contains("Whenever"))
|
||||
.filter(a -> a.getRule().contains("dies"))
|
||||
.filter(a -> !a.getRule().contains("with \"When")) // ignore token creating effects
|
||||
.filter(a -> !a.isLeavesTheBattlefieldTrigger())
|
||||
.forEach(a -> {
|
||||
fail(card, "abilities", "dies trigger must use setLeavesTheBattlefieldTrigger(true) and override isInUseableZone - " + a.getClass().getSimpleName());
|
||||
});
|
||||
|
||||
// special check: duplicated words in ability text (wrong target/filter usage)
|
||||
// example: You may exile __two two__ blue cards
|
||||
// possible fixes:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue