diff --git a/Mage.Sets/src/mage/cards/a/AdaptiveAutomaton.java b/Mage.Sets/src/mage/cards/a/AdaptiveAutomaton.java index b9d4da3de9..9212ae9e51 100644 --- a/Mage.Sets/src/mage/cards/a/AdaptiveAutomaton.java +++ b/Mage.Sets/src/mage/cards/a/AdaptiveAutomaton.java @@ -100,7 +100,7 @@ class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { SubType subtype = (SubType) game.getState().getValue(permanent.getId() + "_type"); - if (subtype != null && !permanent.getSubtype(game).contains(subtype)) { + if (subtype != null && !permanent.hasSubtype(subtype, game)) { permanent.getSubtype(game).add(subtype); } } diff --git a/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java b/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java index 6e97c7ab13..ad910cbd04 100644 --- a/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java +++ b/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java @@ -27,11 +27,6 @@ */ package mage.cards.a; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; @@ -40,13 +35,7 @@ import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.SubType; -import mage.constants.SuperType; -import mage.constants.TargetController; -import mage.constants.WatcherScope; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterNonlandPermanent; import mage.filter.predicate.Predicate; @@ -59,6 +48,8 @@ import mage.game.permanent.Permanent; import mage.target.common.TargetNonlandPermanent; import mage.watchers.Watcher; +import java.util.*; + /** * * @author TheElk801 @@ -129,11 +120,11 @@ class DamagedByPiratesWatcher extends Watcher { if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (creature != null && creature.getSubtype(game).contains(SubType.PIRATE)) { + if (creature != null && creature.hasSubtype(SubType.PIRATE, game)) { if (damageSourceIds.keySet().contains(event.getTargetId())) { damageSourceIds.get(event.getTargetId()).add(creature.getId()); } else { - Set creatureSet = new HashSet(); + Set creatureSet = new HashSet<>(); creatureSet.add(creature.getId()); damageSourceIds.put(event.getTargetId(), creatureSet); } diff --git a/Mage.Sets/src/mage/cards/a/AjanisChosen.java b/Mage.Sets/src/mage/cards/a/AjanisChosen.java index 6fbd79e5c5..56cdd43624 100644 --- a/Mage.Sets/src/mage/cards/a/AjanisChosen.java +++ b/Mage.Sets/src/mage/cards/a/AjanisChosen.java @@ -27,7 +27,6 @@ */ package mage.cards.a; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; @@ -42,6 +41,8 @@ import mage.game.permanent.token.CatToken; import mage.game.permanent.token.Token; import mage.players.Player; +import java.util.UUID; + /** * * @author Plopman @@ -95,7 +96,7 @@ class AjanisChosenEffect extends OneShotEffect { Token token = new CatToken(); if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { Permanent enchantment = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (enchantment != null && enchantment.getSubtype(game).contains(SubType.AURA)) { + if (enchantment != null && enchantment.hasSubtype(SubType.AURA, game)) { for (UUID tokenId : token.getLastAddedTokenIds()) { Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { diff --git a/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java b/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java index b7a26eccdc..d37541c508 100644 --- a/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java +++ b/Mage.Sets/src/mage/cards/a/AnZerrinRuins.java @@ -27,7 +27,6 @@ */ package mage.cards.a; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -36,17 +35,14 @@ import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SubType; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * * @author TheElk801 @@ -95,7 +91,7 @@ class AnZerrinRuinsDontUntapEffect extends DontUntapInControllersUntapStepAllEff Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && sourcePerm != null) { SubType subtype = (SubType) game.getState().getValue(sourcePerm.getId() + "_type"); - if (permanent.getSubtype(game).contains(subtype)) { + if (permanent.hasSubtype(subtype, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java index 30c2064f2f..eb8174ae8d 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java @@ -27,9 +27,6 @@ */ package mage.cards.a; -import java.util.Iterator; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; @@ -38,13 +35,7 @@ import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.SubType; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -52,6 +43,10 @@ import mage.game.stack.Spell; import mage.game.stack.StackObject; import mage.players.Player; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; + /** * * @author TheElk801 @@ -102,7 +97,7 @@ class ConspyEffect extends ContinuousEffectImpl { // in graveyard for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card.isCreature() && !card.getSubtype(game).contains(choice)) { + if (card.isCreature() && !card.hasSubtype(choice, game)) { for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(s); } @@ -112,7 +107,7 @@ class ConspyEffect extends ContinuousEffectImpl { // on Hand for (UUID cardId : controller.getHand()) { Card card = game.getCard(cardId); - if (card.isCreature() && !card.getSubtype(game).contains(choice)) { + if (card.isCreature() && !card.hasSubtype(choice, game)) { for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(s); } @@ -121,7 +116,7 @@ class ConspyEffect extends ContinuousEffectImpl { } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.isCreature() && !card.getSubtype(game).contains(choice)) { + if (card.isCreature() && !card.hasSubtype(choice, game)) { for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(s); } @@ -130,7 +125,7 @@ class ConspyEffect extends ContinuousEffectImpl { } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.getSubtype(game).contains(choice)) { + if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.hasSubtype(choice, game)) { for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(s); } @@ -141,7 +136,7 @@ class ConspyEffect extends ContinuousEffectImpl { for (UUID commanderId : controller.getCommandersIds()) { if (game.getState().getZone(commanderId) == Zone.COMMAND) { Card card = game.getCard(commanderId); - if (card.isCreature() && !card.getSubtype(game).contains(choice)) { + if (card.isCreature() && !card.hasSubtype(choice, game)) { for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(s); } @@ -155,7 +150,7 @@ class ConspyEffect extends ContinuousEffectImpl { if (stackObject instanceof Spell && stackObject.getControllerId().equals(source.getControllerId()) && stackObject.isCreature() - && !stackObject.getSubtype(game).contains(choice)) { + && !stackObject.hasSubtype(choice, game)) { Card card = ((Spell) stackObject).getCard(); for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(s); @@ -167,7 +162,7 @@ class ConspyEffect extends ContinuousEffectImpl { List creatures = game.getBattlefield().getAllActivePermanents( new FilterControlledCreaturePermanent(), source.getControllerId(), game); for (Permanent creature : creatures) { - if (creature != null && !creature.getSubtype(game).contains(choice)) { + if (creature != null && !creature.hasSubtype(choice, game)) { creature.getSubtype(game).add(choice); } } diff --git a/Mage.Sets/src/mage/cards/a/ArmamentMaster.java b/Mage.Sets/src/mage/cards/a/ArmamentMaster.java index 9d4151670b..aef4031ef5 100644 --- a/Mage.Sets/src/mage/cards/a/ArmamentMaster.java +++ b/Mage.Sets/src/mage/cards/a/ArmamentMaster.java @@ -27,8 +27,6 @@ */ package mage.cards.a; -import java.util.List; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -41,6 +39,9 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.List; +import java.util.UUID; + /** * * @author North @@ -116,7 +117,7 @@ class ArmamentMasterEffect extends ContinuousEffectImpl { List attachments = p.getAttachments(); for (UUID attachmentId : attachments) { Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) { count++; } } diff --git a/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java b/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java index c424647775..843ff15938 100644 --- a/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java +++ b/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java @@ -87,7 +87,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl { SubType subtype = (SubType) game.getState().getValue(permanent.getId() + "_type"); for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature() && !card.getSubtype(game).contains(subtype)) { + if (card != null && card.isCreature() && !card.hasSubtype(subtype, game)) { game.getState().getCreateCardAttribute(card).getSubtype().add(subtype); } } diff --git a/Mage.Sets/src/mage/cards/a/AuramancersGuise.java b/Mage.Sets/src/mage/cards/a/AuramancersGuise.java index fb9bc68a8a..7ccaf66d28 100644 --- a/Mage.Sets/src/mage/cards/a/AuramancersGuise.java +++ b/Mage.Sets/src/mage/cards/a/AuramancersGuise.java @@ -27,8 +27,6 @@ */ package mage.cards.a; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; @@ -46,6 +44,9 @@ import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.List; +import java.util.UUID; + /** * * @author spjspj @@ -101,7 +102,7 @@ class EnchantedCreatureAurasCount implements DynamicValue { List attachments = permanent.getAttachments(); for (UUID attachmentId : attachments) { Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype(game).contains(SubType.AURA)) { + if (attached != null && attached.hasSubtype(SubType.AURA, game)) { count++; } diff --git a/Mage.Sets/src/mage/cards/b/BartelRuneaxe.java b/Mage.Sets/src/mage/cards/b/BartelRuneaxe.java index 6db21c27a6..bc03f9f2a5 100644 --- a/Mage.Sets/src/mage/cards/b/BartelRuneaxe.java +++ b/Mage.Sets/src/mage/cards/b/BartelRuneaxe.java @@ -109,7 +109,7 @@ class BartelRuneaxeEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId()); if (stackObject != null && event.getTargetId().equals(source.getSourceId())) { - if (stackObject.getSubtype(game).contains(SubType.AURA)) { + if (stackObject.hasSubtype(SubType.AURA, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/BlastfireBolt.java b/Mage.Sets/src/mage/cards/b/BlastfireBolt.java index 327a631c74..e6ac583f52 100644 --- a/Mage.Sets/src/mage/cards/b/BlastfireBolt.java +++ b/Mage.Sets/src/mage/cards/b/BlastfireBolt.java @@ -95,7 +95,7 @@ class DestroyAllAttachedEquipmentEffect extends OneShotEffect { List attachments = new ArrayList<>(target.getAttachments()); for (UUID attachmentId : attachments) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) { attachment.destroy(source.getSourceId(), game, false); } } diff --git a/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java b/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java index bd48a4c2fa..9cbfc70cc3 100644 --- a/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java +++ b/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java @@ -27,8 +27,6 @@ */ package mage.cards.b; -import java.util.List; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; @@ -47,6 +45,9 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.watchers.common.PermanentsSacrificedWatcher; +import java.util.List; +import java.util.UUID; + /** * @author LevelX2 */ @@ -88,7 +89,7 @@ enum BriarbridgePatrolCondition implements Condition { if (sacrificedPermanents != null && !sacrificedPermanents.isEmpty()) { int amountOfClues = 0; for (Permanent permanent : sacrificedPermanents) { - if (permanent.getSubtype(game).contains(SubType.CLUE)) { + if (permanent.hasSubtype(SubType.CLUE, game)) { amountOfClues++; } } diff --git a/Mage.Sets/src/mage/cards/c/CopyEnchantment.java b/Mage.Sets/src/mage/cards/c/CopyEnchantment.java index 24761d4680..cf9968c139 100644 --- a/Mage.Sets/src/mage/cards/c/CopyEnchantment.java +++ b/Mage.Sets/src/mage/cards/c/CopyEnchantment.java @@ -88,7 +88,7 @@ class CopyEnchantmentEffect extends CopyPermanentEffect { if (super.apply(game, source)) { Permanent permanentToCopy = getBluePrintPermanent(); if (permanentToCopy != null) { - if (permanentToCopy.getSubtype(game).contains(SubType.AURA)) { + if (permanentToCopy.hasSubtype(SubType.AURA, game)) { Target target = getBluePrintPermanent().getSpellAbility().getTargets().get(0); Outcome auraOutcome = Outcome.BoostCreature; Ability: diff --git a/Mage.Sets/src/mage/cards/c/CrypticGateway.java b/Mage.Sets/src/mage/cards/c/CrypticGateway.java index 8c17e28e5d..9821618bf7 100644 --- a/Mage.Sets/src/mage/cards/c/CrypticGateway.java +++ b/Mage.Sets/src/mage/cards/c/CrypticGateway.java @@ -203,14 +203,14 @@ class CrypticGatewayEffect extends OneShotEffect { List subtypes = new ArrayList<>(); for (SubType subtype : creature.getSubtype(game)) { - if (creature2.getSubtype(game).contains(subtype) || changeling2) { + if (creature2.hasSubtype(subtype, game) || changeling2) { subtypes.add(new SubtypePredicate(subtype)); commonSubType = true; } } for (SubType subtype : creature2.getSubtype(game)) { - if (creature.getSubtype(game).contains(subtype) || changeling) { + if (creature.hasSubtype(subtype, game) || changeling) { subtypes.add(new SubtypePredicate(subtype)); commonSubType = true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java b/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java index 12c2c2dd7f..ea26695acd 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java @@ -27,7 +27,6 @@ */ package mage.cards.c; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -52,6 +51,8 @@ import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * * @author BetaSteward @@ -107,7 +108,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect { // get the names of attached Curses for (UUID attachmentId: targetPlayer.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.CURSE)) { + if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) { filter.add(Predicates.not(new NamePredicate(attachment.getName()))); } } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfThirst.java b/Mage.Sets/src/mage/cards/c/CurseOfThirst.java index 7824f0e2ff..99ee2c1c20 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfThirst.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfThirst.java @@ -136,7 +136,7 @@ class CursesAttachedCount implements DynamicValue { if (player != null) { for (UUID attachmentId: player.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.CURSE)) + if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) count++; } } diff --git a/Mage.Sets/src/mage/cards/d/DaringSleuth.java b/Mage.Sets/src/mage/cards/d/DaringSleuth.java index 417ac40ae3..de3b79f7d2 100644 --- a/Mage.Sets/src/mage/cards/d/DaringSleuth.java +++ b/Mage.Sets/src/mage/cards/d/DaringSleuth.java @@ -27,7 +27,6 @@ */ package mage.cards.d; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.TransformSourceEffect; @@ -42,6 +41,8 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import java.util.UUID; + /** * * @author fireshoes @@ -96,7 +97,7 @@ class DaringSleuthTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DauntingDefender.java b/Mage.Sets/src/mage/cards/d/DauntingDefender.java index 8eef9e3c72..3e4e96f8ac 100644 --- a/Mage.Sets/src/mage/cards/d/DauntingDefender.java +++ b/Mage.Sets/src/mage/cards/d/DauntingDefender.java @@ -27,7 +27,6 @@ */ package mage.cards.d; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -42,6 +41,8 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * * @author TheElk801 @@ -90,7 +91,7 @@ class DauntingDefenderEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getSubtype(game).contains(SubType.CLERIC)) { + if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype(SubType.CLERIC, game)) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/d/DaybreakCoronet.java b/Mage.Sets/src/mage/cards/d/DaybreakCoronet.java index e95b1b081f..086d0dd58f 100644 --- a/Mage.Sets/src/mage/cards/d/DaybreakCoronet.java +++ b/Mage.Sets/src/mage/cards/d/DaybreakCoronet.java @@ -110,7 +110,7 @@ class AuraAttachedPredicate implements Predicate { if (!uuid.equals(ownId)) { Permanent attachment = game.getPermanent(uuid); if (attachment != null - && attachment.getSubtype(game).contains(SubType.AURA)) { + && attachment.hasSubtype(SubType.AURA, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/e/EmeriaShepherd.java b/Mage.Sets/src/mage/cards/e/EmeriaShepherd.java index c0867898a8..b0173b92a7 100644 --- a/Mage.Sets/src/mage/cards/e/EmeriaShepherd.java +++ b/Mage.Sets/src/mage/cards/e/EmeriaShepherd.java @@ -27,7 +27,6 @@ */ package mage.cards.e; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.LandfallAbility; @@ -37,8 +36,8 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterPermanentCard; import mage.filter.predicate.Predicates; @@ -48,6 +47,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** * * @author LevelX2 @@ -109,7 +110,7 @@ class EmeriaShepherdReturnToHandTargetEffect extends OneShotEffect { return false; } Zone toZone = Zone.HAND; - if (triggeringLand.getSubtype(game).contains(SubType.PLAINS) + if (triggeringLand.hasSubtype(SubType.PLAINS, game) && controller.chooseUse(Outcome.PutCardInPlay, "Put the card to battlefield instead?", source, game)) { toZone = Zone.BATTLEFIELD; } diff --git a/Mage.Sets/src/mage/cards/e/EverflameEidolon.java b/Mage.Sets/src/mage/cards/e/EverflameEidolon.java index cd976d672e..978b5ca8bb 100644 --- a/Mage.Sets/src/mage/cards/e/EverflameEidolon.java +++ b/Mage.Sets/src/mage/cards/e/EverflameEidolon.java @@ -27,7 +27,6 @@ */ package mage.cards.e; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,14 +38,12 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.BestowAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * * @author Quercitron @@ -98,7 +95,7 @@ class EverflameEidolonEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourceObject != null) { - if (sourceObject.getSubtype(game).contains(SubType.AURA)) { + if (sourceObject.hasSubtype(SubType.AURA, game)) { game.addEffect(new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), source); } else { game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source); diff --git a/Mage.Sets/src/mage/cards/f/FleetingMemories.java b/Mage.Sets/src/mage/cards/f/FleetingMemories.java index c02a3e51e3..47577f15e7 100644 --- a/Mage.Sets/src/mage/cards/f/FleetingMemories.java +++ b/Mage.Sets/src/mage/cards/f/FleetingMemories.java @@ -103,7 +103,7 @@ class FleetingMemoriesTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game); } @Override diff --git a/Mage.Sets/src/mage/cards/f/Foxfire.java b/Mage.Sets/src/mage/cards/f/Foxfire.java new file mode 100644 index 0000000000..159fc7a92a --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/Foxfire.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.f; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author L_J + */ +public class Foxfire extends CardImpl { + + public Foxfire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); + + // Untap target attacking creature. Prevent all combat damage that would be dealt to and dealt by that creature this turn. + this.getSpellAbility().addTarget(new TargetAttackingCreature()); + this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true)); + this.getSpellAbility().addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)),false)); + + + } + + public Foxfire(final Foxfire card) { + super(card); + } + + @Override + public Foxfire copy() { + return new Foxfire(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GoblinBrawler.java b/Mage.Sets/src/mage/cards/g/GoblinBrawler.java index 40ecab1bbe..299548a83a 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinBrawler.java +++ b/Mage.Sets/src/mage/cards/g/GoblinBrawler.java @@ -99,7 +99,7 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (permanent != null && permanent.hasSubtype(SubType.EQUIPMENT, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java b/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java index b2201c3a1f..beb3cd4068 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java +++ b/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java @@ -27,7 +27,6 @@ */ package mage.cards.g; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -36,14 +35,16 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.*; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; +import java.util.UUID; + /** * * @author Plopman @@ -102,7 +103,7 @@ class GoblinCharbelcherEffect extends OneShotEffect { cards.add(card); if (card.isLand()){ landFound = true; - if(card.getSubtype(game).contains(SubType.MOUNTAIN)){ + if(card.hasSubtype(SubType.MOUNTAIN, game)){ isMountain = true; } break; @@ -117,7 +118,7 @@ class GoblinCharbelcherEffect extends OneShotEffect { if (landFound) { damage--; } - if(isMountain == true){ + if(isMountain){ damage *= 2; } diff --git a/Mage.Sets/src/mage/cards/g/GoblinGame.java b/Mage.Sets/src/mage/cards/g/GoblinGame.java index af2c91fa16..5c58cafc2f 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinGame.java +++ b/Mage.Sets/src/mage/cards/g/GoblinGame.java @@ -36,7 +36,6 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; import mage.game.Game; import mage.players.Player; diff --git a/Mage.Sets/src/mage/cards/g/GolemSkinGauntlets.java b/Mage.Sets/src/mage/cards/g/GolemSkinGauntlets.java index f640905ac1..8dbcccd31d 100644 --- a/Mage.Sets/src/mage/cards/g/GolemSkinGauntlets.java +++ b/Mage.Sets/src/mage/cards/g/GolemSkinGauntlets.java @@ -91,7 +91,7 @@ class GolemSkinGauntletsAttachedCount implements DynamicValue { List attachments = permanent.getAttachments(); for (UUID attachmentId : attachments) { Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) { count++; } } diff --git a/Mage.Sets/src/mage/cards/g/GrafMole.java b/Mage.Sets/src/mage/cards/g/GrafMole.java index 814cbd73a9..90acdffb6d 100644 --- a/Mage.Sets/src/mage/cards/g/GrafMole.java +++ b/Mage.Sets/src/mage/cards/g/GrafMole.java @@ -91,7 +91,7 @@ class GrafMoleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game); } @Override diff --git a/Mage.Sets/src/mage/cards/g/GreaterRealmOfPreservation.java b/Mage.Sets/src/mage/cards/g/GreaterRealmOfPreservation.java new file mode 100644 index 0000000000..de7fa75b94 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GreaterRealmOfPreservation.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.g; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventNextDamageFromChosenSourceToYouEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.FilterObject; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author L_J + */ +public class GreaterRealmOfPreservation extends CardImpl { + + private static final FilterObject filter = new FilterObject("black or red source"); + static{ + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), new ColorPredicate(ObjectColor.RED))); + } + + public GreaterRealmOfPreservation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + + + // {1}{W}: The next time a black or red source of your choice would deal damage to you this turn, prevent that damage. + Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{W}"))); + } + + public GreaterRealmOfPreservation(final GreaterRealmOfPreservation card) { + super(card); + } + + @Override + public GreaterRealmOfPreservation copy() { + return new GreaterRealmOfPreservation(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GuardianBeast.java b/Mage.Sets/src/mage/cards/g/GuardianBeast.java index eb53911dbc..72c83b9654 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianBeast.java +++ b/Mage.Sets/src/mage/cards/g/GuardianBeast.java @@ -142,7 +142,7 @@ class GuardianBeastConditionalEffect extends ContinuousRuleModifyingEffectImpl { } StackObject spell = game.getStack().getStackObject(event.getSourceId()); - if (event.getType() == EventType.LOSE_CONTROL || event.getType() == EventType.ATTACH || event.getType() == EventType.TARGET && spell != null && spell.isEnchantment() && spell.getSubtype(game).contains(SubType.AURA)) { + if (event.getType() == EventType.LOSE_CONTROL || event.getType() == EventType.ATTACH || event.getType() == EventType.TARGET && spell != null && spell.isEnchantment() && spell.hasSubtype(SubType.AURA, game)) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (perm != null && Objects.equals(perm.getId(), targetPermanent.getId()) && !perm.isCreature()) { return true; diff --git a/Mage.Sets/src/mage/cards/g/GuulDrazOverseer.java b/Mage.Sets/src/mage/cards/g/GuulDrazOverseer.java index bb5a97d3d6..19d3ebb499 100644 --- a/Mage.Sets/src/mage/cards/g/GuulDrazOverseer.java +++ b/Mage.Sets/src/mage/cards/g/GuulDrazOverseer.java @@ -27,7 +27,6 @@ */ package mage.cards.g; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.LandfallAbility; @@ -41,6 +40,8 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** * * @author LevelX2 @@ -91,7 +92,7 @@ class GuulDrazOverseerEffect extends OneShotEffect { Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (controller != null && land != null) { int boost = 1; - if (land.getSubtype(game).contains(SubType.SWAMP)) { + if (land.hasSubtype(SubType.SWAMP, game)) { boost = 2; } game.addEffect(new BoostControlledEffect(boost, 0, Duration.EndOfTurn, true), source); diff --git a/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java b/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java index b0c1171265..a5b164951f 100644 --- a/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java +++ b/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java @@ -27,7 +27,6 @@ */ package mage.cards.h; -import java.util.UUID; import mage.ConditionalMana; import mage.MageObject; import mage.Mana; @@ -54,6 +53,8 @@ import mage.filter.predicate.Predicates; import mage.game.Game; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -158,7 +159,7 @@ class UginPlaneswalkerCardPredicate implements Predicate { @Override public boolean apply(Card input, Game game) { return input.isPlaneswalker() - && input.getSubtype(game).contains(SubType.UGIN); + && input.hasSubtype(SubType.UGIN, game); } @Override diff --git a/Mage.Sets/src/mage/cards/j/Jokulmorder.java b/Mage.Sets/src/mage/cards/j/Jokulmorder.java index 3b7c148006..87ce51cb02 100644 --- a/Mage.Sets/src/mage/cards/j/Jokulmorder.java +++ b/Mage.Sets/src/mage/cards/j/Jokulmorder.java @@ -27,7 +27,6 @@ */ package mage.cards.j; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTappedAbility; @@ -51,6 +50,8 @@ import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledPermanent; +import java.util.UUID; + /** * * @author fireshoes @@ -110,7 +111,7 @@ class JokulmorderTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent land = game.getPermanent(event.getTargetId()); - return land.getSubtype(game).contains(SubType.ISLAND) + return land.hasSubtype(SubType.ISLAND, game) && land.getControllerId().equals(this.controllerId); } diff --git a/Mage.Sets/src/mage/cards/k/KarnLiberated.java b/Mage.Sets/src/mage/cards/k/KarnLiberated.java index 8d474da8d6..3f5b40282d 100644 --- a/Mage.Sets/src/mage/cards/k/KarnLiberated.java +++ b/Mage.Sets/src/mage/cards/k/KarnLiberated.java @@ -123,7 +123,7 @@ class KarnLiberatedEffect extends OneShotEffect { for (ExileZone zone : game.getExile().getExileZones()) { if (zone.getId().equals(exileId)) { for (Card card : zone.getCards(game)) { - if (!card.getSubtype(game).contains(SubType.AURA) && card.isPermanent()) { + if (!card.hasSubtype(SubType.AURA, game) && card.isPermanent()) { cards.add(card); } } @@ -155,7 +155,7 @@ class KarnLiberatedEffect extends OneShotEffect { } for (Card card : cards) { game.getState().setZone(card.getId(), Zone.EXILED); - if (card.isPermanent() && !card.getSubtype(game).contains(SubType.AURA)) { + if (card.isPermanent() && !card.hasSubtype(SubType.AURA, game)) { game.getExile().add(exileId, sourceObject.getIdName(), card); } } diff --git a/Mage.Sets/src/mage/cards/k/KorDuelist.java b/Mage.Sets/src/mage/cards/k/KorDuelist.java index 5cbbcfead5..3dad3f3d16 100644 --- a/Mage.Sets/src/mage/cards/k/KorDuelist.java +++ b/Mage.Sets/src/mage/cards/k/KorDuelist.java @@ -84,7 +84,7 @@ class SourceIsEquiped implements Condition { for (UUID attachmentUUID : attachments) { Permanent attachment = game.getPermanent(attachmentUUID); if (attachment != null) { - if (attachment.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attachment.hasSubtype(SubType.EQUIPMENT, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java b/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java index 63c9bf294c..1cfc935515 100644 --- a/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java +++ b/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java @@ -27,7 +27,6 @@ */ package mage.cards.l; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.ManacostVariableValue; @@ -37,11 +36,7 @@ import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.TargetController; +import mage.constants.*; import mage.counters.CounterType; import mage.filter.common.FilterArtifactPermanent; import mage.filter.predicate.permanent.ControllerPredicate; @@ -51,6 +46,8 @@ import mage.game.permanent.token.Token; import mage.target.common.TargetArtifactPermanent; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * * @author fireshoes @@ -101,8 +98,8 @@ class LifecraftAwakeningEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent) game.getPermanent(source.getTargets().getFirstTarget()); - if (!permanent.isCreature() && !permanent.getSubtype(game).contains(SubType.VEHICLE)) { + Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); + if (!permanent.isCreature() && !permanent.hasSubtype(SubType.VEHICLE, game)) { ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new LifecraftAwakeningToken(), false, true, Duration.Custom); continuousEffect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(continuousEffect, source); diff --git a/Mage.Sets/src/mage/cards/l/Lightsaber.java b/Mage.Sets/src/mage/cards/l/Lightsaber.java index c820ad153b..210cb57129 100644 --- a/Mage.Sets/src/mage/cards/l/Lightsaber.java +++ b/Mage.Sets/src/mage/cards/l/Lightsaber.java @@ -27,7 +27,6 @@ */ package mage.cards.l; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -38,15 +37,13 @@ import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; import mage.util.CardUtil; +import java.util.UUID; + /** * * @author Styxo @@ -73,7 +70,7 @@ public class Lightsaber extends CardImpl { public void adjustCosts(Ability ability, Game game) { if (ability instanceof EquipAbility) { Permanent targetCreature = game.getPermanent(ability.getTargets().getFirstTarget()); - if (targetCreature != null && (targetCreature.getSubtype(game).contains(SubType.SITH) || targetCreature.getSubtype(game).contains(SubType.JEDI))) { + if (targetCreature != null && (targetCreature.hasSubtype(SubType.SITH, game) || targetCreature.hasSubtype(SubType.JEDI, game))) { CardUtil.increaseCost(ability, 1 - ability.getManaCostsToPay().convertedManaCost()); } } diff --git a/Mage.Sets/src/mage/cards/l/LilianasDefeat.java b/Mage.Sets/src/mage/cards/l/LilianasDefeat.java index 072a84ea98..081350eade 100644 --- a/Mage.Sets/src/mage/cards/l/LilianasDefeat.java +++ b/Mage.Sets/src/mage/cards/l/LilianasDefeat.java @@ -27,7 +27,6 @@ */ package mage.cards.l; -import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -44,6 +43,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; +import java.util.UUID; + /** * * @author LevelX2 @@ -93,7 +94,7 @@ class LilianasDefeatEffect extends OneShotEffect { if (player != null && permanent != null) { permanent.destroy(source.getSourceId(), game, true); game.applyEffects(); - if (permanent.isPlaneswalker() && permanent.getSubtype(game).contains(SubType.LILIANA)) { + if (permanent.isPlaneswalker() && permanent.hasSubtype(SubType.LILIANA, game)) { Player permanentController = game.getPlayer(permanent.getControllerId()); if (permanentController != null) { permanentController.loseLife(3, game, false); diff --git a/Mage.Sets/src/mage/cards/l/LostInTheWoods.java b/Mage.Sets/src/mage/cards/l/LostInTheWoods.java index e248d911db..849c4c7c98 100644 --- a/Mage.Sets/src/mage/cards/l/LostInTheWoods.java +++ b/Mage.Sets/src/mage/cards/l/LostInTheWoods.java @@ -27,26 +27,19 @@ */ package mage.cards.l; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AttacksAllTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.SetTargetPointer; -import mage.constants.Zone; +import mage.cards.*; +import mage.constants.*; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** * * @author BetaSteward @@ -95,7 +88,7 @@ class LostInTheWoodsEffect extends OneShotEffect { controller.revealCards(sourceObject.getName(), cards, game); if (card != null) { - if (card.getSubtype(game).contains(SubType.FOREST)) { + if (card.hasSubtype(SubType.FOREST, game)) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { permanent.removeFromCombat(game); diff --git a/Mage.Sets/src/mage/cards/m/MarkOfEviction.java b/Mage.Sets/src/mage/cards/m/MarkOfEviction.java index 335f8b2d78..3cae064589 100644 --- a/Mage.Sets/src/mage/cards/m/MarkOfEviction.java +++ b/Mage.Sets/src/mage/cards/m/MarkOfEviction.java @@ -108,7 +108,7 @@ class MarkOfEvictionEffect extends OneShotEffect { toHand.add(enchanted); for (UUID attachmentId : enchanted.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) { + if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) { toHand.add(attachment); } } diff --git a/Mage.Sets/src/mage/cards/m/MurderousSpoils.java b/Mage.Sets/src/mage/cards/m/MurderousSpoils.java index c8f15e8949..42a7abd4d2 100644 --- a/Mage.Sets/src/mage/cards/m/MurderousSpoils.java +++ b/Mage.Sets/src/mage/cards/m/MurderousSpoils.java @@ -98,7 +98,7 @@ class MurderousSpoilsEffect extends OneShotEffect { List attachments = new ArrayList<>(); for (UUID uuid : target.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached.hasSubtype(SubType.EQUIPMENT, game)) { attachments.add(attached); } } diff --git a/Mage.Sets/src/mage/cards/m/MyriadLandscape.java b/Mage.Sets/src/mage/cards/m/MyriadLandscape.java index 84f26a0a74..3a2c36827d 100644 --- a/Mage.Sets/src/mage/cards/m/MyriadLandscape.java +++ b/Mage.Sets/src/mage/cards/m/MyriadLandscape.java @@ -110,7 +110,7 @@ class TargetCardInLibrarySharingLandType extends TargetCardInLibrary { if (landTypes.isEmpty()) { landTypes.addAll(landCard.getSubtype(game)); } else { - landTypes.removeIf(next -> !landCard.getSubtype(game).contains(next)); + landTypes.removeIf(next -> !landCard.hasSubtype(next, game)); } } } @@ -118,7 +118,7 @@ class TargetCardInLibrarySharingLandType extends TargetCardInLibrary { if (card != null && !landTypes.isEmpty()) { for (Iterator iterator = landTypes.iterator(); iterator.hasNext();) { SubType next = iterator.next(); - if (card.getSubtype(game).contains(next)) { + if (card.hasSubtype(next, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java b/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java index 3bc661f5e2..222513369a 100644 --- a/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java +++ b/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java @@ -142,7 +142,7 @@ class NecromancersMagemarkEffect extends ReplacementEffectImpl { if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { for (UUID attachmentId : permanent.getAttachments()) { Permanent attachment = game.getPermanentOrLKIBattlefield(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) { + if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/n/Necromancy.java b/Mage.Sets/src/mage/cards/n/Necromancy.java index 6dd2ab4f61..504c61abba 100644 --- a/Mage.Sets/src/mage/cards/n/Necromancy.java +++ b/Mage.Sets/src/mage/cards/n/Necromancy.java @@ -204,7 +204,7 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!permanent.getSubtype(game).contains(SubType.AURA)) { + if (!permanent.hasSubtype(SubType.AURA, game)) { permanent.getSubtype(game).add(SubType.AURA); } } diff --git a/Mage.Sets/src/mage/cards/n/NewBlood.java b/Mage.Sets/src/mage/cards/n/NewBlood.java index abef9e8c1d..cd2c534219 100644 --- a/Mage.Sets/src/mage/cards/n/NewBlood.java +++ b/Mage.Sets/src/mage/cards/n/NewBlood.java @@ -27,9 +27,6 @@ */ package mage.cards.n; -import java.util.LinkedHashSet; -import java.util.UUID; -import java.util.stream.Collectors; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; @@ -43,12 +40,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; import mage.choices.ChoiceImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.SubType; +import mage.constants.*; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.TextPartSubtypePredicate; @@ -60,6 +52,10 @@ import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; +import java.util.LinkedHashSet; +import java.util.UUID; +import java.util.stream.Collectors; + /** * * @author LevelX2 @@ -187,9 +183,9 @@ class ChangeCreatureTypeTargetEffect extends ContinuousEffectImpl { break; case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (targetObject.getSubtype(game).contains(fromSubType)) { + if (targetObject.hasSubtype(fromSubType, game)) { targetObject.getSubtype(game).remove(fromSubType); - if (!targetObject.getSubtype(game).contains(toSubType)) { + if (!targetObject.hasSubtype(toSubType, game)) { targetObject.getSubtype(game).add(toSubType); } } diff --git a/Mage.Sets/src/mage/cards/n/NyleasPresence.java b/Mage.Sets/src/mage/cards/n/NyleasPresence.java index c6c1e9cc9e..a56ede9558 100644 --- a/Mage.Sets/src/mage/cards/n/NyleasPresence.java +++ b/Mage.Sets/src/mage/cards/n/NyleasPresence.java @@ -141,7 +141,7 @@ class NyleasPresenceLandTypeEffect extends ContinuousEffectImpl { break; case TypeChangingEffects_4: for (SubType subtype : landTypes) { - if (!land.getSubtype(game).contains(subtype)) { + if (!land.hasSubtype(subtype, game)) { land.getSubtype(game).add(subtype); } } diff --git a/Mage.Sets/src/mage/cards/o/OrzhovCharm.java b/Mage.Sets/src/mage/cards/o/OrzhovCharm.java index 512a8098e5..d6c41b44c5 100644 --- a/Mage.Sets/src/mage/cards/o/OrzhovCharm.java +++ b/Mage.Sets/src/mage/cards/o/OrzhovCharm.java @@ -119,7 +119,7 @@ class OrzhovCharmReturnToHandEffect extends OneShotEffect { for (UUID attachmentId : attachments) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.getControllerId().equals(source.getControllerId()) - && attachment.getSubtype(game).contains(SubType.AURA)) { + && attachment.hasSubtype(SubType.AURA, game)) { attachment.moveToZone(Zone.HAND, source.getSourceId(), game, false); } } diff --git a/Mage.Sets/src/mage/cards/p/PathOfAncestry.java b/Mage.Sets/src/mage/cards/p/PathOfAncestry.java index b0226c0aeb..8973e87ab8 100644 --- a/Mage.Sets/src/mage/cards/p/PathOfAncestry.java +++ b/Mage.Sets/src/mage/cards/p/PathOfAncestry.java @@ -27,8 +27,6 @@ */ package mage.cards.p; -import java.util.Iterator; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -47,6 +45,9 @@ import mage.game.events.GameEvent; import mage.game.stack.Spell; import mage.players.Player; +import java.util.Iterator; +import java.util.UUID; + /** * * @author TheElk801 @@ -115,7 +116,7 @@ class PathOfAncestryTriggeredAbility extends TriggeredAbilityImpl { if (sType.getSubTypeSet() == SubTypeSet.CreatureType) { for (UUID cmdr : controller.getCommandersIds()) { MageObject commander = game.getObject(cmdr); - if (commander != null && commander.getSubtype(game).contains(sType)) { + if (commander != null && commander.hasSubtype(sType, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java b/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java index 1e9bc9d243..3e2d14811d 100644 --- a/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java +++ b/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java @@ -115,7 +115,7 @@ class PlaneswalkersMischiefEffect extends OneShotEffect { effect.setTargetPointer(new FixedTarget(revealedCard.getId())); game.addEffect(effect, source); OneShotEffect effect2 = new ReturnFromExileEffect(source.getSourceId(), Zone.HAND); - Condition condition = new SpellWasNotCastCondition(source.getSourceId(), revealedCard.getId()); + Condition condition = new PlaneswalkersMischiefCondition(source.getSourceId(), revealedCard.getId()); ConditionalOneShotEffect effect3 = new ConditionalOneShotEffect(effect2, condition, "if you haven't cast it, return it to its owner's hand."); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect3); game.addDelayedTriggeredAbility(delayedAbility, source); @@ -163,12 +163,12 @@ class PlaneswalkersMischiefCastFromExileEffect extends AsThoughEffectImpl { } } -class SpellWasNotCastCondition implements Condition { +class PlaneswalkersMischiefCondition implements Condition { protected UUID exileId; protected UUID cardId; - public SpellWasNotCastCondition(UUID exileId, UUID cardId) { + public PlaneswalkersMischiefCondition(UUID exileId, UUID cardId) { this.exileId = exileId; this.cardId = cardId; } diff --git a/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java b/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java index a595c4d194..cad4f3e7fb 100644 --- a/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java +++ b/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java @@ -27,17 +27,12 @@ */ package mage.cards.p; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; @@ -45,6 +40,8 @@ import mage.game.events.GameEvent.EventType; import mage.game.events.NumberOfTriggersEvent; import mage.game.events.ZoneChangeEvent; +import java.util.UUID; + /** * * @author Styxo @@ -101,7 +98,7 @@ class PrecipiceOfMortisEffect extends ReplacementEffectImpl { if (sourceEvent.getType() == EventType.ENTERS_THE_BATTLEFIELD && sourceEvent instanceof EntersTheBattlefieldEvent) { EntersTheBattlefieldEvent entersTheBattlefieldEvent = (EntersTheBattlefieldEvent) sourceEvent; // Only for entering Jedis - if (entersTheBattlefieldEvent.getTarget().getSubtype(game).contains(SubType.JEDI)) { + if (entersTheBattlefieldEvent.getTarget().hasSubtype(SubType.JEDI, game)) { // Only for triggers of permanents if (game.getPermanent(numberOfTriggersEvent.getSourceId()) != null) { return true; @@ -113,7 +110,7 @@ class PrecipiceOfMortisEffect extends ReplacementEffectImpl { ZoneChangeEvent leavesTheBattlefieldEvent = (ZoneChangeEvent) sourceEvent; if (leavesTheBattlefieldEvent.getFromZone() == Zone.BATTLEFIELD) { // Only for leaving Jedis - if (leavesTheBattlefieldEvent.getTarget().getSubtype(game).contains(SubType.JEDI)) { + if (leavesTheBattlefieldEvent.getTarget().hasSubtype(SubType.JEDI, game)) { // Only for triggers of permanents if (game.getPermanent(numberOfTriggersEvent.getSourceId()) != null) { return true; diff --git a/Mage.Sets/src/mage/cards/p/PrismaticOmen.java b/Mage.Sets/src/mage/cards/p/PrismaticOmen.java index a3b9fc199c..57fdb7f16d 100644 --- a/Mage.Sets/src/mage/cards/p/PrismaticOmen.java +++ b/Mage.Sets/src/mage/cards/p/PrismaticOmen.java @@ -123,7 +123,7 @@ class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl { break; case TypeChangingEffects_4: for (SubType subtype : landTypes) { - if (!land.getSubtype(game).contains(subtype)) { + if (!land.hasSubtype(subtype, game)) { land.getSubtype(game).add(subtype); } } diff --git a/Mage.Sets/src/mage/cards/p/PsychicTheft.java b/Mage.Sets/src/mage/cards/p/PsychicTheft.java index f3ecc5b1ea..0de93dd34e 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicTheft.java +++ b/Mage.Sets/src/mage/cards/p/PsychicTheft.java @@ -42,8 +42,6 @@ import mage.abilities.effects.common.ReturnFromExileEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.filter.common.FilterInstantOrSorceryCard; import mage.constants.AsThoughEffectType; import mage.constants.CardType; @@ -58,7 +56,6 @@ import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; import mage.watchers.common.SpellsCastWatcher; - /** * * @author L_J (significantly based on code by jeffwadsworth and Styxo) @@ -119,16 +116,16 @@ class PsychicTheftEffect extends OneShotEffect { } } if (chosenCard != null) { - + opponent.moveCardToExileWithInfo(chosenCard, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.HAND, true); - + AsThoughEffect effect = new PsychicTheftCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(chosenCard.getId())); game.addEffect(effect, source); - + OneShotEffect effect2 = new ReturnFromExileEffect(source.getSourceId(), Zone.HAND); - Condition condition = new SpellWasNotCastCondition(source.getSourceId(), chosenCard.getId()); - + Condition condition = new PsychicTheftCondition(source.getSourceId(), chosenCard.getId()); + ConditionalOneShotEffect effect3 = new ConditionalOneShotEffect(effect2, condition, "if you haven't cast it, return it to its owner's hand."); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect3); game.addDelayedTriggeredAbility(delayedAbility, source); @@ -176,12 +173,12 @@ class PsychicTheftCastFromExileEffect extends AsThoughEffectImpl { } } -class SpellWasNotCastCondition implements Condition { +class PsychicTheftCondition implements Condition { protected UUID exileId; protected UUID cardId; - public SpellWasNotCastCondition(UUID exileId, UUID cardId) { + public PsychicTheftCondition(UUID exileId, UUID cardId) { this.exileId = exileId; this.cardId = cardId; } diff --git a/Mage.Sets/src/mage/cards/r/Realmwright.java b/Mage.Sets/src/mage/cards/r/Realmwright.java index af22570bc8..ae20d46c86 100644 --- a/Mage.Sets/src/mage/cards/r/Realmwright.java +++ b/Mage.Sets/src/mage/cards/r/Realmwright.java @@ -111,7 +111,7 @@ class RealmwrightEffect2 extends ContinuousEffectImpl { if (land != null) { switch (layer) { case TypeChangingEffects_4: - if (sublayer == SubLayer.NA && !land.getSubtype(game).contains(choice)) { + if (sublayer == SubLayer.NA && !land.hasSubtype(choice, game)) { land.getSubtype(game).add(choice); } break; diff --git a/Mage.Sets/src/mage/cards/r/RingOfMaruf.java b/Mage.Sets/src/mage/cards/r/RingOfMaruf.java new file mode 100644 index 0000000000..d4a0ea12a6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RingOfMaruf.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.WishEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author L_J + */ +public class RingOfMaruf extends CardImpl { + + public RingOfMaruf(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}"); + + // {5}, {Tap}, Exile Ring of Maruf: The next time you would draw a card this turn, instead choose a card you own from outside the game and put it into your hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RingOfMarufEffect(), new ManaCostsImpl("{5}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new ExileSourceCost()); + this.addAbility(ability); + } + + public RingOfMaruf(final RingOfMaruf card) { + super(card); + } + + @Override + public RingOfMaruf copy() { + return new RingOfMaruf(this); + } +} + +class RingOfMarufEffect extends ReplacementEffectImpl { + + public RingOfMarufEffect() { + super(Duration.EndOfTurn, Outcome.Benefit); + staticText = "The next time you would draw a card this turn, instead choose a card you own from outside the game and put it into your hand."; + } + + public RingOfMarufEffect(final RingOfMarufEffect effect) { + super(effect); + } + + @Override + public RingOfMarufEffect copy() { + return new RingOfMarufEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + new WishEffect(new FilterCard(), false).apply(game, source); + this.discard(); + return true; + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DRAW_CARD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return source.getControllerId().equals(event.getPlayerId()); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java b/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java index 7628920a92..5a5d21a2b9 100644 --- a/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java +++ b/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java @@ -105,7 +105,7 @@ class RiptideShapeshifterEffect extends OneShotEffect { Cards revealedCards = new CardsImpl(); while (controller.getLibrary().hasCards()) { Card card = controller.getLibrary().removeFromTop(game); - if (card.isCreature() && card.getSubtype(game).contains(SubType.byDescription(choice.getChoice()))) { + if (card.isCreature() && card.hasSubtype(SubType.byDescription(choice.getChoice()), game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; } diff --git a/Mage.Sets/src/mage/cards/r/RishadanPawnshop.java b/Mage.Sets/src/mage/cards/r/RishadanPawnshop.java new file mode 100644 index 0000000000..f2c995b97d --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RishadanPawnshop.java @@ -0,0 +1,115 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.r; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author L_J + */ +public class RishadanPawnshop extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("nontoken permanent you control"); + + static { + filter.add(Predicates.not(new TokenPredicate())); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public RishadanPawnshop(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + + // Shuffle target nontoken permanent you control into its owner's library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RishadanPawnshopShuffleIntoLibraryEffect(), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + + } + + public RishadanPawnshop(final RishadanPawnshop card) { + super(card); + } + + @Override + public RishadanPawnshop copy() { + return new RishadanPawnshop(this); + } +} + +class RishadanPawnshopShuffleIntoLibraryEffect extends OneShotEffect { + + public RishadanPawnshopShuffleIntoLibraryEffect() { + super(Outcome.Detriment); + this.staticText = "The owner of target nontoken permanent you control shuffles it into his or her library"; + } + + public RishadanPawnshopShuffleIntoLibraryEffect(final RishadanPawnshopShuffleIntoLibraryEffect effect) { + super(effect); + } + + @Override + public RishadanPawnshopShuffleIntoLibraryEffect copy() { + return new RishadanPawnshopShuffleIntoLibraryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { + Player owner = game.getPlayer(permanent.getOwnerId()); + if (owner != null) { + owner.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); + owner.shuffleLibrary(source, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/s/SealockMonster.java b/Mage.Sets/src/mage/cards/s/SealockMonster.java index 310375ecc0..4132bf08ba 100644 --- a/Mage.Sets/src/mage/cards/s/SealockMonster.java +++ b/Mage.Sets/src/mage/cards/s/SealockMonster.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility; @@ -45,6 +44,8 @@ import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** * * @author LevelX2 @@ -116,7 +117,7 @@ class SealockMonsterBecomesIslandTargetEffect extends ContinuousEffectImpl { } break; case TypeChangingEffects_4: - if (!land.getSubtype(game).contains(SubType.ISLAND)) { + if (!land.hasSubtype(SubType.ISLAND, game)) { land.getSubtype(game).add(SubType.ISLAND); } break; diff --git a/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java b/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java index d67051f38c..e7e06d14ab 100644 --- a/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java +++ b/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java @@ -101,7 +101,7 @@ class SilenceTheBelieversExileEffect extends OneShotEffect { List attachments = new ArrayList<>(creature.getAttachments()); for (UUID attachmentId: attachments) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) { + if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) { controller.moveCardToExileWithInfo(attachment, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); } } diff --git a/Mage.Sets/src/mage/cards/s/SirensRuse.java b/Mage.Sets/src/mage/cards/s/SirensRuse.java index c6acf46fed..58ec90f304 100644 --- a/Mage.Sets/src/mage/cards/s/SirensRuse.java +++ b/Mage.Sets/src/mage/cards/s/SirensRuse.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect; @@ -40,6 +39,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** * * @author TheElk801 @@ -85,7 +86,7 @@ class SirensRuseEffect extends ExileTargetForSourceEffect { boolean isPirate = false; Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null && permanent.getSubtype(game).contains(SubType.PIRATE)) { + if (permanent != null && permanent.hasSubtype(SubType.PIRATE, game)) { isPirate = true; } if (super.apply(game, source)) { diff --git a/Mage.Sets/src/mage/cards/s/SoulExchange.java b/Mage.Sets/src/mage/cards/s/SoulExchange.java index 08f28b8587..995a4241dd 100644 --- a/Mage.Sets/src/mage/cards/s/SoulExchange.java +++ b/Mage.Sets/src/mage/cards/s/SoulExchange.java @@ -27,7 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.Cost; import mage.abilities.costs.common.ExileTargetCost; @@ -36,8 +35,8 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; import mage.filter.common.FilterCreatureCard; import mage.game.Game; @@ -45,22 +44,23 @@ import mage.game.permanent.Permanent; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** - * * @author MarcoMarin */ public class SoulExchange extends CardImpl { public SoulExchange(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}"); // As an additional cost to cast Soul Exchange, exile a creature you control. Cost cost = new ExileTargetCost(new TargetControlledCreaturePermanent()); this.getSpellAbility().addCost(cost); // Return target creature card from your graveyard to the battlefield. Put a +2/+2 counter on that creature if the exiled creature was a Thrull. - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); - this.getSpellAbility().addEffect(new SoulExchangeEffect()); - + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.getSpellAbility().addEffect(new SoulExchangeEffect()); + } public SoulExchange(final SoulExchange card) { @@ -73,17 +73,17 @@ public class SoulExchange extends CardImpl { } } -class SoulExchangeEffect extends OneShotEffect{ - +class SoulExchangeEffect extends OneShotEffect { + public SoulExchangeEffect() { super(Outcome.Benefit); this.setText("Return target creature card from your graveyard to the battlefield. Put a +2/+2 counter on that creature if the exiled creature was a Thrull."); } - + public SoulExchangeEffect(final SoulExchangeEffect effect) { super(effect); } - + @Override public SoulExchangeEffect copy() { return new SoulExchangeEffect(this); @@ -93,22 +93,22 @@ class SoulExchangeEffect extends OneShotEffect{ public boolean apply(Game game, Ability source) { ReturnFromGraveyardToBattlefieldTargetEffect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); if (!effect.apply(game, source)) return false; - - for (Cost c : source.getCosts()){ + + for (Cost c : source.getCosts()) { /* if (!c.getTargets().isEmpty()){ UUID t = c.getTargets().getFirstTarget(); Permanent exiled = game.getPermanentOrLKIBattlefield(t);*/ if (c.isPaid() && c instanceof ExileTargetCost) { for (Permanent exiled : ((ExileTargetCost) c).getPermanents()) { - if (exiled != null){ - if(exiled.getSubtype(game).contains(SubType.THRULL)){ - game.getPermanent(source.getFirstTarget()).addCounters(CounterType.P2P2.createInstance(), source, game); - return true; + if (exiled != null) { + if (exiled.hasSubtype(SubType.THRULL, game)) { + game.getPermanent(source.getFirstTarget()).addCounters(CounterType.P2P2.createInstance(), source, game); + return true; } - } else return false; - } + } else return false; + } } - } - return true; + } + return true; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/StartYourEngines.java b/Mage.Sets/src/mage/cards/s/StartYourEngines.java index 631bb9eb51..4cc5a1ad2e 100644 --- a/Mage.Sets/src/mage/cards/s/StartYourEngines.java +++ b/Mage.Sets/src/mage/cards/s/StartYourEngines.java @@ -27,22 +27,18 @@ */ package mage.cards.s; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * * @author LevelX2 @@ -90,7 +86,7 @@ class StartYourEnginesEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent != null && permanent.getSubtype(game).contains(SubType.VEHICLE)) { + if (permanent != null && permanent.hasSubtype(SubType.VEHICLE, game)) { if (sublayer == SubLayer.NA) { permanent.addCardType(CardType.ARTIFACT); permanent.addCardType(CardType.CREATURE);// TODO: Chcek if giving CREATURE Type is correct diff --git a/Mage.Sets/src/mage/cards/s/StormtideLeviathan.java b/Mage.Sets/src/mage/cards/s/StormtideLeviathan.java index 8adbc93f23..86bbf54402 100644 --- a/Mage.Sets/src/mage/cards/s/StormtideLeviathan.java +++ b/Mage.Sets/src/mage/cards/s/StormtideLeviathan.java @@ -114,7 +114,7 @@ class StormtideLeviathanEffect extends ContinuousEffectImpl { for (Permanent land : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) { switch (layer) { case TypeChangingEffects_4: - if (!land.getSubtype(game).contains(SubType.ISLAND)) { + if (!land.hasSubtype(SubType.ISLAND, game)) { land.getSubtype(game).add(SubType.ISLAND); } break; diff --git a/Mage.Sets/src/mage/cards/s/StreetSweeper.java b/Mage.Sets/src/mage/cards/s/StreetSweeper.java index 55d0237f94..3a62f39c72 100644 --- a/Mage.Sets/src/mage/cards/s/StreetSweeper.java +++ b/Mage.Sets/src/mage/cards/s/StreetSweeper.java @@ -108,7 +108,7 @@ class StreetSweeperDestroyEffect extends OneShotEffect { for(UUID uuid : attachments) { Permanent aura = game.getPermanent(uuid); - if(aura != null && aura.getSubtype(game).contains(SubType.AURA)) + if(aura != null && aura.hasSubtype(SubType.AURA, game)) { aura.destroy(source.getSourceId(), game, false); } diff --git a/Mage.Sets/src/mage/cards/t/TetsuoUmezawa.java b/Mage.Sets/src/mage/cards/t/TetsuoUmezawa.java index c8db2f395a..067764fbac 100644 --- a/Mage.Sets/src/mage/cards/t/TetsuoUmezawa.java +++ b/Mage.Sets/src/mage/cards/t/TetsuoUmezawa.java @@ -27,7 +27,6 @@ */ package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -49,6 +48,8 @@ import mage.game.permanent.Permanent; import mage.game.stack.StackObject; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** * * @author JRHerlehy @@ -127,9 +128,9 @@ class TetsuoUmezawaEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId()); + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); if (stackObject != null && event.getTargetId().equals(source.getSourceId())) { - if (stackObject.getSubtype(game).contains(SubType.AURA)) { + if (stackObject.hasSubtype(SubType.AURA, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TheUrDragon.java b/Mage.Sets/src/mage/cards/t/TheUrDragon.java index f0a501a17a..2e8cbf0e4a 100644 --- a/Mage.Sets/src/mage/cards/t/TheUrDragon.java +++ b/Mage.Sets/src/mage/cards/t/TheUrDragon.java @@ -27,9 +27,6 @@ */ package mage.cards.t; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; @@ -42,13 +39,7 @@ import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AbilityWord; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.SubType; -import mage.constants.SuperType; -import mage.constants.WatcherScope; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; @@ -57,6 +48,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.watchers.Watcher; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author TheElk801 @@ -125,7 +120,7 @@ class DragonsAttackedWatcher extends Watcher { this.attackedThisTurnCreatures.clear(); } if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - if (game.getPermanent(event.getSourceId()).getSubtype(game).contains(SubType.DRAGON)) { + if (game.getPermanent(event.getSourceId()).hasSubtype(SubType.DRAGON, game)) { this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(), game)); } } @@ -166,7 +161,7 @@ class TheUrDragonTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { for (UUID attacker : game.getCombat().getAttackers()) { Permanent creature = game.getPermanent(attacker); - if (creature != null && creature.getControllerId() == this.getControllerId() && creature.getSubtype(game).contains(SubType.DRAGON)) { + if (creature != null && creature.getControllerId() == this.getControllerId() && creature.hasSubtype(SubType.DRAGON, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/ThrullWizard.java b/Mage.Sets/src/mage/cards/t/ThrullWizard.java new file mode 100644 index 0000000000..0e6663321f --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThrullWizard.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.OrCost; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetSpell; + +/** + * + * @author L_J + */ +public class ThrullWizard extends CardImpl { + private static final FilterSpell filter = new FilterSpell("black spell"); + static{ + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public ThrullWizard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + this.subtype.add(SubType.THRULL); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{B}: Counter target black spell unless that spell's controller pays {B} or {3}. + Cost cost = new OrCost(new ColoredManaCost(ColoredManaSymbol.B), new GenericManaCost(3), "pay {B} or pay {3}"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(cost), new ManaCostsImpl("{1}{B}")); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public ThrullWizard(final ThrullWizard card) { + super(card); + } + + @Override + public ThrullWizard copy() { + return new ThrullWizard(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TirelessTracker.java b/Mage.Sets/src/mage/cards/t/TirelessTracker.java index 790f2081e0..63f62539fd 100644 --- a/Mage.Sets/src/mage/cards/t/TirelessTracker.java +++ b/Mage.Sets/src/mage/cards/t/TirelessTracker.java @@ -106,7 +106,7 @@ class TirelessTrackerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game); } @Override diff --git a/Mage.Sets/src/mage/cards/t/TrainingDrone.java b/Mage.Sets/src/mage/cards/t/TrainingDrone.java index 930d3cc932..d2e58a3b9d 100644 --- a/Mage.Sets/src/mage/cards/t/TrainingDrone.java +++ b/Mage.Sets/src/mage/cards/t/TrainingDrone.java @@ -86,7 +86,7 @@ class TrainingDroneEffect extends RestrictionEffect { List attachments = permanent.getAttachments(); for (UUID uuid : attachments) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached.hasSubtype(SubType.EQUIPMENT, game)) { return false; } } diff --git a/Mage.Sets/src/mage/cards/t/TreefolkMystic.java b/Mage.Sets/src/mage/cards/t/TreefolkMystic.java index e1b40c9020..3b29abd1b4 100644 --- a/Mage.Sets/src/mage/cards/t/TreefolkMystic.java +++ b/Mage.Sets/src/mage/cards/t/TreefolkMystic.java @@ -92,7 +92,7 @@ class TreefolkMysticEffect extends OneShotEffect { attachments.addAll(permanent.getAttachments()); for (UUID uuid : attachments) { Permanent aura = game.getPermanent(uuid); - if (aura != null && aura.getSubtype(game).contains(SubType.AURA)) { + if (aura != null && aura.hasSubtype(SubType.AURA, game)) { aura.destroy(source.getSourceId(), game, false); } } diff --git a/Mage.Sets/src/mage/cards/t/TurnToSlag.java b/Mage.Sets/src/mage/cards/t/TurnToSlag.java index baa52c6d21..ed122abdb8 100644 --- a/Mage.Sets/src/mage/cards/t/TurnToSlag.java +++ b/Mage.Sets/src/mage/cards/t/TurnToSlag.java @@ -83,7 +83,7 @@ class TurnToSlagEffect extends OneShotEffect { List attachments = new ArrayList<>(); for (UUID uuid : target.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached.hasSubtype(SubType.EQUIPMENT, game)) { attachments.add(attached); } } diff --git a/Mage.Sets/src/mage/cards/u/UlvenwaldMysteries.java b/Mage.Sets/src/mage/cards/u/UlvenwaldMysteries.java index cdfaacb374..23cd488c18 100644 --- a/Mage.Sets/src/mage/cards/u/UlvenwaldMysteries.java +++ b/Mage.Sets/src/mage/cards/u/UlvenwaldMysteries.java @@ -108,7 +108,7 @@ class UlvenwaldMysteriesTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game); } @Override diff --git a/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java b/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java index 914bf30b6a..d2b980a0ec 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java @@ -27,7 +27,6 @@ */ package mage.cards.v; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -42,6 +41,8 @@ import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * @author ImperatorPrime */ @@ -108,7 +109,7 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl { permanent.getSubtype(game).clear(); for (SubType type : card.getSubtype(game)) { - if (!permanent.getSubtype(game).contains(type)) { + if (!permanent.hasSubtype(type, game)) { permanent.getSubtype(game).add(type); } } diff --git a/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java b/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java index ecd73bbb80..6e6e7ba200 100644 --- a/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java +++ b/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java @@ -92,7 +92,7 @@ class WitchbaneOrbEffect extends OneShotEffect { List toDestroy = new ArrayList<>(); for (UUID attachmentId : controller.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.CURSE)) { + if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) { toDestroy.add(attachment); } } diff --git a/Mage.Sets/src/mage/cards/x/Xenograft.java b/Mage.Sets/src/mage/cards/x/Xenograft.java index 7014fb3001..49ca70239b 100644 --- a/Mage.Sets/src/mage/cards/x/Xenograft.java +++ b/Mage.Sets/src/mage/cards/x/Xenograft.java @@ -84,7 +84,7 @@ class XenograftAddSubtypeEffect extends ContinuousEffectImpl { if (subtype != null) { List permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { - if (permanent != null && !permanent.getSubtype(game).contains(subtype)) { + if (permanent != null && !permanent.hasSubtype(subtype, game)) { permanent.getSubtype(game).add(subtype); } } diff --git a/Mage.Sets/src/mage/sets/ArabianNights.java b/Mage.Sets/src/mage/sets/ArabianNights.java index d9fd0bab01..eb76776430 100644 --- a/Mage.Sets/src/mage/sets/ArabianNights.java +++ b/Mage.Sets/src/mage/sets/ArabianNights.java @@ -130,6 +130,7 @@ public class ArabianNights extends ExpansionSet { cards.add(new SetCardInfo("Piety", 65, Rarity.COMMON, Piety.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Pyramids", 81, Rarity.RARE, mage.cards.p.Pyramids.class)); cards.add(new SetCardInfo("Repentant Blacksmith", 66, Rarity.RARE, mage.cards.r.RepentantBlacksmith.class)); + cards.add(new SetCardInfo("Ring of Ma'rûf", 82, Rarity.RARE, mage.cards.r.RingOfMaruf.class)); cards.add(new SetCardInfo("Rukh Egg", 52, Rarity.COMMON, RukhEgg.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Rukh Egg", 53, Rarity.COMMON, RukhEgg.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sandals of Abdallah", 83, Rarity.UNCOMMON, mage.cards.s.SandalsOfAbdallah.class)); diff --git a/Mage.Sets/src/mage/sets/FallenEmpires.java b/Mage.Sets/src/mage/sets/FallenEmpires.java index 77c084713f..aa73229d50 100644 --- a/Mage.Sets/src/mage/sets/FallenEmpires.java +++ b/Mage.Sets/src/mage/sets/FallenEmpires.java @@ -235,6 +235,7 @@ public class FallenEmpires extends ExpansionSet { cards.add(new SetCardInfo("Thorn Thallid", 99, Rarity.COMMON, ThornThallid.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Thrull Champion", 29, Rarity.RARE, mage.cards.t.ThrullChampion.class)); cards.add(new SetCardInfo("Thrull Retainer", 30, Rarity.UNCOMMON, mage.cards.t.ThrullRetainer.class)); + cards.add(new SetCardInfo("Thrull Wizard", 31, Rarity.UNCOMMON, mage.cards.t.ThrullWizard.class)); cards.add(new SetCardInfo("Tidal Influence", 57, Rarity.UNCOMMON, mage.cards.t.TidalInfluence.class)); cards.add(new SetCardInfo("Vodalian Knights", 58, Rarity.RARE, mage.cards.v.VodalianKnights.class)); cards.add(new SetCardInfo("Vodalian Mage", 59, Rarity.COMMON, VodalianMage.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Sets/src/mage/sets/FifthEdition.java b/Mage.Sets/src/mage/sets/FifthEdition.java index 0dec8e37ad..7da38440f8 100644 --- a/Mage.Sets/src/mage/sets/FifthEdition.java +++ b/Mage.Sets/src/mage/sets/FifthEdition.java @@ -38,7 +38,7 @@ public class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Adarkar Wastes", 410, Rarity.RARE, mage.cards.a.AdarkarWastes.class)); cards.add(new SetCardInfo("Air Elemental", 71, Rarity.UNCOMMON, mage.cards.a.AirElemental.class)); cards.add(new SetCardInfo("Akron Legionnaire", 278, Rarity.RARE, mage.cards.a.AkronLegionnaire.class)); - cards.add(new SetCardInfo("Alabaster Potion", 279, Rarity.COMMON, mage.cards.a.AlabasterPotion.class)); + cards.add(new SetCardInfo("Alabaster Potion", 279, Rarity.COMMON, mage.cards.a.AlabasterPotion.class)); cards.add(new SetCardInfo("Aladdin's Ring", 346, Rarity.RARE, mage.cards.a.AladdinsRing.class)); cards.add(new SetCardInfo("Ambush Party", 208, Rarity.COMMON, mage.cards.a.AmbushParty.class)); cards.add(new SetCardInfo("Amulet of Kroog", 347, Rarity.COMMON, mage.cards.a.AmuletOfKroog.class)); @@ -177,6 +177,7 @@ public class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Forest", 419, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 420, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forget", 89, Rarity.RARE, mage.cards.f.Forget.class)); + cards.add(new SetCardInfo("Foxfire", 157, Rarity.COMMON, mage.cards.f.Foxfire.class)); cards.add(new SetCardInfo("Fountain of Youth", 372, Rarity.UNCOMMON, mage.cards.f.FountainOfYouth.class)); cards.add(new SetCardInfo("Frozen Shade", 25, Rarity.COMMON, mage.cards.f.FrozenShade.class)); cards.add(new SetCardInfo("Fungusaur", 158, Rarity.RARE, mage.cards.f.Fungusaur.class)); @@ -196,6 +197,7 @@ public class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Goblin War Drums", 237, Rarity.COMMON, GoblinWarDrums.class)); cards.add(new SetCardInfo("Goblin Warrens", 238, Rarity.RARE, mage.cards.g.GoblinWarrens.class)); cards.add(new SetCardInfo("Grapeshot Catapult", 375, Rarity.COMMON, mage.cards.g.GrapeshotCatapult.class)); + cards.add(new SetCardInfo("Greater Realm of Preservation", 307, Rarity.UNCOMMON, mage.cards.g.GreaterRealmOfPreservation.class)); cards.add(new SetCardInfo("Grizzly Bears", 163, Rarity.COMMON, mage.cards.g.GrizzlyBears.class)); cards.add(new SetCardInfo("Havenwood Battleground", 421, Rarity.UNCOMMON, mage.cards.h.HavenwoodBattleground.class)); cards.add(new SetCardInfo("Heal", 308, Rarity.COMMON, mage.cards.h.Heal.class)); @@ -353,7 +355,7 @@ public class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Segovian Leviathan", 122, Rarity.UNCOMMON, mage.cards.s.SegovianLeviathan.class)); cards.add(new SetCardInfo("Sengir Autocrat", 55, Rarity.RARE, mage.cards.s.SengirAutocrat.class)); cards.add(new SetCardInfo("Serpent Generator", 397, Rarity.RARE, mage.cards.s.SerpentGenerator.class)); - cards.add(new SetCardInfo("Serra Paladin", 337, Rarity.UNCOMMON, mage.cards.s.SerraPaladin.class)); + cards.add(new SetCardInfo("Serra Paladin", 337, Rarity.UNCOMMON, mage.cards.s.SerraPaladin.class)); cards.add(new SetCardInfo("Shanodin Dryads", 187, Rarity.COMMON, mage.cards.s.ShanodinDryads.class)); cards.add(new SetCardInfo("Shapeshifter", 398, Rarity.UNCOMMON, mage.cards.s.Shapeshifter.class)); cards.add(new SetCardInfo("Shatter", 265, Rarity.COMMON, mage.cards.s.Shatter.class)); diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index e102db1d35..dca007b32a 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -102,14 +102,14 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Deflection", 65, Rarity.RARE, mage.cards.d.Deflection.class)); cards.add(new SetCardInfo("Demonic Consultation", 9, Rarity.UNCOMMON, mage.cards.d.DemonicConsultation.class)); cards.add(new SetCardInfo("Despotic Scepter", 291, Rarity.RARE, mage.cards.d.DespoticScepter.class)); - cards.add(new SetCardInfo("Diabolic Vision", 362, Rarity.UNCOMMON, mage.cards.d.DiabolicVision.class)); + cards.add(new SetCardInfo("Diabolic Vision", 362, Rarity.UNCOMMON, mage.cards.d.DiabolicVision.class)); cards.add(new SetCardInfo("Disenchant", 244, Rarity.COMMON, mage.cards.d.Disenchant.class)); - cards.add(new SetCardInfo("Drift of the Dead", 11, Rarity.UNCOMMON, mage.cards.d.DriftOfTheDead.class)); + cards.add(new SetCardInfo("Drift of the Dead", 11, Rarity.UNCOMMON, mage.cards.d.DriftOfTheDead.class)); cards.add(new SetCardInfo("Dwarven Armory", 182, Rarity.RARE, mage.cards.d.DwarvenArmory.class)); cards.add(new SetCardInfo("Elder Druid", 120, Rarity.RARE, mage.cards.e.ElderDruid.class)); cards.add(new SetCardInfo("Elemental Augury", 364, Rarity.RARE, mage.cards.e.ElementalAugury.class)); cards.add(new SetCardInfo("Enduring Renewal", 247, Rarity.RARE, mage.cards.e.EnduringRenewal.class)); - cards.add(new SetCardInfo("Energy Storm", 248, Rarity.RARE, mage.cards.e.EnergyStorm.class)); + cards.add(new SetCardInfo("Energy Storm", 248, Rarity.RARE, mage.cards.e.EnergyStorm.class)); cards.add(new SetCardInfo("Enervate", 67, Rarity.COMMON, mage.cards.e.Enervate.class)); cards.add(new SetCardInfo("Errantry", 183, Rarity.COMMON, mage.cards.e.Errantry.class)); cards.add(new SetCardInfo("Fanatical Fever", 122, Rarity.UNCOMMON, mage.cards.f.FanaticalFever.class)); @@ -128,7 +128,8 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Forest", 330, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forgotten Lore", 125, Rarity.UNCOMMON, mage.cards.f.ForgottenLore.class)); cards.add(new SetCardInfo("Foul Familiar", 14, Rarity.COMMON, mage.cards.f.FoulFamiliar.class)); - cards.add(new SetCardInfo("Freyalise's Charm", 128, Rarity.UNCOMMON, mage.cards.f.FreyalisesCharm.class)); + cards.add(new SetCardInfo("Freyalise's Charm", 128, Rarity.UNCOMMON, mage.cards.f.FreyalisesCharm.class)); + cards.add(new SetCardInfo("Foxfire", 126, Rarity.COMMON, mage.cards.f.Foxfire.class)); cards.add(new SetCardInfo("Fumarole", 369, Rarity.UNCOMMON, mage.cards.f.Fumarole.class)); cards.add(new SetCardInfo("Fyndhorn Bow", 293, Rarity.UNCOMMON, mage.cards.f.FyndhornBow.class)); cards.add(new SetCardInfo("Fyndhorn Brownie", 130, Rarity.COMMON, mage.cards.f.FyndhornBrownie.class)); @@ -167,7 +168,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Imposing Visage", 193, Rarity.COMMON, mage.cards.i.ImposingVisage.class)); cards.add(new SetCardInfo("Incinerate", 194, Rarity.COMMON, mage.cards.i.Incinerate.class)); cards.add(new SetCardInfo("Infernal Darkness", 23, Rarity.RARE, mage.cards.i.InfernalDarkness.class)); - cards.add(new SetCardInfo("Infernal Denizen", 24, Rarity.RARE, mage.cards.i.InfernalDenizen.class)); + cards.add(new SetCardInfo("Infernal Denizen", 24, Rarity.RARE, mage.cards.i.InfernalDenizen.class)); cards.add(new SetCardInfo("Infuse", 80, Rarity.COMMON, mage.cards.i.Infuse.class)); cards.add(new SetCardInfo("Island", 334, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 335, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); @@ -181,9 +182,9 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Justice", 256, Rarity.UNCOMMON, mage.cards.j.Justice.class)); cards.add(new SetCardInfo("Karplusan Forest", 337, Rarity.RARE, mage.cards.k.KarplusanForest.class)); cards.add(new SetCardInfo("Karplusan Yeti", 197, Rarity.RARE, mage.cards.k.KarplusanYeti.class)); - cards.add(new SetCardInfo("Kelsinko Ranger", 257, Rarity.COMMON, mage.cards.k.KelsinkoRanger.class)); + cards.add(new SetCardInfo("Kelsinko Ranger", 257, Rarity.COMMON, mage.cards.k.KelsinkoRanger.class)); cards.add(new SetCardInfo("Kjeldoran Dead", 25, Rarity.COMMON, mage.cards.k.KjeldoranDead.class)); - cards.add(new SetCardInfo("Kjeldoran Frostbeast", 374, Rarity.UNCOMMON, mage.cards.k.KjeldoranFrostbeast.class)); + cards.add(new SetCardInfo("Kjeldoran Frostbeast", 374, Rarity.UNCOMMON, mage.cards.k.KjeldoranFrostbeast.class)); cards.add(new SetCardInfo("Kjeldoran Royal Guard", 262, Rarity.RARE, mage.cards.k.KjeldoranRoyalGuard.class)); cards.add(new SetCardInfo("Knight of Stromgald", 26, Rarity.UNCOMMON, mage.cards.k.KnightOfStromgald.class)); cards.add(new SetCardInfo("Krovikan Fetish", 28, Rarity.COMMON, mage.cards.k.KrovikanFetish.class)); @@ -201,7 +202,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Marton Stromgald", 199, Rarity.RARE, mage.cards.m.MartonStromgald.class)); cards.add(new SetCardInfo("Merieke Ri Berit", 375, Rarity.RARE, mage.cards.m.MeriekeRiBerit.class)); cards.add(new SetCardInfo("Mesmeric Trance", 83, Rarity.RARE, mage.cards.m.MesmericTrance.class)); - cards.add(new SetCardInfo("Meteor Shower", 202, Rarity.COMMON, mage.cards.m.MeteorShower.class)); + cards.add(new SetCardInfo("Meteor Shower", 202, Rarity.COMMON, mage.cards.m.MeteorShower.class)); cards.add(new SetCardInfo("Mind Ravel", 35, Rarity.COMMON, mage.cards.m.MindRavel.class)); cards.add(new SetCardInfo("Mind Warp", 36, Rarity.UNCOMMON, mage.cards.m.MindWarp.class)); cards.add(new SetCardInfo("Minion of Leshrac", 38, Rarity.RARE, mage.cards.m.MinionOfLeshrac.class)); @@ -313,7 +314,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Wild Growth", 165, Rarity.COMMON, mage.cards.w.WildGrowth.class)); cards.add(new SetCardInfo("Wind Spirit", 106, Rarity.UNCOMMON, mage.cards.w.WindSpirit.class)); cards.add(new SetCardInfo("Wings of Aesthir", 383, Rarity.UNCOMMON, mage.cards.w.WingsOfAesthir.class)); - cards.add(new SetCardInfo("Woolly Mammoths", 166, Rarity.COMMON, mage.cards.w.WoollyMammoths.class)); + cards.add(new SetCardInfo("Woolly Mammoths", 166, Rarity.COMMON, mage.cards.w.WoollyMammoths.class)); cards.add(new SetCardInfo("Word of Blasting", 224, Rarity.UNCOMMON, mage.cards.w.WordOfBlasting.class)); cards.add(new SetCardInfo("Wrath of Marit Lage", 109, Rarity.RARE, mage.cards.w.WrathOfMaritLage.class)); cards.add(new SetCardInfo("Yavimaya Gnats", 168, Rarity.UNCOMMON, mage.cards.y.YavimayaGnats.class)); diff --git a/Mage.Sets/src/mage/sets/Legends.java b/Mage.Sets/src/mage/sets/Legends.java index 36a6ce285d..4be3a031cb 100644 --- a/Mage.Sets/src/mage/sets/Legends.java +++ b/Mage.Sets/src/mage/sets/Legends.java @@ -59,11 +59,11 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Aerathi Berserker", 131, Rarity.UNCOMMON, mage.cards.a.AerathiBerserker.class)); cards.add(new SetCardInfo("Aisling Leprechaun", 87, Rarity.COMMON, mage.cards.a.AislingLeprechaun.class)); cards.add(new SetCardInfo("Akron Legionnaire", 170, Rarity.RARE, mage.cards.a.AkronLegionnaire.class)); - cards.add(new SetCardInfo("Alabaster Potion", 171, Rarity.COMMON, mage.cards.a.AlabasterPotion.class)); + cards.add(new SetCardInfo("Alabaster Potion", 171, Rarity.COMMON, mage.cards.a.AlabasterPotion.class)); cards.add(new SetCardInfo("Alchor's Tomb", 214, Rarity.RARE, mage.cards.a.AlchorsTomb.class)); cards.add(new SetCardInfo("All Hallow's Eve", 2, Rarity.RARE, mage.cards.a.AllHallowsEve.class)); cards.add(new SetCardInfo("Amrou Kithkin", 172, Rarity.COMMON, mage.cards.a.AmrouKithkin.class)); - cards.add(new SetCardInfo("Angelic Voices", 173, Rarity.RARE, mage.cards.a.AngelicVoices.class)); + cards.add(new SetCardInfo("Angelic Voices", 173, Rarity.RARE, mage.cards.a.AngelicVoices.class)); cards.add(new SetCardInfo("Angus Mackenzie", 257, Rarity.RARE, mage.cards.a.AngusMackenzie.class)); cards.add(new SetCardInfo("Arcades Sabboth", 258, Rarity.RARE, mage.cards.a.ArcadesSabboth.class)); cards.add(new SetCardInfo("Arena of the Ancients", 215, Rarity.RARE, mage.cards.a.ArenaOfTheAncients.class)); @@ -124,6 +124,7 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Giant Strength", 147, Rarity.COMMON, mage.cards.g.GiantStrength.class)); cards.add(new SetCardInfo("Gravity Sphere", 149, Rarity.RARE, mage.cards.g.GravitySphere.class)); cards.add(new SetCardInfo("Great Defender", 185, Rarity.UNCOMMON, mage.cards.g.GreatDefender.class)); + cards.add(new SetCardInfo("Greater Realm of Preservation", 187, Rarity.UNCOMMON, mage.cards.g.GreaterRealmOfPreservation.class)); cards.add(new SetCardInfo("Greed", 15, Rarity.RARE, mage.cards.g.Greed.class)); cards.add(new SetCardInfo("Green Mana Battery", 223, Rarity.UNCOMMON, mage.cards.g.GreenManaBattery.class)); cards.add(new SetCardInfo("Gwendlyn Di Corci", 268, Rarity.RARE, mage.cards.g.GwendlynDiCorci.class)); diff --git a/Mage.Sets/src/mage/sets/MastersEdition.java b/Mage.Sets/src/mage/sets/MastersEdition.java index d049d73b11..0b627070ff 100644 --- a/Mage.Sets/src/mage/sets/MastersEdition.java +++ b/Mage.Sets/src/mage/sets/MastersEdition.java @@ -128,6 +128,7 @@ public class MastersEdition extends ExpansionSet { cards.add(new SetCardInfo("Goblins of the Flarg", 98, Rarity.COMMON, mage.cards.g.GoblinsOfTheFlarg.class)); cards.add(new SetCardInfo("Goblin Wizard", 97, Rarity.RARE, mage.cards.g.GoblinWizard.class)); cards.add(new SetCardInfo("Granite Gargoyle", 99, Rarity.UNCOMMON, mage.cards.g.GraniteGargoyle.class)); + cards.add(new SetCardInfo("Greater Realm of Preservation", 13, Rarity.UNCOMMON, mage.cards.g.GreaterRealmOfPreservation.class)); cards.add(new SetCardInfo("Hallowed Ground", 14, Rarity.UNCOMMON, mage.cards.h.HallowedGround.class)); cards.add(new SetCardInfo("Hand of Justice", 15, Rarity.RARE, mage.cards.h.HandOfJustice.class)); cards.add(new SetCardInfo("Hecatomb", 71, Rarity.RARE, mage.cards.h.Hecatomb.class)); @@ -196,6 +197,7 @@ public class MastersEdition extends ExpansionSet { cards.add(new SetCardInfo("Rabid Wombat", 126, Rarity.UNCOMMON, mage.cards.r.RabidWombat.class)); cards.add(new SetCardInfo("Rainbow Vale", 179, Rarity.RARE, mage.cards.r.RainbowVale.class)); cards.add(new SetCardInfo("Righteous Avengers", 25, Rarity.COMMON, mage.cards.r.RighteousAvengers.class)); + cards.add(new SetCardInfo("Ring of Ma'rûf", 163, Rarity.RARE, mage.cards.r.RingOfMaruf.class)); cards.add(new SetCardInfo("River Merfolk", 47, Rarity.COMMON, mage.cards.r.RiverMerfolk.class)); cards.add(new SetCardInfo("Roots", 127, Rarity.COMMON, mage.cards.r.Roots.class)); cards.add(new SetCardInfo("Scryb Sprites", 128, Rarity.COMMON, mage.cards.s.ScrybSprites.class)); @@ -229,7 +231,7 @@ public class MastersEdition extends ExpansionSet { cards.add(new SetCardInfo("Tornado", 136, Rarity.RARE, mage.cards.t.Tornado.class)); cards.add(new SetCardInfo("Urza's Bauble", 170, Rarity.UNCOMMON, mage.cards.u.UrzasBauble.class)); cards.add(new SetCardInfo("Urza's Chalice", 171, Rarity.COMMON, mage.cards.u.UrzasChalice.class)); - cards.add(new SetCardInfo("Varchild's War-Riders", 110, Rarity.RARE, mage.cards.v.VarchildsWarRiders.class)); + cards.add(new SetCardInfo("Varchild's War-Riders", 110, Rarity.RARE, mage.cards.v.VarchildsWarRiders.class)); cards.add(new SetCardInfo("Vesuvan Doppelganger", 54, Rarity.RARE, mage.cards.v.VesuvanDoppelganger.class)); cards.add(new SetCardInfo("Vodalian Knights", 55, Rarity.UNCOMMON, mage.cards.v.VodalianKnights.class)); cards.add(new SetCardInfo("Walking Wall", 172, Rarity.UNCOMMON, mage.cards.w.WalkingWall.class)); diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 96aadcec6a..1b5bcf25b0 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -255,6 +255,7 @@ public class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Rishadan Brigand", 92, Rarity.RARE, mage.cards.r.RishadanBrigand.class)); cards.add(new SetCardInfo("Rishadan Cutpurse", 93, Rarity.COMMON, mage.cards.r.RishadanCutpurse.class)); cards.add(new SetCardInfo("Rishadan Footpad", 94, Rarity.UNCOMMON, mage.cards.r.RishadanFootpad.class)); + cards.add(new SetCardInfo("Rishadan Pawnshop", 311, Rarity.RARE, mage.cards.r.RishadanPawnshop.class)); cards.add(new SetCardInfo("Rishadan Port", 324, Rarity.RARE, mage.cards.r.RishadanPort.class)); cards.add(new SetCardInfo("Rock Badger", 210, Rarity.UNCOMMON, mage.cards.r.RockBadger.class)); cards.add(new SetCardInfo("Rushwood Dryad", 263, Rarity.COMMON, mage.cards.r.RushwoodDryad.class)); diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index 2569ca1acf..131dbe8efa 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -1,9 +1,5 @@ package mage; -import java.io.Serializable; -import java.util.EnumSet; -import java.util.List; -import java.util.UUID; import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; @@ -19,6 +15,11 @@ import mage.game.Game; import mage.game.events.ZoneChangeEvent; import mage.util.SubTypeList; +import java.io.Serializable; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; + public interface MageObject extends MageItem, Serializable { String getName(); @@ -177,7 +178,7 @@ public interface MageObject extends MageItem, Serializable { } } for (SubType subtype : this.getSubtype(game)) { - if (otherCard.getSubtype(game).contains(subtype)) { + if (otherCard.hasSubtype(subtype, game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/common/AuraAttachedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AuraAttachedTriggeredAbility.java index 375aa2ccda..54937ec333 100644 --- a/Mage/src/main/java/mage/abilities/common/AuraAttachedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AuraAttachedTriggeredAbility.java @@ -58,7 +58,7 @@ public class AuraAttachedTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { Permanent attachment = game.getPermanent(event.getSourceId()); - if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) { + if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/EquippedMultipleSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EquippedMultipleSourceCondition.java index 5cf42544ea..1d4da7cf8a 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EquippedMultipleSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EquippedMultipleSourceCondition.java @@ -29,11 +29,11 @@ package mage.abilities.condition.common; import mage.abilities.Ability; import mage.abilities.condition.Condition; +import mage.constants.SubType; import mage.game.Game; import mage.game.permanent.Permanent; import java.util.UUID; -import mage.constants.SubType; /** * Describes condition when creature is equipped with more than one Equipment. @@ -51,7 +51,7 @@ public enum EquippedMultipleSourceCondition implements Condition { if (permanent != null) { for (UUID uuid : permanent.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) { countEquipped++; if (countEquipped >= 2) { return true; diff --git a/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java index 645ade621c..c311bc24ce 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java @@ -50,7 +50,7 @@ public enum EquippedSourceCondition implements Condition { if (permanent != null) { for (UUID uuid : permanent.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/AuraAttachedCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/AuraAttachedCount.java index 2bf48de780..b537a92bd9 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/AuraAttachedCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/AuraAttachedCount.java @@ -64,7 +64,7 @@ public class AuraAttachedCount implements DynamicValue { List attachments = p.getAttachments(); for (UUID attachmentId : attachments) { Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype(game).contains(SubType.AURA)) { + if (attached != null && attached.hasSubtype(SubType.AURA, game)) { count++; } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java index d6ae575e81..61ae15257d 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java @@ -1,14 +1,14 @@ package mage.abilities.dynamicvalue.common; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.constants.CardType; import mage.constants.SubType; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * @author Loki */ @@ -63,19 +63,19 @@ public class DomainValue implements DynamicValue { } for (Permanent p : game.getBattlefield().getAllActivePermanents(targetPlayer)) { if (p.isLand()) { - if (havePlains == 0 && p.getSubtype(game).contains(SubType.PLAINS)) { + if (havePlains == 0 && p.hasSubtype(SubType.PLAINS, game)) { havePlains = 1; } - if (haveIslands == 0 && p.getSubtype(game).contains(SubType.ISLAND)) { + if (haveIslands == 0 && p.hasSubtype(SubType.ISLAND, game)) { haveIslands = 1; } - if (haveMountains == 0 && p.getSubtype(game).contains(SubType.MOUNTAIN)) { + if (haveMountains == 0 && p.hasSubtype(SubType.MOUNTAIN, game)) { haveMountains = 1; } - if (haveSwamps == 0 && p.getSubtype(game).contains(SubType.SWAMP)) { + if (haveSwamps == 0 && p.hasSubtype(SubType.SWAMP, game)) { haveSwamps = 1; } - if (haveForests == 0 && p.getSubtype(game).contains(SubType.FOREST)) { + if (haveForests == 0 && p.hasSubtype(SubType.FOREST, game)) { haveForests = 1; } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/EquipmentAttachedCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/EquipmentAttachedCount.java index d9c7516637..15c87cfaba 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/EquipmentAttachedCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/EquipmentAttachedCount.java @@ -27,8 +27,6 @@ */ package mage.abilities.dynamicvalue.common; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; @@ -36,6 +34,9 @@ import mage.constants.SubType; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.List; +import java.util.UUID; + /** * * @author North, noxx @@ -64,7 +65,7 @@ public class EquipmentAttachedCount implements DynamicValue { List attachments = permanent.getAttachments(); for (UUID attachmentId : attachments) { Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) { count++; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java index 88cddba460..746ca3f4ef 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java @@ -27,9 +27,6 @@ */ package mage.abilities.effects.common; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.MageObject; import mage.ObjectColor; import mage.abilities.Ability; @@ -51,6 +48,10 @@ import mage.util.CardUtil; import mage.util.functions.ApplyToPermanent; import mage.util.functions.EmptyApplyToPermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -237,10 +238,10 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect { if (tokenToughness != Integer.MIN_VALUE) { token.getToughness().modifyBaseValue(tokenToughness); } - if (additionalSubType != null && !token.getSubtype(game).contains(additionalSubType)) { + if (additionalSubType != null && !token.hasSubtype(additionalSubType, game)) { token.getSubtype(game).add(additionalSubType); } - if (onlySubType != null && !token.getSubtype(game).contains(onlySubType)) { + if (onlySubType != null && !token.hasSubtype(onlySubType, game)) { token.getSubtype(game).clear(); token.getSubtype(game).add(onlySubType); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java index e4ca732835..67aad3e4cb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAllEffect.java @@ -59,7 +59,7 @@ public class AddCardSubtypeAllEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - if (perm != null && !perm.getSubtype(game).contains(addedSubtype)) { + if (perm != null && !perm.hasSubtype(addedSubtype, game)) { perm.getSubtype(game).add(addedSubtype); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAttachedEffect.java index 76aefcab8a..e7f41ef050 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSubtypeAttachedEffect.java @@ -59,7 +59,7 @@ public class AddCardSubtypeAttachedEffect extends ContinuousEffectImpl { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent target = game.getPermanent(equipment.getAttachedTo()); - if (target != null && !target.getSubtype(game).contains(addedSubtype)) + if (target != null && !target.hasSubtype(addedSubtype, game)) target.getSubtype(game).add(addedSubtype); } return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java index 00763a3831..010cf646b3 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java @@ -84,7 +84,7 @@ public class BecomesAuraSourceEffect extends ContinuousEffectImpl implements Sou switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!permanent.getSubtype(game).contains(SubType.AURA)) { + if (!permanent.hasSubtype(SubType.AURA, game)) { permanent.getSubtype(game).add(SubType.AURA); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java index a8007645ec..0db8746d06 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java @@ -75,27 +75,27 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl { for (SubType landType : landTypes) { switch (landType) { case SWAMP: - if (permanent.getSubtype(game).contains(SubType.SWAMP)) { // type can be removed by other effect with newer timestamp, so no ability adding + if (permanent.hasSubtype(SubType.SWAMP, game)) { // type can be removed by other effect with newer timestamp, so no ability adding permanent.addAbility(new BlackManaAbility(), source.getSourceId(), game); } break; case MOUNTAIN: - if (permanent.getSubtype(game).contains(SubType.MOUNTAIN)) { + if (permanent.hasSubtype(SubType.MOUNTAIN, game)) { permanent.addAbility(new RedManaAbility(), source.getSourceId(), game); } break; case FOREST: - if (permanent.getSubtype(game).contains(SubType.FOREST)) { + if (permanent.hasSubtype(SubType.FOREST, game)) { permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game); } break; case ISLAND: - if (permanent.getSubtype(game).contains(SubType.ISLAND)) { + if (permanent.hasSubtype(SubType.ISLAND, game)) { permanent.addAbility(new BlueManaAbility(), source.getSourceId(), game); } break; case PLAINS: - if (permanent.getSubtype(game).contains(SubType.PLAINS)) { + if (permanent.hasSubtype(SubType.PLAINS, game)) { permanent.addAbility(new WhiteManaAbility(), source.getSourceId(), game); } break; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 845dba8896..e843082305 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -149,7 +149,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } else { landTypesToAdd.clear(); for (SubType subtype : landTypes) { - if (!land.getSubtype(game).contains(subtype)) { + if (!land.hasSubtype(subtype, game)) { land.getSubtype(game).add(subtype); landTypesToAdd.add(subtype); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java index 6310cc7115..da2e7b4a5e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java @@ -104,7 +104,7 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { break; } for (SubType t : token.getSubtype(game)) { - if (!permanent.getSubtype(game).contains(t)) { + if (!permanent.hasSubtype(t, game)) { permanent.getSubtype(game).add(t); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect.java index 5e2f408753..9b62e1e933 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect.java @@ -120,7 +120,7 @@ public class BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect extends Co break; } for (SubType subType : token.getSubtype(game)) { - if (!permanentAttachedTo.getSubtype(game).contains(subType)) { + if (!permanentAttachedTo.hasSubtype(subType, game)) { permanentAttachedTo.getSubtype(game).add(subType); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java index 2964330d10..43915d9ac7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java @@ -27,7 +27,7 @@ public class BecomesCreatureIfVehicleEffect extends ContinuousEffectImpl { Permanent aura = game.getPermanent(source.getSourceId()); if (aura != null && aura.getAttachedTo() != null) { Permanent enchanted = game.getPermanent(aura.getAttachedTo()); - if (enchanted != null && enchanted.getSubtype(game).contains(SubType.VEHICLE)) { + if (enchanted != null && enchanted.hasSubtype(SubType.VEHICLE, game)) { enchanted.addCardType(addedType); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java index 0872acbf64..b95e5b79e5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java @@ -89,7 +89,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { } else { if (!token.getSubtype(game).isEmpty()) { for (SubType subtype : token.getSubtype(game)) { - if (!permanent.getSubtype(game).contains(subtype)) { + if (!permanent.hasSubtype(subtype, game)) { permanent.getSubtype(game).add(subtype); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java index 04702ba86b..e5a140ff81 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java @@ -77,7 +77,7 @@ public class BecomesCreatureTypeTargetEffect extends ContinuousEffectImpl { permanent.getSubtype(game).addAll(subtypes); } else { for (SubType subtype : subtypes) { - if (!permanent.getSubtype(game).contains(subtype)) { + if (!permanent.hasSubtype(subtype, game)) { permanent.getSubtype(game).add(subtype); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java index 0758cd8519..3bc5c7a936 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java @@ -74,7 +74,7 @@ public class BecomesSubtypeAllEffect extends ContinuousEffectImpl { permanent.getSubtype(game).addAll(subtypes); } else { for (SubType subtype : subtypes) { - if (!permanent.getSubtype(game).contains(subtype)) { + if (!permanent.hasSubtype(subtype, game)) { permanent.getSubtype(game).add(subtype); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java b/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java index c623bc5966..b662a74911 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java @@ -94,7 +94,7 @@ class AuraSwapEffect extends OneShotEffect { if (controller != null) { Permanent auraSourcePermanent = game.getPermanent(source.getSourceId()); if (auraSourcePermanent != null - && auraSourcePermanent.getSubtype(game).contains(SubType.AURA) + && auraSourcePermanent.hasSubtype(SubType.AURA, game) && auraSourcePermanent.getOwnerId().equals(source.getControllerId())) { Permanent enchantedPermanent = game.getPermanent(auraSourcePermanent.getAttachedTo()); filterCardToCheck.add(new AuraCardCanAttachToPermanentId(enchantedPermanent.getId())); diff --git a/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java b/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java index c7f041a633..0aab88b1f3 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java @@ -188,7 +188,7 @@ class BestowEntersBattlefieldEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent bestowPermanent = game.getPermanentEntering(source.getSourceId()); if (bestowPermanent != null) { - if (bestowPermanent.getSubtype(game).contains(SubType.AURA)) { + if (bestowPermanent.hasSubtype(SubType.AURA, game)) { MageObject basicObject = bestowPermanent.getBasicMageObject(game); basicObject.getSubtype(null).add(SubType.AURA); basicObject.getCardType().remove(CardType.CREATURE); diff --git a/Mage/src/main/java/mage/abilities/keyword/EmbalmAbility.java b/Mage/src/main/java/mage/abilities/keyword/EmbalmAbility.java index 2e54362a8d..c8a4aefa48 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EmbalmAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EmbalmAbility.java @@ -110,7 +110,7 @@ class EmbalmEffect extends OneShotEffect { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(card); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) token.getColor(game).setColor(ObjectColor.WHITE); - if (!token.getSubtype(game).contains(SubType.ZOMBIE)) { + if (!token.hasSubtype(SubType.ZOMBIE, game)) { token.getSubtype(game).add(0, SubType.ZOMBIE); } token.getManaCost().clear(); diff --git a/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java b/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java index 10260b59d6..e7ae5d52af 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java @@ -115,7 +115,7 @@ class EternalizeEffect extends OneShotEffect { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(card); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) token.getColor(game).setColor(ObjectColor.BLACK); - if (!token.getSubtype(game).contains(SubType.ZOMBIE)) { + if (!token.hasSubtype(SubType.ZOMBIE, game)) { token.getSubtype(game).add(0, SubType.ZOMBIE); } token.getManaCost().clear(); diff --git a/Mage/src/main/java/mage/abilities/keyword/SpliceOntoArcaneAbility.java b/Mage/src/main/java/mage/abilities/keyword/SpliceOntoArcaneAbility.java index 4926f258ff..b21ebe7d89 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SpliceOntoArcaneAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SpliceOntoArcaneAbility.java @@ -27,7 +27,6 @@ */ package mage.abilities.keyword; -import java.util.Iterator; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.SpellAbility; @@ -38,15 +37,13 @@ import mage.abilities.costs.CostsImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.SpliceCardEffectImpl; import mage.cards.Card; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SpellAbilityType; -import mage.constants.SubType; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.stack.Spell; import mage.players.Player; +import java.util.Iterator; + /** * 702.45. Splice @@ -183,7 +180,7 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { MageObject object = game.getObject(abilityToModify.getSourceId()); - if (object != null && object.getSubtype(game).contains(SubType.ARCANE)) { + if (object != null && object.hasSubtype(SubType.ARCANE, game)) { return spliceSpellCanBeActivated(source, game); } return false; diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/EquippedPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/EquippedPredicate.java index c88f12c831..87ca0911f6 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/EquippedPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/EquippedPredicate.java @@ -21,7 +21,7 @@ public class EquippedPredicate implements Predicate { public boolean apply(Permanent input, Game game) { for (UUID attachmentId : input.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getSubtype(game).contains(SubType.EQUIPMENT)) { + if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) { return true; } } diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 56dd77e916..18babecc50 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -929,7 +929,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public boolean cantBeAttachedBy(MageObject source, Game game) { for (ProtectionAbility ability : this.getAbilities(game).getProtectionAbilities()) { - if (!(source.getSubtype(game).contains(SubType.AURA) + if (!(source.hasSubtype(SubType.AURA, game) && !ability.removesAuras()) && !source.getId().equals(ability.getAuraIdNotToBeRemoved()) && !ability.canTarget(source, game)) { diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index 391939efdd..38d664896e 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -27,10 +27,6 @@ */ package mage.game.stack; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.Mana; @@ -64,6 +60,11 @@ import mage.players.Player; import mage.util.GameLog; import mage.util.SubTypeList; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; + /** * * @author BetaSteward_at_googlemail.com @@ -245,7 +246,7 @@ public class Spell extends StackObjImpl implements Card { } counter(null, game); return false; - } else if (this.isEnchantment() && this.getSubtype(game).contains(SubType.AURA)) { + } else if (this.isEnchantment() && this.hasSubtype(SubType.AURA, game)) { if (ability.getTargets().stillLegal(ability, game)) { updateOptionalCosts(0); boolean bestow = ability instanceof BestowAbility; diff --git a/Mage/src/main/java/mage/util/SubTypeList.java b/Mage/src/main/java/mage/util/SubTypeList.java index 08fc2575ba..cf6fd8ef9e 100644 --- a/Mage/src/main/java/mage/util/SubTypeList.java +++ b/Mage/src/main/java/mage/util/SubTypeList.java @@ -1,14 +1,17 @@ package mage.util; +import mage.constants.SubType; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import mage.constants.SubType; public class SubTypeList extends ArrayList { + + @Deprecated public boolean addAll(List subtypes) { return addAll(subtypes.stream() diff --git a/Mage/src/main/java/mage/util/functions/AddSubtypeApplier.java b/Mage/src/main/java/mage/util/functions/AddSubtypeApplier.java index 9ba53f1758..6f5c35e93d 100644 --- a/Mage/src/main/java/mage/util/functions/AddSubtypeApplier.java +++ b/Mage/src/main/java/mage/util/functions/AddSubtypeApplier.java @@ -5,13 +5,14 @@ */ package mage.util.functions; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.constants.SubType; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * * @author LevelX2 @@ -26,7 +27,7 @@ public class AddSubtypeApplier extends ApplyToPermanent { @Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { - if (!permanent.getSubtype(game).contains(subtype)) { + if (!permanent.hasSubtype(subtype, game)) { permanent.getSubtype(game).add(subtype); } return true; @@ -34,7 +35,7 @@ public class AddSubtypeApplier extends ApplyToPermanent { @Override public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) { - if (!mageObject.getSubtype(game).contains(subtype)) { + if (!mageObject.hasSubtype(subtype, game)) { mageObject.getSubtype(game).add(subtype); } return true;