From e2da104d6d2e808d73096a54da41c6f1626d1027 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Wed, 27 Jun 2018 22:02:53 -0400 Subject: [PATCH 01/58] Implement Keeper of the Beasts --- .../src/mage/cards/k/KeeperOfTheBeasts.java | 111 ++++++++++++++++++ Mage.Sets/src/mage/sets/Exodus.java | 3 +- .../game/permanent/token/BeastToken4.java | 45 +++++++ 3 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/k/KeeperOfTheBeasts.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/BeastToken4.java diff --git a/Mage.Sets/src/mage/cards/k/KeeperOfTheBeasts.java b/Mage.Sets/src/mage/cards/k/KeeperOfTheBeasts.java new file mode 100644 index 0000000000..cc4ccc8fcd --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KeeperOfTheBeasts.java @@ -0,0 +1,111 @@ +package mage.cards.k; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +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.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterOpponent; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.BeastToken2; +import mage.game.permanent.token.BeastToken4; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetOpponent; + +/** + * + * @author noahg + */ +public final class KeeperOfTheBeasts extends CardImpl { + + public KeeperOfTheBeasts(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {G}, {tap}: Choose target opponent who controlled more creatures than you did as you activated this ability. Put a 2/2 green Beast creature token onto the battlefield. + Ability ability = new SimpleActivatedAbility(new CreateTokenEffect(new BeastToken4()).setText("Choose target opponent who controlled more creatures than you did as you activated this ability. Put a 2/2 green Beast creature token onto the battlefield."), + new ManaCostsImpl("{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new KeeperOfTheBeastsTarget()); + this.addAbility(ability); + } + + public KeeperOfTheBeasts(final KeeperOfTheBeasts card) { + super(card); + } + + @Override + public KeeperOfTheBeasts copy() { + return new KeeperOfTheBeasts(this); + } +} + +class KeeperOfTheBeastsTarget extends TargetPlayer { + + public KeeperOfTheBeastsTarget() { + super(1, 1, false, new FilterOpponent("opponent that controls more creatures than you")); + } + + public KeeperOfTheBeastsTarget(final KeeperOfTheBeastsTarget target) { + super(target); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); + Set possibleTargets = new HashSet<>(); + int creaturesController = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game); + + for (UUID targetId : availablePossibleTargets) { + if (game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, targetId, game) > creaturesController) { + possibleTargets.add(targetId); + } + } + return possibleTargets; + } + + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int count = 0; + MageObject targetSource = game.getObject(sourceId); + Player controller = game.getPlayer(sourceControllerId); + if (controller != null) { + for (UUID playerId : game.getState().getPlayersInRange(sourceControllerId, game)) { + Player player = game.getPlayer(playerId); + if (player != null + && game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game) + < game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game) + && !player.hasLeft() + && filter.match(player, sourceId, sourceControllerId, game) + && player.canBeTargetedBy(targetSource, sourceControllerId, game)) { + count++; + if (count >= this.minNumberOfTargets) { + return true; + } + } + } + } + return false; + } + + @Override + public KeeperOfTheBeastsTarget copy() { + return new KeeperOfTheBeastsTarget(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/Exodus.java b/Mage.Sets/src/mage/sets/Exodus.java index 0322801819..c80118de2c 100644 --- a/Mage.Sets/src/mage/sets/Exodus.java +++ b/Mage.Sets/src/mage/sets/Exodus.java @@ -68,8 +68,9 @@ public final class Exodus extends ExpansionSet { cards.add(new SetCardInfo("Hatred", 64, Rarity.RARE, mage.cards.h.Hatred.class)); cards.add(new SetCardInfo("High Ground", 7, Rarity.UNCOMMON, mage.cards.h.HighGround.class)); cards.add(new SetCardInfo("Jackalope Herd", 111, Rarity.COMMON, mage.cards.j.JackalopeHerd.class)); + cards.add(new SetCardInfo("Keeper of the Beasts", 112, Rarity.UNCOMMON, mage.cards.k.KeeperOfTheBeasts.class)); cards.add(new SetCardInfo("Keeper of the Dead", 65, Rarity.UNCOMMON, mage.cards.k.KeeperOfTheDead.class)); - cards.add(new SetCardInfo("Keeper of the Light", 8, Rarity.UNCOMMON, mage.cards.k.KeeperOfTheLight.class)); + cards.add(new SetCardInfo("Keeper of the Light", 8, Rarity.UNCOMMON, mage.cards.k.KeeperOfTheLight.class)); cards.add(new SetCardInfo("Killer Whale", 37, Rarity.UNCOMMON, mage.cards.k.KillerWhale.class)); cards.add(new SetCardInfo("Kor Chant", 9, Rarity.COMMON, mage.cards.k.KorChant.class)); cards.add(new SetCardInfo("Mage il-Vec", 86, Rarity.COMMON, mage.cards.m.MageIlVec.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/BeastToken4.java b/Mage/src/main/java/mage/game/permanent/token/BeastToken4.java new file mode 100644 index 0000000000..d6b579b451 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/BeastToken4.java @@ -0,0 +1,45 @@ + +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public final class BeastToken4 extends TokenImpl { + + public BeastToken4() { + this(null, 0); + } + + public BeastToken4(String setCode) { + this(setCode, 0); + } + + public BeastToken4(String setCode, int tokenType) { + super("Beast", "2/2 green Beast creature token"); + setOriginalExpansionSetCode(setCode != null ? setCode : "EXO"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add(SubType.BEAST); + power = new MageInt(2); + toughness = new MageInt(2); + + } + + public BeastToken4(final BeastToken4 token) { + super(token); + } + + @Override + public BeastToken4 copy() { + return new BeastToken4(this); + } +} From 174588e34311b8d9d0c47873972d74a31dc6845e Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Fri, 29 Jun 2018 20:47:11 -0400 Subject: [PATCH 02/58] Implement Aetherplasm --- Mage.Sets/src/mage/cards/a/Aetherplasm.java | 98 +++++++++++++++++++ Mage.Sets/src/mage/sets/Guildpact.java | 1 + .../effects/common/DoIfCostPaid.java | 1 + 3 files changed, 100 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/Aetherplasm.java diff --git a/Mage.Sets/src/mage/cards/a/Aetherplasm.java b/Mage.Sets/src/mage/cards/a/Aetherplasm.java new file mode 100644 index 0000000000..6864f3c98f --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/Aetherplasm.java @@ -0,0 +1,98 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author noahg + */ +public final class Aetherplasm extends CardImpl { + + public Aetherplasm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + + this.subtype.add(SubType.ILLUSION); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Aetherplasm blocks a creature, you may return Aetherplasm to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature. + this.addAbility(new BlocksTriggeredAbility + (new DoIfCostPaid(new AetherplasmEffect(), new ReturnToHandFromBattlefieldSourceCost()), false, true)); + } + + public Aetherplasm(final Aetherplasm card) { + super(card); + } + + @Override + public Aetherplasm copy() { + return new Aetherplasm(this); + } +} + +class AetherplasmEffect extends OneShotEffect { + + public AetherplasmEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "you may put a creature card from your hand onto the battlefield blocking that creature"; + } + + public AetherplasmEffect(AetherplasmEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent blockedCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (player == null) { + return false; + } + if (player.chooseUse(Outcome.PutCardInPlay, "Put a creature card from your hand onto the battlefield?", source, game)) { + TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A); + if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + if(player.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null) + && game.getCombat() != null && blockedCreature != null){ + CombatGroup attacker = game.getCombat().findGroup(blockedCreature.getId()); + Permanent putIntoPlay = game.getPermanent(target.getFirstTarget()); + if (putIntoPlay != null && putIntoPlay.isCreature() &&attacker != null) { + game.getCombat().findGroup(blockedCreature.getId()).addBlocker(putIntoPlay.getId(), source.getControllerId(), game); + return true; + } + } + } + } + } + return false; + } + + @Override + public AetherplasmEffect copy() { + return new AetherplasmEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Guildpact.java b/Mage.Sets/src/mage/sets/Guildpact.java index 5eadbe6723..0d4e7a3ec7 100644 --- a/Mage.Sets/src/mage/sets/Guildpact.java +++ b/Mage.Sets/src/mage/sets/Guildpact.java @@ -29,6 +29,7 @@ public final class Guildpact extends ExpansionSet { this.ratioBoosterMythic = 0; cards.add(new SetCardInfo("Absolver Thrull", 1, Rarity.COMMON, mage.cards.a.AbsolverThrull.class)); cards.add(new SetCardInfo("Abyssal Nocturnus", 43, Rarity.RARE, mage.cards.a.AbyssalNocturnus.class)); + cards.add(new SetCardInfo("Aetherplasm", 22, Rarity.UNCOMMON, mage.cards.a.Aetherplasm.class)); cards.add(new SetCardInfo("Agent of Masks", 100, Rarity.UNCOMMON, mage.cards.a.AgentOfMasks.class)); cards.add(new SetCardInfo("Angel of Despair", 101, Rarity.RARE, mage.cards.a.AngelOfDespair.class)); cards.add(new SetCardInfo("Battering Wurm", 79, Rarity.UNCOMMON, mage.cards.b.BatteringWurm.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java index e0882ae446..a68dc8e27f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java @@ -141,6 +141,7 @@ public class DoIfCostPaid extends OneShotEffect { String costText = cost.getText(); if (costText != null && !costText.toLowerCase(Locale.ENGLISH).startsWith("put") + && !costText.toLowerCase(Locale.ENGLISH).startsWith("return") && !costText.toLowerCase(Locale.ENGLISH).startsWith("exile") && !costText.toLowerCase(Locale.ENGLISH).startsWith("discard") && !costText.toLowerCase(Locale.ENGLISH).startsWith("sacrifice") From ed9d51526eccf2e863c965dcf3ee954087e89b24 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Fri, 29 Jun 2018 23:46:35 -0400 Subject: [PATCH 03/58] Implement Conjurer's Ban --- Mage.Sets/src/mage/cards/c/ConjurersBan.java | 85 ++++++++++++++++++++ Mage.Sets/src/mage/sets/Guildpact.java | 1 + 2 files changed, 86 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ConjurersBan.java diff --git a/Mage.Sets/src/mage/cards/c/ConjurersBan.java b/Mage.Sets/src/mage/cards/c/ConjurersBan.java new file mode 100644 index 0000000000..f7624da9e8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConjurersBan.java @@ -0,0 +1,85 @@ +package mage.cards.c; + +import java.util.UUID; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.ChooseACardNameEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author noahg + */ +public final class ConjurersBan extends CardImpl { + + public ConjurersBan(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{B}"); + + + // Choose a card name. Until your next turn, spells with the chosen name can’t be cast and lands with the chosen name can’t be played. + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); + this.getSpellAbility().addEffect(new ConjurersBanEffect()); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public ConjurersBan(final ConjurersBan card) { + super(card); + } + + @Override + public ConjurersBan copy() { + return new ConjurersBan(this); + } +} + +class ConjurersBanEffect extends ContinuousRuleModifyingEffectImpl { + + public ConjurersBanEffect() { + super(Duration.UntilYourNextTurn, Outcome.Detriment, true, false); + this.staticText = "spells with the chosen name can't be cast and lands with the chosen name can't be played"; + } + + public ConjurersBanEffect(final ConjurersBanEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public ConjurersBanEffect copy() { + return new ConjurersBanEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.CAST_SPELL || event.getType() == GameEvent.EventType.PLAY_LAND) { + MageObject object = game.getObject(event.getSourceId()); + return object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY)); + } + return false; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + String namedCard = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); + String playerName = game.getPlayer(source.getControllerId()).getName(); + if (namedCard == null || playerName == null || source.getSourceObject(game) == null){ + return super.getInfoMessage(source, event, game); + } + return "Until "+playerName+"'s next turn, spells named "+namedCard+" can't be cast and lands named "+namedCard+" can't be played ("+source.getSourceObject(game).getIdName()+")."; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Guildpact.java b/Mage.Sets/src/mage/sets/Guildpact.java index 5eadbe6723..16e3125609 100644 --- a/Mage.Sets/src/mage/sets/Guildpact.java +++ b/Mage.Sets/src/mage/sets/Guildpact.java @@ -44,6 +44,7 @@ public final class Guildpact extends ExpansionSet { cards.add(new SetCardInfo("Castigate", 106, Rarity.COMMON, mage.cards.c.Castigate.class)); cards.add(new SetCardInfo("Caustic Rain", 44, Rarity.UNCOMMON, mage.cards.c.CausticRain.class)); cards.add(new SetCardInfo("Cerebral Vortex", 107, Rarity.RARE, mage.cards.c.CerebralVortex.class)); + cards.add(new SetCardInfo("Conjurer's Ban", 108, Rarity.UNCOMMON, mage.cards.c.ConjurersBan.class)); cards.add(new SetCardInfo("Crash Landing", 82, Rarity.UNCOMMON, mage.cards.c.CrashLanding.class)); cards.add(new SetCardInfo("Cremate", 45, Rarity.COMMON, mage.cards.c.Cremate.class)); cards.add(new SetCardInfo("Cry of Contrition", 46, Rarity.COMMON, mage.cards.c.CryOfContrition.class)); From 83e417aa9c51e7c11d5b3cf41758f56283d7e227 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sat, 30 Jun 2018 19:23:42 -0400 Subject: [PATCH 04/58] Implement Azorius Ploy --- Mage.Sets/src/mage/cards/a/AzoriusPloy.java | 57 +++++++++++++++++++++ Mage.Sets/src/mage/sets/Dissension.java | 1 + 2 files changed, 58 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AzoriusPloy.java diff --git a/Mage.Sets/src/mage/cards/a/AzoriusPloy.java b/Mage.Sets/src/mage/cards/a/AzoriusPloy.java new file mode 100644 index 0000000000..c7e1c996d5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AzoriusPloy.java @@ -0,0 +1,57 @@ +package mage.cards.a; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.AbilityImpl; +import mage.abilities.SpellAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; + +/** + * + * @author noahg + */ +public final class AzoriusPloy extends CardImpl { + + public AzoriusPloy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}{W}{U}"); + + + // Prevent all combat damage target creature would deal this turn. + Effect effect = new PreventDamageByTargetEffect( Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage target creature would deal this turn."); + this.getSpellAbility().addEffect(effect); + Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("first creature")); + this.getSpellAbility().addTarget(target); + + // Prevent all combat damage that would be dealt to target creature this turn. + Effect effect2 = new PreventDamageToTargetEffect(Duration.EndOfTurn, true); + effect2.setText("

Prevent all combat damage that would be dealt to target creature this turn."); + effect2.setTargetPointer(SecondTargetPointer.getInstance()); + this.getSpellAbility().addEffect(effect2); + target = new TargetCreaturePermanent(new FilterCreaturePermanent("second creature (can be the same as the first)")); + this.getSpellAbility().addTarget(target); + + } + + public AzoriusPloy(final AzoriusPloy card) { + super(card); + } + + @Override + public AzoriusPloy copy() { + return new AzoriusPloy(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index 7fafc036ec..8f436cb17c 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -38,6 +38,7 @@ public final class Dissension extends ExpansionSet { cards.add(new SetCardInfo("Azorius First-Wing", 105, Rarity.COMMON, mage.cards.a.AzoriusFirstWing.class)); cards.add(new SetCardInfo("Azorius Guildmage", 141, Rarity.UNCOMMON, mage.cards.a.AzoriusGuildmage.class)); cards.add(new SetCardInfo("Azorius Herald", 2, Rarity.UNCOMMON, mage.cards.a.AzoriusHerald.class)); + cards.add(new SetCardInfo("Azorius Ploy", 106, Rarity.UNCOMMON, mage.cards.a.AzoriusPloy.class)); cards.add(new SetCardInfo("Azorius Signet", 159, Rarity.COMMON, mage.cards.a.AzoriusSignet.class)); cards.add(new SetCardInfo("Beacon Hawk", 3, Rarity.COMMON, mage.cards.b.BeaconHawk.class)); cards.add(new SetCardInfo("Biomantic Mastery", 142, Rarity.RARE, mage.cards.b.BiomanticMastery.class)); From 687c7a2b26089ed51cf4e6f93b005e4f342131e4 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 1 Jul 2018 09:22:21 -0400 Subject: [PATCH 05/58] Implement Flash Foliage --- Mage.Sets/src/mage/cards/f/FlashFoliage.java | 101 +++++++++++++++++++ Mage.Sets/src/mage/sets/Dissension.java | 1 + 2 files changed, 102 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FlashFoliage.java diff --git a/Mage.Sets/src/mage/cards/f/FlashFoliage.java b/Mage.Sets/src/mage/cards/f/FlashFoliage.java new file mode 100644 index 0000000000..2460dffc86 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FlashFoliage.java @@ -0,0 +1,101 @@ +package mage.cards.f; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.CastOnlyDuringPhaseStepSourceAbility; +import mage.abilities.condition.common.AfterBlockersAreDeclaredCondition; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TurnPhase; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.SaprolingToken; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.common.FilterCreatureAttackingYou; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author noahg + */ +public final class FlashFoliage extends CardImpl { + + public FlashFoliage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); + + + // Cast Flash Foliage only during combat after blockers are declared. + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.instance)); + + // Create a 1/1 green Saproling creature token that’s blocking target creature attacking you. + this.getSpellAbility().addEffect(new FlashFoliageEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreatureAttackingYou())); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public FlashFoliage(final FlashFoliage card) { + super(card); + } + + @Override + public FlashFoliage copy() { + return new FlashFoliage(this); + } +} + +class FlashFoliageEffect extends OneShotEffect { + + public FlashFoliageEffect() { + super(Outcome.Benefit); + this.staticText = "create a 1/1 green Saproling creature token that’s blocking target creature attacking you"; + } + + public FlashFoliageEffect(final FlashFoliageEffect effect) { + super(effect); + } + + @Override + public FlashFoliageEffect copy() { + return new FlashFoliageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + + if (controller != null) { + Token token = new SaprolingToken(); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + Permanent attackingCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (attackingCreature != null && game.getState().getCombat() != null) { + // Possible ruling (see Aetherplasm) + // The token you created is blocking the attacking creature, + // even if the block couldn't legally be declared (for example, if that creature + // enters the battlefield tapped, or it can't block, or the attacking creature + // has protection from it) + CombatGroup combatGroup = game.getState().getCombat().findGroup(attackingCreature.getId()); + if (combatGroup != null) { + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent saprolingToken = game.getPermanent(tokenId); + if (saprolingToken != null) { + combatGroup.addBlocker(tokenId, source.getControllerId(), game); + game.getCombat().addBlockingGroup(tokenId, attackingCreature.getId(), controller.getId(), game); + } + } + combatGroup.pickBlockerOrder(attackingCreature.getControllerId(), game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index 7fafc036ec..a8d1817105 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -75,6 +75,7 @@ public final class Dissension extends ExpansionSet { cards.add(new SetCardInfo("Experiment Kraj", 110, Rarity.RARE, mage.cards.e.ExperimentKraj.class)); cards.add(new SetCardInfo("Flame-Kin War Scout", 61, Rarity.UNCOMMON, mage.cards.f.FlameKinWarScout.class)); cards.add(new SetCardInfo("Flaring Flame-Kin", 62, Rarity.UNCOMMON, mage.cards.f.FlaringFlameKin.class)); + cards.add(new SetCardInfo("Flash Foliage", 85, Rarity.UNCOMMON, mage.cards.f.FlashFoliage.class)); cards.add(new SetCardInfo("Freewind Equenaut", 9, Rarity.COMMON, mage.cards.f.FreewindEquenaut.class)); cards.add(new SetCardInfo("Ghost Quarter", 173, Rarity.UNCOMMON, mage.cards.g.GhostQuarter.class)); cards.add(new SetCardInfo("Gnat Alley Creeper", 63, Rarity.UNCOMMON, mage.cards.g.GnatAlleyCreeper.class)); From f83abb4fef3f0075ad1277c4c2d91608f48f37f8 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 1 Jul 2018 10:08:32 -0400 Subject: [PATCH 06/58] Implement Nettling Curse --- Mage.Sets/src/mage/cards/n/NettlingCurse.java | 54 +++++++++++++++++++ Mage.Sets/src/mage/sets/Dissension.java | 1 + 2 files changed, 55 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NettlingCurse.java diff --git a/Mage.Sets/src/mage/cards/n/NettlingCurse.java b/Mage.Sets/src/mage/cards/n/NettlingCurse.java new file mode 100644 index 0000000000..062efbbfe3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NettlingCurse.java @@ -0,0 +1,54 @@ +package mage.cards.n; + +import java.util.UUID; + +import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.LoseLifeControllerAttachedEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.combat.AttacksIfAbleAttachedEffect; +import mage.constants.*; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.effects.common.AttachEffect; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; + +/** + * + * @author noahg + */ +public final class NettlingCurse extends CardImpl { + + public NettlingCurse(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Whenever enchanted creature attacks or blocks, its controller loses 3 life. + this.addAbility(new AttacksOrBlocksEnchantedTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeControllerAttachedEffect(3))); + + // {1}{R}: Enchanted creature attacks this turn if able. + this.addAbility(new SimpleActivatedAbility(new AttacksIfAbleAttachedEffect(Duration.EndOfTurn, AttachmentType.AURA), new ManaCostsImpl("{1}{R}"))); + } + + public NettlingCurse(final NettlingCurse card) { + super(card); + } + + @Override + public NettlingCurse copy() { + return new NettlingCurse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index 7fafc036ec..cee1502119 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -105,6 +105,7 @@ public final class Dissension extends ExpansionSet { cards.add(new SetCardInfo("Minister of Impediments", 144, Rarity.COMMON, mage.cards.m.MinisterOfImpediments.class)); cards.add(new SetCardInfo("Mistral Charger", 13, Rarity.UNCOMMON, mage.cards.m.MistralCharger.class)); cards.add(new SetCardInfo("Momir Vig, Simic Visionary", 118, Rarity.RARE, mage.cards.m.MomirVigSimicVisionary.class)); + cards.add(new SetCardInfo("Nettling Curse", 48, Rarity.COMMON, mage.cards.n.NettlingCurse.class)); cards.add(new SetCardInfo("Nihilistic Glee", 50, Rarity.RARE, mage.cards.n.NihilisticGlee.class)); cards.add(new SetCardInfo("Novijen, Heart of Progress", 175, Rarity.UNCOMMON, mage.cards.n.NovijenHeartOfProgress.class)); cards.add(new SetCardInfo("Novijen Sages", 27, Rarity.RARE, mage.cards.n.NovijenSages.class)); From 2720af7b0f9dcd3e1ebecad818827f10128e5399 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 1 Jul 2018 13:36:30 -0400 Subject: [PATCH 07/58] Implement Fertile Imagination --- Mage.Sets/src/mage/cards/b/BloodOath.java | 2 +- .../src/mage/cards/f/FertileImagination.java | 125 ++++++++++++++++++ Mage.Sets/src/mage/sets/Dissension.java | 1 + 3 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/f/FertileImagination.java diff --git a/Mage.Sets/src/mage/cards/b/BloodOath.java b/Mage.Sets/src/mage/cards/b/BloodOath.java index d9c07dda95..0edc503b6b 100644 --- a/Mage.Sets/src/mage/cards/b/BloodOath.java +++ b/Mage.Sets/src/mage/cards/b/BloodOath.java @@ -80,7 +80,7 @@ class BloodOathEffect extends OneShotEffect { if (player != null && opponent != null && sourceObject != null) { Choice choiceImpl = new ChoiceImpl(); choiceImpl.setChoices(choice); - if (!player.choose(Outcome.Neutral, choiceImpl, game)) { + if (player.choose(Outcome.Neutral, choiceImpl, game)) { CardType type = null; String choosenType = choiceImpl.getChoice(); diff --git a/Mage.Sets/src/mage/cards/f/FertileImagination.java b/Mage.Sets/src/mage/cards/f/FertileImagination.java new file mode 100644 index 0000000000..f25b42bef3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FertileImagination.java @@ -0,0 +1,125 @@ +package mage.cards.f; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.token.SaprolingToken; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author noahg + */ +public final class FertileImagination extends CardImpl { + + public FertileImagination(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + + + // Choose a card type. Target opponent reveals their hand. Create two 1/1 green Saproling creature tokens for each card of the chosen type revealed this way. + this.getSpellAbility().addEffect(new FertileImaginationEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public FertileImagination(final FertileImagination card) { + super(card); + } + + @Override + public FertileImagination copy() { + return new FertileImagination(this); + } +} + +class FertileImaginationEffect extends OneShotEffect { + + private static final Set choice = new LinkedHashSet<>(); + + static { + choice.add(CardType.ARTIFACT.toString()); + choice.add(CardType.CREATURE.toString()); + choice.add(CardType.ENCHANTMENT.toString()); + choice.add(CardType.INSTANT.toString()); + choice.add(CardType.LAND.toString()); + choice.add(CardType.PLANESWALKER.toString()); + choice.add(CardType.SORCERY.toString()); + choice.add(CardType.TRIBAL.toString()); + } + + public FertileImaginationEffect() { + super(Outcome.Benefit); + staticText = "Choose a card type. Target opponent reveals their hand. Create two 1/1 green Saproling creature tokens for each card of the chosen type revealed this way"; + } + + public FertileImaginationEffect(final FertileImaginationEffect effect) { + super(effect); + } + + @Override + public FertileImaginationEffect copy() { + return new FertileImaginationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player player = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(source.getFirstTarget()); + if (player != null && opponent != null && sourceObject != null) { + Choice choiceImpl = new ChoiceImpl(); + choiceImpl.setChoices(choice); + if (player.choose(Outcome.Neutral, choiceImpl, game)) { + CardType type = null; + String choosenType = choiceImpl.getChoice(); + + if (choosenType.equals(CardType.ARTIFACT.toString())) { + type = CardType.ARTIFACT; + } else if (choosenType.equals(CardType.LAND.toString())) { + type = CardType.LAND; + } else if (choosenType.equals(CardType.CREATURE.toString())) { + type = CardType.CREATURE; + } else if (choosenType.equals(CardType.ENCHANTMENT.toString())) { + type = CardType.ENCHANTMENT; + } else if (choosenType.equals(CardType.INSTANT.toString())) { + type = CardType.INSTANT; + } else if (choosenType.equals(CardType.SORCERY.toString())) { + type = CardType.SORCERY; + } else if (choosenType.equals(CardType.PLANESWALKER.toString())) { + type = CardType.PLANESWALKER; + } else if (choosenType.equals(CardType.TRIBAL.toString())) { + type = CardType.TRIBAL; + } + if (type != null) { + Cards hand = opponent.getHand(); + SaprolingToken saprolingToken = new SaprolingToken(); + opponent.revealCards(sourceObject.getIdName(), hand, game); + Set cards = hand.getCards(game); + int tokensToMake = 0; + for (Card card : cards) { + if (card != null && card.getCardType().contains(type)) { + tokensToMake += 2; + } + } + game.informPlayers(sourceObject.getLogName() + " creates " + (tokensToMake == 0 ? "no" : "" + tokensToMake) + " 1/1 green Saproling creature tokens."); + saprolingToken.putOntoBattlefield(tokensToMake, game, source.getId(), source.getControllerId()); + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index 7fafc036ec..df2bbdbd76 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -73,6 +73,7 @@ public final class Dissension extends ExpansionSet { cards.add(new SetCardInfo("Entropic Eidolon", 45, Rarity.COMMON, mage.cards.e.EntropicEidolon.class)); cards.add(new SetCardInfo("Evolution Vat", 161, Rarity.RARE, mage.cards.e.EvolutionVat.class)); cards.add(new SetCardInfo("Experiment Kraj", 110, Rarity.RARE, mage.cards.e.ExperimentKraj.class)); + cards.add(new SetCardInfo("Fertile Imagination", 84, Rarity.UNCOMMON, mage.cards.f.FertileImagination.class)); cards.add(new SetCardInfo("Flame-Kin War Scout", 61, Rarity.UNCOMMON, mage.cards.f.FlameKinWarScout.class)); cards.add(new SetCardInfo("Flaring Flame-Kin", 62, Rarity.UNCOMMON, mage.cards.f.FlaringFlameKin.class)); cards.add(new SetCardInfo("Freewind Equenaut", 9, Rarity.COMMON, mage.cards.f.FreewindEquenaut.class)); From 84365b20066d4a388ec7b3041b28b56f15092138 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 1 Jul 2018 14:52:18 -0400 Subject: [PATCH 08/58] Fix text --- Mage.Sets/src/mage/cards/n/NettlingCurse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/n/NettlingCurse.java b/Mage.Sets/src/mage/cards/n/NettlingCurse.java index 062efbbfe3..18456d6a31 100644 --- a/Mage.Sets/src/mage/cards/n/NettlingCurse.java +++ b/Mage.Sets/src/mage/cards/n/NettlingCurse.java @@ -40,7 +40,7 @@ public final class NettlingCurse extends CardImpl { this.addAbility(new AttacksOrBlocksEnchantedTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeControllerAttachedEffect(3))); // {1}{R}: Enchanted creature attacks this turn if able. - this.addAbility(new SimpleActivatedAbility(new AttacksIfAbleAttachedEffect(Duration.EndOfTurn, AttachmentType.AURA), new ManaCostsImpl("{1}{R}"))); + this.addAbility(new SimpleActivatedAbility(new AttacksIfAbleAttachedEffect(Duration.EndOfTurn, AttachmentType.AURA).setText("Enchanted creature attacks this turn if able."), new ManaCostsImpl("{1}{R}"))); } public NettlingCurse(final NettlingCurse card) { From 16dd6d07b524751fc19a428532cb3ee4da75363f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Srde=C4=8Dn=C3=BD?= Date: Mon, 2 Jul 2018 00:41:16 +0200 Subject: [PATCH 09/58] The M19 booster has a 5/12 chance of getting the basic land slot replaced by the common taplands, that do NOT appear in the booster. Previously the taplands had the same chance to be generated as the basics, now they are generated with the proper odds. --- Mage.Sets/src/mage/sets/CoreSet2019.java | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 275e7eef3c..339078d5fa 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -1,7 +1,9 @@ package mage.sets; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import mage.cards.Card; import mage.cards.ExpansionSet; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; @@ -22,6 +24,7 @@ public final class CoreSet2019 extends ExpansionSet { return instance; } List savedSpecialCommon = new ArrayList<>(); + protected final List savedSpecialLand = new ArrayList<>(); private CoreSet2019() { super("Core Set 2019", "M19", ExpansionSet.buildDate(2018, 7, 13), SetType.CORE); @@ -35,6 +38,10 @@ public final class CoreSet2019 extends ExpansionSet { this.ratioBoosterMythic = 8; this.numBoosterDoubleFaced = -1; this.maxCardNumberInBooster = 280; + + // Core 2019 boosters have a 5/12 chance of basic land being replaced + // with the common taplands, which DO NOT appear in the common slot. + this.ratioBoosterSpecialLand = 5/12; cards.add(new SetCardInfo("Abnormal Endurance", 85, Rarity.COMMON, mage.cards.a.AbnormalEndurance.class)); cards.add(new SetCardInfo("Act of Treason", 127, Rarity.COMMON, mage.cards.a.ActOfTreason.class)); @@ -387,4 +394,29 @@ public final class CoreSet2019 extends ExpansionSet { specialCommons.addAll(savedSpecialCommon); return specialCommons; } + + @Override + // the common taplands replacing the basic land + public List getSpecialLand() + { + if (savedSpecialLand.isEmpty()) + { + List TaplandNames = Arrays.asList( + "Cinder Barrens", "Forsaken Sanctuary", "Foul Orchard", + "Highland Lake", "Meandering River", "Stone Quarry", + "Submerged Boneyard", "Timber Gorge", "Tranquil Expanse", + "Woodland Stream" + ); + + CardCriteria criteria = new CardCriteria(); + criteria.setCodes("M19"); + for (String name: TaplandNames) { criteria.nameExact(name); } + savedSpecialLand.addAll(CardRepository.instance.findCards(criteria)); + } + + return new ArrayList<>(savedSpecialLand); + } + + + } From 85402b55226ec268379f795206a9947210c19c84 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 2 Jul 2018 10:37:29 -0400 Subject: [PATCH 10/58] updated Legacy banlist (https://magic.wizards.com/en/articles/archive/news/july-2-2018-banned-restricted-update-2018-07-02) --- .../Mage.Deck.Constructed/src/mage/deck/Legacy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java index c2e9a7e7a6..90f4ee51ba 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java @@ -1,4 +1,3 @@ - package mage.deck; import mage.cards.ExpansionSet; @@ -32,6 +31,7 @@ public class Legacy extends Constructed { banned.add("Chaos Orb"); banned.add("Contract from Below"); banned.add("Darkpact"); + banned.add("Deathrite Shaman"); banned.add("Demonic Attorney"); banned.add("Demonic Consultation"); banned.add("Demonic Tutor"); @@ -42,6 +42,7 @@ public class Legacy extends Constructed { banned.add("Fastbond"); banned.add("Flash"); banned.add("Frantic Search"); + banned.add("Gitaxian Probe"); banned.add("Goblin Recruiter"); banned.add("Gush"); banned.add("Hermit Druid"); From 6cf3d8b7b4590f38657056d4d19757d7273112d9 Mon Sep 17 00:00:00 2001 From: spjspj Date: Tue, 3 Jul 2018 23:19:20 +1000 Subject: [PATCH 11/58] Fix portcullis --- Mage.Sets/src/mage/cards/p/Portcullis.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/p/Portcullis.java b/Mage.Sets/src/mage/cards/p/Portcullis.java index 319e341c8c..82ec1cea8b 100644 --- a/Mage.Sets/src/mage/cards/p/Portcullis.java +++ b/Mage.Sets/src/mage/cards/p/Portcullis.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -32,7 +31,7 @@ public final class Portcullis extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); public Portcullis(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature. String rule = "Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature"; @@ -91,14 +90,18 @@ class PortcullisExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + } if (permanent != null && creature != null) { Player controller = game.getPlayer(creature.getControllerId()); Zone currentZone = game.getState().getZone(creature.getId()); if (currentZone == Zone.BATTLEFIELD) { controller.moveCardsToExile(creature, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName()); + return true; } } return false; From 0ecff1d0fd87bab76832751fcc5bfde6b19d5467 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 3 Jul 2018 19:26:01 -0400 Subject: [PATCH 12/58] Implement Metamorphic Alteration --- .../mage/cards/m/MetamorphicAlteration.java | 153 ++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2019.java | 1 + 2 files changed, 154 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java diff --git a/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java b/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java new file mode 100644 index 0000000000..8b09566c29 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java @@ -0,0 +1,153 @@ +package mage.cards.m; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author noahg + */ +public final class MetamorphicAlteration extends CardImpl { + + public MetamorphicAlteration(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // As Metamorphic Alteration enters the battlefield, choose a creature. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACreature())); + + // Enchanted creature is a copy of the chosen creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MetamorphicAlterationEffect())); + } + + public MetamorphicAlteration(final MetamorphicAlteration card) { + super(card); + } + + @Override + public MetamorphicAlteration copy() { + return new MetamorphicAlteration(this); + } +} + +class ChooseACreature extends OneShotEffect { + + public static String INFO_KEY = "CHOSEN_CREATURE"; + + public ChooseACreature() { + super(Outcome.Copy); + staticText = "choose a creature"; + } + + public ChooseACreature(final ChooseACreature effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getPermanentEntering(source.getSourceId()); + if (sourceObject == null) { + sourceObject = game.getObject(source.getSourceId()); + } + if (controller != null && sourceObject != null) { + Target target = new TargetCreaturePermanent(); + target.setNotTarget(true); + if (target.canChoose(source.getSourceId(), controller.getId(), game)) { + controller.choose(Outcome.Copy, target, source.getSourceId(), game); + Permanent chosenPermanent = game.getPermanent(target.getFirstTarget()); + game.getState().setValue(source.getSourceId().toString() + INFO_KEY, chosenPermanent.copy()); + } + } + return false; + } + + @Override + public ChooseACreature copy() { + return new ChooseACreature(this); + } +} + +class MetamorphicAlterationEffect extends ContinuousEffectImpl { + + public MetamorphicAlterationEffect() { + super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.Copy); + this.staticText = "Enchanted creature is a copy of the chosen creature."; + } + + public MetamorphicAlterationEffect(MetamorphicAlterationEffect effect) { + super(effect); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + //TODO this is stupid and there's got to be a better way, but it works and people probably want to practice full M19 before Prerelease. + Permanent enchantment = game.getPermanent(source.getSourceId()); + Permanent copied = (Permanent) game.getState().getValue(source.getSourceId().toString() + ChooseACreature.INFO_KEY); + if (enchantment != null && copied != null) { + Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); + if (permanent != null && layer == Layer.CopyEffects_1) { + permanent.setName(copied.getName()); + permanent.getManaCost().clear(); + permanent.getManaCost().addAll(copied.getManaCost()); + permanent.setExpansionSetCode(copied.getExpansionSetCode()); + permanent.getSuperType().clear(); + for (SuperType t : copied.getSuperType()) { + permanent.addSuperType(t); + } + permanent.getCardType().clear(); + for (CardType t : copied.getCardType()) { + permanent.addCardType(t); + } + permanent.getSubtype(game).retainAll(SubType.getLandTypes(false)); + for (SubType t : copied.getSubtype(game)) { + permanent.getSubtype(game).add(t); + } + permanent.getColor(game).setColor(copied.getColor(game)); + permanent.removeAllAbilities(source.getSourceId(), game); + for (Ability ability : copied.getAbilities()) { + permanent.addAbility(ability, source.getSourceId(), game); + } + permanent.getPower().setValue(copied.getPower().getValue()); + permanent.getToughness().setValue(copied.getToughness().getValue()); + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public MetamorphicAlterationEffect copy() { + return new MetamorphicAlterationEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 339078d5fa..64bdfbc750 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -207,6 +207,7 @@ public final class CoreSet2019 extends ExpansionSet { cards.add(new SetCardInfo("Marauder's Axe", 240, Rarity.COMMON, mage.cards.m.MaraudersAxe.class)); cards.add(new SetCardInfo("Meandering River", 253, Rarity.COMMON, mage.cards.m.MeanderingRiver.class)); cards.add(new SetCardInfo("Mentor of the Meek", 27, Rarity.RARE, mage.cards.m.MentorOfTheMeek.class)); + cards.add(new SetCardInfo("Metamorphic Alteration", 60, Rarity.RARE, mage.cards.m.MetamorphicAlteration.class)); cards.add(new SetCardInfo("Meteor Golem", 241, Rarity.UNCOMMON, mage.cards.m.MeteorGolem.class)); cards.add(new SetCardInfo("Mighty Leap", 28, Rarity.COMMON, mage.cards.m.MightyLeap.class)); cards.add(new SetCardInfo("Militia Bugler", 29, Rarity.UNCOMMON, mage.cards.m.MilitiaBugler.class)); From 9f06046f2245deb089a68296239ccc36942fd255 Mon Sep 17 00:00:00 2001 From: igoudt Date: Wed, 4 Jul 2018 14:24:11 +0200 Subject: [PATCH 13/58] add isOwned and isControlled methods. remove some null-checks, remove some unnecessary casts --- .../src/main/java/mage/view/CardsView.java | 2 +- .../src/mage/player/ai/ComputerPlayer6.java | 2 +- .../mage/cards/a/AbandonedSarcophagus.java | 4 ++-- .../src/mage/cards/a/AbbotOfKeralKeep.java | 2 +- Mage.Sets/src/mage/cards/a/AcidicSoil.java | 2 +- Mage.Sets/src/mage/cards/a/AerialCaravan.java | 2 +- Mage.Sets/src/mage/cards/a/AetherCharge.java | 2 +- Mage.Sets/src/mage/cards/a/Aetherspouts.java | 2 +- .../src/mage/cards/a/AjanisLastStand.java | 2 +- Mage.Sets/src/mage/cards/a/AkoumFirebird.java | 2 +- Mage.Sets/src/mage/cards/a/AkoumHellkite.java | 2 +- Mage.Sets/src/mage/cards/a/AladdinsLamp.java | 2 +- .../src/mage/cards/a/AmbuscadeShaman.java | 2 +- Mage.Sets/src/mage/cards/a/AmuletOfVigor.java | 2 +- Mage.Sets/src/mage/cards/a/AngelicChorus.java | 2 +- .../mage/cards/a/AnimarSoulOfElements.java | 2 +- .../src/mage/cards/a/AnimationModule.java | 2 +- Mage.Sets/src/mage/cards/a/ApexOfPower.java | 2 +- .../src/mage/cards/a/ArcaneAdaptation.java | 4 ++-- .../src/mage/cards/a/ArchonOfRedemption.java | 2 +- .../src/mage/cards/a/AsLuckWouldHaveIt.java | 2 +- .../src/mage/cards/a/AsmiraHolyAvenger.java | 2 +- .../mage/cards/b/BattlefieldThaumaturge.java | 2 +- .../src/mage/cards/b/BidentOfThassa.java | 2 +- Mage.Sets/src/mage/cards/b/Bioshift.java | 4 ++-- Mage.Sets/src/mage/cards/b/BlazeCommando.java | 2 +- Mage.Sets/src/mage/cards/b/BlindingBeam.java | 4 ++-- .../src/mage/cards/b/BloodsporeThrinax.java | 2 +- .../src/mage/cards/b/BloodstoneGoblin.java | 2 +- Mage.Sets/src/mage/cards/b/Bossk.java | 2 +- .../src/mage/cards/b/BottledCloister.java | 2 +- .../src/mage/cards/b/BoundDetermined.java | 2 +- Mage.Sets/src/mage/cards/b/BowerPassage.java | 2 +- .../src/mage/cards/b/BramblewoodParagon.java | 2 +- .../src/mage/cards/b/BredForTheHunt.java | 2 +- .../src/mage/cards/b/BroodingSaurian.java | 2 +- .../src/mage/cards/b/BrutalHordechief.java | 2 +- .../src/mage/cards/c/CallerOfTheClaw.java | 2 +- .../src/mage/cards/c/CampaignOfVengeance.java | 2 +- .../src/mage/cards/c/CastThroughTime.java | 2 +- Mage.Sets/src/mage/cards/c/CatalystStone.java | 2 +- Mage.Sets/src/mage/cards/c/CelestialDawn.java | 4 ++-- .../src/mage/cards/c/ChampionOfLambholt.java | 2 +- .../src/mage/cards/c/ChanceEncounter.java | 2 +- .../src/mage/cards/c/ChandraPyromaster.java | 4 ++-- Mage.Sets/src/mage/cards/c/ChannelHarm.java | 6 +++--- .../src/mage/cards/c/ChickenALaKing.java | 2 +- .../src/mage/cards/c/ChitteringDoom.java | 2 +- Mage.Sets/src/mage/cards/c/CircleOfFlame.java | 2 +- .../src/mage/cards/c/CityOfTraitors.java | 2 +- .../src/mage/cards/c/CleansingMeditation.java | 2 +- Mage.Sets/src/mage/cards/c/CloudCover.java | 2 +- Mage.Sets/src/mage/cards/c/CloudKey.java | 2 +- Mage.Sets/src/mage/cards/c/CoastalPiracy.java | 2 +- Mage.Sets/src/mage/cards/c/Comeuppance.java | 10 +++++----- .../src/mage/cards/c/CommuneWithLava.java | 2 +- .../src/mage/cards/c/ConcussiveBolt.java | 2 +- Mage.Sets/src/mage/cards/c/Conspiracy.java | 6 +++--- .../src/mage/cards/c/CorpsejackMenace.java | 2 +- .../mage/cards/c/CouncilOfTheAbsolute.java | 2 +- Mage.Sets/src/mage/cards/c/Counterflux.java | 2 +- .../src/mage/cards/c/CrawlingSensation.java | 2 +- Mage.Sets/src/mage/cards/c/CurseOfEchoes.java | 2 +- .../mage/cards/c/CurseOfTheNightlyHunt.java | 2 +- Mage.Sets/src/mage/cards/c/CustodiLich.java | 2 +- .../mage/cards/d/DarigaazReincarnated.java | 2 +- .../src/mage/cards/d/DarkDwellerOracle.java | 2 +- .../src/mage/cards/d/DauntingDefender.java | 2 +- .../src/mage/cards/d/DaxosOfMeletis.java | 4 ++-- .../src/mage/cards/d/DearlyDeparted.java | 2 +- .../src/mage/cards/d/DeathsPresence.java | 2 +- .../src/mage/cards/d/DeepfathomSkulker.java | 2 +- Mage.Sets/src/mage/cards/d/DefenseGrid.java | 2 +- .../src/mage/cards/d/DefiantGreatmaw.java | 2 +- .../mage/cards/d/DereviEmpyrialTactician.java | 2 +- .../src/mage/cards/d/DesecratedTomb.java | 2 +- .../src/mage/cards/d/DireFleetDaredevil.java | 6 +++--- .../src/mage/cards/d/DiregrafCaptain.java | 2 +- .../src/mage/cards/d/DisplayOfDominance.java | 2 +- .../src/mage/cards/d/DivineDeflection.java | 4 ++-- .../src/mage/cards/d/DjeruWithEyesOpen.java | 2 +- .../src/mage/cards/d/DjinnIlluminatus.java | 4 ++-- .../src/mage/cards/d/DoorOfDestinies.java | 2 +- .../src/mage/cards/d/DoublingSeason.java | 2 +- .../src/mage/cards/d/DrafnasRestoration.java | 2 +- .../mage/cards/d/DragonlordsPrerogative.java | 2 +- Mage.Sets/src/mage/cards/d/DreamPillager.java | 2 +- Mage.Sets/src/mage/cards/d/DungeonGeists.java | 4 ++-- .../src/mage/cards/e/ElderwoodScion.java | 2 +- .../src/mage/cards/e/Electropotence.java | 2 +- Mage.Sets/src/mage/cards/e/ElkinBottle.java | 2 +- .../src/mage/cards/e/EmbermawHellion.java | 2 +- .../src/mage/cards/e/EncirclingFissure.java | 2 +- .../src/mage/cards/e/EnduringScalelord.java | 2 +- Mage.Sets/src/mage/cards/e/EnigmaSphinx.java | 2 +- .../src/mage/cards/e/EssenceOfTheWild.java | 2 +- .../src/mage/cards/e/EternalScourge.java | 2 +- .../src/mage/cards/e/EunuchsIntrigues.java | 2 +- Mage.Sets/src/mage/cards/f/FaithsReward.java | 2 +- .../src/mage/cards/f/FalkenrathGorger.java | 2 +- .../src/mage/cards/f/FavorableDestiny.java | 2 +- Mage.Sets/src/mage/cards/f/FellShepherd.java | 2 +- .../src/mage/cards/f/FiendslayerPaladin.java | 2 +- Mage.Sets/src/mage/cards/f/FireServant.java | 2 +- .../src/mage/cards/f/FlamebladeAngel.java | 2 +- .../src/mage/cards/f/FlamesOfRemembrance.java | 2 +- .../mage/cards/f/FlayerOfTheHatebound.java | 2 +- Mage.Sets/src/mage/cards/f/Fluctuator.java | 2 +- .../src/mage/cards/f/FoeRazerRegent.java | 2 +- .../src/mage/cards/f/ForbiddenCrypt.java | 2 +- .../src/mage/cards/f/FracturedLoyalty.java | 2 +- .../src/mage/cards/g/GarnaTheBloodflame.java | 2 +- .../src/mage/cards/g/GenerousPatron.java | 4 ++-- Mage.Sets/src/mage/cards/g/GideonJura.java | 2 +- .../src/mage/cards/g/GideonsIntervention.java | 2 +- .../mage/cards/g/GiselaBladeOfGoldnight.java | 2 +- .../src/mage/cards/g/GladehartCavalry.java | 2 +- Mage.Sets/src/mage/cards/g/Gleancrawler.java | 2 +- .../src/mage/cards/g/GoblinRockSled.java | 2 +- Mage.Sets/src/mage/cards/g/GoblinWarCry.java | 2 +- Mage.Sets/src/mage/cards/g/GoblinWelder.java | 2 +- .../src/mage/cards/g/GrandWarlordRadha.java | 4 ++-- .../src/mage/cards/g/GratuitousViolence.java | 2 +- Mage.Sets/src/mage/cards/g/GraveBetrayal.java | 2 +- Mage.Sets/src/mage/cards/g/GravePact.java | 2 +- Mage.Sets/src/mage/cards/g/Gravecrawler.java | 2 +- Mage.Sets/src/mage/cards/g/GreatbowDoyen.java | 2 +- .../src/mage/cards/g/GrenzoHavocRaiser.java | 6 +++--- Mage.Sets/src/mage/cards/g/GrinningTotem.java | 2 +- Mage.Sets/src/mage/cards/g/GroundPounder.java | 2 +- .../src/mage/cards/g/GruulRagebeast.java | 2 +- .../src/mage/cards/g/GuardianOfTazeem.java | 2 +- Mage.Sets/src/mage/cards/g/Guile.java | 2 +- Mage.Sets/src/mage/cards/g/GutterGrime.java | 2 +- .../mage/cards/h/HaakonStromgaldScourge.java | 2 +- .../mage/cards/h/HallarTheFirefletcher.java | 2 +- .../src/mage/cards/h/HardenedBerserker.java | 2 +- .../src/mage/cards/h/HardenedScales.java | 2 +- Mage.Sets/src/mage/cards/h/HarmsWay.java | 2 +- Mage.Sets/src/mage/cards/h/HavengulLich.java | 2 +- .../src/mage/cards/h/HedronFieldPurists.java | 2 +- Mage.Sets/src/mage/cards/h/Hellrider.java | 2 +- Mage.Sets/src/mage/cards/h/HeraldOfWar.java | 2 +- Mage.Sets/src/mage/cards/h/HomewardPath.java | 2 +- Mage.Sets/src/mage/cards/h/Hostility.java | 2 +- Mage.Sets/src/mage/cards/i/IcefallRegent.java | 2 +- .../mage/cards/i/IkraShidiqiTheUsurper.java | 2 +- .../src/mage/cards/i/IllusionistsGambit.java | 2 +- Mage.Sets/src/mage/cards/i/Immerwolf.java | 2 +- .../src/mage/cards/i/IncreasingVengeance.java | 4 ++-- .../src/mage/cards/i/InfectiousCurse.java | 2 +- .../src/mage/cards/i/InfiniteReflection.java | 2 +- Mage.Sets/src/mage/cards/i/IreShaman.java | 2 +- .../src/mage/cards/i/IslandSanctuary.java | 2 +- .../mage/cards/j/JaceArchitectOfThought.java | 2 +- .../src/mage/cards/j/JaceCunningCastaway.java | 2 +- Mage.Sets/src/mage/cards/j/JarOfEyeballs.java | 2 +- Mage.Sets/src/mage/cards/j/Jokulmorder.java | 2 +- Mage.Sets/src/mage/cards/j/Juxtapose.java | 2 +- Mage.Sets/src/mage/cards/k/KarnLiberated.java | 2 +- .../src/mage/cards/k/KarnScionOfUrza.java | 2 +- .../src/mage/cards/k/KaronaFalseGod.java | 4 ++-- .../src/mage/cards/k/KarplusanMinotaur.java | 4 ++-- .../mage/cards/k/KazarovSengirPureblood.java | 2 +- .../src/mage/cards/k/KeeperOfTheDead.java | 4 ++-- .../src/mage/cards/k/KnacksawClique.java | 2 +- .../mage/cards/k/KnightsOfTheBlackRose.java | 2 +- .../src/mage/cards/k/KopalaWardenOfWaves.java | 4 ++-- .../src/mage/cards/k/KrarksOtherThumb.java | 2 +- Mage.Sets/src/mage/cards/k/KrarksThumb.java | 2 +- Mage.Sets/src/mage/cards/l/Larceny.java | 2 +- .../src/mage/cards/l/LashknifeBarrier.java | 2 +- .../mage/cards/l/LeovoldEmissaryOfTrest.java | 2 +- .../src/mage/cards/l/LightOfSanction.java | 6 +++--- .../mage/cards/l/LilianaUntouchedByDeath.java | 2 +- .../src/mage/cards/l/LilianasContract.java | 2 +- Mage.Sets/src/mage/cards/l/LoamingShaman.java | 4 ++-- .../src/mage/cards/l/LocketOfYesterdays.java | 2 +- .../src/mage/cards/l/LuminatePrimordial.java | 2 +- .../src/mage/cards/m/MaelstromNexus.java | 2 +- .../src/mage/cards/m/MagusOfTheWill.java | 4 ++-- .../src/mage/cards/m/MaliciousAffliction.java | 2 +- Mage.Sets/src/mage/cards/m/Manaplasm.java | 2 +- Mage.Sets/src/mage/cards/m/MangarasTome.java | 2 +- .../src/mage/cards/m/MarangRiverProwler.java | 2 +- .../src/mage/cards/m/MarchOfTheDroids.java | 2 +- .../mage/cards/m/MarchesaTheBlackRose.java | 2 +- Mage.Sets/src/mage/cards/m/MartyrsBond.java | 2 +- .../src/mage/cards/m/MasakoTheHumorless.java | 2 +- .../src/mage/cards/m/MasterBiomancer.java | 2 +- .../mage/cards/m/MavrenFeinDuskApostle.java | 2 +- .../src/mage/cards/m/MelekIzzetParagon.java | 2 +- .../src/mage/cards/m/MeliraSylvokOutcast.java | 2 +- Mage.Sets/src/mage/cards/m/MemoryCrystal.java | 2 +- Mage.Sets/src/mage/cards/m/MetallicMimic.java | 2 +- Mage.Sets/src/mage/cards/m/MidnightOil.java | 6 ++---- .../src/mage/cards/m/MightMakesRight.java | 2 +- Mage.Sets/src/mage/cards/m/Mindswipe.java | 2 +- Mage.Sets/src/mage/cards/m/Mirari.java | 2 +- Mage.Sets/src/mage/cards/m/MirrorMatch.java | 2 +- Mage.Sets/src/mage/cards/m/MirrorOfFate.java | 2 +- .../src/mage/cards/m/MirrorwingDragon.java | 2 +- .../src/mage/cards/m/MisthollowGriffin.java | 2 +- .../src/mage/cards/m/MizzixOfTheIzmagnus.java | 2 +- .../src/mage/cards/m/MonasterySiege.java | 2 +- .../mage/cards/m/MuldrothaTheGravetide.java | 4 ++-- .../src/mage/cards/m/MycoidShepherd.java | 2 +- .../mage/cards/n/NabanDeanOfIteration.java | 2 +- Mage.Sets/src/mage/cards/n/NaturesWill.java | 2 +- .../mage/cards/n/NecromancersMagemark.java | 2 +- .../src/mage/cards/n/NecropolisRegent.java | 2 +- Mage.Sets/src/mage/cards/n/Necropotence.java | 2 +- Mage.Sets/src/mage/cards/n/NestOfScarabs.java | 2 +- Mage.Sets/src/mage/cards/n/NetherTraitor.java | 2 +- .../src/mage/cards/n/NimDeathmantle.java | 2 +- .../mage/cards/n/NivixAerieOfTheFiremind.java | 2 +- .../src/mage/cards/n/NoRestForTheWicked.java | 2 +- Mage.Sets/src/mage/cards/n/NoblePurpose.java | 2 +- .../src/mage/cards/n/NotOfThisWorld.java | 4 ++-- Mage.Sets/src/mage/cards/o/OathOfGideon.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfNissa.java | 2 +- .../src/mage/cards/o/OathswornVampire.java | 2 +- .../src/mage/cards/o/OonasBlackguard.java | 4 ++-- Mage.Sets/src/mage/cards/o/OranRiefHydra.java | 2 +- .../src/mage/cards/o/OrnateKanzashi.java | 2 +- Mage.Sets/src/mage/cards/o/OrzhovCharm.java | 4 ++-- Mage.Sets/src/mage/cards/o/OutpostSiege.java | 2 +- Mage.Sets/src/mage/cards/p/PalisadeGiant.java | 2 +- Mage.Sets/src/mage/cards/p/Panharmonicon.java | 2 +- .../src/mage/cards/p/ParallelThoughts.java | 2 +- Mage.Sets/src/mage/cards/p/PathOfMettle.java | 2 +- Mage.Sets/src/mage/cards/p/PawnOfUlamog.java | 2 +- .../src/mage/cards/p/PedanticLearning.java | 2 +- .../src/mage/cards/p/PerimeterCaptain.java | 2 +- .../src/mage/cards/p/PrecipiceOfMortis.java | 2 +- Mage.Sets/src/mage/cards/p/PriceOfGlory.java | 4 ++-- Mage.Sets/src/mage/cards/p/PrizedAmalgam.java | 2 +- Mage.Sets/src/mage/cards/p/ProperBurial.java | 2 +- .../mage/cards/p/PropheticFlamespeaker.java | 2 +- .../src/mage/cards/p/PureIntentions.java | 2 +- Mage.Sets/src/mage/cards/p/Purgatory.java | 2 +- .../src/mage/cards/p/PyromancerAscension.java | 4 ++-- .../src/mage/cards/p/PyromancersGauntlet.java | 2 +- .../src/mage/cards/p/PyromancersSwath.java | 2 +- .../src/mage/cards/q/QasaliAmbusher.java | 2 +- .../src/mage/cards/q/QasaliSlingers.java | 2 +- .../src/mage/cards/q/QuestForPureFlame.java | 4 ++-- Mage.Sets/src/mage/cards/q/Quicken.java | 2 +- Mage.Sets/src/mage/cards/r/RagingRiver.java | 4 ++-- Mage.Sets/src/mage/cards/r/RaidersSpoils.java | 2 +- Mage.Sets/src/mage/cards/r/RainOfGore.java | 2 +- .../src/mage/cards/r/RakdosLordOfRiots.java | 2 +- Mage.Sets/src/mage/cards/r/RakishHeir.java | 2 +- .../src/mage/cards/r/RakshasaVizier.java | 2 +- .../src/mage/cards/r/RavagerOfTheFells.java | 4 ++-- .../mage/cards/r/RayneAcademyChancellor.java | 2 +- .../src/mage/cards/r/RealitySmasher.java | 2 +- .../src/mage/cards/r/RefractionTrap.java | 2 +- Mage.Sets/src/mage/cards/r/RegalBehemoth.java | 2 +- .../src/mage/cards/r/RemoveEnchantments.java | 2 +- .../mage/cards/r/RenegadeDoppelganger.java | 2 +- Mage.Sets/src/mage/cards/r/Reparations.java | 2 +- Mage.Sets/src/mage/cards/r/Retribution.java | 2 +- .../mage/cards/r/ReyhanLastOfTheAbzan.java | 2 +- .../src/mage/cards/r/RhysTheRedeemed.java | 2 +- Mage.Sets/src/mage/cards/r/RingOfMaruf.java | 2 +- .../src/mage/cards/r/RisenExecutioner.java | 2 +- Mage.Sets/src/mage/cards/r/RoninWarclub.java | 2 +- Mage.Sets/src/mage/cards/r/RootSliver.java | 2 +- Mage.Sets/src/mage/cards/r/RowanKenrith.java | 2 +- .../src/mage/cards/r/RumblingAftershocks.java | 2 +- Mage.Sets/src/mage/cards/s/SacredGround.java | 2 +- .../src/mage/cards/s/SaffiEriksdotter.java | 2 +- Mage.Sets/src/mage/cards/s/SageOfFables.java | 2 +- .../mage/cards/s/SakikoMotherOfSummer.java | 2 +- .../src/mage/cards/s/SatyrFiredancer.java | 2 +- Mage.Sets/src/mage/cards/s/SavageStomp.java | 2 +- .../src/mage/cards/s/SavageSummoning.java | 4 ++-- Mage.Sets/src/mage/cards/s/SavingGrace.java | 2 +- .../src/mage/cards/s/ScourgeOfNelToth.java | 2 +- Mage.Sets/src/mage/cards/s/ScoutsWarning.java | 2 +- Mage.Sets/src/mage/cards/s/ScrapTrawler.java | 2 +- Mage.Sets/src/mage/cards/s/Scrapheap.java | 2 +- .../src/mage/cards/s/SealOfTheGuildpact.java | 2 +- Mage.Sets/src/mage/cards/s/SearingBlaze.java | 4 ++-- .../src/mage/cards/s/SelflessSquire.java | 2 +- .../src/mage/cards/s/SemblanceAnvil.java | 2 +- Mage.Sets/src/mage/cards/s/SenTriplets.java | 2 +- .../src/mage/cards/s/SenatorLottDod.java | 2 +- Mage.Sets/src/mage/cards/s/SerumPowder.java | 2 +- .../src/mage/cards/s/SeshiroTheAnointed.java | 2 +- .../src/mage/cards/s/SettleTheWreckage.java | 2 +- .../src/mage/cards/s/ShadowOfTheGrave.java | 2 +- .../mage/cards/s/ShamanOfForgottenWays.java | 2 +- .../src/mage/cards/s/ShannaSisaysLegacy.java | 2 +- .../src/mage/cards/s/ShapersSanctuary.java | 2 +- Mage.Sets/src/mage/cards/s/ShiningShoal.java | 2 +- .../src/mage/cards/s/ShipbreakerKraken.java | 2 +- .../mage/cards/s/ShireiShizosCaretaker.java | 2 +- .../src/mage/cards/s/SidisiBroodTyrant.java | 2 +- Mage.Sets/src/mage/cards/s/SigilCaptain.java | 2 +- .../mage/cards/s/SilasRennSeekerAdept.java | 2 +- .../src/mage/cards/s/SilverfurPartisan.java | 2 +- .../src/mage/cards/s/SimicGuildmage.java | 4 ++-- .../src/mage/cards/s/SirenStormtamer.java | 4 ++-- .../src/mage/cards/s/SokenzanRenegade.java | 2 +- .../src/mage/cards/s/SosukeSonOfSeshiro.java | 2 +- .../src/mage/cards/s/SoulOfShandalar.java | 4 ++-- .../src/mage/cards/s/SphinxAmbassador.java | 2 +- .../src/mage/cards/s/SqueeTheImmortal.java | 2 +- .../mage/cards/s/SquirrelPoweredScheme.java | 2 +- Mage.Sets/src/mage/cards/s/SteelSquirrel.java | 2 +- .../src/mage/cards/s/StensiaMasquerade.java | 2 +- .../src/mage/cards/s/StolenStrategy.java | 4 ++-- .../src/mage/cards/s/StromkirkOccultist.java | 2 +- .../src/mage/cards/s/SunbirdsInvocation.java | 2 +- .../src/mage/cards/t/TajuruPreserver.java | 2 +- Mage.Sets/src/mage/cards/t/TalusPaladin.java | 2 +- Mage.Sets/src/mage/cards/t/Tamanoa.java | 2 +- Mage.Sets/src/mage/cards/t/TangleKelp.java | 2 +- Mage.Sets/src/mage/cards/t/Taunt.java | 2 +- .../src/mage/cards/t/TeferiMageOfZhalfir.java | 4 ++-- .../src/mage/cards/t/TelimTorsEdict.java | 2 +- .../src/mage/cards/t/TempleAltisaur.java | 2 +- .../src/mage/cards/t/ThadaAdelAcquisitor.java | 2 +- Mage.Sets/src/mage/cards/t/TheBigIdea.java | 2 +- Mage.Sets/src/mage/cards/t/TheFallen.java | 2 +- .../src/mage/cards/t/TheFlameOfKeld.java | 2 +- .../src/mage/cards/t/TheGitrogMonster.java | 2 +- Mage.Sets/src/mage/cards/t/TheUrDragon.java | 2 +- .../src/mage/cards/t/ThopterSpyNetwork.java | 2 +- .../src/mage/cards/t/ThousandYearElixir.java | 2 +- Mage.Sets/src/mage/cards/t/ThreeWishes.java | 2 +- .../src/mage/cards/t/TianaShipsCaretaker.java | 2 +- .../src/mage/cards/t/TidebinderMage.java | 2 +- Mage.Sets/src/mage/cards/t/TimeOfIce.java | 2 +- Mage.Sets/src/mage/cards/t/TimeVault.java | 2 +- .../src/mage/cards/t/TreacherousTerrain.java | 2 +- .../mage/cards/t/TrostaniSelesnyasVoice.java | 2 +- .../src/mage/cards/t/TrueNameNemesis.java | 8 ++++---- Mage.Sets/src/mage/cards/t/TsabosDecree.java | 2 +- .../src/mage/cards/t/TuktukScrapper.java | 2 +- Mage.Sets/src/mage/cards/t/Turnabout.java | 4 ++-- .../src/mage/cards/t/TwilightShepherd.java | 2 +- .../src/mage/cards/t/TwistAllegiance.java | 4 ++-- .../mage/cards/u/UnconventionalTactics.java | 2 +- .../src/mage/cards/u/UndeadAlchemist.java | 2 +- .../cards/u/UneshCriosphinxSovereign.java | 2 +- .../cards/v/ValakutTheMoltenPinnacle.java | 2 +- .../src/mage/cards/v/ValeronWardens.java | 2 +- .../mage/cards/v/VancesBlastingCannons.java | 2 +- .../src/mage/cards/v/VanquishersBanner.java | 2 +- .../src/mage/cards/v/VeilstoneAmulet.java | 2 +- .../src/mage/cards/v/VengefulPharaoh.java | 2 +- .../src/mage/cards/v/VerdantSunsAvatar.java | 2 +- .../src/mage/cards/v/VigilForTheLost.java | 2 +- .../src/mage/cards/v/VizierOfRemedies.java | 2 +- .../mage/cards/v/VizierOfTheMenagerie.java | 2 +- Mage.Sets/src/mage/cards/w/WakeThrasher.java | 2 +- Mage.Sets/src/mage/cards/w/Warbringer.java | 2 +- Mage.Sets/src/mage/cards/w/WarstormSurge.java | 2 +- Mage.Sets/src/mage/cards/w/WebOfInertia.java | 2 +- .../src/mage/cards/w/WharfInfiltrator.java | 2 +- .../src/mage/cards/w/WheelOfSunAndMoon.java | 2 +- Mage.Sets/src/mage/cards/w/WildDefiance.java | 2 +- Mage.Sets/src/mage/cards/w/Willbreaker.java | 2 +- .../src/mage/cards/w/WillingTestSubject.java | 2 +- .../src/mage/cards/w/WindingConstrictor.java | 2 +- Mage.Sets/src/mage/cards/w/WordOfUndoing.java | 2 +- Mage.Sets/src/mage/cards/w/WordsOfWar.java | 2 +- Mage.Sets/src/mage/cards/w/WordsOfWaste.java | 2 +- .../src/mage/cards/w/WordsOfWilding.java | 2 +- Mage.Sets/src/mage/cards/w/WordsOfWind.java | 2 +- .../src/mage/cards/w/WordsOfWorship.java | 2 +- .../src/mage/cards/w/WorldheartPhoenix.java | 2 +- Mage.Sets/src/mage/cards/w/Worship.java | 2 +- .../src/mage/cards/w/WortTheRaidmother.java | 2 +- .../src/mage/cards/y/YawgmothsAgenda.java | 2 +- Mage.Sets/src/mage/cards/y/YawgmothsWill.java | 2 +- .../mage/cards/y/YidrisMaelstromWielder.java | 2 +- .../src/mage/cards/z/ZadaHedronGrinder.java | 2 +- .../src/mage/cards/z/ZameckGuildmage.java | 2 +- .../base/impl/CardTestPlayerAPIImpl.java | 4 ++-- .../mage/abilities/ActivatedAbilityImpl.java | 6 +++--- .../java/mage/abilities/SpecialActions.java | 2 +- .../java/mage/abilities/SpellAbility.java | 2 +- ...AllyEntersBattlefieldTriggeredAbility.java | 2 +- .../AttackedByCreatureTriggeredAbility.java | 2 +- .../common/AttacksAllTriggeredAbility.java | 2 +- .../BecomesMonstrousTriggeredAbility.java | 2 +- .../BeginningOfDrawTriggeredAbility.java | 2 +- .../BeginningOfEndStepTriggeredAbility.java | 2 +- .../BeginningOfUpkeepTriggeredAbility.java | 2 +- ...ealCombatDamagePlayerTriggeredAbility.java | 2 +- ...tureEntersBattlefieldTriggeredAbility.java | 2 +- ...mageToAPlayerAttachedTriggeredAbility.java | 2 +- ...BattlefieldControlledTriggeredAbility.java | 2 +- ...ertCreatureControllerTriggeredAbility.java | 2 +- .../abilities/common/LandfallAbility.java | 2 +- ...aveFromBattlefieldAllTriggeredAbility.java | 2 +- ...llCounteredControllerTriggeredAbility.java | 2 +- ...ginOfMainPhaseDelayedTriggeredAbility.java | 2 +- ...nOfNextEndStepDelayedTriggeredAbility.java | 2 +- .../common/CommanderInPlayCondition.java | 2 +- .../ControllerAttackedThisTurnCondition.java | 2 +- .../condition/common/MeldCondition.java | 4 ++-- .../MonarchIsSourceControllerCondition.java | 2 +- ...anentsYouOwnThatOpponentsControlCount.java | 2 +- .../abilities/effects/ContinuousEffects.java | 2 +- .../effects/GainAbilitySpellsEffect.java | 4 ++-- .../CantBeCounteredControlledEffect.java | 2 +- .../CreatureExploresTriggeredAbility.java | 2 +- ...tUntapInControllersUntapStepAllEffect.java | 2 +- ...InControllersUntapStepEnchantedEffect.java | 2 +- ...tapInControllersUntapStepSourceEffect.java | 2 +- ...tUntapInPlayersNextUntapStepAllEffect.java | 2 +- .../common/PutOnLibraryTargetEffect.java | 4 ++-- .../common/ReturnToHandTargetEffect.java | 4 ++-- .../effects/common/SacrificeSourceEffect.java | 2 +- .../common/SkipUntapOptionalSourceEffect.java | 2 +- .../abilities/effects/common/WishEffect.java | 2 +- .../CantAttackControllerAttachedEffect.java | 2 +- .../CantAttackYouOrPlaneswalkerAllEffect.java | 2 +- .../CantAttackYouUnlessPayManaAllEffect.java | 4 ++-- .../effects/common/combat/GoadAllEffect.java | 2 +- ...itiesAnyTimeYouCouldCastInstantEffect.java | 2 +- .../CastAsThoughItHadFlashAllEffect.java | 2 +- .../ExchangeControlTargetEffect.java | 2 +- .../GainAbilityControlledSpellsEffect.java | 2 +- .../continuous/GainControlTargetEffect.java | 2 +- .../continuous/PlayTheTopCardEffect.java | 2 +- ...DuringEachOtherPlayersUntapStepEffect.java | 2 +- ...DuringEachOtherPlayersUntapStepEffect.java | 2 +- ...bilitiesCostReductionControllerEffect.java | 2 +- ...pellsCostIncreasementControllerEffect.java | 2 +- .../cost/SpellsCostReductionAllEffect.java | 4 ++-- .../SpellsCostReductionControllerEffect.java | 2 +- .../abilities/keyword/AuraSwapAbility.java | 2 +- .../mage/abilities/keyword/EvolveAbility.java | 2 +- .../abilities/keyword/HideawayAbility.java | 2 +- .../abilities/keyword/OfferingAbility.java | 2 +- .../abilities/keyword/RecoverAbility.java | 2 +- .../mage/abilities/keyword/RepairAbility.java | 2 +- .../abilities/keyword/SoulbondAbility.java | 4 ++-- Mage/src/main/java/mage/cards/Card.java | 4 ++++ .../predicate/other/OwnerPredicate.java | 6 +++--- ...ttachedToControlledPermanentPredicate.java | 2 +- .../permanent/ControllerPredicate.java | 8 ++++---- .../DefendingPlayerControlsPredicate.java | 2 +- .../DefendingPlayerOwnsCardPredicate.java | 2 +- .../src/main/java/mage/game/Controllable.java | 4 ++++ Mage/src/main/java/mage/game/GameImpl.java | 17 ++++++++-------- .../main/java/mage/game/combat/Combat.java | 6 +++--- .../command/emblems/AjaniSteadfastEmblem.java | 2 +- .../emblems/DarettiScrapSavantEmblem.java | 2 +- .../planes/TrailOfTheMageRingsPlane.java | 2 +- .../java/mage/game/permanent/Battlefield.java | 12 +++++------ Mage/src/main/java/mage/game/stack/Spell.java | 4 ++-- Mage/src/main/java/mage/players/Library.java | 4 ++-- .../main/java/mage/players/PlayerImpl.java | 20 +++++++++---------- .../common/TargetCardInASingleGraveyard.java | 2 +- .../TargetCardInOpponentsGraveyard.java | 2 +- ...TargetCreaturePermanentSameController.java | 2 +- .../target/common/TargetTriggeredAbility.java | 6 +++--- 464 files changed, 567 insertions(+), 562 deletions(-) diff --git a/Mage.Common/src/main/java/mage/view/CardsView.java b/Mage.Common/src/main/java/mage/view/CardsView.java index ce01784dd0..2a1264f0ce 100644 --- a/Mage.Common/src/main/java/mage/view/CardsView.java +++ b/Mage.Common/src/main/java/mage/view/CardsView.java @@ -73,7 +73,7 @@ public class CardsView extends LinkedHashMap { case BATTLEFIELD: sourceObject = game.getPermanent(ability.getSourceId()); if (sourceObject == null) { - sourceObject = (Permanent) game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD); + sourceObject = game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD); } isPermanent = true; break; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java index 14ffb4b12e..f38270bec6 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java @@ -136,7 +136,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { sb.setLength(0); sb.append("-> Permanents: ["); for (Permanent permanent : game.getBattlefield().getAllPermanents()) { - if (permanent.getOwnerId().equals(player.getId())) { + if (permanent.isOwnedBy(player.getId())) { sb.append(permanent.getName()); if (permanent.isTapped()) { sb.append("(tapped)"); diff --git a/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java b/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java index a73a5b031f..5d44aa8dd6 100644 --- a/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java +++ b/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java @@ -155,7 +155,7 @@ class AbandonedSarcophagusReplacementEffect extends ReplacementEffectImpl { Card card = game.getCard(event.getTargetId()); if (card != null && watcher != null - && card.getOwnerId().equals(controller.getId())) { + && card.isOwnedBy(controller.getId())) { for (Ability ability : card.getAbilities()) { if (ability instanceof CyclingAbility) { cardHasCycling = true; @@ -199,7 +199,7 @@ class AbandonedSarcophagusWatcher extends Watcher { Player controller = game.getPlayer(event.getPlayerId()); if (card != null && controller != null - && card.getOwnerId().equals(controller.getId())) { + && card.isOwnedBy(controller.getId())) { Cards c = getCardsCycledThisTurn(event.getPlayerId()); c.add(card); cycledCardsThisTurn.put(event.getPlayerId(), c); diff --git a/Mage.Sets/src/mage/cards/a/AbbotOfKeralKeep.java b/Mage.Sets/src/mage/cards/a/AbbotOfKeralKeep.java index f7ae5aec0a..c8a371940d 100644 --- a/Mage.Sets/src/mage/cards/a/AbbotOfKeralKeep.java +++ b/Mage.Sets/src/mage/cards/a/AbbotOfKeralKeep.java @@ -108,7 +108,7 @@ class AbbotOfKeralKeepCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/a/AcidicSoil.java b/Mage.Sets/src/mage/cards/a/AcidicSoil.java index a18d163624..cbb5e62189 100644 --- a/Mage.Sets/src/mage/cards/a/AcidicSoil.java +++ b/Mage.Sets/src/mage/cards/a/AcidicSoil.java @@ -57,7 +57,7 @@ class AcidicSoilEffect extends OneShotEffect { if (player != null) { int amount = 0; for (Permanent permanent : permanents) { - if (permanent.getControllerId().equals(playerId)) { + if (permanent.isControlledBy(playerId)) { amount++; } } diff --git a/Mage.Sets/src/mage/cards/a/AerialCaravan.java b/Mage.Sets/src/mage/cards/a/AerialCaravan.java index 8dadcf7bb7..933595fcd9 100644 --- a/Mage.Sets/src/mage/cards/a/AerialCaravan.java +++ b/Mage.Sets/src/mage/cards/a/AerialCaravan.java @@ -114,7 +114,7 @@ class AerialCaravanCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/a/AetherCharge.java b/Mage.Sets/src/mage/cards/a/AetherCharge.java index e2ce3a6dd3..6563c83d14 100644 --- a/Mage.Sets/src/mage/cards/a/AetherCharge.java +++ b/Mage.Sets/src/mage/cards/a/AetherCharge.java @@ -70,7 +70,7 @@ class AetherChargeTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.isCreature() && permanent.hasSubtype(SubType.BEAST, game) - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { Effect effect = this.getEffects().get(0); effect.setValue("damageSource", event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/a/Aetherspouts.java b/Mage.Sets/src/mage/cards/a/Aetherspouts.java index d7988ad0f3..4c565abaad 100644 --- a/Mage.Sets/src/mage/cards/a/Aetherspouts.java +++ b/Mage.Sets/src/mage/cards/a/Aetherspouts.java @@ -81,7 +81,7 @@ class AetherspoutsEffect extends OneShotEffect { List permanentsToTop = new ArrayList<>(); List permanentsToBottom = new ArrayList<>(); for (Permanent permanent:game.getState().getBattlefield().getActivePermanents(new FilterAttackingCreature(), player.getId(), source.getSourceId(), game)) { - if (permanent.getOwnerId().equals(player.getId())) { + if (permanent.isOwnedBy(player.getId())) { if (player.chooseUse(outcome, "Put " + permanent.getLogName() + " to the top? (else it goes to bottom)", source, game)) { permanentsToTop.add(permanent); game.informPlayers(permanent.getLogName() + " goes to the top of " + player.getLogName() + "'s library"); diff --git a/Mage.Sets/src/mage/cards/a/AjanisLastStand.java b/Mage.Sets/src/mage/cards/a/AjanisLastStand.java index a19f94d94c..10e72b763e 100644 --- a/Mage.Sets/src/mage/cards/a/AjanisLastStand.java +++ b/Mage.Sets/src/mage/cards/a/AjanisLastStand.java @@ -85,7 +85,7 @@ class AjanisLastStandTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - if (zEvent.getTarget().getControllerId().equals(controllerId) + if (zEvent.getTarget().isControlledBy(controllerId) && (zEvent.getTarget().isCreature() || zEvent.getTarget().isPlaneswalker())) { return true; diff --git a/Mage.Sets/src/mage/cards/a/AkoumFirebird.java b/Mage.Sets/src/mage/cards/a/AkoumFirebird.java index 53b699b528..9a7d5c7f43 100644 --- a/Mage.Sets/src/mage/cards/a/AkoumFirebird.java +++ b/Mage.Sets/src/mage/cards/a/AkoumFirebird.java @@ -79,7 +79,7 @@ class AkoumFirebirdLandfallAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.controllerId); + return permanent != null && permanent.isLand() && permanent.isControlledBy(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/cards/a/AkoumHellkite.java b/Mage.Sets/src/mage/cards/a/AkoumHellkite.java index 86698bc1f9..24a13cc142 100644 --- a/Mage.Sets/src/mage/cards/a/AkoumHellkite.java +++ b/Mage.Sets/src/mage/cards/a/AkoumHellkite.java @@ -82,7 +82,7 @@ class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isLand() - && permanent.getControllerId().equals(getControllerId())) { + && permanent.isControlledBy(getControllerId())) { Permanent sourcePermanent = game.getPermanent(getSourceId()); if (sourcePermanent != null) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/a/AladdinsLamp.java b/Mage.Sets/src/mage/cards/a/AladdinsLamp.java index 040d1cf38b..6db19c46d5 100644 --- a/Mage.Sets/src/mage/cards/a/AladdinsLamp.java +++ b/Mage.Sets/src/mage/cards/a/AladdinsLamp.java @@ -87,6 +87,6 @@ class AladdinsLampEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/a/AmbuscadeShaman.java b/Mage.Sets/src/mage/cards/a/AmbuscadeShaman.java index fc57daa583..2c8e04683a 100644 --- a/Mage.Sets/src/mage/cards/a/AmbuscadeShaman.java +++ b/Mage.Sets/src/mage/cards/a/AmbuscadeShaman.java @@ -75,7 +75,7 @@ class AmbuscadeShamanTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { UUID targetId = event.getTargetId(); Permanent permanent = game.getPermanent(targetId); - if (permanent.getControllerId().equals(this.controllerId) + if (permanent.isControlledBy(this.controllerId) && permanent.isCreature()) { this.getEffects().setTargetPointer(new FixedTarget(permanent, game)); return true; diff --git a/Mage.Sets/src/mage/cards/a/AmuletOfVigor.java b/Mage.Sets/src/mage/cards/a/AmuletOfVigor.java index 046b2b44c5..0915957d35 100644 --- a/Mage.Sets/src/mage/cards/a/AmuletOfVigor.java +++ b/Mage.Sets/src/mage/cards/a/AmuletOfVigor.java @@ -58,7 +58,7 @@ class AmuletOfVigorTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.isTapped() && p.getControllerId().equals(this.controllerId)) { + if (p != null && p.isTapped() && p.isControlledBy(this.controllerId)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/a/AngelicChorus.java b/Mage.Sets/src/mage/cards/a/AngelicChorus.java index 077345b9f2..7bf3726106 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicChorus.java +++ b/Mage.Sets/src/mage/cards/a/AngelicChorus.java @@ -58,7 +58,7 @@ class AngelicChorusTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.isCreature() - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { this.getEffects().get(0).setValue("lifeSource", event.getTargetId()); return true; } diff --git a/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java b/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java index 986e8d695d..8938197306 100644 --- a/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java +++ b/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java @@ -84,7 +84,7 @@ class AnimarCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { return spell.isCreature(); diff --git a/Mage.Sets/src/mage/cards/a/AnimationModule.java b/Mage.Sets/src/mage/cards/a/AnimationModule.java index 877681d2e0..2263af2ca3 100644 --- a/Mage.Sets/src/mage/cards/a/AnimationModule.java +++ b/Mage.Sets/src/mage/cards/a/AnimationModule.java @@ -84,7 +84,7 @@ class AnimationModuleTriggeredAbility extends TriggeredAbilityImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - return permanent != null && permanent.getControllerId().equals(this.getControllerId()); + return permanent != null && permanent.isControlledBy(this.getControllerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/a/ApexOfPower.java b/Mage.Sets/src/mage/cards/a/ApexOfPower.java index 81c7222911..7cedb5425b 100644 --- a/Mage.Sets/src/mage/cards/a/ApexOfPower.java +++ b/Mage.Sets/src/mage/cards/a/ApexOfPower.java @@ -110,7 +110,7 @@ class ApexOfPowerCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java index 12a962afb6..0a0d05fd24 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java @@ -89,7 +89,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.hasSubtype(subType, game)) { + if (card.isOwnedBy(controller.getId()) && card.isCreature() && !card.hasSubtype(subType, game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(subType); } } @@ -106,7 +106,7 @@ class ConspyEffect extends ContinuousEffectImpl { for (Iterator iterator = game.getStack().iterator(); iterator.hasNext();) { StackObject stackObject = iterator.next(); if (stackObject instanceof Spell - && stackObject.getControllerId().equals(source.getControllerId()) + && stackObject.isControlledBy(source.getControllerId()) && stackObject.isCreature() && !stackObject.hasSubtype(subType, game)) { Card card = ((Spell) stackObject).getCard(); diff --git a/Mage.Sets/src/mage/cards/a/ArchonOfRedemption.java b/Mage.Sets/src/mage/cards/a/ArchonOfRedemption.java index 1386b5e8b2..4107f3f990 100644 --- a/Mage.Sets/src/mage/cards/a/ArchonOfRedemption.java +++ b/Mage.Sets/src/mage/cards/a/ArchonOfRedemption.java @@ -66,7 +66,7 @@ class ArchonOfRedemptionTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getControllerId().equals(getControllerId()) + if (permanent.isControlledBy(getControllerId()) && permanent.isCreature() && (permanent.getId().equals(getSourceId()) || (permanent.getAbilities().contains(FlyingAbility.getInstance())))) { diff --git a/Mage.Sets/src/mage/cards/a/AsLuckWouldHaveIt.java b/Mage.Sets/src/mage/cards/a/AsLuckWouldHaveIt.java index 83adf2f33f..d24d1a4de0 100644 --- a/Mage.Sets/src/mage/cards/a/AsLuckWouldHaveIt.java +++ b/Mage.Sets/src/mage/cards/a/AsLuckWouldHaveIt.java @@ -68,7 +68,7 @@ class AsLuckWouldHaveItTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) { + if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) { for (Effect effect : this.getEffects()) { effect.setValue("rolled", event.getAmount()); } diff --git a/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java b/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java index 8f8ac3242b..60cb57bd4f 100644 --- a/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java +++ b/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java @@ -78,7 +78,7 @@ class AsmiraHolyAvengerWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (card != null && ((Card) card).getOwnerId().equals(this.controllerId) && card.isCreature()) { + if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature()) { creaturesCount++; } } diff --git a/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java b/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java index a927300c89..635027c5ad 100644 --- a/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java +++ b/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java @@ -80,7 +80,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if ((abilityToModify instanceof SpellAbility) - && abilityToModify.getControllerId().equals(source.getControllerId())) { + && abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); return spell != null && StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY.match(spell, game); } diff --git a/Mage.Sets/src/mage/cards/b/BidentOfThassa.java b/Mage.Sets/src/mage/cards/b/BidentOfThassa.java index c6b52126a0..6161b61011 100644 --- a/Mage.Sets/src/mage/cards/b/BidentOfThassa.java +++ b/Mage.Sets/src/mage/cards/b/BidentOfThassa.java @@ -74,7 +74,7 @@ class BidentOfThassaTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/Bioshift.java b/Mage.Sets/src/mage/cards/b/Bioshift.java index cccdcd1713..2876e55ca5 100644 --- a/Mage.Sets/src/mage/cards/b/Bioshift.java +++ b/Mage.Sets/src/mage/cards/b/Bioshift.java @@ -82,7 +82,7 @@ class MoveCounterFromTargetToTargetEffect extends OneShotEffect { if (source.getTargets().size() > 1) { toPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); } - if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) { + if (fromPermanent == null || toPermanent == null || !fromPermanent.isControlledBy(toPermanent.getControllerId())) { return false; } int amountCounters = fromPermanent.getCounters(game).getCount(CounterType.P1P1); @@ -114,7 +114,7 @@ class SameControllerPredicate implements ObjectSourcePlayerPredicate 0) { return true; diff --git a/Mage.Sets/src/mage/cards/b/Bossk.java b/Mage.Sets/src/mage/cards/b/Bossk.java index 302bea02de..f8742c1cac 100644 --- a/Mage.Sets/src/mage/cards/b/Bossk.java +++ b/Mage.Sets/src/mage/cards/b/Bossk.java @@ -81,7 +81,7 @@ class BosskTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent != null && permanent.isLand() && permanent.isControlledBy(this.getControllerId())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/b/BottledCloister.java b/Mage.Sets/src/mage/cards/b/BottledCloister.java index 40fe3da515..8036cdc8f5 100644 --- a/Mage.Sets/src/mage/cards/b/BottledCloister.java +++ b/Mage.Sets/src/mage/cards/b/BottledCloister.java @@ -111,7 +111,7 @@ class BottledCloisterReturnEffect extends OneShotEffect { ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null) { for (Card card: exileZone.getCards(game)) { - if (card.getOwnerId().equals(controller.getId())) { + if (card.isOwnedBy(controller.getId())) { numberOfCards++; card.moveToZone(Zone.HAND, source.getSourceId(), game, true); card.setFaceDown(false, game); diff --git a/Mage.Sets/src/mage/cards/b/BoundDetermined.java b/Mage.Sets/src/mage/cards/b/BoundDetermined.java index 728e21e9db..cfb16ba517 100644 --- a/Mage.Sets/src/mage/cards/b/BoundDetermined.java +++ b/Mage.Sets/src/mage/cards/b/BoundDetermined.java @@ -141,6 +141,6 @@ class DeterminedEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && !spell.getSourceId().equals(source.getSourceId()) && spell.getControllerId().equals(source.getControllerId()); + return spell != null && !spell.getSourceId().equals(source.getSourceId()) && spell.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/b/BowerPassage.java b/Mage.Sets/src/mage/cards/b/BowerPassage.java index 9b4194823b..2051063fd9 100644 --- a/Mage.Sets/src/mage/cards/b/BowerPassage.java +++ b/Mage.Sets/src/mage/cards/b/BowerPassage.java @@ -60,7 +60,7 @@ class BowerPassageEffect extends RestrictionEffect { @Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - if (attacker != null && attacker.getControllerId().equals(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) { + if (attacker != null && attacker.isControlledBy(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) { return false; } return true; diff --git a/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java b/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java index b2445b4811..00a2692cc5 100644 --- a/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java +++ b/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java @@ -79,7 +79,7 @@ class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + return creature != null && creature.isControlledBy(source.getControllerId()) && creature.isCreature() && creature.hasSubtype(SubType.WARRIOR, game) && !event.getTargetId().equals(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/b/BredForTheHunt.java b/Mage.Sets/src/mage/cards/b/BredForTheHunt.java index 13dca000ce..2c5f15e810 100644 --- a/Mage.Sets/src/mage/cards/b/BredForTheHunt.java +++ b/Mage.Sets/src/mage/cards/b/BredForTheHunt.java @@ -62,7 +62,7 @@ class BredForTheHuntTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters(game).getCount(CounterType.P1P1) > 0) { + if (creature != null && creature.isControlledBy(getControllerId()) && creature.getCounters(game).getCount(CounterType.P1P1) > 0) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/BroodingSaurian.java b/Mage.Sets/src/mage/cards/b/BroodingSaurian.java index 0a2383c781..135bbcff7c 100644 --- a/Mage.Sets/src/mage/cards/b/BroodingSaurian.java +++ b/Mage.Sets/src/mage/cards/b/BroodingSaurian.java @@ -88,7 +88,7 @@ class BroodingSaurianControlEffect extends ContinuousEffectImpl { for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { Permanent creature = it.next().getPermanent(game); if (creature != null) { - if (!creature.getControllerId().equals(creature.getOwnerId())) { + if (!creature.isControlledBy(creature.getOwnerId())) { creature.changeControllerId(creature.getOwnerId(), game); } } else { diff --git a/Mage.Sets/src/mage/cards/b/BrutalHordechief.java b/Mage.Sets/src/mage/cards/b/BrutalHordechief.java index eb3cc16faf..e3b37d6800 100644 --- a/Mage.Sets/src/mage/cards/b/BrutalHordechief.java +++ b/Mage.Sets/src/mage/cards/b/BrutalHordechief.java @@ -113,7 +113,7 @@ class BrutalHordechiefTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent source = game.getPermanent(event.getSourceId()); - if (source != null && source.getControllerId().equals(controllerId)) { + if (source != null && source.isControlledBy(controllerId)) { UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game); this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId)); return true; diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java b/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java index b386732ee9..e5607074fe 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java @@ -82,7 +82,7 @@ class CallerOfTheClawWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { Permanent card = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (card != null && card.getOwnerId().equals(this.controllerId) && card.isCreature() && !(card instanceof PermanentToken)) { + if (card != null && card.isOwnedBy(this.controllerId) && card.isCreature() && !(card instanceof PermanentToken)) { creaturesCount++; } } diff --git a/Mage.Sets/src/mage/cards/c/CampaignOfVengeance.java b/Mage.Sets/src/mage/cards/c/CampaignOfVengeance.java index 9db4074504..074e519a83 100644 --- a/Mage.Sets/src/mage/cards/c/CampaignOfVengeance.java +++ b/Mage.Sets/src/mage/cards/c/CampaignOfVengeance.java @@ -61,7 +61,7 @@ class CampaignOfVengeanceTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent source = game.getPermanent(event.getSourceId()); - if (source != null && source.getControllerId().equals(controllerId)) { + if (source != null && source.isControlledBy(controllerId)) { UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game); this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId)); return true; diff --git a/Mage.Sets/src/mage/cards/c/CastThroughTime.java b/Mage.Sets/src/mage/cards/c/CastThroughTime.java index 92a51e71af..143688a420 100644 --- a/Mage.Sets/src/mage/cards/c/CastThroughTime.java +++ b/Mage.Sets/src/mage/cards/c/CastThroughTime.java @@ -77,7 +77,7 @@ class GainReboundEffect extends ContinuousEffectImpl { } for (Iterator iterator = game.getStack().iterator(); iterator.hasNext();) { StackObject stackObject = iterator.next(); - if (stackObject instanceof Spell && stackObject.getControllerId().equals(source.getControllerId())) { + if (stackObject instanceof Spell && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; Card card = spell.getCard(); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/c/CatalystStone.java b/Mage.Sets/src/mage/cards/c/CatalystStone.java index bdcf7f251e..0837d00997 100644 --- a/Mage.Sets/src/mage/cards/c/CatalystStone.java +++ b/Mage.Sets/src/mage/cards/c/CatalystStone.java @@ -89,7 +89,7 @@ class CatalystStoneCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { return SpellAbilityCastMode.FLASHBACK.equals(((SpellAbility) abilityToModify).getSpellAbilityCastMode()); } } diff --git a/Mage.Sets/src/mage/cards/c/CelestialDawn.java b/Mage.Sets/src/mage/cards/c/CelestialDawn.java index 26e74879d8..787eaf39cc 100644 --- a/Mage.Sets/src/mage/cards/c/CelestialDawn.java +++ b/Mage.Sets/src/mage/cards/c/CelestialDawn.java @@ -122,13 +122,13 @@ class CelestialDawnToWhiteEffect extends ContinuousEffectImpl { } // Stack for (MageObject object : game.getStack()) { - if (object instanceof Spell && ((Spell) object).getControllerId().equals(controller.getId())) { + if (object instanceof Spell && ((Spell) object).isControlledBy(controller.getId())) { setColor(object.getColor(game), game); } } // Exile for (Card card : game.getExile().getAllCards(game)) { - if (card.getOwnerId().equals(controller.getId())) { + if (card.isOwnedBy(controller.getId())) { setColor(card.getColor(game), game); } } diff --git a/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java b/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java index 3422e28fc3..de10a0845e 100644 --- a/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java +++ b/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java @@ -79,7 +79,7 @@ class ChampionOfLambholtEffect extends RestrictionEffect { @Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null && attacker.getControllerId().equals(sourcePermanent.getControllerId())) { + if (sourcePermanent != null && attacker.isControlledBy(sourcePermanent.getControllerId())) { return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue(); } return true; diff --git a/Mage.Sets/src/mage/cards/c/ChanceEncounter.java b/Mage.Sets/src/mage/cards/c/ChanceEncounter.java index 9cae7a541b..f417f603a9 100644 --- a/Mage.Sets/src/mage/cards/c/ChanceEncounter.java +++ b/Mage.Sets/src/mage/cards/c/ChanceEncounter.java @@ -68,7 +68,7 @@ class ChanceEncounterTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return this.getControllerId().equals(event.getPlayerId()) && event.getFlag(); + return this.isControlledBy(event.getPlayerId()) && event.getFlag(); } @Override diff --git a/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java b/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java index e2975f6b7d..4e5b7fe082 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java +++ b/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java @@ -115,7 +115,7 @@ class ChandraPyromasterTarget extends TargetPermanent { } UUID firstTarget = player.getId(); Permanent permanent = game.getPermanent(id); - if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { + if (firstTarget != null && permanent != null && permanent.isControlledBy(firstTarget)) { return super.canTarget(id, source, game); } return false; @@ -142,7 +142,7 @@ class ChandraPyromasterTarget extends TargetPermanent { if (player != null) { for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.getControllerId().equals(player.getId())) { + if (permanent != null && permanent.isControlledBy(player.getId())) { possibleTargets.add(targetId); } } diff --git a/Mage.Sets/src/mage/cards/c/ChannelHarm.java b/Mage.Sets/src/mage/cards/c/ChannelHarm.java index 4d063d0644..ecd7da14f4 100644 --- a/Mage.Sets/src/mage/cards/c/ChannelHarm.java +++ b/Mage.Sets/src/mage/cards/c/ChannelHarm.java @@ -82,14 +82,14 @@ class ChannelHarmEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { Permanent targetPermanent = game.getPermanent(event.getTargetId()); - if ((targetPermanent != null && targetPermanent.getControllerId().equals(source.getControllerId())) + if ((targetPermanent != null && targetPermanent.isControlledBy(source.getControllerId())) || event.getTargetId().equals(source.getControllerId())) { MageObject damageSource = game.getObject(event.getSourceId()); if (damageSource instanceof Controllable) { - return !((Controllable) damageSource).getControllerId().equals(source.getControllerId()); + return !((Controllable) damageSource).isControlledBy(source.getControllerId()); } else if (damageSource instanceof Card) { - return !((Card) damageSource).getOwnerId().equals(source.getControllerId()); + return !((Card) damageSource).isOwnedBy(source.getControllerId()); } } } diff --git a/Mage.Sets/src/mage/cards/c/ChickenALaKing.java b/Mage.Sets/src/mage/cards/c/ChickenALaKing.java index cfa4f6c851..54fc631a3b 100644 --- a/Mage.Sets/src/mage/cards/c/ChickenALaKing.java +++ b/Mage.Sets/src/mage/cards/c/ChickenALaKing.java @@ -89,7 +89,7 @@ class ChickenALaKingTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) { + if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) { // event.getData holds the num of sides of the die to roll String data = event.getData(); if (data != null) { diff --git a/Mage.Sets/src/mage/cards/c/ChitteringDoom.java b/Mage.Sets/src/mage/cards/c/ChitteringDoom.java index b6b626805d..5b50ecae6f 100644 --- a/Mage.Sets/src/mage/cards/c/ChitteringDoom.java +++ b/Mage.Sets/src/mage/cards/c/ChitteringDoom.java @@ -57,7 +57,7 @@ class ChitteringDoomTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) { + if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) { if (event.getAmount() >= 4) { return true; } diff --git a/Mage.Sets/src/mage/cards/c/CircleOfFlame.java b/Mage.Sets/src/mage/cards/c/CircleOfFlame.java index 028dd37cb2..dc1c26cd8d 100644 --- a/Mage.Sets/src/mage/cards/c/CircleOfFlame.java +++ b/Mage.Sets/src/mage/cards/c/CircleOfFlame.java @@ -77,7 +77,7 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(event.getTargetId()); youOrYourPlaneswalker = permanent != null && permanent.isPlaneswalker() - && permanent.getControllerId().equals(this.getControllerId()); + && permanent.isControlledBy(this.getControllerId()); } if (youOrYourPlaneswalker) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/c/CityOfTraitors.java b/Mage.Sets/src/mage/cards/c/CityOfTraitors.java index d5108787ed..aa507b2a60 100644 --- a/Mage.Sets/src/mage/cards/c/CityOfTraitors.java +++ b/Mage.Sets/src/mage/cards/c/CityOfTraitors.java @@ -62,7 +62,7 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent land = game.getPermanent(event.getTargetId()); return land.isLand() - && land.getControllerId().equals(this.controllerId) + && land.isControlledBy(this.controllerId) && !Objects.equals(event.getTargetId(), this.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/c/CleansingMeditation.java b/Mage.Sets/src/mage/cards/c/CleansingMeditation.java index d00337ab71..03bcd50210 100644 --- a/Mage.Sets/src/mage/cards/c/CleansingMeditation.java +++ b/Mage.Sets/src/mage/cards/c/CleansingMeditation.java @@ -74,7 +74,7 @@ class CleansingMeditationEffect extends OneShotEffect { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, source.getControllerId(), source.getSourceId(), game)) { if (permanent != null && permanent.destroy(source.getSourceId(), game, false)) { - if (threshold && controller != null && permanent.getOwnerId().equals(controller.getId())) { + if (threshold && controller != null && permanent.isOwnedBy(controller.getId())) { cardsToBattlefield.add(permanent); } } diff --git a/Mage.Sets/src/mage/cards/c/CloudCover.java b/Mage.Sets/src/mage/cards/c/CloudCover.java index 1793102559..7367585c44 100644 --- a/Mage.Sets/src/mage/cards/c/CloudCover.java +++ b/Mage.Sets/src/mage/cards/c/CloudCover.java @@ -63,7 +63,7 @@ class CloudCoverAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(event.getTargetId()); Player controller = game.getPlayer(this.getControllerId()); if (permanent != null - && permanent.getControllerId().equals(getControllerId()) + && permanent.isControlledBy(getControllerId()) && !permanent.getId().equals(this.getSourceId()) && controller != null && controller.hasOpponent(event.getPlayerId(), game)) { diff --git a/Mage.Sets/src/mage/cards/c/CloudKey.java b/Mage.Sets/src/mage/cards/c/CloudKey.java index 7da1f97dfc..5a9bd8158e 100644 --- a/Mage.Sets/src/mage/cards/c/CloudKey.java +++ b/Mage.Sets/src/mage/cards/c/CloudKey.java @@ -119,7 +119,7 @@ class CloudKeyCostModificationEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify instanceof SpellAbility && abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = game.getStack().getSpell(abilityToModify.getSourceId()); if (spell != null && spell.getCardType().toString().contains((String) game.getState().getValue(source.getSourceId().toString() + "_CloudKey"))) { return true; diff --git a/Mage.Sets/src/mage/cards/c/CoastalPiracy.java b/Mage.Sets/src/mage/cards/c/CoastalPiracy.java index dab61d1851..f3a94fc0a6 100644 --- a/Mage.Sets/src/mage/cards/c/CoastalPiracy.java +++ b/Mage.Sets/src/mage/cards/c/CoastalPiracy.java @@ -63,7 +63,7 @@ class CoastalPiracyTriggeredAbility extends TriggeredAbilityImpl { if (((DamagedPlayerEvent) event).isCombatDamage() && game.getOpponents(this.controllerId).contains(((DamagedPlayerEvent) event).getPlayerId())) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/c/Comeuppance.java b/Mage.Sets/src/mage/cards/c/Comeuppance.java index 6abcda8ce1..8d03fa51c8 100644 --- a/Mage.Sets/src/mage/cards/c/Comeuppance.java +++ b/Mage.Sets/src/mage/cards/c/Comeuppance.java @@ -71,7 +71,7 @@ class ComeuppanceEffect extends PreventionEffectImpl { MageObject damageDealingObject = game.getObject(event.getSourceId()); UUID objectControllerId = null; if (damageDealingObject instanceof Permanent) { - if (((Permanent) damageDealingObject).isCreature()) { + if (damageDealingObject.isCreature()) { ((Permanent) damageDealingObject).damage(preventionData.getPreventedDamage(), source.getSourceId(), game, false, true); } else { objectControllerId = ((Permanent) damageDealingObject).getControllerId(); @@ -102,7 +102,7 @@ class ComeuppanceEffect extends PreventionEffectImpl { } else { Permanent targetPermanent = game.getPermanent(event.getTargetId()); if (targetPermanent != null && - targetPermanent.getControllerId().equals(source.getControllerId()) && + targetPermanent.isControlledBy(source.getControllerId()) && targetPermanent.isPlaneswalker()) { catched = true; } @@ -110,11 +110,11 @@ class ComeuppanceEffect extends PreventionEffectImpl { if (catched) { MageObject damageSource = game.getObject(event.getSourceId()); if (damageSource instanceof StackObject) { - return !((StackObject) damageSource).getControllerId().equals(source.getControllerId()); + return !((StackObject) damageSource).isControlledBy(source.getControllerId()); } else if (damageSource instanceof Permanent) { - return !((Permanent) damageSource).getControllerId().equals(source.getControllerId()); + return !((Permanent) damageSource).isControlledBy(source.getControllerId()); } else if (damageSource instanceof Card) { - return !((Card) damageSource).getOwnerId().equals(source.getControllerId()); + return !((Card) damageSource).isOwnedBy(source.getControllerId()); } Logger.getLogger(Comeuppance.class).error("Comeuppance: could not define source objects controller - " + (damageSource != null ? damageSource.getName(): "null")); } diff --git a/Mage.Sets/src/mage/cards/c/CommuneWithLava.java b/Mage.Sets/src/mage/cards/c/CommuneWithLava.java index da68914daf..a047413986 100644 --- a/Mage.Sets/src/mage/cards/c/CommuneWithLava.java +++ b/Mage.Sets/src/mage/cards/c/CommuneWithLava.java @@ -119,7 +119,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && getTargetPointer().getTargets(game, source).contains(sourceId); } diff --git a/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java b/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java index 8cd274c678..b8f39e589a 100644 --- a/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java +++ b/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java @@ -89,7 +89,7 @@ class ConcussiveBoltRestrictionEffect extends RestrictionEffect { if (player == null) { return false; } - if (metalcraft && permanent.getControllerId().equals(player.getId())) { + if (metalcraft && permanent.isControlledBy(player.getId())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/c/Conspiracy.java b/Mage.Sets/src/mage/cards/c/Conspiracy.java index c70361593e..1b305eff23 100644 --- a/Mage.Sets/src/mage/cards/c/Conspiracy.java +++ b/Mage.Sets/src/mage/cards/c/Conspiracy.java @@ -85,13 +85,13 @@ class ConspiracyEffect extends ContinuousEffectImpl { } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature()) { setCreatureSubtype(card, subType, game); } } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature()) { setCreatureSubtype(card, subType, game); } } @@ -108,7 +108,7 @@ class ConspiracyEffect extends ContinuousEffectImpl { for (Iterator iterator = game.getStack().iterator(); iterator.hasNext();) { StackObject stackObject = iterator.next(); if (stackObject instanceof Spell - && stackObject.getControllerId().equals(source.getControllerId()) + && stackObject.isControlledBy(source.getControllerId()) && stackObject.isCreature()) { Card card = ((Spell) stackObject).getCard(); setCreatureSubtype(card, subType, game); diff --git a/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java b/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java index bb3ea2454f..cb0f555675 100644 --- a/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java +++ b/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java @@ -83,7 +83,7 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) + if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature()) { return true; } diff --git a/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java b/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java index 7349f4100e..b9b2f943eb 100644 --- a/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java +++ b/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java @@ -120,7 +120,7 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if ((abilityToModify instanceof SpellAbility) - && abilityToModify.getControllerId().equals(source.getControllerId())) { + && abilityToModify.isControlledBy(source.getControllerId())) { Card card = game.getCard(abilityToModify.getSourceId()); return card.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY)); } diff --git a/Mage.Sets/src/mage/cards/c/Counterflux.java b/Mage.Sets/src/mage/cards/c/Counterflux.java index e27c4599af..4f3703148b 100644 --- a/Mage.Sets/src/mage/cards/c/Counterflux.java +++ b/Mage.Sets/src/mage/cards/c/Counterflux.java @@ -84,7 +84,7 @@ class CounterfluxEffect extends OneShotEffect { List spellsToCounter = new LinkedList<>(); for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && !stackObject.getControllerId().equals(source.getControllerId())) { + if (stackObject instanceof Spell && !stackObject.isControlledBy(source.getControllerId())) { spellsToCounter.add((Spell) stackObject); } } diff --git a/Mage.Sets/src/mage/cards/c/CrawlingSensation.java b/Mage.Sets/src/mage/cards/c/CrawlingSensation.java index 312d646ab5..f3c2788771 100644 --- a/Mage.Sets/src/mage/cards/c/CrawlingSensation.java +++ b/Mage.Sets/src/mage/cards/c/CrawlingSensation.java @@ -72,7 +72,7 @@ class CrawlingSensationTriggeredAbility extends TriggeredAbilityImpl { Set cardType = card.getCardType(); if (cardOwnerId != null - && card.getOwnerId().equals(getControllerId()) + && card.isOwnedBy(getControllerId()) && cardType != null && card.isLand()) { game.getState().setValue("usedOnTurn" + getControllerId() + getOriginalId(), game.getTurnNum()); diff --git a/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java b/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java index aa3e6b8d77..fc85728ff2 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java @@ -90,7 +90,7 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && spell.getControllerId().equals(player.getId())) { + if (player != null && spell.isControlledBy(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheNightlyHunt.java b/Mage.Sets/src/mage/cards/c/CurseOfTheNightlyHunt.java index 473f8d72df..72aa6094a5 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheNightlyHunt.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheNightlyHunt.java @@ -67,7 +67,7 @@ class CurseOfTheNightlyHuntEffect extends RequirementEffect { public boolean applies(Permanent permanent, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { - if (permanent.getControllerId().equals(enchantment.getAttachedTo())) { + if (permanent.isControlledBy(enchantment.getAttachedTo())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/c/CustodiLich.java b/Mage.Sets/src/mage/cards/c/CustodiLich.java index 1d8e2c4114..0fc1625b39 100644 --- a/Mage.Sets/src/mage/cards/c/CustodiLich.java +++ b/Mage.Sets/src/mage/cards/c/CustodiLich.java @@ -70,7 +70,7 @@ class BecomesMonarchSourceControllerTriggeredAbility extends TriggeredAbilityImp @Override public boolean checkTrigger(GameEvent event, Game game) { - return getControllerId().equals(event.getPlayerId()); + return isControlledBy(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DarigaazReincarnated.java b/Mage.Sets/src/mage/cards/d/DarigaazReincarnated.java index 3d23098e3d..d8c3f04ece 100644 --- a/Mage.Sets/src/mage/cards/d/DarigaazReincarnated.java +++ b/Mage.Sets/src/mage/cards/d/DarigaazReincarnated.java @@ -161,7 +161,7 @@ class DarigaazReincarnatedReturnEffect extends OneShotEffect { return false; } MageObject sourceObject = source.getSourceObjectIfItStillExists(game); - if (sourceObject != null && sourceObject instanceof Card) { + if (sourceObject instanceof Card) { Card card = (Card) sourceObject; new RemoveCounterSourceEffect(CounterType.EGG.createInstance()).apply(game, source); if (card.getCounters(game).getCount(CounterType.EGG) == 0) { diff --git a/Mage.Sets/src/mage/cards/d/DarkDwellerOracle.java b/Mage.Sets/src/mage/cards/d/DarkDwellerOracle.java index fe999c3dc9..bef6334009 100644 --- a/Mage.Sets/src/mage/cards/d/DarkDwellerOracle.java +++ b/Mage.Sets/src/mage/cards/d/DarkDwellerOracle.java @@ -121,7 +121,7 @@ class DarkDwellerOracleCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/d/DauntingDefender.java b/Mage.Sets/src/mage/cards/d/DauntingDefender.java index 69e9b5d0f4..bc1b802087 100644 --- a/Mage.Sets/src/mage/cards/d/DauntingDefender.java +++ b/Mage.Sets/src/mage/cards/d/DauntingDefender.java @@ -65,7 +65,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.hasSubtype(SubType.CLERIC, game)) { + if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.hasSubtype(SubType.CLERIC, game)) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java b/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java index fa8c284a89..0f13053b5a 100644 --- a/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java +++ b/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java @@ -144,7 +144,7 @@ class DaxosOfMeletisCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(cardId) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(cardId) && source.isControlledBy(affectedControllerId)) { ExileZone exileZone = game.getState().getExile().getExileZone(exileId); return exileZone != null && exileZone.contains(cardId); } @@ -175,7 +175,7 @@ class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl implements AsT @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget()) && ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId) && (((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)) diff --git a/Mage.Sets/src/mage/cards/d/DearlyDeparted.java b/Mage.Sets/src/mage/cards/d/DearlyDeparted.java index af910d5c79..6083900b5c 100644 --- a/Mage.Sets/src/mage/cards/d/DearlyDeparted.java +++ b/Mage.Sets/src/mage/cards/d/DearlyDeparted.java @@ -64,7 +64,7 @@ class DearlyDepartedEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype(SubType.HUMAN, game)) { + if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.hasSubtype(SubType.HUMAN, game)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/d/DeathsPresence.java b/Mage.Sets/src/mage/cards/d/DeathsPresence.java index 00aac1bb56..0d69324a1c 100644 --- a/Mage.Sets/src/mage/cards/d/DeathsPresence.java +++ b/Mage.Sets/src/mage/cards/d/DeathsPresence.java @@ -66,7 +66,7 @@ class DeathsPresenceTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) { + if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { this.getTargets().clear(); this.addTarget(new TargetControlledCreaturePermanent()); this.getEffects().clear(); diff --git a/Mage.Sets/src/mage/cards/d/DeepfathomSkulker.java b/Mage.Sets/src/mage/cards/d/DeepfathomSkulker.java index 490a04b2b8..d251e95276 100644 --- a/Mage.Sets/src/mage/cards/d/DeepfathomSkulker.java +++ b/Mage.Sets/src/mage/cards/d/DeepfathomSkulker.java @@ -80,7 +80,7 @@ class DeepfathomSkulkerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DefenseGrid.java b/Mage.Sets/src/mage/cards/d/DefenseGrid.java index 9699d07b17..e4aaa65939 100644 --- a/Mage.Sets/src/mage/cards/d/DefenseGrid.java +++ b/Mage.Sets/src/mage/cards/d/DefenseGrid.java @@ -57,7 +57,7 @@ class DefenseGridCostModificationEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (!abilityToModify.getControllerId().equals(game.getActivePlayerId())) { + if (!abilityToModify.isControlledBy(game.getActivePlayerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DefiantGreatmaw.java b/Mage.Sets/src/mage/cards/d/DefiantGreatmaw.java index 300c5788e3..b71d27ff4f 100644 --- a/Mage.Sets/src/mage/cards/d/DefiantGreatmaw.java +++ b/Mage.Sets/src/mage/cards/d/DefiantGreatmaw.java @@ -80,7 +80,7 @@ class DefiantGreatmawTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - boolean weAreDoingIt = getControllerId().equals(game.getControllerId(event.getSourceId())); + boolean weAreDoingIt = isControlledBy(game.getControllerId(event.getSourceId())); boolean isM1M1Counters = event.getData().equals(CounterType.M1M1.getName()); if (weAreDoingIt && isM1M1Counters && event.getTargetId().equals(this.getSourceId())) { return true; diff --git a/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java b/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java index 29dd3bf675..851eff1ffb 100644 --- a/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java +++ b/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java @@ -87,7 +87,7 @@ class DereviEmpyrialTacticianTriggeredAbility extends TriggeredAbilityImpl { if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DesecratedTomb.java b/Mage.Sets/src/mage/cards/d/DesecratedTomb.java index 8112550b0f..b597b3e36d 100644 --- a/Mage.Sets/src/mage/cards/d/DesecratedTomb.java +++ b/Mage.Sets/src/mage/cards/d/DesecratedTomb.java @@ -65,7 +65,7 @@ class DesecratedTombTriggeredAbility extends TriggeredAbilityImpl { Set cardType = card.getCardType(); if (cardOwnerId != null - && card.getOwnerId().equals(getControllerId()) + && card.isOwnedBy(getControllerId()) && cardType != null && card.isCreature()) { return true; diff --git a/Mage.Sets/src/mage/cards/d/DireFleetDaredevil.java b/Mage.Sets/src/mage/cards/d/DireFleetDaredevil.java index 20130a2c61..72fe39f0ca 100644 --- a/Mage.Sets/src/mage/cards/d/DireFleetDaredevil.java +++ b/Mage.Sets/src/mage/cards/d/DireFleetDaredevil.java @@ -147,7 +147,7 @@ class DireFleetDaredevilPlayEffect extends AsThoughEffectImpl { UUID targetId = getTargetPointer().getFirst(game, source); if (targetId != null) { return targetId.equals(objectId) - && source.getControllerId().equals(affectedControllerId); + && source.isControlledBy(affectedControllerId); } else { // the target card has changed zone meanwhile, so the effect is no longer needed discard(); @@ -179,7 +179,7 @@ class DireFleetDaredevilSpendAnyManaEffect extends AsThoughEffectImpl implements @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget()) && ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId) && game.getState().getZone(objectId) == Zone.STACK; @@ -210,7 +210,7 @@ class DireFleetDaredevilReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - UUID eventObject = ((ZoneChangeEvent) event).getTargetId(); + UUID eventObject = event.getTargetId(); StackObject stackObject = game.getStack().getStackObject(eventObject); if (stackObject != null) { if (stackObject instanceof Spell) { diff --git a/Mage.Sets/src/mage/cards/d/DiregrafCaptain.java b/Mage.Sets/src/mage/cards/d/DiregrafCaptain.java index 4f47406d21..4d77c40513 100644 --- a/Mage.Sets/src/mage/cards/d/DiregrafCaptain.java +++ b/Mage.Sets/src/mage/cards/d/DiregrafCaptain.java @@ -88,7 +88,7 @@ class DiregrafCaptainTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.getControllerId().equals(this.controllerId) && filter.match(p, game)) { + if (p != null && p.isControlledBy(this.controllerId) && filter.match(p, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DisplayOfDominance.java b/Mage.Sets/src/mage/cards/d/DisplayOfDominance.java index 407864aae3..f80123275b 100644 --- a/Mage.Sets/src/mage/cards/d/DisplayOfDominance.java +++ b/Mage.Sets/src/mage/cards/d/DisplayOfDominance.java @@ -99,7 +99,7 @@ class DisplayOfDominanceEffect extends ContinuousRuleModifyingEffectImpl { mageObject instanceof Spell && (mageObject.getColor(game).isBlack() || mageObject.getColor(game).isBlue())) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.getControllerId().equals(ability.getControllerId()); + return permanent != null && permanent.isControlledBy(ability.getControllerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/d/DivineDeflection.java b/Mage.Sets/src/mage/cards/d/DivineDeflection.java index b0ffb232d9..9044094c55 100644 --- a/Mage.Sets/src/mage/cards/d/DivineDeflection.java +++ b/Mage.Sets/src/mage/cards/d/DivineDeflection.java @@ -118,12 +118,12 @@ class DivineDeflectionPreventDamageTargetEffect extends PreventionEffectImpl { // check permanent first Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (permanent.getControllerId().equals(source.getControllerId())) { + if (permanent.isControlledBy(source.getControllerId())) { return true; } } // check player - if (source.getControllerId().equals(event.getTargetId())) { + if (source.isControlledBy(event.getTargetId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java b/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java index 1e5e879503..f29593b7e2 100644 --- a/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java +++ b/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java @@ -87,7 +87,7 @@ class DjeruWithEyesOpenPreventEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/d/DjinnIlluminatus.java b/Mage.Sets/src/mage/cards/d/DjinnIlluminatus.java index e33b08f37e..bba34f7496 100644 --- a/Mage.Sets/src/mage/cards/d/DjinnIlluminatus.java +++ b/Mage.Sets/src/mage/cards/d/DjinnIlluminatus.java @@ -81,8 +81,8 @@ class DjinnIlluminatusGainReplicateEffect extends ContinuousEffectImpl { // only spells cast, so no copies of spells if ((stackObject instanceof Spell) && !stackObject.isCopy() - && stackObject.getControllerId().equals(source.getControllerId()) - && djinn.getControllerId().equals(source.getControllerId()) // verify that the controller of the djinn cast that spell + && stackObject.isControlledBy(source.getControllerId()) + && djinn.isControlledBy(source.getControllerId()) // verify that the controller of the djinn cast that spell && !stackObject.getManaCost().isEmpty()) { //handle cases like Ancestral Vision Spell spell = (Spell) stackObject; if (filter.match(stackObject, game)) { diff --git a/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java b/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java index 8edb4b467d..5f196a1205 100644 --- a/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java +++ b/Mage.Sets/src/mage/cards/d/DoorOfDestinies.java @@ -75,7 +75,7 @@ class AddCounterAbility extends TriggeredAbilityImpl { if (subType != null) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null - && spell.getControllerId().equals(getControllerId()) + && spell.isControlledBy(getControllerId()) && spell.hasSubtype(subType, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/d/DoublingSeason.java b/Mage.Sets/src/mage/cards/d/DoublingSeason.java index 587342dffa..fab6ae021d 100644 --- a/Mage.Sets/src/mage/cards/d/DoublingSeason.java +++ b/Mage.Sets/src/mage/cards/d/DoublingSeason.java @@ -79,7 +79,7 @@ class DoublingSeasonCounterEffect extends ReplacementEffectImpl { && permanent.isLand()); // a played land is not an effect } return permanent != null - && permanent.getControllerId().equals(source.getControllerId()) + && permanent.isControlledBy(source.getControllerId()) && !landPlayed; // example: gemstone mine being played as a land drop } diff --git a/Mage.Sets/src/mage/cards/d/DrafnasRestoration.java b/Mage.Sets/src/mage/cards/d/DrafnasRestoration.java index 0fcaa1f512..83b5bb36b0 100644 --- a/Mage.Sets/src/mage/cards/d/DrafnasRestoration.java +++ b/Mage.Sets/src/mage/cards/d/DrafnasRestoration.java @@ -63,7 +63,7 @@ class DrafnasRestorationTarget extends TargetCardInGraveyard { public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); MageObject object = game.getObject(sourceId); - if (object != null && object instanceof StackObject) { + if (object instanceof StackObject) { Player targetPlayer = game.getPlayer(((StackObject) object).getStackAbility().getFirstTarget()); if (targetPlayer != null) { for (Card card : targetPlayer.getGraveyard().getCards(filter, sourceId, sourceControllerId, game)) { diff --git a/Mage.Sets/src/mage/cards/d/DragonlordsPrerogative.java b/Mage.Sets/src/mage/cards/d/DragonlordsPrerogative.java index f0b975accb..6ce626db3f 100644 --- a/Mage.Sets/src/mage/cards/d/DragonlordsPrerogative.java +++ b/Mage.Sets/src/mage/cards/d/DragonlordsPrerogative.java @@ -91,7 +91,7 @@ class DragonlordsPrerogativeCondition implements Condition { if (spell != null && spell.getSpellAbility() != null) { for(Cost cost: spell.getSpellAbility().getCosts()) { if (cost instanceof RevealTargetFromHandCost) { - applies = !((RevealTargetFromHandCost)cost).getTargets().isEmpty(); + applies = !cost.getTargets().isEmpty(); break; } } diff --git a/Mage.Sets/src/mage/cards/d/DreamPillager.java b/Mage.Sets/src/mage/cards/d/DreamPillager.java index 39b74f4139..ad7ca79d2e 100644 --- a/Mage.Sets/src/mage/cards/d/DreamPillager.java +++ b/Mage.Sets/src/mage/cards/d/DreamPillager.java @@ -153,7 +153,7 @@ class DreamPillagerCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/d/DungeonGeists.java b/Mage.Sets/src/mage/cards/d/DungeonGeists.java index c6b2fa5afb..ca1adb9746 100644 --- a/Mage.Sets/src/mage/cards/d/DungeonGeists.java +++ b/Mage.Sets/src/mage/cards/d/DungeonGeists.java @@ -89,7 +89,7 @@ class DungeonGeistsEffect extends ContinuousRuleModifyingEffectImpl { // the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL // event will happen before this effect is applied ever) MageObject sourceObject = source.getSourceObjectIfItStillExists(game); - if (!(sourceObject instanceof Permanent) || !((Permanent) sourceObject).getControllerId().equals(source.getControllerId())) { + if (!(sourceObject instanceof Permanent) || !((Permanent) sourceObject).isControlledBy(source.getControllerId())) { discard(); return false; } @@ -109,7 +109,7 @@ class DungeonGeistsEffect extends ContinuousRuleModifyingEffectImpl { if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getTargetId().equals(targetPointer.getFirst(game, source))) { Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source)); if (targetCreature != null) { - return targetCreature.getControllerId().equals(game.getActivePlayerId()); + return targetCreature.isControlledBy(game.getActivePlayerId()); } else { discard(); return false; diff --git a/Mage.Sets/src/mage/cards/e/ElderwoodScion.java b/Mage.Sets/src/mage/cards/e/ElderwoodScion.java index e099cab1e4..778ffb55e5 100644 --- a/Mage.Sets/src/mage/cards/e/ElderwoodScion.java +++ b/Mage.Sets/src/mage/cards/e/ElderwoodScion.java @@ -73,7 +73,7 @@ class ElderwoodScionCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { for (UUID modeId : abilityToModify.getModes().getSelectedModes()) { Mode mode = abilityToModify.getModes().get(modeId); for (Target target : mode.getTargets()) { diff --git a/Mage.Sets/src/mage/cards/e/Electropotence.java b/Mage.Sets/src/mage/cards/e/Electropotence.java index f556ab2bf3..ebaa86d2cf 100644 --- a/Mage.Sets/src/mage/cards/e/Electropotence.java +++ b/Mage.Sets/src/mage/cards/e/Electropotence.java @@ -64,7 +64,7 @@ class ElectropotenceTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isCreature() - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { this.getEffects().get(0).setValue("damageSource", event.getTargetId()); return true; } diff --git a/Mage.Sets/src/mage/cards/e/ElkinBottle.java b/Mage.Sets/src/mage/cards/e/ElkinBottle.java index 48a6a10b1d..5ace27859f 100644 --- a/Mage.Sets/src/mage/cards/e/ElkinBottle.java +++ b/Mage.Sets/src/mage/cards/e/ElkinBottle.java @@ -113,7 +113,7 @@ class ElkinBottleCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && sourceId.equals(getTargetPointer().getFirst(game, source)); } diff --git a/Mage.Sets/src/mage/cards/e/EmbermawHellion.java b/Mage.Sets/src/mage/cards/e/EmbermawHellion.java index 42ae1cdbcb..9bc75994f2 100644 --- a/Mage.Sets/src/mage/cards/e/EmbermawHellion.java +++ b/Mage.Sets/src/mage/cards/e/EmbermawHellion.java @@ -74,7 +74,7 @@ class EmbermawHellionEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if(source.getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if(source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject sourceObject; Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if(sourcePermanent == null) { diff --git a/Mage.Sets/src/mage/cards/e/EncirclingFissure.java b/Mage.Sets/src/mage/cards/e/EncirclingFissure.java index a022c29835..ca9f6b61eb 100644 --- a/Mage.Sets/src/mage/cards/e/EncirclingFissure.java +++ b/Mage.Sets/src/mage/cards/e/EncirclingFissure.java @@ -66,7 +66,7 @@ class EncirclingFissurePreventEffect extends PreventionEffectImpl { Permanent permanent = game.getPermanent(damageEvent.getSourceId()); if (permanent != null && permanent.isCreature() - && permanent.getControllerId().equals(getTargetPointer().getFirst(game, source))) { + && permanent.isControlledBy(getTargetPointer().getFirst(game, source))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/e/EnduringScalelord.java b/Mage.Sets/src/mage/cards/e/EnduringScalelord.java index f315c98fec..663f0f9cfe 100644 --- a/Mage.Sets/src/mage/cards/e/EnduringScalelord.java +++ b/Mage.Sets/src/mage/cards/e/EnduringScalelord.java @@ -76,7 +76,7 @@ class EnduringScalelordTriggeredAbility extends TriggeredAbilityImpl { return (permanent != null && !event.getTargetId().equals(this.getSourceId()) && permanent.isCreature() - && permanent.getControllerId().equals(this.getControllerId())); + && permanent.isControlledBy(this.getControllerId())); } return false; } diff --git a/Mage.Sets/src/mage/cards/e/EnigmaSphinx.java b/Mage.Sets/src/mage/cards/e/EnigmaSphinx.java index 7b988de1da..ddeb27ac4e 100644 --- a/Mage.Sets/src/mage/cards/e/EnigmaSphinx.java +++ b/Mage.Sets/src/mage/cards/e/EnigmaSphinx.java @@ -90,7 +90,7 @@ class EnigmaSphinxTriggeredAbility extends TriggeredAbilityImpl { && permanent.getId().equals(this.getSourceId()) && // 5/1/2009 If you control an Enigma Sphinx that's owned by another player, it's put into that player's // graveyard from the battlefield, so Enigma Sphinx's middle ability won't trigger. - permanent.getOwnerId().equals(permanent.getControllerId())) { + permanent.isOwnedBy(permanent.getControllerId())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java b/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java index 7dd1629454..2d1a030d4d 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java +++ b/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java @@ -66,7 +66,7 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent perm = ((EntersTheBattlefieldEvent) event).getTarget(); - return perm != null && perm.isCreature() && perm.getControllerId().equals(source.getControllerId()); + return perm != null && perm.isCreature() && perm.isControlledBy(source.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/e/EternalScourge.java b/Mage.Sets/src/mage/cards/e/EternalScourge.java index 4dc83fce26..b226e01a85 100644 --- a/Mage.Sets/src/mage/cards/e/EternalScourge.java +++ b/Mage.Sets/src/mage/cards/e/EternalScourge.java @@ -71,7 +71,7 @@ class EternalScourgePlayEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); - if (card != null && card.getOwnerId().equals(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.EXILED) { + if (card != null && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.EXILED) { return true; } } diff --git a/Mage.Sets/src/mage/cards/e/EunuchsIntrigues.java b/Mage.Sets/src/mage/cards/e/EunuchsIntrigues.java index f4ca2c8779..1daf99900d 100644 --- a/Mage.Sets/src/mage/cards/e/EunuchsIntrigues.java +++ b/Mage.Sets/src/mage/cards/e/EunuchsIntrigues.java @@ -103,7 +103,7 @@ class EunuchsIntriguesRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getControllerId().equals(source.getFirstTarget())) { + if (permanent.isControlledBy(source.getFirstTarget())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/f/FaithsReward.java b/Mage.Sets/src/mage/cards/f/FaithsReward.java index 1c34dec080..cf44963565 100644 --- a/Mage.Sets/src/mage/cards/f/FaithsReward.java +++ b/Mage.Sets/src/mage/cards/f/FaithsReward.java @@ -61,7 +61,7 @@ class FaithsRewardEffect extends OneShotEffect { if (watcher != null) { for (UUID id : watcher.cards) { Card c = game.getCard(id); - if (c != null && c.getOwnerId().equals(source.getControllerId()) && game.getState().getZone(id) == Zone.GRAVEYARD) { + if (c != null && c.isOwnedBy(source.getControllerId()) && game.getState().getZone(id) == Zone.GRAVEYARD) { c.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); } } diff --git a/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java b/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java index b6274936b8..5a9aac019f 100644 --- a/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java +++ b/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java @@ -99,7 +99,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl { // Exile for (Card card : game.getExile().getAllCards(game)) { if (filter.match(card, source.getSourceId(), controller.getId(), game)) { - if (card.getOwnerId().equals(controller.getId())) { + if (card.isOwnedBy(controller.getId())) { addMadnessToCard(game, card, usedMadnessAbilities); } } diff --git a/Mage.Sets/src/mage/cards/f/FavorableDestiny.java b/Mage.Sets/src/mage/cards/f/FavorableDestiny.java index 3f585e83d9..d5a237d635 100644 --- a/Mage.Sets/src/mage/cards/f/FavorableDestiny.java +++ b/Mage.Sets/src/mage/cards/f/FavorableDestiny.java @@ -90,7 +90,7 @@ class FavorableDestinyCondition implements Condition { Player controller = game.getPlayer(creature.getControllerId()); if (controller != null) { for (Permanent perm : game.getBattlefield().getActivePermanents(controller.getId(), game)) { - if (perm.getControllerId().equals(controller.getId()) + if (perm.isControlledBy(controller.getId()) && perm.isCreature() && !perm.equals(creature)) { return true; diff --git a/Mage.Sets/src/mage/cards/f/FellShepherd.java b/Mage.Sets/src/mage/cards/f/FellShepherd.java index e8197945ca..626237217f 100644 --- a/Mage.Sets/src/mage/cards/f/FellShepherd.java +++ b/Mage.Sets/src/mage/cards/f/FellShepherd.java @@ -87,7 +87,7 @@ class FellShepherdWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (card != null && ((Card) card).getOwnerId().equals(this.controllerId) && card.isCreature()) { + if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature()) { creatureIds.add(card.getId()); } } diff --git a/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java b/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java index d1687d6fef..3749823252 100644 --- a/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java +++ b/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java @@ -97,7 +97,7 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifyingEffectImpl { StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId()); if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) { if (stackObject.getColor(game).isBlack() || stackObject.getColor(game).isRed()) { - if (!stackObject.getControllerId().equals(source.getControllerId()) + if (!stackObject.isControlledBy(source.getControllerId()) && stackObject.isInstant() || stackObject.isSorcery()) { return true; diff --git a/Mage.Sets/src/mage/cards/f/FireServant.java b/Mage.Sets/src/mage/cards/f/FireServant.java index 432634db04..5cd9c2c04a 100644 --- a/Mage.Sets/src/mage/cards/f/FireServant.java +++ b/Mage.Sets/src/mage/cards/f/FireServant.java @@ -74,7 +74,7 @@ class FireServantEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { StackObject spell = game.getStack().getStackObject(event.getSourceId()); return spell != null && - spell.getControllerId().equals(source.getControllerId()) && + spell.isControlledBy(source.getControllerId()) && spell.getColor(game).isRed() && (spell.isInstant() || spell.isSorcery()); } diff --git a/Mage.Sets/src/mage/cards/f/FlamebladeAngel.java b/Mage.Sets/src/mage/cards/f/FlamebladeAngel.java index 4558dfcf55..ef69d3eadd 100644 --- a/Mage.Sets/src/mage/cards/f/FlamebladeAngel.java +++ b/Mage.Sets/src/mage/cards/f/FlamebladeAngel.java @@ -78,7 +78,7 @@ class FlamebladeAngelTriggeredAbility extends TriggeredAbilityImpl { result = true; } else { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && getControllerId().equals(permanent.getControllerId())) { + if (permanent != null && isControlledBy(permanent.getControllerId())) { result = true; } } diff --git a/Mage.Sets/src/mage/cards/f/FlamesOfRemembrance.java b/Mage.Sets/src/mage/cards/f/FlamesOfRemembrance.java index 01d71f3010..8c80d6be9c 100644 --- a/Mage.Sets/src/mage/cards/f/FlamesOfRemembrance.java +++ b/Mage.Sets/src/mage/cards/f/FlamesOfRemembrance.java @@ -111,6 +111,6 @@ class FlamesOfRemembranceMayPlayExiledEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) && this.getTargetPointer().getTargets(game, source).contains(objectId); + return source.isControlledBy(affectedControllerId) && this.getTargetPointer().getTargets(game, source).contains(objectId); } } diff --git a/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java b/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java index 768c7fb74c..b51a555a73 100644 --- a/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java +++ b/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java @@ -72,7 +72,7 @@ class FlayerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD - && permanent.getOwnerId().equals(controllerId) + && permanent.isOwnedBy(controllerId) && permanent.isCreature()) { Effect effect = this.getEffects().get(0); effect.setValue("damageSource", event.getTargetId()); diff --git a/Mage.Sets/src/mage/cards/f/Fluctuator.java b/Mage.Sets/src/mage/cards/f/Fluctuator.java index ca95d7d080..7554bb482b 100644 --- a/Mage.Sets/src/mage/cards/f/Fluctuator.java +++ b/Mage.Sets/src/mage/cards/f/Fluctuator.java @@ -56,7 +56,7 @@ class FluctuatorEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - return abilityToModify.getControllerId().equals(source.getControllerId()) + return abilityToModify.isControlledBy(source.getControllerId()) && (abilityToModify instanceof CyclingAbility); } diff --git a/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java b/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java index 08619da0bd..b66dd9c48a 100644 --- a/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java +++ b/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java @@ -91,7 +91,7 @@ class FoeRazerRegentTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.getControllerId().equals(getControllerId())) { + if (permanent != null && permanent.isControlledBy(getControllerId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent, game)); } diff --git a/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java b/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java index 97f42256d0..06678f2232 100644 --- a/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java +++ b/Mage.Sets/src/mage/cards/f/ForbiddenCrypt.java @@ -149,7 +149,7 @@ class ForbiddenCryptPutIntoYourGraveyardReplacementEffect extends ReplacementEff public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getOwnerId().equals(source.getControllerId())) { + if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent == null || !(permanent instanceof PermanentToken)) { return true; diff --git a/Mage.Sets/src/mage/cards/f/FracturedLoyalty.java b/Mage.Sets/src/mage/cards/f/FracturedLoyalty.java index 27e81fe492..260c148e63 100644 --- a/Mage.Sets/src/mage/cards/f/FracturedLoyalty.java +++ b/Mage.Sets/src/mage/cards/f/FracturedLoyalty.java @@ -71,7 +71,7 @@ public final class FracturedLoyalty extends CardImpl { if (enchantedCreature != null) { Player controller = game.getPlayer(enchantedCreature.getControllerId()); if (enchantment.getAttachedTo() != null) { - if (controller != null && !enchantedCreature.getControllerId().equals(this.getTargetPointer().getFirst(game, source))) { + if (controller != null && !enchantedCreature.isControlledBy(this.getTargetPointer().getFirst(game, source))) { ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, this.getTargetPointer().getFirst(game, source)); effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java index fac88ce931..1bd6c487ec 100644 --- a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java +++ b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java @@ -85,7 +85,7 @@ class GarnaTheBloodflameEffect extends OneShotEffect { Set toHand = new HashSet<>(); for (UUID cardId : watcher.getCardsPutToGraveyardThisTurn()) { Card card = game.getCard(cardId); - if (card != null && card.getOwnerId().equals(source.getControllerId()) && game.getState().getZone(cardId) == Zone.GRAVEYARD) { + if (card != null && card.isOwnedBy(source.getControllerId()) && game.getState().getZone(cardId) == Zone.GRAVEYARD) { toHand.add(card); } } diff --git a/Mage.Sets/src/mage/cards/g/GenerousPatron.java b/Mage.Sets/src/mage/cards/g/GenerousPatron.java index 87cefacb22..ccbfaa4035 100644 --- a/Mage.Sets/src/mage/cards/g/GenerousPatron.java +++ b/Mage.Sets/src/mage/cards/g/GenerousPatron.java @@ -62,7 +62,7 @@ class GenerousPatronTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (!getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if (!isControlledBy(game.getControllerId(event.getSourceId()))) { return false; } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); @@ -71,7 +71,7 @@ class GenerousPatronTriggeredAbility extends TriggeredAbilityImpl { } return permanent != null && permanent.isCreature() - && !permanent.getControllerId().equals(getControllerId()); + && !permanent.isControlledBy(getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/g/GideonJura.java b/Mage.Sets/src/mage/cards/g/GideonJura.java index 1e1c44adab..2edb2813cb 100644 --- a/Mage.Sets/src/mage/cards/g/GideonJura.java +++ b/Mage.Sets/src/mage/cards/g/GideonJura.java @@ -122,7 +122,7 @@ class GideonJuraEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getControllerId().equals(source.getFirstTarget()); + return permanent.isControlledBy(source.getFirstTarget()); } @Override diff --git a/Mage.Sets/src/mage/cards/g/GideonsIntervention.java b/Mage.Sets/src/mage/cards/g/GideonsIntervention.java index 1c6d51538f..91e539b291 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsIntervention.java +++ b/Mage.Sets/src/mage/cards/g/GideonsIntervention.java @@ -139,7 +139,7 @@ class GideonsInterventionPreventAllDamageEffect extends PreventionEffectImpl { || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER))) { if (object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY)) && (event.getTargetId().equals(source.getControllerId()) - || targetPerm != null && targetPerm.getControllerId().equals(source.getControllerId()))) { + || targetPerm != null && targetPerm.isControlledBy(source.getControllerId()))) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java b/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java index 29578aca46..79dd93dfd9 100644 --- a/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java +++ b/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java @@ -106,7 +106,7 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl { case DAMAGE_PLANESWALKER: Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (permanent.getControllerId().equals(source.getControllerId())) { + if (permanent.isControlledBy(source.getControllerId())) { preventDamage(event, source, permanent.getId(), game); } else if (game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) { event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount())); diff --git a/Mage.Sets/src/mage/cards/g/GladehartCavalry.java b/Mage.Sets/src/mage/cards/g/GladehartCavalry.java index 08a97e5be1..df612eb6e0 100644 --- a/Mage.Sets/src/mage/cards/g/GladehartCavalry.java +++ b/Mage.Sets/src/mage/cards/g/GladehartCavalry.java @@ -74,7 +74,7 @@ class GladehartCavalryTriggeredAbility extends TriggeredAbilityImpl { && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null - && permanent.getControllerId().equals(this.getControllerId()) + && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature() && permanent.getCounters(game).getCount(CounterType.P1P1) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/g/Gleancrawler.java b/Mage.Sets/src/mage/cards/g/Gleancrawler.java index 648dc92902..9b183e132c 100644 --- a/Mage.Sets/src/mage/cards/g/Gleancrawler.java +++ b/Mage.Sets/src/mage/cards/g/Gleancrawler.java @@ -82,7 +82,7 @@ class GleancrawlerEffect extends OneShotEffect { if (game.getState().getZoneChangeCounter(mor.getSourceId()) == mor.getZoneChangeCounter()) { Card card = game.getCard(mor.getSourceId()); if (card != null && card.isCreature() - && card.getOwnerId().equals(source.getControllerId())) { + && card.isOwnedBy(source.getControllerId())) { cardsToHand.add(card); } } diff --git a/Mage.Sets/src/mage/cards/g/GoblinRockSled.java b/Mage.Sets/src/mage/cards/g/GoblinRockSled.java index 15bc0cb8b6..fa2d9fd378 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinRockSled.java +++ b/Mage.Sets/src/mage/cards/g/GoblinRockSled.java @@ -95,7 +95,7 @@ class DontUntapIfAttackedLastTurnSourceEffect extends ContinuousRuleModifyingEff if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getTargetId().equals(source.getSourceId())) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.getControllerId().equals(game.getActivePlayerId())) { + if (permanent != null && permanent.isControlledBy(game.getActivePlayerId())) { AttackedLastTurnWatcher watcher = (AttackedLastTurnWatcher) game.getState().getWatchers().get(AttackedLastTurnWatcher.class.getSimpleName()); if (watcher != null) { Set attackingCreatures = watcher.getAttackedLastTurnCreatures(permanent.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/g/GoblinWarCry.java b/Mage.Sets/src/mage/cards/g/GoblinWarCry.java index f1e4518365..d4479c8475 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinWarCry.java +++ b/Mage.Sets/src/mage/cards/g/GoblinWarCry.java @@ -103,7 +103,7 @@ class GoblinWarCryRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getControllerId().equals(source.getFirstTarget())) { + if (permanent.isControlledBy(source.getFirstTarget())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/g/GoblinWelder.java b/Mage.Sets/src/mage/cards/g/GoblinWelder.java index a5eaa4a6b7..8df331165b 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinWelder.java +++ b/Mage.Sets/src/mage/cards/g/GoblinWelder.java @@ -75,7 +75,7 @@ public final class GoblinWelder extends CardImpl { && artifact.isArtifact() && card.isArtifact() && currentZone == Zone.GRAVEYARD - && card.getOwnerId().equals(artifact.getControllerId())) { + && card.isOwnedBy(artifact.getControllerId())) { boolean sacrifice = artifact.sacrifice(source.getSourceId(), game); boolean putOnBF = owner.moveCards(card, Zone.BATTLEFIELD, source, game); if (sacrifice || putOnBF) { diff --git a/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java b/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java index 0a426b135c..508844bc91 100644 --- a/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java +++ b/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java @@ -120,7 +120,7 @@ class GrandWarlordRadhaTriggeredAbility extends TriggeredAbilityImpl { Permanent creature = game.getPermanent(attacker); if (creature != null && creature.getControllerId() != null - && creature.getControllerId().equals(this.getControllerId())) { + && creature.isControlledBy(this.getControllerId())) { return true; } } @@ -157,7 +157,7 @@ class GrandWarlordRadhaEffect extends OneShotEffect { if (watcher != null) { int attackingCreatures = 0; for (MageObjectReference attacker : watcher.getAttackedThisTurnCreatures()) { - if (attacker.getPermanentOrLKIBattlefield(game).getControllerId().equals(controller.getId())) { + if (attacker.getPermanentOrLKIBattlefield(game).isControlledBy(controller.getId())) { attackingCreatures++; } } diff --git a/Mage.Sets/src/mage/cards/g/GratuitousViolence.java b/Mage.Sets/src/mage/cards/g/GratuitousViolence.java index 216a6ac592..b345c48d22 100644 --- a/Mage.Sets/src/mage/cards/g/GratuitousViolence.java +++ b/Mage.Sets/src/mage/cards/g/GratuitousViolence.java @@ -72,7 +72,7 @@ class GratuitousViolenceReplacementEffect extends ReplacementEffectImpl { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); return permanent != null && permanent.isCreature() - && permanent.getControllerId().equals(source.getControllerId()); + && permanent.isControlledBy(source.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java index 3fdc4bd5e8..888925283e 100644 --- a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java +++ b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java @@ -75,7 +75,7 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && !permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) { + if (permanent != null && !permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { Card card = (Card) game.getObject(permanent.getId()); if (card != null) { Effect effect = new GraveBetrayalEffect(); diff --git a/Mage.Sets/src/mage/cards/g/GravePact.java b/Mage.Sets/src/mage/cards/g/GravePact.java index 8898367c9b..c2dd2f4ee5 100644 --- a/Mage.Sets/src/mage/cards/g/GravePact.java +++ b/Mage.Sets/src/mage/cards/g/GravePact.java @@ -69,7 +69,7 @@ class GravePactTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) { + if (permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/Gravecrawler.java b/Mage.Sets/src/mage/cards/g/Gravecrawler.java index dd5154a31f..6c119740d8 100644 --- a/Mage.Sets/src/mage/cards/g/Gravecrawler.java +++ b/Mage.Sets/src/mage/cards/g/Gravecrawler.java @@ -75,7 +75,7 @@ class GravecrawlerPlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(source.getSourceId()) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) { Card card = game.getCard(source.getSourceId()); if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { diff --git a/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java b/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java index d590639155..0323b7d343 100644 --- a/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java +++ b/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java @@ -86,7 +86,7 @@ class GreatbowDoyenTriggeredAbility extends TriggeredAbilityImpl { if (creature != null && damagedCreature != null && creature.isCreature() && creature.hasSubtype(SubType.ARCHER, game) - && creature.getControllerId().equals(controllerId)) { + && creature.isControlledBy(controllerId)) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); this.getEffects().get(0).setValue("controller", damagedCreature.getControllerId()); this.getEffects().get(0).setValue("source", event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/g/GrenzoHavocRaiser.java b/Mage.Sets/src/mage/cards/g/GrenzoHavocRaiser.java index 674ef59bdd..f416760744 100644 --- a/Mage.Sets/src/mage/cards/g/GrenzoHavocRaiser.java +++ b/Mage.Sets/src/mage/cards/g/GrenzoHavocRaiser.java @@ -101,7 +101,7 @@ class GrenzoHavocRaiserTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (damagedPlayer != null && permanent != null && ((DamagedEvent) event).isCombatDamage() - && getControllerId().equals(permanent.getControllerId())) { + && isControlledBy(permanent.getControllerId())) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + damagedPlayer.getLogName() + " controls"); filter.add(new ControllerIdPredicate(damagedPlayer.getId())); this.getTargets().clear(); @@ -198,7 +198,7 @@ class GrenzoHavocRaiserCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(cardId) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(cardId) && source.isControlledBy(affectedControllerId)) { ExileZone exileZone = game.getState().getExile().getExileZone(exileId); return exileZone != null && exileZone.contains(cardId); } @@ -229,7 +229,7 @@ class GrenzoHavocRaiserSpendAnyManaEffect extends AsThoughEffectImpl implements @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget()) && ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId) && (((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)) diff --git a/Mage.Sets/src/mage/cards/g/GrinningTotem.java b/Mage.Sets/src/mage/cards/g/GrinningTotem.java index 37016ec834..910bc9034a 100644 --- a/Mage.Sets/src/mage/cards/g/GrinningTotem.java +++ b/Mage.Sets/src/mage/cards/g/GrinningTotem.java @@ -140,7 +140,7 @@ class GrinningTotemMayPlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && sourceId.equals(getTargetPointer().getFirst(game, source)); } diff --git a/Mage.Sets/src/mage/cards/g/GroundPounder.java b/Mage.Sets/src/mage/cards/g/GroundPounder.java index db43efdee4..dcfcf17eb3 100644 --- a/Mage.Sets/src/mage/cards/g/GroundPounder.java +++ b/Mage.Sets/src/mage/cards/g/GroundPounder.java @@ -106,7 +106,7 @@ class GroundPounderTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) { + if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) { if (event.getAmount() >= 5) { return true; } diff --git a/Mage.Sets/src/mage/cards/g/GruulRagebeast.java b/Mage.Sets/src/mage/cards/g/GruulRagebeast.java index f5da5a8ed2..7ac876b7ce 100644 --- a/Mage.Sets/src/mage/cards/g/GruulRagebeast.java +++ b/Mage.Sets/src/mage/cards/g/GruulRagebeast.java @@ -83,7 +83,7 @@ class GruulRagebeastTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { UUID targetId = event.getTargetId(); Permanent permanent = game.getPermanent(targetId); - if (permanent.getControllerId().equals(this.controllerId) + if (permanent.isControlledBy(this.controllerId) && permanent.isCreature() && (targetId.equals(this.getSourceId()) || !targetId.equals(this.getSourceId()))) { diff --git a/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java b/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java index 2a8076d669..a550fb2d67 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java +++ b/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java @@ -85,7 +85,7 @@ class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isLand() - && permanent.getControllerId().equals(getControllerId())) { + && permanent.isControlledBy(getControllerId())) { for (Effect effect : getEffects()) { if (effect instanceof GuardianOfTazeemEffect) { effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/g/Guile.java b/Mage.Sets/src/mage/cards/g/Guile.java index b30d1e541b..c641c4df14 100644 --- a/Mage.Sets/src/mage/cards/g/Guile.java +++ b/Mage.Sets/src/mage/cards/g/Guile.java @@ -107,6 +107,6 @@ class GuileReplacementEffect extends ReplacementEffectImpl { StackObject counteringObject = game.getStack().getStackObject(event.getSourceId()); return counteredSpell != null && counteringObject != null - && counteringObject.getControllerId().equals(source.getControllerId()); + && counteringObject.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/g/GutterGrime.java b/Mage.Sets/src/mage/cards/g/GutterGrime.java index 19985966de..28fa9508b3 100644 --- a/Mage.Sets/src/mage/cards/g/GutterGrime.java +++ b/Mage.Sets/src/mage/cards/g/GutterGrime.java @@ -73,7 +73,7 @@ class GutterGrimeTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = (Permanent) card; ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD - && permanent.getControllerId().equals(this.controllerId) + && permanent.isControlledBy(this.controllerId) && (targetId.equals(this.getSourceId()) || (permanent.isCreature() && !(permanent instanceof PermanentToken)))) { diff --git a/Mage.Sets/src/mage/cards/h/HaakonStromgaldScourge.java b/Mage.Sets/src/mage/cards/h/HaakonStromgaldScourge.java index bcf84ab249..edba324a79 100644 --- a/Mage.Sets/src/mage/cards/h/HaakonStromgaldScourge.java +++ b/Mage.Sets/src/mage/cards/h/HaakonStromgaldScourge.java @@ -156,7 +156,7 @@ class HaakonPlayKnightsFromGraveyardEffect extends AsThoughEffectImpl { Card knightToCast = game.getCard(objectId); if (knightToCast != null && knightToCast.hasSubtype(SubType.KNIGHT, game) - && knightToCast.getOwnerId().equals(source.getControllerId()) + && knightToCast.isOwnedBy(source.getControllerId()) && game.getState().getZone(objectId) == Zone.GRAVEYARD) { return true; } diff --git a/Mage.Sets/src/mage/cards/h/HallarTheFirefletcher.java b/Mage.Sets/src/mage/cards/h/HallarTheFirefletcher.java index 7ca188563c..8eb11c779a 100644 --- a/Mage.Sets/src/mage/cards/h/HallarTheFirefletcher.java +++ b/Mage.Sets/src/mage/cards/h/HallarTheFirefletcher.java @@ -81,7 +81,7 @@ class HallarTheFirefletcherTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getControllerId().equals(controllerId)) { + if (spell != null && spell.isControlledBy(controllerId)) { for (Ability ability : spell.getAbilities()) { if (ability instanceof KickerAbility && ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/h/HardenedBerserker.java b/Mage.Sets/src/mage/cards/h/HardenedBerserker.java index 80804e74ae..5793f80ee1 100644 --- a/Mage.Sets/src/mage/cards/h/HardenedBerserker.java +++ b/Mage.Sets/src/mage/cards/h/HardenedBerserker.java @@ -84,7 +84,7 @@ class HardenedBerserkerSpellsCostReductionEffect extends CostModificationEffectI } } if (abilityToModify instanceof SpellAbility) { - return abilityToModify.getControllerId().equals(source.getControllerId()); + return abilityToModify.isControlledBy(source.getControllerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/h/HardenedScales.java b/Mage.Sets/src/mage/cards/h/HardenedScales.java index 6e72fb04dc..ce764544f9 100644 --- a/Mage.Sets/src/mage/cards/h/HardenedScales.java +++ b/Mage.Sets/src/mage/cards/h/HardenedScales.java @@ -73,7 +73,7 @@ class HardenedScalesEffect extends ReplacementEffectImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) + if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature()) { return true; } diff --git a/Mage.Sets/src/mage/cards/h/HarmsWay.java b/Mage.Sets/src/mage/cards/h/HarmsWay.java index 3f0c5a544e..a6df836e32 100644 --- a/Mage.Sets/src/mage/cards/h/HarmsWay.java +++ b/Mage.Sets/src/mage/cards/h/HarmsWay.java @@ -86,7 +86,7 @@ class HarmsWayPreventDamageTargetEffect extends RedirectionEffect { // check permanent first Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (permanent.getControllerId().equals(source.getControllerId())) { + if (permanent.isControlledBy(source.getControllerId())) { // it's your permanent return true; } diff --git a/Mage.Sets/src/mage/cards/h/HavengulLich.java b/Mage.Sets/src/mage/cards/h/HavengulLich.java index b48b5bb0b6..8c1c4a4896 100644 --- a/Mage.Sets/src/mage/cards/h/HavengulLich.java +++ b/Mage.Sets/src/mage/cards/h/HavengulLich.java @@ -91,7 +91,7 @@ class HavengulLichPlayEffect extends AsThoughEffectImpl { UUID targetId = getTargetPointer().getFirst(game, source); if (targetId != null) { return targetId.equals(objectId) - && source.getControllerId().equals(affectedControllerId) + && source.isControlledBy(affectedControllerId) && Zone.GRAVEYARD == game.getState().getZone(objectId); } else { // the target card has changed zone meanwhile, so the effect is no longer needed diff --git a/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java b/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java index 602fc6d9b7..21d86be512 100644 --- a/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java +++ b/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java @@ -90,7 +90,7 @@ class HedronFieldPuristsEffect extends PreventionEffectImpl { if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/h/Hellrider.java b/Mage.Sets/src/mage/cards/h/Hellrider.java index 0de939add9..91ebfa5e2d 100644 --- a/Mage.Sets/src/mage/cards/h/Hellrider.java +++ b/Mage.Sets/src/mage/cards/h/Hellrider.java @@ -68,7 +68,7 @@ class HellriderTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent source = game.getPermanent(event.getSourceId()); - if (source != null && source.getControllerId().equals(controllerId)) { + if (source != null && source.isControlledBy(controllerId)) { UUID defendingPlayerId = game.getCombat().getDefenderId(event.getSourceId()); this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId)); return true; diff --git a/Mage.Sets/src/mage/cards/h/HeraldOfWar.java b/Mage.Sets/src/mage/cards/h/HeraldOfWar.java index c8e55bf6ba..4ab890792c 100644 --- a/Mage.Sets/src/mage/cards/h/HeraldOfWar.java +++ b/Mage.Sets/src/mage/cards/h/HeraldOfWar.java @@ -79,7 +79,7 @@ class HeraldOfWarCostReductionEffect extends CostModificationEffectImpl { public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { Card sourceCard = game.getCard(abilityToModify.getSourceId()); - if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.hasSubtype(SubType.ANGEL, game) || sourceCard.hasSubtype(SubType.HUMAN, game))) { + if (sourceCard != null && abilityToModify.isControlledBy(source.getControllerId()) && (sourceCard.hasSubtype(SubType.ANGEL, game) || sourceCard.hasSubtype(SubType.HUMAN, game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/h/HomewardPath.java b/Mage.Sets/src/mage/cards/h/HomewardPath.java index d4c99489ec..f6773fe963 100644 --- a/Mage.Sets/src/mage/cards/h/HomewardPath.java +++ b/Mage.Sets/src/mage/cards/h/HomewardPath.java @@ -89,7 +89,7 @@ class HomewardPathControlEffect extends ContinuousEffectImpl { for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { Permanent creature = it.next().getPermanent(game); if (creature != null) { - if (!creature.getControllerId().equals(creature.getOwnerId())) { + if (!creature.isControlledBy(creature.getOwnerId())) { creature.changeControllerId(creature.getOwnerId(), game); } } else { diff --git a/Mage.Sets/src/mage/cards/h/Hostility.java b/Mage.Sets/src/mage/cards/h/Hostility.java index 723b368c98..a9cfc57da2 100644 --- a/Mage.Sets/src/mage/cards/h/Hostility.java +++ b/Mage.Sets/src/mage/cards/h/Hostility.java @@ -86,7 +86,7 @@ class HostilityEffect extends PreventionEffectImpl { if (super.applies(event, source, game)) { if (game.getOpponents(source.getControllerId()).contains(event.getTargetId())) { Spell spell = game.getStack().getSpell(event.getSourceId()); - if (spell != null && spell.getControllerId().equals(source.getControllerId())) { + if (spell != null && spell.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/i/IcefallRegent.java b/Mage.Sets/src/mage/cards/i/IcefallRegent.java index 0280b8b847..8243899a55 100644 --- a/Mage.Sets/src/mage/cards/i/IcefallRegent.java +++ b/Mage.Sets/src/mage/cards/i/IcefallRegent.java @@ -111,7 +111,7 @@ class IcefallRegentEffect extends ContinuousRuleModifyingEffectImpl { // the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL // event will happen before this effect is applied ever) Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) { + if (sourcePermanent == null || !sourcePermanent.isControlledBy(source.getControllerId())) { discard(); return false; } diff --git a/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java b/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java index 1b76006a71..2a44a903b3 100644 --- a/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java +++ b/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java @@ -79,7 +79,7 @@ class IkraShidiqiTheUsurperTriggeredAbility extends TriggeredAbilityImpl { DamagedEvent damageEvent = (DamagedEvent) event; if (damageEvent.isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isCreature() && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent != null && permanent.isCreature() && permanent.isControlledBy(this.getControllerId())) { this.getEffects().clear(); this.getEffects().add(new GainLifeEffect(permanent.getToughness().getValue())); return true; diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java index e381280918..b624891e7a 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java @@ -180,7 +180,7 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect { } // planeswalker Permanent permanent = game.getPermanent(defenderId); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) + if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isPlaneswalker()) { return false; } diff --git a/Mage.Sets/src/mage/cards/i/Immerwolf.java b/Mage.Sets/src/mage/cards/i/Immerwolf.java index ea7c0b63dd..ebc726beb0 100644 --- a/Mage.Sets/src/mage/cards/i/Immerwolf.java +++ b/Mage.Sets/src/mage/cards/i/Immerwolf.java @@ -90,7 +90,7 @@ class ImmerwolfEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); return permanent != null && - permanent.getControllerId().equals(source.getControllerId()) && + permanent.isControlledBy(source.getControllerId()) && filter.match(permanent, game) ; } } diff --git a/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java b/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java index b9966b8a7e..33d22626e0 100644 --- a/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java +++ b/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java @@ -75,14 +75,14 @@ class IncreasingVengeanceEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null) { StackObject stackObjectCopy = spell.createCopyOnStack(game, source, source.getControllerId(), true); - if (stackObjectCopy != null && stackObjectCopy instanceof Spell) { + if (stackObjectCopy instanceof Spell) { game.informPlayers(new StringBuilder(controller.getLogName()).append(((Spell) stackObjectCopy).getActivatedMessage(game)).toString()); } Spell sourceSpell = (Spell) game.getStack().getStackObject(source.getSourceId()); if (sourceSpell != null) { if (sourceSpell.getFromZone() == Zone.GRAVEYARD) { stackObjectCopy = spell.createCopyOnStack(game, source, source.getControllerId(), true); - if (stackObjectCopy != null && stackObjectCopy instanceof Spell) { + if (stackObjectCopy instanceof Spell) { game.informPlayers(new StringBuilder(controller.getLogName()).append(((Spell) stackObjectCopy).getActivatedMessage(game)).toString()); } } diff --git a/Mage.Sets/src/mage/cards/i/InfectiousCurse.java b/Mage.Sets/src/mage/cards/i/InfectiousCurse.java index c1a5a54fdc..24418136a1 100644 --- a/Mage.Sets/src/mage/cards/i/InfectiousCurse.java +++ b/Mage.Sets/src/mage/cards/i/InfectiousCurse.java @@ -122,7 +122,7 @@ class InfectiousCurseCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (source.getControllerId().equals(abilityToModify.getControllerId())) { + if (source.isControlledBy(abilityToModify.getControllerId())) { for (UUID modeId : abilityToModify.getModes().getSelectedModes()) { Mode mode = abilityToModify.getModes().get(modeId); for (Target target : mode.getTargets()) { diff --git a/Mage.Sets/src/mage/cards/i/InfiniteReflection.java b/Mage.Sets/src/mage/cards/i/InfiniteReflection.java index 597a9f36ea..50643266ba 100644 --- a/Mage.Sets/src/mage/cards/i/InfiniteReflection.java +++ b/Mage.Sets/src/mage/cards/i/InfiniteReflection.java @@ -117,7 +117,7 @@ class InfiniteReflectionEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.getControllerId().equals(source.getControllerId()) + return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature() && !(permanent instanceof PermanentToken); } diff --git a/Mage.Sets/src/mage/cards/i/IreShaman.java b/Mage.Sets/src/mage/cards/i/IreShaman.java index cc7055ab6f..8d0cbda7bc 100644 --- a/Mage.Sets/src/mage/cards/i/IreShaman.java +++ b/Mage.Sets/src/mage/cards/i/IreShaman.java @@ -115,7 +115,7 @@ class IreShamanCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/i/IslandSanctuary.java b/Mage.Sets/src/mage/cards/i/IslandSanctuary.java index 6cec4f2d42..aabf94d689 100644 --- a/Mage.Sets/src/mage/cards/i/IslandSanctuary.java +++ b/Mage.Sets/src/mage/cards/i/IslandSanctuary.java @@ -81,7 +81,7 @@ class IslandSanctuaryEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()) && game.getTurn().getStepType() == PhaseStep.DRAW; + return source.isControlledBy(event.getPlayerId()) && game.getTurn().getStepType() == PhaseStep.DRAW; } @Override diff --git a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java index 639950af6b..ecd7273c35 100644 --- a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java +++ b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java @@ -242,7 +242,7 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); String playerName = new StringBuilder(player.getLogName()).append("'s").toString(); - if (source.getControllerId().equals(player.getId())) { + if (source.isControlledBy(player.getId())) { playerName = "your"; } TargetCardInLibrary target = new TargetCardInLibrary(new FilterNonlandCard(new StringBuilder("nonland card from ").append(playerName).append(" library").toString())); diff --git a/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java b/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java index 160baea076..e5b52f876d 100644 --- a/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java +++ b/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java @@ -112,7 +112,7 @@ class JaceCunningCastawayDamageTriggeredAbility extends DelayedTriggeredAbility if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId) + if (creature != null && creature.isControlledBy(controllerId) && !damagedPlayerIds.contains(event.getTargetId())) { damagedPlayerIds.add(event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java b/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java index f8076da878..5ea98a196f 100644 --- a/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java +++ b/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java @@ -83,7 +83,7 @@ class JarOfEyeballsTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) { + if (permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/j/Jokulmorder.java b/Mage.Sets/src/mage/cards/j/Jokulmorder.java index 5ce1975847..dfe4138831 100644 --- a/Mage.Sets/src/mage/cards/j/Jokulmorder.java +++ b/Mage.Sets/src/mage/cards/j/Jokulmorder.java @@ -86,7 +86,7 @@ class JokulmorderTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent land = game.getPermanent(event.getTargetId()); return land.hasSubtype(SubType.ISLAND, game) - && land.getControllerId().equals(this.controllerId); + && land.isControlledBy(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/cards/j/Juxtapose.java b/Mage.Sets/src/mage/cards/j/Juxtapose.java index 2adf2dfa6b..ecc6700268 100644 --- a/Mage.Sets/src/mage/cards/j/Juxtapose.java +++ b/Mage.Sets/src/mage/cards/j/Juxtapose.java @@ -97,7 +97,7 @@ class JuxtaposeEffect extends ContinuousEffectImpl { if (permanent1 != null && permanent2 != null) { // exchange works only for two different controllers - if (permanent1.getControllerId().equals(permanent2.getControllerId())) { + if (permanent1.isControlledBy(permanent2.getControllerId())) { // discard effect if controller of both permanents is the same discard(); return; diff --git a/Mage.Sets/src/mage/cards/k/KarnLiberated.java b/Mage.Sets/src/mage/cards/k/KarnLiberated.java index 5a4629551f..dc7a656eab 100644 --- a/Mage.Sets/src/mage/cards/k/KarnLiberated.java +++ b/Mage.Sets/src/mage/cards/k/KarnLiberated.java @@ -111,7 +111,7 @@ class KarnLiberatedEffect extends OneShotEffect { player.getHand().clear(); player.getLibrary().clear(); for (Card card : game.getCards()) { - if (card.getOwnerId().equals(player.getId()) && !card.isCopy() // no copies + if (card.isOwnedBy(player.getId()) && !card.isCopy() // no copies && !player.getSideboard().contains(card.getId()) && !cards.contains(card)) { // not the exiled cards if (player.getCommandersIds().contains(card.getId())) { diff --git a/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java b/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java index e9589ae460..7fc485e715 100644 --- a/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java +++ b/Mage.Sets/src/mage/cards/k/KarnScionOfUrza.java @@ -170,7 +170,7 @@ class KarnMinus1Effect extends OneShotEffect { Cards filteredCards = new CardsImpl(); for (Card exileCard : exile) { - if (exileCard.getOwnerId().equals(source.getControllerId()) && filter.match(exileCard, game)) { + if (exileCard.isOwnedBy(source.getControllerId()) && filter.match(exileCard, game)) { filteredCards.add(exileCard); } } diff --git a/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java b/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java index 636f40c80c..b338d4cf51 100644 --- a/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java +++ b/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java @@ -86,8 +86,8 @@ class KaronaFalseGodUntapGetControlEffect extends OneShotEffect { // remove old control effects of the same player for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof GainControlTargetEffect) { - UUID checkId = (UUID) ((GainControlTargetEffect) effect).getValue("KaronaFalseGodSourceId"); - UUID controllerId = (UUID) ((GainControlTargetEffect) effect).getValue("KaronaFalseGodControllerId"); + UUID checkId = (UUID) effect.getValue("KaronaFalseGodSourceId"); + UUID controllerId = (UUID) effect.getValue("KaronaFalseGodControllerId"); if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) { effect.discard(); } diff --git a/Mage.Sets/src/mage/cards/k/KarplusanMinotaur.java b/Mage.Sets/src/mage/cards/k/KarplusanMinotaur.java index f4ee2af344..eda2fdad62 100644 --- a/Mage.Sets/src/mage/cards/k/KarplusanMinotaur.java +++ b/Mage.Sets/src/mage/cards/k/KarplusanMinotaur.java @@ -103,7 +103,7 @@ class KarplusanMinotaurFlipWinTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return this.getControllerId().equals(event.getPlayerId()) && event.getFlag(); + return this.isControlledBy(event.getPlayerId()) && event.getFlag(); } @Override @@ -134,7 +134,7 @@ class KarplusanMinotaurFlipLoseTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return this.getControllerId().equals(event.getPlayerId()) && !event.getFlag(); + return this.isControlledBy(event.getPlayerId()) && !event.getFlag(); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java b/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java index b56ea5a3b0..53a780e8b8 100644 --- a/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java +++ b/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java @@ -87,7 +87,7 @@ class KazarovSengirPurebloodTriggeredAbility extends TriggeredAbilityImpl { if (permanent == null) { return false; } - if (permanent.getControllerId().equals(this.getControllerId())) { + if (permanent.isControlledBy(this.getControllerId())) { return false; } return true; diff --git a/Mage.Sets/src/mage/cards/k/KeeperOfTheDead.java b/Mage.Sets/src/mage/cards/k/KeeperOfTheDead.java index eadc6f82a7..3508e2839f 100644 --- a/Mage.Sets/src/mage/cards/k/KeeperOfTheDead.java +++ b/Mage.Sets/src/mage/cards/k/KeeperOfTheDead.java @@ -128,7 +128,7 @@ class KeeperOfTheDeadCreatureTarget extends TargetPermanent { public boolean canTarget(UUID id, Ability source, Game game) { UUID firstTarget = source.getFirstTarget(); Permanent permanent = game.getPermanent(id); - if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { + if (firstTarget != null && permanent != null && permanent.isControlledBy(firstTarget)) { return super.canTarget(id, source, game); } return false; @@ -153,7 +153,7 @@ class KeeperOfTheDeadCreatureTarget extends TargetPermanent { UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget(); for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if (permanent != null && nonblackCreaturefilter.match(permanent, game) && permanent.getControllerId().equals(playerId)) { + if (permanent != null && nonblackCreaturefilter.match(permanent, game) && permanent.isControlledBy(playerId)) { possibleTargets.add(targetId); } } diff --git a/Mage.Sets/src/mage/cards/k/KnacksawClique.java b/Mage.Sets/src/mage/cards/k/KnacksawClique.java index 9de1b132b8..1b3b488215 100644 --- a/Mage.Sets/src/mage/cards/k/KnacksawClique.java +++ b/Mage.Sets/src/mage/cards/k/KnacksawClique.java @@ -122,7 +122,7 @@ class KnacksawCliqueCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && sourceId.equals(getTargetPointer().getFirst(game, source)); } diff --git a/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java b/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java index 1faaa0d25d..482ed9506d 100644 --- a/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java +++ b/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java @@ -86,7 +86,7 @@ class BecomesMonarchTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkInterveningIfClause(Game game) { MonarchAtTurnStartWatcher watcher = (MonarchAtTurnStartWatcher) game.getState().getWatchers().get(MonarchAtTurnStartWatcher.class.getSimpleName()); - return watcher != null && getControllerId().equals(watcher.getMonarchIdAtTurnStart()); + return watcher != null && isControlledBy(watcher.getMonarchIdAtTurnStart()); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KopalaWardenOfWaves.java b/Mage.Sets/src/mage/cards/k/KopalaWardenOfWaves.java index 5f8dc1b441..738f2ffc63 100644 --- a/Mage.Sets/src/mage/cards/k/KopalaWardenOfWaves.java +++ b/Mage.Sets/src/mage/cards/k/KopalaWardenOfWaves.java @@ -93,7 +93,7 @@ class KopalaWardenOfWavesCostReductionEffect extends CostModificationEffectImpl Permanent creature = game.getPermanent(targetUUID); if (creature != null && filter.match(creature, game) - && creature.getControllerId().equals(source.getControllerId())) { + && creature.isControlledBy(source.getControllerId())) { return true; } } @@ -144,7 +144,7 @@ class KopalaWardenOfWavesCostReductionEffect2 extends CostModificationEffectImpl Permanent creature = game.getPermanent(targetUUID); if (creature != null && filter.match(creature, game) - && creature.getControllerId().equals(source.getControllerId())) { + && creature.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/k/KrarksOtherThumb.java b/Mage.Sets/src/mage/cards/k/KrarksOtherThumb.java index 1575db39a5..6001ec5599 100644 --- a/Mage.Sets/src/mage/cards/k/KrarksOtherThumb.java +++ b/Mage.Sets/src/mage/cards/k/KrarksOtherThumb.java @@ -82,7 +82,7 @@ class KrarksOtherThumbEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KrarksThumb.java b/Mage.Sets/src/mage/cards/k/KrarksThumb.java index 20a705b886..3acb3bde5a 100644 --- a/Mage.Sets/src/mage/cards/k/KrarksThumb.java +++ b/Mage.Sets/src/mage/cards/k/KrarksThumb.java @@ -74,7 +74,7 @@ class KrarksThumbEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/l/Larceny.java b/Mage.Sets/src/mage/cards/l/Larceny.java index 19279f5e72..297dd135e8 100644 --- a/Mage.Sets/src/mage/cards/l/Larceny.java +++ b/Mage.Sets/src/mage/cards/l/Larceny.java @@ -64,7 +64,7 @@ class LarcenyTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { for(Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); diff --git a/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java b/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java index 77a2b57084..994ea460f7 100644 --- a/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java +++ b/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java @@ -79,7 +79,7 @@ class LashknifeBarrierEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = game.getPermanent(event.getTargetId()); - return creature.getControllerId().equals(source.getControllerId()); + return creature.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/l/LeovoldEmissaryOfTrest.java b/Mage.Sets/src/mage/cards/l/LeovoldEmissaryOfTrest.java index cce548fd28..270e050053 100644 --- a/Mage.Sets/src/mage/cards/l/LeovoldEmissaryOfTrest.java +++ b/Mage.Sets/src/mage/cards/l/LeovoldEmissaryOfTrest.java @@ -109,7 +109,7 @@ class LeovoldEmissaryOfTrestTriggeredAbility extends TriggeredAbilityImpl { return true; // Player was targeted } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) { + if (permanent != null && this.isControlledBy(permanent.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/l/LightOfSanction.java b/Mage.Sets/src/mage/cards/l/LightOfSanction.java index c952814299..a097697568 100644 --- a/Mage.Sets/src/mage/cards/l/LightOfSanction.java +++ b/Mage.Sets/src/mage/cards/l/LightOfSanction.java @@ -56,13 +56,13 @@ class LightOfSanctionEffect 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())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { MageObject damageSource = game.getObject(event.getSourceId()); if (damageSource instanceof Controllable) { - return ((Controllable) damageSource).getControllerId().equals(source.getControllerId()); + return ((Controllable) damageSource).isControlledBy(source.getControllerId()); } else if (damageSource instanceof Card) { - return ((Card) damageSource).getOwnerId().equals(source.getControllerId()); + return ((Card) damageSource).isOwnedBy(source.getControllerId()); } } } diff --git a/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java b/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java index 5d8bb40b5a..6d569e1012 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java +++ b/Mage.Sets/src/mage/cards/l/LilianaUntouchedByDeath.java @@ -135,7 +135,7 @@ class LilianaUntouchedByDeathGraveyardEffect extends AsThoughEffectImpl { Card card = game.getCard(objectId); if (card != null && card.hasSubtype(SubType.ZOMBIE, game) - && card.getOwnerId().equals(source.getControllerId()) + && card.isOwnedBy(source.getControllerId()) && game.getState().getZone(objectId) == Zone.GRAVEYARD) { return true; } diff --git a/Mage.Sets/src/mage/cards/l/LilianasContract.java b/Mage.Sets/src/mage/cards/l/LilianasContract.java index e11a5d929f..a568b0a855 100644 --- a/Mage.Sets/src/mage/cards/l/LilianasContract.java +++ b/Mage.Sets/src/mage/cards/l/LilianasContract.java @@ -70,7 +70,7 @@ enum LilianasContractCondition implements Condition { Set demonNames = new HashSet(); for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent == null - || !permanent.getControllerId().equals(source.getControllerId()) + || !permanent.isControlledBy(source.getControllerId()) || !permanent.hasSubtype(SubType.DEMON, game)) { continue; } diff --git a/Mage.Sets/src/mage/cards/l/LoamingShaman.java b/Mage.Sets/src/mage/cards/l/LoamingShaman.java index d31cd699bf..e9ed578b3f 100644 --- a/Mage.Sets/src/mage/cards/l/LoamingShaman.java +++ b/Mage.Sets/src/mage/cards/l/LoamingShaman.java @@ -99,10 +99,10 @@ class LoamingShamanTargetCardsInGraveyard extends TargetCardInGraveyard { if (firstTarget != null) { Card card = game.getCard(firstTarget); if (card == null || targetCard == null - || !card.getOwnerId().equals(targetCard.getOwnerId())) { + || !card.isOwnedBy(targetCard.getOwnerId())) { return false; } - } else if (targetCard == null || !targetCard.getOwnerId().equals(targetPlayerId)) { + } else if (targetCard == null || !targetCard.isOwnedBy(targetPlayerId)) { return false; } return super.canTarget(id, source, game); diff --git a/Mage.Sets/src/mage/cards/l/LocketOfYesterdays.java b/Mage.Sets/src/mage/cards/l/LocketOfYesterdays.java index 8c649f6fcf..e987b48df8 100644 --- a/Mage.Sets/src/mage/cards/l/LocketOfYesterdays.java +++ b/Mage.Sets/src/mage/cards/l/LocketOfYesterdays.java @@ -70,7 +70,7 @@ class LocketOfYesterdaysCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getControllerId().equals(source.getControllerId()) + if (abilityToModify.isControlledBy(source.getControllerId()) && (abilityToModify instanceof SpellAbility)) { return true; } diff --git a/Mage.Sets/src/mage/cards/l/LuminatePrimordial.java b/Mage.Sets/src/mage/cards/l/LuminatePrimordial.java index d5df07c0b8..ce678715e6 100644 --- a/Mage.Sets/src/mage/cards/l/LuminatePrimordial.java +++ b/Mage.Sets/src/mage/cards/l/LuminatePrimordial.java @@ -88,7 +88,7 @@ class LuminatePrimordialEffect extends OneShotEffect { for (Target target: source.getTargets()) { if (target instanceof TargetCreaturePermanent) { Permanent targetCreature = game.getPermanent(target.getFirstTarget()); - if (targetCreature != null && !targetCreature.getControllerId().equals(source.getControllerId())) { + if (targetCreature != null && !targetCreature.isControlledBy(source.getControllerId())) { int amountLife = targetCreature.getPower().getValue(); Player controller = game.getPlayer(targetCreature.getControllerId()); targetCreature.moveToExile(null, null, source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/m/MaelstromNexus.java b/Mage.Sets/src/mage/cards/m/MaelstromNexus.java index 73ed90b41e..c88f8d523c 100644 --- a/Mage.Sets/src/mage/cards/m/MaelstromNexus.java +++ b/Mage.Sets/src/mage/cards/m/MaelstromNexus.java @@ -67,7 +67,7 @@ class MaelstromNexusGainCascadeFirstSpellEffect extends ContinuousEffectImpl { if (controller != null) { for (StackObject stackObject : game.getStack()) { // only spells cast, so no copies of spells - if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { + if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get(FirstSpellCastThisTurnWatcher.class.getSimpleName()); if (watcher != null && spell.getId().equals(watcher.getIdOfFirstCastSpell(source.getControllerId()))) { diff --git a/Mage.Sets/src/mage/cards/m/MagusOfTheWill.java b/Mage.Sets/src/mage/cards/m/MagusOfTheWill.java index 604ffe0b41..e56c7ef98e 100644 --- a/Mage.Sets/src/mage/cards/m/MagusOfTheWill.java +++ b/Mage.Sets/src/mage/cards/m/MagusOfTheWill.java @@ -137,9 +137,9 @@ class MagusOfTheWillReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getOwnerId().equals(source.getControllerId())) { + if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (permanent == null || !(permanent instanceof PermanentToken)) { + if (!(permanent instanceof PermanentToken)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java b/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java index b7c5cccbfb..67c5e5e20c 100644 --- a/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java +++ b/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java @@ -81,7 +81,7 @@ class CopySourceSpellEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { StackObject stackObjectCopy = spell.createCopyOnStack(game, source, source.getControllerId(), true); - if (stackObjectCopy != null && stackObjectCopy instanceof Spell) { + if (stackObjectCopy instanceof Spell) { String activateMessage = ((Spell) stackObjectCopy).getActivatedMessage(game); if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); diff --git a/Mage.Sets/src/mage/cards/m/Manaplasm.java b/Mage.Sets/src/mage/cards/m/Manaplasm.java index d3fab12d96..26e2373708 100644 --- a/Mage.Sets/src/mage/cards/m/Manaplasm.java +++ b/Mage.Sets/src/mage/cards/m/Manaplasm.java @@ -67,7 +67,7 @@ class ManaplasmAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getControllerId().equals(controllerId)) { + if (spell != null && spell.isControlledBy(controllerId)) { this.getEffects().remove(0); int x = spell.getConvertedManaCost(); this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/cards/m/MangarasTome.java b/Mage.Sets/src/mage/cards/m/MangarasTome.java index 0d92198f56..c46179ffc4 100644 --- a/Mage.Sets/src/mage/cards/m/MangarasTome.java +++ b/Mage.Sets/src/mage/cards/m/MangarasTome.java @@ -123,6 +123,6 @@ class MangarasTomeReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/m/MarangRiverProwler.java b/Mage.Sets/src/mage/cards/m/MarangRiverProwler.java index 1e7591a456..e03922c936 100644 --- a/Mage.Sets/src/mage/cards/m/MarangRiverProwler.java +++ b/Mage.Sets/src/mage/cards/m/MarangRiverProwler.java @@ -89,7 +89,7 @@ class MarangRiverProwlerCastEffect extends AsThoughEffectImpl { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null - && card.getOwnerId().equals(affectedControllerId) + && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD && game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/m/MarchOfTheDroids.java b/Mage.Sets/src/mage/cards/m/MarchOfTheDroids.java index 6a07b61fa9..5e31a472b5 100644 --- a/Mage.Sets/src/mage/cards/m/MarchOfTheDroids.java +++ b/Mage.Sets/src/mage/cards/m/MarchOfTheDroids.java @@ -69,7 +69,7 @@ class MarchOfTheDroidsEffect extends OneShotEffect { if (controller != null) { Cards cardsToReturn = new CardsImpl(); for (Card card : controller.getGraveyard().getCards(game)) { - if (card.getOwnerId().equals(controller.getId()) && card.getCounters(game).getCount(CounterType.REPAIR) > 0) { + if (card.isOwnedBy(controller.getId()) && card.getCounters(game).getCount(CounterType.REPAIR) > 0) { int number = card.getCounters(game).getCount(CounterType.REPAIR); if (number > 0) { cardsToReturn.add(card); diff --git a/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java b/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java index 6617f13762..1dc83d372b 100644 --- a/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java +++ b/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java @@ -89,7 +89,7 @@ class MarchesaTheBlackRoseTriggeredAbility extends TriggeredAbilityImpl { && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null - && permanent.getControllerId().equals(this.getControllerId()) + && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature() && permanent.getCounters(game).getCount(CounterType.P1P1) > 0) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/m/MartyrsBond.java b/Mage.Sets/src/mage/cards/m/MartyrsBond.java index cebfff601b..930d3670c1 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrsBond.java +++ b/Mage.Sets/src/mage/cards/m/MartyrsBond.java @@ -74,7 +74,7 @@ class MartyrsBondTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent.getControllerId().equals(this.getControllerId()) && !permanent.isLand()) { + if (permanent.isControlledBy(this.getControllerId()) && !permanent.isLand()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent.getId())); } diff --git a/Mage.Sets/src/mage/cards/m/MasakoTheHumorless.java b/Mage.Sets/src/mage/cards/m/MasakoTheHumorless.java index e4ef412e4c..1ab1ddf350 100644 --- a/Mage.Sets/src/mage/cards/m/MasakoTheHumorless.java +++ b/Mage.Sets/src/mage/cards/m/MasakoTheHumorless.java @@ -68,7 +68,7 @@ class BlockTappedEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { Permanent permanent = game.getPermanent(sourceId); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/m/MasterBiomancer.java b/Mage.Sets/src/mage/cards/m/MasterBiomancer.java index 7b1ca8c4a8..79f1c60538 100644 --- a/Mage.Sets/src/mage/cards/m/MasterBiomancer.java +++ b/Mage.Sets/src/mage/cards/m/MasterBiomancer.java @@ -66,7 +66,7 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + return creature != null && creature.isControlledBy(source.getControllerId()) && creature.isCreature() && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/m/MavrenFeinDuskApostle.java b/Mage.Sets/src/mage/cards/m/MavrenFeinDuskApostle.java index d85d9d5546..a0b101ebcb 100644 --- a/Mage.Sets/src/mage/cards/m/MavrenFeinDuskApostle.java +++ b/Mage.Sets/src/mage/cards/m/MavrenFeinDuskApostle.java @@ -83,7 +83,7 @@ class MavrenFeinDuskApostleTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { for (UUID creatureId : game.getCombat().getAttackers()) { Permanent creature = game.getPermanent(creatureId); - if (creature != null && filter.match(creature, game) && creature.getControllerId().equals(controllerId)) { + if (creature != null && filter.match(creature, game) && creature.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java b/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java index a407ae3294..8d6dd6cd67 100644 --- a/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java +++ b/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java @@ -93,7 +93,7 @@ class MelekIzzetParagonTriggeredAbility extends TriggeredAbilityImpl { if (event.getZone() == Zone.LIBRARY) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null - && spell.getOwnerId().equals(super.getControllerId()) + && spell.isOwnedBy(super.getControllerId()) && (spell.isInstant() || spell.isSorcery())) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java b/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java index d83881a5f5..d3d868a2e2 100644 --- a/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java +++ b/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java @@ -121,7 +121,7 @@ class MeliraSylvokOutcastEffect2 extends ReplacementEffectImpl { if (perm == null) { perm = game.getPermanentEntering(event.getTargetId()); } - if (perm != null && perm.isCreature() && perm.getControllerId().equals(source.getControllerId())) { + if (perm != null && perm.isCreature() && perm.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MemoryCrystal.java b/Mage.Sets/src/mage/cards/m/MemoryCrystal.java index 961c67224f..2da9818be4 100644 --- a/Mage.Sets/src/mage/cards/m/MemoryCrystal.java +++ b/Mage.Sets/src/mage/cards/m/MemoryCrystal.java @@ -74,7 +74,7 @@ class MemoryCrystalSpellsCostReductionEffect extends CostModificationEffectImpl @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { if (BuybackCondition.instance.apply(game, abilityToModify)) { diff --git a/Mage.Sets/src/mage/cards/m/MetallicMimic.java b/Mage.Sets/src/mage/cards/m/MetallicMimic.java index 28105b9f4d..8788555ab1 100644 --- a/Mage.Sets/src/mage/cards/m/MetallicMimic.java +++ b/Mage.Sets/src/mage/cards/m/MetallicMimic.java @@ -75,7 +75,7 @@ class MetallicMimicReplacementEffect extends ReplacementEffectImpl { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent enteringCreature = ((EntersTheBattlefieldEvent) event).getTarget(); if (enteringCreature != null && sourcePermanent != null - && enteringCreature.getControllerId().equals(source.getControllerId()) + && enteringCreature.isControlledBy(source.getControllerId()) && enteringCreature.isCreature() && !event.getTargetId().equals(source.getSourceId())) { SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/m/MidnightOil.java b/Mage.Sets/src/mage/cards/m/MidnightOil.java index 3dd316efc8..954d340896 100644 --- a/Mage.Sets/src/mage/cards/m/MidnightOil.java +++ b/Mage.Sets/src/mage/cards/m/MidnightOil.java @@ -87,10 +87,8 @@ class MidnightOilTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(event.getPlayerId())) { - return true; - } - return false; + return isControlledBy(event.getPlayerId()); + } @Override diff --git a/Mage.Sets/src/mage/cards/m/MightMakesRight.java b/Mage.Sets/src/mage/cards/m/MightMakesRight.java index cc8c4333da..9b293c50e4 100644 --- a/Mage.Sets/src/mage/cards/m/MightMakesRight.java +++ b/Mage.Sets/src/mage/cards/m/MightMakesRight.java @@ -82,7 +82,7 @@ enum ControlsEachCreatureWithGreatestPowerCondition implements Condition { result = true; } if (power == maxPower) { - result &= permanent.getControllerId().equals(source.getControllerId()); + result &= permanent.isControlledBy(source.getControllerId()); } } return result; diff --git a/Mage.Sets/src/mage/cards/m/Mindswipe.java b/Mage.Sets/src/mage/cards/m/Mindswipe.java index cda1df94a9..fbfa217fd3 100644 --- a/Mage.Sets/src/mage/cards/m/Mindswipe.java +++ b/Mage.Sets/src/mage/cards/m/Mindswipe.java @@ -70,7 +70,7 @@ class MindswipeEffect extends OneShotEffect { if (object == null) { object = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK); } - if (object != null && object instanceof Spell) { + if (object instanceof Spell) { Spell spell = (Spell) object; Player spellController = game.getPlayer(spell.getControllerId()); if (spellController != null) { diff --git a/Mage.Sets/src/mage/cards/m/Mirari.java b/Mage.Sets/src/mage/cards/m/Mirari.java index bdace8ebf8..0c0b0fe580 100644 --- a/Mage.Sets/src/mage/cards/m/Mirari.java +++ b/Mage.Sets/src/mage/cards/m/Mirari.java @@ -92,7 +92,7 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null - && (spell.getControllerId().equals(this.getControllerId())) + && (spell.isControlledBy(this.getControllerId())) && (spell.isInstant() || spell.isSorcery()); } diff --git a/Mage.Sets/src/mage/cards/m/MirrorMatch.java b/Mage.Sets/src/mage/cards/m/MirrorMatch.java index f3bfc7ae93..895f00a1ca 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorMatch.java +++ b/Mage.Sets/src/mage/cards/m/MirrorMatch.java @@ -70,7 +70,7 @@ class MirrorMatchEffect extends OneShotEffect { for (UUID attackerId : game.getCombat().getAttackers()) { Permanent attacker = game.getPermanent(attackerId); if (attacker != null - && source.getControllerId().equals(game.getCombat().getDefendingPlayerId(attackerId, game))) { + && source.isControlledBy(game.getCombat().getDefendingPlayerId(attackerId, game))) { CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, false); effect.setTargetPointer(new FixedTarget(attacker, game)); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/m/MirrorOfFate.java b/Mage.Sets/src/mage/cards/m/MirrorOfFate.java index f66350bffe..bc8bd0e12f 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorOfFate.java +++ b/Mage.Sets/src/mage/cards/m/MirrorOfFate.java @@ -134,7 +134,7 @@ class MirrorOfFateTarget extends TargetCardInExile { @Override public boolean canTarget(UUID id, Ability source, Game game) { Card card = game.getCard(id); - if (card != null && card.getOwnerId().equals(source.getControllerId()) + if (card != null && card.isOwnedBy(source.getControllerId()) && game.getState().getZone(card.getId()) == Zone.EXILED) { for (ExileZone exile : game.getExile().getExileZones()) { if (exile != null && exile.contains(id)) { diff --git a/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java b/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java index d91e782b5b..73e4af0c51 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java +++ b/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java @@ -153,7 +153,7 @@ class MirrorwingDragonCopySpellEffect extends CopySpellForEachItCouldTargetEffec @Override protected boolean okUUIDToCopyFor(UUID potentialTarget, Game game, Ability source, Spell spell) { Permanent permanent = game.getPermanent(potentialTarget); - if (permanent == null || !permanent.getControllerId().equals(spell.getControllerId())) { + if (permanent == null || !permanent.isControlledBy(spell.getControllerId())) { return false; } return true; diff --git a/Mage.Sets/src/mage/cards/m/MisthollowGriffin.java b/Mage.Sets/src/mage/cards/m/MisthollowGriffin.java index cc59223b76..decac80309 100644 --- a/Mage.Sets/src/mage/cards/m/MisthollowGriffin.java +++ b/Mage.Sets/src/mage/cards/m/MisthollowGriffin.java @@ -72,7 +72,7 @@ class MisthollowGriffinPlayEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); - if (card != null && card.getOwnerId().equals(affectedControllerId) + if (card != null && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.EXILED) { return true; } diff --git a/Mage.Sets/src/mage/cards/m/MizzixOfTheIzmagnus.java b/Mage.Sets/src/mage/cards/m/MizzixOfTheIzmagnus.java index c5de6457ea..4a598ae096 100644 --- a/Mage.Sets/src/mage/cards/m/MizzixOfTheIzmagnus.java +++ b/Mage.Sets/src/mage/cards/m/MizzixOfTheIzmagnus.java @@ -107,7 +107,7 @@ class MizzixOfTheIzmagnusCostReductionEffect extends CostModificationEffectImpl @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify instanceof SpellAbility && abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { return StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(spell, source.getSourceId(), source.getControllerId(), game); diff --git a/Mage.Sets/src/mage/cards/m/MonasterySiege.java b/Mage.Sets/src/mage/cards/m/MonasterySiege.java index 089a158384..c2257a5c9d 100644 --- a/Mage.Sets/src/mage/cards/m/MonasterySiege.java +++ b/Mage.Sets/src/mage/cards/m/MonasterySiege.java @@ -90,7 +90,7 @@ class MonasterySiegeCostIncreaseEffect extends CostModificationEffectImpl { return true; } Permanent permanent = game.getPermanent(targetUUID); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java index bc84efc939..dfd13e4590 100644 --- a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java +++ b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java @@ -84,8 +84,8 @@ class MuldrothaTheGravetideCastFromGraveyardEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - if (source.getControllerId().equals(affectedControllerId) - && source.getControllerId().equals(game.getOwnerId(objectId)) // only from your graveyard + if (source.isControlledBy(affectedControllerId) + && source.isControlledBy(game.getOwnerId(objectId)) // only from your graveyard && affectedControllerId.equals(game.getActivePlayerId()) // only during your turns (e.g. prevent flash creatures) && Zone.GRAVEYARD.equals(game.getState().getZone(objectId))) { MuldrothaTheGravetideWatcher watcher = (MuldrothaTheGravetideWatcher) game.getState().getWatchers().get(MuldrothaTheGravetideWatcher.class.getSimpleName()); diff --git a/Mage.Sets/src/mage/cards/m/MycoidShepherd.java b/Mage.Sets/src/mage/cards/m/MycoidShepherd.java index 2e00d71e7e..ae18362969 100644 --- a/Mage.Sets/src/mage/cards/m/MycoidShepherd.java +++ b/Mage.Sets/src/mage/cards/m/MycoidShepherd.java @@ -75,7 +75,7 @@ class MycoidShepherdTriggeredAbility extends TriggeredAbilityImpl { } if (super.getSourceId().equals(event.getTargetId()) || permanent.getPower().getValue() > 4 - && permanent.getControllerId().equals(controllerId)) { + && permanent.isControlledBy(controllerId)) { Zone after = game.getState().getZone(event.getTargetId()); return after != null && Zone.GRAVEYARD.match(after); } diff --git a/Mage.Sets/src/mage/cards/n/NabanDeanOfIteration.java b/Mage.Sets/src/mage/cards/n/NabanDeanOfIteration.java index 3a7b63ae63..be2690ceb5 100644 --- a/Mage.Sets/src/mage/cards/n/NabanDeanOfIteration.java +++ b/Mage.Sets/src/mage/cards/n/NabanDeanOfIteration.java @@ -74,7 +74,7 @@ class NabanDeanOfIterationEffect extends ReplacementEffectImpl { if (event instanceof NumberOfTriggersEvent) { NumberOfTriggersEvent numberOfTriggersEvent = (NumberOfTriggersEvent) event; // Only triggers of the controller of Naban - if (source.getControllerId().equals(event.getPlayerId())) { + if (source.isControlledBy(event.getPlayerId())) { GameEvent sourceEvent = numberOfTriggersEvent.getSourceEvent(); // Only EtB triggers if (sourceEvent != null diff --git a/Mage.Sets/src/mage/cards/n/NaturesWill.java b/Mage.Sets/src/mage/cards/n/NaturesWill.java index 2aec1b05d6..f96bc4b006 100644 --- a/Mage.Sets/src/mage/cards/n/NaturesWill.java +++ b/Mage.Sets/src/mage/cards/n/NaturesWill.java @@ -63,7 +63,7 @@ class NaturesWillEffect extends OneShotEffect { for (Permanent land : lands) { if (damagedPlayers.contains(land.getControllerId())) { land.tap(game); - } else if (land.getControllerId().equals(source.getControllerId())) { + } else if (land.isControlledBy(source.getControllerId())) { land.untap(game); } } diff --git a/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java b/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java index 7ec8e35d05..168c633cb7 100644 --- a/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java +++ b/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java @@ -113,7 +113,7 @@ class NecromancersMagemarkEffect extends ReplacementEffectImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { for (UUID attachmentId : permanent.getAttachments()) { Permanent attachment = game.getPermanentOrLKIBattlefield(attachmentId); if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) { diff --git a/Mage.Sets/src/mage/cards/n/NecropolisRegent.java b/Mage.Sets/src/mage/cards/n/NecropolisRegent.java index d7a628de3d..5e53ec1011 100644 --- a/Mage.Sets/src/mage/cards/n/NecropolisRegent.java +++ b/Mage.Sets/src/mage/cards/n/NecropolisRegent.java @@ -76,7 +76,7 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { this.getEffects().clear(); Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount())); effect.setTargetPointer(new FixedTarget(creature.getId())); diff --git a/Mage.Sets/src/mage/cards/n/Necropotence.java b/Mage.Sets/src/mage/cards/n/Necropotence.java index 8a7372a4b2..3c1cc4bf28 100644 --- a/Mage.Sets/src/mage/cards/n/Necropotence.java +++ b/Mage.Sets/src/mage/cards/n/Necropotence.java @@ -79,7 +79,7 @@ class NecropotenceTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(event.getPlayerId())) { + if (isControlledBy(event.getPlayerId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/n/NestOfScarabs.java b/Mage.Sets/src/mage/cards/n/NestOfScarabs.java index c5d031e637..2086264318 100644 --- a/Mage.Sets/src/mage/cards/n/NestOfScarabs.java +++ b/Mage.Sets/src/mage/cards/n/NestOfScarabs.java @@ -56,7 +56,7 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - boolean weAreDoingIt = getControllerId().equals(game.getControllerId(event.getSourceId())); + boolean weAreDoingIt = isControlledBy(game.getControllerId(event.getSourceId())); boolean isM1M1Counters = event.getData().equals(CounterType.M1M1.getName()); if (weAreDoingIt && isM1M1Counters && event.getAmount() > 0) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); diff --git a/Mage.Sets/src/mage/cards/n/NetherTraitor.java b/Mage.Sets/src/mage/cards/n/NetherTraitor.java index e790731580..e7d2ab58ac 100644 --- a/Mage.Sets/src/mage/cards/n/NetherTraitor.java +++ b/Mage.Sets/src/mage/cards/n/NetherTraitor.java @@ -81,7 +81,7 @@ class NetherTraitorTriggeredAbility extends TriggeredAbilityImpl { } if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { if (zEvent.getTarget() != null && - zEvent.getTarget().getOwnerId().equals(this.getControllerId()) && + zEvent.getTarget().isOwnedBy(this.getControllerId()) && zEvent.getTarget().isCreature()&& !zEvent.getTarget().getId().equals(this.getSourceId())) { return true; diff --git a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java index 6ccaafd97b..895ef5405c 100644 --- a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java +++ b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java @@ -91,7 +91,7 @@ class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; Permanent permanent = zEvent.getTarget(); if (permanent != null - && permanent.getOwnerId().equals(this.controllerId) + && permanent.isOwnedBy(this.controllerId) && zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD && !(permanent instanceof PermanentToken) diff --git a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java index 38aa79dcba..f9bbf4d741 100644 --- a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java +++ b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java @@ -112,7 +112,7 @@ class NivixAerieOfTheFiremindCanCastEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(this.getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java b/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java index dcf415c54e..063f4958cb 100644 --- a/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java +++ b/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java @@ -67,7 +67,7 @@ class NoRestForTheWickedEffect extends OneShotEffect { if (c != null) { if (game.getState().getZone(cardId) == Zone.GRAVEYARD && c.isCreature() - && c.getOwnerId().equals(source.getControllerId())) { + && c.isOwnedBy(source.getControllerId())) { cardsToHand.add(c); } } diff --git a/Mage.Sets/src/mage/cards/n/NoblePurpose.java b/Mage.Sets/src/mage/cards/n/NoblePurpose.java index e2df397cd8..6fce1fb36f 100644 --- a/Mage.Sets/src/mage/cards/n/NoblePurpose.java +++ b/Mage.Sets/src/mage/cards/n/NoblePurpose.java @@ -66,7 +66,7 @@ class NoblePurposeTriggeredAbility extends TriggeredAbilityImpl { if (damageEvent.isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null && permanent.isCreature() - && permanent.getControllerId().equals(this.getControllerId())) { + && permanent.isControlledBy(this.getControllerId())) { this.getEffects().clear(); this.getEffects().add(new GainLifeEffect(damageEvent.getAmount())); return true; diff --git a/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java b/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java index 5c0ab9a662..740bd42953 100644 --- a/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java +++ b/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java @@ -94,7 +94,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { for (Target target : objectTargets) { for (UUID targetId : target.getTargets()) { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); - if (targetedPermanent != null && targetedPermanent.getControllerId().equals(sourceControllerId)) { + if (targetedPermanent != null && targetedPermanent.isControlledBy(sourceControllerId)) { return true; } } @@ -121,7 +121,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { for (Target target : objectTargets) { for (UUID targetId : target.getTargets()) { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); - if (targetedPermanent != null && targetedPermanent.getControllerId().equals(sourceControllerId)) { + if (targetedPermanent != null && targetedPermanent.isControlledBy(sourceControllerId)) { possibleTargets.add(stackObject.getId()); } } diff --git a/Mage.Sets/src/mage/cards/o/OathOfGideon.java b/Mage.Sets/src/mage/cards/o/OathOfGideon.java index dbc04025c0..255862c77e 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfGideon.java +++ b/Mage.Sets/src/mage/cards/o/OathOfGideon.java @@ -63,7 +63,7 @@ class OathOfGideonReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + return creature != null && creature.isControlledBy(source.getControllerId()) && creature.isPlaneswalker() && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/o/OathOfNissa.java b/Mage.Sets/src/mage/cards/o/OathOfNissa.java index ce7ead3c27..514e75cb56 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfNissa.java +++ b/Mage.Sets/src/mage/cards/o/OathOfNissa.java @@ -128,7 +128,7 @@ class OathOfNissaSpendAnyManaEffect extends AsThoughEffectImpl implements AsThou @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - if (source.getControllerId().equals(affectedControllerId)) { + if (source.isControlledBy(affectedControllerId)) { MageObject mageObject = game.getObject(objectId); if (mageObject != null) { if (mageObject.isPlaneswalker()) { diff --git a/Mage.Sets/src/mage/cards/o/OathswornVampire.java b/Mage.Sets/src/mage/cards/o/OathswornVampire.java index a1caad56ea..8fc5b42812 100644 --- a/Mage.Sets/src/mage/cards/o/OathswornVampire.java +++ b/Mage.Sets/src/mage/cards/o/OathswornVampire.java @@ -80,7 +80,7 @@ class OathswornVampirePlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(source.getSourceId()) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) { Card card = game.getCard(source.getSourceId()); if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { return condition.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/o/OonasBlackguard.java b/Mage.Sets/src/mage/cards/o/OonasBlackguard.java index 452995f26a..f4e3abb70a 100644 --- a/Mage.Sets/src/mage/cards/o/OonasBlackguard.java +++ b/Mage.Sets/src/mage/cards/o/OonasBlackguard.java @@ -74,7 +74,7 @@ class OonasBlackguardReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); - if (creature != null && creature.getControllerId().equals(source.getControllerId()) + if (creature != null && creature.isControlledBy(source.getControllerId()) && creature.isCreature() && creature.hasSubtype(SubType.ROGUE, game) && !event.getTargetId().equals(source.getSourceId())) { @@ -127,7 +127,7 @@ class OonasBlackguardTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters(game).getCount(CounterType.P1P1) > 0) { + if (creature != null && creature.isControlledBy(getControllerId()) && creature.getCounters(game).getCount(CounterType.P1P1) > 0) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/o/OranRiefHydra.java b/Mage.Sets/src/mage/cards/o/OranRiefHydra.java index ff793ae4f9..fab442f426 100644 --- a/Mage.Sets/src/mage/cards/o/OranRiefHydra.java +++ b/Mage.Sets/src/mage/cards/o/OranRiefHydra.java @@ -78,7 +78,7 @@ class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isLand() - && permanent.getControllerId().equals(getControllerId())) { + && permanent.isControlledBy(getControllerId())) { Permanent sourcePermanent = game.getPermanent(getSourceId()); if (sourcePermanent != null) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/o/OrnateKanzashi.java b/Mage.Sets/src/mage/cards/o/OrnateKanzashi.java index cde70b63df..163714d47e 100644 --- a/Mage.Sets/src/mage/cards/o/OrnateKanzashi.java +++ b/Mage.Sets/src/mage/cards/o/OrnateKanzashi.java @@ -113,7 +113,7 @@ class OrnateKanzashiCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/o/OrzhovCharm.java b/Mage.Sets/src/mage/cards/o/OrzhovCharm.java index f15c6adda1..bf6486b1cb 100644 --- a/Mage.Sets/src/mage/cards/o/OrzhovCharm.java +++ b/Mage.Sets/src/mage/cards/o/OrzhovCharm.java @@ -92,12 +92,12 @@ class OrzhovCharmReturnToHandEffect extends OneShotEffect { attachments.addAll(target.getAttachments()); for (UUID attachmentId : attachments) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getControllerId().equals(source.getControllerId()) + if (attachment != null && attachment.isControlledBy(source.getControllerId()) && attachment.hasSubtype(SubType.AURA, game)) { attachment.moveToZone(Zone.HAND, source.getSourceId(), game, false); } } - if (target.getControllerId().equals(source.getControllerId())) { + if (target.isControlledBy(source.getControllerId())) { target.moveToZone(Zone.HAND, source.getSourceId(), game, false); } return true; diff --git a/Mage.Sets/src/mage/cards/o/OutpostSiege.java b/Mage.Sets/src/mage/cards/o/OutpostSiege.java index dc028a94db..2fabfdbc09 100644 --- a/Mage.Sets/src/mage/cards/o/OutpostSiege.java +++ b/Mage.Sets/src/mage/cards/o/OutpostSiege.java @@ -133,7 +133,7 @@ class CastFromNonHandZoneTargetEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (getTargetPointer().getTargets(game, source).contains(objectId) - && source.getControllerId().equals(affectedControllerId)) { + && source.isControlledBy(affectedControllerId)) { Card card = game.getCard(objectId); if (card != null) { return true; diff --git a/Mage.Sets/src/mage/cards/p/PalisadeGiant.java b/Mage.Sets/src/mage/cards/p/PalisadeGiant.java index 5f3a83ca37..10a8ffde34 100644 --- a/Mage.Sets/src/mage/cards/p/PalisadeGiant.java +++ b/Mage.Sets/src/mage/cards/p/PalisadeGiant.java @@ -98,7 +98,7 @@ class PalisadeGiantReplacementEffect extends ReplacementEffectImpl { Permanent targetPermanent = game.getPermanent(event.getTargetId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (targetPermanent != null && - targetPermanent.getControllerId().equals(source.getControllerId()) && + targetPermanent.isControlledBy(source.getControllerId()) && !targetPermanent.getName().equals(sourcePermanent.getName())) { // no redirection from or to other Palisade Giants return true; } diff --git a/Mage.Sets/src/mage/cards/p/Panharmonicon.java b/Mage.Sets/src/mage/cards/p/Panharmonicon.java index ea7bedb187..35ee17e6e7 100644 --- a/Mage.Sets/src/mage/cards/p/Panharmonicon.java +++ b/Mage.Sets/src/mage/cards/p/Panharmonicon.java @@ -66,7 +66,7 @@ class PanharmoniconEffect extends ReplacementEffectImpl { if (event instanceof NumberOfTriggersEvent) { NumberOfTriggersEvent numberOfTriggersEvent = (NumberOfTriggersEvent) event; // Only triggers of the controller of Panharmonicon - if (source.getControllerId().equals(event.getPlayerId())) { + if (source.isControlledBy(event.getPlayerId())) { GameEvent sourceEvent = numberOfTriggersEvent.getSourceEvent(); // Only EtB triggers if (sourceEvent != null diff --git a/Mage.Sets/src/mage/cards/p/ParallelThoughts.java b/Mage.Sets/src/mage/cards/p/ParallelThoughts.java index cf23ec4d58..16858edec0 100644 --- a/Mage.Sets/src/mage/cards/p/ParallelThoughts.java +++ b/Mage.Sets/src/mage/cards/p/ParallelThoughts.java @@ -150,6 +150,6 @@ class ParallelThoughtsReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/p/PathOfMettle.java b/Mage.Sets/src/mage/cards/p/PathOfMettle.java index 274b6023e5..10ec5e2d64 100644 --- a/Mage.Sets/src/mage/cards/p/PathOfMettle.java +++ b/Mage.Sets/src/mage/cards/p/PathOfMettle.java @@ -101,7 +101,7 @@ class PathOfMettleTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { int attackerCount = 0; if (game.getCombat() != null) { - if (getControllerId().equals(game.getCombat().getAttackingPlayerId())) { + if (isControlledBy(game.getCombat().getAttackingPlayerId())) { for (UUID attacker : game.getCombat().getAttackers()) { if (filter.match(game.getPermanent(attacker), game)) { attackerCount++; diff --git a/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java b/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java index e270d7f1d9..0ef7b2de1c 100644 --- a/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java +++ b/Mage.Sets/src/mage/cards/p/PawnOfUlamog.java @@ -74,7 +74,7 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = (Permanent) card; ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD - && permanent.getControllerId().equals(this.controllerId) + && permanent.isControlledBy(this.controllerId) && (targetId.equals(this.getSourceId()) || (permanent.isCreature() && !targetId.equals(this.getSourceId()) diff --git a/Mage.Sets/src/mage/cards/p/PedanticLearning.java b/Mage.Sets/src/mage/cards/p/PedanticLearning.java index a11782b0cc..b72a54652c 100644 --- a/Mage.Sets/src/mage/cards/p/PedanticLearning.java +++ b/Mage.Sets/src/mage/cards/p/PedanticLearning.java @@ -63,7 +63,7 @@ class PedanticLearningTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); Set cardType = card.getCardType(); if (cardOwnerId != null - && card.getOwnerId().equals(getControllerId()) + && card.isOwnedBy(getControllerId()) && cardType != null && card.isLand()) { return true; diff --git a/Mage.Sets/src/mage/cards/p/PerimeterCaptain.java b/Mage.Sets/src/mage/cards/p/PerimeterCaptain.java index f46eaf61a6..5034a47c86 100644 --- a/Mage.Sets/src/mage/cards/p/PerimeterCaptain.java +++ b/Mage.Sets/src/mage/cards/p/PerimeterCaptain.java @@ -67,7 +67,7 @@ class PerimeterCaptainTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null) { - if (creature.getControllerId().equals(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) { + if (creature.isControlledBy(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java b/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java index f0989f2959..8ed229abe3 100644 --- a/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java +++ b/Mage.Sets/src/mage/cards/p/PrecipiceOfMortis.java @@ -66,7 +66,7 @@ class PrecipiceOfMortisEffect extends ReplacementEffectImpl { if (event instanceof NumberOfTriggersEvent) { NumberOfTriggersEvent numberOfTriggersEvent = (NumberOfTriggersEvent) event; // Only triggers of the controller of Precipice of Mortis - if (source.getControllerId().equals(event.getPlayerId())) { + if (source.isControlledBy(event.getPlayerId())) { GameEvent sourceEvent = numberOfTriggersEvent.getSourceEvent(); // enters triggers if (sourceEvent.getType() == EventType.ENTERS_THE_BATTLEFIELD && sourceEvent instanceof EntersTheBattlefieldEvent) { diff --git a/Mage.Sets/src/mage/cards/p/PriceOfGlory.java b/Mage.Sets/src/mage/cards/p/PriceOfGlory.java index cfe602387f..c34c287cd4 100644 --- a/Mage.Sets/src/mage/cards/p/PriceOfGlory.java +++ b/Mage.Sets/src/mage/cards/p/PriceOfGlory.java @@ -69,7 +69,7 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl { } if (permanent.isLand() && player.getInRange().contains(permanent.getControllerId()) - && !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause + && !permanent.isControlledBy(game.getActivePlayerId())) { // intervening if clause getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; } @@ -103,7 +103,7 @@ class PriceOfGloryEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Permanent land = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source)); - if (land != null && !land.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause has to be checked again + if (land != null && !land.isControlledBy(game.getActivePlayerId())) { // intervening if clause has to be checked again land.destroy(source.getSourceId(), game, false); } return true; diff --git a/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java b/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java index a6e0f5b39c..77d939f26f 100644 --- a/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java +++ b/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java @@ -88,7 +88,7 @@ class PrizedAmalgamTriggerdAbility extends EntersBattlefieldAllTriggeredAbility EntersTheBattlefieldEvent entersEvent = (EntersTheBattlefieldEvent) event; if (entersEvent.getFromZone() == Zone.GRAVEYARD) { result = true; - } else if (entersEvent.getFromZone() == Zone.STACK && entersEvent.getTarget().getControllerId().equals(getControllerId())) { + } else if (entersEvent.getFromZone() == Zone.STACK && entersEvent.getTarget().isControlledBy(getControllerId())) { CastFromGraveyardWatcher watcher = (CastFromGraveyardWatcher) game.getState().getWatchers().get(CastFromGraveyardWatcher.class.getSimpleName()); if (watcher != null) { int zcc = game.getState().getZoneChangeCounter(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/p/ProperBurial.java b/Mage.Sets/src/mage/cards/p/ProperBurial.java index 1c178d5903..53b6feb9d2 100644 --- a/Mage.Sets/src/mage/cards/p/ProperBurial.java +++ b/Mage.Sets/src/mage/cards/p/ProperBurial.java @@ -63,7 +63,7 @@ class ProperBurialTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) { + if (permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { this.getEffects().clear(); this.addEffect(new GainLifeEffect(permanent.getToughness().getValue())); return true; diff --git a/Mage.Sets/src/mage/cards/p/PropheticFlamespeaker.java b/Mage.Sets/src/mage/cards/p/PropheticFlamespeaker.java index e4a257ed00..2309a098cd 100644 --- a/Mage.Sets/src/mage/cards/p/PropheticFlamespeaker.java +++ b/Mage.Sets/src/mage/cards/p/PropheticFlamespeaker.java @@ -113,7 +113,7 @@ class PropheticFlamespeakerCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/p/PureIntentions.java b/Mage.Sets/src/mage/cards/p/PureIntentions.java index 9ef3d45226..df8ff3752b 100644 --- a/Mage.Sets/src/mage/cards/p/PureIntentions.java +++ b/Mage.Sets/src/mage/cards/p/PureIntentions.java @@ -71,7 +71,7 @@ class PureIntentionsAllTriggeredAbility extends DelayedTriggeredAbility { if (stackObject != null && game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId())) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getOwnerId().equals(getControllerId())) { + if (card != null && card.isOwnedBy(getControllerId())) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/p/Purgatory.java b/Mage.Sets/src/mage/cards/p/Purgatory.java index 15fdd00b4b..1da37aebcc 100644 --- a/Mage.Sets/src/mage/cards/p/Purgatory.java +++ b/Mage.Sets/src/mage/cards/p/Purgatory.java @@ -94,7 +94,7 @@ class PurgatoryTriggeredAbility extends TriggeredAbilityImpl { && zEvent.getFromZone() == Zone.BATTLEFIELD && !(permanent instanceof PermanentToken) && permanent.isCreature() - && permanent.getOwnerId().equals(controller.getId())) { + && permanent.isOwnedBy(controller.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; diff --git a/Mage.Sets/src/mage/cards/p/PyromancerAscension.java b/Mage.Sets/src/mage/cards/p/PyromancerAscension.java index 8cb391cd50..c4831f5dd2 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancerAscension.java +++ b/Mage.Sets/src/mage/cards/p/PyromancerAscension.java @@ -88,7 +88,7 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null && - (spell.getControllerId().equals(this.getControllerId())) && + (spell.isControlledBy(this.getControllerId())) && (spell.isInstant() || spell.isSorcery()); } @@ -135,7 +135,7 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null && - (spell.getControllerId().equals(this.getControllerId())) && + (spell.isControlledBy(this.getControllerId())) && (spell.isInstant() || spell.isSorcery()); } diff --git a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java index 77c12981a0..8c6055dc4b 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java @@ -63,7 +63,7 @@ class PyromancersGauntletReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { MageObject object = game.getObject(event.getSourceId()); if (object != null && object instanceof Spell) { - if (((Spell) object).getControllerId().equals(source.getControllerId()) + if (((Spell) object).isControlledBy(source.getControllerId()) && (object.isInstant() || object.isSorcery())){ return true; diff --git a/Mage.Sets/src/mage/cards/p/PyromancersSwath.java b/Mage.Sets/src/mage/cards/p/PyromancersSwath.java index 79fac231a1..9bcae7d269 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersSwath.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersSwath.java @@ -67,7 +67,7 @@ class PyromancersSwathReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (source.getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if (source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject object = game.getObject(event.getSourceId()); return object != null && (object.isInstant() || object.isSorcery()); } diff --git a/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java b/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java index c4739d42e4..134df29422 100644 --- a/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java +++ b/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java @@ -81,7 +81,7 @@ class QasaliAmbusherAbility extends ActivatedAbilityImpl { if (!game.getBattlefield().getActivePermanents(filterPlains, this.getControllerId(), this.getSourceId(), game).isEmpty() && !game.getBattlefield().getActivePermanents(filterForest, this.getControllerId(), this.getSourceId(), game).isEmpty()) { for (CombatGroup group : game.getCombat().getGroups()) { - if (getControllerId().equals(group.getDefenderId())) { + if (isControlledBy(group.getDefenderId())) { return super.canActivate(playerId, game); } } diff --git a/Mage.Sets/src/mage/cards/q/QasaliSlingers.java b/Mage.Sets/src/mage/cards/q/QasaliSlingers.java index 7d9b09aac1..a68dd90737 100644 --- a/Mage.Sets/src/mage/cards/q/QasaliSlingers.java +++ b/Mage.Sets/src/mage/cards/q/QasaliSlingers.java @@ -76,7 +76,7 @@ class QasaliSlingersTriggeredAbility extends TriggeredAbilityImpl { if (permanent.getId().equals(this.getSourceId())) { return true; } - if (permanent.hasSubtype(SubType.CAT, game) && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent.hasSubtype(SubType.CAT, game) && permanent.isControlledBy(this.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java b/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java index ab99767888..abd0c7e33f 100644 --- a/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java +++ b/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java @@ -72,7 +72,7 @@ class QuestForPureFlameTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(getControllerId()).contains(event.getTargetId())) { - return getControllerId().equals(game.getControllerId(event.getSourceId())); + return isControlledBy(game.getControllerId(event.getSourceId())); } return false; } @@ -108,7 +108,7 @@ class QuestForPureFlameEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(game.getControllerId(event.getSourceId())); + return source.isControlledBy(game.getControllerId(event.getSourceId())); } @Override diff --git a/Mage.Sets/src/mage/cards/q/Quicken.java b/Mage.Sets/src/mage/cards/q/Quicken.java index 07ff6c72b9..e34973989e 100644 --- a/Mage.Sets/src/mage/cards/q/Quicken.java +++ b/Mage.Sets/src/mage/cards/q/Quicken.java @@ -86,7 +86,7 @@ class QuickenAsThoughEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (quickenWatcher.isQuickenSpellActive(affectedControllerId, source.getSourceId(), zoneChangeCounter)) { Card card = game.getCard(sourceId); - if (card != null && card.isSorcery() && source.getControllerId().equals(affectedControllerId)) { + if (card != null && card.isSorcery() && source.isControlledBy(affectedControllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RagingRiver.java b/Mage.Sets/src/mage/cards/r/RagingRiver.java index 6f065dd513..1d5eba39f4 100644 --- a/Mage.Sets/src/mage/cards/r/RagingRiver.java +++ b/Mage.Sets/src/mage/cards/r/RagingRiver.java @@ -128,11 +128,11 @@ class RagingRiverEffect extends OneShotEffect { } else { List leftLog = left.stream() .filter(permanent -> permanent.getControllerId() != null) - .filter(permanent -> permanent.getControllerId().equals(defender.getId())) + .filter(permanent -> permanent.isControlledBy(defender.getId())) .collect(Collectors.toList()); List rightLog = right.stream() .filter(permanent -> permanent.getControllerId() != null) - .filter(permanent -> permanent.getControllerId().equals(defender.getId())) + .filter(permanent -> permanent.isControlledBy(defender.getId())) .collect(Collectors.toList()); diff --git a/Mage.Sets/src/mage/cards/r/RaidersSpoils.java b/Mage.Sets/src/mage/cards/r/RaidersSpoils.java index dc20f31e86..ed92d70e99 100644 --- a/Mage.Sets/src/mage/cards/r/RaidersSpoils.java +++ b/Mage.Sets/src/mage/cards/r/RaidersSpoils.java @@ -70,7 +70,7 @@ class RaidersSpoilsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; Permanent permanent = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && permanent != null && permanent.hasSubtype(SubType.WARRIOR, game) && permanent.getControllerId().equals(controllerId)) { + if (damageEvent.isCombatDamage() && permanent != null && permanent.hasSubtype(SubType.WARRIOR, game) && permanent.isControlledBy(controllerId)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/r/RainOfGore.java b/Mage.Sets/src/mage/cards/r/RainOfGore.java index e14e6fbfb3..9deeecbaf7 100644 --- a/Mage.Sets/src/mage/cards/r/RainOfGore.java +++ b/Mage.Sets/src/mage/cards/r/RainOfGore.java @@ -77,7 +77,7 @@ class RainOfGoreEffect extends ReplacementEffectImpl { if (!game.getStack().isEmpty()) { StackObject stackObject = game.getStack().getFirst(); if (stackObject != null) { - return stackObject.getControllerId().equals(event.getPlayerId()); + return stackObject.isControlledBy(event.getPlayerId()); } } return false; diff --git a/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java b/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java index 18074ed07d..31d5b44e3d 100644 --- a/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java +++ b/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java @@ -120,7 +120,7 @@ class RakdosLordOfRiotsCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { return spell.isCreature(); diff --git a/Mage.Sets/src/mage/cards/r/RakishHeir.java b/Mage.Sets/src/mage/cards/r/RakishHeir.java index 4234f39dc9..37de821632 100644 --- a/Mage.Sets/src/mage/cards/r/RakishHeir.java +++ b/Mage.Sets/src/mage/cards/r/RakishHeir.java @@ -71,7 +71,7 @@ class RakishHeirTriggeredAbility extends TriggeredAbilityImpl { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; Permanent permanent = game.getPermanent(event.getSourceId()); if (damageEvent.isCombatDamage() && permanent != null - && permanent.hasSubtype(SubType.VAMPIRE, game) && permanent.getControllerId().equals(controllerId)) { + && permanent.hasSubtype(SubType.VAMPIRE, game) && permanent.isControlledBy(controllerId)) { this.getEffects().clear(); AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setTargetPointer(new FixedTarget(permanent.getId())); diff --git a/Mage.Sets/src/mage/cards/r/RakshasaVizier.java b/Mage.Sets/src/mage/cards/r/RakshasaVizier.java index 6e30688992..955fc76258 100644 --- a/Mage.Sets/src/mage/cards/r/RakshasaVizier.java +++ b/Mage.Sets/src/mage/cards/r/RakshasaVizier.java @@ -67,7 +67,7 @@ class RakshasaVizierTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.getFromZone() == Zone.GRAVEYARD && zEvent.getToZone() == Zone.EXILED) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getOwnerId().equals(getControllerId())) { + if (card != null && card.isOwnedBy(getControllerId())) { return true; } diff --git a/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java b/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java index 3819a5c581..23fafd8cc5 100644 --- a/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java +++ b/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java @@ -164,7 +164,7 @@ class RavagerOfTheFellsTarget extends TargetPermanent { } UUID firstTarget = player.getId(); Permanent permanent = game.getPermanent(id); - if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { + if (firstTarget != null && permanent != null && permanent.isControlledBy(firstTarget)) { return super.canTarget(id, source, game); } return false; @@ -191,7 +191,7 @@ class RavagerOfTheFellsTarget extends TargetPermanent { if (player != null) { for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.getControllerId().equals(player.getId())) { + if (permanent != null && permanent.isControlledBy(player.getId())) { possibleTargets.add(targetId); } } diff --git a/Mage.Sets/src/mage/cards/r/RayneAcademyChancellor.java b/Mage.Sets/src/mage/cards/r/RayneAcademyChancellor.java index 341f7f277d..b20a2e3d94 100644 --- a/Mage.Sets/src/mage/cards/r/RayneAcademyChancellor.java +++ b/Mage.Sets/src/mage/cards/r/RayneAcademyChancellor.java @@ -77,7 +77,7 @@ class RayneAcademyChancellorTriggeredAbility extends TriggeredAbilityImpl { return true; } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) { + if (permanent != null && this.isControlledBy(permanent.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RealitySmasher.java b/Mage.Sets/src/mage/cards/r/RealitySmasher.java index 8d559180e5..706af59e41 100644 --- a/Mage.Sets/src/mage/cards/r/RealitySmasher.java +++ b/Mage.Sets/src/mage/cards/r/RealitySmasher.java @@ -73,7 +73,7 @@ class RealitySmasherTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { StackObject spell = game.getStack().getStackObject(event.getSourceId()); - if (spell == null || !(spell instanceof Spell)) { + if (!(spell instanceof Spell)) { return false; } else { if (event.getTargetId().equals(this.getSourceId()) diff --git a/Mage.Sets/src/mage/cards/r/RefractionTrap.java b/Mage.Sets/src/mage/cards/r/RefractionTrap.java index a058cff52d..84d3bc3672 100644 --- a/Mage.Sets/src/mage/cards/r/RefractionTrap.java +++ b/Mage.Sets/src/mage/cards/r/RefractionTrap.java @@ -158,7 +158,7 @@ class RefractionTrapPreventDamageEffect extends PreventionEffectImpl { // check permanent first Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (permanent.getControllerId().equals(source.getControllerId())) { + if (permanent.isControlledBy(source.getControllerId())) { // it's your permanent return true; } diff --git a/Mage.Sets/src/mage/cards/r/RegalBehemoth.java b/Mage.Sets/src/mage/cards/r/RegalBehemoth.java index 2ef608b495..07e8352ad1 100644 --- a/Mage.Sets/src/mage/cards/r/RegalBehemoth.java +++ b/Mage.Sets/src/mage/cards/r/RegalBehemoth.java @@ -80,7 +80,7 @@ class RegalBehemothTriggeredManaAbility extends TriggeredManaAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(game.getMonarchId())) { + if (isControlledBy(game.getMonarchId())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) { ManaEvent mEvent = (ManaEvent) event; diff --git a/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java b/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java index 9c6d6165cf..6828490c7f 100644 --- a/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java +++ b/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java @@ -86,7 +86,7 @@ class AttachedToOpponentControlledAttackingCreaturePredicate implements ObjectPl if (permanent != null) { if (permanent.isCreature()) { if (permanent.isAttacking()) { - if (!permanent.getControllerId().equals(input.getPlayerId()) && + if (!permanent.isControlledBy(input.getPlayerId()) && game.getPlayer(input.getPlayerId()).hasOpponent(permanent.getControllerId(), game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java b/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java index f137b6278f..a6c2585ab4 100644 --- a/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java +++ b/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java @@ -72,7 +72,7 @@ class RenegadeDoppelgangerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (!event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent != null && permanent.isCreature() && permanent.isControlledBy(this.getControllerId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent.getId())); } diff --git a/Mage.Sets/src/mage/cards/r/Reparations.java b/Mage.Sets/src/mage/cards/r/Reparations.java index 249f94a636..e909ec6339 100644 --- a/Mage.Sets/src/mage/cards/r/Reparations.java +++ b/Mage.Sets/src/mage/cards/r/Reparations.java @@ -74,7 +74,7 @@ class ReparationsTriggeredAbility extends TriggeredAbilityImpl { } if (targetPermanent != null && targetPermanent.isCreature() - && targetPermanent.getControllerId().equals(controllerId)) { + && targetPermanent.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/r/Retribution.java b/Mage.Sets/src/mage/cards/r/Retribution.java index f5167bcbed..2c0a7214ad 100644 --- a/Mage.Sets/src/mage/cards/r/Retribution.java +++ b/Mage.Sets/src/mage/cards/r/Retribution.java @@ -107,7 +107,7 @@ class TargetCreaturePermanentOpponentSameController extends TargetCreaturePerman Permanent targetPermanent = game.getPermanent(targetId); if (targetPermanent != null) { if (!firstTargetPermanent.getId().equals(targetPermanent.getId())) { - if (!firstTargetPermanent.getControllerId().equals(targetPermanent.getOwnerId())) { + if (!firstTargetPermanent.isControlledBy(targetPermanent.getOwnerId())) { return false; } } diff --git a/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java b/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java index a814fc7a9f..3d95cc5195 100644 --- a/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java +++ b/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java @@ -99,7 +99,7 @@ class ReyhanLastOfTheAbzanTriggeredAbility extends TriggeredAbilityImpl { // You control Player player = game.getPlayer(this.getControllerId()); - if (player == null || !permanent.getControllerId().equals(getControllerId())) { + if (player == null || !permanent.isControlledBy(getControllerId())) { return false; } diff --git a/Mage.Sets/src/mage/cards/r/RhysTheRedeemed.java b/Mage.Sets/src/mage/cards/r/RhysTheRedeemed.java index e87bf81a3f..1a46092cb3 100644 --- a/Mage.Sets/src/mage/cards/r/RhysTheRedeemed.java +++ b/Mage.Sets/src/mage/cards/r/RhysTheRedeemed.java @@ -91,7 +91,7 @@ class RhysTheRedeemedEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { - if (permanent.getControllerId().equals(source.getControllerId())) { + if (permanent.isControlledBy(source.getControllerId())) { CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(); effect.setTargetPointer(new FixedTarget(permanent, game)); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/r/RingOfMaruf.java b/Mage.Sets/src/mage/cards/r/RingOfMaruf.java index a836a3a52c..3b39d23e7d 100644 --- a/Mage.Sets/src/mage/cards/r/RingOfMaruf.java +++ b/Mage.Sets/src/mage/cards/r/RingOfMaruf.java @@ -80,6 +80,6 @@ class RingOfMarufEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/r/RisenExecutioner.java b/Mage.Sets/src/mage/cards/r/RisenExecutioner.java index df4278b14b..40c1b4c799 100644 --- a/Mage.Sets/src/mage/cards/r/RisenExecutioner.java +++ b/Mage.Sets/src/mage/cards/r/RisenExecutioner.java @@ -91,7 +91,7 @@ class RisenExecutionerCastEffect extends AsThoughEffectImpl { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null - && card.getOwnerId().equals(affectedControllerId) + && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { return true; } diff --git a/Mage.Sets/src/mage/cards/r/RoninWarclub.java b/Mage.Sets/src/mage/cards/r/RoninWarclub.java index 8cf766bef6..d3f6624f42 100644 --- a/Mage.Sets/src/mage/cards/r/RoninWarclub.java +++ b/Mage.Sets/src/mage/cards/r/RoninWarclub.java @@ -71,7 +71,7 @@ public final class RoninWarclub extends CardImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.isCreature() - && (permanent.getControllerId().equals(this.controllerId))) { + && (permanent.isControlledBy(this.controllerId))) { if (!this.getTargets().isEmpty()) { // remove previous target diff --git a/Mage.Sets/src/mage/cards/r/RootSliver.java b/Mage.Sets/src/mage/cards/r/RootSliver.java index 57dc6af5e7..69c57f6a76 100644 --- a/Mage.Sets/src/mage/cards/r/RootSliver.java +++ b/Mage.Sets/src/mage/cards/r/RootSliver.java @@ -89,7 +89,7 @@ class RootSliverEffect extends ContinuousRuleModifyingEffectImpl { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.hasSubtype(SubType.SLIVER, game)) { MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject != null && sourceObject instanceof StackObject) { + if (sourceObject instanceof StackObject) { return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RowanKenrith.java b/Mage.Sets/src/mage/cards/r/RowanKenrith.java index b32b883391..1fc9050119 100644 --- a/Mage.Sets/src/mage/cards/r/RowanKenrith.java +++ b/Mage.Sets/src/mage/cards/r/RowanKenrith.java @@ -107,7 +107,7 @@ class RowanKenrithAttackEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getControllerId().equals(source.getFirstTarget()); + return permanent.isControlledBy(source.getFirstTarget()); } @Override diff --git a/Mage.Sets/src/mage/cards/r/RumblingAftershocks.java b/Mage.Sets/src/mage/cards/r/RumblingAftershocks.java index 20245e932a..74f8e3b025 100644 --- a/Mage.Sets/src/mage/cards/r/RumblingAftershocks.java +++ b/Mage.Sets/src/mage/cards/r/RumblingAftershocks.java @@ -78,7 +78,7 @@ class RumblingAftershocksTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getControllerId().equals(controllerId)) { + if (spell != null && spell.isControlledBy(controllerId)) { int damageAmount = 0; for (Ability ability: spell.getAbilities()) { if (ability instanceof KickerAbility) { diff --git a/Mage.Sets/src/mage/cards/s/SacredGround.java b/Mage.Sets/src/mage/cards/s/SacredGround.java index bfe3c54d2d..93a2b21b08 100644 --- a/Mage.Sets/src/mage/cards/s/SacredGround.java +++ b/Mage.Sets/src/mage/cards/s/SacredGround.java @@ -64,7 +64,7 @@ class SacredGroundTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zce = (ZoneChangeEvent) event; if (Zone.BATTLEFIELD == zce.getFromZone() && Zone.GRAVEYARD == zce.getToZone()) { Permanent targetPermanent = zce.getTarget(); - if (targetPermanent.isLand() && targetPermanent.getControllerId().equals(getControllerId())) { + if (targetPermanent.isLand() && targetPermanent.isControlledBy(getControllerId())) { getEffects().get(0).setTargetPointer(new FixedTarget(targetPermanent.getId(), game.getState().getZoneChangeCounter(targetPermanent.getId()))); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SaffiEriksdotter.java b/Mage.Sets/src/mage/cards/s/SaffiEriksdotter.java index cb54538d81..da707f54ca 100644 --- a/Mage.Sets/src/mage/cards/s/SaffiEriksdotter.java +++ b/Mage.Sets/src/mage/cards/s/SaffiEriksdotter.java @@ -106,7 +106,7 @@ class SaffiEriksdotterDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent) event).isDiesEvent()) { if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) { - if (this.getControllerId().equals(event.getPlayerId())) { + if (this.isControlledBy(event.getPlayerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SageOfFables.java b/Mage.Sets/src/mage/cards/s/SageOfFables.java index 1b5b311990..fb238129d5 100644 --- a/Mage.Sets/src/mage/cards/s/SageOfFables.java +++ b/Mage.Sets/src/mage/cards/s/SageOfFables.java @@ -71,7 +71,7 @@ class SageOfFablesReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + return creature != null && creature.isControlledBy(source.getControllerId()) && creature.isCreature() && creature.hasSubtype(SubType.WIZARD, game) && !event.getTargetId().equals(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/s/SakikoMotherOfSummer.java b/Mage.Sets/src/mage/cards/s/SakikoMotherOfSummer.java index 59a3944ea5..da0593a803 100644 --- a/Mage.Sets/src/mage/cards/s/SakikoMotherOfSummer.java +++ b/Mage.Sets/src/mage/cards/s/SakikoMotherOfSummer.java @@ -74,7 +74,7 @@ class SakikoMotherOfSummerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { + if (creature != null && creature.isControlledBy(controllerId)) { this.getEffects().clear(); Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(event.getAmount()), "that player", true); effect.setTargetPointer(new FixedTarget(creature.getControllerId())); diff --git a/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java b/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java index 52deb05c28..fafe925705 100644 --- a/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java +++ b/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java @@ -95,7 +95,7 @@ class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if (isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject damageSource = game.getObject(event.getSourceId()); if (damageSource != null) { if (game.getOpponents(getControllerId()).contains(event.getTargetId())) { diff --git a/Mage.Sets/src/mage/cards/s/SavageStomp.java b/Mage.Sets/src/mage/cards/s/SavageStomp.java index 9596862919..8a08017619 100644 --- a/Mage.Sets/src/mage/cards/s/SavageStomp.java +++ b/Mage.Sets/src/mage/cards/s/SavageStomp.java @@ -84,7 +84,7 @@ enum SavageStompCondition implements Condition { Iterator targets = sourceSpell.getStackAbility().getTargets().iterator(); while (targets.hasNext()) { Permanent permanent = game.getPermanentOrLKIBattlefield(targets.next().getFirstTarget()); - if (permanent != null && filter.match(permanent, game) && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && filter.match(permanent, game) && permanent.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SavageSummoning.java b/Mage.Sets/src/mage/cards/s/SavageSummoning.java index 28c873c4e8..2d19dea4fb 100644 --- a/Mage.Sets/src/mage/cards/s/SavageSummoning.java +++ b/Mage.Sets/src/mage/cards/s/SavageSummoning.java @@ -103,9 +103,9 @@ class SavageSummoningAsThoughEffect extends AsThoughEffectImpl { if (commander.isCreature() && commander.getControllerId().equals(source.getControllerId())) { return true; } - } else if (mageObject != null && mageObject instanceof Card) { + } else if (mageObject instanceof Card) { Card card = (Card) mageObject; - if (card.isCreature() && card.getOwnerId().equals(source.getControllerId())) { + if (card.isCreature() && card.isOwnedBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SavingGrace.java b/Mage.Sets/src/mage/cards/s/SavingGrace.java index 0ee8ad8d97..bf4a045014 100644 --- a/Mage.Sets/src/mage/cards/s/SavingGrace.java +++ b/Mage.Sets/src/mage/cards/s/SavingGrace.java @@ -94,7 +94,7 @@ class SavingGraceReplacementEffect extends ReplacementEffectImpl { if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) { Permanent targetPermanent = game.getPermanent(event.getTargetId()); if (targetPermanent != null - && targetPermanent.getControllerId().equals(source.getControllerId())) { + && targetPermanent.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/ScourgeOfNelToth.java b/Mage.Sets/src/mage/cards/s/ScourgeOfNelToth.java index e6a1cb64b5..4e09668db0 100644 --- a/Mage.Sets/src/mage/cards/s/ScourgeOfNelToth.java +++ b/Mage.Sets/src/mage/cards/s/ScourgeOfNelToth.java @@ -76,7 +76,7 @@ class ScourgeOfNelTothPlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(source.getSourceId()) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) { if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { Player player = game.getPlayer(affectedControllerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java index c2a22fd281..5ddb9e6c3a 100644 --- a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java +++ b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java @@ -87,7 +87,7 @@ class ScoutsWarningAsThoughEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (watcher.isScoutsWarningSpellActive(source.getSourceId(), zoneChangeCounter)) { Card card = game.getCard(sourceId); - if (card != null && card.isCreature() && source.getControllerId().equals(affectedControllerId)) { + if (card != null && card.isCreature() && source.isControlledBy(affectedControllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/ScrapTrawler.java b/Mage.Sets/src/mage/cards/s/ScrapTrawler.java index 60546eaa7a..65de4ee26e 100644 --- a/Mage.Sets/src/mage/cards/s/ScrapTrawler.java +++ b/Mage.Sets/src/mage/cards/s/ScrapTrawler.java @@ -78,7 +78,7 @@ class ScrapTrawlerTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (permanent.getControllerId().equals(this.getControllerId()) && permanent.isArtifact()) { + if (permanent.isControlledBy(this.getControllerId()) && permanent.isArtifact()) { FilterCard filter = new FilterArtifactCard("artifact card in your graveyard with converted mana cost less than " + permanent.getManaCost().convertedManaCost()); filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, permanent.getManaCost().convertedManaCost())); TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter); diff --git a/Mage.Sets/src/mage/cards/s/Scrapheap.java b/Mage.Sets/src/mage/cards/s/Scrapheap.java index c38b844d81..b57e7f95e6 100644 --- a/Mage.Sets/src/mage/cards/s/Scrapheap.java +++ b/Mage.Sets/src/mage/cards/s/Scrapheap.java @@ -64,7 +64,7 @@ class ScrapheapTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && permanent.getOwnerId().equals(this.getControllerId())) { + if (permanent != null && permanent.isOwnedBy(this.getControllerId())) { if (StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT.match(permanent, sourceId, controllerId, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java b/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java index 3cd5899623..6bd3881998 100644 --- a/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java +++ b/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java @@ -143,7 +143,7 @@ class SealOfTheGuildpactCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - return abilityToModify.getControllerId().equals(source.getControllerId()) + return abilityToModify.isControlledBy(source.getControllerId()) && abilityToModify instanceof SpellAbility; } diff --git a/Mage.Sets/src/mage/cards/s/SearingBlaze.java b/Mage.Sets/src/mage/cards/s/SearingBlaze.java index 0deaae3341..cda4d3ce25 100644 --- a/Mage.Sets/src/mage/cards/s/SearingBlaze.java +++ b/Mage.Sets/src/mage/cards/s/SearingBlaze.java @@ -100,7 +100,7 @@ class SearingBlazeTarget extends TargetPermanent { } UUID firstTarget = player.getId(); Permanent permanent = game.getPermanent(id); - if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { + if (firstTarget != null && permanent != null && permanent.isControlledBy(firstTarget)) { return super.canTarget(id, source, game); } return false; @@ -117,7 +117,7 @@ class SearingBlazeTarget extends TargetPermanent { if (player != null) { for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.getControllerId().equals(player.getId())) { + if (permanent != null && permanent.isControlledBy(player.getId())) { possibleTargets.add(targetId); } } diff --git a/Mage.Sets/src/mage/cards/s/SelflessSquire.java b/Mage.Sets/src/mage/cards/s/SelflessSquire.java index adcd11469e..eac10d15e6 100644 --- a/Mage.Sets/src/mage/cards/s/SelflessSquire.java +++ b/Mage.Sets/src/mage/cards/s/SelflessSquire.java @@ -74,7 +74,7 @@ class SelflessSquireTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(event.getTargetId())) { + if (isControlledBy(event.getTargetId())) { getEffects().clear(); getEffects().add(new AddCountersSourceEffect(CounterType.P1P1.createInstance(event.getAmount()))); return true; diff --git a/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java b/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java index 1f39b373f4..34372611f2 100644 --- a/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java +++ b/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java @@ -109,7 +109,7 @@ class SemblanceAnvilCostReductionEffect extends CostModificationEffectImpl { public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { Card sourceCard = game.getCard(abilityToModify.getSourceId()); - if (sourceCard != null && sourceCard.getOwnerId().equals(source.getControllerId())) { + if (sourceCard != null && sourceCard.isOwnedBy(source.getControllerId())) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { List imprinted = permanent.getImprinted(); diff --git a/Mage.Sets/src/mage/cards/s/SenTriplets.java b/Mage.Sets/src/mage/cards/s/SenTriplets.java index e0681a1308..e1d6ed588b 100644 --- a/Mage.Sets/src/mage/cards/s/SenTriplets.java +++ b/Mage.Sets/src/mage/cards/s/SenTriplets.java @@ -147,7 +147,7 @@ class SenTripletsPlayFromOpponentsHandEffect extends AsThoughEffectImpl { public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Card card = game.getCard(objectId); return card != null && - card.getOwnerId().equals(getTargetPointer().getFirst(game, source)) && + card.isOwnedBy(getTargetPointer().getFirst(game, source)) && game.getState().getZone(objectId) == Zone.HAND && affectedControllerId.equals(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/s/SenatorLottDod.java b/Mage.Sets/src/mage/cards/s/SenatorLottDod.java index 903bb71b24..2c6f13cddc 100644 --- a/Mage.Sets/src/mage/cards/s/SenatorLottDod.java +++ b/Mage.Sets/src/mage/cards/s/SenatorLottDod.java @@ -75,7 +75,7 @@ class SenatorLottDodSpellsTargetingCreatureCostReductionEffect extends CostModif for (Target target : mode.getTargets()) { for (UUID targetUUID : target.getTargets()) { Permanent permanent = game.getPermanent(targetUUID); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SerumPowder.java b/Mage.Sets/src/mage/cards/s/SerumPowder.java index cdc8e4b6e8..955f9a5bf6 100644 --- a/Mage.Sets/src/mage/cards/s/SerumPowder.java +++ b/Mage.Sets/src/mage/cards/s/SerumPowder.java @@ -87,7 +87,7 @@ class SerumPowderReplaceEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java b/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java index af2cdf3a2a..cca4023c35 100644 --- a/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java +++ b/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java @@ -81,7 +81,7 @@ class SeshiroTheAnointedAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.hasSubtype(SubType.SNAKE, game) && p.getControllerId().equals(controllerId)) { + if (damageEvent.isCombatDamage() && p != null && p.hasSubtype(SubType.SNAKE, game) && p.isControlledBy(controllerId)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/SettleTheWreckage.java b/Mage.Sets/src/mage/cards/s/SettleTheWreckage.java index b68584e3c4..4a2a86accd 100644 --- a/Mage.Sets/src/mage/cards/s/SettleTheWreckage.java +++ b/Mage.Sets/src/mage/cards/s/SettleTheWreckage.java @@ -73,7 +73,7 @@ class SettleTheWreckageEffect extends OneShotEffect { Iterator creatureIds = game.getCombat().getAttackers().iterator(); while (creatureIds.hasNext()) { Permanent creature = game.getPermanent(creatureIds.next()); - if (creature != null && creature.getControllerId().equals(player.getId())) { + if (creature != null && creature.isControlledBy(player.getId())) { toExile.add(creature); attackers++; } diff --git a/Mage.Sets/src/mage/cards/s/ShadowOfTheGrave.java b/Mage.Sets/src/mage/cards/s/ShadowOfTheGrave.java index 8839aaea5e..c85fcab35d 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowOfTheGrave.java +++ b/Mage.Sets/src/mage/cards/s/ShadowOfTheGrave.java @@ -63,7 +63,7 @@ class ShadowOfTheGraveEffect extends OneShotEffect { && watcher != null) { for (Card card : watcher.getCardsCycledOrDiscardedThisTurn(controller.getId()).getCards(game)) { if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD //must come from their graveyard - && card.getOwnerId().equals(controller.getId())) { //confirm ownership, but it should not be possible to get not ownwd cards here + && card.isOwnedBy(controller.getId())) { //confirm ownership, but it should not be possible to get not ownwd cards here controller.moveCardToHandWithInfo(card, source.getId(), game, true); } } diff --git a/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java b/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java index 8a3d88c5ec..8718cc44df 100644 --- a/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java +++ b/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java @@ -92,7 +92,7 @@ class ShamanOfForgottenWaysManaCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = source.getSourceObject(game); - return object != null && (object instanceof Spell) && object.isCreature(); + return object instanceof Spell && object.isCreature(); } } diff --git a/Mage.Sets/src/mage/cards/s/ShannaSisaysLegacy.java b/Mage.Sets/src/mage/cards/s/ShannaSisaysLegacy.java index 5477904286..6041c37855 100644 --- a/Mage.Sets/src/mage/cards/s/ShannaSisaysLegacy.java +++ b/Mage.Sets/src/mage/cards/s/ShannaSisaysLegacy.java @@ -104,7 +104,7 @@ class ShannaSisaysLegacyEffect extends ContinuousRuleModifyingEffectImpl { StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId()); if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) { if (stackObject instanceof Ability) { - if (!stackObject.getControllerId().equals(source.getControllerId())) { + if (!stackObject.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java b/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java index 60c0959441..7646943630 100644 --- a/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java +++ b/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java @@ -61,7 +61,7 @@ class CreaturesYouControlTargetedTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); Player targetter = game.getPlayer(event.getPlayerId()); - if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) { + if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { Object object = game.getObject(event.getSourceId()); if (object != null && targetter != null && targetter.hasOpponent(this.getControllerId(), game)) { return true; diff --git a/Mage.Sets/src/mage/cards/s/ShiningShoal.java b/Mage.Sets/src/mage/cards/s/ShiningShoal.java index 861eef8981..5733872da8 100644 --- a/Mage.Sets/src/mage/cards/s/ShiningShoal.java +++ b/Mage.Sets/src/mage/cards/s/ShiningShoal.java @@ -111,7 +111,7 @@ class ShiningShoalRedirectDamageTargetEffect extends RedirectDamageFromSourceToT // check creature first Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isCreature()) { - if (permanent.getControllerId().equals(source.getControllerId())) { + if (permanent.isControlledBy(source.getControllerId())) { // it's your creature redirectTarget = source.getTargets().get(1); return true; diff --git a/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java b/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java index a0f0afcd48..d43cfaed03 100644 --- a/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java +++ b/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java @@ -90,7 +90,7 @@ class ShipbreakerKrakenReplacementEffect extends ContinuousRuleModifyingEffectIm // the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL // event will happen before this effect is applied ever) Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) { + if (sourcePermanent == null || !sourcePermanent.isControlledBy(source.getControllerId())) { discard(); return false; } diff --git a/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java b/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java index 003933e493..6e0d7d255f 100644 --- a/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java +++ b/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java @@ -80,7 +80,7 @@ class ShireiShizosCaretakerTriggeredAbility extends TriggeredAbilityImpl { Card card = game.getCard(zEvent.getTargetId()); if (card != null && LKIpermanent != null - && card.getOwnerId().equals(this.controllerId) + && card.isOwnedBy(this.controllerId) && zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD && card.isCreature() diff --git a/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java b/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java index 3a3c4e1f8a..933cbb20ce 100644 --- a/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java +++ b/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java @@ -78,7 +78,7 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl { Set cardType = card.getCardType(); if (cardOwnerId != null - && card.getOwnerId().equals(getControllerId()) + && card.isOwnedBy(getControllerId()) && cardType != null && card.isCreature()) { return true; diff --git a/Mage.Sets/src/mage/cards/s/SigilCaptain.java b/Mage.Sets/src/mage/cards/s/SigilCaptain.java index c216469dfd..e14f9428f6 100644 --- a/Mage.Sets/src/mage/cards/s/SigilCaptain.java +++ b/Mage.Sets/src/mage/cards/s/SigilCaptain.java @@ -69,7 +69,7 @@ class SigilCaptainTriggeredAbility extends TriggeredAbilityImpl { if (permanent == null) { return false; } - if (permanent.getControllerId().equals(controllerId) + if (permanent.isControlledBy(controllerId) && permanent.getPower().getValue() == 1 && permanent.getToughness().getValue() == 1) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/s/SilasRennSeekerAdept.java b/Mage.Sets/src/mage/cards/s/SilasRennSeekerAdept.java index 040f3ae781..9343d54c7d 100644 --- a/Mage.Sets/src/mage/cards/s/SilasRennSeekerAdept.java +++ b/Mage.Sets/src/mage/cards/s/SilasRennSeekerAdept.java @@ -79,7 +79,7 @@ class SilasRennSeekerAdeptPlayEffect extends AsThoughEffectImpl { UUID targetId = getTargetPointer().getFirst(game, source); if (targetId != null) { return targetId.equals(objectId) - && source.getControllerId().equals(affectedControllerId); + && source.isControlledBy(affectedControllerId); } else { // the target card has changed zone meanwhile, so the effect is no longer needed discard(); diff --git a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java index b7c15d5eaa..4caebce8f9 100644 --- a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java +++ b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java @@ -75,7 +75,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(this.controllerId) && (permanent.hasSubtype(SubType.WOLF, game) || permanent.hasSubtype(SubType.WEREWOLF, game))) { + if (permanent != null && permanent.isControlledBy(this.controllerId) && (permanent.hasSubtype(SubType.WOLF, game) || permanent.hasSubtype(SubType.WEREWOLF, game))) { MageObject object = game.getObject(event.getSourceId()); if (object != null && object instanceof Spell) { Card c = (Spell) object; diff --git a/Mage.Sets/src/mage/cards/s/SimicGuildmage.java b/Mage.Sets/src/mage/cards/s/SimicGuildmage.java index 0a5fe6fefd..45d3b6eec7 100644 --- a/Mage.Sets/src/mage/cards/s/SimicGuildmage.java +++ b/Mage.Sets/src/mage/cards/s/SimicGuildmage.java @@ -110,7 +110,7 @@ class MoveCounterFromTargetToTargetEffect extends OneShotEffect { if (source.getTargets().size() > 1) { toPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); } - if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) { + if (fromPermanent == null || toPermanent == null || !fromPermanent.isControlledBy(toPermanent.getControllerId())) { return false; } fromPermanent.removeCounters(CounterType.P1P1.createInstance(1), game); @@ -136,7 +136,7 @@ class SameControllerPredicate implements ObjectSourcePlayerPredicate choices = new TreeSet<>(); Collection cards = game.getCards(); for (Card gameCard : cards) { - if (gameCard.getOwnerId().equals(targetPlayer.getId())) { + if (gameCard.isOwnedBy(targetPlayer.getId())) { choices.add(gameCard.getName()); } } diff --git a/Mage.Sets/src/mage/cards/s/SqueeTheImmortal.java b/Mage.Sets/src/mage/cards/s/SqueeTheImmortal.java index adfc361ed0..4e08bb419d 100644 --- a/Mage.Sets/src/mage/cards/s/SqueeTheImmortal.java +++ b/Mage.Sets/src/mage/cards/s/SqueeTheImmortal.java @@ -71,7 +71,7 @@ class SqueePlayEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); - if (card != null && card.getOwnerId().equals(affectedControllerId) + if (card != null && card.isOwnedBy(affectedControllerId) && (game.getState().getZone(source.getSourceId()) == Zone.EXILED || game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD)) { return true; diff --git a/Mage.Sets/src/mage/cards/s/SquirrelPoweredScheme.java b/Mage.Sets/src/mage/cards/s/SquirrelPoweredScheme.java index 3534b19b43..d717fb812e 100644 --- a/Mage.Sets/src/mage/cards/s/SquirrelPoweredScheme.java +++ b/Mage.Sets/src/mage/cards/s/SquirrelPoweredScheme.java @@ -62,7 +62,7 @@ class SquirrelPoweredSchemeEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { // ignore planar dies (dice roll amount of planar dies is equal to 0) - return event.getAmount() > 0 && source.getControllerId().equals(event.getPlayerId()); + return event.getAmount() > 0 && source.isControlledBy(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/s/SteelSquirrel.java b/Mage.Sets/src/mage/cards/s/SteelSquirrel.java index 0a5f82b69c..c8f992ceec 100644 --- a/Mage.Sets/src/mage/cards/s/SteelSquirrel.java +++ b/Mage.Sets/src/mage/cards/s/SteelSquirrel.java @@ -76,7 +76,7 @@ class SteelSquirrelTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) { + if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) { if (event.getAmount() >= 5) { for (Effect effect : this.getEffects()) { effect.setValue("rolled", event.getAmount()); diff --git a/Mage.Sets/src/mage/cards/s/StensiaMasquerade.java b/Mage.Sets/src/mage/cards/s/StensiaMasquerade.java index 3716bc5fa3..61f2a5dc8a 100644 --- a/Mage.Sets/src/mage/cards/s/StensiaMasquerade.java +++ b/Mage.Sets/src/mage/cards/s/StensiaMasquerade.java @@ -88,7 +88,7 @@ class StensiaMasqueradeTriggeredAbility extends TriggeredAbilityImpl { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; Permanent permanent = game.getPermanent(event.getSourceId()); if (damageEvent.isCombatDamage() && permanent != null - && permanent.hasSubtype(SubType.VAMPIRE, game) && permanent.getControllerId().equals(controllerId)) { + && permanent.hasSubtype(SubType.VAMPIRE, game) && permanent.isControlledBy(controllerId)) { this.getEffects().clear(); AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setTargetPointer(new FixedTarget(permanent.getId())); diff --git a/Mage.Sets/src/mage/cards/s/StolenStrategy.java b/Mage.Sets/src/mage/cards/s/StolenStrategy.java index 07b0556f1e..18e0108846 100644 --- a/Mage.Sets/src/mage/cards/s/StolenStrategy.java +++ b/Mage.Sets/src/mage/cards/s/StolenStrategy.java @@ -133,7 +133,7 @@ class StolenStrategyCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(cardId) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(cardId) && source.isControlledBy(affectedControllerId)) { ExileZone exileZone = game.getState().getExile().getExileZone(exileId); return exileZone != null && exileZone.contains(cardId); } @@ -164,7 +164,7 @@ class StolenStrategySpendAnyManaEffect extends AsThoughEffectImpl implements AsT @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget()) && ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId) && (((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)) diff --git a/Mage.Sets/src/mage/cards/s/StromkirkOccultist.java b/Mage.Sets/src/mage/cards/s/StromkirkOccultist.java index 7e0974aa05..ff3405bd2a 100644 --- a/Mage.Sets/src/mage/cards/s/StromkirkOccultist.java +++ b/Mage.Sets/src/mage/cards/s/StromkirkOccultist.java @@ -117,7 +117,7 @@ class StromkirkOccultistPlayFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java b/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java index e90d03fbb7..a0c40edbe7 100644 --- a/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java +++ b/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java @@ -65,7 +65,7 @@ class SunbirdsInvocationTriggeredAbility extends SpellCastControllerTriggeredAbi Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getFromZone().equals(Zone.HAND) - && spell.getOwnerId().equals(getControllerId())) { // must be from the controller's hand + && spell.isOwnedBy(getControllerId())) { // must be from the controller's hand if (spell.getCard() != null) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(spell.getId())); diff --git a/Mage.Sets/src/mage/cards/t/TajuruPreserver.java b/Mage.Sets/src/mage/cards/t/TajuruPreserver.java index f077b37d8d..27f8fac2ce 100644 --- a/Mage.Sets/src/mage/cards/t/TajuruPreserver.java +++ b/Mage.Sets/src/mage/cards/t/TajuruPreserver.java @@ -72,7 +72,7 @@ class TajuruPreserverEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { MageObject object = game.getObject(event.getSourceId()); if (object instanceof PermanentCard) { if (game.getOpponents(source.getControllerId()).contains(((PermanentCard)object).getControllerId())) { diff --git a/Mage.Sets/src/mage/cards/t/TalusPaladin.java b/Mage.Sets/src/mage/cards/t/TalusPaladin.java index 87db089913..2619c545e0 100644 --- a/Mage.Sets/src/mage/cards/t/TalusPaladin.java +++ b/Mage.Sets/src/mage/cards/t/TalusPaladin.java @@ -82,7 +82,7 @@ class TalusPaladinTriggeredAbility extends TriggeredAbilityImpl { Permanent ally = game.getPermanent(event.getTargetId()); if (ally != null) { if (ally.hasSubtype(SubType.ALLY, game) - && ally.getControllerId().equals(this.getControllerId())) { + && ally.isControlledBy(this.getControllerId())) { if (event.getTargetId().equals(this.getSourceId()) || event.getTargetId().equals(ally.getId())) { return true; diff --git a/Mage.Sets/src/mage/cards/t/Tamanoa.java b/Mage.Sets/src/mage/cards/t/Tamanoa.java index 58d3f70fed..a567e0c2c0 100644 --- a/Mage.Sets/src/mage/cards/t/Tamanoa.java +++ b/Mage.Sets/src/mage/cards/t/Tamanoa.java @@ -72,7 +72,7 @@ class TamanoaDealsDamageTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { MageObject eventSourceObject = game.getObject(event.getSourceId()); if (eventSourceObject != null && !eventSourceObject.isCreature()) { - if (getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if (isControlledBy(game.getControllerId(event.getSourceId()))) { this.getEffects().forEach((effect) -> { effect.setValue("damage", event.getAmount()); }); diff --git a/Mage.Sets/src/mage/cards/t/TangleKelp.java b/Mage.Sets/src/mage/cards/t/TangleKelp.java index 25ae12d285..d4dde772df 100644 --- a/Mage.Sets/src/mage/cards/t/TangleKelp.java +++ b/Mage.Sets/src/mage/cards/t/TangleKelp.java @@ -106,7 +106,7 @@ class DontUntapIfAttackedLastTurnEnchantedEffect extends ContinuousRuleModifying Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null && event.getTargetId().equals(enchantment.getAttachedTo())) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null && permanent.getControllerId().equals(game.getActivePlayerId())) { + if (permanent != null && permanent.isControlledBy(game.getActivePlayerId())) { AttackedLastTurnWatcher watcher = (AttackedLastTurnWatcher) game.getState().getWatchers().get(AttackedLastTurnWatcher.class.getSimpleName()); if (watcher != null) { Set attackingCreatures = watcher.getAttackedLastTurnCreatures(permanent.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/t/Taunt.java b/Mage.Sets/src/mage/cards/t/Taunt.java index 377d64a899..ed2e444429 100644 --- a/Mage.Sets/src/mage/cards/t/Taunt.java +++ b/Mage.Sets/src/mage/cards/t/Taunt.java @@ -55,7 +55,7 @@ class TauntEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getControllerId().equals(this.getTargetPointer().getFirst(game, source)); + return permanent.isControlledBy(this.getTargetPointer().getFirst(game, source)); } @Override diff --git a/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java b/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java index 9f9672c728..be586c41a5 100644 --- a/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java +++ b/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java @@ -89,13 +89,13 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl { } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature()) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature()) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } diff --git a/Mage.Sets/src/mage/cards/t/TelimTorsEdict.java b/Mage.Sets/src/mage/cards/t/TelimTorsEdict.java index 7b3b24804d..e065dbebbb 100644 --- a/Mage.Sets/src/mage/cards/t/TelimTorsEdict.java +++ b/Mage.Sets/src/mage/cards/t/TelimTorsEdict.java @@ -58,7 +58,7 @@ class TelimTorsEdictPredicate implements ObjectPlayerPredicate input, Game game) { Permanent permanent = input.getObject(); UUID playerId = input.getPlayerId(); - if (permanent.getControllerId().equals(playerId) || permanent.getOwnerId().equals(playerId)) { + if (permanent.isControlledBy(playerId) || permanent.isOwnedBy(playerId)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/t/TempleAltisaur.java b/Mage.Sets/src/mage/cards/t/TempleAltisaur.java index 2f07f760a1..c4f1afe7dd 100644 --- a/Mage.Sets/src/mage/cards/t/TempleAltisaur.java +++ b/Mage.Sets/src/mage/cards/t/TempleAltisaur.java @@ -77,7 +77,7 @@ class TempleAltisaurPreventEffect extends PreventionEffectImpl { if (permanent != null && !permanent.getId().equals(source.getSourceId()) && permanent.hasSubtype(SubType.DINOSAUR, game) - && permanent.getControllerId().equals(source.getControllerId())) { + && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/t/ThadaAdelAcquisitor.java b/Mage.Sets/src/mage/cards/t/ThadaAdelAcquisitor.java index 5c0bcb2aa9..e5777b82a6 100644 --- a/Mage.Sets/src/mage/cards/t/ThadaAdelAcquisitor.java +++ b/Mage.Sets/src/mage/cards/t/ThadaAdelAcquisitor.java @@ -116,7 +116,7 @@ class ThadaAdelPlayFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) + return source.isControlledBy(affectedControllerId) && sourceId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/cards/t/TheBigIdea.java b/Mage.Sets/src/mage/cards/t/TheBigIdea.java index 44d3391a6b..6bb1285d16 100644 --- a/Mage.Sets/src/mage/cards/t/TheBigIdea.java +++ b/Mage.Sets/src/mage/cards/t/TheBigIdea.java @@ -118,7 +118,7 @@ class TheBigIdeaReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (!this.used) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/t/TheFallen.java b/Mage.Sets/src/mage/cards/t/TheFallen.java index 59388577ce..8676d61c57 100644 --- a/Mage.Sets/src/mage/cards/t/TheFallen.java +++ b/Mage.Sets/src/mage/cards/t/TheFallen.java @@ -65,7 +65,7 @@ class TheFallenEffect extends OneShotEffect { TheFallenWatcher watcher = (TheFallenWatcher) game.getState().getWatchers().get(TheFallenWatcher.class.getSimpleName()); if (watcher != null && watcher.getPlayersAndWalkersDealtDamageThisGame(source.getSourceId()) != null) { for (UUID playerId : watcher.getPlayersAndWalkersDealtDamageThisGame(source.getSourceId())) { - if (!source.getControllerId().equals(playerId)) { + if (!source.isControlledBy(playerId)) { game.damagePlayerOrPlaneswalker(playerId, 1, source.getSourceId(), game, false, true); } } diff --git a/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java b/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java index 0e7bcab716..1fb9383bfb 100644 --- a/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java +++ b/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java @@ -83,7 +83,7 @@ class TheFlameOfKeldDamageEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (source.getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if (source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject sourceObject; Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (sourcePermanent == null) { diff --git a/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java b/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java index b126d89cbb..8fc2ee9ce1 100644 --- a/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java +++ b/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java @@ -83,7 +83,7 @@ class TheGitrogMonsterTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); Set cardType = card.getCardType(); if (cardOwnerId != null - && card.getOwnerId().equals(getControllerId()) + && card.isOwnedBy(getControllerId()) && cardType != null && card.isLand()) { return true; diff --git a/Mage.Sets/src/mage/cards/t/TheUrDragon.java b/Mage.Sets/src/mage/cards/t/TheUrDragon.java index 0c425272e5..ac9fbb0494 100644 --- a/Mage.Sets/src/mage/cards/t/TheUrDragon.java +++ b/Mage.Sets/src/mage/cards/t/TheUrDragon.java @@ -94,7 +94,7 @@ class TheUrDragonTriggeredAbility extends TriggeredAbilityImpl { Permanent creature = game.getPermanent(attacker); if (creature != null && creature.getControllerId() != null - && creature.getControllerId().equals(this.getControllerId()) + && creature.isControlledBy(this.getControllerId()) && creature.hasSubtype(SubType.DRAGON, game)) { attackingDragons++; } diff --git a/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java b/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java index 7b9393e5bb..8514dc9255 100644 --- a/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java +++ b/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java @@ -108,7 +108,7 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl { if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId) + if (creature != null && creature.isControlledBy(controllerId) && creature.isArtifact() && !damagedPlayerIds.contains(event.getTargetId())) { damagedPlayerIds.add(event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java b/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java index c41b0293b9..41ed3921e2 100644 --- a/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java +++ b/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java @@ -76,6 +76,6 @@ class ThousandYearElixirEffect extends AsThoughEffectImpl { Permanent permanent = game.getPermanent(sourceId); return permanent != null && permanent.isCreature() - && permanent.getControllerId().equals(source.getControllerId()); + && permanent.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/t/ThreeWishes.java b/Mage.Sets/src/mage/cards/t/ThreeWishes.java index b6d14874cc..a88b1df88d 100644 --- a/Mage.Sets/src/mage/cards/t/ThreeWishes.java +++ b/Mage.Sets/src/mage/cards/t/ThreeWishes.java @@ -187,7 +187,7 @@ class ThreeWishesPlayFromExileEffect extends AsThoughEffectImpl { return exile != null && getTargetPointer().getFirst(game, source) != null && getTargetPointer().getFirst(game, source).equals(sourceId) - && source.getControllerId().equals(affectedControllerId) + && source.isControlledBy(affectedControllerId) && game.getState().getZone(sourceId) == Zone.EXILED && exile.contains(sourceId); } diff --git a/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java b/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java index 4c4d968a16..832e96d5de 100644 --- a/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java +++ b/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java @@ -96,7 +96,7 @@ class TianaShipsCaretakerTriggeredAbility extends TriggeredAbilityImpl { && zEvent.getFromZone() == Zone.BATTLEFIELD && (permanent.isArtifact() && permanent.hasSubtype(SubType.EQUIPMENT, game) || permanent.isEnchantment() && permanent.hasSubtype(SubType.AURA, game)) - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/t/TidebinderMage.java b/Mage.Sets/src/mage/cards/t/TidebinderMage.java index cdc97d7c4a..e2ba1780fd 100644 --- a/Mage.Sets/src/mage/cards/t/TidebinderMage.java +++ b/Mage.Sets/src/mage/cards/t/TidebinderMage.java @@ -97,7 +97,7 @@ class TidebinderMageEffect extends ContinuousRuleModifyingEffectImpl { // the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL // event will happen before this effect is applied ever) Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) { + if (sourcePermanent == null || !sourcePermanent.isControlledBy(source.getControllerId())) { discard(); return false; } diff --git a/Mage.Sets/src/mage/cards/t/TimeOfIce.java b/Mage.Sets/src/mage/cards/t/TimeOfIce.java index fddf8a086e..10780d7b64 100644 --- a/Mage.Sets/src/mage/cards/t/TimeOfIce.java +++ b/Mage.Sets/src/mage/cards/t/TimeOfIce.java @@ -119,7 +119,7 @@ class TimeOfIceEffect extends ContinuousRuleModifyingEffectImpl { if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getTargetId().equals(targetPointer.getFirst(game, source))) { Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source)); if (targetCreature != null) { - return targetCreature.getControllerId().equals(game.getActivePlayerId()); + return targetCreature.isControlledBy(game.getActivePlayerId()); } else { discard(); return false; diff --git a/Mage.Sets/src/mage/cards/t/TimeVault.java b/Mage.Sets/src/mage/cards/t/TimeVault.java index 3e55951851..7586d9f3a8 100644 --- a/Mage.Sets/src/mage/cards/t/TimeVault.java +++ b/Mage.Sets/src/mage/cards/t/TimeVault.java @@ -78,7 +78,7 @@ class TimeVaultReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (source.getControllerId().equals(event.getPlayerId())) { + if (source.isControlledBy(event.getPlayerId())) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.isTapped()) { return true; diff --git a/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java b/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java index 8650e8c92b..248c68496b 100644 --- a/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java +++ b/Mage.Sets/src/mage/cards/t/TreacherousTerrain.java @@ -61,7 +61,7 @@ class TreacherousTerrainEffect extends OneShotEffect { if (player != null) { int amount = 0; for (Permanent permanent : permanents) { - if (permanent.getControllerId().equals(playerId)) { + if (permanent.isControlledBy(playerId)) { amount++; } } diff --git a/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java b/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java index 9e23a771fe..5d1a729b30 100644 --- a/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java +++ b/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java @@ -78,7 +78,7 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.isCreature() - && permanent.getControllerId().equals(this.controllerId) + && permanent.isControlledBy(this.controllerId) && !Objects.equals(event.getTargetId(), this.getSourceId())) { Effect effect = this.getEffects().get(0); // life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution) diff --git a/Mage.Sets/src/mage/cards/t/TrueNameNemesis.java b/Mage.Sets/src/mage/cards/t/TrueNameNemesis.java index 2ed94431b8..bc5fefd817 100644 --- a/Mage.Sets/src/mage/cards/t/TrueNameNemesis.java +++ b/Mage.Sets/src/mage/cards/t/TrueNameNemesis.java @@ -84,16 +84,16 @@ class ProtectionFromPlayerAbility extends ProtectionAbility { UUID playerId = (UUID) game.getState().getValue(this.getSourceId() + "_player"); if (playerId != null && source != null) { if (source instanceof Permanent) { - return !((Permanent) source).getControllerId().equals(playerId); + return !((Permanent) source).isControlledBy(playerId); } if (source instanceof Spell) { - return !((Spell) source).getControllerId().equals(playerId); + return !((Spell) source).isControlledBy(playerId); } if (source instanceof StackObject) { - return !((StackObject) source).getControllerId().equals(playerId); + return !((StackObject) source).isControlledBy(playerId); } if (source instanceof Card) { // e.g. for Vengeful Pharaoh - return !((Card) source).getOwnerId().equals(playerId); + return !((Card) source).isOwnedBy(playerId); } } return true; diff --git a/Mage.Sets/src/mage/cards/t/TsabosDecree.java b/Mage.Sets/src/mage/cards/t/TsabosDecree.java index 325c3479d4..422d34b075 100644 --- a/Mage.Sets/src/mage/cards/t/TsabosDecree.java +++ b/Mage.Sets/src/mage/cards/t/TsabosDecree.java @@ -84,7 +84,7 @@ class TsabosDecreeEffect extends OneShotEffect { FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent(); filterCreaturePermanent.add(new SubtypePredicate(SubType.byDescription(typeChoice.getChoice()))); for (Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent, source.getSourceId(), game)) { - if (creature.getControllerId().equals(targetPlayer.getId())) { + if (creature.isControlledBy(targetPlayer.getId())) { creature.destroy(source.getSourceId(), game, true); } } diff --git a/Mage.Sets/src/mage/cards/t/TuktukScrapper.java b/Mage.Sets/src/mage/cards/t/TuktukScrapper.java index f2b30cff51..c7b772f03c 100644 --- a/Mage.Sets/src/mage/cards/t/TuktukScrapper.java +++ b/Mage.Sets/src/mage/cards/t/TuktukScrapper.java @@ -78,7 +78,7 @@ class TuktukScrapperTriggeredAbility extends TriggeredAbilityImpl { return true; } if (permanent.hasSubtype(SubType.ALLY, game) - && permanent.getControllerId().equals(this.getControllerId())) { + && permanent.isControlledBy(this.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/Turnabout.java b/Mage.Sets/src/mage/cards/t/Turnabout.java index 7a0c468d93..47e2ae27a8 100644 --- a/Mage.Sets/src/mage/cards/t/Turnabout.java +++ b/Mage.Sets/src/mage/cards/t/Turnabout.java @@ -112,14 +112,14 @@ class TurnaboutEffect extends OneShotEffect { if (choiceImpl.getChoice().equals("Untap")) { filter.add(new TappedPredicate()); for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - if (permanent.getControllerId().equals(target)) { + if (permanent.isControlledBy(target)) { permanent.untap(game); } } } else { filter.add(Predicates.not(new TappedPredicate())); for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - if (permanent.getControllerId().equals(target)) { + if (permanent.isControlledBy(target)) { permanent.tap(game); } } diff --git a/Mage.Sets/src/mage/cards/t/TwilightShepherd.java b/Mage.Sets/src/mage/cards/t/TwilightShepherd.java index a6de912d3d..fe12c72f72 100644 --- a/Mage.Sets/src/mage/cards/t/TwilightShepherd.java +++ b/Mage.Sets/src/mage/cards/t/TwilightShepherd.java @@ -90,7 +90,7 @@ class TwilightShepherdEffect extends OneShotEffect { if (game.getState().getZoneChangeCounter(mor.getSourceId()) == mor.getZoneChangeCounter()) { Card card = game.getCard(mor.getSourceId()); if (card != null - && card.getOwnerId().equals(source.getControllerId())) { + && card.isOwnedBy(source.getControllerId())) { cardsToHand.add(card); } } diff --git a/Mage.Sets/src/mage/cards/t/TwistAllegiance.java b/Mage.Sets/src/mage/cards/t/TwistAllegiance.java index 19527d1eab..625aa01123 100644 --- a/Mage.Sets/src/mage/cards/t/TwistAllegiance.java +++ b/Mage.Sets/src/mage/cards/t/TwistAllegiance.java @@ -67,8 +67,8 @@ class TwistAllegianceEffect extends OneShotEffect { if (controller != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { // only creatures of controller & target opponent - if (permanent.getControllerId().equals(source.getControllerId()) || permanent.getControllerId().equals(targetOpponent.getId())) { - UUID newController = permanent.getControllerId().equals(source.getControllerId()) ? targetOpponent.getId() : source.getControllerId(); + if (permanent.isControlledBy(source.getControllerId()) || permanent.isControlledBy(targetOpponent.getId())) { + UUID newController = permanent.isControlledBy(source.getControllerId()) ? targetOpponent.getId() : source.getControllerId(); ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, true, newController); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java b/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java index edf1e27210..81b45ca907 100644 --- a/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java +++ b/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java @@ -92,7 +92,7 @@ class UnconventionalTacticsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.isCreature() - && permanent.getControllerId().equals(this.controllerId) + && permanent.isControlledBy(this.controllerId) && filter.match(permanent, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java b/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java index 4a9e3c1690..2953587af9 100644 --- a/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java +++ b/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java @@ -124,7 +124,7 @@ class UndeadAlchemistEffect extends ReplacementEffectImpl { if (damageEvent.isCombatDamage()) { UUID controllerId = source.getControllerId(); Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.hasSubtype(SubType.ZOMBIE, game) && permanent.getControllerId().equals(controllerId)) { + if (permanent != null && permanent.hasSubtype(SubType.ZOMBIE, game) && permanent.isControlledBy(controllerId)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java b/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java index 0fe3423522..d48aeec950 100644 --- a/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java +++ b/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java @@ -98,7 +98,7 @@ class UneshCriosphinxSovereignTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.getOwnerId().equals(controllerId) + && permanent.isOwnedBy(controllerId) && permanent.isCreature() && (event.getTargetId().equals(getSourceId()) || filter.match(permanent, game))) { return true; diff --git a/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java index 85ceb9e664..be270c6477 100644 --- a/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java @@ -80,7 +80,7 @@ class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent != null && permanent.isLand() && permanent.isControlledBy(this.getControllerId())) { if (permanent.hasSubtype(SubType.MOUNTAIN, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/v/ValeronWardens.java b/Mage.Sets/src/mage/cards/v/ValeronWardens.java index 905fbed1c2..e2d71a168f 100644 --- a/Mage.Sets/src/mage/cards/v/ValeronWardens.java +++ b/Mage.Sets/src/mage/cards/v/ValeronWardens.java @@ -69,7 +69,7 @@ class ValeronWardensTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - return permanent != null && permanent.getControllerId().equals(getControllerId()); + return permanent != null && permanent.isControlledBy(getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java b/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java index b57f1eed13..c29c57a9a2 100644 --- a/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java +++ b/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java @@ -120,7 +120,7 @@ class CastFromNonHandZoneTargetEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (getTargetPointer().getTargets(game, source).contains(objectId) - && source.getControllerId().equals(affectedControllerId)) { + && source.isControlledBy(affectedControllerId)) { Card card = game.getCard(objectId); if (card != null) { return true; diff --git a/Mage.Sets/src/mage/cards/v/VanquishersBanner.java b/Mage.Sets/src/mage/cards/v/VanquishersBanner.java index 327fef11cf..87a0cc004f 100644 --- a/Mage.Sets/src/mage/cards/v/VanquishersBanner.java +++ b/Mage.Sets/src/mage/cards/v/VanquishersBanner.java @@ -87,7 +87,7 @@ class DrawCardIfCreatureTypeAbility extends TriggeredAbilityImpl { if (spell != null && spell.isCreature() && spell.hasSubtype(subType, game) - && spell.getControllerId().equals(getControllerId())) { + && spell.isControlledBy(getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java b/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java index 9d8b364394..b08a759db3 100644 --- a/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java +++ b/Mage.Sets/src/mage/cards/v/VeilstoneAmulet.java @@ -72,7 +72,7 @@ class VeilstoneAmuletEffect extends ContinuousRuleModifyingEffectImpl { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { if (permanent.isCreature() && - permanent.getControllerId().equals(ability.getControllerId()) && + permanent.isControlledBy(ability.getControllerId()) && game.getPlayer(ability.getControllerId()).hasOpponent(event.getPlayerId(), game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/v/VengefulPharaoh.java b/Mage.Sets/src/mage/cards/v/VengefulPharaoh.java index a1e545299f..25d66d6245 100644 --- a/Mage.Sets/src/mage/cards/v/VengefulPharaoh.java +++ b/Mage.Sets/src/mage/cards/v/VengefulPharaoh.java @@ -109,7 +109,7 @@ class VengefulPharaohTriggeredAbility extends TriggeredAbilityImpl { } if (event.getType() == EventType.DAMAGED_PLANESWALKER && ((DamagedEvent) event).isCombatDamage()) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent != null && permanent.isControlledBy(this.getControllerId())) { if (!game.getPhase().getStep().equals(stepTriggeredPlansewalker) || game.getTurnNum() != turnTriggeredPlaneswalker) { stepTriggeredPlansewalker = game.getPhase().getStep(); turnTriggeredPlaneswalker = game.getTurnNum(); diff --git a/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java b/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java index 65c86cf7d6..130a194860 100644 --- a/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java +++ b/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java @@ -66,7 +66,7 @@ class VerdantSunsAvatarTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isCreature() - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { Effect effect = this.getEffects().get(0); // Life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution) effect.setValue("lifeSource", event.getTargetId()); diff --git a/Mage.Sets/src/mage/cards/v/VigilForTheLost.java b/Mage.Sets/src/mage/cards/v/VigilForTheLost.java index 463316ebc7..b5de68f55e 100644 --- a/Mage.Sets/src/mage/cards/v/VigilForTheLost.java +++ b/Mage.Sets/src/mage/cards/v/VigilForTheLost.java @@ -66,7 +66,7 @@ class VigilForTheLostTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p.getControllerId().equals(this.getControllerId()) && p.isCreature()) { + if (p.isControlledBy(this.getControllerId()) && p.isCreature()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/v/VizierOfRemedies.java b/Mage.Sets/src/mage/cards/v/VizierOfRemedies.java index 9eb1d5063c..2823ffa75b 100644 --- a/Mage.Sets/src/mage/cards/v/VizierOfRemedies.java +++ b/Mage.Sets/src/mage/cards/v/VizierOfRemedies.java @@ -76,7 +76,7 @@ class VizierOfRemediesReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (source != null && source.getControllerId() != null) { - if (source.getControllerId().equals(game.getControllerId(event.getTargetId())) + if (source.isControlledBy(game.getControllerId(event.getTargetId())) && event.getData() != null && event.getData().equals(CounterType.M1M1.getName()) && event.getAmount() > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java b/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java index f55d382826..cfca3c4884 100644 --- a/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java +++ b/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java @@ -160,7 +160,7 @@ class VizierOfTheMenagerieManaEffect extends AsThoughEffectImpl implements AsTho @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - if (source.getControllerId().equals(affectedControllerId)) { + if (source.isControlledBy(affectedControllerId)) { MageObject mageObject = game.getObject(objectId); return mageObject != null && mageObject.isCreature(); diff --git a/Mage.Sets/src/mage/cards/w/WakeThrasher.java b/Mage.Sets/src/mage/cards/w/WakeThrasher.java index c801aba05d..cea61f1738 100644 --- a/Mage.Sets/src/mage/cards/w/WakeThrasher.java +++ b/Mage.Sets/src/mage/cards/w/WakeThrasher.java @@ -67,7 +67,7 @@ class BecomesUntappedControlledPermanentTriggeredAbility extends TriggeredAbilit @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getPermanent(event.getTargetId()).getControllerId().equals(this.controllerId); + return game.getPermanent(event.getTargetId()).isControlledBy(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/cards/w/Warbringer.java b/Mage.Sets/src/mage/cards/w/Warbringer.java index bf29775672..4d40a5f31e 100644 --- a/Mage.Sets/src/mage/cards/w/Warbringer.java +++ b/Mage.Sets/src/mage/cards/w/Warbringer.java @@ -71,7 +71,7 @@ class WarbringerSpellsCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { return DashedCondition.instance.apply(game, abilityToModify); diff --git a/Mage.Sets/src/mage/cards/w/WarstormSurge.java b/Mage.Sets/src/mage/cards/w/WarstormSurge.java index 0849d7e543..71475721b2 100644 --- a/Mage.Sets/src/mage/cards/w/WarstormSurge.java +++ b/Mage.Sets/src/mage/cards/w/WarstormSurge.java @@ -62,7 +62,7 @@ class WarstormSurgeTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent.isCreature() - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { Effect effect = this.getEffects().get(0); effect.setValue("damageSource", event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/w/WebOfInertia.java b/Mage.Sets/src/mage/cards/w/WebOfInertia.java index 8d099bd7cd..6739e5cf82 100644 --- a/Mage.Sets/src/mage/cards/w/WebOfInertia.java +++ b/Mage.Sets/src/mage/cards/w/WebOfInertia.java @@ -105,7 +105,7 @@ class WebOfInertiaRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getControllerId().equals(attackerID); + return permanent.isControlledBy(attackerID); } @Override diff --git a/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java b/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java index a4dc0e26eb..207fd6e128 100644 --- a/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java +++ b/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java @@ -83,7 +83,7 @@ class WharfInfiltratorDiscardAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Card card = game.getCard(event.getTargetId()); - if (getControllerId().equals(event.getPlayerId()) && card != null && card.isCreature()) { + if (isControlledBy(event.getPlayerId()) && card != null && card.isCreature()) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/w/WheelOfSunAndMoon.java b/Mage.Sets/src/mage/cards/w/WheelOfSunAndMoon.java index 662038c9b8..af23559ad4 100644 --- a/Mage.Sets/src/mage/cards/w/WheelOfSunAndMoon.java +++ b/Mage.Sets/src/mage/cards/w/WheelOfSunAndMoon.java @@ -85,7 +85,7 @@ class WheelOfSunAndMoonEffect extends ReplacementEffectImpl { if (card != null) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null - && card.getOwnerId().equals(enchantment.getAttachedTo())) { + && card.isOwnedBy(enchantment.getAttachedTo())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WildDefiance.java b/Mage.Sets/src/mage/cards/w/WildDefiance.java index fa2787c995..6d2fd53615 100644 --- a/Mage.Sets/src/mage/cards/w/WildDefiance.java +++ b/Mage.Sets/src/mage/cards/w/WildDefiance.java @@ -63,7 +63,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(this.controllerId) && permanent.isCreature()) { + if (permanent != null && permanent.isControlledBy(this.controllerId) && permanent.isCreature()) { MageObject object = game.getObject(event.getSourceId()); if (object != null && object instanceof Spell) { Card c = (Spell) object; diff --git a/Mage.Sets/src/mage/cards/w/Willbreaker.java b/Mage.Sets/src/mage/cards/w/Willbreaker.java index 32c6e2669c..0c1faff0ba 100644 --- a/Mage.Sets/src/mage/cards/w/Willbreaker.java +++ b/Mage.Sets/src/mage/cards/w/Willbreaker.java @@ -67,7 +67,7 @@ class WillbreakerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(event.getPlayerId())) { + if (isControlledBy(event.getPlayerId())) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isCreature()) { Player controller = game.getPlayer(getControllerId()); diff --git a/Mage.Sets/src/mage/cards/w/WillingTestSubject.java b/Mage.Sets/src/mage/cards/w/WillingTestSubject.java index e68c4c3eb0..5b48449d82 100644 --- a/Mage.Sets/src/mage/cards/w/WillingTestSubject.java +++ b/Mage.Sets/src/mage/cards/w/WillingTestSubject.java @@ -79,7 +79,7 @@ class WillingTestSubjectTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) { + if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) { if (event.getAmount() >= 4) { return true; } diff --git a/Mage.Sets/src/mage/cards/w/WindingConstrictor.java b/Mage.Sets/src/mage/cards/w/WindingConstrictor.java index 0d780cdf00..3d113229f5 100644 --- a/Mage.Sets/src/mage/cards/w/WindingConstrictor.java +++ b/Mage.Sets/src/mage/cards/w/WindingConstrictor.java @@ -79,7 +79,7 @@ class WindingConstrictorPermanentEffect extends ReplacementEffectImpl { } return permanent != null && (permanent.isCreature() || permanent.isArtifact()) - && permanent.getControllerId().equals(source.getControllerId()); + && permanent.isControlledBy(source.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/w/WordOfUndoing.java b/Mage.Sets/src/mage/cards/w/WordOfUndoing.java index a249db86de..af5518c6ff 100644 --- a/Mage.Sets/src/mage/cards/w/WordOfUndoing.java +++ b/Mage.Sets/src/mage/cards/w/WordOfUndoing.java @@ -67,7 +67,7 @@ class WordOfUndoingReturnToHandEffect extends OneShotEffect { if (target != null) { for (UUID attachmentId : target.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getControllerId().equals(source.getControllerId()) + if (attachment != null && attachment.isControlledBy(source.getControllerId()) && attachment.hasSubtype(SubType.AURA, game) && attachment.getColor(game).isWhite()) { attachments.add(attachment); } diff --git a/Mage.Sets/src/mage/cards/w/WordsOfWar.java b/Mage.Sets/src/mage/cards/w/WordsOfWar.java index 86cd074ca9..927d2d5b3e 100644 --- a/Mage.Sets/src/mage/cards/w/WordsOfWar.java +++ b/Mage.Sets/src/mage/cards/w/WordsOfWar.java @@ -95,7 +95,7 @@ class WordsOfWarEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (!this.used) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/w/WordsOfWaste.java b/Mage.Sets/src/mage/cards/w/WordsOfWaste.java index dbbe02e3d4..3db705865e 100644 --- a/Mage.Sets/src/mage/cards/w/WordsOfWaste.java +++ b/Mage.Sets/src/mage/cards/w/WordsOfWaste.java @@ -75,6 +75,6 @@ class WordsOfWasteEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/w/WordsOfWilding.java b/Mage.Sets/src/mage/cards/w/WordsOfWilding.java index 4363863c31..ffe65dcdb5 100644 --- a/Mage.Sets/src/mage/cards/w/WordsOfWilding.java +++ b/Mage.Sets/src/mage/cards/w/WordsOfWilding.java @@ -75,6 +75,6 @@ class WordsOfWildingEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/w/WordsOfWind.java b/Mage.Sets/src/mage/cards/w/WordsOfWind.java index 13f7ad5851..da3860a089 100644 --- a/Mage.Sets/src/mage/cards/w/WordsOfWind.java +++ b/Mage.Sets/src/mage/cards/w/WordsOfWind.java @@ -95,7 +95,7 @@ class WordsOfWindEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (!this.used) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/w/WordsOfWorship.java b/Mage.Sets/src/mage/cards/w/WordsOfWorship.java index 7e2716d8ef..907167a265 100644 --- a/Mage.Sets/src/mage/cards/w/WordsOfWorship.java +++ b/Mage.Sets/src/mage/cards/w/WordsOfWorship.java @@ -81,7 +81,7 @@ class WordsOfWorshipEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (!this.used) { - return source.getControllerId().equals(event.getPlayerId()); + return source.isControlledBy(event.getPlayerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/w/WorldheartPhoenix.java b/Mage.Sets/src/mage/cards/w/WorldheartPhoenix.java index 3e0d059b64..12af950b7b 100644 --- a/Mage.Sets/src/mage/cards/w/WorldheartPhoenix.java +++ b/Mage.Sets/src/mage/cards/w/WorldheartPhoenix.java @@ -80,7 +80,7 @@ public final class WorldheartPhoenix extends CardImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(source.getSourceId()) && source.getControllerId().equals(affectedControllerId)) { + if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) { if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { Player player = game.getPlayer(affectedControllerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/w/Worship.java b/Mage.Sets/src/mage/cards/w/Worship.java index 53220fb1e1..3290eea0cf 100644 --- a/Mage.Sets/src/mage/cards/w/Worship.java +++ b/Mage.Sets/src/mage/cards/w/Worship.java @@ -58,7 +58,7 @@ class WorshipReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (source.getControllerId().equals(event.getPlayerId())) { + if (source.isControlledBy(event.getPlayerId())) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && (controller.getLife() - event.getAmount()) < 1 diff --git a/Mage.Sets/src/mage/cards/w/WortTheRaidmother.java b/Mage.Sets/src/mage/cards/w/WortTheRaidmother.java index bc160dda18..6fae146170 100644 --- a/Mage.Sets/src/mage/cards/w/WortTheRaidmother.java +++ b/Mage.Sets/src/mage/cards/w/WortTheRaidmother.java @@ -81,7 +81,7 @@ class WortGainConspireEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { for (StackObject stackObject : game.getStack()) { // only spells cast, so no copies of spells - if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { + if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; if (filter.match(stackObject, game)) { game.getState().addOtherAbility(spell.getCard(), conspireAbility); diff --git a/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java b/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java index b03f24343f..fbf46de1da 100644 --- a/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java +++ b/Mage.Sets/src/mage/cards/y/YawgmothsAgenda.java @@ -135,7 +135,7 @@ class YawgmothsAgendaReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getOwnerId().equals(source.getControllerId())) { + if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent == null || !(permanent instanceof PermanentToken)) { return true; diff --git a/Mage.Sets/src/mage/cards/y/YawgmothsWill.java b/Mage.Sets/src/mage/cards/y/YawgmothsWill.java index ada8e06646..8690dbd141 100644 --- a/Mage.Sets/src/mage/cards/y/YawgmothsWill.java +++ b/Mage.Sets/src/mage/cards/y/YawgmothsWill.java @@ -125,7 +125,7 @@ class YawgmothsWillReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getOwnerId().equals(source.getControllerId())) { + if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent == null || !(permanent instanceof PermanentToken)) { return true; diff --git a/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java b/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java index 2d2ccb801c..2f73bc5024 100644 --- a/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java +++ b/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java @@ -71,7 +71,7 @@ class YidrisMaelstromWielderGainCascadeEffect extends ContinuousEffectImpl { if (controller != null) { for (StackObject stackObject : game.getStack()) { // only spells cast, so no copies of spells - if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { + if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; if (spell.getFromZone() == Zone.HAND) { game.getState().addOtherAbility(spell.getCard(), cascadeAbility); diff --git a/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java b/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java index 8c7f524cf9..7b76cdcb2f 100644 --- a/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java +++ b/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java @@ -100,7 +100,7 @@ class ZadaHedronGrinderTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null - && (spell.getControllerId().equals(this.getControllerId())) + && (spell.isControlledBy(this.getControllerId())) && (spell.isInstant() || spell.isSorcery()); } diff --git a/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java b/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java index 4706cd7ccb..4c785c4197 100644 --- a/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java +++ b/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java @@ -69,7 +69,7 @@ class ZameckGuildmageEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.isCreature(); + return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(); } @Override diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index e39ab59a36..bf2a95d870 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -985,7 +985,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement int actualCount = 0; for (ExileZone exile : currentGame.getExile().getExileZones()) { for (Card card : exile.getCards(currentGame)) { - if (card.getOwnerId().equals(owner.getId())) { + if (card.isOwnedBy(owner.getId())) { actualCount++; } } @@ -1005,7 +1005,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement int actualCount = 0; for (ExileZone exile : currentGame.getExile().getExileZones()) { for (Card card : exile.getCards(currentGame)) { - if (card.getOwnerId().equals(owner.getId()) && card.getName().equals(cardName)) { + if (card.isOwnedBy(owner.getId()) && card.getName().equals(cardName)) { actualCount++; } } diff --git a/Mage/src/main/java/mage/abilities/ActivatedAbilityImpl.java b/Mage/src/main/java/mage/abilities/ActivatedAbilityImpl.java index aaf3ece406..6b48461d8f 100644 --- a/Mage/src/main/java/mage/abilities/ActivatedAbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/ActivatedAbilityImpl.java @@ -178,7 +178,7 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa break; case OWNER: Permanent permanent = game.getPermanent(getSourceId()); - if (!permanent.getOwnerId().equals(playerId)) { + if (!permanent.isOwnedBy(playerId)) { return ActivationStatus.getFalse(); } break; @@ -191,7 +191,7 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa Permanent enchantment = game.getPermanent(getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); - if (enchanted != null && enchanted.getControllerId().equals(playerId)) { + if (enchanted != null && enchanted.isControlledBy(playerId)) { break; } } @@ -223,7 +223,7 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa } else if (mageObject instanceof Plane) { return ((Plane) mageObject).getControllerId().equals(playerId); } else if (game.getState().getZone(this.sourceId) != Zone.BATTLEFIELD) { - return ((Card) mageObject).getOwnerId().equals(playerId); + return ((Card) mageObject).isOwnedBy(playerId); } } return false; diff --git a/Mage/src/main/java/mage/abilities/SpecialActions.java b/Mage/src/main/java/mage/abilities/SpecialActions.java index 716acff4d1..ed2da19d37 100644 --- a/Mage/src/main/java/mage/abilities/SpecialActions.java +++ b/Mage/src/main/java/mage/abilities/SpecialActions.java @@ -27,7 +27,7 @@ public class SpecialActions extends AbilitiesImpl { public LinkedHashMap getControlledBy(UUID controllerId, boolean manaAction) { LinkedHashMap controlledBy = new LinkedHashMap<>(); for (SpecialAction action: this) { - if (action.getControllerId().equals(controllerId) && action.isManaAction() == manaAction) { + if (action.isControlledBy(controllerId) && action.isManaAction() == manaAction) { controlledBy.put(action.id, action); } } diff --git a/Mage/src/main/java/mage/abilities/SpellAbility.java b/Mage/src/main/java/mage/abilities/SpellAbility.java index d6e29580d6..04e9d0cbc7 100644 --- a/Mage/src/main/java/mage/abilities/SpellAbility.java +++ b/Mage/src/main/java/mage/abilities/SpellAbility.java @@ -76,7 +76,7 @@ public class SpellAbility extends ActivatedAbilityImpl { MageObjectReference permittingSource = game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, null, playerId, game); if (permittingSource == null) { Card card = game.getCard(sourceId); - if (!(card != null && card.getOwnerId().equals(playerId))) { + if (!(card != null && card.isOwnedBy(playerId))) { return ActivationStatus.getFalse(); } } diff --git a/Mage/src/main/java/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java index 7ef05216fd..85716ef801 100644 --- a/Mage/src/main/java/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java @@ -31,7 +31,7 @@ public class AllyEntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl @Override public boolean checkTrigger(GameEvent event, Game game) { EntersTheBattlefieldEvent ebe = (EntersTheBattlefieldEvent) event; - return ebe.getTarget().getControllerId().equals(this.controllerId) + return ebe.getTarget().isControlledBy(this.controllerId) && (event.getTargetId().equals(this.getSourceId()) || (ebe.getTarget().hasSubtype(SubType.ALLY, game) && !event.getTargetId().equals(this.getSourceId()))); } diff --git a/Mage/src/main/java/mage/abilities/common/AttackedByCreatureTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AttackedByCreatureTriggeredAbility.java index d027297794..89c0741a67 100644 --- a/Mage/src/main/java/mage/abilities/common/AttackedByCreatureTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AttackedByCreatureTriggeredAbility.java @@ -60,7 +60,7 @@ public class AttackedByCreatureTriggeredAbility extends TriggeredAbilityImpl { UUID defendingPlayer = game.getCombat().getDefendingPlayerId(event.getSourceId(), game); Permanent attackingCreature = game.getPermanent(event.getSourceId()); if (filter.match(attackingCreature, game) - && getControllerId().equals(defendingPlayer) + && isControlledBy(defendingPlayer) && attackingCreature != null) { switch (setTargetPointer) { case PERMANENT: diff --git a/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java index 14e601238f..3b47bc1c16 100644 --- a/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java @@ -67,7 +67,7 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl { check = true; } else { Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null && planeswalker.isPlaneswalker() && planeswalker.getControllerId().equals(getControllerId())) { + if (planeswalker != null && planeswalker.isPlaneswalker() && planeswalker.isControlledBy(getControllerId())) { check = true; } } diff --git a/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java index 41ddae73ad..70eeed7514 100644 --- a/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java @@ -41,7 +41,7 @@ public class BecomesMonstrousTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isCreature() - && (permanent.getControllerId().equals(getControllerId()))) { + && (permanent.isControlledBy(getControllerId()))) { this.getEffects().setTargetPointer(new FixedTarget(permanent, game)); return true; } diff --git a/Mage/src/main/java/mage/abilities/common/BeginningOfDrawTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BeginningOfDrawTriggeredAbility.java index 04c2da9409..bb91497e55 100644 --- a/Mage/src/main/java/mage/abilities/common/BeginningOfDrawTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BeginningOfDrawTriggeredAbility.java @@ -77,7 +77,7 @@ public class BeginningOfDrawTriggeredAbility extends TriggeredAbilityImpl { Permanent attachment = game.getPermanent(sourceId); if (attachment != null && attachment.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); - if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { + if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) { if (getTargets().isEmpty()) { this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java index 9b725a3653..abbebcf05e 100644 --- a/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java @@ -79,7 +79,7 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { Permanent attachment = game.getPermanent(sourceId); if (attachment != null && attachment.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); - if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { + if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) { if (getTargets().isEmpty()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); diff --git a/Mage/src/main/java/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java index ee91ec32cb..49d7c0a70e 100644 --- a/Mage/src/main/java/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java @@ -91,7 +91,7 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl { Permanent attachment = game.getPermanent(sourceId); if (attachment != null && attachment.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); - if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { + if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) { if (setTargetPointer && getTargets().isEmpty()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); diff --git a/Mage/src/main/java/mage/abilities/common/ControlledCreaturesDealCombatDamagePlayerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/ControlledCreaturesDealCombatDamagePlayerTriggeredAbility.java index e16db409c8..71c0d50bde 100644 --- a/Mage/src/main/java/mage/abilities/common/ControlledCreaturesDealCombatDamagePlayerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ControlledCreaturesDealCombatDamagePlayerTriggeredAbility.java @@ -55,7 +55,7 @@ public class ControlledCreaturesDealCombatDamagePlayerTriggeredAbility extends T if (event.getType() == EventType.DAMAGED_PLAYER) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getControllerId().equals(this.getControllerId())) { + if (damageEvent.isCombatDamage() && p != null && p.isControlledBy(this.getControllerId())) { madeDamage = true; damagedPlayerIds.add(event.getPlayerId()); } diff --git a/Mage/src/main/java/mage/abilities/common/CreatureEntersBattlefieldTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/CreatureEntersBattlefieldTriggeredAbility.java index 19ee35058a..ba3e9555d7 100644 --- a/Mage/src/main/java/mage/abilities/common/CreatureEntersBattlefieldTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/CreatureEntersBattlefieldTriggeredAbility.java @@ -94,7 +94,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (filter.match(permanent, sourceId, controllerId, game) - && (permanent.getControllerId().equals(this.controllerId) ^ opponentController)) { + && (permanent.isControlledBy(this.controllerId) ^ opponentController)) { if (!this.getTargets().isEmpty()) { Target target = this.getTargets().get(0); if (target instanceof TargetPlayer) { diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAttachedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAttachedTriggeredAbility.java index d3ff537c9b..9fdf532e9f 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAttachedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAttachedTriggeredAbility.java @@ -67,7 +67,7 @@ public class DealsDamageToAPlayerAttachedTriggeredAbility extends TriggeredAbili } } if (targetController == TargetController.YOU) { - if (!this.getControllerId().equals(event.getPlayerId())) { + if (!this.isControlledBy(event.getPlayerId())) { return false; } } diff --git a/Mage/src/main/java/mage/abilities/common/EntersBattlefieldControlledTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/EntersBattlefieldControlledTriggeredAbility.java index 1b5434c950..0d273a2c80 100644 --- a/Mage/src/main/java/mage/abilities/common/EntersBattlefieldControlledTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/EntersBattlefieldControlledTriggeredAbility.java @@ -53,7 +53,7 @@ public class EntersBattlefieldControlledTriggeredAbility extends EntersBattlefie public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.getControllerId().equals(this.getControllerId()); + return permanent != null && permanent.isControlledBy(this.getControllerId()); } return false; } diff --git a/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java index ff91f35fb0..8598ec694e 100644 --- a/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java @@ -27,7 +27,7 @@ public class ExertCreatureControllerTriggeredAbility extends TriggeredAbilityImp @Override public boolean checkTrigger(GameEvent event, Game game) { - boolean weAreExerting = getControllerId().equals(event.getPlayerId()); + boolean weAreExerting = isControlledBy(event.getPlayerId()); Permanent exerted = game.getPermanent(event.getTargetId()); boolean exertedIsCreature = (exerted != null) && exerted.isCreature(); return weAreExerting && exertedIsCreature; diff --git a/Mage/src/main/java/mage/abilities/common/LandfallAbility.java b/Mage/src/main/java/mage/abilities/common/LandfallAbility.java index e31252feb0..3718685a67 100644 --- a/Mage/src/main/java/mage/abilities/common/LandfallAbility.java +++ b/Mage/src/main/java/mage/abilities/common/LandfallAbility.java @@ -48,7 +48,7 @@ public class LandfallAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isLand() - && permanent.getControllerId().equals(this.controllerId)) { + && permanent.isControlledBy(this.controllerId)) { triggeringLand = permanent; if (setTargetPointer == SetTargetPointer.PERMANENT) { for (Effect effect : getAllEffects()) { diff --git a/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java index a67372514e..df73e1f2ef 100644 --- a/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java @@ -51,7 +51,7 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { if (filter.match(zEvent.getTarget(), this.getSourceId(), this.getControllerId(), game)) { - if (onlyToControllerGraveyard && !this.getControllerId().equals(game.getOwnerId(zEvent.getTargetId()))) { + if (onlyToControllerGraveyard && !this.isControlledBy(game.getOwnerId(zEvent.getTargetId()))) { return false; } if (setTargetPointer) { diff --git a/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java index ffa9768a1d..a0d3c0f0e8 100644 --- a/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SpellCounteredControllerTriggeredAbility.java @@ -48,7 +48,7 @@ public class SpellCounteredControllerTriggeredAbility extends TriggeredAbilityIm if (stackObjectThatCountered == null) { stackObjectThatCountered = (StackObject) game.getLastKnownInformation(event.getSourceId(), Zone.STACK); } - if (stackObjectThatCountered != null && stackObjectThatCountered.getControllerId().equals(getControllerId())) { + if (stackObjectThatCountered != null && stackObjectThatCountered.isControlledBy(getControllerId())) { StackObject counteredStackObject = (StackObject) game.getLastKnownInformation(event.getTargetId(), Zone.STACK); return counteredStackObject != null && (counteredStackObject instanceof Spell); } diff --git a/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java index 310986bb28..23b8331c9c 100644 --- a/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java @@ -78,7 +78,7 @@ public class AtTheBeginOfMainPhaseDelayedTriggeredAbility extends DelayedTrigger Permanent attachment = game.getPermanent(sourceId); if (attachment != null && attachment.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); - if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { + if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java index 81b502a405..0fff4ee32a 100644 --- a/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java @@ -69,7 +69,7 @@ public class AtTheBeginOfNextEndStepDelayedTriggeredAbility extends DelayedTrigg Permanent attachment = game.getPermanent(sourceId); if (attachment != null && attachment.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); - if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { + if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) { correctEndPhase = true; } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java b/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java index ffe21e2839..ac0d85ce0e 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java @@ -24,7 +24,7 @@ public enum CommanderInPlayCondition implements Condition { if (controller != null) { for (UUID commanderId : controller.getCommandersIds()) { Permanent commander = game.getPermanent(commanderId); - if (commander != null && commander.getControllerId().equals(source.getControllerId())) { + if (commander != null && commander.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java index d609bb85d6..b327e6e214 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java @@ -16,6 +16,6 @@ public enum ControllerAttackedThisTurnCondition implements Condition { @Override public boolean apply(Game game, Ability source) { AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get(AttackedThisTurnWatcher.class.getSimpleName()); - return source.getControllerId().equals(game.getActivePlayerId()) && watcher != null && !watcher.getAttackedThisTurnCreatures().isEmpty(); + return source.isControlledBy(game.getActivePlayerId()) && watcher != null && !watcher.getAttackedThisTurnCreatures().isEmpty(); } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java index 30905d724e..4b95507e5a 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MeldCondition.java @@ -27,8 +27,8 @@ public class MeldCondition implements Condition { MageObject sourceMageObject = source.getSourceObjectIfItStillExists(game); if (sourceMageObject != null && sourceMageObject instanceof Permanent) { Permanent sourcePermanent = (Permanent) sourceMageObject; - if (sourcePermanent.getControllerId().equals(source.getControllerId()) - && sourcePermanent.getOwnerId().equals(source.getControllerId())) { + if (sourcePermanent.isControlledBy(source.getControllerId()) + && sourcePermanent.isOwnedBy(source.getControllerId())) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); filter.add(new NamePredicate(this.meldWithName)); filter.add(new OwnerIdPredicate(source.getControllerId())); diff --git a/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java index 2576e5c9ba..deffa175d8 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java @@ -15,7 +15,7 @@ public enum MonarchIsSourceControllerCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return source.getControllerId().equals(game.getMonarchId()); + return source.isControlledBy(game.getMonarchId()); } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java index 69a7ce9315..66c49c9618 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/PermanentsYouOwnThatOpponentsControlCount.java @@ -17,7 +17,7 @@ public class PermanentsYouOwnThatOpponentsControlCount implements DynamicValue { int count = 0; for (Permanent permanent : game.getBattlefield().getActivePermanents(sourceAbility.getControllerId(), game)) { - if (!permanent.getOwnerId().equals(permanent.getControllerId()) && permanent.getOwnerId().equals(sourceAbility.getControllerId())) { + if (!permanent.isOwnedBy(permanent.getControllerId()) && permanent.isOwnedBy(sourceAbility.getControllerId())) { if (opponentIds.contains(permanent.getControllerId())) { count++; } diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java index c0427d341e..374c7e3db3 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java @@ -465,7 +465,7 @@ public class ContinuousEffects implements Serializable { for (SpliceCardEffect effect : spliceCardEffects) { Set abilities = spliceCardEffects.getAbility(effect.getId()); for (Ability ability : abilities) { - if (ability.getControllerId().equals(playerId) && (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, null, null))) { + if (ability.isControlledBy(playerId) && (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, null, null))) { if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { spliceEffects.add(effect); break; diff --git a/Mage/src/main/java/mage/abilities/effects/GainAbilitySpellsEffect.java b/Mage/src/main/java/mage/abilities/effects/GainAbilitySpellsEffect.java index 6804ff9b86..11545d7d27 100644 --- a/Mage/src/main/java/mage/abilities/effects/GainAbilitySpellsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/GainAbilitySpellsEffect.java @@ -41,7 +41,7 @@ public class GainAbilitySpellsEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { for (Card card : game.getExile().getAllCards(game)) { - if (card.getOwnerId().equals(source.getControllerId()) && filter.match(card, game)) { + if (card.isOwnedBy(source.getControllerId()) && filter.match(card, game)) { game.getState().addOtherAbility(card, ability); } } @@ -61,7 +61,7 @@ public class GainAbilitySpellsEffect extends ContinuousEffectImpl { } } for (StackObject stackObject : game.getStack()) { - if (stackObject.getControllerId().equals(source.getControllerId())) { + if (stackObject.isControlledBy(source.getControllerId())) { Card card = game.getCard(stackObject.getSourceId()); if (card != null && filter.match(card, game)) { if (!card.getAbilities().contains(ability)) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeCounteredControlledEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeCounteredControlledEffect.java index 820431e0f1..78aafb7885 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeCounteredControlledEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeCounteredControlledEffect.java @@ -61,7 +61,7 @@ public class CantBeCounteredControlledEffect extends ContinuousRuleModifyingEffe @Override public boolean applies(GameEvent event, Ability source, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getControllerId().equals(source.getControllerId()) + if (spell != null && spell.isControlledBy(source.getControllerId()) && filterTarget.match(spell, source.getSourceId(), source.getControllerId(), game)) { if (filterSource == null) { return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreatureExploresTriggeredAbility.java b/Mage/src/main/java/mage/abilities/effects/common/CreatureExploresTriggeredAbility.java index 3ccefeef6b..12654a1b43 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreatureExploresTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreatureExploresTriggeredAbility.java @@ -26,7 +26,7 @@ public class CreatureExploresTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent creature = game.getPermanentOrLKIBattlefield(event.getTargetId()); if (creature != null) { - return creature.getControllerId().equals(getControllerId()); + return creature.isControlledBy(getControllerId()); } return false; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java index e95c011f0c..f7d139f97c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java @@ -61,7 +61,7 @@ public class DontUntapInControllersUntapStepAllEffect extends ContinuousRuleModi if (permanent != null) { switch(targetController) { case YOU: - if (!permanent.getControllerId().equals(source.getControllerId())) { + if (!permanent.isControlledBy(source.getControllerId())) { return false; } break; diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java index 541bdd908e..9371f56249 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java @@ -60,7 +60,7 @@ public class DontUntapInControllersUntapStepEnchantedEffect extends ContinuousRu Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null && event.getTargetId().equals(enchantment.getAttachedTo())) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null && permanent.getControllerId().equals(game.getActivePlayerId())) { + if (permanent != null && permanent.isControlledBy(game.getActivePlayerId())) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java index 636677a554..8c2d9842be 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java @@ -50,7 +50,7 @@ public class DontUntapInControllersUntapStepSourceEffect extends ContinuousRuleM if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getTargetId().equals(source.getSourceId())) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.getControllerId().equals(game.getActivePlayerId())) { + if (permanent != null && permanent.isControlledBy(game.getActivePlayerId())) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java index 9fca3ecdb7..82f48cce45 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java @@ -94,7 +94,7 @@ public class DontUntapInPlayersNextUntapStepAllEffect extends ContinuousRuleModi Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { Player controller = game.getPlayer(source.getControllerId()); - if (!permanent.getControllerId().equals(getTargetPointer().getFirst(game, source))) { + if (!permanent.isControlledBy(getTargetPointer().getFirst(game, source))) { return false; } if (controller != null && !game.isOpponent(controller, permanent.getControllerId())) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java index c6a2ab1542..f0cd06bc60 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java @@ -78,7 +78,7 @@ public class PutOnLibraryTargetEffect extends OneShotEffect { Cards cardsPlayer = new CardsImpl(); for (Iterator iterator = cards.iterator(); iterator.hasNext();) { Card next = iterator.next(); - if (next.getOwnerId().equals(owner.getId())) { + if (next.isOwnedBy(owner.getId())) { cardsPlayer.add(next); iterator.remove(); } @@ -97,7 +97,7 @@ public class PutOnLibraryTargetEffect extends OneShotEffect { Cards cardsPlayer = new CardsImpl(); for (Iterator iterator = permanents.iterator(); iterator.hasNext();) { Permanent next = iterator.next(); - if (next.getOwnerId().equals(owner.getId())) { + if (next.isOwnedBy(owner.getId())) { cardsPlayer.add(next); iterator.remove(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java index c3f6ed2d72..51252895a9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java @@ -57,7 +57,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect { for (Target target : source.getTargets()) { for (UUID targetId : target.getTargets()) { MageObject mageObject = game.getObject(targetId); - if (mageObject instanceof Spell && ((Spell) mageObject).isCopy()) { + if (mageObject instanceof Spell && mageObject.isCopy()) { copyIds.add(targetId); } else if (mageObject instanceof Card) { cards.add((Card) mageObject); @@ -68,7 +68,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect { for (UUID targetId : targetPointer.getTargets(game, source)) { MageObject mageObject = game.getObject(targetId); if (mageObject != null) { - if (mageObject instanceof Spell && ((Spell) mageObject).isCopy()) { + if (mageObject instanceof Spell && mageObject.isCopy()) { copyIds.add(targetId); } else { cards.add((Card) mageObject); diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceEffect.java index 26e828dc58..b4e9339de4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceEffect.java @@ -44,7 +44,7 @@ public class SacrificeSourceEffect extends OneShotEffect { if (sourceObject instanceof Permanent) { Permanent permanent = (Permanent) sourceObject; // you can only sacrifice a permanent you control - if (source.getControllerId().equals(permanent.getControllerId())) { + if (source.isControlledBy(permanent.getControllerId())) { return permanent.sacrifice(source.getSourceId(), game); } return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java index 667c0bb295..dbe05cd6b7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java @@ -27,7 +27,7 @@ public class SkipUntapOptionalSourceEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { return permanent.getId().equals(source.getSourceId()) - && permanent.getControllerId().equals(game.getActivePlayerId()) && // your untap step + && permanent.isControlledBy(game.getActivePlayerId()) && // your untap step permanent.isTapped(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java b/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java index 5841feef03..62f74e3598 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java @@ -86,7 +86,7 @@ public class WishEffect extends OneShotEffect { } if (alsoFromExile) { for (Card exileCard : exile) { - if (exileCard.getOwnerId().equals(source.getControllerId()) && filter.match(exileCard, game)) { + if (exileCard.isOwnedBy(source.getControllerId()) && filter.match(exileCard, game)) { filteredCards.add(exileCard); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java index 04aae7f845..09e122ede9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java @@ -38,7 +38,7 @@ public class CantAttackControllerAttachedEffect extends RestrictionEffect { return false; } Permanent planeswalker = game.getPermanent(defenderId); - return planeswalker == null || !planeswalker.getControllerId().equals(source.getControllerId()); + return planeswalker == null || !planeswalker.isControlledBy(source.getControllerId()); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java index fa228c16e6..b603326ddf 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java @@ -44,7 +44,7 @@ public class CantAttackYouOrPlaneswalkerAllEffect extends RestrictionEffect { return false; } Permanent planeswalker = game.getPermanent(defenderId); - return planeswalker == null || !planeswalker.getControllerId().equals(source.getControllerId()); + return planeswalker == null || !planeswalker.isControlledBy(source.getControllerId()); } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java index ebf276e561..0eef90ee66 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java @@ -56,7 +56,7 @@ public class CantAttackYouUnlessPayManaAllEffect extends PayCostToAttackBlockEff } } // attack target is controlling player - if (source.getControllerId().equals(event.getTargetId())) { + if (source.isControlledBy(event.getTargetId())) { return true; } // or attack target is a planeswalker of the controlling player @@ -64,7 +64,7 @@ public class CantAttackYouUnlessPayManaAllEffect extends PayCostToAttackBlockEff Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isPlaneswalker() - && permanent.getControllerId().equals(source.getControllerId())) { + && permanent.isControlledBy(source.getControllerId())) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/GoadAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/GoadAllEffect.java index d525e0b372..c24a7630db 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/GoadAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/GoadAllEffect.java @@ -33,7 +33,7 @@ public class GoadAllEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { - if (!creature.getControllerId().equals(source.getControllerId())) { + if (!creature.isControlledBy(source.getControllerId())) { Effect effect = new GoadTargetEffect(); effect.setTargetPointer(new FixedTarget(creature, game)); effect.apply(game, source); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java index 3d4470dd57..4f76c81b72 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/ActivateAbilitiesAnyTimeYouCouldCastInstantEffect.java @@ -44,7 +44,7 @@ public class ActivateAbilitiesAnyTimeYouCouldCastInstantEffect extends AsThoughE @Override public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game) { - return affectedAbility.getControllerId().equals(source.getControllerId()) + return affectedAbility.isControlledBy(source.getControllerId()) && activatedAbility.isInstance(affectedAbility); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java index 62d3492038..762e6539ae 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java @@ -51,7 +51,7 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID affectedSpellId, Ability source, UUID affectedControllerId, Game game) { - if (anyPlayer || source.getControllerId().equals(affectedControllerId)) { + if (anyPlayer || source.isControlledBy(affectedControllerId)) { Card card = game.getCard(affectedSpellId); return card != null && filter.match(card, game); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/ExchangeControlTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/ExchangeControlTargetEffect.java index e79074f1bc..37c32f864a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/ExchangeControlTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/ExchangeControlTargetEffect.java @@ -98,7 +98,7 @@ public class ExchangeControlTargetEffect extends ContinuousEffectImpl { } if (permanent1 != null && permanent2 != null) { // exchange works only for two different controllers - if (permanent1.getControllerId().equals(permanent2.getControllerId())) { + if (permanent1.isControlledBy(permanent2.getControllerId())) { // discard effect if controller of both permanents is the same discard(); return; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledSpellsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledSpellsEffect.java index 01becdd24b..e58f88cda6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledSpellsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledSpellsEffect.java @@ -48,7 +48,7 @@ public class GainAbilityControlledSpellsEffect extends ContinuousEffectImpl { if (player != null && permanent != null) { for (StackObject stackObject : game.getStack()) { // only spells cast, so no copies of spells - if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { + if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; if (filter.match(spell, game)) { if (!spell.getAbilities().contains(ability)) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java index 455fb38e09..993134026f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java @@ -83,7 +83,7 @@ public class GainControlTargetEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(permanentId); if (permanent != null) { targetStillExists = true; - if (!permanent.getControllerId().equals(controllingPlayerId)) { + if (!permanent.isControlledBy(controllingPlayerId)) { GameEvent loseControlEvent = GameEvent.getEvent(GameEvent.EventType.LOSE_CONTROL, permanentId, source.getId(), permanent.getControllerId()); if (game.replaceEvent(loseControlEvent)) { return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java index 5dd1ffdc77..35e63cc361 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java @@ -50,7 +50,7 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl { Card cardOnTop = game.getCard(objectId); if (cardOnTop != null && affectedControllerId.equals(source.getControllerId()) - && cardOnTop.getOwnerId().equals(source.getControllerId()) + && cardOnTop.isOwnedBy(source.getControllerId()) && (!cardOnTop.getManaCost().isEmpty() || cardOnTop.isLand()) && filter.match(cardOnTop, game)) { Player player = game.getPlayer(cardOnTop.getOwnerId()); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java index 1fd92243ec..76999b4f19 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java @@ -44,7 +44,7 @@ public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEff applied = Boolean.FALSE; } if (!applied && layer == Layer.RulesEffects) { - if (!source.getControllerId().equals(game.getActivePlayerId()) && game.getStep().getType() == PhaseStep.UNTAP) { + if (!source.isControlledBy(game.getActivePlayerId()) && game.getStep().getType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { boolean untap = true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java index aa2dcbe44d..d1ede8e3a3 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java @@ -39,7 +39,7 @@ public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends Continuous applied = Boolean.FALSE; } if (!applied && layer == Layer.RulesEffects) { - if (!source.getControllerId().equals(game.getActivePlayerId()) + if (!source.isControlledBy(game.getActivePlayerId()) && game.getStep() != null && game.getStep().getType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/AbilitiesCostReductionControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/AbilitiesCostReductionControllerEffect.java index 75e4ade46e..b0b53d2d82 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/AbilitiesCostReductionControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/AbilitiesCostReductionControllerEffect.java @@ -44,7 +44,7 @@ public class AbilitiesCostReductionControllerEffect extends CostModificationEffe @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - return abilityToModify.getControllerId().equals(source.getControllerId()) + return abilityToModify.isControlledBy(source.getControllerId()) && activatedAbility.isInstance(abilityToModify); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java index 9c1631f071..7023fc7884 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasementControllerEffect.java @@ -69,7 +69,7 @@ public class SpellsCostIncreasementControllerEffect extends CostModificationEffe @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { return this.filter.match(spell, game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java index bc2f1e2382..4947acadf2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java @@ -120,10 +120,10 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (onlyControlled && !abilityToModify.getControllerId().equals(source.getControllerId())) { + if (onlyControlled && !abilityToModify.isControlledBy(source.getControllerId())) { return false; } - if (controllerId != null && !abilityToModify.getControllerId().equals(controllerId)) { + if (controllerId != null && !abilityToModify.isControlledBy(controllerId)) { return false; } if (abilityToModify instanceof SpellAbility) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java index 55068aec82..a58c1a2cb0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java @@ -114,7 +114,7 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.getControllerId().equals(source.getControllerId())) { + if (abilityToModify.isControlledBy(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { return this.filter.match(spell, source.getSourceId(), source.getControllerId(), game); diff --git a/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java b/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java index ef351303bf..8e44391643 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java @@ -69,7 +69,7 @@ class AuraSwapEffect extends OneShotEffect { Permanent auraSourcePermanent = game.getPermanent(source.getSourceId()); if (auraSourcePermanent != null && auraSourcePermanent.hasSubtype(SubType.AURA, game) - && auraSourcePermanent.getOwnerId().equals(source.getControllerId())) { + && auraSourcePermanent.isOwnedBy(source.getControllerId())) { Permanent enchantedPermanent = game.getPermanent(auraSourcePermanent.getAttachedTo()); filterCardToCheck.add(new AuraCardCanAttachToPermanentId(enchantedPermanent.getId())); TargetCardInHand target = new TargetCardInHand(filterCardToCheck); diff --git a/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java b/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java index 66d3f4f063..7e2183feb2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java @@ -84,7 +84,7 @@ public class EvolveAbility extends TriggeredAbilityImpl { Permanent triggeringCreature = game.getPermanent(event.getTargetId()); if (triggeringCreature != null && triggeringCreature.isCreature() - && triggeringCreature.getControllerId().equals(this.controllerId)) { + && triggeringCreature.isControlledBy(this.controllerId)) { Permanent sourceCreature = game.getPermanent(sourceId); if (sourceCreature != null && isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java b/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java index 28fab9980a..2d0c6829bf 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java @@ -140,7 +140,7 @@ class HideawayLookAtFaceDownCardEffect extends AsThoughEffectImpl { // TODO: Does not handle if a player had the control of the land permanent some time before // we would need to add a watcher to handle this Permanent sourcePermanet = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (sourcePermanet != null && sourcePermanet.getControllerId().equals(affectedControllerId)) { + if (sourcePermanet != null && sourcePermanet.isControlledBy(affectedControllerId)) { ExileZone exile = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); Card card = game.getCard(objectId); if (exile != null && exile.contains(objectId) && card != null) { diff --git a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java index b32005c053..9a1de9fd98 100644 --- a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java @@ -107,7 +107,7 @@ class OfferingAsThoughEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability affectedAbility, Ability source, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(sourceId); - if (!card.getOwnerId().equals(source.getControllerId())) { + if (!card.isOwnedBy(source.getControllerId())) { return false; } // because can activate is always called twice, result from first call will be used diff --git a/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java b/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java index 12bf54f5aa..c6bac07f93 100644 --- a/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java @@ -49,7 +49,7 @@ public class RecoverAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - if (zEvent.getTarget().getOwnerId().equals(getControllerId()) + if (zEvent.getTarget().isOwnedBy(getControllerId()) && zEvent.getTarget().isCreature() && !zEvent.getTarget().getId().equals(getSourceId())) { return true; diff --git a/Mage/src/main/java/mage/abilities/keyword/RepairAbility.java b/Mage/src/main/java/mage/abilities/keyword/RepairAbility.java index 46e22d57fa..713b0d11fc 100644 --- a/Mage/src/main/java/mage/abilities/keyword/RepairAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/RepairAbility.java @@ -84,7 +84,7 @@ class RepairCastFromGraveyardEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId); + return source.isControlledBy(affectedControllerId); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java b/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java index e9289e3b8e..da422af6d8 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java @@ -78,7 +78,7 @@ public class SoulbondAbility extends EntersBattlefieldTriggeredAbility { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(getControllerId())) { if (permanent.isCreature()) { if (permanent.getId().equals(getSourceId())) { - if (permanent.getControllerId().equals(getControllerId())) { + if (permanent.isControlledBy(getControllerId())) { self = true; if (other) { return true; @@ -195,7 +195,7 @@ class SoulbondEntersOtherAbility extends EntersBattlefieldAllTriggeredAbility { // if you control both this creature and another creature and both are unpaired if (game.getBattlefield().countAll(filter, getControllerId(), game) > 0) { Permanent sourcePermanent = game.getPermanent(getSourceId()); - if (sourcePermanent != null && sourcePermanent.getControllerId().equals(getControllerId()) && sourcePermanent.getPairedCard() == null) { + if (sourcePermanent != null && sourcePermanent.isControlledBy(getControllerId()) && sourcePermanent.getPairedCard() == null) { return true; } } diff --git a/Mage/src/main/java/mage/cards/Card.java b/Mage/src/main/java/mage/cards/Card.java index 7408bc8b9c..bac8f59d40 100644 --- a/Mage/src/main/java/mage/cards/Card.java +++ b/Mage/src/main/java/mage/cards/Card.java @@ -168,4 +168,8 @@ public interface Card extends MageObject { boolean addAttachment(UUID permanentId, Game game); boolean removeAttachment(UUID permanentId, Game game); + + default boolean isOwnedBy(UUID controllerId){ + return getOwnerId().equals(controllerId); + } } diff --git a/Mage/src/main/java/mage/filter/predicate/other/OwnerPredicate.java b/Mage/src/main/java/mage/filter/predicate/other/OwnerPredicate.java index f70c92b5cb..1050e0d04a 100644 --- a/Mage/src/main/java/mage/filter/predicate/other/OwnerPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/other/OwnerPredicate.java @@ -30,18 +30,18 @@ public class OwnerPredicate implements ObjectPlayerPredicate> switch (targetOwner) { case YOU: - if (card.getOwnerId().equals(playerId)) { + if (card.isOwnedBy(playerId)) { return true; } break; case OPPONENT: - if (!card.getOwnerId().equals(playerId) + if (!card.isOwnedBy(playerId) && game.getPlayer(playerId).hasOpponent(card.getOwnerId(), game)) { return true; } break; case NOT_YOU: - if (!card.getOwnerId().equals(playerId)) { + if (!card.isOwnedBy(playerId)) { return true; } break; diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java index afcbfc3eaa..c8257e2c2d 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java @@ -17,7 +17,7 @@ public class AttachedToControlledPermanentPredicate implements ObjectPlayerPredi Permanent attachement = input.getObject(); if (attachement != null) { Permanent permanent = game.getPermanent(attachement.getAttachedTo()); - if (permanent != null && permanent.getControllerId().equals(input.getPlayerId())) { + if (permanent != null && permanent.isControlledBy(input.getPlayerId())) { return true; } } diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/ControllerPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/ControllerPredicate.java index 1a90b57cb4..d77c180f95 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/ControllerPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/ControllerPredicate.java @@ -28,7 +28,7 @@ public class ControllerPredicate implements ObjectPlayerPredicate input, Game game) { - return input.getObject().getControllerId().equals(game.getCombat().getDefendingPlayerId(input.getSourceId(), game)); + return input.getObject().isControlledBy(game.getCombat().getDefendingPlayerId(input.getSourceId(), game)); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java index a0326cb54e..fe044d827e 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java @@ -14,7 +14,7 @@ public class DefendingPlayerOwnsCardPredicate implements ObjectSourcePlayerPredi @Override public boolean apply(ObjectSourcePlayer input, Game game) { - return input.getObject().getOwnerId().equals(game.getCombat().getDefendingPlayerId(input.getSourceId(), game)); + return input.getObject().isOwnedBy(game.getCombat().getDefendingPlayerId(input.getSourceId(), game)); } @Override diff --git a/Mage/src/main/java/mage/game/Controllable.java b/Mage/src/main/java/mage/game/Controllable.java index aad1d744d1..025b8f3720 100644 --- a/Mage/src/main/java/mage/game/Controllable.java +++ b/Mage/src/main/java/mage/game/Controllable.java @@ -10,4 +10,8 @@ import java.util.UUID; public interface Controllable { UUID getControllerId(); UUID getId(); + + default boolean isControlledBy(UUID controllerID){ + return getControllerId().equals(controllerID); + } } diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 51e85962e7..abfd93c49d 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -1865,7 +1865,7 @@ public abstract class GameImpl implements Game, Serializable { //702.93e.: ...another player gains control // ...or the creature it's paired with leaves the battlefield. Permanent paired = perm.getPairedCard().getPermanent(this); - if (paired == null || !perm.getControllerId().equals(paired.getControllerId()) || paired.getPairedCard() == null) { + if (paired == null || !perm.isControlledBy(paired.getControllerId()) || paired.getPairedCard() == null) { perm.setPairedCard(null); if (paired != null && paired.getPairedCard() != null) { paired.setPairedCard(null); @@ -1876,7 +1876,7 @@ public abstract class GameImpl implements Game, Serializable { if (perm.getBandedCards() != null && !perm.getBandedCards().isEmpty()) { for (UUID bandedId : new ArrayList<>(perm.getBandedCards())) { Permanent banded = getPermanent(bandedId); - if (banded == null || !perm.getControllerId().equals(banded.getControllerId()) || !banded.getBandedCards().contains(perm.getId())) { + if (banded == null || !perm.isControlledBy(banded.getControllerId()) || !banded.getBandedCards().contains(perm.getId())) { perm.removeBandedCard(bandedId); if (banded != null && banded.getBandedCards().contains(perm.getId())) { banded.removeBandedCard(perm.getId()); @@ -1993,7 +1993,7 @@ public abstract class GameImpl implements Game, Serializable { } else if (target instanceof TargetCard) { Card attachedTo = getCard(perm.getAttachedTo()); if (attachedTo == null - || !((TargetCard) spellAbility.getTargets().get(0)).canTarget(perm.getControllerId(), perm.getAttachedTo(), spellAbility, this)) { + || !(spellAbility.getTargets().get(0)).canTarget(perm.getControllerId(), perm.getAttachedTo(), spellAbility, this)) { if (movePermanentToGraveyardWithInfo(perm)) { if (attachedTo != null) { attachedTo.removeAttachment(perm.getId(), this); @@ -2482,7 +2482,7 @@ public abstract class GameImpl implements Game, Serializable { Set toOutside = new HashSet<>(); for (Iterator it = getBattlefield().getAllPermanents().iterator(); it.hasNext();) { Permanent perm = it.next(); - if (perm.getOwnerId().equals(playerId)) { + if (perm.isOwnedBy(playerId)) { if (perm.getAttachedTo() != null) { Permanent attachedTo = getPermanent(perm.getAttachedTo()); if (attachedTo != null) { @@ -2500,7 +2500,7 @@ public abstract class GameImpl implements Game, Serializable { } toOutside.add(perm); // it.remove(); - } else if (perm.getControllerId().equals(player.getId())) { + } else if (perm.isControlledBy(player.getId())) { // and any effects which give that player control of any objects or players end Effects: for (ContinuousEffect effect : getContinuousEffects().getLayeredEffects(this)) { @@ -2533,7 +2533,7 @@ public abstract class GameImpl implements Game, Serializable { } // Then, if that player controlled any objects on the stack not represented by cards, those objects cease to exist. this.getState().getContinuousEffects().removeInactiveEffects(this); - getStack().removeIf(object -> object.getControllerId().equals(playerId)); + getStack().removeIf(object -> object.isControlledBy(playerId)); // Then, if there are any objects still controlled by that player, those objects are exiled. applyEffects(); // to remove control from effects removed meanwhile List permanents = this.getBattlefield().getAllActivePermanents(playerId); @@ -2545,7 +2545,7 @@ public abstract class GameImpl implements Game, Serializable { for (ExileZone exile : this.getExile().getExileZones()) { for (Iterator it = exile.iterator(); it.hasNext();) { Card card = this.getCard(it.next()); - if (card != null && card.getOwnerId().equals(playerId)) { + if (card != null && card.isOwnedBy(playerId)) { it.remove(); } } @@ -2579,13 +2579,12 @@ public abstract class GameImpl implements Game, Serializable { } } } - Iterator> it = gameCards.entrySet().iterator(); while (it.hasNext()) { Entry entry = it.next(); Card card = entry.getValue(); - if (card.getOwnerId().equals(playerId)) { + if (card.isOwnedBy(playerId)) { it.remove(); } } diff --git a/Mage/src/main/java/mage/game/combat/Combat.java b/Mage/src/main/java/mage/game/combat/Combat.java index 8fecec7c63..b9620a42cb 100644 --- a/Mage/src/main/java/mage/game/combat/Combat.java +++ b/Mage/src/main/java/mage/game/combat/Combat.java @@ -209,7 +209,7 @@ public class Combat implements Serializable, Copyable { possibleDefenders = new HashSet<>(); for (UUID objectId : defenders) { Permanent planeswalker = game.getPermanent(objectId); - if (planeswalker != null && planeswalker.getControllerId().equals(playerToAttack)) { + if (planeswalker != null && planeswalker.isControlledBy(playerToAttack)) { possibleDefenders.add(objectId); } else if (playerToAttack.equals(objectId)) { possibleDefenders.add(objectId); @@ -964,7 +964,7 @@ public class Combat implements Serializable, Copyable { if (creatureForcedToBlock == null) { break; } - if (!creatureForcedToBlock.getControllerId().equals(player.getId())) { + if (!creatureForcedToBlock.isControlledBy(player.getId())) { // ignore creatures controlled by other players continue; } @@ -1473,7 +1473,7 @@ public class Combat implements Serializable, Copyable { } if (group.defenderIsPlaneswalker) { Permanent permanent = game.getPermanent(group.getDefenderId()); - if (permanent.getControllerId().equals(defenderId)) { + if (permanent.isControlledBy(defenderId)) { return true; } } diff --git a/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java b/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java index 40675d7daf..755291e039 100644 --- a/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java @@ -60,7 +60,7 @@ class AjaniSteadfastPreventEffect extends PreventionEffectImpl { if (event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java b/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java index 8e91c02d57..246f783855 100644 --- a/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java @@ -59,7 +59,7 @@ class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getTarget().isArtifact() - && zEvent.getTarget().getOwnerId().equals(this.controllerId)) { + && zEvent.getTarget().isOwnedBy(this.controllerId)) { this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId())); return true; } diff --git a/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java b/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java index 318f07c375..1af6669798 100644 --- a/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TrailOfTheMageRingsPlane.java @@ -115,7 +115,7 @@ class TrailOfTheMageRingsReboundEffect extends ContinuousEffectImpl { } for (Iterator iterator = game.getStack().iterator(); iterator.hasNext();) { StackObject stackObject = iterator.next(); - if (stackObject instanceof Spell && stackObject.getControllerId().equals(source.getControllerId())) { + if (stackObject instanceof Spell && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; Card card = spell.getCard(); if (card != null) { diff --git a/Mage/src/main/java/mage/game/permanent/Battlefield.java b/Mage/src/main/java/mage/game/permanent/Battlefield.java index 58eac0788e..c9df6b058c 100644 --- a/Mage/src/main/java/mage/game/permanent/Battlefield.java +++ b/Mage/src/main/java/mage/game/permanent/Battlefield.java @@ -58,7 +58,7 @@ public class Battlefield implements Serializable { public int countAll(FilterPermanent filter, UUID controllerId, Game game) { return (int) field.values() .stream() - .filter(permanent -> permanent.getControllerId().equals(controllerId) + .filter(permanent -> permanent.isControlledBy(controllerId) && filter.match(permanent, game) && permanent.isPhasedIn()) .count(); @@ -124,7 +124,7 @@ public class Battlefield implements Serializable { public boolean contains(FilterPermanent filter, UUID controllerId, int num, Game game) { return field.values() .stream() - .filter(permanent -> permanent.getControllerId().equals(controllerId) + .filter(permanent -> permanent.isControlledBy(controllerId) && filter.match(permanent, game) && permanent.isPhasedIn()) .count() >= num; @@ -213,7 +213,7 @@ public class Battlefield implements Serializable { return field.values() .stream() .filter(perm -> perm.isPhasedIn() - && perm.getControllerId().equals(controllerId)) + && perm.isControlledBy(controllerId)) .collect(Collectors.toList()); } @@ -261,7 +261,7 @@ public class Battlefield implements Serializable { public List getAllActivePermanents(FilterPermanent filter, UUID controllerId, Game game) { return field.values() .stream() - .filter(perm -> perm.isPhasedIn() && perm.getControllerId().equals(controllerId) && filter.match(perm, game)) + .filter(perm -> perm.isPhasedIn() && perm.isControlledBy(controllerId) && filter.match(perm, game)) .collect(Collectors.toList()); } @@ -333,14 +333,14 @@ public class Battlefield implements Serializable { .stream() .filter(perm -> perm.getAbilities().containsKey(PhasingAbility.getInstance().getId()) && perm.isPhasedIn() && - perm.getControllerId().equals(controllerId)) + perm.isControlledBy(controllerId)) .collect(Collectors.toList()); } public List getPhasedOut(UUID controllerId) { return field.values() .stream() - .filter(perm -> !perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) + .filter(perm -> !perm.isPhasedIn() && perm.isControlledBy(controllerId)) .collect(Collectors.toList()); } diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index c729298ce4..3d137719f8 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -244,7 +244,7 @@ public class Spell extends StackObjImpl implements Card { // card will be copied during putOntoBattlefield, so the card of CardPermanent has to be changed // TODO: Find a better way to prevent bestow creatures from being effected by creature affecting abilities Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null && permanent instanceof PermanentCard) { + if (permanent instanceof PermanentCard) { permanent.setSpellAbility(ability); // otherwise spell ability without bestow will be set if (!card.getCardType().contains(CardType.CREATURE)) { card.addCardType(CardType.CREATURE); @@ -264,7 +264,7 @@ public class Spell extends StackObjImpl implements Card { updateOptionalCosts(0); if (controller.moveCards(card, Zone.BATTLEFIELD, ability, game, false, faceDown, false, null)) { Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null && permanent instanceof PermanentCard) { + if (permanent instanceof PermanentCard) { ((PermanentCard) permanent).getCard().addCardType(CardType.CREATURE); ((PermanentCard) permanent).getCard().getSubtype(game).remove(SubType.AURA); return true; diff --git a/Mage/src/main/java/mage/players/Library.java b/Mage/src/main/java/mage/players/Library.java index 5841a85ce9..3c896d5b83 100644 --- a/Mage/src/main/java/mage/players/Library.java +++ b/Mage/src/main/java/mage/players/Library.java @@ -101,7 +101,7 @@ public class Library implements Serializable { } public void putOnTop(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { + if (card.isOwnedBy(playerId)) { card.setZone(Zone.LIBRARY, game); library.addFirst(card.getId()); } else { @@ -125,7 +125,7 @@ public class Library implements Serializable { } public void putOnBottom(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { + if (card.isOwnedBy(playerId)) { card.setZone(Zone.LIBRARY, game); library.remove(card.getId()); library.add(card.getId()); diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index a552eb9ae1..423ae4e208 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -645,7 +645,7 @@ public abstract class PlayerImpl implements Player, Serializable { */ @Override public boolean putInHand(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { + if (card.isOwnedBy(playerId)) { card.setZone(Zone.HAND, game); this.hand.add(card); } else { @@ -834,7 +834,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean putInGraveyard(Card card, Game game) { - if (card.getOwnerId().equals(playerId)) { + if (card.isOwnedBy(playerId)) { this.graveyard.add(card); } else { return game.getPlayer(card.getOwnerId()).putInGraveyard(card, game); @@ -885,7 +885,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean putCardOnTopXOfLibrary(Card card, Game game, Ability source, int xFromTheTop) { - if (card.getOwnerId().equals(getId())) { + if (card.isOwnedBy(getId())) { if (library.size() + 1 < xFromTheTop) { putCardsOnBottomOfLibrary(new CardsImpl(card), game, source, true); } else { @@ -1556,7 +1556,7 @@ public abstract class PlayerImpl implements Player, Serializable { // that phased out indirectly won't phase in by itself, but instead phases in // along with the card it's attached to. Permanent attachedTo = game.getPermanent(permanent.getAttachedTo()); - if (!(attachedTo != null && attachedTo.getControllerId().equals(this.getId()))) { + if (!(attachedTo != null && attachedTo.isControlledBy(this.getId()))) { permanent.phaseOut(game, false); } } @@ -2325,7 +2325,7 @@ public abstract class PlayerImpl implements Player, Serializable { setStoredBookmark(game.bookmarkState()); // makes it possible to UNDO a declared attacker with costs from e.g. Propaganda } Permanent attacker = game.getPermanent(attackerId); - if (attacker != null && attacker.canAttack(defenderId, game) && attacker.getControllerId().equals(playerId)) { + if (attacker != null && attacker.canAttack(defenderId, game) && attacker.isControlledBy(playerId)) { if (!game.getCombat().declareAttacker(attackerId, defenderId, playerId, game)) { game.undo(playerId); } @@ -3023,7 +3023,7 @@ public abstract class PlayerImpl implements Player, Serializable { // activated abilities from objects in the command zone (emblems or commanders) for (CommandObject commandObject : game.getState().getCommand()) { for (ActivatedAbility ability : commandObject.getAbilities().getActivatedAbilities(Zone.COMMAND)) { - if (ability.getControllerId().equals(getId()) && canPlay(ability, availableMana, game.getObject(ability.getSourceId()), game)) { + if (ability.isControlledBy(getId()) && canPlay(ability, availableMana, game.getObject(ability.getSourceId()), game)) { playableActivated.put(ability.toString(), ability); } @@ -3578,7 +3578,7 @@ public abstract class PlayerImpl implements Player, Serializable { game.informPlayers(getLogName() + " puts " + (withName ? card.getLogName() : (card.isFaceDown(game) ? "a face down card" : "a card")) + " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' - + (card.getOwnerId().equals(this.getId()) ? "into their hand" : "into its owner's hand") + + (card.isOwnedBy(this.getId()) ? "into their hand" : "into its owner's hand") ); } result = true; @@ -3601,7 +3601,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (cards.isEmpty()) { ownerId = card.getOwnerId(); } - if (card.getOwnerId().equals(ownerId)) { + if (card.isOwnedBy(ownerId)) { it.remove(); cards.add(card); } @@ -3672,7 +3672,7 @@ public abstract class PlayerImpl implements Player, Serializable { StringBuilder sb = new StringBuilder(this.getLogName()) .append(" puts ").append(card.getLogName()).append(' ').append(card.isCopy() ? "(Copy) " : "") .append(fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' : ""); - if (card.getOwnerId().equals(getId())) { + if (card.isOwnedBy(getId())) { sb.append("into their graveyard"); } else { sb.append("it into its owner's graveyard"); @@ -3704,7 +3704,7 @@ public abstract class PlayerImpl implements Player, Serializable { sb.append("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(' '); } sb.append("to the ").append(toTop ? "top" : "bottom"); - if (card.getOwnerId().equals(getId())) { + if (card.isOwnedBy(getId())) { sb.append(" of their library"); } else { Player player = game.getPlayer(card.getOwnerId()); diff --git a/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java b/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java index b2a4e937e3..86721777d3 100644 --- a/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java +++ b/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java @@ -34,7 +34,7 @@ public class TargetCardInASingleGraveyard extends TargetCard { Card card = game.getCard(firstTarget); Card targetCard = game.getCard(id); if (card == null || targetCard == null - || !card.getOwnerId().equals(targetCard.getOwnerId())) { + || !card.isOwnedBy(targetCard.getOwnerId())) { return false; } } diff --git a/Mage/src/main/java/mage/target/common/TargetCardInOpponentsGraveyard.java b/Mage/src/main/java/mage/target/common/TargetCardInOpponentsGraveyard.java index 13676b8da1..4ebbfa167f 100644 --- a/Mage/src/main/java/mage/target/common/TargetCardInOpponentsGraveyard.java +++ b/Mage/src/main/java/mage/target/common/TargetCardInOpponentsGraveyard.java @@ -40,7 +40,7 @@ public class TargetCardInOpponentsGraveyard extends TargetCard { if (game.getPlayer(source.getControllerId()).hasOpponent(card.getOwnerId(), game)) { if (allFromOneOpponent && !targets.isEmpty()) { Card firstCard = game.getCard(targets.keySet().iterator().next()); - if (firstCard != null && !card.getOwnerId().equals(firstCard.getOwnerId())) { + if (firstCard != null && !card.isOwnedBy(firstCard.getOwnerId())) { return false; } } diff --git a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentSameController.java b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentSameController.java index 107a65d47f..642440373a 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentSameController.java +++ b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentSameController.java @@ -31,7 +31,7 @@ public class TargetCreaturePermanentSameController extends TargetCreaturePermane Permanent targetPermanent = game.getPermanent(targetId); if (targetPermanent != null) { if (!firstTargetPermanent.getId().equals(targetPermanent.getId())) { - if (!firstTargetPermanent.getControllerId().equals(targetPermanent.getOwnerId())) { + if (!firstTargetPermanent.isControlledBy(targetPermanent.getOwnerId())) { return false; } } diff --git a/Mage/src/main/java/mage/target/common/TargetTriggeredAbility.java b/Mage/src/main/java/mage/target/common/TargetTriggeredAbility.java index b0bad5fe74..5efeb3552d 100644 --- a/Mage/src/main/java/mage/target/common/TargetTriggeredAbility.java +++ b/Mage/src/main/java/mage/target/common/TargetTriggeredAbility.java @@ -40,7 +40,7 @@ public class TargetTriggeredAbility extends TargetObject { return stackObject.getStackAbility() != null && (stackObject.getStackAbility() instanceof TriggeredAbility) && source != null - && stackObject.getStackAbility().getControllerId().equals(source.getControllerId()); + && stackObject.getStackAbility().isControlledBy(source.getControllerId()); } @Override @@ -53,7 +53,7 @@ public class TargetTriggeredAbility extends TargetObject { for (StackObject stackObject : game.getStack()) { if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility - && stackObject.getStackAbility().getControllerId().equals(sourceControllerId)) { + && stackObject.getStackAbility().isControlledBy(sourceControllerId)) { return true; } } @@ -71,7 +71,7 @@ public class TargetTriggeredAbility extends TargetObject { for (StackObject stackObject : game.getStack()) { if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility - && stackObject.getStackAbility().getControllerId().equals(sourceControllerId)) { + && stackObject.getStackAbility().isControlledBy(sourceControllerId)) { possibleTargets.add(stackObject.getStackAbility().getId()); } } From 6c000d917737d30471ec30e890d4a87053bfae79 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 4 Jul 2018 22:59:32 -0400 Subject: [PATCH 14/58] fixed Rowan Kenrith emblem not triggering (fixes #5109) --- .../main/java/mage/game/command/emblems/RowanKenrithEmblem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java b/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java index 5243df4bc1..46ecdbb4e6 100644 --- a/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java @@ -30,7 +30,7 @@ public class RowanKenrithEmblem extends Emblem { class RowanKenrithEmblemTriggeredAbility extends TriggeredAbilityImpl { RowanKenrithEmblemTriggeredAbility() { - super(Zone.BATTLEFIELD, new RowanKenrithEmblemEffect(), false); + super(Zone.COMMAND, new RowanKenrithEmblemEffect(), false); } RowanKenrithEmblemTriggeredAbility(final RowanKenrithEmblemTriggeredAbility ability) { From 1f7c7e90b288121f659893a59331dea74eaac7f3 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Thu, 5 Jul 2018 21:35:56 -0400 Subject: [PATCH 15/58] Implement Aetherflame Wall --- .../src/mage/cards/a/AetherflameWall.java | 50 +++++++++++++++++++ .../src/mage/cards/h/HeartwoodDryad.java | 31 +----------- .../src/mage/cards/w/WallOfDiffusion.java | 33 ++---------- Mage.Sets/src/mage/sets/TimeSpiral.java | 1 + .../CanBlockAsThoughtItHadShadowEffect.java | 38 ++++++++++++++ 5 files changed, 94 insertions(+), 59 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/a/AetherflameWall.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/CanBlockAsThoughtItHadShadowEffect.java diff --git a/Mage.Sets/src/mage/cards/a/AetherflameWall.java b/Mage.Sets/src/mage/cards/a/AetherflameWall.java new file mode 100644 index 0000000000..9579f21ccc --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AetherflameWall.java @@ -0,0 +1,50 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CanBlockAsThoughtItHadShadowEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; + +import java.util.UUID; + +/** + * + * @author noahg + */ +public final class AetherflameWall extends CardImpl { + + public AetherflameWall(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.WALL); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // Aetherflame Wall can block creatures with shadow as though they didn’t have shadow. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAsThoughtItHadShadowEffect(Duration.WhileOnBattlefield))); + + // {R}: Aetherflame Wall gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public AetherflameWall(final AetherflameWall card) { + super(card); + } + + @Override + public AetherflameWall copy() { + return new AetherflameWall(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HeartwoodDryad.java b/Mage.Sets/src/mage/cards/h/HeartwoodDryad.java index 3fe01db33e..88c2bc0c89 100644 --- a/Mage.Sets/src/mage/cards/h/HeartwoodDryad.java +++ b/Mage.Sets/src/mage/cards/h/HeartwoodDryad.java @@ -6,6 +6,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.common.CanBlockAsThoughtItHadShadowEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AsThoughEffectType; @@ -29,7 +30,7 @@ public final class HeartwoodDryad extends CardImpl { this.toughness = new MageInt(1); // Heartwood Dryad can block creatures with shadow as though Heartwood Dryad had shadow. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAsThoughtIthadShadowEffect(Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAsThoughtItHadShadowEffect(Duration.WhileOnBattlefield))); } public HeartwoodDryad(final HeartwoodDryad card) { @@ -40,32 +41,4 @@ public final class HeartwoodDryad extends CardImpl { public HeartwoodDryad copy() { return new HeartwoodDryad(this); } -} - -class CanBlockAsThoughtIthadShadowEffect extends AsThoughEffectImpl { - - public CanBlockAsThoughtIthadShadowEffect(Duration duration) { - super(AsThoughEffectType.BLOCK_SHADOW, duration, Outcome.Benefit); - staticText = "{this} can block creatures with shadow as though {this} had shadow"; - } - - public CanBlockAsThoughtIthadShadowEffect(final CanBlockAsThoughtIthadShadowEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CanBlockAsThoughtIthadShadowEffect copy() { - return new CanBlockAsThoughtIthadShadowEffect(this); - } - - @Override - public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return sourceId.equals(source.getSourceId()); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/w/WallOfDiffusion.java b/Mage.Sets/src/mage/cards/w/WallOfDiffusion.java index 0371561cfd..2e33018082 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfDiffusion.java +++ b/Mage.Sets/src/mage/cards/w/WallOfDiffusion.java @@ -6,6 +6,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.common.CanBlockAsThoughtItHadShadowEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +34,7 @@ public final class WallOfDiffusion extends CardImpl { // Defender this.addAbility(DefenderAbility.getInstance()); // Wall of Diffusion can block creatures with shadow as though Wall of Diffusion had shadow. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAsThoughtIthadShadowEffect(Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAsThoughtItHadShadowEffect(Duration.WhileOnBattlefield))); } public WallOfDiffusion(final WallOfDiffusion card) { @@ -44,32 +45,4 @@ public final class WallOfDiffusion extends CardImpl { public WallOfDiffusion copy() { return new WallOfDiffusion(this); } -} - -class CanBlockAsThoughtIthadShadowEffect extends AsThoughEffectImpl { - - public CanBlockAsThoughtIthadShadowEffect(Duration duration) { - super(AsThoughEffectType.BLOCK_SHADOW, duration, Outcome.Benefit); - staticText = "{this} can block creatures with shadow as though {this} had shadow"; - } - - public CanBlockAsThoughtIthadShadowEffect(final CanBlockAsThoughtIthadShadowEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CanBlockAsThoughtIthadShadowEffect copy() { - return new CanBlockAsThoughtIthadShadowEffect(this); - } - - @Override - public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return sourceId.equals(source.getSourceId()); - } - -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TimeSpiral.java b/Mage.Sets/src/mage/sets/TimeSpiral.java index dd82083812..44f41aa06d 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/TimeSpiral.java @@ -26,6 +26,7 @@ public final class TimeSpiral extends ExpansionSet { this.numBoosterRare = 1; this.ratioBoosterMythic = 0; cards.add(new SetCardInfo("Academy Ruins", 269, Rarity.RARE, mage.cards.a.AcademyRuins.class)); + cards.add(new SetCardInfo("Aetherflame Wall", 142, Rarity.COMMON, mage.cards.a.AetherflameWall.class)); cards.add(new SetCardInfo("Amrou Scout", 1, Rarity.COMMON, mage.cards.a.AmrouScout.class)); cards.add(new SetCardInfo("Amrou Seekers", 2, Rarity.COMMON, mage.cards.a.AmrouSeekers.class)); cards.add(new SetCardInfo("Ancestral Vision", 48, Rarity.RARE, mage.cards.a.AncestralVision.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CanBlockAsThoughtItHadShadowEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CanBlockAsThoughtItHadShadowEffect.java new file mode 100644 index 0000000000..2725b18636 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/CanBlockAsThoughtItHadShadowEffect.java @@ -0,0 +1,38 @@ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; + +import java.util.UUID; + +public class CanBlockAsThoughtItHadShadowEffect extends AsThoughEffectImpl { + + public CanBlockAsThoughtItHadShadowEffect(Duration duration) { + super(AsThoughEffectType.BLOCK_SHADOW, duration, Outcome.Benefit); + staticText = "{this} can block creatures with shadow as though {this} had shadow"; + } + + public CanBlockAsThoughtItHadShadowEffect(final CanBlockAsThoughtItHadShadowEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CanBlockAsThoughtItHadShadowEffect copy() { + return new CanBlockAsThoughtItHadShadowEffect(this); + } + + @Override + public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { + return sourceId.equals(source.getSourceId()); + } + +} From c169f078338eb163e1f14010188e0d401fbc89da Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 6 Jul 2018 09:20:29 -0400 Subject: [PATCH 16/58] fixed Ajani, Adversary of Tyrants emblem not triggereding (fixes #5115) --- .../command/emblems/AjaniAdversaryOfTyrantsEmblem.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java index 21f4e6ce1c..3a74eac9dd 100644 --- a/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/AjaniAdversaryOfTyrantsEmblem.java @@ -3,12 +3,13 @@ package mage.game.command.emblems; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.command.Emblem; import mage.game.permanent.token.CatToken2; /** * - * @author spjspj + * @author TheElk801 */ public class AjaniAdversaryOfTyrantsEmblem extends Emblem { @@ -17,8 +18,8 @@ public class AjaniAdversaryOfTyrantsEmblem extends Emblem { this.setName("Emblem Ajani"); this.setExpansionSetCodeForImage("M19"); this.getAbilities().add(new BeginningOfEndStepTriggeredAbility( - new CreateTokenEffect(new CatToken2(), 3), - TargetController.YOU, false + Zone.COMMAND, new CreateTokenEffect(new CatToken2(), 3), + TargetController.YOU, null, false )); } } From d7914bca440c79b4eb32b3f4da0bb930890d39ca Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 6 Jul 2018 09:46:59 -0400 Subject: [PATCH 17/58] fixed Tezzeret, Artifice Master emblem not triggering --- .../game/command/emblems/TezzeretArtificeMasterEmblem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java index 24376c9a17..397aac8c66 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TezzeretArtificeMasterEmblem.java @@ -3,13 +3,14 @@ package mage.game.command.emblems; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterPermanentCard; import mage.game.command.Emblem; import mage.target.common.TargetCardInLibrary; /** * - * @author spjspj + * @author TheElk801 */ public class TezzeretArtificeMasterEmblem extends Emblem { @@ -18,9 +19,10 @@ public class TezzeretArtificeMasterEmblem extends Emblem { this.setName("Emblem Tezzeret"); this.setExpansionSetCodeForImage("M19"); this.getAbilities().add(new BeginningOfEndStepTriggeredAbility( + Zone.COMMAND, new SearchLibraryPutInPlayEffect( new TargetCardInLibrary(new FilterPermanentCard()) - ), TargetController.YOU, false + ), TargetController.YOU, null, false )); } } From 30246732b8e5247349174ac4c9aa279256df9f3f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 6 Jul 2018 13:48:53 -0400 Subject: [PATCH 18/58] small verify fix --- Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java b/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java index 66db41dd0d..0ce811c3ee 100644 --- a/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java +++ b/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java @@ -33,7 +33,7 @@ import mage.watchers.Watcher; public final class PalladiaMorsTheRuiner extends CardImpl { public PalladiaMorsTheRuiner(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{R}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ELDER); From 36c004122ab525f53afec266018a09377de40fd8 Mon Sep 17 00:00:00 2001 From: Quercitron Date: Sun, 8 Jul 2018 01:19:49 +0300 Subject: [PATCH 19/58] Fix dual lands generation in the Core Set 2019 boosters --- Mage.Sets/src/mage/sets/CoreSet2019.java | 35 +++++-------------- .../mage/test/sets/BoosterGenerationTest.java | 16 +++++++++ .../main/java/mage/cards/ExpansionSet.java | 5 +-- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 64bdfbc750..525de25c51 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -30,8 +30,8 @@ public final class CoreSet2019 extends ExpansionSet { super("Core Set 2019", "M19", ExpansionSet.buildDate(2018, 7, 13), SetType.CORE); this.hasBoosters = true; this.hasBasicLands = true; - this.numBoosterSpecial = 1; - this.numBoosterLands = 0; + this.numBoosterSpecial = 0; + this.numBoosterLands = 1; this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; @@ -41,7 +41,8 @@ public final class CoreSet2019 extends ExpansionSet { // Core 2019 boosters have a 5/12 chance of basic land being replaced // with the common taplands, which DO NOT appear in the common slot. - this.ratioBoosterSpecialLand = 5/12; + this.ratioBoosterSpecialLand = 12; + this.ratioBoosterSpecialLandNumerator = 5; cards.add(new SetCardInfo("Abnormal Endurance", 85, Rarity.COMMON, mage.cards.a.AbnormalEndurance.class)); cards.add(new SetCardInfo("Act of Treason", 127, Rarity.COMMON, mage.cards.a.ActOfTreason.class)); @@ -362,7 +363,7 @@ public final class CoreSet2019 extends ExpansionSet { @Override public List getCardsByRarity(Rarity rarity) { - // Common cards retrievement of Fate Reforged boosters - prevent the retrievement of the common lands (e.g. Blossoming Sands) + // Common cards retrievement of Core Set 2019 boosters - prevent the retrievement of the common lands (e.g. Meandering River) if (rarity == Rarity.COMMON) { List savedCardsInfos = savedCards.get(rarity); if (savedCardsInfos == null) { @@ -381,20 +382,6 @@ public final class CoreSet2019 extends ExpansionSet { return super.getCardsByRarity(rarity); } } - - @Override - public List getSpecialCommon() { - List specialCommons = new ArrayList<>(); - if (savedSpecialCommon.isEmpty()) { - CardCriteria criteria = new CardCriteria(); - criteria.rarities(Rarity.COMMON).setCodes(this.code).types(CardType.LAND); - savedSpecialCommon = CardRepository.instance.findCards(criteria); - criteria.rarities(Rarity.LAND).setCodes(this.code); - savedSpecialCommon.addAll(CardRepository.instance.findCards(criteria)); - } - specialCommons.addAll(savedSpecialCommon); - return specialCommons; - } @Override // the common taplands replacing the basic land @@ -402,16 +389,10 @@ public final class CoreSet2019 extends ExpansionSet { { if (savedSpecialLand.isEmpty()) { - List TaplandNames = Arrays.asList( - "Cinder Barrens", "Forsaken Sanctuary", "Foul Orchard", - "Highland Lake", "Meandering River", "Stone Quarry", - "Submerged Boneyard", "Timber Gorge", "Tranquil Expanse", - "Woodland Stream" - ); - CardCriteria criteria = new CardCriteria(); - criteria.setCodes("M19"); - for (String name: TaplandNames) { criteria.nameExact(name); } + criteria.setCodes(this.code); + criteria.rarities(Rarity.COMMON); + criteria.types(CardType.LAND); savedSpecialLand.addAll(CardRepository.instance.findCards(criteria)); } diff --git a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java index 9511ab69d2..b6da9a2d9e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java @@ -7,6 +7,9 @@ import java.util.List; import mage.cards.Card; import mage.cards.repository.CardInfo; import mage.cards.repository.CardScanner; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.sets.CoreSet2019; import mage.sets.FateReforged; import mage.sets.MastersEditionII; import mage.sets.MastersEditionIV; @@ -99,6 +102,19 @@ public class BoosterGenerationTest extends MageTestBase { } } + @Test + public void testCoreSet2019_DualLandsAreGenerated() { + List allCards = new ArrayList<>(); + for (int i = 0; i < 50; i++) { + List booster = CoreSet2019.getInstance().createBooster(); + // check that booster contains a land card + assertTrue(booster.stream().anyMatch(card -> card.getCardType().contains(CardType.LAND))); + allCards.addAll(booster); + } + // check that some dual lands were generated + assertTrue(allCards.stream().anyMatch(card -> card.getCardType().contains(CardType.LAND) && card.getRarity().equals(Rarity.COMMON))); + } + private static String str(List cards) { StringBuilder sb = new StringBuilder("["); Iterator iterator = cards.iterator(); diff --git a/Mage/src/main/java/mage/cards/ExpansionSet.java b/Mage/src/main/java/mage/cards/ExpansionSet.java index 290ca6f63c..2e0750d00e 100644 --- a/Mage/src/main/java/mage/cards/ExpansionSet.java +++ b/Mage/src/main/java/mage/cards/ExpansionSet.java @@ -88,7 +88,8 @@ public abstract class ExpansionSet implements Serializable { protected int numBoosterSpecial; protected int numBoosterLands; - protected int ratioBoosterSpecialLand = 0; // if > 0 basic lands are replaced with special land in the ratio every X land is replaced by special land + protected int ratioBoosterSpecialLand = 0; // if > 0 basic lands are replaced with special land with probability ratioBoosterSpecialLandNumerator / ratioBoosterSpecialLand + protected int ratioBoosterSpecialLandNumerator = 1; protected int numBoosterCommon; protected int numBoosterUncommon; @@ -208,7 +209,7 @@ public abstract class ExpansionSet implements Serializable { List specialLands = getSpecialLand(); List basicLands = getCardsByRarity(Rarity.LAND); for (int i = 0; i < numBoosterLands; i++) { - if (ratioBoosterSpecialLand > 0 && RandomUtil.nextInt(ratioBoosterSpecialLand) == 0 && specialLands != null) { + if (ratioBoosterSpecialLand > 0 && RandomUtil.nextInt(ratioBoosterSpecialLand) < ratioBoosterSpecialLandNumerator && specialLands != null) { addToBooster(booster, specialLands); } else { addToBooster(booster, basicLands); From 35022d4ed35f03f300411e62c081760192970bde Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 8 Jul 2018 12:53:30 +1000 Subject: [PATCH 20/58] Add in new bar chart distribution for the 'M' mana analyse button. --- .../java/mage/client/cards/DragCardGrid.java | 36 ++++- .../java/mage/client/cards/ManaBarChart.java | 129 ++++++++++++++++++ 2 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index af83e6775b..1ccb6b745c 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -1083,10 +1083,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg } repaint(); } - + private void chooseMatching() { Collection toMatch = dragCardList(); - + for (DragCardGridListener l : listeners) { for (CardView card : allCards) { for (CardView aMatch : toMatch) { @@ -1337,6 +1337,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg public void analyseDeck() { HashMap qtys = new HashMap<>(); HashMap pips = new HashMap<>(); + HashMap pips_at_cmcs = new HashMap<>(); HashMap sourcePips = new HashMap<>(); HashMap manaCounts = new HashMap<>(); pips.put("#w}", 0); @@ -1397,10 +1398,31 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg mc = mc.replaceAll("\\{([WUBRG]).([WUBRG])\\}", "{$1}{$2}"); mc = mc.replaceAll("\\{", "#"); mc = mc.toLowerCase(Locale.ENGLISH); + int cmc = card.getConvertedManaCost(); + + // Do colorless mana pips + Pattern regex = Pattern.compile("#([0-9]+)}"); + Matcher regexMatcher = regex.matcher(mc); + while (regexMatcher.find()) { + String val = regexMatcher.group(1); + int colorless_val = Integer.parseInt(val); + int pip_value = 0; + if (pips_at_cmcs.get(cmc + "##c}") != null) { + pip_value = pips_at_cmcs.get(cmc + "##c}"); + } + pips_at_cmcs.put(cmc + "##c}", colorless_val + pip_value); + pips.put("#c}", colorless_val + pip_value); + } + for (String pip : pips.keySet()) { int value = pips.get(pip); while (mc.toLowerCase(Locale.ENGLISH).contains(pip)) { pips.put(pip, ++value); + int pip_value = 0; + if (pips_at_cmcs.get(cmc + "#" + pip) != null) { + pip_value = pips_at_cmcs.get(cmc + "#" + pip); + } + pips_at_cmcs.put(cmc + "#" + pip, ++pip_value); mc = mc.replaceFirst(pip, ""); } } @@ -1448,9 +1470,17 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg panel4.add(new JLabel("Mana sources found:")); panel4.add(chart3); + JPanel panel5 = new JPanel(); + panel5.setLayout(new BoxLayout(panel5, BoxLayout.Y_AXIS)); + ManaBarChart chart4 = new ManaBarChart(pips_at_cmcs); + chart4.setMinimumSize(new Dimension(200, 200)); + panel5.add(new JLabel("Mana distribution:")); + panel5.add(chart4); + panel.add(panel2); panel.add(panel3); panel.add(panel4); + panel.add(panel5); JFrame frame = new JFrame("JOptionPane showMessageDialog component example"); JOptionPane.showMessageDialog(frame, panel, "This is the distribution of colors found", JOptionPane.INFORMATION_MESSAGE); @@ -1719,7 +1749,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg JMenuItem invertSelection = new JMenuItem("Invert Selection"); invertSelection.addActionListener(e2 -> invertSelection()); menu.add(invertSelection); - + JMenuItem chooseMatching = new JMenuItem("Choose Matching"); chooseMatching.addActionListener(e2 -> chooseMatching()); menu.add(chooseMatching); diff --git a/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java b/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java new file mode 100644 index 0000000000..5d547a8dc7 --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java @@ -0,0 +1,129 @@ +package mage.client.cards; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.Stroke; +import java.awt.geom.Rectangle2D; +import java.util.HashMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.JComponent; + +public class ManaBarChart extends JComponent { + + HashMap pips_at_cmcs = new HashMap(); + + ManaBarChart() { + } + + ManaBarChart(HashMap pips_at_cmcs) { + this.pips_at_cmcs = pips_at_cmcs; + } + + @Override + public Dimension getPreferredSize() { + Dimension preferred = super.getPreferredSize(); + Dimension minimum = getMinimumSize(); + Dimension maximum = getMaximumSize(); + preferred.width = Math.min(Math.max(preferred.width, minimum.width), maximum.width); + preferred.height = Math.min(Math.max(preferred.height, minimum.height), maximum.height); + return preferred; + } + + public void paint(Graphics g) { + drawBar((Graphics2D) g, getBounds()); + } + + void drawBar(Graphics2D g, Rectangle area) { + Pattern regex = Pattern.compile("^([0-9]+)##(.)}"); + HashMap totals_at_cmcs = new HashMap(); + int max_num_pips = 0; + int max_cmc = 0; + + for (String key : pips_at_cmcs.keySet()) { + Matcher regexMatcher = regex.matcher(key); + int num_pips = pips_at_cmcs.get(key); + while (regexMatcher.find()) { + String cmc = regexMatcher.group(1); + int cmc_num = Integer.parseInt(cmc); + if (max_cmc < cmc_num) { + max_cmc = cmc_num; + } + + int total_at_cmc = 0; + if (totals_at_cmcs.get(cmc_num) != null) { + total_at_cmc = totals_at_cmcs.get(cmc_num); + } + totals_at_cmcs.put(cmc_num, total_at_cmc + num_pips); + if (max_num_pips < total_at_cmc + num_pips) { + max_num_pips = total_at_cmc + num_pips; + } + } + } + + int height_factor = 200 / max_num_pips; + int width_factor = 200 / (max_cmc + 2); + if (width_factor > 20) { + width_factor = 20; + } + if (width_factor < 11) { + width_factor = 11; + } + + g.setColor(Color.LIGHT_GRAY); + for (int i = 0; i < max_num_pips; i++) { + if (i % 10 == 0) { + g.drawLine(0, 200 - 1 - i * height_factor, 400, 200 - 1 - i * height_factor); + } else if (i % 10 == 5) { + Stroke dashed = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{5}, 0); + Stroke oldstroke = g.getStroke(); + g.setStroke(dashed); + g.drawLine(0, 200 - 1 - i * height_factor, 400, 200 - 1 - i * height_factor); + g.setStroke(oldstroke); + } + } + + HashMap running_totals_at_cmcs = new HashMap(); + for (String key : pips_at_cmcs.keySet()) { + Matcher regexMatcher = regex.matcher(key); + int num_pips = pips_at_cmcs.get(key); + while (regexMatcher.find()) { + String cmc = regexMatcher.group(1); + int cmc_num = Integer.parseInt(cmc); + String color = regexMatcher.group(2); + + int total_at_cmc = 0; + if (running_totals_at_cmcs.get(cmc_num) != null) { + total_at_cmc = running_totals_at_cmcs.get(cmc_num); + } + + if (color.equalsIgnoreCase("w")) { + g.setColor(Color.WHITE); + } + if (color.equalsIgnoreCase("u")) { + g.setColor(Color.BLUE); + } + if (color.equalsIgnoreCase("b")) { + g.setColor(Color.BLACK); + } + if (color.equalsIgnoreCase("r")) { + g.setColor(Color.RED); + } + if (color.equalsIgnoreCase("g")) { + g.setColor(Color.GREEN); + } + if (color.equalsIgnoreCase("c")) { + g.setColor(Color.DARK_GRAY); + } + g.fill(new Rectangle2D.Double(cmc_num * width_factor, 200 - total_at_cmc - num_pips * height_factor, 10, num_pips * height_factor)); + running_totals_at_cmcs.put(cmc_num, total_at_cmc + num_pips * height_factor); + } + } + + } +} From 9ececbbda8c3e1aa5abb13004b92fe3fb40a7db2 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 8 Jul 2018 12:59:59 +1000 Subject: [PATCH 21/58] Add in new bar chart distribution for the 'M' mana analyse button. --- Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java b/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java index 5d547a8dc7..c7b7f39e77 100644 --- a/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java +++ b/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java @@ -120,7 +120,7 @@ public class ManaBarChart extends JComponent { if (color.equalsIgnoreCase("c")) { g.setColor(Color.DARK_GRAY); } - g.fill(new Rectangle2D.Double(cmc_num * width_factor, 200 - total_at_cmc - num_pips * height_factor, 10, num_pips * height_factor)); + g.fill(new Rectangle2D.Double(cmc_num * width_factor, 200 - 1 - total_at_cmc - num_pips * height_factor, 10, num_pips * height_factor)); running_totals_at_cmcs.put(cmc_num, total_at_cmc + num_pips * height_factor); } } From e0bffcc5212a649bdbaae111646547f0734898f4 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 8 Jul 2018 13:09:38 +1000 Subject: [PATCH 22/58] Add in new bar chart distribution for the 'M' mana analyse button. --- Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index 1ccb6b745c..3738225d41 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -1408,7 +1408,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg int colorless_val = Integer.parseInt(val); int pip_value = 0; if (pips_at_cmcs.get(cmc + "##c}") != null) { - pip_value = pips_at_cmcs.get(cmc + "##c}"); + pip_value = pips.get("#c}"); } pips_at_cmcs.put(cmc + "##c}", colorless_val + pip_value); pips.put("#c}", colorless_val + pip_value); From d6450eed94ab974470a1a9fb7bb976cc0e7f392a Mon Sep 17 00:00:00 2001 From: igoudt Date: Sun, 8 Jul 2018 13:11:39 +0200 Subject: [PATCH 23/58] change enum comparison --- Mage.Sets/src/mage/cards/a/ArtifactPossession.java | 2 +- Mage.Sets/src/mage/cards/a/AshenGhoul.java | 4 ++-- Mage.Sets/src/mage/cards/a/AssaultSuit.java | 2 +- Mage.Sets/src/mage/cards/b/BloodSun.java | 7 +------ Mage.Sets/src/mage/cards/b/BoneyardScourge.java | 2 +- Mage.Sets/src/mage/cards/b/BreathOfFury.java | 2 +- Mage.Sets/src/mage/cards/b/BuildersBane.java | 2 +- Mage.Sets/src/mage/cards/c/CinderCloud.java | 2 +- Mage.Sets/src/mage/cards/c/CorrosiveOoze.java | 4 ++-- Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java | 2 +- Mage.Sets/src/mage/cards/f/Flickerform.java | 2 +- Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java | 2 +- Mage.Sets/src/mage/cards/h/Hellfire.java | 2 +- Mage.Sets/src/mage/cards/i/InstillEnergy.java | 2 +- Mage.Sets/src/mage/cards/j/JourneyToEternity.java | 2 +- Mage.Sets/src/mage/cards/k/KaerveksPurge.java | 2 +- Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java | 2 +- Mage.Sets/src/mage/cards/m/MoggInfestation.java | 2 +- Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java | 4 ++-- Mage.Sets/src/mage/cards/n/NetherTraitor.java | 2 +- Mage.Sets/src/mage/cards/p/Purgatory.java | 2 +- Mage.Sets/src/mage/cards/s/ShrivelingRot.java | 2 +- Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java | 2 +- Mage.Sets/src/mage/cards/t/TravelingPlague.java | 2 +- .../org/mage/test/game/ends/PhageTheUntouchableTest.java | 2 +- Mage/src/main/java/mage/abilities/AbilityImpl.java | 2 +- .../java/mage/abilities/costs/common/ExileSourceCost.java | 2 +- .../effects/common/continuous/AddCardTypeTargetEffect.java | 2 +- .../effects/common/replacement/DiesReplacementEffect.java | 2 +- .../mana/conditional/ConditionalSpellManaBuilder.java | 2 +- Mage/src/main/java/mage/designations/Monarch.java | 3 +-- Mage/src/main/java/mage/game/permanent/Permanent.java | 7 +++++++ 32 files changed, 41 insertions(+), 40 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/ArtifactPossession.java b/Mage.Sets/src/mage/cards/a/ArtifactPossession.java index 8725c3e104..5cd51f52b0 100644 --- a/Mage.Sets/src/mage/cards/a/ArtifactPossession.java +++ b/Mage.Sets/src/mage/cards/a/ArtifactPossession.java @@ -74,7 +74,7 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent aura = game.getPermanent(this.getSourceId()); - return aura != null && aura.getAttachedTo() != null && aura.getAttachedTo().equals(event.getSourceId()); + return aura != null && aura.isAttachedTo(event.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/a/AshenGhoul.java b/Mage.Sets/src/mage/cards/a/AshenGhoul.java index 7b8b0d3f81..b5ed0e24d7 100644 --- a/Mage.Sets/src/mage/cards/a/AshenGhoul.java +++ b/Mage.Sets/src/mage/cards/a/AshenGhoul.java @@ -61,8 +61,8 @@ enum AshenGhoulCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (!game.getStep().getType().equals(PhaseStep.UPKEEP) - || !game.getActivePlayerId().equals(source.getControllerId())) { + if (game.getStep().getType() != PhaseStep.UPKEEP + || !game.isActivePlayer(source.getControllerId())) { return false; } if (controller != null) { diff --git a/Mage.Sets/src/mage/cards/a/AssaultSuit.java b/Mage.Sets/src/mage/cards/a/AssaultSuit.java index 34afdccb51..3020310195 100644 --- a/Mage.Sets/src/mage/cards/a/AssaultSuit.java +++ b/Mage.Sets/src/mage/cards/a/AssaultSuit.java @@ -96,7 +96,7 @@ public final class AssaultSuit extends CardImpl { if (event.getType() == GameEvent.EventType.SACRIFICE_PERMANENT) { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { - return equipment.getAttachedTo().equals(event.getTargetId()); + return equipment.isAttachedTo(event.getTargetId()); } } return false; diff --git a/Mage.Sets/src/mage/cards/b/BloodSun.java b/Mage.Sets/src/mage/cards/b/BloodSun.java index 3782782b9b..efa84ba2eb 100644 --- a/Mage.Sets/src/mage/cards/b/BloodSun.java +++ b/Mage.Sets/src/mage/cards/b/BloodSun.java @@ -72,12 +72,7 @@ class BloodSunEffect extends ContinuousEffectImpl { for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS, player.getId(), source.getSourceId(), game)) { switch (layer) { case AbilityAddingRemovingEffects_6: - for (Iterator it = permanent.getAbilities().iterator(); it.hasNext();) { - Ability ability = it.next(); - if (!ability.getAbilityType().equals(AbilityType.MANA)) { - it.remove(); - } - } + permanent.getAbilities().removeIf(ability -> ability.getAbilityType() != AbilityType.MANA); break; } } diff --git a/Mage.Sets/src/mage/cards/b/BoneyardScourge.java b/Mage.Sets/src/mage/cards/b/BoneyardScourge.java index 7c409d64fc..4b61d29348 100644 --- a/Mage.Sets/src/mage/cards/b/BoneyardScourge.java +++ b/Mage.Sets/src/mage/cards/b/BoneyardScourge.java @@ -92,7 +92,7 @@ class DiesWhileInGraveyardTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; for (Zone z : Zone.values()) { - if (game.getShortLivingLKI(sourceId, z) && !z.equals(Zone.GRAVEYARD)) { + if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) { return false; } } diff --git a/Mage.Sets/src/mage/cards/b/BreathOfFury.java b/Mage.Sets/src/mage/cards/b/BreathOfFury.java index 2e8fb766f0..f493139fad 100644 --- a/Mage.Sets/src/mage/cards/b/BreathOfFury.java +++ b/Mage.Sets/src/mage/cards/b/BreathOfFury.java @@ -80,7 +80,7 @@ class BreathOfFuryAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(getSourceId()); if (damageEvent.isCombatDamage() && enchantment != null - && enchantment.getAttachedTo().equals(event.getSourceId())) { + && enchantment.isAttachedTo(event.getSourceId())) { Permanent creature = game.getPermanent(enchantment.getAttachedTo()); if (creature != null) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/b/BuildersBane.java b/Mage.Sets/src/mage/cards/b/BuildersBane.java index 6b90776cfa..094a17f47e 100644 --- a/Mage.Sets/src/mage/cards/b/BuildersBane.java +++ b/Mage.Sets/src/mage/cards/b/BuildersBane.java @@ -77,7 +77,7 @@ class BuildersBaneEffect extends OneShotEffect { if (permanent.destroy(source.getSourceId(), game, false)) { game.applyEffects(); if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId()) - && !game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as grvayard continue; } diff --git a/Mage.Sets/src/mage/cards/c/CinderCloud.java b/Mage.Sets/src/mage/cards/c/CinderCloud.java index 077dc5a04e..24d02c18e8 100644 --- a/Mage.Sets/src/mage/cards/c/CinderCloud.java +++ b/Mage.Sets/src/mage/cards/c/CinderCloud.java @@ -61,7 +61,7 @@ class CinderCloudEffect extends OneShotEffect { if (permanent != null && permanent.destroy(source.getSourceId(), game, false) && permanent.getColor(game).equals(ObjectColor.WHITE)) { game.applyEffects(); if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId()) - && !game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as grvayard return true; } diff --git a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java index dda0916a50..ac19501f19 100644 --- a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java +++ b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java @@ -175,8 +175,8 @@ class CorrosiveOozeCombatWatcher extends Watcher { } if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { - if (game.getTurn() != null && TurnPhase.COMBAT.equals(game.getTurn().getPhaseType())) { + if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { + if (game.getTurn() != null && TurnPhase.COMBAT == game.getTurn().getPhaseType()) { // Check if a previous blocked or blocked by creatures is leaving the battlefield for (Map.Entry> entry : oozeBlocksOrBlocked.entrySet()) { for (MageObjectReference mor : entry.getValue()) { diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java index 43dbcdb967..cc40d56084 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java @@ -36,7 +36,7 @@ public final class CurseOfTheSwine extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SpellAbility && ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability instanceof SpellAbility && ability.getAbilityType() == AbilityType.SPELL) { ability.getTargets().clear(); ability.addTarget(new TargetCreaturePermanent(ability.getManaCostsToPay().getX())); } diff --git a/Mage.Sets/src/mage/cards/f/Flickerform.java b/Mage.Sets/src/mage/cards/f/Flickerform.java index 042640a62d..550ae27ce6 100644 --- a/Mage.Sets/src/mage/cards/f/Flickerform.java +++ b/Mage.Sets/src/mage/cards/f/Flickerform.java @@ -182,7 +182,7 @@ class FlickerformReturnEffect extends OneShotEffect { if (!toBattlefieldAttached.isEmpty()) { controller.moveCards(toBattlefieldAttached, Zone.BATTLEFIELD, source, game); for (Card card : toBattlefieldAttached) { - if (game.getState().getZone(card.getId()).equals(Zone.BATTLEFIELD)) { + if (game.getState().getZone(card.getId()) == Zone.BATTLEFIELD) { newPermanent.addAttachment(card.getId(), game); } } diff --git a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java index 1bd6c487ec..74585b1ffe 100644 --- a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java +++ b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java @@ -119,7 +119,7 @@ class GarnaTheBloodflameWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone().equals(Zone.GRAVEYARD)) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && card.isCreature()) { cards.add(event.getTargetId()); diff --git a/Mage.Sets/src/mage/cards/h/Hellfire.java b/Mage.Sets/src/mage/cards/h/Hellfire.java index 3d7076eda0..b12ebf4b68 100644 --- a/Mage.Sets/src/mage/cards/h/Hellfire.java +++ b/Mage.Sets/src/mage/cards/h/Hellfire.java @@ -66,7 +66,7 @@ class HellfireEffect extends OneShotEffect { filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); for (Permanent creature : game.getState().getBattlefield().getActivePermanents(filter, controller.getId(), game)) { if (creature.destroy(source.getSourceId(), game, false) - && game.getState().getZone(creature.getId()).equals(Zone.GRAVEYARD)) { // If a commander is replaced to command zone, the creature does not die) { + && game.getState().getZone(creature.getId()) == Zone.GRAVEYARD) { // If a commander is replaced to command zone, the creature does not die) { destroyedCreature++; } } diff --git a/Mage.Sets/src/mage/cards/i/InstillEnergy.java b/Mage.Sets/src/mage/cards/i/InstillEnergy.java index f884141e31..a1c89de400 100644 --- a/Mage.Sets/src/mage/cards/i/InstillEnergy.java +++ b/Mage.Sets/src/mage/cards/i/InstillEnergy.java @@ -80,6 +80,6 @@ class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - return enchantment != null && enchantment.getAttachedTo() != null && enchantment.getAttachedTo().equals(objectId); + return enchantment != null && enchantment.isAttachedTo(objectId); } } diff --git a/Mage.Sets/src/mage/cards/j/JourneyToEternity.java b/Mage.Sets/src/mage/cards/j/JourneyToEternity.java index 1aebd7b437..365534cf3a 100644 --- a/Mage.Sets/src/mage/cards/j/JourneyToEternity.java +++ b/Mage.Sets/src/mage/cards/j/JourneyToEternity.java @@ -86,7 +86,7 @@ class JourneyToEternityReturnTransformedSourceEffect extends OneShotEffect { if (card != null && controller != null) { Zone zone = game.getState().getZone(card.getId()); // cards needs to be in public non battlefield zone - if (zone.equals(Zone.BATTLEFIELD) || !zone.isPublicZone()) { + if (zone == Zone.BATTLEFIELD || !zone.isPublicZone()) { return true; } game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); diff --git a/Mage.Sets/src/mage/cards/k/KaerveksPurge.java b/Mage.Sets/src/mage/cards/k/KaerveksPurge.java index 6028d89f01..591f109a1b 100644 --- a/Mage.Sets/src/mage/cards/k/KaerveksPurge.java +++ b/Mage.Sets/src/mage/cards/k/KaerveksPurge.java @@ -76,7 +76,7 @@ class KaerveksPurgeEffect extends OneShotEffect { if (targetCreature != null && targetCreature.destroy(source.getSourceId(), game, false)) { game.applyEffects(); if (targetCreature.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(targetCreature.getId()) - && !game.getState().getZone(targetCreature.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(targetCreature.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as graveyard return true; } diff --git a/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java b/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java index 551627d15c..6f54f2debc 100644 --- a/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java +++ b/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java @@ -74,7 +74,7 @@ class KalitasDestroyEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null && permanent.destroy(source.getSourceId(), game, false)) { // if not destroyed it returns false if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId()) - && !game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as grvayard return true; } diff --git a/Mage.Sets/src/mage/cards/m/MoggInfestation.java b/Mage.Sets/src/mage/cards/m/MoggInfestation.java index be7b4dc9a4..e0a05836ef 100644 --- a/Mage.Sets/src/mage/cards/m/MoggInfestation.java +++ b/Mage.Sets/src/mage/cards/m/MoggInfestation.java @@ -65,7 +65,7 @@ class MoggInfestationEffect extends OneShotEffect { if (controller != null && getTargetPointer().getFirst(game, source) != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) { if (permanent.destroy(source.getSourceId(), game, false)) { - if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { // If a commander is replaced to command zone, the creature does not die + if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) { // If a commander is replaced to command zone, the creature does not die Effect effect = new CreateTokenTargetEffect(new GoblinToken(), 2); effect.setTargetPointer(getTargetPointer()); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java index dfd13e4590..f80bf2ab4d 100644 --- a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java +++ b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java @@ -139,13 +139,13 @@ class MuldrothaTheGravetideWatcher extends Watcher { if (event.getType() == GameEvent.EventType.PLAY_LAND) { fromZone = game.getState().getZone(event.getTargetId()); // Remember the Zone the land came from } - if (event.getType() == GameEvent.EventType.LAND_PLAYED && fromZone.equals(Zone.GRAVEYARD)) { + if (event.getType() == GameEvent.EventType.LAND_PLAYED && fromZone == Zone.GRAVEYARD) { addPermanentTypes(event, game.getPermanentOrLKIBattlefield(event.getTargetId()), game); } if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell.getFromZone().equals(Zone.GRAVEYARD)) { + if (spell.getFromZone() == Zone.GRAVEYARD) { addPermanentTypes(event, spell, game); } } diff --git a/Mage.Sets/src/mage/cards/n/NetherTraitor.java b/Mage.Sets/src/mage/cards/n/NetherTraitor.java index e7d2ab58ac..269030fc48 100644 --- a/Mage.Sets/src/mage/cards/n/NetherTraitor.java +++ b/Mage.Sets/src/mage/cards/n/NetherTraitor.java @@ -75,7 +75,7 @@ class NetherTraitorTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; for (Zone z : Zone.values()) { - if (game.getShortLivingLKI(sourceId, z) && !z.equals(Zone.GRAVEYARD)) { + if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) { return false; } } diff --git a/Mage.Sets/src/mage/cards/p/Purgatory.java b/Mage.Sets/src/mage/cards/p/Purgatory.java index 1da37aebcc..7fdb5917e8 100644 --- a/Mage.Sets/src/mage/cards/p/Purgatory.java +++ b/Mage.Sets/src/mage/cards/p/Purgatory.java @@ -129,7 +129,7 @@ class PurgatoryExileEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); Card card = game.getCard(this.getTargetPointer().getFirst(game, source)); if (sourceController != null && exileId != null && sourceObject != null && card != null) { - if (game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { sourceController.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName()); } return true; diff --git a/Mage.Sets/src/mage/cards/s/ShrivelingRot.java b/Mage.Sets/src/mage/cards/s/ShrivelingRot.java index 9d2961830a..57c8db9535 100644 --- a/Mage.Sets/src/mage/cards/s/ShrivelingRot.java +++ b/Mage.Sets/src/mage/cards/s/ShrivelingRot.java @@ -148,7 +148,7 @@ class ShrivelingRotEffect extends OneShotEffect { Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (permanent != null) { if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId()) - && !game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) { // A replacement effect has moved the card to another zone as graveyard return true; } diff --git a/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java b/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java index a0c40edbe7..10dcad1ec4 100644 --- a/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java +++ b/Mage.Sets/src/mage/cards/s/SunbirdsInvocation.java @@ -64,7 +64,7 @@ class SunbirdsInvocationTriggeredAbility extends SpellCastControllerTriggeredAbi if (event.getPlayerId().equals(getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null - && spell.getFromZone().equals(Zone.HAND) + && spell.getFromZone() == Zone.HAND && spell.isOwnedBy(getControllerId())) { // must be from the controller's hand if (spell.getCard() != null) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/t/TravelingPlague.java b/Mage.Sets/src/mage/cards/t/TravelingPlague.java index 148be5c523..d079c2c44b 100644 --- a/Mage.Sets/src/mage/cards/t/TravelingPlague.java +++ b/Mage.Sets/src/mage/cards/t/TravelingPlague.java @@ -135,7 +135,7 @@ class TravelingPlagueEffect extends OneShotEffect { if (enchantedCreature != null) { Player controllerOfEnchantedCreature = game.getPlayer(enchantedCreature.getControllerId()); if (travelingPlague != null - && game.getState().getZone(travelingPlague.getId()).equals(Zone.GRAVEYARD) // aura must come from the graveyard + && game.getState().getZone(travelingPlague.getId()) == Zone.GRAVEYARD // aura must come from the graveyard && controllerOfEnchantedCreature != null) { TargetPermanent target = new TargetPermanent(new FilterCreaturePermanent("creature to enchant with " + travelingPlague.getName())); target.setNotTarget(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java b/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java index b068f3030d..8679e5c112 100644 --- a/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java @@ -44,7 +44,7 @@ public class PhageTheUntouchableTest extends CardTestPlayerBase { Assert.assertTrue("Game has ended.", currentGame.hasEnded()); Assert.assertTrue("Player A has won.", playerA.hasWon()); - Assert.assertTrue("Game ist At end phase", currentGame.getPhase().getType().equals(TurnPhase.END)); + Assert.assertTrue("Game ist At end phase", currentGame.getPhase().getType() == TurnPhase.END); } diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 4f63e57609..800b1242a3 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -910,7 +910,7 @@ public abstract class AbilityImpl implements Ability { } MageObject object = game.getObject(this.getSourceId()); // emblem/planes are always actual - if (object != null && (object instanceof Emblem || object instanceof Plane)) { + if (object instanceof Emblem || object instanceof Plane) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/costs/common/ExileSourceCost.java b/Mage/src/main/java/mage/abilities/costs/common/ExileSourceCost.java index 4414e063bc..5e460a9b44 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ExileSourceCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ExileSourceCost.java @@ -44,7 +44,7 @@ public class ExileSourceCost extends CostImpl { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { MageObject sourceObject = ability.getSourceObject(game); Player controller = game.getPlayer(controllerId); - if (controller != null && sourceObject != null && (sourceObject instanceof Card)) { + if (controller != null && sourceObject instanceof Card) { UUID exileZoneId = null; String exileZoneName = ""; if (toUniqueExileZone) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java index c3e07473ab..b8f0933039 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java @@ -88,7 +88,7 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl { sb.append(cardType.toString().toLowerCase(Locale.ENGLISH)).append(" "); } sb.append("in addition to its other types"); - if (getDuration().equals(Duration.EndOfTurn)) { + if (getDuration() == Duration.EndOfTurn) { sb.append(" until end of turn"); } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/replacement/DiesReplacementEffect.java b/Mage/src/main/java/mage/abilities/effects/common/replacement/DiesReplacementEffect.java index bf08c67125..12ece0c7b5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/replacement/DiesReplacementEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/replacement/DiesReplacementEffect.java @@ -29,7 +29,7 @@ public class DiesReplacementEffect extends ReplacementEffectImpl { public DiesReplacementEffect(MageObjectReference objectRef, Duration duration) { super(duration, Outcome.Exile); this.objectRef = objectRef; - staticText = "If that creature would die " + (duration.equals(Duration.EndOfTurn) ? "this turn" : "") + ", exile it instead"; + staticText = "If that creature would die " + (duration == Duration.EndOfTurn ? "this turn" : "") + ", exile it instead"; } public DiesReplacementEffect(final DiesReplacementEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java b/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java index c1d071e93f..86f5939b30 100644 --- a/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java +++ b/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java @@ -63,7 +63,7 @@ class SpellCastManaCondition extends ManaCondition implements Condition { public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - if (object != null && (object instanceof StackObject)) { + if ((object instanceof StackObject)) { return filter.match((StackObject) object, source.getSourceId(), source.getControllerId(), game); } } diff --git a/Mage/src/main/java/mage/designations/Monarch.java b/Mage/src/main/java/mage/designations/Monarch.java index b911345a94..0281b3c459 100644 --- a/Mage/src/main/java/mage/designations/Monarch.java +++ b/Mage/src/main/java/mage/designations/Monarch.java @@ -84,8 +84,7 @@ class MonarchDealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedPlayerEvent) event).isCombatDamage()) { MageObject damagingObject = game.getObject(event.getSourceId()); - if (damagingObject != null - && damagingObject instanceof Permanent + if (damagingObject instanceof Permanent && damagingObject.isCreature() && event.getTargetId().equals(game.getMonarchId())) { setControllerId(event.getPlayerId()); diff --git a/Mage/src/main/java/mage/game/permanent/Permanent.java b/Mage/src/main/java/mage/game/permanent/Permanent.java index da6a39a9fa..1e17d0e8a9 100644 --- a/Mage/src/main/java/mage/game/permanent/Permanent.java +++ b/Mage/src/main/java/mage/game/permanent/Permanent.java @@ -353,4 +353,11 @@ public interface Permanent extends Card, Controllable { void setCreateOrder(int createOrder); + default boolean isAttachedTo(UUID otherId){ + if(getAttachedTo() == null){ + return false; + } + return getAttachedTo().equals(otherId); + } + } From 6b9a2bb12cf0d420b0a7b9308e3fdf32615a5f0e Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 8 Jul 2018 21:28:25 +1000 Subject: [PATCH 24/58] Add in new bar chart distribution for the 'M' mana analyse button. --- .../java/mage/client/cards/DragCardGrid.java | 2 ++ .../java/mage/client/cards/ManaBarChart.java | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index 3738225d41..70dc871497 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -1397,6 +1397,8 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg } mc = mc.replaceAll("\\{([WUBRG]).([WUBRG])\\}", "{$1}{$2}"); mc = mc.replaceAll("\\{", "#"); + mc = mc.replaceAll("#2\\/", "#"); + mc = mc.replaceAll("p}", "}"); mc = mc.toLowerCase(Locale.ENGLISH); int cmc = card.getConvertedManaCost(); diff --git a/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java b/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java index c7b7f39e77..15ae7abb53 100644 --- a/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java +++ b/Mage.Client/src/main/java/mage/client/cards/ManaBarChart.java @@ -66,6 +66,9 @@ public class ManaBarChart extends JComponent { } } + if (max_num_pips <= 0) { + max_num_pips = 1; + } int height_factor = 200 / max_num_pips; int width_factor = 200 / (max_cmc + 2); if (width_factor > 20) { @@ -75,11 +78,21 @@ public class ManaBarChart extends JComponent { width_factor = 11; } - g.setColor(Color.LIGHT_GRAY); + g.setColor(new Color(130, 130, 130)); for (int i = 0; i < max_num_pips; i++) { - if (i % 10 == 0) { + if (max_num_pips > 10) { + if (i % 10 == 0) { + g.drawLine(0, 200 - 1 - i * height_factor, 400, 200 - 1 - i * height_factor); + } else if (i % 10 == 5) { + Stroke dashed = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{5}, 0); + Stroke oldstroke = g.getStroke(); + g.setStroke(dashed); + g.drawLine(0, 200 - 1 - i * height_factor, 400, 200 - 1 - i * height_factor); + g.setStroke(oldstroke); + } + } else if (i % 2 == 0) { g.drawLine(0, 200 - 1 - i * height_factor, 400, 200 - 1 - i * height_factor); - } else if (i % 10 == 5) { + } else if (i % 2 == 1) { Stroke dashed = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{5}, 0); Stroke oldstroke = g.getStroke(); g.setStroke(dashed); @@ -88,6 +101,15 @@ public class ManaBarChart extends JComponent { } } + for (int i = 0; i < 17; i++) { + if (i % 5 == 0) { + g.drawLine(width_factor * i, 200, width_factor * i, 190); + } else { + g.drawLine(width_factor * i, 200, width_factor * i, 195); + } + + } + HashMap running_totals_at_cmcs = new HashMap(); for (String key : pips_at_cmcs.keySet()) { Matcher regexMatcher = regex.matcher(key); From 417274f105713c4a9d62a4173d485e306e0c826b Mon Sep 17 00:00:00 2001 From: igoudt Date: Sun, 8 Jul 2018 13:37:43 +0200 Subject: [PATCH 25/58] fix Brine Shaman --- Mage.Sets/src/mage/cards/b/BrineShaman.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BrineShaman.java b/Mage.Sets/src/mage/cards/b/BrineShaman.java index 3b43cbe04d..2a2d0398ca 100644 --- a/Mage.Sets/src/mage/cards/b/BrineShaman.java +++ b/Mage.Sets/src/mage/cards/b/BrineShaman.java @@ -18,6 +18,8 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterSpell; import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; + +import mage.filter.StaticFilters; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; @@ -30,7 +32,7 @@ import mage.target.common.TargetCreaturePermanent; */ public final class BrineShaman extends CardImpl { - private static final FilterSpell filter = new FilterSpell("noncreature spell"); + private static final FilterSpell filter = new FilterSpell("creature spell"); static { filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); @@ -54,7 +56,7 @@ public final class BrineShaman extends CardImpl { ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); ability.addCost(new ManaCostsImpl("{1}{U}{U}")); - ability.addTarget(new TargetSpell(filter)); + ability.addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_CREATURE)); this.addAbility(ability); } From bc623fd2104b64ff8ab2fa1c74bffef9611f3722 Mon Sep 17 00:00:00 2001 From: igoudt Date: Sun, 8 Jul 2018 13:41:58 +0200 Subject: [PATCH 26/58] fix the eldest reborn --- Mage.Sets/src/mage/cards/t/TheEldestReborn.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/t/TheEldestReborn.java b/Mage.Sets/src/mage/cards/t/TheEldestReborn.java index f38a938116..666e52d657 100644 --- a/Mage.Sets/src/mage/cards/t/TheEldestReborn.java +++ b/Mage.Sets/src/mage/cards/t/TheEldestReborn.java @@ -14,6 +14,7 @@ import mage.constants.SubType; import mage.constants.TargetController; import mage.filter.FilterCard; import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInGraveyard; @@ -33,6 +34,15 @@ public final class TheEldestReborn extends CardImpl { )); } + private static final FilterControlledPermanent filterSacrifice = new FilterControlledPermanent("creature or planeswalker"); + static { + filterSacrifice.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.PLANESWALKER) + )); + + } + public TheEldestReborn(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}"); @@ -42,7 +52,7 @@ public final class TheEldestReborn extends CardImpl { SagaAbility sagaAbility = new SagaAbility(this, SagaChapter.CHAPTER_III); // I — Each opponent sacrifices a creature or planeswalker. sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, - new SacrificeOpponentsEffect(StaticFilters.FILTER_PERMANENT_CREATURE_OR_PLANESWALKER_A) + new SacrificeOpponentsEffect(filterSacrifice) ); // II — Each opponent discards a card. From 7f27b5b948f226caf71b0bb073266aa2b98c1594 Mon Sep 17 00:00:00 2001 From: igoudt Date: Sun, 8 Jul 2018 13:53:02 +0200 Subject: [PATCH 27/58] fix Archon of Valor's Reach not working for Planeswalkers --- Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java b/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java index f8166c4b1e..ffc743472c 100644 --- a/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java +++ b/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java @@ -133,7 +133,7 @@ class ArchonOfValorsReachChoice extends ChoiceImpl { return CardType.INSTANT; case "Sorcery": return CardType.SORCERY; - case "Planewswalker": + case "Planeswalker": return CardType.PLANESWALKER; default: return null; From 0162607ea19199960e48197bade0dcba077ccda7 Mon Sep 17 00:00:00 2001 From: igoudt Date: Sun, 8 Jul 2018 13:54:27 +0200 Subject: [PATCH 28/58] fix Order of Succession --- Mage.Sets/src/mage/cards/o/OrderOfSuccession.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java b/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java index e88e00e95c..eb366f17fe 100644 --- a/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java +++ b/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java @@ -70,7 +70,7 @@ class OrderOfSuccessionEffect extends OneShotEffect { if (controller != null) { Map playerCreature = new HashMap<>(2); Choice choice = new ChoiceLeftOrRight(); - if (controller.choose(Outcome.Neutral, choice, game)) { + if (!controller.choose(Outcome.Neutral, choice, game)) { return false; } boolean left = choice.getChoice().equals("Left"); From 992470e1ea1cba3a2db55231c0f119756df536a4 Mon Sep 17 00:00:00 2001 From: Quercitron Date: Sun, 8 Jul 2018 17:23:44 +0300 Subject: [PATCH 29/58] Fix that MaxCardNumberInBooster filter is applied incorrectly and only part of the commons is used for booster generation in the Core Set 2019, Dragon's Maze and Fate Reforged sets --- Mage.Sets/src/mage/sets/CoreSet2019.java | 6 +++--- Mage.Sets/src/mage/sets/DragonsMaze.java | 6 +++--- Mage.Sets/src/mage/sets/FateReforged.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 525de25c51..132743ef00 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -370,10 +370,10 @@ public final class CoreSet2019 extends ExpansionSet { CardCriteria criteria = new CardCriteria(); criteria.rarities(Rarity.COMMON); criteria.setCodes(this.code).notTypes(CardType.LAND); - if (maxCardNumberInBooster != Integer.MAX_VALUE) { - criteria.maxCardNumber(maxCardNumberInBooster); - } savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND); + } savedCards.put(rarity, savedCardsInfos); } // Return a copy of the saved cards information, as not to let modify the original. diff --git a/Mage.Sets/src/mage/sets/DragonsMaze.java b/Mage.Sets/src/mage/sets/DragonsMaze.java index d9e10a58ea..8e01820b2a 100644 --- a/Mage.Sets/src/mage/sets/DragonsMaze.java +++ b/Mage.Sets/src/mage/sets/DragonsMaze.java @@ -202,10 +202,10 @@ public final class DragonsMaze extends ExpansionSet { CardCriteria criteria = new CardCriteria(); criteria.setCodes(this.code).notTypes(CardType.LAND); criteria.rarities(rarity).doubleFaced(false); - if (maxCardNumberInBooster != Integer.MAX_VALUE) { - criteria.maxCardNumber(maxCardNumberInBooster); - } savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND); + } savedCards.put(rarity, savedCardsInfos); } // Return a copy of the saved cards information, as not to modify the original. diff --git a/Mage.Sets/src/mage/sets/FateReforged.java b/Mage.Sets/src/mage/sets/FateReforged.java index e500a7f1bf..0cc077d3ed 100644 --- a/Mage.Sets/src/mage/sets/FateReforged.java +++ b/Mage.Sets/src/mage/sets/FateReforged.java @@ -236,10 +236,10 @@ public final class FateReforged extends ExpansionSet { CardCriteria criteria = new CardCriteria(); criteria.rarities(Rarity.COMMON); criteria.setCodes(this.code).notTypes(CardType.LAND); - if (maxCardNumberInBooster != Integer.MAX_VALUE) { - criteria.maxCardNumber(maxCardNumberInBooster); - } savedCardsInfos = CardRepository.instance.findCards(criteria); + if (maxCardNumberInBooster != Integer.MAX_VALUE) { + savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND); + } savedCards.put(rarity, savedCardsInfos); } // Return a copy of the saved cards information, as not to let modify the original. From ae6256f65303210b18e4077ec94ffcca38f7311c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 8 Jul 2018 10:41:07 -0400 Subject: [PATCH 30/58] gauntlet of power text fix --- Mage.Sets/src/mage/cards/g/GauntletOfPower.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GauntletOfPower.java b/Mage.Sets/src/mage/cards/g/GauntletOfPower.java index 62d0bb6eae..9d14044b08 100644 --- a/Mage.Sets/src/mage/cards/g/GauntletOfPower.java +++ b/Mage.Sets/src/mage/cards/g/GauntletOfPower.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -164,7 +163,8 @@ class TapForManaAllTriggeredAbility extends TriggeredManaAbility { @Override public String getRule() { - return "Whenever " + filter.getMessage() + " for mana, " + super.getRule(); + return "Whenever a basic land is tapped for mana of the chosen color, " + + "its controller adds an additional one mana of that color."; } } @@ -172,7 +172,7 @@ class GauntletOfPowerEffectEffect2 extends ManaEffect { public GauntletOfPowerEffectEffect2() { super(); - staticText = "its controller adds one mana of that color"; + staticText = "its controller adds one additional mana of that color"; } public GauntletOfPowerEffectEffect2(final GauntletOfPowerEffectEffect2 effect) { From ec08ddf722f42efb0231bf80f9d21278efb0a698 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 8 Jul 2018 10:43:09 -0400 Subject: [PATCH 31/58] fixed Council's Judgment choice ambiguity --- Mage.Sets/src/mage/cards/c/CouncilsJudgment.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CouncilsJudgment.java b/Mage.Sets/src/mage/cards/c/CouncilsJudgment.java index beda5d4bf0..340c01444b 100644 --- a/Mage.Sets/src/mage/cards/c/CouncilsJudgment.java +++ b/Mage.Sets/src/mage/cards/c/CouncilsJudgment.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.HashMap; @@ -28,7 +27,7 @@ import mage.target.common.TargetNonlandPermanent; public final class CouncilsJudgment extends CardImpl { public CouncilsJudgment(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}"); // Will of the council - Starting with you, each player votes for a nonland permanent you don't control. Exile each permanent with the most votes or tied for most votes. this.getSpellAbility().addEffect(new CouncilsJudgmentEffect()); @@ -89,7 +88,7 @@ class CouncilsJudgmentEffect extends OneShotEffect { } chosenCards.put(permanent, 1); } - game.informPlayers(player.getLogName() + " has chosen: " + permanent.getName()); + game.informPlayers(player.getLogName() + " has chosen: " + permanent.getLogName()); } } } From 5744bfa843bca4a18229cf1df0e827fe4187b1a2 Mon Sep 17 00:00:00 2001 From: spjspj Date: Mon, 9 Jul 2018 01:15:07 +1000 Subject: [PATCH 32/58] Add in new bar chart distribution for the 'M' mana analyse button. --- .../java/mage/client/cards/DragCardGrid.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index 70dc871497..9521fc3753 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -1408,12 +1408,18 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg while (regexMatcher.find()) { String val = regexMatcher.group(1); int colorless_val = Integer.parseInt(val); - int pip_value = 0; - if (pips_at_cmcs.get(cmc + "##c}") != null) { - pip_value = pips.get("#c}"); + + int total_c_pip = 0; + if (pips.get("#c}") != null) { + total_c_pip = pips.get("#c}"); } - pips_at_cmcs.put(cmc + "##c}", colorless_val + pip_value); - pips.put("#c}", colorless_val + pip_value); + pips.put("#c}", colorless_val + total_c_pip); + + int cmc_pip_value = pips.get("#c}"); + if (pips_at_cmcs.get(cmc + "##c}") != null) { + cmc_pip_value = pips_at_cmcs.get(cmc + "##c}"); + } + pips_at_cmcs.put(cmc + "##c}", colorless_val + cmc_pip_value); } for (String pip : pips.keySet()) { From 1f39a3df51011d09ef7805519db6d078ad45d4f3 Mon Sep 17 00:00:00 2001 From: spjspj Date: Mon, 9 Jul 2018 01:35:57 +1000 Subject: [PATCH 33/58] .. --- Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index 9521fc3753..7ca2057605 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -1415,7 +1415,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg } pips.put("#c}", colorless_val + total_c_pip); - int cmc_pip_value = pips.get("#c}"); + int cmc_pip_value = 0; if (pips_at_cmcs.get(cmc + "##c}") != null) { cmc_pip_value = pips_at_cmcs.get(cmc + "##c}"); } From c91e56b937f33fa0c730ecd7e95a8e26758a810e Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 8 Jul 2018 22:01:37 -0400 Subject: [PATCH 34/58] Fix Rite of Belzenlok token not damaging its controller --- .../mage/game/permanent/token/BelzenlokDemonToken.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Mage/src/main/java/mage/game/permanent/token/BelzenlokDemonToken.java b/Mage/src/main/java/mage/game/permanent/token/BelzenlokDemonToken.java index 4ba0d93601..81883c03a1 100644 --- a/Mage/src/main/java/mage/game/permanent/token/BelzenlokDemonToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/BelzenlokDemonToken.java @@ -21,6 +21,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; /** * @@ -94,9 +95,9 @@ class BelzenlokDemonTokenEffect extends OneShotEffect { if (otherCreatures > 0) { new SacrificeControllerEffect(filter, 1, "").apply(game, source); } else { - Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (permanent != null) { - permanent.damage(6, permanent.getId(), game, false, true); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.damage(6, source.getSourceId(), game, false, true); } } return true; From 11dffe2182b5290b5fb6afec73ec7828bf595c6c Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 8 Jul 2018 22:10:13 -0400 Subject: [PATCH 35/58] Fix Chaos Wand --- Mage.Sets/src/mage/cards/c/ChaosWand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/c/ChaosWand.java b/Mage.Sets/src/mage/cards/c/ChaosWand.java index 1a13b28d8e..f5f790060a 100644 --- a/Mage.Sets/src/mage/cards/c/ChaosWand.java +++ b/Mage.Sets/src/mage/cards/c/ChaosWand.java @@ -82,14 +82,16 @@ class ChaosWandEffect extends OneShotEffect { break; } opponent.moveCards(card, Zone.EXILED, source, game); + controller.revealCards(source, new CardsImpl(card), game); if (card.isInstant() || card.isSorcery()) { if (!controller.chooseUse(outcome, "Cast " + card.getName() + " without paying its mana cost?", source, game) || !controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) { cardsToShuffle.add(card); } break; + } else { + cardsToShuffle.add(card); } - cardsToShuffle.add(card); } return opponent.putCardsOnBottomOfLibrary(cardsToShuffle, game, source, false); } From b8be6f72d4591e2cd2c319b5c68cfd1237c9e2ce Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sun, 8 Jul 2018 22:48:51 -0400 Subject: [PATCH 36/58] Implement Truth or Tale --- Mage.Sets/src/mage/cards/t/TruthOrTale.java | 126 ++++++++++++++++++++ Mage.Sets/src/mage/sets/TimeSpiral.java | 1 + 2 files changed, 127 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TruthOrTale.java diff --git a/Mage.Sets/src/mage/cards/t/TruthOrTale.java b/Mage.Sets/src/mage/cards/t/TruthOrTale.java new file mode 100644 index 0000000000..f76c7eed66 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TruthOrTale.java @@ -0,0 +1,126 @@ +package mage.cards.t; + +import java.util.*; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Library; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetCard; +import mage.target.common.TargetOpponent; +import mage.util.GameLog; + +/** + * + * @author noahg + */ +public final class TruthOrTale extends CardImpl { + + public TruthOrTale(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + + // Reveal the top five cards of your library and separate them into two piles. An opponent chooses one of those piles. Put a card from the chosen pile into your hand, then put all other cards revealed this way on the bottom of your library in any order. + this.getSpellAbility().addEffect(new TruthOrTaleEffect()); + } + + public TruthOrTale(final TruthOrTale card) { + super(card); + } + + @Override + public TruthOrTale copy() { + return new TruthOrTale(this); + } +} + +class TruthOrTaleEffect extends OneShotEffect { + + public TruthOrTaleEffect() { + super(Outcome.DrawCard); + this.staticText = "Reveal the top five cards of your library and separate them into two piles. An opponent chooses one of those piles. Put a card from the chosen pile into your hand, then put all other cards revealed this way on the bottom of your library in any order"; + } + + public TruthOrTaleEffect(final TruthOrTaleEffect effect) { + super(effect); + } + + @Override + public TruthOrTaleEffect copy() { + return new TruthOrTaleEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + + Cards cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 5)); + controller.revealCards(sourceObject.getIdName(), cards, game); + + Player opponent; + Set opponents = game.getOpponents(controller.getId()); + if (opponents.size() == 1) { + opponent = game.getPlayer(opponents.iterator().next()); + } else { + Target target = new TargetOpponent(true); + controller.chooseTarget(Outcome.Detriment, target, source, game); + opponent = game.getPlayer(target.getFirstTarget()); + } + + if (opponent != null) { + TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, new FilterCard("cards to put in the first pile")); + List pile1 = new ArrayList<>(); + target.setRequired(false); + if (controller.choose(Outcome.Neutral, cards, target, game)) { + List targets = target.getTargets(); + for (UUID targetId : targets) { + Card card = game.getCard(targetId); + if (card != null) { + pile1.add(card); + } + } + } + List pile2 = new ArrayList<>(); + for (UUID cardId : cards) { + Card card = game.getCard(cardId); + if (card != null && !pile1.contains(card)) { + pile2.add(card); + } + } + boolean choice = opponent.choosePile(Outcome.Detriment, "Choose a pile for " + controller.getName() + " to choose a card from.", pile1, pile2, game); + + List chosen = choice ? pile1 : pile2; + if (!chosen.isEmpty()) { + Cards chosenCards = new CardsImpl(new HashSet<>(chosen)); + TargetCard finalChosenCardTarget = new TargetCard(Zone.LIBRARY,new FilterCard("card to put into your hand")); + if (controller.choose(Outcome.DrawCard, chosenCards, finalChosenCardTarget, game)){ + Card finalChosenCard = game.getCard(finalChosenCardTarget.getFirstTarget()); + if (finalChosenCard != null) { + if (!game.isSimulation()) { + game.informPlayers(controller.getName() + " chose to put " + finalChosenCard.getIdName() + " into their hand."); + } + cards.remove(finalChosenCard); + controller.moveCards(finalChosenCard, Zone.HAND, source, game); + } + } + } + + controller.putCardsOnBottomOfLibrary(cards, game, source, true); + } + + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TimeSpiral.java b/Mage.Sets/src/mage/sets/TimeSpiral.java index 44f41aa06d..be584c20ac 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/TimeSpiral.java @@ -294,6 +294,7 @@ public final class TimeSpiral extends ExpansionSet { cards.add(new SetCardInfo("Trickbind", 88, Rarity.RARE, mage.cards.t.Trickbind.class)); cards.add(new SetCardInfo("Triskelavus", 266, Rarity.RARE, mage.cards.t.Triskelavus.class)); cards.add(new SetCardInfo("Tromp the Domains", 230, Rarity.UNCOMMON, mage.cards.t.TrompTheDomains.class)); + cards.add(new SetCardInfo("Truth or Tale", 89, Rarity.UNCOMMON, mage.cards.t.TruthOrTale.class)); cards.add(new SetCardInfo("Two-Headed Sliver", 183, Rarity.COMMON, mage.cards.t.TwoHeadedSliver.class)); cards.add(new SetCardInfo("Undying Rage", 184, Rarity.UNCOMMON, mage.cards.u.UndyingRage.class)); cards.add(new SetCardInfo("Unyaro Bees", 231, Rarity.RARE, mage.cards.u.UnyaroBees.class)); From af0e9aac89bb275e4c582be5354ac53f9cc58cf8 Mon Sep 17 00:00:00 2001 From: spjspj Date: Tue, 10 Jul 2018 00:15:08 +1000 Subject: [PATCH 37/58] Brawl is missing m19. --- .../Mage.Deck.Constructed/src/mage/deck/Brawl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java index c0297b0ad3..f0d895130a 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java @@ -50,8 +50,8 @@ public class Brawl extends Constructed { if ((set.getSetType() == SetType.CORE || set.getSetType() == SetType.EXPANSION || set.getSetType() == SetType.SUPPLEMENTAL_STANDARD_LEGAL) - && (!set.getReleaseDate().before(earliestDate) - && !set.getReleaseDate().after(current.getTime()))) { + && (!set.getReleaseDate().before(earliestDate))) { + // && !set.getReleaseDate().after(current.getTime()))) // spjspj - allow m19 to be included.. setCodes.add(set.getCode()); } } From 0324c1ad9f222f63073af653bca62591bd2bf488 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 9 Jul 2018 10:31:30 -0400 Subject: [PATCH 38/58] Updated how Standard and Brawl share legality --- .../src/mage/deck/Brawl.java | 48 ++----------------- .../src/mage/deck/Standard.java | 40 +++++++++------- 2 files changed, 27 insertions(+), 61 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java index c0297b0ad3..7e13650658 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java @@ -3,11 +3,8 @@ package mage.deck; import java.util.*; import mage.abilities.common.CanBeYourCommanderAbility; import mage.cards.Card; -import mage.cards.ExpansionSet; -import mage.cards.Sets; import mage.cards.decks.Constructed; import mage.cards.decks.Deck; -import mage.constants.SetType; import mage.filter.FilterMana; /** @@ -22,50 +19,11 @@ public class Brawl extends Constructed { super("Brawl"); // Copy of standard sets - GregorianCalendar current = new GregorianCalendar(); - List sets = new ArrayList(Sets.getInstance().values()); - Collections.sort(sets, new Comparator() { - @Override - public int compare(final ExpansionSet lhs, ExpansionSet rhs) { - return lhs.getReleaseDate().after(rhs.getReleaseDate()) ? -1 : 1; - } - }); - int fallSetsAdded = 0; - Date earliestDate = null; - // Get the second most recent fall set that's been released. - for (ExpansionSet set : sets) { - if (set.getReleaseDate().after(current.getTime())) { - continue; - } - if (isFallSet(set)) { - fallSetsAdded++; - if (fallSetsAdded == 2) { - earliestDate = set.getReleaseDate(); - break; - } - } - } - // Get all sets released on or after the second most recent fall set's release - for (ExpansionSet set : sets) { - if ((set.getSetType() == SetType.CORE - || set.getSetType() == SetType.EXPANSION - || set.getSetType() == SetType.SUPPLEMENTAL_STANDARD_LEGAL) - && (!set.getReleaseDate().before(earliestDate) - && !set.getReleaseDate().after(current.getTime()))) { - setCodes.add(set.getCode()); - } - } + setCodes.addAll(Standard.makeLegalSets()); + banned.add("Baral, Chief of Compliance"); banned.add("Smuggler's Copter"); - banned.add("Sorcerers' Spyglass"); - } - - private static boolean isFallSet(ExpansionSet set) { - Calendar cal = Calendar.getInstance(); - cal.setTime(set.getReleaseDate()); - // Fall sets are normally released during or after September - return set.getSetType() == SetType.EXPANSION - && (cal.get(Calendar.MONTH) > 7); + banned.add("Sorcerous Spyglass"); } public Brawl(String name) { diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java index bc1c2a5a64..2e2098244a 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java @@ -20,6 +20,28 @@ public class Standard extends Constructed { public Standard() { super("Constructed - Standard"); + + setCodes.addAll(makeLegalSets()); + + banned.add("Attune with Aether"); // since 2018-01-15 + banned.add("Aetherworks Marvel"); + banned.add("Felidar Guardian"); + banned.add("Rampaging Ferocidon"); // since 2018-01-15 + banned.add("Ramunap Ruins"); // since 2018-01-15 + banned.add("Rogue Refiner"); // since 2018-01-15 + banned.add("Smuggler's Copter"); + } + + private static boolean isFallSet(ExpansionSet set) { + Calendar cal = Calendar.getInstance(); + cal.setTime(set.getReleaseDate()); + // Fall sets are normally released during or after September + return set.getSetType() == SetType.EXPANSION + && (cal.get(Calendar.MONTH) > 7); + } + + public static List makeLegalSets() { + List codes = new ArrayList(); GregorianCalendar current = new GregorianCalendar(); List sets = new ArrayList(Sets.getInstance().values()); Collections.sort(sets, new Comparator() { @@ -50,23 +72,9 @@ public class Standard extends Constructed { || set.getSetType() == SetType.SUPPLEMENTAL_STANDARD_LEGAL) && !set.getReleaseDate().before(earliestDate)) { // && !set.getReleaseDate().after(current.getTime()))) { - setCodes.add(set.getCode()); + codes.add(set.getCode()); } } - banned.add("Attune with Aether"); // since 2018-01-15 - banned.add("Aetherworks Marvel"); - banned.add("Felidar Guardian"); - banned.add("Rampaging Ferocidon"); // since 2018-01-15 - banned.add("Ramunap Ruins"); // since 2018-01-15 - banned.add("Rogue Refiner"); // since 2018-01-15 - banned.add("Smuggler's Copter"); - } - - private static boolean isFallSet(ExpansionSet set) { - Calendar cal = Calendar.getInstance(); - cal.setTime(set.getReleaseDate()); - // Fall sets are normally released during or after September - return set.getSetType() == SetType.EXPANSION - && (cal.get(Calendar.MONTH) > 7); + return codes; } } From 490217facde27214d3c86f6b4a86cecf71b86d1b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 9 Jul 2018 11:25:47 -0400 Subject: [PATCH 39/58] updated 1 on 1 Brawl life total --- .../Mage.Game.BrawlDuel/src/mage/game/BrawlDuelMatch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Server.Plugins/Mage.Game.BrawlDuel/src/mage/game/BrawlDuelMatch.java b/Mage.Server.Plugins/Mage.Game.BrawlDuel/src/mage/game/BrawlDuelMatch.java index 1650d6fb20..e0a56eb0e2 100644 --- a/Mage.Server.Plugins/Mage.Game.BrawlDuel/src/mage/game/BrawlDuelMatch.java +++ b/Mage.Server.Plugins/Mage.Game.BrawlDuel/src/mage/game/BrawlDuelMatch.java @@ -16,7 +16,7 @@ public class BrawlDuelMatch extends MatchImpl { @Override public void startGame() throws GameException { - int startLife = 20; + int startLife = 25; boolean alsoHand = true; BrawlDuel game = new BrawlDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife); game.setCheckCommanderDamage(false); From c456a1961e015dc5e3c410cfa94703e6518a5b73 Mon Sep 17 00:00:00 2001 From: igoudt Date: Sun, 8 Jul 2018 22:25:25 +0200 Subject: [PATCH 40/58] add more isActivePlayer and isAttachedTo calls --- .../src/mage/cards/a/AlhammarretsArchive.java | 2 +- .../src/mage/cards/a/AngelicArbiter.java | 4 +-- .../src/mage/cards/a/AngelicBenediction.java | 2 +- Mage.Sets/src/mage/cards/a/AssaultSuit.java | 2 +- .../src/mage/cards/a/AzorTheLawbringer.java | 2 +- .../src/mage/cards/b/BattlegraceAngel.java | 2 +- .../mage/cards/c/ChainsOfMephistopheles.java | 2 +- .../mage/cards/c/ChancellorOfTheTangle.java | 2 +- .../src/mage/cards/c/ChronicFlooding.java | 3 +-- .../src/mage/cards/c/CityOfSolitude.java | 2 +- .../src/mage/cards/c/CommuneWithLava.java | 2 +- .../src/mage/cards/c/ConquerorsFlail.java | 2 +- Mage.Sets/src/mage/cards/c/CowedByWisdom.java | 2 +- Mage.Sets/src/mage/cards/c/CruelReality.java | 2 +- .../src/mage/cards/c/CurseOfBloodletting.java | 13 +++++----- .../src/mage/cards/c/CurseOfOblivion.java | 2 +- .../src/mage/cards/c/CurseOfOpulence.java | 2 +- .../src/mage/cards/c/CurseOfPredation.java | 3 +-- .../mage/cards/c/CurseOfTheBloodyTome.java | 2 +- .../src/mage/cards/c/CurseOfTheForsaken.java | 3 +-- .../mage/cards/c/CurseOfThePiercedHeart.java | 2 +- Mage.Sets/src/mage/cards/c/CurseOfThirst.java | 2 +- .../src/mage/cards/c/CurseOfVengeance.java | 5 ++-- .../src/mage/cards/d/DawnsReflection.java | 2 +- .../src/mage/cards/d/DosanTheFallingLeaf.java | 2 +- .../src/mage/cards/d/DragonlordDromoka.java | 2 +- .../src/mage/cards/e/EdificeOfAuthority.java | 2 +- .../src/mage/cards/e/EnterTheInfinite.java | 2 +- Mage.Sets/src/mage/cards/f/FaithsFetters.java | 2 +- Mage.Sets/src/mage/cards/f/FinestHour.java | 2 +- .../src/mage/cards/g/GabrielAngelfire.java | 2 +- .../src/mage/cards/g/GideonBattleForged.java | 4 +-- Mage.Sets/src/mage/cards/g/GideonJura.java | 2 +- Mage.Sets/src/mage/cards/g/GisaAndGeralf.java | 2 +- .../src/mage/cards/g/GrandAbolisher.java | 2 +- Mage.Sets/src/mage/cards/g/GrinningTotem.java | 4 +-- .../src/mage/cards/h/HakimLoreweaver.java | 2 +- Mage.Sets/src/mage/cards/i/IcefallRegent.java | 2 +- .../src/mage/cards/i/IllusionistsBracers.java | 2 +- .../src/mage/cards/i/InfectiousCurse.java | 2 +- .../mage/cards/j/JaceArchitectOfThought.java | 2 +- .../mage/cards/k/KaradorGhostChieftain.java | 2 +- .../src/mage/cards/k/KeranosGodOfStorms.java | 2 +- .../src/mage/cards/k/KessDissidentMage.java | 4 +-- .../src/mage/cards/k/KumanosBlessing.java | 25 +++++++++---------- .../src/mage/cards/m/MarketFestival.java | 2 +- Mage.Sets/src/mage/cards/n/NotionThief.java | 2 +- Mage.Sets/src/mage/cards/o/OracleEnVec.java | 6 ++--- Mage.Sets/src/mage/cards/o/Overgrowth.java | 2 +- Mage.Sets/src/mage/cards/p/ParadoxHaze.java | 2 +- .../src/mage/cards/p/PersonalSanctuary.java | 2 +- .../src/mage/cards/p/PredatoryAdvantage.java | 2 +- .../src/mage/cards/p/PrimitiveEtchings.java | 2 +- .../src/mage/cards/r/RafiqOfTheMany.java | 2 +- .../src/mage/cards/r/RaidBombardment.java | 2 +- Mage.Sets/src/mage/cards/r/ReturnToDust.java | 2 +- Mage.Sets/src/mage/cards/r/RowanKenrith.java | 2 +- Mage.Sets/src/mage/cards/r/Rowen.java | 2 +- Mage.Sets/src/mage/cards/s/SentinelTower.java | 2 +- Mage.Sets/src/mage/cards/s/SerraAvenger.java | 2 +- Mage.Sets/src/mage/cards/s/SigilOfValor.java | 5 ++-- Mage.Sets/src/mage/cards/s/SirensCall.java | 2 +- Mage.Sets/src/mage/cards/s/SoulEcho.java | 2 +- .../mage/cards/s/SovereignsOfLostAlara.java | 2 +- Mage.Sets/src/mage/cards/s/SphinxsDecree.java | 2 +- .../src/mage/cards/s/SpitefulReturned.java | 2 +- .../mage/cards/t/TamiyoFieldResearcher.java | 2 +- Mage.Sets/src/mage/cards/t/Taunt.java | 2 +- .../src/mage/cards/t/TidebinderMage.java | 2 +- .../src/mage/cards/t/TormentOfScarabs.java | 2 +- .../mage/cards/u/UndiscoveredParadise.java | 2 +- .../src/mage/cards/u/UnwindingClock.java | 2 +- .../src/mage/cards/u/UrbanBurgeoning.java | 2 +- .../src/mage/cards/v/VoiceOfResurgence.java | 2 +- .../src/mage/cards/v/VraskaTheUnseen.java | 2 +- Mage.Sets/src/mage/cards/w/WallOfDust.java | 4 +-- Mage.Sets/src/mage/cards/w/Witchstalker.java | 2 +- Mage.Sets/src/mage/cards/w/WritOfPassage.java | 3 +-- .../src/mage/cards/x/XenicPoltergeist.java | 2 +- ...geToACreatureAttachedTriggeredAbility.java | 3 +-- .../combat/CantBeBlockedAttachedEffect.java | 4 +-- .../CantCastMoreThanOneSpellEffect.java | 2 +- .../mage/game/permanent/PermanentImpl.java | 6 +---- 83 files changed, 109 insertions(+), 122 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java b/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java index 557b806e6a..02b087e0ab 100644 --- a/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java +++ b/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java @@ -111,7 +111,7 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { - if (game.getActivePlayerId().equals(event.getPlayerId()) + if (game.isActivePlayer(event.getPlayerId()) && game.getPhase().getStep().getType() == PhaseStep.DRAW) { CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get(CardsDrawnDuringDrawStepWatcher.class.getSimpleName()); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { diff --git a/Mage.Sets/src/mage/cards/a/AngelicArbiter.java b/Mage.Sets/src/mage/cards/a/AngelicArbiter.java index 0415e145bf..75693f80c0 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicArbiter.java +++ b/Mage.Sets/src/mage/cards/a/AngelicArbiter.java @@ -65,7 +65,7 @@ class AngelicArbiterCantAttackTargetEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (game.getActivePlayerId().equals(permanent.getControllerId()) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) { + if (game.isActivePlayer(permanent.getControllerId()) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) { CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName()); if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(permanent.getControllerId()) > 0) { return true; @@ -113,7 +113,7 @@ class AngelicArbiterEffect2 extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + if (game.isActivePlayer(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { PlayerAttackedWatcher watcher = (PlayerAttackedWatcher) game.getState().getWatchers().get(PlayerAttackedWatcher.class.getSimpleName()); if (watcher != null && watcher.getNumberOfAttackersCurrentTurn(event.getPlayerId()) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/a/AngelicBenediction.java b/Mage.Sets/src/mage/cards/a/AngelicBenediction.java index fdd6db3234..8271766147 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicBenediction.java +++ b/Mage.Sets/src/mage/cards/a/AngelicBenediction.java @@ -62,7 +62,7 @@ class AngelicBenedictionTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId)) { + if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { return true; } diff --git a/Mage.Sets/src/mage/cards/a/AssaultSuit.java b/Mage.Sets/src/mage/cards/a/AssaultSuit.java index 3020310195..ac21d9ab6b 100644 --- a/Mage.Sets/src/mage/cards/a/AssaultSuit.java +++ b/Mage.Sets/src/mage/cards/a/AssaultSuit.java @@ -95,7 +95,7 @@ public final class AssaultSuit extends CardImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.SACRIFICE_PERMANENT) { Permanent equipment = game.getPermanent(source.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) { + if (equipment != null) { return equipment.isAttachedTo(event.getTargetId()); } } diff --git a/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java b/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java index d879c1e609..0933ac1fa1 100644 --- a/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java +++ b/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java @@ -123,7 +123,7 @@ class AzorTheLawbringerCantCastEffect extends ContinuousRuleModifyingEffectImpl @Override public boolean applies(GameEvent event, Ability source, Game game) { UUID opponentId = getTargetPointer().getFirst(game, source); - if (game.getActivePlayerId().equals(opponentId)) { + if (game.isActivePlayer(opponentId)) { if (playersNextTurn == 0) { playersNextTurn = game.getTurnNum(); } diff --git a/Mage.Sets/src/mage/cards/b/BattlegraceAngel.java b/Mage.Sets/src/mage/cards/b/BattlegraceAngel.java index 10b675c1e7..62e5d7ea98 100644 --- a/Mage.Sets/src/mage/cards/b/BattlegraceAngel.java +++ b/Mage.Sets/src/mage/cards/b/BattlegraceAngel.java @@ -77,7 +77,7 @@ class BattlegraceAngelAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId) ) { + if (game.isActivePlayer(this.controllerId) ) { if (game.getCombat().attacksAlone()) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); diff --git a/Mage.Sets/src/mage/cards/c/ChainsOfMephistopheles.java b/Mage.Sets/src/mage/cards/c/ChainsOfMephistopheles.java index 664d9387ab..04f12fe4cf 100644 --- a/Mage.Sets/src/mage/cards/c/ChainsOfMephistopheles.java +++ b/Mage.Sets/src/mage/cards/c/ChainsOfMephistopheles.java @@ -85,7 +85,7 @@ class ChainsOfMephistophelesReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getPhase().getStep().getType() == PhaseStep.DRAW) { + if (game.isActivePlayer(event.getPlayerId()) && game.getPhase().getStep().getType() == PhaseStep.DRAW) { CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get(CardsDrawnDuringDrawStepWatcher.class.getSimpleName()); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/c/ChancellorOfTheTangle.java b/Mage.Sets/src/mage/cards/c/ChancellorOfTheTangle.java index d7a2f94c46..3b61a92463 100644 --- a/Mage.Sets/src/mage/cards/c/ChancellorOfTheTangle.java +++ b/Mage.Sets/src/mage/cards/c/ChancellorOfTheTangle.java @@ -67,7 +67,7 @@ class ChancellorOfTheTangleDelayedTriggeredAbility extends DelayedTriggeredAbili @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getActivePlayerId().equals(controllerId); + return game.isActivePlayer(controllerId); } @Override public ChancellorOfTheTangleDelayedTriggeredAbility copy() { diff --git a/Mage.Sets/src/mage/cards/c/ChronicFlooding.java b/Mage.Sets/src/mage/cards/c/ChronicFlooding.java index e20d623828..62f452388d 100644 --- a/Mage.Sets/src/mage/cards/c/ChronicFlooding.java +++ b/Mage.Sets/src/mage/cards/c/ChronicFlooding.java @@ -72,10 +72,9 @@ class ChronicFloodingAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent source = game.getPermanent(this.sourceId); - if (source != null && source.getAttachedTo().equals(event.getTargetId())) { + if (source != null && source.isAttachedTo(event.getTargetId())) { Permanent attached = game.getPermanent(source.getAttachedTo()); if (attached != null) { - for (Effect e : getEffects()) { e.setTargetPointer(new FixedTarget(attached.getControllerId())); } diff --git a/Mage.Sets/src/mage/cards/c/CityOfSolitude.java b/Mage.Sets/src/mage/cards/c/CityOfSolitude.java index 40becef9f8..01291a6252 100644 --- a/Mage.Sets/src/mage/cards/c/CityOfSolitude.java +++ b/Mage.Sets/src/mage/cards/c/CityOfSolitude.java @@ -67,7 +67,7 @@ class CityOfSolitudeEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return !game.getActivePlayerId().equals(event.getPlayerId()); + return !game.isActivePlayer(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/c/CommuneWithLava.java b/Mage.Sets/src/mage/cards/c/CommuneWithLava.java index a047413986..e38056a591 100644 --- a/Mage.Sets/src/mage/cards/c/CommuneWithLava.java +++ b/Mage.Sets/src/mage/cards/c/CommuneWithLava.java @@ -105,7 +105,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl { @Override public boolean isInactive(Ability source, Game game) { if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) { - if (game.getActivePlayerId().equals(source.getControllerId())) { + if (game.isActivePlayer(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/c/ConquerorsFlail.java b/Mage.Sets/src/mage/cards/c/ConquerorsFlail.java index 3a35053555..477cd898b8 100644 --- a/Mage.Sets/src/mage/cards/c/ConquerorsFlail.java +++ b/Mage.Sets/src/mage/cards/c/ConquerorsFlail.java @@ -149,7 +149,7 @@ class ConquerorsFlailEffect extends ContinuousRuleModifyingEffectImpl { } } - if (isAttached && game.getActivePlayerId().equals(source.getControllerId()) + if (isAttached && game.isActivePlayer(source.getControllerId()) && game.getPlayer(source.getControllerId()).hasOpponent(event.getPlayerId(), game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/c/CowedByWisdom.java b/Mage.Sets/src/mage/cards/c/CowedByWisdom.java index 5561417e05..7559402bc1 100644 --- a/Mage.Sets/src/mage/cards/c/CowedByWisdom.java +++ b/Mage.Sets/src/mage/cards/c/CowedByWisdom.java @@ -80,7 +80,7 @@ class CowedByWisdomayCostToAttackBlockEffect extends PayCostToAttackBlockEffectI @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - return enchantment != null && enchantment.getAttachedTo().equals(event.getSourceId()); + return enchantment != null && enchantment.isAttachedTo(event.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/cards/c/CruelReality.java b/Mage.Sets/src/mage/cards/c/CruelReality.java index 40417f03cb..ed9a9e2904 100644 --- a/Mage.Sets/src/mage/cards/c/CruelReality.java +++ b/Mage.Sets/src/mage/cards/c/CruelReality.java @@ -85,7 +85,7 @@ class CruelRealityTriggeredAbiilty extends TriggeredAbilityImpl { && enchantment.getAttachedTo() != null) { Player cursedPlayer = game.getPlayer(enchantment.getAttachedTo()); if (cursedPlayer != null - && game.getActivePlayerId().equals(cursedPlayer.getId())) { + && game.isActivePlayer(cursedPlayer.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(cursedPlayer.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java b/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java index 8363d4848d..7fe65e9355 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java @@ -1,7 +1,6 @@ package mage.cards.c; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; @@ -16,14 +15,15 @@ import mage.game.permanent.Permanent; import mage.target.TargetPlayer; import mage.util.CardUtil; +import java.util.UUID; + /** - * * @author BetaSteward */ public final class CurseOfBloodletting extends CardImpl { public CurseOfBloodletting(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); this.subtype.add(SubType.AURA, SubType.CURSE); @@ -71,10 +71,9 @@ class CurseOfBloodlettingEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && - enchantment.getAttachedTo() != null && - event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; + if (enchantment != null && + enchantment.isAttachedTo(event.getTargetId())) { + return true; } return false; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfOblivion.java b/Mage.Sets/src/mage/cards/c/CurseOfOblivion.java index e31da408ec..a12ec39a26 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfOblivion.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfOblivion.java @@ -79,7 +79,7 @@ class CurseOfOblivionAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { + if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfOpulence.java b/Mage.Sets/src/mage/cards/c/CurseOfOpulence.java index 6156af8739..c6c9359074 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfOpulence.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfOpulence.java @@ -78,7 +78,7 @@ class CurseOfOpulenceEffect extends OneShotEffect { if (enchantment != null) { Player enchantedPlayer = game.getPlayer(enchantment.getAttachedTo()); if (enchantedPlayer != null) { - Set players = new HashSet(); + Set players = new HashSet<>(); for (UUID attacker : game.getCombat().getAttackers()) { UUID defender = game.getCombat().getDefenderId(attacker); if (defender.equals(enchantedPlayer.getId()) diff --git a/Mage.Sets/src/mage/cards/c/CurseOfPredation.java b/Mage.Sets/src/mage/cards/c/CurseOfPredation.java index be79d9fec4..a130d37685 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfPredation.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfPredation.java @@ -84,8 +84,7 @@ class CurseOfPredationTriggeredAbility extends TriggeredAbilityImpl { if (defender != null) { Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null - && enchantment.getAttachedTo() != null - && enchantment.getAttachedTo().equals(defender.getId())) { + && enchantment.isAttachedTo(defender.getId())) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getSourceId())); } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java b/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java index dc12e4ebdc..18040ebb79 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java @@ -79,7 +79,7 @@ class CurseOfTheBloodyTomeAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { + if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java b/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java index 2759845d26..f240a0e5d6 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java @@ -83,8 +83,7 @@ class CurseOfTheForsakenTriggeredAbility extends TriggeredAbilityImpl { if (defender != null) { Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null - && enchantment.getAttachedTo() != null - && enchantment.getAttachedTo().equals(defender.getId())) { + && enchantment.isAttachedTo(defender.getId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfThePiercedHeart.java b/Mage.Sets/src/mage/cards/c/CurseOfThePiercedHeart.java index bfd840ef5a..9f713dcde1 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfThePiercedHeart.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfThePiercedHeart.java @@ -81,7 +81,7 @@ class CurseOfThePiercedHeartAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { + if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfThirst.java b/Mage.Sets/src/mage/cards/c/CurseOfThirst.java index a0f2087a3e..97c1c9c1ea 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfThirst.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfThirst.java @@ -81,7 +81,7 @@ class CurseOfThirstAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { + if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java b/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java index 0be3bf905d..3fb01a3559 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java @@ -84,8 +84,7 @@ class CurseOfVengeanceTriggeredAbility extends TriggeredAbilityImpl { Spell spell = game.getStack().getSpell(event.getSourceId()); if (enchantment != null && spell != null - && enchantment.getAttachedTo() != null - && enchantment.getAttachedTo().equals(spell.getControllerId())) { + && enchantment.isAttachedTo(spell.getControllerId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(getSourceId())); return true; } @@ -126,7 +125,7 @@ class CurseOfVengeancePlayerLosesTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent sourceObject = game.getPermanentOrLKIBattlefield(this.getSourceId()); - return sourceObject != null && sourceObject.getAttachedTo().equals(event.getPlayerId()); + return sourceObject != null && sourceObject.isAttachedTo(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DawnsReflection.java b/Mage.Sets/src/mage/cards/d/DawnsReflection.java index 95c1d28040..85b962c872 100644 --- a/Mage.Sets/src/mage/cards/d/DawnsReflection.java +++ b/Mage.Sets/src/mage/cards/d/DawnsReflection.java @@ -76,7 +76,7 @@ class DawnsReflectionTriggeredAbility extends TriggeredManaAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); + return enchantment != null && enchantment.isAttachedTo(event.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DosanTheFallingLeaf.java b/Mage.Sets/src/mage/cards/d/DosanTheFallingLeaf.java index ab35abb523..b8e535ff8e 100644 --- a/Mage.Sets/src/mage/cards/d/DosanTheFallingLeaf.java +++ b/Mage.Sets/src/mage/cards/d/DosanTheFallingLeaf.java @@ -54,7 +54,7 @@ class DosanTheFallingLeafEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getType() == GameEvent.EventType.CAST_SPELL && !game.getActivePlayerId().equals(event.getPlayerId()); + return event.getType() == GameEvent.EventType.CAST_SPELL && !game.isActivePlayer(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DragonlordDromoka.java b/Mage.Sets/src/mage/cards/d/DragonlordDromoka.java index a33d28d65b..c24d6985bc 100644 --- a/Mage.Sets/src/mage/cards/d/DragonlordDromoka.java +++ b/Mage.Sets/src/mage/cards/d/DragonlordDromoka.java @@ -78,7 +78,7 @@ class DragonlordDromokaEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getActivePlayerId().equals(source.getControllerId()) && + if (game.isActivePlayer(source.getControllerId()) && game.getPlayer(source.getControllerId()).hasOpponent(event.getPlayerId(), game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/e/EdificeOfAuthority.java b/Mage.Sets/src/mage/cards/e/EdificeOfAuthority.java index 27b95e5d19..9ee96ef783 100644 --- a/Mage.Sets/src/mage/cards/e/EdificeOfAuthority.java +++ b/Mage.Sets/src/mage/cards/e/EdificeOfAuthority.java @@ -117,7 +117,7 @@ class EdificeOfAuthorityRestrictionEffect extends RestrictionEffect { public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) { - if (game.getActivePlayerId().equals(source.getControllerId()) + if (game.isActivePlayer(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { Permanent permanent = game.getPermanent(targetId); diff --git a/Mage.Sets/src/mage/cards/e/EnterTheInfinite.java b/Mage.Sets/src/mage/cards/e/EnterTheInfinite.java index 536676ee66..5b725d6d0a 100644 --- a/Mage.Sets/src/mage/cards/e/EnterTheInfinite.java +++ b/Mage.Sets/src/mage/cards/e/EnterTheInfinite.java @@ -123,7 +123,7 @@ class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect { @Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) { - if (game.getActivePlayerId().equals(source.getControllerId())) { + if (game.isActivePlayer(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/f/FaithsFetters.java b/Mage.Sets/src/mage/cards/f/FaithsFetters.java index d5fd0ecc6e..42327c282a 100644 --- a/Mage.Sets/src/mage/cards/f/FaithsFetters.java +++ b/Mage.Sets/src/mage/cards/f/FaithsFetters.java @@ -86,7 +86,7 @@ class FaithsFettersEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo().equals(event.getSourceId())) { + if (enchantment != null && enchantment.isAttachedTo(event.getSourceId())) { Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); if (ability.isPresent() && ability.get().getAbilityType() != AbilityType.MANA) { return true; diff --git a/Mage.Sets/src/mage/cards/f/FinestHour.java b/Mage.Sets/src/mage/cards/f/FinestHour.java index 87b8adea5e..2163788f4b 100644 --- a/Mage.Sets/src/mage/cards/f/FinestHour.java +++ b/Mage.Sets/src/mage/cards/f/FinestHour.java @@ -74,7 +74,7 @@ class FinestHourAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId)) { + if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); diff --git a/Mage.Sets/src/mage/cards/g/GabrielAngelfire.java b/Mage.Sets/src/mage/cards/g/GabrielAngelfire.java index 83a1c2357b..a820735811 100644 --- a/Mage.Sets/src/mage/cards/g/GabrielAngelfire.java +++ b/Mage.Sets/src/mage/cards/g/GabrielAngelfire.java @@ -77,7 +77,7 @@ class GabrielAngelfireGainAbilityEffect extends GainAbilitySourceEffect { @Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { - if (!sameStep && game.getActivePlayerId().equals(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { + if (!sameStep && game.isActivePlayer(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { return true; } } else { diff --git a/Mage.Sets/src/mage/cards/g/GideonBattleForged.java b/Mage.Sets/src/mage/cards/g/GideonBattleForged.java index 9971f9973d..9507206424 100644 --- a/Mage.Sets/src/mage/cards/g/GideonBattleForged.java +++ b/Mage.Sets/src/mage/cards/g/GideonBattleForged.java @@ -138,7 +138,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { if (targetPermanent == null) { return true; } - if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) { + if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.isActivePlayer(targetPermanent.getControllerId())) { nextTurnTargetController = game.getTurnNum(); } return game.getPhase().getType() == TurnPhase.END && nextTurnTargetController > 0 && game.getTurnNum() > nextTurnTargetController; @@ -157,7 +157,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { - if (game.getActivePlayerId().equals(permanent.getControllerId())) { + if (game.isActivePlayer(permanent.getControllerId())) { Permanent planeswalker = game.getPermanent(source.getSourceId()); if (planeswalker != null) { return true; diff --git a/Mage.Sets/src/mage/cards/g/GideonJura.java b/Mage.Sets/src/mage/cards/g/GideonJura.java index 2edb2813cb..d4890e3114 100644 --- a/Mage.Sets/src/mage/cards/g/GideonJura.java +++ b/Mage.Sets/src/mage/cards/g/GideonJura.java @@ -129,7 +129,7 @@ class GideonJuraEffect extends RequirementEffect { public boolean isInactive(Ability source, Game game) { return (startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END - && game.getActivePlayerId().equals(source.getFirstTarget()))) + && game.isActivePlayer(source.getFirstTarget()))) || // 6/15/2010: If a creature controlled by the affected player can't attack Gideon Jura (because he's no longer on the battlefield, for example), that player may have it attack you, another one of your planeswalkers, or nothing at all. creatingPermanent.getPermanent(game) == null; } diff --git a/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java b/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java index c88f1150fe..66e7d23cbd 100644 --- a/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java +++ b/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java @@ -81,7 +81,7 @@ class GisaAndGeralfContinuousEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - if (!game.getActivePlayerId().equals(player.getId())) { + if (!game.isActivePlayer(player.getId())) { return false; } for (Card card : player.getGraveyard().getCards(filter, game)) { diff --git a/Mage.Sets/src/mage/cards/g/GrandAbolisher.java b/Mage.Sets/src/mage/cards/g/GrandAbolisher.java index 2f557aaace..e9c05daf96 100644 --- a/Mage.Sets/src/mage/cards/g/GrandAbolisher.java +++ b/Mage.Sets/src/mage/cards/g/GrandAbolisher.java @@ -85,7 +85,7 @@ class GrandAbolisherEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getActivePlayerId().equals(source.getControllerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + if (game.isActivePlayer(source.getControllerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { switch(event.getType()) { case CAST_SPELL: return true; diff --git a/Mage.Sets/src/mage/cards/g/GrinningTotem.java b/Mage.Sets/src/mage/cards/g/GrinningTotem.java index 910bc9034a..b2fa96eebf 100644 --- a/Mage.Sets/src/mage/cards/g/GrinningTotem.java +++ b/Mage.Sets/src/mage/cards/g/GrinningTotem.java @@ -124,7 +124,7 @@ class GrinningTotemMayPlayEffect extends AsThoughEffectImpl { @Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { - if (!sameStep && game.getActivePlayerId().equals(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { + if (!sameStep && game.isActivePlayer(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { return true; } } else { @@ -178,7 +178,7 @@ class GrinningTotemDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getActivePlayerId().equals(this.getControllerId()); + return game.isActivePlayer(this.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java b/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java index 4b17ac32df..ef9f925de7 100644 --- a/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java +++ b/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java @@ -145,7 +145,7 @@ class HakimLoreweaverCondition implements Condition { } } return PhaseStep.UPKEEP == game.getStep().getType() - && game.getActivePlayerId().equals(source.getControllerId()); + && game.isActivePlayer(source.getControllerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/i/IcefallRegent.java b/Mage.Sets/src/mage/cards/i/IcefallRegent.java index 8243899a55..8e21b7bf10 100644 --- a/Mage.Sets/src/mage/cards/i/IcefallRegent.java +++ b/Mage.Sets/src/mage/cards/i/IcefallRegent.java @@ -132,7 +132,7 @@ class IcefallRegentEffect extends ContinuousRuleModifyingEffectImpl { if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { if (event.getTargetId().equals(targetPointer.getFirst(game, source))) { Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source)); - return targetCreature != null && game.getActivePlayerId().equals(targetCreature.getControllerId()); + return targetCreature != null && game.isActivePlayer(targetCreature.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java b/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java index 8e73dee5b4..389d705645 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java @@ -72,7 +72,7 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent equipment = game.getPermanent(this.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null && equipment.getAttachedTo().equals(event.getSourceId())) { + if (equipment != null && equipment.isAttachedTo(event.getSourceId())) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (!(stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl)) { Effect effect = this.getEffects().get(0); diff --git a/Mage.Sets/src/mage/cards/i/InfectiousCurse.java b/Mage.Sets/src/mage/cards/i/InfectiousCurse.java index 24418136a1..555dc866bd 100644 --- a/Mage.Sets/src/mage/cards/i/InfectiousCurse.java +++ b/Mage.Sets/src/mage/cards/i/InfectiousCurse.java @@ -87,7 +87,7 @@ class InfectiousCurseAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { + if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } diff --git a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java index ecd7273c35..efd444476f 100644 --- a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java +++ b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java @@ -134,7 +134,7 @@ class JaceArchitectOfThoughtDelayedTriggeredAbility extends DelayedTriggeredAbil @Override public boolean isInactive(Game game) { - return game.getActivePlayerId().equals(getControllerId()) && game.getTurnNum() != startingTurn; + return game.isActivePlayer(getControllerId()) && game.getTurnNum() != startingTurn; } @Override diff --git a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java index 35b7d59bc5..aba7458be3 100644 --- a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java +++ b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java @@ -111,7 +111,7 @@ class KaradorGhostChieftainContinuousEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - if (game.getActivePlayerId() == null || !game.getActivePlayerId().equals(player.getId())) { + if (game.getActivePlayerId() == null || !game.isActivePlayer(player.getId())) { return false; } for (Card card : player.getGraveyard().getCards(new FilterCreatureCard(), game)) { diff --git a/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java b/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java index 2713e4282d..3590d94123 100644 --- a/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java +++ b/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java @@ -92,7 +92,7 @@ class KeranosGodOfStormsTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { - if (game.getActivePlayerId().equals(this.getControllerId())) { + if (game.isActivePlayer(this.getControllerId())) { CardsAmountDrawnThisTurnWatcher watcher = (CardsAmountDrawnThisTurnWatcher) game.getState().getWatchers().get(CardsAmountDrawnThisTurnWatcher.class.getSimpleName()); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) != 1) { diff --git a/Mage.Sets/src/mage/cards/k/KessDissidentMage.java b/Mage.Sets/src/mage/cards/k/KessDissidentMage.java index 8eb49369f9..bc3cc94473 100644 --- a/Mage.Sets/src/mage/cards/k/KessDissidentMage.java +++ b/Mage.Sets/src/mage/cards/k/KessDissidentMage.java @@ -97,7 +97,7 @@ class KessDissidentMageContinuousEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - if (!game.getActivePlayerId().equals(player.getId())) { + if (!game.isActivePlayer(player.getId())) { return false; } for (Card card : player.getGraveyard().getCards(filter, game)) { @@ -138,7 +138,7 @@ class KessDissidentMageCastFromGraveyardEffect extends AsThoughEffectImpl { public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (objectId.equals(getTargetPointer().getFirst(game, source))) { if (affectedControllerId.equals(source.getControllerId())) { - if (game.getActivePlayerId().equals(source.getControllerId())) { + if (game.isActivePlayer(source.getControllerId())) { KessDissidentMageWatcher watcher = (KessDissidentMageWatcher) game.getState().getWatchers().get(KessDissidentMageWatcher.class.getSimpleName(), source.getSourceId()); if (!(source instanceof FlashbackAbility)) { return !watcher.isAbilityUsed(); diff --git a/Mage.Sets/src/mage/cards/k/KumanosBlessing.java b/Mage.Sets/src/mage/cards/k/KumanosBlessing.java index c6873c3cf9..c745c6fd9c 100644 --- a/Mage.Sets/src/mage/cards/k/KumanosBlessing.java +++ b/Mage.Sets/src/mage/cards/k/KumanosBlessing.java @@ -1,9 +1,6 @@ package mage.cards.k; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -24,15 +21,18 @@ import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.watchers.Watcher; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class KumanosBlessing extends CardImpl { public KumanosBlessing(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.subtype.add(SubType.AURA); // Flash @@ -77,7 +77,7 @@ class KumanosBlessingEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && permanent != null) { return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); @@ -89,10 +89,10 @@ class KumanosBlessingEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ZONE_CHANGE; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - ZoneChangeEvent zce = (ZoneChangeEvent) event; + ZoneChangeEvent zce = (ZoneChangeEvent) event; if (zce.isDiesEvent()) { DamagedByEnchantedWatcher watcher = (DamagedByEnchantedWatcher) game.getState().getWatchers().get(DamagedByEnchantedWatcher.class.getSimpleName(), source.getSourceId()); if (watcher != null) { @@ -126,16 +126,15 @@ class DamagedByEnchantedWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == EventType.DAMAGED_CREATURE) { Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (enchantment.getAttachedTo().equals(event.getSourceId())) { - MageObjectReference mor = new MageObjectReference(event.getTargetId(), game); - damagedCreatures.add(mor); + if (enchantment != null && enchantment.isAttachedTo(event.getSourceId())) { + MageObjectReference mor = new MageObjectReference(event.getTargetId(), game); + damagedCreatures.add(mor); - } } } } + @Override public void reset() { super.reset(); diff --git a/Mage.Sets/src/mage/cards/m/MarketFestival.java b/Mage.Sets/src/mage/cards/m/MarketFestival.java index f642113728..b6431fa765 100644 --- a/Mage.Sets/src/mage/cards/m/MarketFestival.java +++ b/Mage.Sets/src/mage/cards/m/MarketFestival.java @@ -78,7 +78,7 @@ class MarketFestivalTriggeredAbility extends TriggeredManaAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); + return enchantment != null && enchantment.isAttachedTo(event.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/cards/n/NotionThief.java b/Mage.Sets/src/mage/cards/n/NotionThief.java index 1d790f30eb..9ff6a3977a 100644 --- a/Mage.Sets/src/mage/cards/n/NotionThief.java +++ b/Mage.Sets/src/mage/cards/n/NotionThief.java @@ -89,7 +89,7 @@ class NotionThiefReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getStep().getType() == PhaseStep.DRAW) { + if (game.isActivePlayer(event.getPlayerId()) && game.getStep().getType() == PhaseStep.DRAW) { CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get(CardsDrawnDuringDrawStepWatcher.class.getSimpleName()); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/o/OracleEnVec.java b/Mage.Sets/src/mage/cards/o/OracleEnVec.java index 4770125d3f..118fd61524 100644 --- a/Mage.Sets/src/mage/cards/o/OracleEnVec.java +++ b/Mage.Sets/src/mage/cards/o/OracleEnVec.java @@ -139,7 +139,7 @@ class OracleEnVecMustAttackRequirementEffect extends RequirementEffect { public boolean isInactive(Ability source, Game game) { return startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END - && game.getActivePlayerId().equals(this.getTargetPointer().getFirst(game, source))); + && game.isActivePlayer(this.getTargetPointer().getFirst(game, source))); } @Override @@ -177,7 +177,7 @@ class OracleEnVecCantAttackRestrictionEffect extends RestrictionEffect { public boolean isInactive(Ability source, Game game) { return startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END - && game.getActivePlayerId().equals(this.getTargetPointer().getFirst(game, source))); + && game.isActivePlayer(this.getTargetPointer().getFirst(game, source))); } @Override @@ -207,7 +207,7 @@ class OracleEnVecDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - return startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(event.getPlayerId()); + return startingTurn != game.getTurnNum() && game.isActivePlayer(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/o/Overgrowth.java b/Mage.Sets/src/mage/cards/o/Overgrowth.java index 27718d28c0..39d1741669 100644 --- a/Mage.Sets/src/mage/cards/o/Overgrowth.java +++ b/Mage.Sets/src/mage/cards/o/Overgrowth.java @@ -77,7 +77,7 @@ class OvergrowthTriggeredAbility extends TriggeredManaAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { + if (enchantment != null && enchantment.isAttachedTo(event.getSourceId())) { Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); if (enchanted != null) { getEffects().get(0).setTargetPointer(new FixedTarget(enchanted.getControllerId())); diff --git a/Mage.Sets/src/mage/cards/p/ParadoxHaze.java b/Mage.Sets/src/mage/cards/p/ParadoxHaze.java index 38b926a89f..eb98a98e32 100644 --- a/Mage.Sets/src/mage/cards/p/ParadoxHaze.java +++ b/Mage.Sets/src/mage/cards/p/ParadoxHaze.java @@ -79,7 +79,7 @@ class ParadoxHazeTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(getSourceId()); if (permanent != null) { Player player = game.getPlayer(permanent.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { + if (player != null && game.isActivePlayer(player.getId())) { FirstTimeStepWatcher watcher = (FirstTimeStepWatcher) game.getState().getWatchers().get(EventType.UPKEEP_STEP_POST.toString() + FirstTimeStepWatcher.class.getSimpleName()); if (watcher != null && !watcher.conditionMet()) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); diff --git a/Mage.Sets/src/mage/cards/p/PersonalSanctuary.java b/Mage.Sets/src/mage/cards/p/PersonalSanctuary.java index f6f62c3deb..2a0cdb373b 100644 --- a/Mage.Sets/src/mage/cards/p/PersonalSanctuary.java +++ b/Mage.Sets/src/mage/cards/p/PersonalSanctuary.java @@ -68,7 +68,7 @@ class PersonalSanctuaryEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER) { - if (event.getTargetId().equals(source.getControllerId()) && game.getActivePlayerId().equals(source.getControllerId())) + if (event.getTargetId().equals(source.getControllerId()) && game.isActivePlayer(source.getControllerId())) return super.applies(event, source, game); } return false; diff --git a/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java b/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java index 551d5a692c..fe202bc1e0 100644 --- a/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java +++ b/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java @@ -76,7 +76,7 @@ class CastCreatureWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST - && game.getActivePlayerId().equals(event.getPlayerId()) + && game.isActivePlayer(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId())) { Spell spell = (Spell) game.getObject(event.getTargetId()); if (spell.isCreature()) { diff --git a/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java b/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java index addf6310f5..630ceaa9e1 100644 --- a/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java +++ b/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java @@ -65,7 +65,7 @@ class PrimitiveEtchingsAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { - if (game.getActivePlayerId().equals(this.getControllerId()) && this.lastTriggeredTurn != game.getTurnNum()) { + if (game.isActivePlayer(this.getControllerId()) && this.lastTriggeredTurn != game.getTurnNum()) { Card card = game.getCard(event.getTargetId()); Player controller = game.getPlayer(this.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(this.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java b/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java index c8384d9c94..904e443aa4 100644 --- a/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java +++ b/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java @@ -77,7 +77,7 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId) ) { + if (game.isActivePlayer(this.controllerId) ) { if (game.getCombat().attacksAlone()) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); diff --git a/Mage.Sets/src/mage/cards/r/RaidBombardment.java b/Mage.Sets/src/mage/cards/r/RaidBombardment.java index 74a95d90a3..25f1a4d7a1 100644 --- a/Mage.Sets/src/mage/cards/r/RaidBombardment.java +++ b/Mage.Sets/src/mage/cards/r/RaidBombardment.java @@ -59,7 +59,7 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId)) { + if (game.isActivePlayer(this.controllerId)) { Permanent attacker = game.getPermanent(event.getSourceId()); if (attacker != null) { if (attacker.getPower().getValue() <= 2) { diff --git a/Mage.Sets/src/mage/cards/r/ReturnToDust.java b/Mage.Sets/src/mage/cards/r/ReturnToDust.java index 9cdef129d8..c57d35ac04 100644 --- a/Mage.Sets/src/mage/cards/r/ReturnToDust.java +++ b/Mage.Sets/src/mage/cards/r/ReturnToDust.java @@ -37,7 +37,7 @@ public final class ReturnToDust extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { - if (game.getActivePlayerId().equals(ability.getControllerId()) && game.isMainPhase()) { + if (game.isActivePlayer(ability.getControllerId()) && game.isMainPhase()) { ability.addTarget(new TargetPermanent(1, 2, StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT, false)); } else { diff --git a/Mage.Sets/src/mage/cards/r/RowanKenrith.java b/Mage.Sets/src/mage/cards/r/RowanKenrith.java index 1fc9050119..a3a6678dfd 100644 --- a/Mage.Sets/src/mage/cards/r/RowanKenrith.java +++ b/Mage.Sets/src/mage/cards/r/RowanKenrith.java @@ -114,7 +114,7 @@ class RowanKenrithAttackEffect extends RequirementEffect { public boolean isInactive(Ability source, Game game) { return (startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END - && game.getActivePlayerId().equals(source.getFirstTarget()))) + && game.isActivePlayer(source.getFirstTarget()))) || // 6/15/2010: If a creature controlled by the affected player can't attack Gideon Jura (because he's no longer on the battlefield, for example), that player may have it attack you, another one of your planeswalkers, or nothing at all. creatingPermanent.getPermanent(game) == null; } diff --git a/Mage.Sets/src/mage/cards/r/Rowen.java b/Mage.Sets/src/mage/cards/r/Rowen.java index de7dc8e4fb..c44d050a38 100644 --- a/Mage.Sets/src/mage/cards/r/Rowen.java +++ b/Mage.Sets/src/mage/cards/r/Rowen.java @@ -65,7 +65,7 @@ class RowenAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { - if (game.getActivePlayerId().equals(this.getControllerId()) && this.lastTriggeredTurn != game.getTurnNum()) { + if (game.isActivePlayer(this.getControllerId()) && this.lastTriggeredTurn != game.getTurnNum()) { Card card = game.getCard(event.getTargetId()); Player controller = game.getPlayer(this.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(this.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/s/SentinelTower.java b/Mage.Sets/src/mage/cards/s/SentinelTower.java index b9d645b05e..9988c741cc 100644 --- a/Mage.Sets/src/mage/cards/s/SentinelTower.java +++ b/Mage.Sets/src/mage/cards/s/SentinelTower.java @@ -61,7 +61,7 @@ class SentinelTowerTriggeredAbility extends SpellCastAllTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(getControllerId()) + if (game.isActivePlayer(getControllerId()) && super.checkTrigger(event, game)) { SentinelTowerWatcher watcher = (SentinelTowerWatcher) game.getState().getWatchers().get(SentinelTowerWatcher.class.getSimpleName()); if (watcher == null) { diff --git a/Mage.Sets/src/mage/cards/s/SerraAvenger.java b/Mage.Sets/src/mage/cards/s/SerraAvenger.java index 065adc24a3..1ddb5e47d2 100644 --- a/Mage.Sets/src/mage/cards/s/SerraAvenger.java +++ b/Mage.Sets/src/mage/cards/s/SerraAvenger.java @@ -80,7 +80,7 @@ class CantCastSerraAvengerEffect extends ContinuousRuleModifyingEffectImpl { if (event.getType() == EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) { Player controller = game.getPlayer(source.getControllerId()); // it can be cast on other players turn 1 - 3 if some effect let allow you to do this - if (controller != null && controller.getTurns() <= 3 && game.getActivePlayerId().equals(source.getControllerId())) { + if (controller != null && controller.getTurns() <= 3 && game.isActivePlayer(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SigilOfValor.java b/Mage.Sets/src/mage/cards/s/SigilOfValor.java index f7954a8225..aafeddaf20 100644 --- a/Mage.Sets/src/mage/cards/s/SigilOfValor.java +++ b/Mage.Sets/src/mage/cards/s/SigilOfValor.java @@ -75,13 +75,12 @@ class SigilOfValorTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(getControllerId())) { + if (game.isActivePlayer(getControllerId())) { if (game.getCombat().attacksAlone()) { Permanent equipment = game.getPermanent(getSourceId()); UUID attackerId = game.getCombat().getAttackers().get(0); if (equipment != null - && equipment.getAttachedTo() != null - && equipment.getAttachedTo().equals(attackerId)) { + && equipment.isAttachedTo(attackerId)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(attackerId)); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SirensCall.java b/Mage.Sets/src/mage/cards/s/SirensCall.java index f075dcc09d..9512ea85e4 100644 --- a/Mage.Sets/src/mage/cards/s/SirensCall.java +++ b/Mage.Sets/src/mage/cards/s/SirensCall.java @@ -73,7 +73,7 @@ class SirensCallMustAttackEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return game.getActivePlayerId().equals(permanent.getControllerId()); + return game.isActivePlayer(permanent.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/s/SoulEcho.java b/Mage.Sets/src/mage/cards/s/SoulEcho.java index 7042b2539b..7adefc2cb6 100644 --- a/Mage.Sets/src/mage/cards/s/SoulEcho.java +++ b/Mage.Sets/src/mage/cards/s/SoulEcho.java @@ -106,7 +106,7 @@ class SoulEchoReplacementEffect extends ReplacementEffectImpl { @Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { - if (!sameStep && game.getActivePlayerId().equals(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { + if (!sameStep && game.isActivePlayer(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { return true; } } else { diff --git a/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java b/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java index 749155607d..bf9a5c6d90 100644 --- a/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java +++ b/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java @@ -77,7 +77,7 @@ class CreatureControlledAttacksAloneTriggeredAbility extends TriggeredAbilityImp @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId)) { + if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); return true; diff --git a/Mage.Sets/src/mage/cards/s/SphinxsDecree.java b/Mage.Sets/src/mage/cards/s/SphinxsDecree.java index ec0f5cb46b..2b841942ca 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxsDecree.java +++ b/Mage.Sets/src/mage/cards/s/SphinxsDecree.java @@ -103,7 +103,7 @@ class SphinxsDecreeCantCastEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { UUID opponentId = getTargetPointer().getFirst(game, source); - if (game.getActivePlayerId().equals(opponentId)) { + if (game.isActivePlayer(opponentId)) { if (playersNextTurn == 0) { playersNextTurn = game.getTurnNum(); } diff --git a/Mage.Sets/src/mage/cards/s/SpitefulReturned.java b/Mage.Sets/src/mage/cards/s/SpitefulReturned.java index d0728b5895..3bca683888 100644 --- a/Mage.Sets/src/mage/cards/s/SpitefulReturned.java +++ b/Mage.Sets/src/mage/cards/s/SpitefulReturned.java @@ -86,7 +86,7 @@ class SpitefulReturnedTriggeredAbility extends TriggeredAbilityImpl { return true; } } else { - if (sourcePermanent.getAttachedTo() != null && sourcePermanent.getAttachedTo().equals(event.getSourceId())) { + if (sourcePermanent.isAttachedTo(event.getSourceId())) { UUID defender = game.getCombat().getDefendingPlayerId(sourcePermanent.getAttachedTo(), game); this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); return true; diff --git a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java index f3316cca38..c7d568a392 100644 --- a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java +++ b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java @@ -150,7 +150,7 @@ class TamiyoFieldResearcherDelayedTriggeredAbility extends DelayedTriggeredAbili @Override public boolean isInactive(Game game) { - return game.getActivePlayerId().equals(getControllerId()) && game.getTurnNum() != startingTurn; + return game.isActivePlayer(getControllerId()) && game.getTurnNum() != startingTurn; } @Override diff --git a/Mage.Sets/src/mage/cards/t/Taunt.java b/Mage.Sets/src/mage/cards/t/Taunt.java index ed2e444429..cff6d3e77c 100644 --- a/Mage.Sets/src/mage/cards/t/Taunt.java +++ b/Mage.Sets/src/mage/cards/t/Taunt.java @@ -62,7 +62,7 @@ class TauntEffect extends RequirementEffect { public boolean isInactive(Ability source, Game game) { return startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END && - game.getActivePlayerId().equals(this.getTargetPointer().getFirst(game, source))); + game.isActivePlayer(this.getTargetPointer().getFirst(game, source))); } @Override diff --git a/Mage.Sets/src/mage/cards/t/TidebinderMage.java b/Mage.Sets/src/mage/cards/t/TidebinderMage.java index e2ba1780fd..bc6348a859 100644 --- a/Mage.Sets/src/mage/cards/t/TidebinderMage.java +++ b/Mage.Sets/src/mage/cards/t/TidebinderMage.java @@ -118,7 +118,7 @@ class TidebinderMageEffect extends ContinuousRuleModifyingEffectImpl { if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { if (event.getTargetId().equals(targetPointer.getFirst(game, source))) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && game.getActivePlayerId().equals(permanent.getControllerId())) { + if (permanent != null && game.isActivePlayer(permanent.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TormentOfScarabs.java b/Mage.Sets/src/mage/cards/t/TormentOfScarabs.java index 4d3fbc6db7..bda573aa8b 100644 --- a/Mage.Sets/src/mage/cards/t/TormentOfScarabs.java +++ b/Mage.Sets/src/mage/cards/t/TormentOfScarabs.java @@ -80,7 +80,7 @@ class TormentOfScarabsAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { - if (game.getActivePlayerId().equals(enchantment.getAttachedTo())) { + if (game.isActivePlayer(enchantment.getAttachedTo())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/u/UndiscoveredParadise.java b/Mage.Sets/src/mage/cards/u/UndiscoveredParadise.java index f23896135d..17395c3370 100644 --- a/Mage.Sets/src/mage/cards/u/UndiscoveredParadise.java +++ b/Mage.Sets/src/mage/cards/u/UndiscoveredParadise.java @@ -89,7 +89,7 @@ class AtBeginningOfUntapDelayedTriggeredAbility extends DelayedTriggeredAbility @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(controllerId)) { + if (game.isActivePlayer(controllerId)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/u/UnwindingClock.java b/Mage.Sets/src/mage/cards/u/UnwindingClock.java index 51f5f1d1b2..4c0b876739 100644 --- a/Mage.Sets/src/mage/cards/u/UnwindingClock.java +++ b/Mage.Sets/src/mage/cards/u/UnwindingClock.java @@ -67,7 +67,7 @@ class UnwindingClockEffect extends ContinuousEffectImpl { applied = Boolean.FALSE; } if (!applied && layer == Layer.RulesEffects) { - if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) { + if (!game.isActivePlayer(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); for (Permanent artifact : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { boolean untap = true; diff --git a/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java b/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java index bc55f6d0cb..2b9c1d2c91 100644 --- a/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java +++ b/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java @@ -82,7 +82,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl { applied = Boolean.FALSE; } if (!applied && layer == Layer.RulesEffects) { - if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) { + if (!game.isActivePlayer(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); Permanent land = game.getPermanent(source.getSourceId()); boolean untap = true; diff --git a/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java b/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java index 059572e9e7..309f312024 100644 --- a/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java +++ b/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java @@ -68,7 +68,7 @@ class VoiceOfResurgenceTriggeredAbility extends TriggeredAbilityImpl { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && game.getOpponents(super.getControllerId()).contains(spell.getControllerId()) - && game.getActivePlayerId().equals(super.getControllerId())) { + && game.isActivePlayer(super.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java index cc1310933b..7699a25e1e 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java +++ b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java @@ -112,7 +112,7 @@ class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl { @Override public boolean isInactive(Ability source, Game game) { if (startingTurn != 0 && game.getTurnNum() != startingTurn) { - if (game.getActivePlayerId().equals(source.getControllerId())) { + if (game.isActivePlayer(source.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WallOfDust.java b/Mage.Sets/src/mage/cards/w/WallOfDust.java index a9438e5302..5998d54a4c 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfDust.java +++ b/Mage.Sets/src/mage/cards/w/WallOfDust.java @@ -76,7 +76,7 @@ class WallOfDustRestrictionEffect extends RestrictionEffect { if (targetPermanent == null) { return true; } - if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) { + if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.isActivePlayer(targetPermanent.getControllerId())) { nextTurnTargetController = game.getTurnNum(); } return game.getPhase().getType() == TurnPhase.END && nextTurnTargetController > 0 && game.getTurnNum() > nextTurnTargetController; @@ -95,7 +95,7 @@ class WallOfDustRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { - if (game.getActivePlayerId().equals(permanent.getControllerId())) { + if (game.isActivePlayer(permanent.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/w/Witchstalker.java b/Mage.Sets/src/mage/cards/w/Witchstalker.java index 42b10d3ee8..6c8f6fedd7 100644 --- a/Mage.Sets/src/mage/cards/w/Witchstalker.java +++ b/Mage.Sets/src/mage/cards/w/Witchstalker.java @@ -78,7 +78,7 @@ class WitchstalkerTriggeredAbility extends TriggeredAbilityImpl { return spell != null && filter.match(spell,game) && game.getOpponents(this.getControllerId()).contains(spell.getControllerId()) - && game.getActivePlayerId().equals(this.getControllerId()); + && game.isActivePlayer(this.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/w/WritOfPassage.java b/Mage.Sets/src/mage/cards/w/WritOfPassage.java index b2f3a78725..a36d8348ea 100644 --- a/Mage.Sets/src/mage/cards/w/WritOfPassage.java +++ b/Mage.Sets/src/mage/cards/w/WritOfPassage.java @@ -97,7 +97,6 @@ class WritOfPassageAttachedEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { Permanent attachment = game.getPermanent(source.getSourceId()); - return attachment != null && attachment.getAttachedTo() != null - && attachment.getAttachedTo().equals(permanent.getId()); + return attachment != null && attachment.isAttachedTo(permanent.getId()); } } diff --git a/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java b/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java index 2b0cbb1387..33d6e8756f 100644 --- a/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java +++ b/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java @@ -84,7 +84,7 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl { @Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { - if (game.getActivePlayerId().equals(source.getControllerId())) { + if (game.isActivePlayer(source.getControllerId())) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAttachedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAttachedTriggeredAbility.java index 5cf8d73b16..10a3024d06 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAttachedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAttachedTriggeredAbility.java @@ -48,8 +48,7 @@ public class DealsDamageToACreatureAttachedTriggeredAbility extends TriggeredAbi if (!combatOnly || ((DamagedCreatureEvent) event).isCombatDamage()) { Permanent attachment = game.getPermanent(this.getSourceId()); if (attachment != null - && attachment.getAttachedTo() != null - && event.getSourceId().equals(attachment.getAttachedTo())) { + && attachment.isAttachedTo(event.getSourceId())) { if (setTargetPointer) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedAttachedEffect.java index 39647dd438..6fc49b43cd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedAttachedEffect.java @@ -36,7 +36,7 @@ public class CantBeBlockedAttachedEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { Permanent attachment = game.getPermanent(source.getSourceId()); - return attachment != null && attachment.getAttachedTo() != null - && attachment.getAttachedTo().equals(permanent.getId()); + return attachment != null + && attachment.isAttachedTo(permanent.getId()); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CantCastMoreThanOneSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CantCastMoreThanOneSpellEffect.java index 5a50943bff..e20ec58717 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CantCastMoreThanOneSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CantCastMoreThanOneSpellEffect.java @@ -65,7 +65,7 @@ public class CantCastMoreThanOneSpellEffect extends ContinuousRuleModifyingEffec break; case CONTROLLER_ATTACHED_TO: Permanent attachment = game.getPermanent(source.getSourceId()); - if (attachment == null || !attachment.getAttachedTo().equals(event.getPlayerId())) { + if (attachment == null || !attachment.isAttachedTo(event.getPlayerId())) { return false; } } diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index bb11ca0f8f..fca0516e4d 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -630,11 +630,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public List getConnectedCards(String key) { - if (this.connectedCards.containsKey(key)) { - return this.connectedCards.get(key); - } else { - return emptyList; - } + return this.connectedCards.getOrDefault(key, emptyList); } @Override From 6dce0c26f38961dea00931a5a53624ecfe778a20 Mon Sep 17 00:00:00 2001 From: igoudt Date: Mon, 9 Jul 2018 21:24:43 +0200 Subject: [PATCH 41/58] fix some his or her to their --- Mage.Sets/src/mage/cards/h/HintOfInsanity.java | 2 +- Mage.Sets/src/mage/cards/m/MineMineMine.java | 2 +- Mage.Sets/src/mage/cards/o/OnceMoreWithFeeling.java | 2 +- Mage.Sets/src/mage/cards/p/PsychicBattle.java | 2 +- Mage.Sets/src/mage/cards/t/ThoughtDissector.java | 4 ++-- .../effects/common/LookLibraryTopCardTargetPlayerEffect.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/h/HintOfInsanity.java b/Mage.Sets/src/mage/cards/h/HintOfInsanity.java index 922837d71c..745149db0b 100644 --- a/Mage.Sets/src/mage/cards/h/HintOfInsanity.java +++ b/Mage.Sets/src/mage/cards/h/HintOfInsanity.java @@ -46,7 +46,7 @@ class HintOfInsanityEffect extends OneShotEffect { public HintOfInsanityEffect() { super(Outcome.Discard); - this.staticText = "Target player reveals his or her hand. That player discards all nonland cards with the same name as another card in his or her hand"; + this.staticText = "Target player reveals their hand. That player discards all nonland cards with the same name as another card in their hand"; } public HintOfInsanityEffect(final HintOfInsanityEffect effect) { diff --git a/Mage.Sets/src/mage/cards/m/MineMineMine.java b/Mage.Sets/src/mage/cards/m/MineMineMine.java index 51f7444aaa..b5c54f0dad 100644 --- a/Mage.Sets/src/mage/cards/m/MineMineMine.java +++ b/Mage.Sets/src/mage/cards/m/MineMineMine.java @@ -63,7 +63,7 @@ class MineMineMineDrawEffect extends OneShotEffect { MineMineMineDrawEffect() { super(Outcome.DrawCard); - this.staticText = "each player puts his or her library into his or her hand"; + this.staticText = "each player puts their library into their hand"; } MineMineMineDrawEffect(final MineMineMineDrawEffect effect) { diff --git a/Mage.Sets/src/mage/cards/o/OnceMoreWithFeeling.java b/Mage.Sets/src/mage/cards/o/OnceMoreWithFeeling.java index 467c6d2724..a5e986680f 100644 --- a/Mage.Sets/src/mage/cards/o/OnceMoreWithFeeling.java +++ b/Mage.Sets/src/mage/cards/o/OnceMoreWithFeeling.java @@ -55,7 +55,7 @@ class OnceMoreWithFeelingEffect extends OneShotEffect { public OnceMoreWithFeelingEffect() { super(Outcome.Detriment); - staticText = "Exile all permanents and all cards from all graveyards. Each player shuffles his or her hand into his or her library"; + staticText = "Exile all permanents and all cards from all graveyards. Each player shuffles their hand into their library"; } public OnceMoreWithFeelingEffect(final OnceMoreWithFeelingEffect effect) { diff --git a/Mage.Sets/src/mage/cards/p/PsychicBattle.java b/Mage.Sets/src/mage/cards/p/PsychicBattle.java index 65673a9583..f4f3eb91b9 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicBattle.java +++ b/Mage.Sets/src/mage/cards/p/PsychicBattle.java @@ -88,7 +88,7 @@ class PsychicBattleEffect extends OneShotEffect { public PsychicBattleEffect() { super(Outcome.Benefit); - this.staticText = "each player reveals the top card of his or her library. The player who reveals the card with the highest converted mana cost may change the target or targets. If two or more cards are tied for highest cost, the target or targets remain unchanged"; + this.staticText = "each player reveals the top card of their library. The player who reveals the card with the highest converted mana cost may change the target or targets. If two or more cards are tied for highest cost, the target or targets remain unchanged"; } public PsychicBattleEffect(final PsychicBattleEffect effect) { diff --git a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java index 523217f235..2238235f42 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java @@ -30,7 +30,7 @@ public final class ThoughtDissector extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); - // {X}, {tap}: Target opponent reveals cards from the top of his or her library until an artifact card or X cards are revealed, whichever comes first. If an artifact card is revealed this way, put it onto the battlefield under your control and sacrifice Thought Dissector. Put the rest of the revealed cards into that player's graveyard. + // {X}, {tap}: Target opponent reveals cards from the top of their library until an artifact card or X cards are revealed, whichever comes first. If an artifact card is revealed this way, put it onto the battlefield under your control and sacrifice Thought Dissector. Put the rest of the revealed cards into that player's graveyard. SimpleActivatedAbility abilitiy = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThoughtDissectorEffect(), new VariableManaCost()); abilitiy.addCost(new TapSourceCost()); abilitiy.addTarget(new TargetOpponent()); @@ -53,7 +53,7 @@ class ThoughtDissectorEffect extends OneShotEffect { public ThoughtDissectorEffect() { super(Outcome.Detriment); - staticText = "Target opponent reveals cards from the top of his or her library until an artifact card or X cards are revealed, whichever comes first. If an artifact card is revealed this way, put it onto the battlefield under your control and sacrifice {this}. Put the rest of the revealed cards into that player's graveyard."; + staticText = "Target opponent reveals cards from the top of their library until an artifact card or X cards are revealed, whichever comes first. If an artifact card is revealed this way, put it onto the battlefield under your control and sacrifice {this}. Put the rest of the revealed cards into that player's graveyard."; } public ThoughtDissectorEffect(final ThoughtDissectorEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryTopCardTargetPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryTopCardTargetPlayerEffect.java index 87395253fa..1fd35fb54b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryTopCardTargetPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryTopCardTargetPlayerEffect.java @@ -82,7 +82,7 @@ public class LookLibraryTopCardTargetPlayerEffect extends OneShotEffect { } } if (mayShuffleAfter) { - if (player.chooseUse(Outcome.Benefit, (player == targetPlayer ? "Shuffle your library?" : "Do you want the chosen player to shuffle his or her library?"), source, game)) { + if (player.chooseUse(Outcome.Benefit, (player == targetPlayer ? "Shuffle your library?" : "Do you want the chosen player to shuffle their library?"), source, game)) { targetPlayer.shuffleLibrary(source, game); } } From 69465fd9b668fca171e537e7335eba3604e682a5 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 10 Jul 2018 05:49:21 +0400 Subject: [PATCH 42/58] * Fixed svg symbols download from scryfall (#5135); --- .../org/mage/plugins/card/dl/DownloadGui.java | 1 + .../org/mage/plugins/card/dl/DownloadJob.java | 40 ++++++++++- .../org/mage/plugins/card/dl/Downloader.java | 19 ++++- .../dl/sources/ScryfallSymbolsSource.java | 69 +++++++++++++------ .../dl/sources/WizardCardsImageSource.java | 34 ++------- .../plugins/card/utils/CardImageUtils.java | 37 +++++++++- 6 files changed, 140 insertions(+), 60 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadGui.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadGui.java index a8438a706a..e3ff2ca179 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadGui.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadGui.java @@ -158,6 +158,7 @@ public class DownloadGui extends JPanel { b.addActionListener(e -> { switch(this.job.getState()) { case NEW: + case PREPARING: case WORKING: this.job.setState(State.ABORTED); } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java index 6efcfd3eef..c39fb6d163 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java @@ -23,16 +23,16 @@ import org.mage.plugins.card.utils.CardImageUtils; * The class DownloadJob. * * @version V0.0 25.08.2010 - * @author Clemens Koza + * @author Clemens Koza, JayDi85 */ public class DownloadJob extends AbstractLaternaBean { public enum State { - NEW, WORKING, FINISHED, ABORTED + NEW, PREPARING, WORKING, FINISHED, ABORTED } private final String name; - private final Source source; + private Source source; private final Destination destination; private final Property state = properties.property("state", State.NEW); private final Property message = properties.property("message"); @@ -98,6 +98,36 @@ public class DownloadJob extends AbstractLaternaBean { this.message.setValue(message); } + /** + * Inner prepare cycle from new to working + */ + public void doPrepareAndStartWork() { + if (this.state.getValue() != State.NEW) { + setError("Can't call prepare at this point."); + return; + } + + this.state.setValue(State.PREPARING); + + try { + onPreparing(); + } catch (Exception e) { + setError("Prepare error: " + e.getMessage(), e); + return; + } + + // change to working state on good prepare call + this.state.setValue(State.WORKING); + } + + + /** + * Prepare code to override in custom download tasks (it's calls before work start) + */ + public void onPreparing() throws Exception { + return; + } + /** * Sets the job's message. * @@ -131,6 +161,10 @@ public class DownloadJob extends AbstractLaternaBean { return source; } + public void setSource(Source source) { + this.source = source; + } + public Destination getDestination() { return destination; } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/Downloader.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/Downloader.java index 4b71a8d16c..497ee62d62 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/Downloader.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/Downloader.java @@ -60,6 +60,7 @@ public class Downloader extends AbstractLaternaBean implements Disposable { for (DownloadJob j : jobs) { switch (j.getState()) { case NEW: + case PREPARING: case WORKING: j.setState(State.ABORTED); } @@ -82,8 +83,11 @@ public class Downloader extends AbstractLaternaBean implements Disposable { } public void add(DownloadJob job) { + if (job.getState() == State.PREPARING) { + throw new IllegalArgumentException("Job already preparing"); + } if (job.getState() == State.WORKING) { - throw new IllegalArgumentException("Job already running"); + throw new IllegalArgumentException("Job already working"); } if (job.getState() == State.FINISHED) { throw new IllegalArgumentException("Job already finished"); @@ -106,13 +110,22 @@ public class Downloader extends AbstractLaternaBean implements Disposable { @Override public void onMessage(DownloadJob job) { - //the job won't be processed by multiple threads + + // start to work + // the job won't be processed by multiple threads synchronized (job) { if (job.getState() != State.NEW) { return; } - job.setState(State.WORKING); + + job.doPrepareAndStartWork(); + + if (job.getState() != State.WORKING) { + return; + } } + + // download and save data try { Source src = job.getSource(); Destination dst = job.getDestination(); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallSymbolsSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallSymbolsSource.java index e90d1cf9c5..483bb27e86 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallSymbolsSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallSymbolsSource.java @@ -9,8 +9,13 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import mage.MageException; import mage.util.StreamUtils; +import org.jsoup.select.Elements; import org.mage.plugins.card.dl.DownloadJob; +import org.mage.plugins.card.utils.CardImageUtils; + +import javax.swing.text.Document; import static org.mage.card.arcane.ManaSymbols.getSymbolFileNameAsSVG; import static org.mage.plugins.card.utils.CardImageUtils.getImagesDir; @@ -18,14 +23,14 @@ import static org.mage.plugins.card.utils.CardImageUtils.getImagesDir; // TODO: add force to download symbols (rewrite exist files) /** - * - * @author jaydi85@gmail.com - * + * @author JayDi85 */ public class ScryfallSymbolsSource implements Iterable { - static final String SOURCE_URL = "https://assets.scryfall.com/assets/scryfall.css"; // search css-file on https://scryfall.com/docs/api/colors + //static final String SOURCE_URL = "https://assets.scryfall.com/assets/scryfall.css"; // old version with direct css-file on https://scryfall.com/docs/api/colors + static final String CSS_SOURCE_URL = "https://scryfall.com/docs/api/colors"; + static final String CSS_SOURCE_SELECTOR = "link[rel=stylesheet]"; // static final String STATE_PROP_NAME = "state"; static final String DOWNLOAD_TEMP_FILE = getImagesDir() + File.separator + "temp" + File.separator + "scryfall-symbols-source.txt"; @@ -55,21 +60,21 @@ public class ScryfallSymbolsSource implements Iterable { return jobs.iterator(); } - private void parseData(String sourcePath){ + private void parseData(String sourcePath) { String sourceData = ""; try { sourceData = new String(Files.readAllBytes(Paths.get(sourcePath))); - }catch (IOException e) { + } catch (IOException e) { LOGGER.error("Can't open file to parse data: " + sourcePath + " , reason: " + e.getMessage()); } // gen symbols list ArrayList allMageSymbols = new ArrayList<>(); - for(int i = 0; i < SYMBOLS_LIST.length; i++){ + for (int i = 0; i < SYMBOLS_LIST.length; i++) { allMageSymbols.add(SYMBOLS_LIST[i]); } - for(Integer i = SYMBOLS_NUMBER_START; i <= SYMBOLS_NUMBER_END; i++){ + for (Integer i = SYMBOLS_NUMBER_START; i <= SYMBOLS_NUMBER_END; i++) { allMageSymbols.add(String.valueOf(SYMBOLS_NUMBER_START + i)); } @@ -88,23 +93,22 @@ public class ScryfallSymbolsSource implements Iterable { // dirs maker File dir = getSymbolFileNameAsSVG("W").getParentFile(); - if(!dir.exists()){ + if (!dir.exists()) { dir.mkdirs(); } // decode and save data (only if not exist) - for(String needCode: allMageSymbols){ + for (String needCode : allMageSymbols) { String searchCode = needCode.replace("/", ""); - if(!foundedData.containsKey(searchCode)) - { + if (!foundedData.containsKey(searchCode)) { LOGGER.warn("Can't found symbol code from scryfall: " + searchCode); continue; } File destFile = getSymbolFileNameAsSVG(searchCode); - if (destFile.exists() && (destFile.length() > 0)){ + if (destFile.exists() && (destFile.length() > 0)) { continue; } FileOutputStream stream = null; @@ -118,7 +122,7 @@ public class ScryfallSymbolsSource implements Iterable { stream.write(fileData); LOGGER.info("New svg symbol downloaded: " + needCode); - } catch (Exception e) { + } catch (Exception e) { LOGGER.error("Can't decode svg icon and save to file: " + destFile.getPath() + ", reason: " + e.getMessage()); } finally { StreamUtils.closeQuietly(stream); @@ -127,23 +131,26 @@ public class ScryfallSymbolsSource implements Iterable { } - private class ScryfallSymbolsDownloadJob extends DownloadJob{ + private class ScryfallSymbolsDownloadJob extends DownloadJob { + + private String cssUrl = ""; // need to find url from colors page https://scryfall.com/docs/api/colors // listener for data parse after download complete - private class ScryDownloadOnFinishedListener implements PropertyChangeListener { + private class ScryfallDownloadOnFinishedListener implements PropertyChangeListener { private String downloadedFile; - public ScryDownloadOnFinishedListener(String ADestFile){ + public ScryfallDownloadOnFinishedListener(String ADestFile) { this.downloadedFile = ADestFile; } @Override public void propertyChange(PropertyChangeEvent evt) { - if (!evt.getPropertyName().equals(STATE_PROP_NAME)){ + + if (!evt.getPropertyName().equals(STATE_PROP_NAME)) { throw new IllegalArgumentException("Unknown download property " + evt.getPropertyName()); } - if (evt.getNewValue() != State.FINISHED){ + if (evt.getNewValue() != State.FINISHED) { return; } @@ -152,16 +159,34 @@ public class ScryfallSymbolsSource implements Iterable { } } + @Override + public void onPreparing() throws Exception { + this.cssUrl = ""; + + org.jsoup.nodes.Document doc = CardImageUtils.downloadHtmlDocument(CSS_SOURCE_URL); + org.jsoup.select.Elements cssList = doc.select(CSS_SOURCE_SELECTOR); + if (cssList.size() == 1) { + this.cssUrl = cssList.first().attr("href").toString(); + } + + if (this.cssUrl.isEmpty()) { + throw new IllegalStateException("Can't find stylesheet url from scryfall colors page."); + } else { + this.setSource(fromURL(this.cssUrl)); + } + } + private String destFile = ""; public ScryfallSymbolsDownloadJob() { - super("Scryfall symbols source", fromURL(SOURCE_URL), toFile(DOWNLOAD_TEMP_FILE)); + // download init + super("Scryfall symbols source", fromURL(""), toFile(DOWNLOAD_TEMP_FILE)); // url setup on preparing stage this.destFile = DOWNLOAD_TEMP_FILE; - this.addPropertyChangeListener(STATE_PROP_NAME, new ScryDownloadOnFinishedListener(this.destFile)); + this.addPropertyChangeListener(STATE_PROP_NAME, new ScryfallDownloadOnFinishedListener(this.destFile)); // clear dest file (always download new data) File file = new File(this.destFile); - if (file.exists()){ + if (file.exists()) { file.delete(); } } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java index dff6ed8304..e4103359ba 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java @@ -35,6 +35,7 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.mage.plugins.card.images.CardDownloadData; +import org.mage.plugins.card.utils.CardImageUtils; /** * @author North @@ -535,7 +536,7 @@ public enum WizardCardsImageSource implements CardImageSource { while (page < 999) { String searchUrl = "http://gatherer.wizards.com/Pages/Search/Default.aspx?sort=cn+&page=" + page + "&action=advanced&output=spoiler&method=visual&set=+%5B%22" + URLSetName + "%22%5D"; logger.debug("URL: " + searchUrl); - Document doc = getDocument(searchUrl); + Document doc = CardImageUtils.downloadHtmlDocument(searchUrl); Elements cardsImages = doc.select("img[src^=../../Handlers/]"); if (cardsImages.isEmpty()) { break; @@ -587,33 +588,6 @@ public enum WizardCardsImageSource implements CardImageSource { return setLinks; } - private Document getDocument(String urlString) throws NumberFormatException, IOException { - Preferences prefs = MageFrame.getPreferences(); - Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None")); - Document doc; - if (proxyType == ProxyType.NONE) { - doc = Jsoup.connect(urlString).timeout(60 * 1000).get(); - } else { - String proxyServer = prefs.get("proxyAddress", ""); - int proxyPort = Integer.parseInt(prefs.get("proxyPort", "0")); - URL url = new URL(urlString); - Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyServer, proxyPort)); - HttpURLConnection uc = (HttpURLConnection) url.openConnection(proxy); - uc.setConnectTimeout(10000); - uc.setReadTimeout(60000); - uc.connect(); - - String line; - StringBuffer tmp = new StringBuffer(); - BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream())); - while ((line = in.readLine()) != null) { - tmp.append(line); - } - doc = Jsoup.parse(String.valueOf(tmp)); - } - return doc; - } - private void getLandVariations(LinkedHashMap setLinks, String cardSet, int multiverseId, String cardName) throws IOException, NumberFormatException { CardCriteria criteria = new CardCriteria(); criteria.nameExact(cardName); @@ -621,7 +595,7 @@ public enum WizardCardsImageSource implements CardImageSource { List cards = CardRepository.instance.findCards(criteria); String urlLandDocument = "http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=" + multiverseId; - Document landDoc = getDocument(urlLandDocument); + Document landDoc = CardImageUtils.downloadHtmlDocument(urlLandDocument); Elements variations = landDoc.select("a.variationlink"); if (!variations.isEmpty()) { if (variations.size() > cards.size()) { @@ -668,7 +642,7 @@ public enum WizardCardsImageSource implements CardImageSource { private HashMap getlocalizedMultiverseIds(Integer englishMultiverseId) throws IOException { String cardLanguagesUrl = "http://gatherer.wizards.com/Pages/Card/Languages.aspx?multiverseid=" + englishMultiverseId; - Document cardLanguagesDoc = getDocument(cardLanguagesUrl); + Document cardLanguagesDoc = CardImageUtils.downloadHtmlDocument(cardLanguagesUrl); Elements languageTableRows = cardLanguagesDoc.select("tr.cardItem"); HashMap localizedIds = new HashMap<>(); if (!languageTableRows.isEmpty()) { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java index 6b7c74587a..fb7c42aa09 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java @@ -1,11 +1,17 @@ package org.mage.plugins.card.utils; +import java.io.BufferedReader; import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.net.Proxy; +import java.net.URL; import java.util.HashMap; import java.util.Locale; import java.util.prefs.Preferences; + import mage.client.MageFrame; import mage.client.constants.Constants; import mage.client.dialog.PreferencesDialog; @@ -13,6 +19,8 @@ import mage.remote.Connection; import mage.remote.Connection.ProxyType; import net.java.truevfs.access.TFile; import org.apache.log4j.Logger; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; import org.mage.plugins.card.images.CardDownloadData; import org.mage.plugins.card.properties.SettingsManager; @@ -22,7 +30,6 @@ public final class CardImageUtils { private static final Logger log = Logger.getLogger(CardImageUtils.class); /** - * * @param card * @return String if image exists, else null */ @@ -54,7 +61,6 @@ public final class CardImageUtils { } /** - * * @param card * @return String regardless of whether image exists */ @@ -280,4 +286,31 @@ public final class CardImageUtils { } return null; } + + public static Document downloadHtmlDocument(String urlString) throws NumberFormatException, IOException { + Preferences prefs = MageFrame.getPreferences(); + Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None")); + Document doc; + if (proxyType == ProxyType.NONE) { + doc = Jsoup.connect(urlString).timeout(60 * 1000).get(); + } else { + String proxyServer = prefs.get("proxyAddress", ""); + int proxyPort = Integer.parseInt(prefs.get("proxyPort", "0")); + URL url = new URL(urlString); + Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyServer, proxyPort)); + HttpURLConnection uc = (HttpURLConnection) url.openConnection(proxy); + uc.setConnectTimeout(10000); + uc.setReadTimeout(60000); + uc.connect(); + + String line; + StringBuffer tmp = new StringBuffer(); + BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream())); + while ((line = in.readLine()) != null) { + tmp.append(line); + } + doc = Jsoup.parse(String.valueOf(tmp)); + } + return doc; + } } From 7d2790e355f606d6316ba5369619975010b177b5 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 10 Jul 2018 06:05:35 +0400 Subject: [PATCH 43/58] Fixed card numbers in POR - Portal (#4628) --- Mage.Sets/src/mage/sets/Portal.java | 438 ++++++++++++++-------------- 1 file changed, 219 insertions(+), 219 deletions(-) diff --git a/Mage.Sets/src/mage/sets/Portal.java b/Mage.Sets/src/mage/sets/Portal.java index 81b744f91e..81162ed77c 100644 --- a/Mage.Sets/src/mage/sets/Portal.java +++ b/Mage.Sets/src/mage/sets/Portal.java @@ -34,226 +34,226 @@ public final class Portal extends ExpansionSet { this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; - cards.add(new SetCardInfo("Alabaster Dragon", 163, Rarity.RARE, mage.cards.a.AlabasterDragon.class)); - cards.add(new SetCardInfo("Alluring Scent", 80, Rarity.RARE, mage.cards.a.AlluringScent.class)); - cards.add(new SetCardInfo("Anaconda", 81, Rarity.UNCOMMON, mage.cards.a.Anaconda.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Anaconda", 82, Rarity.UNCOMMON, mage.cards.a.Anaconda.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Ancestral Memories", 41, Rarity.RARE, mage.cards.a.AncestralMemories.class)); - cards.add(new SetCardInfo("Angelic Blessing", 164, Rarity.COMMON, mage.cards.a.AngelicBlessing.class)); - cards.add(new SetCardInfo("Archangel", 165, Rarity.RARE, mage.cards.a.Archangel.class)); - cards.add(new SetCardInfo("Ardent Militia", 166, Rarity.UNCOMMON, mage.cards.a.ArdentMilitia.class)); - cards.add(new SetCardInfo("Armageddon", 167, Rarity.RARE, mage.cards.a.Armageddon.class)); - cards.add(new SetCardInfo("Armored Pegasus", 168, Rarity.COMMON, mage.cards.a.ArmoredPegasus.class)); - cards.add(new SetCardInfo("Arrogant Vampire", 1, Rarity.UNCOMMON, mage.cards.a.ArrogantVampire.class)); - cards.add(new SetCardInfo("Assassin's Blade", 2, Rarity.UNCOMMON, mage.cards.a.AssassinsBlade.class)); - cards.add(new SetCardInfo("Balance of Power", 42, Rarity.RARE, mage.cards.b.BalanceOfPower.class)); - cards.add(new SetCardInfo("Baleful Stare", 43, Rarity.UNCOMMON, mage.cards.b.BalefulStare.class)); - cards.add(new SetCardInfo("Bee Sting", 83, Rarity.UNCOMMON, mage.cards.b.BeeSting.class)); - cards.add(new SetCardInfo("Blaze", 122, Rarity.UNCOMMON, mage.cards.b.Blaze.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Blaze", 123, Rarity.UNCOMMON, mage.cards.b.Blaze.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Blessed Reversal", 169, Rarity.RARE, mage.cards.b.BlessedReversal.class)); - cards.add(new SetCardInfo("Blinding Light", 170, Rarity.RARE, mage.cards.b.BlindingLight.class)); - cards.add(new SetCardInfo("Bog Imp", 3, Rarity.COMMON, mage.cards.b.BogImp.class)); - cards.add(new SetCardInfo("Bog Raiders", 4, Rarity.COMMON, mage.cards.b.BogRaiders.class)); - cards.add(new SetCardInfo("Bog Wraith", 5, Rarity.UNCOMMON, mage.cards.b.BogWraith.class)); - cards.add(new SetCardInfo("Boiling Seas", 124, Rarity.UNCOMMON, mage.cards.b.BoilingSeas.class)); - cards.add(new SetCardInfo("Border Guard", 171, Rarity.COMMON, mage.cards.b.BorderGuard.class)); - cards.add(new SetCardInfo("Breath of Life", 172, Rarity.COMMON, mage.cards.b.BreathOfLife.class)); - cards.add(new SetCardInfo("Bull Hippo", 84, Rarity.UNCOMMON, mage.cards.b.BullHippo.class)); - cards.add(new SetCardInfo("Burning Cloak", 125, Rarity.COMMON, mage.cards.b.BurningCloak.class)); - cards.add(new SetCardInfo("Capricious Sorcerer", 44, Rarity.RARE, mage.cards.c.CapriciousSorcerer.class)); - cards.add(new SetCardInfo("Charging Bandits", 6, Rarity.UNCOMMON, mage.cards.c.ChargingBandits.class)); - cards.add(new SetCardInfo("Charging Paladin", 173, Rarity.UNCOMMON, mage.cards.c.ChargingPaladin.class)); - cards.add(new SetCardInfo("Charging Rhino", 85, Rarity.RARE, mage.cards.c.ChargingRhino.class)); - cards.add(new SetCardInfo("Cloak of Feathers", 45, Rarity.COMMON, mage.cards.c.CloakOfFeathers.class)); - cards.add(new SetCardInfo("Cloud Dragon", 46, Rarity.RARE, mage.cards.c.CloudDragon.class)); - cards.add(new SetCardInfo("Cloud Pirates", 47, Rarity.COMMON, mage.cards.c.CloudPirates.class)); - cards.add(new SetCardInfo("Cloud Spirit", 48, Rarity.UNCOMMON, mage.cards.c.CloudSpirit.class)); - cards.add(new SetCardInfo("Command of Unsummoning", 49, Rarity.UNCOMMON, mage.cards.c.CommandOfUnsummoning.class)); - cards.add(new SetCardInfo("Coral Eel", 50, Rarity.COMMON, mage.cards.c.CoralEel.class)); - cards.add(new SetCardInfo("Craven Giant", 126, Rarity.COMMON, mage.cards.c.CravenGiant.class)); - cards.add(new SetCardInfo("Craven Knight", 7, Rarity.COMMON, mage.cards.c.CravenKnight.class)); - cards.add(new SetCardInfo("Cruel Bargain", 8, Rarity.RARE, mage.cards.c.CruelBargain.class)); - cards.add(new SetCardInfo("Cruel Fate", 51, Rarity.RARE, mage.cards.c.CruelFate.class)); - cards.add(new SetCardInfo("Cruel Tutor", 9, Rarity.RARE, mage.cards.c.CruelTutor.class)); - cards.add(new SetCardInfo("Deep-Sea Serpent", 52, Rarity.UNCOMMON, mage.cards.d.DeepSeaSerpent.class)); - cards.add(new SetCardInfo("Deep Wood", 86, Rarity.UNCOMMON, mage.cards.d.DeepWood.class)); - cards.add(new SetCardInfo("Defiant Stand", 174, Rarity.UNCOMMON, mage.cards.d.DefiantStand.class)); + cards.add(new SetCardInfo("Alabaster Dragon", 1, Rarity.RARE, mage.cards.a.AlabasterDragon.class)); + cards.add(new SetCardInfo("Alluring Scent", 157, Rarity.RARE, mage.cards.a.AlluringScent.class)); + cards.add(new SetCardInfo("Anaconda", "158a", Rarity.UNCOMMON, mage.cards.a.Anaconda.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Anaconda", "158b", Rarity.UNCOMMON, mage.cards.a.Anaconda.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Ancestral Memories", 40, Rarity.RARE, mage.cards.a.AncestralMemories.class)); + cards.add(new SetCardInfo("Angelic Blessing", 2, Rarity.COMMON, mage.cards.a.AngelicBlessing.class)); + cards.add(new SetCardInfo("Archangel", 3, Rarity.RARE, mage.cards.a.Archangel.class)); + cards.add(new SetCardInfo("Ardent Militia", 4, Rarity.UNCOMMON, mage.cards.a.ArdentMilitia.class)); + cards.add(new SetCardInfo("Armageddon", 5, Rarity.RARE, mage.cards.a.Armageddon.class)); + cards.add(new SetCardInfo("Armored Pegasus", 6, Rarity.COMMON, mage.cards.a.ArmoredPegasus.class)); + cards.add(new SetCardInfo("Arrogant Vampire", 79, Rarity.UNCOMMON, mage.cards.a.ArrogantVampire.class)); + cards.add(new SetCardInfo("Assassin's Blade", 80, Rarity.UNCOMMON, mage.cards.a.AssassinsBlade.class)); + cards.add(new SetCardInfo("Balance of Power", 41, Rarity.RARE, mage.cards.b.BalanceOfPower.class)); + cards.add(new SetCardInfo("Baleful Stare", 42, Rarity.UNCOMMON, mage.cards.b.BalefulStare.class)); + cards.add(new SetCardInfo("Bee Sting", 159, Rarity.UNCOMMON, mage.cards.b.BeeSting.class)); + cards.add(new SetCardInfo("Blaze", "118a", Rarity.UNCOMMON, mage.cards.b.Blaze.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Blaze", "118b", Rarity.UNCOMMON, mage.cards.b.Blaze.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Blessed Reversal", 7, Rarity.RARE, mage.cards.b.BlessedReversal.class)); + cards.add(new SetCardInfo("Blinding Light", 8, Rarity.RARE, mage.cards.b.BlindingLight.class)); + cards.add(new SetCardInfo("Bog Imp", 81, Rarity.COMMON, mage.cards.b.BogImp.class)); + cards.add(new SetCardInfo("Bog Raiders", 82, Rarity.COMMON, mage.cards.b.BogRaiders.class)); + cards.add(new SetCardInfo("Bog Wraith", 83, Rarity.UNCOMMON, mage.cards.b.BogWraith.class)); + cards.add(new SetCardInfo("Boiling Seas", 119, Rarity.UNCOMMON, mage.cards.b.BoilingSeas.class)); + cards.add(new SetCardInfo("Border Guard", 9, Rarity.COMMON, mage.cards.b.BorderGuard.class)); + cards.add(new SetCardInfo("Breath of Life", 10, Rarity.COMMON, mage.cards.b.BreathOfLife.class)); + cards.add(new SetCardInfo("Bull Hippo", 160, Rarity.UNCOMMON, mage.cards.b.BullHippo.class)); + cards.add(new SetCardInfo("Burning Cloak", 120, Rarity.COMMON, mage.cards.b.BurningCloak.class)); + cards.add(new SetCardInfo("Capricious Sorcerer", 43, Rarity.RARE, mage.cards.c.CapriciousSorcerer.class)); + cards.add(new SetCardInfo("Charging Bandits", 84, Rarity.UNCOMMON, mage.cards.c.ChargingBandits.class)); + cards.add(new SetCardInfo("Charging Paladin", 11, Rarity.UNCOMMON, mage.cards.c.ChargingPaladin.class)); + cards.add(new SetCardInfo("Charging Rhino", 161, Rarity.RARE, mage.cards.c.ChargingRhino.class)); + cards.add(new SetCardInfo("Cloak of Feathers", 44, Rarity.COMMON, mage.cards.c.CloakOfFeathers.class)); + cards.add(new SetCardInfo("Cloud Dragon", 45, Rarity.RARE, mage.cards.c.CloudDragon.class)); + cards.add(new SetCardInfo("Cloud Pirates", 46, Rarity.COMMON, mage.cards.c.CloudPirates.class)); + cards.add(new SetCardInfo("Cloud Spirit", 47, Rarity.UNCOMMON, mage.cards.c.CloudSpirit.class)); + cards.add(new SetCardInfo("Command of Unsummoning", 48, Rarity.UNCOMMON, mage.cards.c.CommandOfUnsummoning.class)); + cards.add(new SetCardInfo("Coral Eel", 49, Rarity.COMMON, mage.cards.c.CoralEel.class)); + cards.add(new SetCardInfo("Craven Giant", 121, Rarity.COMMON, mage.cards.c.CravenGiant.class)); + cards.add(new SetCardInfo("Craven Knight", 85, Rarity.COMMON, mage.cards.c.CravenKnight.class)); + cards.add(new SetCardInfo("Cruel Bargain", 86, Rarity.RARE, mage.cards.c.CruelBargain.class)); + cards.add(new SetCardInfo("Cruel Fate", 50, Rarity.RARE, mage.cards.c.CruelFate.class)); + cards.add(new SetCardInfo("Cruel Tutor", 87, Rarity.RARE, mage.cards.c.CruelTutor.class)); + cards.add(new SetCardInfo("Deep Wood", 162, Rarity.UNCOMMON, mage.cards.d.DeepWood.class)); + cards.add(new SetCardInfo("Deep-Sea Serpent", 51, Rarity.UNCOMMON, mage.cards.d.DeepSeaSerpent.class)); + cards.add(new SetCardInfo("Defiant Stand", 12, Rarity.UNCOMMON, mage.cards.d.DefiantStand.class)); cards.add(new SetCardInfo("Deja Vu", 53, Rarity.COMMON, mage.cards.d.DejaVu.class)); - cards.add(new SetCardInfo("Desert Drake", 127, Rarity.UNCOMMON, mage.cards.d.DesertDrake.class)); - cards.add(new SetCardInfo("Devastation", 128, Rarity.RARE, mage.cards.d.Devastation.class)); - cards.add(new SetCardInfo("Devoted Hero", 175, Rarity.COMMON, mage.cards.d.DevotedHero.class)); - cards.add(new SetCardInfo("Djinn of the Lamp", 54, Rarity.RARE, mage.cards.d.DjinnOfTheLamp.class)); - cards.add(new SetCardInfo("Dread Charge", 10, Rarity.RARE, mage.cards.d.DreadCharge.class)); - cards.add(new SetCardInfo("Dread Reaper", 11, Rarity.RARE, mage.cards.d.DreadReaper.class)); - cards.add(new SetCardInfo("Dry Spell", 12, Rarity.UNCOMMON, DrySpell.class)); - cards.add(new SetCardInfo("Earthquake", 129, Rarity.RARE, mage.cards.e.Earthquake.class)); - cards.add(new SetCardInfo("Ebon Dragon", 13, Rarity.RARE, mage.cards.e.EbonDragon.class)); - cards.add(new SetCardInfo("Elite Cat Warrior", 87, Rarity.COMMON, EliteCatWarrior.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Elite Cat Warrior", 88, Rarity.COMMON, EliteCatWarrior.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Elven Cache", 89, Rarity.COMMON, mage.cards.e.ElvenCache.class)); - cards.add(new SetCardInfo("Elvish Ranger", 90, Rarity.COMMON, mage.cards.e.ElvishRanger.class)); - cards.add(new SetCardInfo("Endless Cockroaches", 14, Rarity.RARE, mage.cards.e.EndlessCockroaches.class)); - cards.add(new SetCardInfo("Exhaustion", 55, Rarity.RARE, mage.cards.e.Exhaustion.class)); - cards.add(new SetCardInfo("False Peace", 176, Rarity.COMMON, mage.cards.f.FalsePeace.class)); - cards.add(new SetCardInfo("Feral Shadow", 15, Rarity.COMMON, mage.cards.f.FeralShadow.class)); - cards.add(new SetCardInfo("Final Strike", 16, Rarity.RARE, mage.cards.f.FinalStrike.class)); - cards.add(new SetCardInfo("Fire Dragon", 130, Rarity.RARE, mage.cards.f.FireDragon.class)); - cards.add(new SetCardInfo("Fire Imp", 131, Rarity.UNCOMMON, mage.cards.f.FireImp.class)); - cards.add(new SetCardInfo("Fire Snake", 132, Rarity.COMMON, mage.cards.f.FireSnake.class)); - cards.add(new SetCardInfo("Fire Tempest", 133, Rarity.RARE, mage.cards.f.FireTempest.class)); - cards.add(new SetCardInfo("Flashfires", 134, Rarity.UNCOMMON, mage.cards.f.Flashfires.class)); - cards.add(new SetCardInfo("Fleet-Footed Monk", 177, Rarity.COMMON, mage.cards.f.FleetFootedMonk.class)); - cards.add(new SetCardInfo("Flux", 56, Rarity.UNCOMMON, mage.cards.f.Flux.class)); - cards.add(new SetCardInfo("Foot Soldiers", 178, Rarity.COMMON, mage.cards.f.FootSoldiers.class)); - cards.add(new SetCardInfo("Forest", 203, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Forest", 204, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Forest", 205, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Forest", 206, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Fruition", 91, Rarity.COMMON, mage.cards.f.Fruition.class)); - cards.add(new SetCardInfo("Giant Octopus", 57, Rarity.COMMON, mage.cards.g.GiantOctopus.class)); - cards.add(new SetCardInfo("Giant Spider", 92, Rarity.COMMON, mage.cards.g.GiantSpider.class)); - cards.add(new SetCardInfo("Gift of Estates", 179, Rarity.RARE, mage.cards.g.GiftOfEstates.class)); - cards.add(new SetCardInfo("Goblin Bully", 136, Rarity.COMMON, mage.cards.g.GoblinBully.class)); - cards.add(new SetCardInfo("Gorilla Warrior", 93, Rarity.COMMON, mage.cards.g.GorillaWarrior.class)); - cards.add(new SetCardInfo("Gravedigger", 17, Rarity.UNCOMMON, mage.cards.g.Gravedigger.class)); - cards.add(new SetCardInfo("Grizzly Bears", 94, Rarity.COMMON, mage.cards.g.GrizzlyBears.class)); - cards.add(new SetCardInfo("Hand of Death", 18, Rarity.COMMON, mage.cards.h.HandOfDeath.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Hand of Death", 19, Rarity.COMMON, mage.cards.h.HandOfDeath.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Harsh Justice", 180, Rarity.RARE, mage.cards.h.HarshJustice.class)); - cards.add(new SetCardInfo("Highland Giant", 137, Rarity.COMMON, mage.cards.h.HighlandGiant.class)); - cards.add(new SetCardInfo("Hill Giant", 138, Rarity.COMMON, mage.cards.h.HillGiant.class)); - cards.add(new SetCardInfo("Horned Turtle", 58, Rarity.COMMON, mage.cards.h.HornedTurtle.class)); - cards.add(new SetCardInfo("Howling Fury", 20, Rarity.COMMON, mage.cards.h.HowlingFury.class)); - cards.add(new SetCardInfo("Hulking Cyclops", 139, Rarity.UNCOMMON, mage.cards.h.HulkingCyclops.class)); - cards.add(new SetCardInfo("Hulking Goblin", 140, Rarity.COMMON, mage.cards.h.HulkingGoblin.class)); - cards.add(new SetCardInfo("Hurricane", 95, Rarity.RARE, mage.cards.h.Hurricane.class)); - cards.add(new SetCardInfo("Ingenious Thief", 59, Rarity.UNCOMMON, mage.cards.i.IngeniousThief.class)); - cards.add(new SetCardInfo("Island", 207, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Island", 208, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Island", 209, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Island", 210, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Jungle Lion", 96, Rarity.COMMON, mage.cards.j.JungleLion.class)); - cards.add(new SetCardInfo("Keen-Eyed Archers", 181, Rarity.COMMON, mage.cards.k.KeenEyedArchers.class)); - cards.add(new SetCardInfo("King's Assassin", 21, Rarity.RARE, mage.cards.k.KingsAssassin.class)); - cards.add(new SetCardInfo("Knight Errant", 182, Rarity.COMMON, mage.cards.k.KnightErrant.class)); - cards.add(new SetCardInfo("Last Chance", 141, Rarity.RARE, mage.cards.l.LastChance.class)); - cards.add(new SetCardInfo("Lava Axe", 142, Rarity.COMMON, mage.cards.l.LavaAxe.class)); - cards.add(new SetCardInfo("Lava Flow", 143, Rarity.UNCOMMON, mage.cards.l.LavaFlow.class)); - cards.add(new SetCardInfo("Lizard Warrior", 144, Rarity.COMMON, mage.cards.l.LizardWarrior.class)); - cards.add(new SetCardInfo("Man-o'-War", 60, Rarity.UNCOMMON, mage.cards.m.ManOWar.class)); - cards.add(new SetCardInfo("Mercenary Knight", 22, Rarity.RARE, mage.cards.m.MercenaryKnight.class)); - cards.add(new SetCardInfo("Merfolk of the Pearl Trident", 61, Rarity.COMMON, mage.cards.m.MerfolkOfThePearlTrident.class)); - cards.add(new SetCardInfo("Mind Knives", 23, Rarity.COMMON, mage.cards.m.MindKnives.class)); - cards.add(new SetCardInfo("Mind Rot", 24, Rarity.COMMON, mage.cards.m.MindRot.class)); - cards.add(new SetCardInfo("Minotaur Warrior", 145, Rarity.COMMON, mage.cards.m.MinotaurWarrior.class)); - cards.add(new SetCardInfo("Mobilize", 97, Rarity.COMMON, mage.cards.m.Mobilize.class)); - cards.add(new SetCardInfo("Monstrous Growth", 98, Rarity.COMMON, mage.cards.m.MonstrousGrowth.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Monstrous Growth", 99, Rarity.COMMON, mage.cards.m.MonstrousGrowth.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Moon Sprite", 100, Rarity.UNCOMMON, mage.cards.m.MoonSprite.class)); + cards.add(new SetCardInfo("Desert Drake", 122, Rarity.UNCOMMON, mage.cards.d.DesertDrake.class)); + cards.add(new SetCardInfo("Devastation", 123, Rarity.RARE, mage.cards.d.Devastation.class)); + cards.add(new SetCardInfo("Devoted Hero", 13, Rarity.COMMON, mage.cards.d.DevotedHero.class)); + cards.add(new SetCardInfo("Djinn of the Lamp", 52, Rarity.RARE, mage.cards.d.DjinnOfTheLamp.class)); + cards.add(new SetCardInfo("Dread Charge", 88, Rarity.RARE, mage.cards.d.DreadCharge.class)); + cards.add(new SetCardInfo("Dread Reaper", 89, Rarity.RARE, mage.cards.d.DreadReaper.class)); + cards.add(new SetCardInfo("Dry Spell", 90, Rarity.UNCOMMON, DrySpell.class)); + cards.add(new SetCardInfo("Earthquake", 124, Rarity.RARE, mage.cards.e.Earthquake.class)); + cards.add(new SetCardInfo("Ebon Dragon", 91, Rarity.RARE, mage.cards.e.EbonDragon.class)); + cards.add(new SetCardInfo("Elite Cat Warrior", "163a", Rarity.COMMON, EliteCatWarrior.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Elite Cat Warrior", "163b", Rarity.COMMON, EliteCatWarrior.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Elven Cache", 164, Rarity.COMMON, mage.cards.e.ElvenCache.class)); + cards.add(new SetCardInfo("Elvish Ranger", 165, Rarity.COMMON, mage.cards.e.ElvishRanger.class)); + cards.add(new SetCardInfo("Endless Cockroaches", 92, Rarity.RARE, mage.cards.e.EndlessCockroaches.class)); + cards.add(new SetCardInfo("Exhaustion", 54, Rarity.RARE, mage.cards.e.Exhaustion.class)); + cards.add(new SetCardInfo("False Peace", 14, Rarity.COMMON, mage.cards.f.FalsePeace.class)); + cards.add(new SetCardInfo("Feral Shadow", 93, Rarity.COMMON, mage.cards.f.FeralShadow.class)); + cards.add(new SetCardInfo("Final Strike", 94, Rarity.RARE, mage.cards.f.FinalStrike.class)); + cards.add(new SetCardInfo("Fire Dragon", 125, Rarity.RARE, mage.cards.f.FireDragon.class)); + cards.add(new SetCardInfo("Fire Imp", 126, Rarity.UNCOMMON, mage.cards.f.FireImp.class)); + cards.add(new SetCardInfo("Fire Snake", 127, Rarity.COMMON, mage.cards.f.FireSnake.class)); + cards.add(new SetCardInfo("Fire Tempest", 128, Rarity.RARE, mage.cards.f.FireTempest.class)); + cards.add(new SetCardInfo("Flashfires", 129, Rarity.UNCOMMON, mage.cards.f.Flashfires.class)); + cards.add(new SetCardInfo("Fleet-Footed Monk", 15, Rarity.COMMON, mage.cards.f.FleetFootedMonk.class)); + cards.add(new SetCardInfo("Flux", 55, Rarity.UNCOMMON, mage.cards.f.Flux.class)); + cards.add(new SetCardInfo("Foot Soldiers", 16, Rarity.COMMON, mage.cards.f.FootSoldiers.class)); + cards.add(new SetCardInfo("Forest", 212, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Forest", 213, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Forest", 214, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Forest", 215, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Fruition", 166, Rarity.COMMON, mage.cards.f.Fruition.class)); + cards.add(new SetCardInfo("Giant Octopus", 56, Rarity.COMMON, mage.cards.g.GiantOctopus.class)); + cards.add(new SetCardInfo("Giant Spider", 167, Rarity.COMMON, mage.cards.g.GiantSpider.class)); + cards.add(new SetCardInfo("Gift of Estates", 17, Rarity.RARE, mage.cards.g.GiftOfEstates.class)); + cards.add(new SetCardInfo("Goblin Bully", 131, Rarity.COMMON, mage.cards.g.GoblinBully.class)); + cards.add(new SetCardInfo("Gorilla Warrior", 168, Rarity.COMMON, mage.cards.g.GorillaWarrior.class)); + cards.add(new SetCardInfo("Gravedigger", 95, Rarity.UNCOMMON, mage.cards.g.Gravedigger.class)); + cards.add(new SetCardInfo("Grizzly Bears", 169, Rarity.COMMON, mage.cards.g.GrizzlyBears.class)); + cards.add(new SetCardInfo("Hand of Death", "96a", Rarity.COMMON, mage.cards.h.HandOfDeath.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Hand of Death", "96b", Rarity.COMMON, mage.cards.h.HandOfDeath.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Harsh Justice", 18, Rarity.RARE, mage.cards.h.HarshJustice.class)); + cards.add(new SetCardInfo("Highland Giant", 132, Rarity.COMMON, mage.cards.h.HighlandGiant.class)); + cards.add(new SetCardInfo("Hill Giant", 133, Rarity.COMMON, mage.cards.h.HillGiant.class)); + cards.add(new SetCardInfo("Horned Turtle", 57, Rarity.COMMON, mage.cards.h.HornedTurtle.class)); + cards.add(new SetCardInfo("Howling Fury", 97, Rarity.COMMON, mage.cards.h.HowlingFury.class)); + cards.add(new SetCardInfo("Hulking Cyclops", 134, Rarity.UNCOMMON, mage.cards.h.HulkingCyclops.class)); + cards.add(new SetCardInfo("Hulking Goblin", 135, Rarity.COMMON, mage.cards.h.HulkingGoblin.class)); + cards.add(new SetCardInfo("Hurricane", 170, Rarity.RARE, mage.cards.h.Hurricane.class)); + cards.add(new SetCardInfo("Ingenious Thief", 58, Rarity.UNCOMMON, mage.cards.i.IngeniousThief.class)); + cards.add(new SetCardInfo("Island", 200, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Island", 201, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Island", 202, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Island", 203, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Jungle Lion", 171, Rarity.COMMON, mage.cards.j.JungleLion.class)); + cards.add(new SetCardInfo("Keen-Eyed Archers", 19, Rarity.COMMON, mage.cards.k.KeenEyedArchers.class)); + cards.add(new SetCardInfo("King's Assassin", 98, Rarity.RARE, mage.cards.k.KingsAssassin.class)); + cards.add(new SetCardInfo("Knight Errant", 20, Rarity.COMMON, mage.cards.k.KnightErrant.class)); + cards.add(new SetCardInfo("Last Chance", 136, Rarity.RARE, mage.cards.l.LastChance.class)); + cards.add(new SetCardInfo("Lava Axe", 137, Rarity.COMMON, mage.cards.l.LavaAxe.class)); + cards.add(new SetCardInfo("Lava Flow", 138, Rarity.UNCOMMON, mage.cards.l.LavaFlow.class)); + cards.add(new SetCardInfo("Lizard Warrior", 139, Rarity.COMMON, mage.cards.l.LizardWarrior.class)); + cards.add(new SetCardInfo("Man-o'-War", 59, Rarity.UNCOMMON, mage.cards.m.ManOWar.class)); + cards.add(new SetCardInfo("Mercenary Knight", 99, Rarity.RARE, mage.cards.m.MercenaryKnight.class)); + cards.add(new SetCardInfo("Merfolk of the Pearl Trident", 60, Rarity.COMMON, mage.cards.m.MerfolkOfThePearlTrident.class)); + cards.add(new SetCardInfo("Mind Knives", 100, Rarity.COMMON, mage.cards.m.MindKnives.class)); + cards.add(new SetCardInfo("Mind Rot", 101, Rarity.COMMON, mage.cards.m.MindRot.class)); + cards.add(new SetCardInfo("Minotaur Warrior", 140, Rarity.COMMON, mage.cards.m.MinotaurWarrior.class)); + cards.add(new SetCardInfo("Mobilize", 172, Rarity.COMMON, mage.cards.m.Mobilize.class)); + cards.add(new SetCardInfo("Monstrous Growth", "173a", Rarity.COMMON, mage.cards.m.MonstrousGrowth.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Monstrous Growth", "173b", Rarity.COMMON, mage.cards.m.MonstrousGrowth.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Moon Sprite", 174, Rarity.UNCOMMON, mage.cards.m.MoonSprite.class)); + cards.add(new SetCardInfo("Mountain Goat", 141, Rarity.UNCOMMON, mage.cards.m.MountainGoat.class)); + cards.add(new SetCardInfo("Mountain", 208, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Mountain", 209, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Mountain", 210, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 211, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mountain", 212, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mountain", 213, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mountain", 214, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mountain Goat", 146, Rarity.UNCOMMON, mage.cards.m.MountainGoat.class)); - cards.add(new SetCardInfo("Muck Rats", 25, Rarity.COMMON, mage.cards.m.MuckRats.class)); - cards.add(new SetCardInfo("Mystic Denial", 62, Rarity.UNCOMMON, mage.cards.m.MysticDenial.class)); - cards.add(new SetCardInfo("Natural Order", 101, Rarity.RARE, mage.cards.n.NaturalOrder.class)); - cards.add(new SetCardInfo("Natural Spring", 102, Rarity.UNCOMMON, mage.cards.n.NaturalSpring.class)); - cards.add(new SetCardInfo("Nature's Cloak", 103, Rarity.RARE, mage.cards.n.NaturesCloak.class)); - cards.add(new SetCardInfo("Nature's Lore", 104, Rarity.COMMON, mage.cards.n.NaturesLore.class)); - cards.add(new SetCardInfo("Nature's Ruin", 26, Rarity.UNCOMMON, mage.cards.n.NaturesRuin.class)); - cards.add(new SetCardInfo("Needle Storm", 105, Rarity.UNCOMMON, mage.cards.n.NeedleStorm.class)); - cards.add(new SetCardInfo("Noxious Toad", 27, Rarity.UNCOMMON, mage.cards.n.NoxiousToad.class)); - cards.add(new SetCardInfo("Omen", 63, Rarity.COMMON, mage.cards.o.Omen.class)); - cards.add(new SetCardInfo("Owl Familiar", 64, Rarity.COMMON, mage.cards.o.OwlFamiliar.class)); - cards.add(new SetCardInfo("Panther Warriors", 106, Rarity.COMMON, mage.cards.p.PantherWarriors.class)); - cards.add(new SetCardInfo("Path of Peace", 183, Rarity.COMMON, mage.cards.p.PathOfPeace.class)); - cards.add(new SetCardInfo("Personal Tutor", 65, Rarity.UNCOMMON, mage.cards.p.PersonalTutor.class)); - cards.add(new SetCardInfo("Phantom Warrior", 66, Rarity.RARE, mage.cards.p.PhantomWarrior.class)); - cards.add(new SetCardInfo("Pillaging Horde", 147, Rarity.RARE, mage.cards.p.PillagingHorde.class)); - cards.add(new SetCardInfo("Plains", 215, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plains", 216, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plains", 217, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plains", 218, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plant Elemental", 107, Rarity.UNCOMMON, mage.cards.p.PlantElemental.class)); - cards.add(new SetCardInfo("Primeval Force", 108, Rarity.RARE, mage.cards.p.PrimevalForce.class)); - cards.add(new SetCardInfo("Prosperity", 67, Rarity.RARE, mage.cards.p.Prosperity.class)); - cards.add(new SetCardInfo("Pyroclasm", 148, Rarity.RARE, mage.cards.p.Pyroclasm.class)); - cards.add(new SetCardInfo("Python", 28, Rarity.COMMON, mage.cards.p.Python.class)); - cards.add(new SetCardInfo("Raging Cougar", 149, Rarity.COMMON, mage.cards.r.RagingCougar.class)); - cards.add(new SetCardInfo("Raging Goblin", 150, Rarity.COMMON, mage.cards.r.RagingGoblin.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Raging Goblin", 151, Rarity.COMMON, mage.cards.r.RagingGoblin.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Raging Minotaur", 152, Rarity.COMMON, mage.cards.r.RagingMinotaur.class)); - cards.add(new SetCardInfo("Rain of Salt", 153, Rarity.UNCOMMON, mage.cards.r.RainOfSalt.class)); - cards.add(new SetCardInfo("Rain of Tears", 29, Rarity.UNCOMMON, mage.cards.r.RainOfTears.class)); - cards.add(new SetCardInfo("Raise Dead", 30, Rarity.COMMON, mage.cards.r.RaiseDead.class)); - cards.add(new SetCardInfo("Redwood Treefolk", 109, Rarity.COMMON, mage.cards.r.RedwoodTreefolk.class)); - cards.add(new SetCardInfo("Regal Unicorn", 184, Rarity.COMMON, mage.cards.r.RegalUnicorn.class)); - cards.add(new SetCardInfo("Renewing Dawn", 185, Rarity.UNCOMMON, mage.cards.r.RenewingDawn.class)); - cards.add(new SetCardInfo("Rowan Treefolk", 110, Rarity.COMMON, mage.cards.r.RowanTreefolk.class)); - cards.add(new SetCardInfo("Sacred Knight", 186, Rarity.COMMON, mage.cards.s.SacredKnight.class)); - cards.add(new SetCardInfo("Sacred Nectar", 187, Rarity.COMMON, mage.cards.s.SacredNectar.class)); - cards.add(new SetCardInfo("Scorching Spear", 154, Rarity.COMMON, mage.cards.s.ScorchingSpear.class)); - cards.add(new SetCardInfo("Scorching Winds", 155, Rarity.UNCOMMON, mage.cards.s.ScorchingWinds.class)); - cards.add(new SetCardInfo("Seasoned Marshal", 188, Rarity.UNCOMMON, mage.cards.s.SeasonedMarshal.class)); - cards.add(new SetCardInfo("Serpent Assassin", 31, Rarity.RARE, mage.cards.s.SerpentAssassin.class)); - cards.add(new SetCardInfo("Serpent Warrior", 32, Rarity.COMMON, mage.cards.s.SerpentWarrior.class)); - cards.add(new SetCardInfo("Skeletal Crocodile", 33, Rarity.COMMON, mage.cards.s.SkeletalCrocodile.class)); - cards.add(new SetCardInfo("Skeletal Snake", 34, Rarity.COMMON, mage.cards.s.SkeletalSnake.class)); - cards.add(new SetCardInfo("Snapping Drake", 68, Rarity.COMMON, mage.cards.s.SnappingDrake.class)); - cards.add(new SetCardInfo("Sorcerous Sight", 69, Rarity.COMMON, mage.cards.s.SorcerousSight.class)); - cards.add(new SetCardInfo("Soul Shred", 35, Rarity.COMMON, mage.cards.s.SoulShred.class)); - cards.add(new SetCardInfo("Spined Wurm", 111, Rarity.COMMON, mage.cards.s.SpinedWurm.class)); - cards.add(new SetCardInfo("Spiritual Guardian", 189, Rarity.RARE, mage.cards.s.SpiritualGuardian.class)); - cards.add(new SetCardInfo("Spitting Earth", 156, Rarity.COMMON, mage.cards.s.SpittingEarth.class)); - cards.add(new SetCardInfo("Spotted Griffin", 190, Rarity.COMMON, mage.cards.s.SpottedGriffin.class)); - cards.add(new SetCardInfo("Stalking Tiger", 112, Rarity.COMMON, mage.cards.s.StalkingTiger.class)); - cards.add(new SetCardInfo("Starlight", 191, Rarity.UNCOMMON, mage.cards.s.Starlight.class)); - cards.add(new SetCardInfo("Starlit Angel", 192, Rarity.UNCOMMON, mage.cards.s.StarlitAngel.class)); - cards.add(new SetCardInfo("Steadfastness", 193, Rarity.COMMON, mage.cards.s.Steadfastness.class)); - cards.add(new SetCardInfo("Stern Marshal", 194, Rarity.RARE, mage.cards.s.SternMarshal.class)); - cards.add(new SetCardInfo("Stone Rain", 157, Rarity.COMMON, mage.cards.s.StoneRain.class)); - cards.add(new SetCardInfo("Storm Crow", 70, Rarity.COMMON, mage.cards.s.StormCrow.class)); - cards.add(new SetCardInfo("Summer Bloom", 113, Rarity.RARE, mage.cards.s.SummerBloom.class)); - cards.add(new SetCardInfo("Swamp", 219, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Swamp", 220, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Swamp", 221, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Swamp", 222, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Sylvan Tutor", 114, Rarity.RARE, mage.cards.s.SylvanTutor.class)); - cards.add(new SetCardInfo("Symbol of Unsummoning", 71, Rarity.COMMON, mage.cards.s.SymbolOfUnsummoning.class)); - cards.add(new SetCardInfo("Taunt", 72, Rarity.RARE, mage.cards.t.Taunt.class)); - cards.add(new SetCardInfo("Temporary Truce", 195, Rarity.RARE, mage.cards.t.TemporaryTruce.class)); - cards.add(new SetCardInfo("Theft of Dreams", 73, Rarity.UNCOMMON, mage.cards.t.TheftOfDreams.class)); - cards.add(new SetCardInfo("Thing from the Deep", 74, Rarity.RARE, mage.cards.t.ThingFromTheDeep.class)); - cards.add(new SetCardInfo("Thundering Wurm", 115, Rarity.RARE, mage.cards.t.ThunderingWurm.class)); - cards.add(new SetCardInfo("Thundermare", 158, Rarity.RARE, mage.cards.t.Thundermare.class)); - cards.add(new SetCardInfo("Tidal Surge", 75, Rarity.COMMON, mage.cards.t.TidalSurge.class)); - cards.add(new SetCardInfo("Time Ebb", 76, Rarity.COMMON, mage.cards.t.TimeEbb.class)); - cards.add(new SetCardInfo("Touch of Brilliance", 77, Rarity.COMMON, mage.cards.t.TouchOfBrilliance.class)); - cards.add(new SetCardInfo("Treetop Defense", 116, Rarity.RARE, mage.cards.t.TreetopDefense.class)); - cards.add(new SetCardInfo("Undying Beast", 36, Rarity.COMMON, mage.cards.u.UndyingBeast.class)); - cards.add(new SetCardInfo("Untamed Wilds", 117, Rarity.UNCOMMON, mage.cards.u.UntamedWilds.class)); - cards.add(new SetCardInfo("Valorous Charge", 196, Rarity.UNCOMMON, mage.cards.v.ValorousCharge.class)); - cards.add(new SetCardInfo("Vampiric Feast", 37, Rarity.UNCOMMON, mage.cards.v.VampiricFeast.class)); - cards.add(new SetCardInfo("Vampiric Touch", 38, Rarity.COMMON, mage.cards.v.VampiricTouch.class)); - cards.add(new SetCardInfo("Venerable Monk", 197, Rarity.UNCOMMON, mage.cards.v.VenerableMonk.class)); - cards.add(new SetCardInfo("Vengeance", 198, Rarity.UNCOMMON, mage.cards.v.Vengeance.class)); - cards.add(new SetCardInfo("Virtue's Ruin", 39, Rarity.UNCOMMON, mage.cards.v.VirtuesRuin.class)); - cards.add(new SetCardInfo("Volcanic Dragon", 159, Rarity.RARE, mage.cards.v.VolcanicDragon.class)); - cards.add(new SetCardInfo("Volcanic Hammer", 160, Rarity.COMMON, mage.cards.v.VolcanicHammer.class)); - cards.add(new SetCardInfo("Wall of Granite", 161, Rarity.UNCOMMON, mage.cards.w.WallOfGranite.class)); - cards.add(new SetCardInfo("Wall of Swords", 199, Rarity.UNCOMMON, mage.cards.w.WallOfSwords.class)); - cards.add(new SetCardInfo("Warrior's Charge", 200, Rarity.COMMON, WarriorsCharge.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Warrior's Charge", 201, Rarity.COMMON, WarriorsCharge.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Whiptail Wurm", 118, Rarity.UNCOMMON, mage.cards.w.WhiptailWurm.class)); - cards.add(new SetCardInfo("Wicked Pact", 40, Rarity.RARE, mage.cards.w.WickedPact.class)); - cards.add(new SetCardInfo("Willow Dryad", 119, Rarity.COMMON, mage.cards.w.WillowDryad.class)); - cards.add(new SetCardInfo("Wind Drake", 78, Rarity.COMMON, mage.cards.w.WindDrake.class)); - cards.add(new SetCardInfo("Winds of Change", 162, Rarity.RARE, mage.cards.w.WindsOfChange.class)); - cards.add(new SetCardInfo("Winter's Grasp", 120, Rarity.UNCOMMON, mage.cards.w.WintersGrasp.class)); - cards.add(new SetCardInfo("Withering Gaze", 79, Rarity.UNCOMMON, mage.cards.w.WitheringGaze.class)); - cards.add(new SetCardInfo("Wood Elves", 121, Rarity.RARE, mage.cards.w.WoodElves.class)); - cards.add(new SetCardInfo("Wrath of God", 202, Rarity.RARE, mage.cards.w.WrathOfGod.class)); + cards.add(new SetCardInfo("Muck Rats", 102, Rarity.COMMON, mage.cards.m.MuckRats.class)); + cards.add(new SetCardInfo("Mystic Denial", 61, Rarity.UNCOMMON, mage.cards.m.MysticDenial.class)); + cards.add(new SetCardInfo("Natural Order", 175, Rarity.RARE, mage.cards.n.NaturalOrder.class)); + cards.add(new SetCardInfo("Natural Spring", 176, Rarity.UNCOMMON, mage.cards.n.NaturalSpring.class)); + cards.add(new SetCardInfo("Nature's Cloak", 177, Rarity.RARE, mage.cards.n.NaturesCloak.class)); + cards.add(new SetCardInfo("Nature's Lore", 178, Rarity.COMMON, mage.cards.n.NaturesLore.class)); + cards.add(new SetCardInfo("Nature's Ruin", 103, Rarity.UNCOMMON, mage.cards.n.NaturesRuin.class)); + cards.add(new SetCardInfo("Needle Storm", 179, Rarity.UNCOMMON, mage.cards.n.NeedleStorm.class)); + cards.add(new SetCardInfo("Noxious Toad", 104, Rarity.UNCOMMON, mage.cards.n.NoxiousToad.class)); + cards.add(new SetCardInfo("Omen", 62, Rarity.COMMON, mage.cards.o.Omen.class)); + cards.add(new SetCardInfo("Owl Familiar", 63, Rarity.COMMON, mage.cards.o.OwlFamiliar.class)); + cards.add(new SetCardInfo("Panther Warriors", 180, Rarity.COMMON, mage.cards.p.PantherWarriors.class)); + cards.add(new SetCardInfo("Path of Peace", 21, Rarity.COMMON, mage.cards.p.PathOfPeace.class)); + cards.add(new SetCardInfo("Personal Tutor", 64, Rarity.UNCOMMON, mage.cards.p.PersonalTutor.class)); + cards.add(new SetCardInfo("Phantom Warrior", 65, Rarity.RARE, mage.cards.p.PhantomWarrior.class)); + cards.add(new SetCardInfo("Pillaging Horde", 142, Rarity.RARE, mage.cards.p.PillagingHorde.class)); + cards.add(new SetCardInfo("Plains", 196, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plains", 197, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plains", 198, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plains", 199, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plant Elemental", 181, Rarity.UNCOMMON, mage.cards.p.PlantElemental.class)); + cards.add(new SetCardInfo("Primeval Force", 182, Rarity.RARE, mage.cards.p.PrimevalForce.class)); + cards.add(new SetCardInfo("Prosperity", 66, Rarity.RARE, mage.cards.p.Prosperity.class)); + cards.add(new SetCardInfo("Pyroclasm", 143, Rarity.RARE, mage.cards.p.Pyroclasm.class)); + cards.add(new SetCardInfo("Python", 105, Rarity.COMMON, mage.cards.p.Python.class)); + cards.add(new SetCardInfo("Raging Cougar", 144, Rarity.COMMON, mage.cards.r.RagingCougar.class)); + cards.add(new SetCardInfo("Raging Goblin", "145a", Rarity.COMMON, mage.cards.r.RagingGoblin.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Raging Goblin", "145b", Rarity.COMMON, mage.cards.r.RagingGoblin.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Raging Minotaur", 146, Rarity.COMMON, mage.cards.r.RagingMinotaur.class)); + cards.add(new SetCardInfo("Rain of Salt", 147, Rarity.UNCOMMON, mage.cards.r.RainOfSalt.class)); + cards.add(new SetCardInfo("Rain of Tears", 106, Rarity.UNCOMMON, mage.cards.r.RainOfTears.class)); + cards.add(new SetCardInfo("Raise Dead", 107, Rarity.COMMON, mage.cards.r.RaiseDead.class)); + cards.add(new SetCardInfo("Redwood Treefolk", 183, Rarity.COMMON, mage.cards.r.RedwoodTreefolk.class)); + cards.add(new SetCardInfo("Regal Unicorn", 22, Rarity.COMMON, mage.cards.r.RegalUnicorn.class)); + cards.add(new SetCardInfo("Renewing Dawn", 23, Rarity.UNCOMMON, mage.cards.r.RenewingDawn.class)); + cards.add(new SetCardInfo("Rowan Treefolk", 184, Rarity.COMMON, mage.cards.r.RowanTreefolk.class)); + cards.add(new SetCardInfo("Sacred Knight", 24, Rarity.COMMON, mage.cards.s.SacredKnight.class)); + cards.add(new SetCardInfo("Sacred Nectar", 25, Rarity.COMMON, mage.cards.s.SacredNectar.class)); + cards.add(new SetCardInfo("Scorching Spear", 148, Rarity.COMMON, mage.cards.s.ScorchingSpear.class)); + cards.add(new SetCardInfo("Scorching Winds", 149, Rarity.UNCOMMON, mage.cards.s.ScorchingWinds.class)); + cards.add(new SetCardInfo("Seasoned Marshal", 26, Rarity.UNCOMMON, mage.cards.s.SeasonedMarshal.class)); + cards.add(new SetCardInfo("Serpent Assassin", 108, Rarity.RARE, mage.cards.s.SerpentAssassin.class)); + cards.add(new SetCardInfo("Serpent Warrior", 109, Rarity.COMMON, mage.cards.s.SerpentWarrior.class)); + cards.add(new SetCardInfo("Skeletal Crocodile", 110, Rarity.COMMON, mage.cards.s.SkeletalCrocodile.class)); + cards.add(new SetCardInfo("Skeletal Snake", 111, Rarity.COMMON, mage.cards.s.SkeletalSnake.class)); + cards.add(new SetCardInfo("Snapping Drake", 67, Rarity.COMMON, mage.cards.s.SnappingDrake.class)); + cards.add(new SetCardInfo("Sorcerous Sight", 68, Rarity.COMMON, mage.cards.s.SorcerousSight.class)); + cards.add(new SetCardInfo("Soul Shred", 112, Rarity.COMMON, mage.cards.s.SoulShred.class)); + cards.add(new SetCardInfo("Spined Wurm", 185, Rarity.COMMON, mage.cards.s.SpinedWurm.class)); + cards.add(new SetCardInfo("Spiritual Guardian", 27, Rarity.RARE, mage.cards.s.SpiritualGuardian.class)); + cards.add(new SetCardInfo("Spitting Earth", 150, Rarity.COMMON, mage.cards.s.SpittingEarth.class)); + cards.add(new SetCardInfo("Spotted Griffin", 28, Rarity.COMMON, mage.cards.s.SpottedGriffin.class)); + cards.add(new SetCardInfo("Stalking Tiger", 186, Rarity.COMMON, mage.cards.s.StalkingTiger.class)); + cards.add(new SetCardInfo("Starlight", 29, Rarity.UNCOMMON, mage.cards.s.Starlight.class)); + cards.add(new SetCardInfo("Starlit Angel", 30, Rarity.UNCOMMON, mage.cards.s.StarlitAngel.class)); + cards.add(new SetCardInfo("Steadfastness", 31, Rarity.COMMON, mage.cards.s.Steadfastness.class)); + cards.add(new SetCardInfo("Stern Marshal", 32, Rarity.RARE, mage.cards.s.SternMarshal.class)); + cards.add(new SetCardInfo("Stone Rain", 151, Rarity.COMMON, mage.cards.s.StoneRain.class)); + cards.add(new SetCardInfo("Storm Crow", 69, Rarity.COMMON, mage.cards.s.StormCrow.class)); + cards.add(new SetCardInfo("Summer Bloom", 187, Rarity.RARE, mage.cards.s.SummerBloom.class)); + cards.add(new SetCardInfo("Swamp", 204, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swamp", 205, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swamp", 206, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swamp", 207, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Sylvan Tutor", 188, Rarity.RARE, mage.cards.s.SylvanTutor.class)); + cards.add(new SetCardInfo("Symbol of Unsummoning", 70, Rarity.COMMON, mage.cards.s.SymbolOfUnsummoning.class)); + cards.add(new SetCardInfo("Taunt", 71, Rarity.RARE, mage.cards.t.Taunt.class)); + cards.add(new SetCardInfo("Temporary Truce", 33, Rarity.RARE, mage.cards.t.TemporaryTruce.class)); + cards.add(new SetCardInfo("Theft of Dreams", 72, Rarity.UNCOMMON, mage.cards.t.TheftOfDreams.class)); + cards.add(new SetCardInfo("Thing from the Deep", 73, Rarity.RARE, mage.cards.t.ThingFromTheDeep.class)); + cards.add(new SetCardInfo("Thundering Wurm", 189, Rarity.RARE, mage.cards.t.ThunderingWurm.class)); + cards.add(new SetCardInfo("Thundermare", 152, Rarity.RARE, mage.cards.t.Thundermare.class)); + cards.add(new SetCardInfo("Tidal Surge", 74, Rarity.COMMON, mage.cards.t.TidalSurge.class)); + cards.add(new SetCardInfo("Time Ebb", 75, Rarity.COMMON, mage.cards.t.TimeEbb.class)); + cards.add(new SetCardInfo("Touch of Brilliance", 76, Rarity.COMMON, mage.cards.t.TouchOfBrilliance.class)); + cards.add(new SetCardInfo("Treetop Defense", 190, Rarity.RARE, mage.cards.t.TreetopDefense.class)); + cards.add(new SetCardInfo("Undying Beast", 113, Rarity.COMMON, mage.cards.u.UndyingBeast.class)); + cards.add(new SetCardInfo("Untamed Wilds", 191, Rarity.UNCOMMON, mage.cards.u.UntamedWilds.class)); + cards.add(new SetCardInfo("Valorous Charge", 34, Rarity.UNCOMMON, mage.cards.v.ValorousCharge.class)); + cards.add(new SetCardInfo("Vampiric Feast", 114, Rarity.UNCOMMON, mage.cards.v.VampiricFeast.class)); + cards.add(new SetCardInfo("Vampiric Touch", 115, Rarity.COMMON, mage.cards.v.VampiricTouch.class)); + cards.add(new SetCardInfo("Venerable Monk", 35, Rarity.UNCOMMON, mage.cards.v.VenerableMonk.class)); + cards.add(new SetCardInfo("Vengeance", 36, Rarity.UNCOMMON, mage.cards.v.Vengeance.class)); + cards.add(new SetCardInfo("Virtue's Ruin", 116, Rarity.UNCOMMON, mage.cards.v.VirtuesRuin.class)); + cards.add(new SetCardInfo("Volcanic Dragon", 153, Rarity.RARE, mage.cards.v.VolcanicDragon.class)); + cards.add(new SetCardInfo("Volcanic Hammer", 154, Rarity.COMMON, mage.cards.v.VolcanicHammer.class)); + cards.add(new SetCardInfo("Wall of Granite", 155, Rarity.UNCOMMON, mage.cards.w.WallOfGranite.class)); + cards.add(new SetCardInfo("Wall of Swords", 37, Rarity.UNCOMMON, mage.cards.w.WallOfSwords.class)); + cards.add(new SetCardInfo("Warrior's Charge", "38a", Rarity.COMMON, WarriorsCharge.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Warrior's Charge", "38b", Rarity.COMMON, WarriorsCharge.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Whiptail Wurm", 192, Rarity.UNCOMMON, mage.cards.w.WhiptailWurm.class)); + cards.add(new SetCardInfo("Wicked Pact", 117, Rarity.RARE, mage.cards.w.WickedPact.class)); + cards.add(new SetCardInfo("Willow Dryad", 193, Rarity.COMMON, mage.cards.w.WillowDryad.class)); + cards.add(new SetCardInfo("Wind Drake", 77, Rarity.COMMON, mage.cards.w.WindDrake.class)); + cards.add(new SetCardInfo("Winds of Change", 156, Rarity.RARE, mage.cards.w.WindsOfChange.class)); + cards.add(new SetCardInfo("Winter's Grasp", 194, Rarity.UNCOMMON, mage.cards.w.WintersGrasp.class)); + cards.add(new SetCardInfo("Withering Gaze", 78, Rarity.UNCOMMON, mage.cards.w.WitheringGaze.class)); + cards.add(new SetCardInfo("Wood Elves", 195, Rarity.RARE, mage.cards.w.WoodElves.class)); + cards.add(new SetCardInfo("Wrath of God", 39, Rarity.RARE, mage.cards.w.WrathOfGod.class)); } } From 1592a9d1734d3dd3baa2fef333603c7ccc45a1a5 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 10 Jul 2018 06:06:19 +0400 Subject: [PATCH 44/58] Fixed card numbers in P02 - Portal Second Age (#4628) --- Mage.Sets/src/mage/sets/PortalSecondAge.java | 208 +++++++++---------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/Mage.Sets/src/mage/sets/PortalSecondAge.java b/Mage.Sets/src/mage/sets/PortalSecondAge.java index bb316e198f..1efd4d7421 100644 --- a/Mage.Sets/src/mage/sets/PortalSecondAge.java +++ b/Mage.Sets/src/mage/sets/PortalSecondAge.java @@ -31,57 +31,57 @@ public final class PortalSecondAge extends ExpansionSet { this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; - cards.add(new SetCardInfo("Abyssal Nightstalker", 1, Rarity.UNCOMMON, mage.cards.a.AbyssalNightstalker.class)); + cards.add(new SetCardInfo("Abyssal Nightstalker", 61, Rarity.UNCOMMON, mage.cards.a.AbyssalNightstalker.class)); cards.add(new SetCardInfo("Air Elemental", 31, Rarity.UNCOMMON, mage.cards.a.AirElemental.class)); - cards.add(new SetCardInfo("Alaborn Cavalier", 121, Rarity.UNCOMMON, mage.cards.a.AlabornCavalier.class)); - cards.add(new SetCardInfo("Alaborn Grenadier", 122, Rarity.COMMON, mage.cards.a.AlabornGrenadier.class)); - cards.add(new SetCardInfo("Alaborn Musketeer", 123, Rarity.COMMON, mage.cards.a.AlabornMusketeer.class)); - cards.add(new SetCardInfo("Alaborn Trooper", 124, Rarity.COMMON, mage.cards.a.AlabornTrooper.class)); - cards.add(new SetCardInfo("Alaborn Veteran", 125, Rarity.RARE, mage.cards.a.AlabornVeteran.class)); - cards.add(new SetCardInfo("Alaborn Zealot", 126, Rarity.UNCOMMON, mage.cards.a.AlabornZealot.class)); - cards.add(new SetCardInfo("Alluring Scent", 61, Rarity.RARE, mage.cards.a.AlluringScent.class)); - cards.add(new SetCardInfo("Ancient Craving", 2, Rarity.RARE, mage.cards.a.AncientCraving.class)); - cards.add(new SetCardInfo("Angelic Blessing", 129, Rarity.COMMON, mage.cards.a.AngelicBlessing.class)); - cards.add(new SetCardInfo("Angelic Wall", 130, Rarity.COMMON, mage.cards.a.AngelicWall.class)); - cards.add(new SetCardInfo("Angel of Fury", 127, Rarity.RARE, mage.cards.a.AngelOfFury.class)); - cards.add(new SetCardInfo("Angel of Mercy", 128, Rarity.UNCOMMON, mage.cards.a.AngelOfMercy.class)); + cards.add(new SetCardInfo("Alaborn Cavalier", 1, Rarity.UNCOMMON, mage.cards.a.AlabornCavalier.class)); + cards.add(new SetCardInfo("Alaborn Grenadier", 2, Rarity.COMMON, mage.cards.a.AlabornGrenadier.class)); + cards.add(new SetCardInfo("Alaborn Musketeer", 3, Rarity.COMMON, mage.cards.a.AlabornMusketeer.class)); + cards.add(new SetCardInfo("Alaborn Trooper", 4, Rarity.COMMON, mage.cards.a.AlabornTrooper.class)); + cards.add(new SetCardInfo("Alaborn Veteran", 5, Rarity.RARE, mage.cards.a.AlabornVeteran.class)); + cards.add(new SetCardInfo("Alaborn Zealot", 6, Rarity.UNCOMMON, mage.cards.a.AlabornZealot.class)); + cards.add(new SetCardInfo("Alluring Scent", 121, Rarity.RARE, mage.cards.a.AlluringScent.class)); + cards.add(new SetCardInfo("Ancient Craving", 62, Rarity.RARE, mage.cards.a.AncientCraving.class)); + cards.add(new SetCardInfo("Angel of Fury", 7, Rarity.RARE, mage.cards.a.AngelOfFury.class)); + cards.add(new SetCardInfo("Angel of Mercy", 8, Rarity.UNCOMMON, mage.cards.a.AngelOfMercy.class)); + cards.add(new SetCardInfo("Angelic Blessing", 9, Rarity.COMMON, mage.cards.a.AngelicBlessing.class)); + cards.add(new SetCardInfo("Angelic Wall", 10, Rarity.COMMON, mage.cards.a.AngelicWall.class)); cards.add(new SetCardInfo("Apprentice Sorcerer", 32, Rarity.UNCOMMON, mage.cards.a.ApprenticeSorcerer.class)); - cards.add(new SetCardInfo("Archangel", 131, Rarity.RARE, mage.cards.a.Archangel.class)); - cards.add(new SetCardInfo("Armageddon", 132, Rarity.RARE, mage.cards.a.Armageddon.class)); + cards.add(new SetCardInfo("Archangel", 11, Rarity.RARE, mage.cards.a.Archangel.class)); + cards.add(new SetCardInfo("Armageddon", 12, Rarity.RARE, mage.cards.a.Armageddon.class)); cards.add(new SetCardInfo("Armored Galleon", 33, Rarity.UNCOMMON, mage.cards.a.ArmoredGalleon.class)); - cards.add(new SetCardInfo("Armored Griffin", 133, Rarity.UNCOMMON, mage.cards.a.ArmoredGriffin.class)); - cards.add(new SetCardInfo("Barbtooth Wurm", 62, Rarity.COMMON, mage.cards.b.BarbtoothWurm.class)); - cards.add(new SetCardInfo("Bargain", 134, Rarity.UNCOMMON, mage.cards.b.Bargain.class)); - cards.add(new SetCardInfo("Bear Cub", 63, Rarity.COMMON, mage.cards.b.BearCub.class)); - cards.add(new SetCardInfo("Bee Sting", 64, Rarity.UNCOMMON, mage.cards.b.BeeSting.class)); + cards.add(new SetCardInfo("Armored Griffin", 13, Rarity.UNCOMMON, mage.cards.a.ArmoredGriffin.class)); + cards.add(new SetCardInfo("Barbtooth Wurm", 122, Rarity.COMMON, mage.cards.b.BarbtoothWurm.class)); + cards.add(new SetCardInfo("Bargain", 14, Rarity.UNCOMMON, mage.cards.b.Bargain.class)); + cards.add(new SetCardInfo("Bear Cub", 123, Rarity.COMMON, mage.cards.b.BearCub.class)); + cards.add(new SetCardInfo("Bee Sting", 124, Rarity.UNCOMMON, mage.cards.b.BeeSting.class)); cards.add(new SetCardInfo("Blaze", 91, Rarity.UNCOMMON, mage.cards.b.Blaze.class)); - cards.add(new SetCardInfo("Bloodcurdling Scream", 3, Rarity.UNCOMMON, mage.cards.b.BloodcurdlingScream.class)); - cards.add(new SetCardInfo("Breath of Life", 135, Rarity.COMMON, mage.cards.b.BreathOfLife.class)); + cards.add(new SetCardInfo("Bloodcurdling Scream", 63, Rarity.UNCOMMON, mage.cards.b.BloodcurdlingScream.class)); + cards.add(new SetCardInfo("Breath of Life", 15, Rarity.COMMON, mage.cards.b.BreathOfLife.class)); cards.add(new SetCardInfo("Brimstone Dragon", 92, Rarity.RARE, mage.cards.b.BrimstoneDragon.class)); - cards.add(new SetCardInfo("Brutal Nightstalker", 4, Rarity.UNCOMMON, mage.cards.b.BrutalNightstalker.class)); - cards.add(new SetCardInfo("Chorus of Woe", 5, Rarity.COMMON, mage.cards.c.ChorusOfWoe.class)); + cards.add(new SetCardInfo("Brutal Nightstalker", 64, Rarity.UNCOMMON, mage.cards.b.BrutalNightstalker.class)); + cards.add(new SetCardInfo("Chorus of Woe", 65, Rarity.COMMON, mage.cards.c.ChorusOfWoe.class)); cards.add(new SetCardInfo("Coastal Wizard", 34, Rarity.RARE, mage.cards.c.CoastalWizard.class)); - cards.add(new SetCardInfo("Coercion", 6, Rarity.UNCOMMON, mage.cards.c.Coercion.class)); - cards.add(new SetCardInfo("Cruel Edict", 7, Rarity.COMMON, mage.cards.c.CruelEdict.class)); - cards.add(new SetCardInfo("Dakmor Bat", 8, Rarity.COMMON, mage.cards.d.DakmorBat.class)); - cards.add(new SetCardInfo("Dakmor Plague", 9, Rarity.UNCOMMON, mage.cards.d.DakmorPlague.class)); - cards.add(new SetCardInfo("Dakmor Scorpion", 10, Rarity.COMMON, mage.cards.d.DakmorScorpion.class)); - cards.add(new SetCardInfo("Dakmor Sorceress", 11, Rarity.RARE, mage.cards.d.DakmorSorceress.class)); - cards.add(new SetCardInfo("Dark Offering", 12, Rarity.UNCOMMON, mage.cards.d.DarkOffering.class)); - cards.add(new SetCardInfo("Deathcoil Wurm", 65, Rarity.RARE, mage.cards.d.DeathcoilWurm.class)); - cards.add(new SetCardInfo("Deep Wood", 66, Rarity.UNCOMMON, mage.cards.d.DeepWood.class)); - cards.add(new SetCardInfo("Deja Vu", 35, Rarity.COMMON, mage.cards.d.DejaVu.class)); - cards.add(new SetCardInfo("Denizen of the Deep", 36, Rarity.RARE, mage.cards.d.DenizenOfTheDeep.class)); + cards.add(new SetCardInfo("Coercion", 66, Rarity.UNCOMMON, mage.cards.c.Coercion.class)); + cards.add(new SetCardInfo("Cruel Edict", 67, Rarity.COMMON, mage.cards.c.CruelEdict.class)); + cards.add(new SetCardInfo("Dakmor Bat", 68, Rarity.COMMON, mage.cards.d.DakmorBat.class)); + cards.add(new SetCardInfo("Dakmor Plague", 69, Rarity.UNCOMMON, mage.cards.d.DakmorPlague.class)); + cards.add(new SetCardInfo("Dakmor Scorpion", 70, Rarity.COMMON, mage.cards.d.DakmorScorpion.class)); + cards.add(new SetCardInfo("Dakmor Sorceress", 71, Rarity.RARE, mage.cards.d.DakmorSorceress.class)); + cards.add(new SetCardInfo("Dark Offering", 72, Rarity.UNCOMMON, mage.cards.d.DarkOffering.class)); + cards.add(new SetCardInfo("Deathcoil Wurm", 125, Rarity.RARE, mage.cards.d.DeathcoilWurm.class)); + cards.add(new SetCardInfo("Deep Wood", 126, Rarity.UNCOMMON, mage.cards.d.DeepWood.class)); + cards.add(new SetCardInfo("Deja Vu", 36, Rarity.COMMON, mage.cards.d.DejaVu.class)); + cards.add(new SetCardInfo("Denizen of the Deep", 35, Rarity.RARE, mage.cards.d.DenizenOfTheDeep.class)); cards.add(new SetCardInfo("Earthquake", 94, Rarity.RARE, mage.cards.e.Earthquake.class)); cards.add(new SetCardInfo("Exhaustion", 37, Rarity.RARE, mage.cards.e.Exhaustion.class)); cards.add(new SetCardInfo("Extinguish", 38, Rarity.COMMON, mage.cards.e.Extinguish.class)); cards.add(new SetCardInfo("Eye Spy", 39, Rarity.UNCOMMON, mage.cards.e.EyeSpy.class)); cards.add(new SetCardInfo("False Summoning", 40, Rarity.COMMON, mage.cards.f.FalseSummoning.class)); - cards.add(new SetCardInfo("Festival of Trokin", 136, Rarity.COMMON, mage.cards.f.FestivalOfTrokin.class)); - cards.add(new SetCardInfo("Forest", 151, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Forest", 152, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Forest", 153, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Foul Spirit", 13, Rarity.UNCOMMON, mage.cards.f.FoulSpirit.class)); + cards.add(new SetCardInfo("Festival of Trokin", 16, Rarity.COMMON, mage.cards.f.FestivalOfTrokin.class)); + cards.add(new SetCardInfo("Forest", 163, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Forest", 164, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Forest", 165, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Foul Spirit", 73, Rarity.UNCOMMON, mage.cards.f.FoulSpirit.class)); cards.add(new SetCardInfo("Goblin Cavaliers", 95, Rarity.COMMON, mage.cards.g.GoblinCavaliers.class)); cards.add(new SetCardInfo("Goblin Firestarter", 96, Rarity.UNCOMMON, mage.cards.g.GoblinFirestarter.class)); cards.add(new SetCardInfo("Goblin General", 97, Rarity.RARE, mage.cards.g.GoblinGeneral.class)); @@ -93,106 +93,106 @@ public final class PortalSecondAge extends ExpansionSet { cards.add(new SetCardInfo("Goblin Raider", 103, Rarity.COMMON, mage.cards.g.GoblinRaider.class)); cards.add(new SetCardInfo("Goblin War Cry", 104, Rarity.UNCOMMON, mage.cards.g.GoblinWarCry.class)); cards.add(new SetCardInfo("Goblin War Strike", 105, Rarity.COMMON, mage.cards.g.GoblinWarStrike.class)); - cards.add(new SetCardInfo("Golden Bear", 67, Rarity.COMMON, mage.cards.g.GoldenBear.class)); - cards.add(new SetCardInfo("Hand of Death", 14, Rarity.COMMON, mage.cards.h.HandOfDeath.class)); - cards.add(new SetCardInfo("Harmony of Nature", 68, Rarity.UNCOMMON, mage.cards.h.HarmonyOfNature.class)); - cards.add(new SetCardInfo("Hidden Horror", 15, Rarity.RARE, mage.cards.h.HiddenHorror.class)); - cards.add(new SetCardInfo("Hurricane", 69, Rarity.RARE, mage.cards.h.Hurricane.class)); - cards.add(new SetCardInfo("Ironhoof Ox", 70, Rarity.UNCOMMON, mage.cards.i.IronhoofOx.class)); + cards.add(new SetCardInfo("Golden Bear", 127, Rarity.COMMON, mage.cards.g.GoldenBear.class)); + cards.add(new SetCardInfo("Hand of Death", 74, Rarity.COMMON, mage.cards.h.HandOfDeath.class)); + cards.add(new SetCardInfo("Harmony of Nature", 128, Rarity.UNCOMMON, mage.cards.h.HarmonyOfNature.class)); + cards.add(new SetCardInfo("Hidden Horror", 75, Rarity.RARE, mage.cards.h.HiddenHorror.class)); + cards.add(new SetCardInfo("Hurricane", 129, Rarity.RARE, mage.cards.h.Hurricane.class)); + cards.add(new SetCardInfo("Ironhoof Ox", 130, Rarity.UNCOMMON, mage.cards.i.IronhoofOx.class)); cards.add(new SetCardInfo("Island", 154, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 155, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 156, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Jagged Lightning", 106, Rarity.UNCOMMON, mage.cards.j.JaggedLightning.class)); - cards.add(new SetCardInfo("Just Fate", 137, Rarity.RARE, mage.cards.j.JustFate.class)); - cards.add(new SetCardInfo("Kiss of Death", 16, Rarity.UNCOMMON, mage.cards.k.KissOfDeath.class)); + cards.add(new SetCardInfo("Just Fate", 17, Rarity.RARE, mage.cards.j.JustFate.class)); + cards.add(new SetCardInfo("Kiss of Death", 76, Rarity.UNCOMMON, mage.cards.k.KissOfDeath.class)); cards.add(new SetCardInfo("Lava Axe", 107, Rarity.COMMON, mage.cards.l.LavaAxe.class)); - cards.add(new SetCardInfo("Lone Wolf", 71, Rarity.UNCOMMON, mage.cards.l.LoneWolf.class)); - cards.add(new SetCardInfo("Lurking Nightstalker", 17, Rarity.COMMON, mage.cards.l.LurkingNightstalker.class)); - cards.add(new SetCardInfo("Lynx", 72, Rarity.COMMON, mage.cards.l.Lynx.class)); + cards.add(new SetCardInfo("Lone Wolf", 131, Rarity.UNCOMMON, mage.cards.l.LoneWolf.class)); + cards.add(new SetCardInfo("Lurking Nightstalker", 77, Rarity.COMMON, mage.cards.l.LurkingNightstalker.class)); + cards.add(new SetCardInfo("Lynx", 132, Rarity.COMMON, mage.cards.l.Lynx.class)); cards.add(new SetCardInfo("Magma Giant", 108, Rarity.RARE, mage.cards.m.MagmaGiant.class)); - cards.add(new SetCardInfo("Mind Rot", 18, Rarity.COMMON, mage.cards.m.MindRot.class)); - cards.add(new SetCardInfo("Moaning Spirit", 19, Rarity.COMMON, mage.cards.m.MoaningSpirit.class)); - cards.add(new SetCardInfo("Monstrous Growth", 73, Rarity.COMMON, mage.cards.m.MonstrousGrowth.class)); - cards.add(new SetCardInfo("Mountain", 157, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mountain", 158, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Mountain", 159, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Muck Rats", 20, Rarity.COMMON, mage.cards.m.MuckRats.class)); + cards.add(new SetCardInfo("Mind Rot", 78, Rarity.COMMON, mage.cards.m.MindRot.class)); + cards.add(new SetCardInfo("Moaning Spirit", 79, Rarity.COMMON, mage.cards.m.MoaningSpirit.class)); + cards.add(new SetCardInfo("Monstrous Growth", 133, Rarity.COMMON, mage.cards.m.MonstrousGrowth.class)); + cards.add(new SetCardInfo("Mountain", 160, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Mountain", 161, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Mountain", 162, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Muck Rats", 80, Rarity.COMMON, mage.cards.m.MuckRats.class)); cards.add(new SetCardInfo("Mystic Denial", 41, Rarity.UNCOMMON, mage.cards.m.MysticDenial.class)); - cards.add(new SetCardInfo("Natural Spring", 74, Rarity.COMMON, mage.cards.n.NaturalSpring.class)); - cards.add(new SetCardInfo("Nature's Lore", 75, Rarity.COMMON, mage.cards.n.NaturesLore.class)); - cards.add(new SetCardInfo("Nightstalker Engine", 21, Rarity.RARE, mage.cards.n.NightstalkerEngine.class)); - cards.add(new SetCardInfo("Norwood Archers", 76, Rarity.COMMON, mage.cards.n.NorwoodArchers.class)); - cards.add(new SetCardInfo("Norwood Priestess", 77, Rarity.RARE, mage.cards.n.NorwoodPriestess.class)); - cards.add(new SetCardInfo("Norwood Ranger", 78, Rarity.COMMON, mage.cards.n.NorwoodRanger.class)); - cards.add(new SetCardInfo("Norwood Riders", 79, Rarity.COMMON, mage.cards.n.NorwoodRiders.class)); - cards.add(new SetCardInfo("Norwood Warrior", 80, Rarity.COMMON, mage.cards.n.NorwoodWarrior.class)); + cards.add(new SetCardInfo("Natural Spring", 134, Rarity.COMMON, mage.cards.n.NaturalSpring.class)); + cards.add(new SetCardInfo("Nature's Lore", 135, Rarity.COMMON, mage.cards.n.NaturesLore.class)); + cards.add(new SetCardInfo("Nightstalker Engine", 81, Rarity.RARE, mage.cards.n.NightstalkerEngine.class)); + cards.add(new SetCardInfo("Norwood Archers", 136, Rarity.COMMON, mage.cards.n.NorwoodArchers.class)); + cards.add(new SetCardInfo("Norwood Priestess", 137, Rarity.RARE, mage.cards.n.NorwoodPriestess.class)); + cards.add(new SetCardInfo("Norwood Ranger", 138, Rarity.COMMON, mage.cards.n.NorwoodRanger.class)); + cards.add(new SetCardInfo("Norwood Riders", 139, Rarity.COMMON, mage.cards.n.NorwoodRiders.class)); + cards.add(new SetCardInfo("Norwood Warrior", 140, Rarity.COMMON, mage.cards.n.NorwoodWarrior.class)); cards.add(new SetCardInfo("Obsidian Giant", 109, Rarity.UNCOMMON, mage.cards.o.ObsidianGiant.class)); cards.add(new SetCardInfo("Ogre Arsonist", 110, Rarity.UNCOMMON, mage.cards.o.OgreArsonist.class)); cards.add(new SetCardInfo("Ogre Berserker", 111, Rarity.COMMON, mage.cards.o.OgreBerserker.class)); cards.add(new SetCardInfo("Ogre Taskmaster", 112, Rarity.UNCOMMON, mage.cards.o.OgreTaskmaster.class)); cards.add(new SetCardInfo("Ogre Warrior", 113, Rarity.COMMON, mage.cards.o.OgreWarrior.class)); - cards.add(new SetCardInfo("Path of Peace", 138, Rarity.COMMON, mage.cards.p.PathOfPeace.class)); - cards.add(new SetCardInfo("Plains", 160, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plains", 161, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plains", 162, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Plated Wurm", 81, Rarity.COMMON, mage.cards.p.PlatedWurm.class)); - cards.add(new SetCardInfo("Predatory Nightstalker", 22, Rarity.UNCOMMON, mage.cards.p.PredatoryNightstalker.class)); - cards.add(new SetCardInfo("Prowling Nightstalker", 23, Rarity.COMMON, mage.cards.p.ProwlingNightstalker.class)); + cards.add(new SetCardInfo("Path of Peace", 18, Rarity.COMMON, mage.cards.p.PathOfPeace.class)); + cards.add(new SetCardInfo("Plains", 151, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plains", 152, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plains", 153, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Plated Wurm", 141, Rarity.COMMON, mage.cards.p.PlatedWurm.class)); + cards.add(new SetCardInfo("Predatory Nightstalker", 82, Rarity.UNCOMMON, mage.cards.p.PredatoryNightstalker.class)); + cards.add(new SetCardInfo("Prowling Nightstalker", 83, Rarity.COMMON, mage.cards.p.ProwlingNightstalker.class)); cards.add(new SetCardInfo("Raging Goblin", 114, Rarity.COMMON, mage.cards.r.RagingGoblin.class)); - cards.add(new SetCardInfo("Raiding Nightstalker", 24, Rarity.COMMON, mage.cards.r.RaidingNightstalker.class)); - cards.add(new SetCardInfo("Rain of Daggers", 25, Rarity.RARE, mage.cards.r.RainOfDaggers.class)); - cards.add(new SetCardInfo("Raise Dead", 26, Rarity.COMMON, mage.cards.r.RaiseDead.class)); - cards.add(new SetCardInfo("Rally the Troops", 139, Rarity.UNCOMMON, mage.cards.r.RallyTheTroops.class)); - cards.add(new SetCardInfo("Ravenous Rats", 27, Rarity.COMMON, mage.cards.r.RavenousRats.class)); - cards.add(new SetCardInfo("Razorclaw Bear", 82, Rarity.RARE, mage.cards.r.RazorclawBear.class)); + cards.add(new SetCardInfo("Raiding Nightstalker", 84, Rarity.COMMON, mage.cards.r.RaidingNightstalker.class)); + cards.add(new SetCardInfo("Rain of Daggers", 85, Rarity.RARE, mage.cards.r.RainOfDaggers.class)); + cards.add(new SetCardInfo("Raise Dead", 86, Rarity.COMMON, mage.cards.r.RaiseDead.class)); + cards.add(new SetCardInfo("Rally the Troops", 19, Rarity.UNCOMMON, mage.cards.r.RallyTheTroops.class)); + cards.add(new SetCardInfo("Ravenous Rats", 87, Rarity.COMMON, mage.cards.r.RavenousRats.class)); + cards.add(new SetCardInfo("Razorclaw Bear", 142, Rarity.RARE, mage.cards.r.RazorclawBear.class)); cards.add(new SetCardInfo("Relentless Assault", 115, Rarity.RARE, mage.cards.r.RelentlessAssault.class)); cards.add(new SetCardInfo("Remove", 43, Rarity.UNCOMMON, mage.cards.r.Remove.class)); - cards.add(new SetCardInfo("Renewing Touch", 83, Rarity.UNCOMMON, mage.cards.r.RenewingTouch.class)); - cards.add(new SetCardInfo("Return of the Nightstalkers", 28, Rarity.RARE, mage.cards.r.ReturnOfTheNightstalkers.class)); - cards.add(new SetCardInfo("Righteous Charge", 140, Rarity.COMMON, mage.cards.r.RighteousCharge.class)); - cards.add(new SetCardInfo("Righteous Fury", 141, Rarity.RARE, mage.cards.r.RighteousFury.class)); - cards.add(new SetCardInfo("River Bear", 84, Rarity.UNCOMMON, mage.cards.r.RiverBear.class)); - cards.add(new SetCardInfo("Salvage", 85, Rarity.COMMON, mage.cards.s.Salvage.class)); + cards.add(new SetCardInfo("Renewing Touch", 143, Rarity.UNCOMMON, mage.cards.r.RenewingTouch.class)); + cards.add(new SetCardInfo("Return of the Nightstalkers", 88, Rarity.RARE, mage.cards.r.ReturnOfTheNightstalkers.class)); + cards.add(new SetCardInfo("Righteous Charge", 20, Rarity.COMMON, mage.cards.r.RighteousCharge.class)); + cards.add(new SetCardInfo("Righteous Fury", 21, Rarity.RARE, mage.cards.r.RighteousFury.class)); + cards.add(new SetCardInfo("River Bear", 144, Rarity.UNCOMMON, mage.cards.r.RiverBear.class)); + cards.add(new SetCardInfo("Salvage", 145, Rarity.COMMON, mage.cards.s.Salvage.class)); cards.add(new SetCardInfo("Screeching Drake", 44, Rarity.COMMON, mage.cards.s.ScreechingDrake.class)); cards.add(new SetCardInfo("Sea Drake", 45, Rarity.UNCOMMON, mage.cards.s.SeaDrake.class)); cards.add(new SetCardInfo("Sleight of Hand", 46, Rarity.COMMON, mage.cards.s.SleightOfHand.class)); cards.add(new SetCardInfo("Spitting Earth", 116, Rarity.COMMON, mage.cards.s.SpittingEarth.class)); - cards.add(new SetCardInfo("Steam Catapult", 142, Rarity.RARE, mage.cards.s.SteamCatapult.class)); + cards.add(new SetCardInfo("Steam Catapult", 22, Rarity.RARE, mage.cards.s.SteamCatapult.class)); cards.add(new SetCardInfo("Steam Frigate", 47, Rarity.COMMON, mage.cards.s.SteamFrigate.class)); cards.add(new SetCardInfo("Stone Rain", 117, Rarity.COMMON, mage.cards.s.StoneRain.class)); - cards.add(new SetCardInfo("Swamp", 163, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Swamp", 164, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Swamp", 165, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Swarm of Rats", 29, Rarity.COMMON, mage.cards.s.SwarmOfRats.class)); - cards.add(new SetCardInfo("Sylvan Basilisk", 86, Rarity.RARE, mage.cards.s.SylvanBasilisk.class)); - cards.add(new SetCardInfo("Sylvan Yeti", 87, Rarity.RARE, mage.cards.s.SylvanYeti.class)); + cards.add(new SetCardInfo("Swamp", 157, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swamp", 158, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swamp", 159, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Swarm of Rats", 89, Rarity.COMMON, mage.cards.s.SwarmOfRats.class)); + cards.add(new SetCardInfo("Sylvan Basilisk", 146, Rarity.RARE, mage.cards.s.SylvanBasilisk.class)); + cards.add(new SetCardInfo("Sylvan Yeti", 147, Rarity.RARE, mage.cards.s.SylvanYeti.class)); cards.add(new SetCardInfo("Talas Air Ship", 48, Rarity.COMMON, mage.cards.t.TalasAirShip.class)); cards.add(new SetCardInfo("Talas Explorer", 49, Rarity.COMMON, mage.cards.t.TalasExplorer.class)); cards.add(new SetCardInfo("Talas Merchant", 50, Rarity.COMMON, mage.cards.t.TalasMerchant.class)); cards.add(new SetCardInfo("Talas Researcher", 51, Rarity.RARE, mage.cards.t.TalasResearcher.class)); cards.add(new SetCardInfo("Talas Scout", 52, Rarity.COMMON, mage.cards.t.TalasScout.class)); cards.add(new SetCardInfo("Talas Warrior", 53, Rarity.RARE, mage.cards.t.TalasWarrior.class)); - cards.add(new SetCardInfo("Temple Acolyte", 143, Rarity.COMMON, mage.cards.t.TempleAcolyte.class)); - cards.add(new SetCardInfo("Temple Elder", 144, Rarity.UNCOMMON, mage.cards.t.TempleElder.class)); + cards.add(new SetCardInfo("Temple Acolyte", 23, Rarity.COMMON, mage.cards.t.TempleAcolyte.class)); + cards.add(new SetCardInfo("Temple Elder", 24, Rarity.UNCOMMON, mage.cards.t.TempleElder.class)); cards.add(new SetCardInfo("Temporal Manipulation", 54, Rarity.RARE, mage.cards.t.TemporalManipulation.class)); cards.add(new SetCardInfo("Theft of Dreams", 55, Rarity.UNCOMMON, mage.cards.t.TheftOfDreams.class)); cards.add(new SetCardInfo("Tidal Surge", 56, Rarity.COMMON, mage.cards.t.TidalSurge.class)); cards.add(new SetCardInfo("Time Ebb", 57, Rarity.COMMON, mage.cards.t.TimeEbb.class)); cards.add(new SetCardInfo("Touch of Brilliance", 58, Rarity.COMMON, mage.cards.t.TouchOfBrilliance.class)); - cards.add(new SetCardInfo("Town Sentry", 145, Rarity.COMMON, mage.cards.t.TownSentry.class)); - cards.add(new SetCardInfo("Tree Monkey", 88, Rarity.COMMON, mage.cards.t.TreeMonkey.class)); + cards.add(new SetCardInfo("Town Sentry", 25, Rarity.COMMON, mage.cards.t.TownSentry.class)); + cards.add(new SetCardInfo("Tree Monkey", 148, Rarity.COMMON, mage.cards.t.TreeMonkey.class)); cards.add(new SetCardInfo("Tremor", 118, Rarity.COMMON, mage.cards.t.Tremor.class)); - cards.add(new SetCardInfo("Trokin High Guard", 146, Rarity.COMMON, mage.cards.t.TrokinHighGuard.class)); + cards.add(new SetCardInfo("Trokin High Guard", 26, Rarity.COMMON, mage.cards.t.TrokinHighGuard.class)); cards.add(new SetCardInfo("Undo", 59, Rarity.UNCOMMON, mage.cards.u.Undo.class)); - cards.add(new SetCardInfo("Untamed Wilds", 89, Rarity.UNCOMMON, mage.cards.u.UntamedWilds.class)); - cards.add(new SetCardInfo("Vampiric Spirit", 30, Rarity.RARE, mage.cards.v.VampiricSpirit.class)); - cards.add(new SetCardInfo("Vengeance", 147, Rarity.UNCOMMON, mage.cards.v.Vengeance.class)); + cards.add(new SetCardInfo("Untamed Wilds", 149, Rarity.UNCOMMON, mage.cards.u.UntamedWilds.class)); + cards.add(new SetCardInfo("Vampiric Spirit", 90, Rarity.RARE, mage.cards.v.VampiricSpirit.class)); + cards.add(new SetCardInfo("Vengeance", 27, Rarity.UNCOMMON, mage.cards.v.Vengeance.class)); cards.add(new SetCardInfo("Volcanic Hammer", 119, Rarity.COMMON, mage.cards.v.VolcanicHammer.class)); - cards.add(new SetCardInfo("Volunteer Militia", 148, Rarity.COMMON, mage.cards.v.VolunteerMilitia.class)); - cards.add(new SetCardInfo("Warrior's Stand", 149, Rarity.UNCOMMON, mage.cards.w.WarriorsStand.class)); + cards.add(new SetCardInfo("Volunteer Militia", 28, Rarity.COMMON, mage.cards.v.VolunteerMilitia.class)); + cards.add(new SetCardInfo("Warrior's Stand", 29, Rarity.UNCOMMON, mage.cards.w.WarriorsStand.class)); + cards.add(new SetCardInfo("Wild Griffin", 30, Rarity.COMMON, mage.cards.w.WildGriffin.class)); + cards.add(new SetCardInfo("Wild Ox", 150, Rarity.UNCOMMON, mage.cards.w.WildOx.class)); cards.add(new SetCardInfo("Wildfire", 120, Rarity.RARE, mage.cards.w.Wildfire.class)); - cards.add(new SetCardInfo("Wild Griffin", 150, Rarity.COMMON, mage.cards.w.WildGriffin.class)); - cards.add(new SetCardInfo("Wild Ox", 90, Rarity.UNCOMMON, mage.cards.w.WildOx.class)); cards.add(new SetCardInfo("Wind Sail", 60, Rarity.COMMON, mage.cards.w.WindSail.class)); } } From 9108104fe50dfabbbbacb5b17f179398876ac8e9 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Mon, 9 Jul 2018 22:21:40 -0400 Subject: [PATCH 45/58] Implement Predatory Focus --- .../src/mage/cards/p/PredatoryFocus.java | 81 +++++++++++++++++++ Mage.Sets/src/mage/sets/Guildpact.java | 1 + .../mage/constants/AsThoughEffectType.java | 1 + .../java/mage/game/combat/CombatGroup.java | 14 ++-- 4 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/p/PredatoryFocus.java diff --git a/Mage.Sets/src/mage/cards/p/PredatoryFocus.java b/Mage.Sets/src/mage/cards/p/PredatoryFocus.java new file mode 100644 index 0000000000..807f524959 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PredatoryFocus.java @@ -0,0 +1,81 @@ +package mage.cards.p; + +import java.util.UUID; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.AsThoughEffect; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author noahg + */ +public final class PredatoryFocus extends CardImpl { + + public PredatoryFocus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); + + + // You may have creatures you control assign their combat damage this turn as though they weren't blocked. + this.getSpellAbility().addEffect(new PredatoryFocusEffect()); + } + + public PredatoryFocus(final PredatoryFocus card) { + super(card); + } + + @Override + public PredatoryFocus copy() { + return new PredatoryFocus(this); + } +} + +class PredatoryFocusEffect extends AsThoughEffectImpl { + + private boolean choseUse; + + public PredatoryFocusEffect() { + super(AsThoughEffectType.DAMAGE_NOT_BLOCKED, Duration.EndOfTurn, Outcome.Damage); + this.staticText = "You may have creatures you control assign their combat damage this turn as though they weren't blocked."; + } + + public PredatoryFocusEffect(PredatoryFocusEffect effect) { + super(effect); + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + Player controller = game.getPlayer(source.getControllerId()); + String sourceName = source.getSourceObject(game).getLogName(); + choseUse = controller.chooseUse(Outcome.Damage, "Have creatures you control deal combat damage this turn" + + " as though they weren't blocked?", source, game); + game.informPlayers(choseUse ? controller.getName()+" chose to use "+sourceName+"'s effect" : + controller.getName()+" chose not to use "+sourceName+"'s effect."); + } + + @Override + public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { + return choseUse && affectedControllerId.equals(source.getControllerId()); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public PredatoryFocusEffect copy() { + return new PredatoryFocusEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Guildpact.java b/Mage.Sets/src/mage/sets/Guildpact.java index 16e3125609..762ddb9e2b 100644 --- a/Mage.Sets/src/mage/sets/Guildpact.java +++ b/Mage.Sets/src/mage/sets/Guildpact.java @@ -130,6 +130,7 @@ public final class Guildpact extends ExpansionSet { cards.add(new SetCardInfo("Pillory of the Sleepless", 125, Rarity.COMMON, mage.cards.p.PilloryOfTheSleepless.class)); cards.add(new SetCardInfo("Plagued Rusalka", 56, Rarity.UNCOMMON, mage.cards.p.PlaguedRusalka.class)); cards.add(new SetCardInfo("Poisonbelly Ogre", 57, Rarity.COMMON, mage.cards.p.PoisonbellyOgre.class)); + cards.add(new SetCardInfo("Predatory Focus", 92, Rarity.UNCOMMON, mage.cards.p.PredatoryFocus.class)); cards.add(new SetCardInfo("Primeval Light", 93, Rarity.UNCOMMON, mage.cards.p.PrimevalLight.class)); cards.add(new SetCardInfo("Pyromatics", 72, Rarity.COMMON, mage.cards.p.Pyromatics.class)); cards.add(new SetCardInfo("Quicken", 31, Rarity.RARE, mage.cards.q.Quicken.class)); diff --git a/Mage/src/main/java/mage/constants/AsThoughEffectType.java b/Mage/src/main/java/mage/constants/AsThoughEffectType.java index 7afa2c6000..cf7a860cdf 100644 --- a/Mage/src/main/java/mage/constants/AsThoughEffectType.java +++ b/Mage/src/main/java/mage/constants/AsThoughEffectType.java @@ -18,6 +18,7 @@ public enum AsThoughEffectType { BLOCK_SWAMPWALK, BLOCK_MOUNTAINWALK, BLOCK_FORESTWALK, + DAMAGE_NOT_BLOCKED, BE_BLOCKED, PLAY_FROM_NOT_OWN_HAND_ZONE, CAST_AS_INSTANT, diff --git a/Mage/src/main/java/mage/game/combat/CombatGroup.java b/Mage/src/main/java/mage/game/combat/CombatGroup.java index 235b2e774c..31f316847b 100644 --- a/Mage/src/main/java/mage/game/combat/CombatGroup.java +++ b/Mage/src/main/java/mage/game/combat/CombatGroup.java @@ -12,6 +12,7 @@ import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.TrampleAbility; +import mage.constants.AsThoughEffectType; import mage.constants.Outcome; import mage.filter.StaticFilters; import mage.game.Game; @@ -124,11 +125,14 @@ public class CombatGroup implements Serializable, Copyable { return; } else { Player player = game.getPlayer(defenderAssignsCombatDamage(game) ? defendingPlayerId : attacker.getControllerId()); - if (attacker.getAbilities().containsKey(DamageAsThoughNotBlockedAbility.getInstance().getId())) { // for handling creatures like Thorn Elemental - if (player.chooseUse(Outcome.Damage, "Do you wish to assign damage for " + attacker.getLogName() + " as though it weren't blocked?", null, game)) { - blocked = false; - unblockedDamage(first, game); - } + if ((attacker.getAbilities().containsKey(DamageAsThoughNotBlockedAbility.getInstance().getId()) && + player.chooseUse(Outcome.Damage, "Do you wish to assign damage for " + + attacker.getLogName() + " as though it weren't blocked?", null, game)) || + game.getContinuousEffects().asThough(attacker.getId(), AsThoughEffectType.DAMAGE_NOT_BLOCKED + , null, attacker.getControllerId(), game) != null) { + // for handling creatures like Thorn Elemental + blocked = false; + unblockedDamage(first, game); } if (blockers.size() == 1) { singleBlockerDamage(player, first, game); From e0932efa8b6d881f7dde8c0be3b4a48e43b4ccb8 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Mon, 9 Jul 2018 22:34:23 -0400 Subject: [PATCH 46/58] Fix TODO on Siege Behemoth --- Mage.Sets/src/mage/cards/s/SiegeBehemoth.java | 56 +++++++++++++++---- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/SiegeBehemoth.java b/Mage.Sets/src/mage/cards/s/SiegeBehemoth.java index 2eaaafa573..96675daffa 100644 --- a/Mage.Sets/src/mage/cards/s/SiegeBehemoth.java +++ b/Mage.Sets/src/mage/cards/s/SiegeBehemoth.java @@ -3,19 +3,21 @@ package mage.cards.s; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.DamageAsThoughNotBlockedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceAttackingCondition; import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; /** * @@ -34,15 +36,9 @@ public final class SiegeBehemoth extends CardImpl { // Hexproof this.addAbility(HexproofAbility.getInstance()); + // As long as Siege Behemoth is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked. - // TODO: DamageAsThoughNotBlockedAbility should be done by rule modifying effect instead of adding ability (if controlled creature looses all abilities it should'nt loose this effect) - this.addAbility(new SimpleStaticAbility( - Zone.BATTLEFIELD, - new ConditionalContinuousEffect( - new GainAbilityControlledEffect(DamageAsThoughNotBlockedAbility.getInstance(), Duration.WhileOnBattlefield, filter), - SourceAttackingCondition.instance, - "As long as {this} is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked" - ))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SiegeBehemothEffect())); } public SiegeBehemoth(final SiegeBehemoth card) { @@ -54,3 +50,39 @@ public final class SiegeBehemoth extends CardImpl { return new SiegeBehemoth(this); } } + +class SiegeBehemothEffect extends AsThoughEffectImpl { + + public SiegeBehemothEffect() { + super(AsThoughEffectType.DAMAGE_NOT_BLOCKED, Duration.WhileOnBattlefield, Outcome.Damage); + this.staticText = "As long as {this} is attacking, for each creature you control, you may have that creature assign its combat damage as though it weren't blocked"; + } + + public SiegeBehemothEffect(SiegeBehemothEffect effect) { + super(effect); + } + + @Override + public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { + Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game); + if (sourcePermanent != null && sourcePermanent.isAttacking()){ + Player controller = game.getPlayer(source.getControllerId()); + Permanent otherCreature = game.getPermanent(sourceId); + if (controller != null && otherCreature != null && otherCreature.isControlledBy(controller.getId())){ + return controller.chooseUse(Outcome.Damage, "Do you wish to assign damage for " + + otherCreature.getLogName() + " as though it weren't blocked?", source, game); + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public SiegeBehemothEffect copy() { + return new SiegeBehemothEffect(this); + } +} From 7e9291ff34a3af22aa271ed4d48d5372de6edae0 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 22:34:16 -0400 Subject: [PATCH 47/58] Implement Dichotomancy --- Mage.Sets/src/mage/cards/d/Dichotomancy.java | 98 ++++++++++++++++++++ Mage.Sets/src/mage/sets/PlanarChaos.java | 1 + 2 files changed, 99 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/Dichotomancy.java diff --git a/Mage.Sets/src/mage/cards/d/Dichotomancy.java b/Mage.Sets/src/mage/cards/d/Dichotomancy.java new file mode 100644 index 0000000000..c788c4dc8f --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/Dichotomancy.java @@ -0,0 +1,98 @@ +package mage.cards.d; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetOpponent; + +/** + * + * @author noahg + */ +public final class Dichotomancy extends CardImpl { + + public Dichotomancy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{U}{U}"); + + + // For each tapped nonland permanent target opponent controls, search that player’s library for a card with the same name as that permanent and put it onto the battlefield under your control. Then that player shuffles their library. + this.getSpellAbility().addEffect(new DichotomancyEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // Suspend 3-{1}{U}{U} + this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{1}{U}{U}"), this)); + } + + public Dichotomancy(final Dichotomancy card) { + super(card); + } + + @Override + public Dichotomancy copy() { + return new Dichotomancy(this); + } +} + +class DichotomancyEffect extends OneShotEffect { + + private static final FilterNonlandPermanent filter = new FilterNonlandPermanent(); + + static { + filter.add(new TappedPredicate()); + } + + public DichotomancyEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "For each tapped nonland permanent target opponent controls, search that player’s library for a card with the same name as that permanent and put it onto the battlefield under your control. Then that player shuffles their library"; + } + + public DichotomancyEffect(DichotomancyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && opponent != null) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, opponent.getId(), game)) { + String name = permanent.getName(); + FilterCard filterCard = new FilterCard("card named \""+name+'"'); + filterCard.add(new NamePredicate(name)); + TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filterCard); + if (controller.searchLibrary(target, game, opponent.getId())) { + controller.moveCards(opponent.getLibrary().getCard(target.getFirstTarget(), game), Zone.BATTLEFIELD, source, game); + } + } + opponent.shuffleLibrary(source, game); + return true; + } + return false; + } + + @Override + public DichotomancyEffect copy() { + return new DichotomancyEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/PlanarChaos.java b/Mage.Sets/src/mage/sets/PlanarChaos.java index dc3ca252a1..bb9ed548a0 100644 --- a/Mage.Sets/src/mage/sets/PlanarChaos.java +++ b/Mage.Sets/src/mage/sets/PlanarChaos.java @@ -61,6 +61,7 @@ public final class PlanarChaos extends ExpansionSet { cards.add(new SetCardInfo("Deadly Grub", 69, Rarity.COMMON, mage.cards.d.DeadlyGrub.class)); cards.add(new SetCardInfo("Deadwood Treefolk", 126, Rarity.UNCOMMON, mage.cards.d.DeadwoodTreefolk.class)); cards.add(new SetCardInfo("Detritivore", 96, Rarity.RARE, mage.cards.d.Detritivore.class)); + cards.add(new SetCardInfo("Dichotomancy", 38, Rarity.RARE, mage.cards.d.Dichotomancy.class)); cards.add(new SetCardInfo("Dismal Failure", 39, Rarity.UNCOMMON, mage.cards.d.DismalFailure.class)); cards.add(new SetCardInfo("Dormant Sliver", 156, Rarity.UNCOMMON, mage.cards.d.DormantSliver.class)); cards.add(new SetCardInfo("Dreamscape Artist", 40, Rarity.COMMON, mage.cards.d.DreamscapeArtist.class)); From c372d93f66d690303462cadd9faca0085f9e1110 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 23:00:27 -0400 Subject: [PATCH 48/58] Implement Molten Firebird and Ivory Gargoyle --- Mage.Sets/src/mage/cards/i/IvoryGargoyle.java | 54 ++++++++++++++ .../src/mage/cards/m/MoltenFirebird.java | 52 +++++++++++++ Mage.Sets/src/mage/sets/Alliances.java | 1 + Mage.Sets/src/mage/sets/MastersEditionII.java | 1 + Mage.Sets/src/mage/sets/PlanarChaos.java | 1 + .../SkipNextDrawStepControllerEffect.java | 74 +++++++++++++++++++ 6 files changed, 183 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/IvoryGargoyle.java create mode 100644 Mage.Sets/src/mage/cards/m/MoltenFirebird.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/SkipNextDrawStepControllerEffect.java diff --git a/Mage.Sets/src/mage/cards/i/IvoryGargoyle.java b/Mage.Sets/src/mage/cards/i/IvoryGargoyle.java new file mode 100644 index 0000000000..0cd6c5e37d --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IvoryGargoyle.java @@ -0,0 +1,54 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.abilities.effects.common.SkipNextDrawStepControllerEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author noahg + */ +public final class IvoryGargoyle extends CardImpl { + + public IvoryGargoyle(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); + + this.subtype.add(SubType.GARGOYLE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Ivory Gargoyle dies, return it to the battlefield under its owner's control at the beginning of the next end step and you skip your next draw step. + Ability ability = new DiesTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceFromGraveyardToBattlefieldEffect()))); + ability.addEffect(new SkipNextDrawStepControllerEffect()); + this.addAbility(ability); + + // {4}{W}: Exile Ivory Gargoyle. + this.addAbility(new SimpleActivatedAbility(new ExileSourceEffect(), new ManaCostsImpl("{4}{W}"))); + } + + public IvoryGargoyle(final IvoryGargoyle card) { + super(card); + } + + @Override + public IvoryGargoyle copy() { + return new IvoryGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MoltenFirebird.java b/Mage.Sets/src/mage/cards/m/MoltenFirebird.java new file mode 100644 index 0000000000..81001ce6ab --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MoltenFirebird.java @@ -0,0 +1,52 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.*; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author noahg + */ +public final class MoltenFirebird extends CardImpl { + + public MoltenFirebird(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.subtype.add(SubType.PHOENIX); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Molten Firebird dies, return it to the battlefield under its owner’s control at the beginning of the next end step and you skip your next draw step. + Ability ability = new DiesTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceFromGraveyardToBattlefieldEffect()))); + ability.addEffect(new SkipNextDrawStepControllerEffect()); + this.addAbility(ability); + + // {4}{R}: Exile Molten Firebird. + this.addAbility(new SimpleActivatedAbility(new ExileSourceEffect(), new ManaCostsImpl("{4}{R}"))); + } + + public MoltenFirebird(final MoltenFirebird card) { + super(card); + } + + @Override + public MoltenFirebird copy() { + return new MoltenFirebird(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Alliances.java b/Mage.Sets/src/mage/sets/Alliances.java index a2638ba711..ea610a1897 100644 --- a/Mage.Sets/src/mage/sets/Alliances.java +++ b/Mage.Sets/src/mage/sets/Alliances.java @@ -89,6 +89,7 @@ public final class Alliances extends ExpansionSet { cards.add(new SetCardInfo("Inheritance", 4, Rarity.UNCOMMON, mage.cards.i.Inheritance.class)); cards.add(new SetCardInfo("Insidious Bookworms", "51a", Rarity.COMMON, mage.cards.i.InsidiousBookworms.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Insidious Bookworms", "51b", Rarity.COMMON, mage.cards.i.InsidiousBookworms.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Ivory Gargoyle", 131, Rarity.RARE, mage.cards.i.IvoryGargoyle.class)); cards.add(new SetCardInfo("Juniper Order Advocate", 6, Rarity.UNCOMMON, mage.cards.j.JuniperOrderAdvocate.class)); cards.add(new SetCardInfo("Kaysa", 96, Rarity.RARE, mage.cards.k.Kaysa.class)); cards.add(new SetCardInfo("Keeper of Tresserhorn", 52, Rarity.RARE, mage.cards.k.KeeperOfTresserhorn.class)); diff --git a/Mage.Sets/src/mage/sets/MastersEditionII.java b/Mage.Sets/src/mage/sets/MastersEditionII.java index bee97c5b58..c3f9f8ffbf 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionII.java @@ -141,6 +141,7 @@ public final class MastersEditionII extends ExpansionSet { cards.add(new SetCardInfo("Infernal Darkness", 97, Rarity.RARE, mage.cards.i.InfernalDarkness.class)); cards.add(new SetCardInfo("Inheritance", 18, Rarity.UNCOMMON, mage.cards.i.Inheritance.class)); cards.add(new SetCardInfo("Ironclaw Orcs", 132, Rarity.COMMON, mage.cards.i.IronclawOrcs.class)); + cards.add(new SetCardInfo("Ivory Gargoyle", 19, Rarity.RARE, mage.cards.i.IvoryGargoyle.class)); cards.add(new SetCardInfo("Jester's Mask", 211, Rarity.RARE, mage.cards.j.JestersMask.class)); cards.add(new SetCardInfo("Jeweled Amulet", 212, Rarity.UNCOMMON, mage.cards.j.JeweledAmulet.class)); cards.add(new SetCardInfo("Johtull Wurm", 168, Rarity.UNCOMMON, mage.cards.j.JohtullWurm.class)); diff --git a/Mage.Sets/src/mage/sets/PlanarChaos.java b/Mage.Sets/src/mage/sets/PlanarChaos.java index dc3ca252a1..9e11c0792a 100644 --- a/Mage.Sets/src/mage/sets/PlanarChaos.java +++ b/Mage.Sets/src/mage/sets/PlanarChaos.java @@ -114,6 +114,7 @@ public final class PlanarChaos extends ExpansionSet { cards.add(new SetCardInfo("Midnight Charm", 74, Rarity.COMMON, mage.cards.m.MidnightCharm.class)); cards.add(new SetCardInfo("Mire Boa", 135, Rarity.COMMON, mage.cards.m.MireBoa.class)); cards.add(new SetCardInfo("Mirri the Cursed", 75, Rarity.RARE, mage.cards.m.MirriTheCursed.class)); + cards.add(new SetCardInfo("Molten Firebird", 117, Rarity.RARE, mage.cards.m.MoltenFirebird.class)); cards.add(new SetCardInfo("Muck Drubb", 76, Rarity.UNCOMMON, mage.cards.m.MuckDrubb.class)); cards.add(new SetCardInfo("Mycologist", 27, Rarity.UNCOMMON, mage.cards.m.Mycologist.class)); cards.add(new SetCardInfo("Necrotic Sliver", 159, Rarity.UNCOMMON, mage.cards.n.NecroticSliver.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/SkipNextDrawStepControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SkipNextDrawStepControllerEffect.java new file mode 100644 index 0000000000..f498b90eeb --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/SkipNextDrawStepControllerEffect.java @@ -0,0 +1,74 @@ +/* + * + * 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.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.game.Game; +import mage.game.turn.TurnMod; +import mage.players.Player; + +/** + * + * @author noahg + */ +public class SkipNextDrawStepControllerEffect extends OneShotEffect { + + public SkipNextDrawStepControllerEffect() { + this("you skip your next draw step"); + } + + public SkipNextDrawStepControllerEffect(String text) { + super(Outcome.Detriment); + this.staticText = text; + } + + public SkipNextDrawStepControllerEffect(SkipNextDrawStepControllerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + game.getState().getTurnMods().add(new TurnMod(player.getId(), PhaseStep.DRAW)); + return true; + } + return false; + } + + @Override + public SkipNextDrawStepControllerEffect copy() { + return new SkipNextDrawStepControllerEffect(this); + } +} From 1272d0d07664aa8f798be79aeb7f3c6f9cf3911d Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 23:14:35 -0400 Subject: [PATCH 49/58] Rename ThroneofGeth --- .../t/{ThroneofGeth.java => ThroneOfGeth.java} | 14 +++++++++----- Mage.Sets/src/mage/sets/ScarsOfMirrodin.java | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) rename Mage.Sets/src/mage/cards/t/{ThroneofGeth.java => ThroneOfGeth.java} (80%) diff --git a/Mage.Sets/src/mage/cards/t/ThroneofGeth.java b/Mage.Sets/src/mage/cards/t/ThroneOfGeth.java similarity index 80% rename from Mage.Sets/src/mage/cards/t/ThroneofGeth.java rename to Mage.Sets/src/mage/cards/t/ThroneOfGeth.java index 1707d08918..329851cf1b 100644 --- a/Mage.Sets/src/mage/cards/t/ThroneofGeth.java +++ b/Mage.Sets/src/mage/cards/t/ThroneOfGeth.java @@ -20,27 +20,31 @@ import mage.target.common.TargetControlledPermanent; * * @author Loki */ -public final class ThroneofGeth extends CardImpl { +public final class ThroneOfGeth extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); } - public ThroneofGeth (UUID ownerId, CardSetInfo setInfo) { + public ThroneOfGeth(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + + // {T}, Sacrifice an artifact: Proliferate. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ProliferateEffect(), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } - public ThroneofGeth (final ThroneofGeth card) { + public ThroneOfGeth(final ThroneOfGeth card) { super(card); } @Override - public ThroneofGeth copy() { - return new ThroneofGeth(this); + public ThroneOfGeth copy() { + return new ThroneOfGeth(this); } } diff --git a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java index 93cf471f04..ed5f1510b8 100644 --- a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java +++ b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java @@ -2,6 +2,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.cards.t.ThroneOfGeth; import mage.constants.Rarity; import mage.constants.SetType; @@ -244,7 +245,7 @@ public final class ScarsOfMirrodin extends ExpansionSet { cards.add(new SetCardInfo("Tel-Jilad Defiance", 129, Rarity.COMMON, mage.cards.t.TelJiladDefiance.class)); cards.add(new SetCardInfo("Tel-Jilad Fallen", 130, Rarity.COMMON, mage.cards.t.TelJiladFallen.class)); cards.add(new SetCardInfo("Tempered Steel", 24, Rarity.RARE, mage.cards.t.TemperedSteel.class)); - cards.add(new SetCardInfo("Throne of Geth", 211, Rarity.UNCOMMON, mage.cards.t.ThroneofGeth.class)); + cards.add(new SetCardInfo("Throne of Geth", 211, Rarity.UNCOMMON, ThroneOfGeth.class)); cards.add(new SetCardInfo("Thrummingbird", 47, Rarity.UNCOMMON, mage.cards.t.Thrummingbird.class)); cards.add(new SetCardInfo("Tower of Calamities", 212, Rarity.RARE, mage.cards.t.TowerOfCalamities.class)); cards.add(new SetCardInfo("Trigon of Corruption", 213, Rarity.UNCOMMON, mage.cards.t.TrigonOfCorruption.class)); From 70c302b0e45addd9c51ef90e47fbafce0f0ed5be Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 23:16:44 -0400 Subject: [PATCH 50/58] Rename BurntheImpure --- ...{BurntheImpure.java => BurnTheImpure.java} | 23 ++++++++++--------- Mage.Sets/src/mage/sets/MirrodinBesieged.java | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) rename Mage.Sets/src/mage/cards/b/{BurntheImpure.java => BurnTheImpure.java} (69%) diff --git a/Mage.Sets/src/mage/cards/b/BurntheImpure.java b/Mage.Sets/src/mage/cards/b/BurnTheImpure.java similarity index 69% rename from Mage.Sets/src/mage/cards/b/BurntheImpure.java rename to Mage.Sets/src/mage/cards/b/BurnTheImpure.java index 5d6e6bd321..9c57bb8b0d 100644 --- a/Mage.Sets/src/mage/cards/b/BurntheImpure.java +++ b/Mage.Sets/src/mage/cards/b/BurnTheImpure.java @@ -18,40 +18,41 @@ import mage.target.common.TargetCreaturePermanent; * * @author ayratn */ -public final class BurntheImpure extends CardImpl { +public final class BurnTheImpure extends CardImpl { - public BurntheImpure(UUID ownerId, CardSetInfo setInfo) { + public BurnTheImpure(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}"); + // Burn the Impure deals 3 damage to target creature. If that creature has infect, Burn the Impure deals 3 damage to that creature’s controller. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BurntheImpureEffect()); + this.getSpellAbility().addEffect(new BurnTheImpureEffect()); } - public BurntheImpure(final BurntheImpure card) { + public BurnTheImpure(final BurnTheImpure card) { super(card); } @Override - public BurntheImpure copy() { - return new BurntheImpure(this); + public BurnTheImpure copy() { + return new BurnTheImpure(this); } } -class BurntheImpureEffect extends OneShotEffect { +class BurnTheImpureEffect extends OneShotEffect { - public BurntheImpureEffect() { + public BurnTheImpureEffect() { super(Outcome.Damage); staticText = "{this} deals 3 damage to target creature. If that creature has infect, {this} deals 3 damage to that creature's controller."; } - public BurntheImpureEffect(final BurntheImpureEffect effect) { + public BurnTheImpureEffect(final BurnTheImpureEffect effect) { super(effect); } @Override - public BurntheImpureEffect copy() { - return new BurntheImpureEffect(this); + public BurnTheImpureEffect copy() { + return new BurnTheImpureEffect(this); } @Override diff --git a/Mage.Sets/src/mage/sets/MirrodinBesieged.java b/Mage.Sets/src/mage/sets/MirrodinBesieged.java index cd5df52caf..c2a968a35e 100644 --- a/Mage.Sets/src/mage/sets/MirrodinBesieged.java +++ b/Mage.Sets/src/mage/sets/MirrodinBesieged.java @@ -2,6 +2,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.cards.b.BurnTheImpure; import mage.constants.Rarity; import mage.constants.SetType; @@ -38,7 +39,7 @@ public final class MirrodinBesieged extends ExpansionSet { cards.add(new SetCardInfo("Blue Sun's Zenith", 20, Rarity.RARE, mage.cards.b.BlueSunsZenith.class)); cards.add(new SetCardInfo("Bonehoard", 100, Rarity.RARE, mage.cards.b.Bonehoard.class)); cards.add(new SetCardInfo("Brass Squire", 101, Rarity.UNCOMMON, mage.cards.b.BrassSquire.class)); - cards.add(new SetCardInfo("Burn the Impure", 59, Rarity.COMMON, mage.cards.b.BurntheImpure.class)); + cards.add(new SetCardInfo("Burn the Impure", 59, Rarity.COMMON, BurnTheImpure.class)); cards.add(new SetCardInfo("Caustic Hound", 40, Rarity.COMMON, mage.cards.c.CausticHound.class)); cards.add(new SetCardInfo("Choking Fumes", 4, Rarity.UNCOMMON, mage.cards.c.ChokingFumes.class)); cards.add(new SetCardInfo("Concussive Bolt", 60, Rarity.COMMON, mage.cards.c.ConcussiveBolt.class)); From 40368bc569e24f9802728430359073f5ab3cab7a Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 23:18:48 -0400 Subject: [PATCH 51/58] Rename WreathofGeists --- .../w/{WreathofGeists.java => WreathOfGeists.java} | 10 +++++----- Mage.Sets/src/mage/sets/Innistrad.java | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) rename Mage.Sets/src/mage/cards/w/{WreathofGeists.java => WreathOfGeists.java} (86%) diff --git a/Mage.Sets/src/mage/cards/w/WreathofGeists.java b/Mage.Sets/src/mage/cards/w/WreathOfGeists.java similarity index 86% rename from Mage.Sets/src/mage/cards/w/WreathofGeists.java rename to Mage.Sets/src/mage/cards/w/WreathOfGeists.java index 7a9da11ab0..8991b23d96 100644 --- a/Mage.Sets/src/mage/cards/w/WreathofGeists.java +++ b/Mage.Sets/src/mage/cards/w/WreathOfGeists.java @@ -23,9 +23,9 @@ import mage.target.common.TargetCreaturePermanent; * * @author nantuko */ -public final class WreathofGeists extends CardImpl { +public final class WreathOfGeists extends CardImpl { - public WreathofGeists(UUID ownerId, CardSetInfo setInfo) { + public WreathOfGeists(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); this.subtype.add(SubType.AURA); @@ -43,12 +43,12 @@ public final class WreathofGeists extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(value, value))); } - public WreathofGeists(final WreathofGeists card) { + public WreathOfGeists(final WreathOfGeists card) { super(card); } @Override - public WreathofGeists copy() { - return new WreathofGeists(this); + public WreathOfGeists copy() { + return new WreathOfGeists(this); } } diff --git a/Mage.Sets/src/mage/sets/Innistrad.java b/Mage.Sets/src/mage/sets/Innistrad.java index 62ea025a4e..771e181695 100644 --- a/Mage.Sets/src/mage/sets/Innistrad.java +++ b/Mage.Sets/src/mage/sets/Innistrad.java @@ -2,6 +2,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.cards.w.WreathOfGeists; import mage.constants.Rarity; import mage.constants.SetType; @@ -309,7 +310,7 @@ public final class Innistrad extends ExpansionSet { cards.add(new SetCardInfo("Wooden Stake", 237, Rarity.COMMON, mage.cards.w.WoodenStake.class)); cards.add(new SetCardInfo("Woodland Cemetery", 249, Rarity.RARE, mage.cards.w.WoodlandCemetery.class)); cards.add(new SetCardInfo("Woodland Sleuth", 210, Rarity.COMMON, mage.cards.w.WoodlandSleuth.class)); - cards.add(new SetCardInfo("Wreath of Geists", 211, Rarity.UNCOMMON, mage.cards.w.WreathofGeists.class)); + cards.add(new SetCardInfo("Wreath of Geists", 211, Rarity.UNCOMMON, WreathOfGeists.class)); } } From 7fdc6477ccf35b8dead5d4b2ba2c57b93607ca90 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 23:31:59 -0400 Subject: [PATCH 52/58] Fix typos in mtg-cards-data.txt --- Utils/mtg-cards-data.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 14b5fd976a..8a284e2497 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -29584,7 +29584,7 @@ Wailing Ghoul|Eldritch Moon|112|C|{1}{B}|Creature - Zombie|1|3|When Wailing Ghou Weirded Vampire|Eldritch Moon|113|C|{3}{B}|Creature - Vampire Horror|3|3|Madness {2}{B} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)| Whispers of Emrakul|Eldritch Moon|114|U|{1}{B}|Sorcery|||Target opponent discards a card at random.$Delirium — If there are four or more card types among cards in your graveyard, that player discards two cards at random instead.| Abandon Reason|Eldritch Moon|115|U|{2}{R}|Instant|||Up to two target creatures each get +1/+0 and gain first strike until end of turn.$Madness {1}{R} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)| -Alchemist's GreetinG|Eldritch Moon|116|C|{4}{R}|Sorcery|||Alchemist's Greeting deals 4 damage to target creature.$Madness {1}{R} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)| +Alchemist's Greeting|Eldritch Moon|116|C|{4}{R}|Sorcery|||Alchemist's Greeting deals 4 damage to target creature.$Madness {1}{R} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)| Assembled Alphas|Eldritch Moon|117|R|{5}{R}|Creature - Wolf|5|5|Whenever Assembled Alphas blocks or becomes blocked by a creature, Assembled Alphas deals 3 damage to that creature and 3 damage to that creature's controller.| Bedlam Reveler|Eldritch Moon|118|R|{6}{R}{R}|Creature - Devil Horror|3|4|Bedlam Reveler costs {1} less to cast for each instant or sorcery card in your graveyard.$Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)$When Bedlam Reveler enters the battlefield, discard your hand, then draw three cards.| Blood Mist|Eldritch Moon|119|U|{3}{R}|Enchantment|||At the beginning of combat on your turn, target creature you control gains double strike until end of turn.| @@ -30466,7 +30466,7 @@ Skyship Plunderer|Aether Revolt|46|U|{1}{U}|Creature - Human Pirate|2|1|Flying$W Take into Custody|Aether Revolt|47|C|{U}|Instant|||Tap target creature. It doesn't untap during its controller's next untap step.| Trophy Mage|Aether Revolt|48|U|{2}{U}|Creature - Human Wizard|2|2|When Trophy Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 3, reveal it, put it into your hand, then shuffle your library.| Whir of Invention|Aether Revolt|49|R|{X}{U}{U}{U}|Instant|||Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Search your library for an artifact card with converted mana cost X or less, put it onto the battlefield, then shuffle your library.| -Wind-King Raiders|Aether Revolt|50|U|{4}{U}{U}|Creature - Human Artificer|4|3|Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Flying| +Wind-Kin Raiders|Aether Revolt|50|U|{4}{U}{U}|Creature - Human Artificer|4|3|Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Flying| Aether Poisoner|Aether Revolt|51|C|{1}{B}|Creature - Human Artificer|1|1|Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$When Aether Poisoner enters the battlefield, you get {E}{E} (two energy counters).$Whenever Aether Poisoner attacks, you may pay {E}{E}. If you do, create a 1/1 colorless Servo artifact creature token.| Alley Strangler|Aether Revolt|52|C|{2}{B}|Creature - Aetherborn Rogue|2|3|Menace| Battle at the Bridge|Aether Revolt|53|R|{X}{B}|Sorcery|||Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Target creature gets -X/-X until end of turn. You gain X life.| @@ -32680,7 +32680,7 @@ Famished Paladin|Rivals of Ixalan|8|U|{1}{W}|Creature - Vampire Knight|3|3|Famis Forerunner of the Legion|Rivals of Ixalan|9|U|{2}{W}|Creature - Vampire Knight|2|2|When Forerunner of the Legion enters the battlefield, you may search your library for a Vampire card, reveal it, then shuffle your library and put that card on top of it.$Whenever another Vampire enters the battlefield under your control, target creature gets +1/+1 until end of turn.| Imperial Ceratops|Rivals of Ixalan|10|U|{4}{W}|Creature - Dinosaur|3|5|Enrage - Whenever Imperial Ceratops is dealt damage, you gain 2 life.| Legion Conquistador|Rivals of Ixalan|11|C|{2}{W}|Creature - Vampire Soldier|2|2|When Legion Conquistador enters the battlefield, you may search your library for any number of cards named Legion Conquistador, reveal them, put them into your hand, then shuffle your library.| -Luminous Bond|Rivals of Ixalan|12|C|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack or block.| +Luminous Bonds|Rivals of Ixalan|12|C|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack or block.| Majestic Heliopterus|Rivals of Ixalan|13|U|{3}{W}|Creature - Dinosaur|2|2|Flying$Whenever Majestic Heliopterus attacks, another target Dinosaur you control gains flying until end of turn.| Martyr of Dusk|Rivals of Ixalan|14|C|{1}{W}|Creature - Vampire Soldier|2|1|When Martyr of Dusk dies, create a 1/1 white Vampire creature token with lifelink.| Moment of Triumph|Rivals of Ixalan|15|C|{W}|Instant|||Target creature gets +2/+2 until end of turn. You gain 2 life.| @@ -32711,10 +32711,10 @@ Hornswoggle|Rivals of Ixalan|39|U|{2}{U}|Instant|||Counter target creature spell Induced Amnesia|Rivals of Ixalan|40|R|{2}{U}|Enchantment|||When Induced Amnesia enters the battlefield, target player exiles all the cards in his or her hand face down, then draws that many cards.$When Induced Amnesia is put into a graveyard from the battlefield, return the exiled cards to their owner's hand.| Kitesail Corsair|Rivals of Ixalan|41|C|{1}{U}|Creature - Human Pirate|2|1|Kitesail Corsair has flying as long as it's attacking.| Kumena's Awakening|Rivals of Ixalan|42|R|{2}{U}{U}|Enchantment|||Ascend (If you control ten or more permenants, you get the city's blessing for the rest of the game.)$At the beginning of your upkeep, each player draws a card. If you have the city's blessing, instead only you draw a card.| -Mist-Cloacked Herald|Rivals of Ixalan|43|C|{U}|Creature - Merfolk Warrior|1|1|Mist-Cloaked Herald can't be blocked.| +Mist-Cloaked Herald|Rivals of Ixalan|43|C|{U}|Creature - Merfolk Warrior|1|1|Mist-Cloaked Herald can't be blocked.| Negate|Rivals of Ixalan|44|C|{1}{U}|Instant|||Counter target noncreature spell.| Nezahal, Primal Tide|Rivals of Ixalan|45|M|{5}{U}{U}|Legendary Creature - Elder Dinosaur|7|7|Nezahal, Primal Tide can't be countered.$You have no maximum hand size.$Whenever an opponent casts a noncreature spell, draw a card.$Discard three cards: Exile Nezahal. Return it to the battlefield tapped under its owner's control at the beginning of the next end step.| -Return to the Wind|Rivals of Ixalan|46|R|{2}{U}|Instant|||Exile target nonland permanent. For as long as that card remains exiled, its owner may cast it without paying its mana cost.| +Release to the Wind|Rivals of Ixalan|46|R|{2}{U}|Instant|||Exile target nonland permanent. For as long as that card remains exiled, its owner may cast it without paying its mana cost.| River Darter|Rivals of Ixalan|47|C|{2}{U}|Creature - Merfolk Warrior|2|3|River Darter can't be blocked by Dinosaurs.| Riverwise Augur|Rivals of Ixalan|48|U|{3}{U}|Creature - Merfolk Wizard|2|2|When Riverwise Augur enters the battlefield, draw three cards, then put two cards from your hand on top of your library in any order. | Sailor of Means|Rivals of Ixalan|49|C|{2}{U}|Creature - Human Pirate|1|4|When Sailor of Means enters the battlefield, create a colorless Treasure artifact token with "{t}, Sacrifice this artifact: Add one mana of any color." | @@ -32726,7 +32726,7 @@ Siren Reaver|Rivals of Ixalan|54|U|{3}{U}|Creature - Siren Pirate|3|2|Raid(If you control ten or more permanents, you get the city's blessing for the rest of the game.)$As long as you have the city's blessing Slippery Scoundrel has Hexproof and can't be blocked.| Soul of the Rapids|Rivals of Ixalan|56|C|{3}{U}{U}|Creature - Elemental|3|2|Flying$Hexproof (This creature can't be the target of spells or abilities your opponents control.)| Spire Winder|Rivals of Ixalan|57|C|{3}{U}|Creature - snake|2|3|Flying$Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)$Spire Winder gets +1/+1 as long as you have the city's blessing.| -Sworn Gaurdian|Rivals of Ixalan|58|C|{1}{U}|Creature - Merfolk Warrior|1|3|| +Sworn Guardian|Rivals of Ixalan|58|C|{1}{U}|Creature - Merfolk Warrior|1|3|| Timestream Navigator|Rivals of Ixalan|59|M|{1}{U}|Creature - Human Pirate Wizard|1|1|Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)${2}{U}{U}, {T}, Put Timestream Navigator on the bottom of its owner's library: Take an extra turn after this one. Activate this ability only if you have the city's blessing.| Warkite Marauder|Rivals of Ixalan|60|R|{1}{U}|Creature - Human Pirate|2|1|Flying$Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn.| Waterknot|Rivals of Ixalan|61|C|{1}{U}{U}|Enchantment - Aura|||Enchant Crerature$When Waterknot enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during it's controller's untap step.| @@ -32788,7 +32788,7 @@ Stampeding Horncrest|Rivals of Ixalan|116|C|{4}{R}|Creature - Dinosaur|4|4|Stamp Storm Fleet Swashbuckler|Rivals of Ixalan|117|U|{1}{R}|Creature - Human Pirate|2|2|Ascend (If you control 10 or more permanents, you gain the city's blessing for the rest of the game.)$Storm Fleet Swashbuckler has double strike as long as you have the city's blessing.| Sun-Collared Raptor|Rivals of Ixalan|118|C|{1}{R}|Creature - Dinosaur|1|2|Trample${2}{R}: Sun-Collared Raptor gets +3/+0 until end of turn.| Swaggering Corsair|Rivals of Ixalan|119|C|{2}{R}|Creature - Human Pirate|2|2|Raid — Swaggering Corsair enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn.| -Tilonali's Crown|Rivals of Ixalan|120|C|{1}{R}|Enchantment - Aura|||Enchant creature$When Tilonali's Crown enters the battlefield, it deals 1 damage to enchanted creature.$Enchanted creature gets +3/+0 and has trample.| +Tilonalli's Crown|Rivals of Ixalan|120|C|{1}{R}|Enchantment - Aura|||Enchant creature$When Tilonali's Crown enters the battlefield, it deals 1 damage to enchanted creature.$Enchanted creature gets +3/+0 and has trample.| Tilonalli's Summoner|Rivals of Ixalan|121|R|{1}{R}|Creature - Human Shaman|1|1|Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)$Whenever Tilonalli's Summoner attacks, you may pay {X}{R}. If you do, create X 1/1 Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing.| Aggressive Urge|Rivals of Ixalan|122|C|{1}{G}|Instant|||Target creature gets +1/+1 until end of turn.$Draw a card.| Cacophodon|Rivals of Ixalan|123|U|{3}{G}|Creature - Dinosaur|2|5|Enrage — Whenever Cacophodon is dealt damage, untap target permanent.| @@ -32810,7 +32810,7 @@ Knight of the Stampede|Rivals of Ixalan|138|C|{3}{G}|Creature - Human Knight|2|4 Naturalize|Rivals of Ixalan|139|C|{1}{G}|Instant|||Destroy target artifact or enchantment.| Orazca Frillback|Rivals of Ixalan|140|C|{2}{G}|Creature - Dinosaur|4|2|| Overgrown Armasaur|Rivals of Ixalan|141|C|{3}{G}{G}|Creature - Dinosaur|4|4|Enrage — Whenever Overgrown Armasaur is dealt damage, create a 1/1 green Saproling creature token.| -Path to Discovery|Rivals of Ixalan|142|R|{3}{G}|Enchantment|||Whenever a creature enters the battlefield under your control, it explores. (Reveal the top card of your library. Put that card into your hand if it's a land. Otherwise, put a +1/+1 counter on the creature, then put the card back or put it into your graveyard.)| +Path of Discovery|Rivals of Ixalan|142|R|{3}{G}|Enchantment|||Whenever a creature enters the battlefield under your control, it explores. (Reveal the top card of your library. Put that card into your hand if it's a land. Otherwise, put a +1/+1 counter on the creature, then put the card back or put it into your graveyard.)| Plummet|Rivals of Ixalan|143|C|{1}{G}|Instant|||Destroy target creature with flying.| Polyraptor|Rivals of Ixalan|144|M|{6}{G}{G}|Creature - Dinosaur|5|5|Enrage — Whenever Polyraptor is dealt damage, create a token that is a copy of Polyraptor.| Strength of the Pack|Rivals of Ixalan|145|U|{4}{G}{G}|Sorcery|||Put two +1/+1 counters on each creature you control.| From 04014b30d616ba40658d33813a46c6271a5c4728 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Tue, 10 Jul 2018 23:32:46 -0400 Subject: [PATCH 53/58] Rename GiftofGrowth --- .../cards/g/{GiftofGrowth.java => GiftOfGrowth.java} | 11 +++++------ Mage.Sets/src/mage/sets/Dominaria.java | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) rename Mage.Sets/src/mage/cards/g/{GiftofGrowth.java => GiftOfGrowth.java} (84%) diff --git a/Mage.Sets/src/mage/cards/g/GiftofGrowth.java b/Mage.Sets/src/mage/cards/g/GiftOfGrowth.java similarity index 84% rename from Mage.Sets/src/mage/cards/g/GiftofGrowth.java rename to Mage.Sets/src/mage/cards/g/GiftOfGrowth.java index 0dedf15bd0..2e599b3236 100644 --- a/Mage.Sets/src/mage/cards/g/GiftofGrowth.java +++ b/Mage.Sets/src/mage/cards/g/GiftOfGrowth.java @@ -4,7 +4,6 @@ package mage.cards.g; import mage.abilities.condition.LockedInCondition; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.KickerAbility; @@ -20,9 +19,9 @@ import java.util.UUID; * * @author rscoates */ -public final class GiftofGrowth extends CardImpl { +public final class GiftOfGrowth extends CardImpl { - public GiftofGrowth(UUID ownerId, CardSetInfo setInfo) { + public GiftOfGrowth(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); // Kicker {2} @@ -36,12 +35,12 @@ public final class GiftofGrowth extends CardImpl { "It gets +2/+2 until end of turn. If this spell was kicked, that creature gets +4/+4 until end of turn instead.")); } - public GiftofGrowth(final GiftofGrowth card) { + public GiftOfGrowth(final GiftOfGrowth card) { super(card); } @Override - public GiftofGrowth copy() { - return new GiftofGrowth(this); + public GiftOfGrowth copy() { + return new GiftOfGrowth(this); } } diff --git a/Mage.Sets/src/mage/sets/Dominaria.java b/Mage.Sets/src/mage/sets/Dominaria.java index 4fd36ededd..ca1235b709 100644 --- a/Mage.Sets/src/mage/sets/Dominaria.java +++ b/Mage.Sets/src/mage/sets/Dominaria.java @@ -2,6 +2,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.cards.g.GiftOfGrowth; import mage.constants.Rarity; import mage.constants.SetType; @@ -117,7 +118,7 @@ public final class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Ghitu Journeymage", 126, Rarity.COMMON, mage.cards.g.GhituJourneymage.class)); cards.add(new SetCardInfo("Ghitu Lavarunner", 127, Rarity.COMMON, mage.cards.g.GhituLavarunner.class)); cards.add(new SetCardInfo("Gideon's Reproach", 19, Rarity.COMMON, mage.cards.g.GideonsReproach.class)); - cards.add(new SetCardInfo("Gift of Growth", 163, Rarity.COMMON, mage.cards.g.GiftofGrowth.class)); + cards.add(new SetCardInfo("Gift of Growth", 163, Rarity.COMMON, GiftOfGrowth.class)); cards.add(new SetCardInfo("Gilded Lotus", 215, Rarity.RARE, mage.cards.g.GildedLotus.class)); cards.add(new SetCardInfo("Goblin Barrage", 128, Rarity.UNCOMMON, mage.cards.g.GoblinBarrage.class)); cards.add(new SetCardInfo("Goblin Chainwhirler", 129, Rarity.RARE, mage.cards.g.GoblinChainwhirler.class)); From db4b47dd068aa75a88eb4ac99b890118f61b51f2 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Wed, 11 Jul 2018 17:43:20 -0400 Subject: [PATCH 54/58] Use paths instead of import --- Mage.Sets/src/mage/sets/Dominaria.java | 3 +-- Mage.Sets/src/mage/sets/Innistrad.java | 3 +-- Mage.Sets/src/mage/sets/MirrodinBesieged.java | 3 +-- Mage.Sets/src/mage/sets/ScarsOfMirrodin.java | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/Dominaria.java b/Mage.Sets/src/mage/sets/Dominaria.java index ca1235b709..6e48f762fe 100644 --- a/Mage.Sets/src/mage/sets/Dominaria.java +++ b/Mage.Sets/src/mage/sets/Dominaria.java @@ -2,7 +2,6 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.g.GiftOfGrowth; import mage.constants.Rarity; import mage.constants.SetType; @@ -118,7 +117,7 @@ public final class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Ghitu Journeymage", 126, Rarity.COMMON, mage.cards.g.GhituJourneymage.class)); cards.add(new SetCardInfo("Ghitu Lavarunner", 127, Rarity.COMMON, mage.cards.g.GhituLavarunner.class)); cards.add(new SetCardInfo("Gideon's Reproach", 19, Rarity.COMMON, mage.cards.g.GideonsReproach.class)); - cards.add(new SetCardInfo("Gift of Growth", 163, Rarity.COMMON, GiftOfGrowth.class)); + cards.add(new SetCardInfo("Gift of Growth", 163, Rarity.COMMON, mage.cards.g.GiftOfGrowth.class)); cards.add(new SetCardInfo("Gilded Lotus", 215, Rarity.RARE, mage.cards.g.GildedLotus.class)); cards.add(new SetCardInfo("Goblin Barrage", 128, Rarity.UNCOMMON, mage.cards.g.GoblinBarrage.class)); cards.add(new SetCardInfo("Goblin Chainwhirler", 129, Rarity.RARE, mage.cards.g.GoblinChainwhirler.class)); diff --git a/Mage.Sets/src/mage/sets/Innistrad.java b/Mage.Sets/src/mage/sets/Innistrad.java index 771e181695..b32374439f 100644 --- a/Mage.Sets/src/mage/sets/Innistrad.java +++ b/Mage.Sets/src/mage/sets/Innistrad.java @@ -2,7 +2,6 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.w.WreathOfGeists; import mage.constants.Rarity; import mage.constants.SetType; @@ -310,7 +309,7 @@ public final class Innistrad extends ExpansionSet { cards.add(new SetCardInfo("Wooden Stake", 237, Rarity.COMMON, mage.cards.w.WoodenStake.class)); cards.add(new SetCardInfo("Woodland Cemetery", 249, Rarity.RARE, mage.cards.w.WoodlandCemetery.class)); cards.add(new SetCardInfo("Woodland Sleuth", 210, Rarity.COMMON, mage.cards.w.WoodlandSleuth.class)); - cards.add(new SetCardInfo("Wreath of Geists", 211, Rarity.UNCOMMON, WreathOfGeists.class)); + cards.add(new SetCardInfo("Wreath of Geists", 211, Rarity.UNCOMMON, mage.cards.w.WreathOfGeists.class)); } } diff --git a/Mage.Sets/src/mage/sets/MirrodinBesieged.java b/Mage.Sets/src/mage/sets/MirrodinBesieged.java index c2a968a35e..31c5cc90a6 100644 --- a/Mage.Sets/src/mage/sets/MirrodinBesieged.java +++ b/Mage.Sets/src/mage/sets/MirrodinBesieged.java @@ -2,7 +2,6 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.b.BurnTheImpure; import mage.constants.Rarity; import mage.constants.SetType; @@ -39,7 +38,7 @@ public final class MirrodinBesieged extends ExpansionSet { cards.add(new SetCardInfo("Blue Sun's Zenith", 20, Rarity.RARE, mage.cards.b.BlueSunsZenith.class)); cards.add(new SetCardInfo("Bonehoard", 100, Rarity.RARE, mage.cards.b.Bonehoard.class)); cards.add(new SetCardInfo("Brass Squire", 101, Rarity.UNCOMMON, mage.cards.b.BrassSquire.class)); - cards.add(new SetCardInfo("Burn the Impure", 59, Rarity.COMMON, BurnTheImpure.class)); + cards.add(new SetCardInfo("Burn the Impure", 59, Rarity.COMMON, mage.cards.b.BurnTheImpure.class)); cards.add(new SetCardInfo("Caustic Hound", 40, Rarity.COMMON, mage.cards.c.CausticHound.class)); cards.add(new SetCardInfo("Choking Fumes", 4, Rarity.UNCOMMON, mage.cards.c.ChokingFumes.class)); cards.add(new SetCardInfo("Concussive Bolt", 60, Rarity.COMMON, mage.cards.c.ConcussiveBolt.class)); diff --git a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java index ed5f1510b8..0742778d39 100644 --- a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java +++ b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java @@ -2,7 +2,6 @@ package mage.sets; import mage.cards.ExpansionSet; -import mage.cards.t.ThroneOfGeth; import mage.constants.Rarity; import mage.constants.SetType; @@ -245,7 +244,7 @@ public final class ScarsOfMirrodin extends ExpansionSet { cards.add(new SetCardInfo("Tel-Jilad Defiance", 129, Rarity.COMMON, mage.cards.t.TelJiladDefiance.class)); cards.add(new SetCardInfo("Tel-Jilad Fallen", 130, Rarity.COMMON, mage.cards.t.TelJiladFallen.class)); cards.add(new SetCardInfo("Tempered Steel", 24, Rarity.RARE, mage.cards.t.TemperedSteel.class)); - cards.add(new SetCardInfo("Throne of Geth", 211, Rarity.UNCOMMON, ThroneOfGeth.class)); + cards.add(new SetCardInfo("Throne of Geth", 211, Rarity.UNCOMMON, mage.cards.t.ThroneOfGeth.class)); cards.add(new SetCardInfo("Thrummingbird", 47, Rarity.UNCOMMON, mage.cards.t.Thrummingbird.class)); cards.add(new SetCardInfo("Tower of Calamities", 212, Rarity.RARE, mage.cards.t.TowerOfCalamities.class)); cards.add(new SetCardInfo("Trigon of Corruption", 213, Rarity.UNCOMMON, mage.cards.t.TrigonOfCorruption.class)); From 1c540bbc7759b88890b16ba790b65ec3e6c3368b Mon Sep 17 00:00:00 2001 From: spjspj Date: Thu, 12 Jul 2018 23:21:00 +1000 Subject: [PATCH 55/58] Check if actually different replacement effects --- .../src/mage/player/human/HumanPlayer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index ab2848376d..e247f18136 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -341,8 +341,18 @@ public class HumanPlayer extends PlayerImpl { replacementEffectChoice.getChoices().clear(); replacementEffectChoice.setKeyChoices(rEffects); + + // Check if there are different ones + int differentChoices = 0; + String lastChoice = ""; + for (String value : replacementEffectChoice.getKeyChoices().values()) { + if (!lastChoice.equalsIgnoreCase(value)) { + lastChoice = value; + differentChoices++; + } + } - while (!abort) { + while (!abort && differentChoices > 1) { updateGameStatePriority("chooseEffect", game); prepareForResponse(game); if (!isExecutingMacro()) { From ec1dc44327bb7edc2ebc4758cbb2c4147af3b6d1 Mon Sep 17 00:00:00 2001 From: spjspj Date: Fri, 13 Jul 2018 00:02:26 +1000 Subject: [PATCH 56/58] Hopefully fix the /fix command .. --- .../java/mage/server/game/GameController.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 78ce2b7dc5..a9593816c7 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -1,4 +1,3 @@ - package mage.server.game; import java.io.*; @@ -1149,7 +1148,7 @@ public class GameController implements GameCallback { sb.append(state.getTurnMods()); sb.append("
getTurnNum: "); sb.append(state.getTurnNum()); - + sb.append("
Using plane chase?:" + state.isPlaneChase()); if (state.isPlaneChase()) { Plane currentPlane = state.getCurrentPlane(); @@ -1157,7 +1156,7 @@ public class GameController implements GameCallback { sb.append("
Current plane:" + currentPlane.getName()); } } - + sb.append("
Future Timeout:"); if (futureTimeout != null) { sb.append("Cancelled?="); @@ -1188,8 +1187,13 @@ public class GameController implements GameCallback { sb.append("
Active player is: "); sb.append(game.getPlayer(state.getActivePlayerId()).getName()); + PassAbility pass = new PassAbility(); if (game.getPlayer(state.getActivePlayerId()).hasLeft()) { + Player p = game.getPlayer(state.getActivePlayerId()); + if (p != null) { + p.concede(game); + } Phase currentPhase = game.getPhase(); if (currentPhase != null) { currentPhase.getStep().skipStep(game, state.getActivePlayerId()); @@ -1204,6 +1208,10 @@ public class GameController implements GameCallback { sb.append("
getChoosingPlayerId: "); if (state.getChoosingPlayerId() != null) { if (game.getPlayer(state.getChoosingPlayerId()).hasLeft()) { + Player p = game.getPlayer(state.getChoosingPlayerId()); + if (p != null) { + p.concede(game); + } Phase currentPhase = game.getPhase(); if (currentPhase != null && !fixedAlready) { currentPhase.getStep().endStep(game, state.getActivePlayerId()); @@ -1218,7 +1226,11 @@ public class GameController implements GameCallback { sb.append("
Player with Priority is: "); if (state.getPriorityPlayerId() != null) { - if (game.getPlayer(state.getPriorityPlayerId()).hasLeft()) { + if (game.getPlayer(state.getPriorityPlayerId()).hasLeft()) { + Player p = game.getPlayer(state.getPriorityPlayerId()); + if (p != null) { + p.concede(game); + } Phase currentPhase = game.getPhase(); if (currentPhase != null && !fixedAlready) { currentPhase.getStep().skipStep(game, state.getActivePlayerId()); @@ -1228,7 +1240,7 @@ public class GameController implements GameCallback { } sb.append(game.getPlayer(state.getPriorityPlayerId()).getName()); sb.append(""); - } + } sb.append("
Future Timeout:"); if (futureTimeout != null) { From 0ad86ff530913cc16b2456eafefc2e5dda31ba9e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 13 Jul 2018 14:08:19 -0400 Subject: [PATCH 57/58] fixed Ajani's Last Stand token name (fixes #5147) --- Mage/src/main/java/mage/game/permanent/token/AvatarToken2.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/game/permanent/token/AvatarToken2.java b/Mage/src/main/java/mage/game/permanent/token/AvatarToken2.java index fa30088d28..b63e3e14c5 100644 --- a/Mage/src/main/java/mage/game/permanent/token/AvatarToken2.java +++ b/Mage/src/main/java/mage/game/permanent/token/AvatarToken2.java @@ -6,8 +6,9 @@ import mage.constants.CardType; import mage.constants.SubType; public final class AvatarToken2 extends TokenImpl { + public AvatarToken2() { - super("Angel", "4/4 white Avatar creature token with flying"); + super("Avatar", "4/4 white Avatar creature token with flying"); cardType.add(CardType.CREATURE); color.setWhite(true); subtype.add(SubType.AVATAR); From dc3b3148e48c6576bdcc9d6b0f90c1cd86eb1e74 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sat, 14 Jul 2018 00:02:02 -0400 Subject: [PATCH 58/58] Fix card number --- Mage.Sets/src/mage/sets/Alliances.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/Alliances.java b/Mage.Sets/src/mage/sets/Alliances.java index ea610a1897..1553e50b59 100644 --- a/Mage.Sets/src/mage/sets/Alliances.java +++ b/Mage.Sets/src/mage/sets/Alliances.java @@ -89,7 +89,7 @@ public final class Alliances extends ExpansionSet { cards.add(new SetCardInfo("Inheritance", 4, Rarity.UNCOMMON, mage.cards.i.Inheritance.class)); cards.add(new SetCardInfo("Insidious Bookworms", "51a", Rarity.COMMON, mage.cards.i.InsidiousBookworms.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Insidious Bookworms", "51b", Rarity.COMMON, mage.cards.i.InsidiousBookworms.class, NON_FULL_USE_VARIOUS)); - cards.add(new SetCardInfo("Ivory Gargoyle", 131, Rarity.RARE, mage.cards.i.IvoryGargoyle.class)); + cards.add(new SetCardInfo("Ivory Gargoyle", 5, Rarity.RARE, mage.cards.i.IvoryGargoyle.class)); cards.add(new SetCardInfo("Juniper Order Advocate", 6, Rarity.UNCOMMON, mage.cards.j.JuniperOrderAdvocate.class)); cards.add(new SetCardInfo("Kaysa", 96, Rarity.RARE, mage.cards.k.Kaysa.class)); cards.add(new SetCardInfo("Keeper of Tresserhorn", 52, Rarity.RARE, mage.cards.k.KeeperOfTresserhorn.class));