Add check that all Auras have an EnchantAbility to VerifyCardDataTest

This commit is contained in:
Alex W. Jackson 2022-01-26 11:36:28 -05:00
parent 743d1771f0
commit f06f4ab252
3 changed files with 11 additions and 3 deletions

View file

@ -4,6 +4,7 @@ package mage.cards.g;
import java.util.UUID; import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.ControlEnchantedEffect; import mage.abilities.effects.common.continuous.ControlEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -29,6 +30,7 @@ public final class GhastlyHaunting extends CardImpl {
// Enchant creature // Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// You control enchanted creature. // You control enchanted creature.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect()));

View file

@ -1,11 +1,10 @@
package mage.cards.v; package mage.cards.v;
import java.util.UUID; import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -26,6 +25,7 @@ public final class Vigilance extends CardImpl {
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA)));
} }

View file

@ -7,6 +7,7 @@ import mage.abilities.common.SagaAbility;
import mage.abilities.common.WerewolfBackTriggeredAbility; import mage.abilities.common.WerewolfBackTriggeredAbility;
import mage.abilities.common.WerewolfFrontTriggeredAbility; import mage.abilities.common.WerewolfFrontTriggeredAbility;
import mage.abilities.effects.keyword.ScryEffect; import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.MenaceAbility; import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.MultikickerAbility; import mage.abilities.keyword.MultikickerAbility;
import mage.abilities.keyword.TransformAbility; import mage.abilities.keyword.TransformAbility;
@ -1383,9 +1384,14 @@ public class VerifyCardDataTest {
fail(card, "abilities", "card have Multikicker ability, but missing it in rules text"); fail(card, "abilities", "card have Multikicker ability, but missing it in rules text");
} }
// special check: Auras need to have enchant ability added
if (card.hasSubtype(SubType.AURA, null) && !card.getAbilities().containsClass(EnchantAbility.class)) {
fail(card, "abilities", "card is an Aura but is missing this.addAbility(EnchantAbility)");
}
// special check: Sagas need to have saga ability added // special check: Sagas need to have saga ability added
if (card.hasSubtype(SubType.SAGA, null) && !card.getAbilities().containsClass(SagaAbility.class)) { if (card.hasSubtype(SubType.SAGA, null) && !card.getAbilities().containsClass(SagaAbility.class)) {
fail(card, "abilities", "card is a Saga but is missing this.addAbility(sagaAbility)"); fail(card, "abilities", "card is a Saga but is missing this.addAbility(SagaAbility)");
} }
// special check: Werewolves front ability should only be on front and vice versa // special check: Werewolves front ability should only be on front and vice versa