From 2a42bec1f2fbc22bb601607c768d993432202160 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 22 Mar 2021 20:01:20 -0400 Subject: [PATCH] simplified various cards to use isInstantOrSorcery method --- Mage.Sets/src/mage/cards/a/Abeyance.java | 2 +- Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java | 2 +- Mage.Sets/src/mage/cards/b/BackdraftHellkite.java | 3 ++- Mage.Sets/src/mage/cards/b/BlazeCommando.java | 2 +- Mage.Sets/src/mage/cards/b/BonusRound.java | 2 +- Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java | 2 +- Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java | 2 +- Mage.Sets/src/mage/cards/c/ChaosWand.java | 2 +- Mage.Sets/src/mage/cards/c/CurseOfEchoes.java | 2 +- Mage.Sets/src/mage/cards/d/DoubleVision.java | 3 ++- Mage.Sets/src/mage/cards/d/Doublecast.java | 2 +- Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java | 2 +- Mage.Sets/src/mage/cards/f/FireServant.java | 2 +- Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java | 2 +- Mage.Sets/src/mage/cards/g/Galvanoth.java | 2 +- Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java | 2 +- Mage.Sets/src/mage/cards/m/Mirari.java | 4 ++-- Mage.Sets/src/mage/cards/n/NarsetTranscendent.java | 2 +- Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java | 2 +- Mage.Sets/src/mage/cards/p/PastInFlames.java | 3 ++- Mage.Sets/src/mage/cards/p/PyromancerAscension.java | 8 ++++---- Mage.Sets/src/mage/cards/p/PyromancersSwath.java | 2 +- Mage.Sets/src/mage/cards/r/RalStormConduit.java | 2 +- Mage.Sets/src/mage/cards/s/SatyrFiredancer.java | 2 +- Mage.Sets/src/mage/cards/s/SentinelTower.java | 2 +- Mage.Sets/src/mage/cards/s/SphinxsDecree.java | 2 +- Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java | 2 +- Mage.Sets/src/mage/cards/t/TergridGodOfFright.java | 2 +- Mage.Sets/src/mage/cards/t/TheMirariConjecture.java | 2 +- Mage.Sets/src/mage/cards/t/ThousandYearStorm.java | 2 +- Mage.Sets/src/mage/cards/w/WildDefiance.java | 2 +- .../effects/common/PreventDamageByTargetEffect.java | 2 +- .../mage/abilities/effects/keyword/SupportEffect.java | 2 +- .../java/mage/abilities/keyword/ProtectionAbility.java | 4 ++-- .../main/java/mage/abilities/keyword/SupportAbility.java | 2 +- .../builder/common/InstantOrSorcerySpellManaBuilder.java | 2 +- Mage/src/main/java/mage/game/draft/RateCard.java | 2 +- Mage/src/main/java/mage/game/stack/Spell.java | 2 +- 38 files changed, 46 insertions(+), 43 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/Abeyance.java b/Mage.Sets/src/mage/cards/a/Abeyance.java index 94ba0ba76d..f1ce9ca85f 100644 --- a/Mage.Sets/src/mage/cards/a/Abeyance.java +++ b/Mage.Sets/src/mage/cards/a/Abeyance.java @@ -87,7 +87,7 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl { return false; } if (event.getType() == GameEvent.EventType.CAST_SPELL - && (object.isInstant() || object.isSorcery())) { + && object.isInstantOrSorcery()) { return true; } if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { diff --git a/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java b/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java index 507efd9d48..8326a5c688 100644 --- a/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java +++ b/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java @@ -131,7 +131,7 @@ class AzorTheLawbringerCantCastEffect extends ContinuousRuleModifyingEffectImpl if (opponentId.equals(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (event.getType() == GameEvent.EventType.CAST_SPELL) { - if (object.isInstant() || object.isSorcery()) { + if (object.isInstantOrSorcery()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java b/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java index 80475b21aa..b07ad16586 100644 --- a/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java +++ b/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java @@ -1,6 +1,7 @@ package mage.cards.b; import mage.MageInt; +import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; @@ -75,7 +76,7 @@ class BackdraftHellkiteEffect extends ContinuousEffectImpl { player.getGraveyard() .stream() .map((cardId) -> game.getCard(cardId)) - .filter(card -> card.isInstant() || card.isSorcery()) + .filter(MageObject::isInstantOrSorcery) .forEachOrdered(card -> affectedObjectList.add(new MageObjectReference(card, game))); } diff --git a/Mage.Sets/src/mage/cards/b/BlazeCommando.java b/Mage.Sets/src/mage/cards/b/BlazeCommando.java index df36371ba1..ceb15534f6 100644 --- a/Mage.Sets/src/mage/cards/b/BlazeCommando.java +++ b/Mage.Sets/src/mage/cards/b/BlazeCommando.java @@ -93,7 +93,7 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl { if (isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject damageSource = game.getObject(event.getSourceId()); if (damageSource != null) { - if (damageSource.isInstant()|| damageSource.isSorcery()) { + if (damageSource.isInstantOrSorcery()) { if (!handledStackObjects.contains(damageSource.getId())) { handledStackObjects.add(damageSource.getId()); return true; diff --git a/Mage.Sets/src/mage/cards/b/BonusRound.java b/Mage.Sets/src/mage/cards/b/BonusRound.java index c84a417a0e..6d33013704 100644 --- a/Mage.Sets/src/mage/cards/b/BonusRound.java +++ b/Mage.Sets/src/mage/cards/b/BonusRound.java @@ -60,7 +60,7 @@ class BonusRoundDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java b/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java index 5aab7b6cda..a551870815 100644 --- a/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java +++ b/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java @@ -71,7 +71,7 @@ class BoseijuWhoSheltersAllWatcher extends Watcher { if (event.getType() == GameEvent.EventType.MANA_PAID) { if (event.getData() != null && event.getData().equals(originalId.toString()) && event.getTargetId() != null) { Card spell = game.getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { spells.add(new MageObjectReference(game.getObject(event.getTargetId()), game)); } } diff --git a/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java b/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java index c767841f94..b384ba8985 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java +++ b/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java @@ -86,7 +86,7 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/c/ChaosWand.java b/Mage.Sets/src/mage/cards/c/ChaosWand.java index 906984011c..fc6f3a33aa 100644 --- a/Mage.Sets/src/mage/cards/c/ChaosWand.java +++ b/Mage.Sets/src/mage/cards/c/ChaosWand.java @@ -82,7 +82,7 @@ class ChaosWandEffect extends OneShotEffect { } opponent.moveCards(card, Zone.EXILED, source, game); controller.revealCards(source, new CardsImpl(card), game); - if (card.isInstant() || card.isSorcery()) { + if (card.isInstantOrSorcery()) { boolean cardWasCast = false; if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java b/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java index 77516a6b5d..9675b80039 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java @@ -85,7 +85,7 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/cards/d/DoubleVision.java b/Mage.Sets/src/mage/cards/d/DoubleVision.java index f71749174e..57a49802c5 100644 --- a/Mage.Sets/src/mage/cards/d/DoubleVision.java +++ b/Mage.Sets/src/mage/cards/d/DoubleVision.java @@ -1,5 +1,6 @@ package mage.cards.d; +import mage.MageObject; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.cards.CardImpl; @@ -71,7 +72,7 @@ class DoubleVisionCopyTriggeredAbility extends SpellCastControllerTriggeredAbili if (watcher != null) { List eligibleSpells = watcher.getSpellsCastThisTurn(this.getControllerId()) .stream() - .filter(s -> s.isInstant() || s.isSorcery()) + .filter(MageObject::isInstantOrSorcery) .collect(Collectors.toList()); return eligibleSpells.size() == 1 && eligibleSpells.get(0).getId().equals(spell.getId()); } diff --git a/Mage.Sets/src/mage/cards/d/Doublecast.java b/Mage.Sets/src/mage/cards/d/Doublecast.java index da91c5a274..aa968a1269 100644 --- a/Mage.Sets/src/mage/cards/d/Doublecast.java +++ b/Mage.Sets/src/mage/cards/d/Doublecast.java @@ -65,7 +65,7 @@ class DoublecastAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java b/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java index 668381f96c..164823125e 100644 --- a/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java +++ b/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java @@ -72,7 +72,7 @@ class EyeOfTheStormAbility extends TriggeredAbilityImpl { && !spell.isCopy() && spell.getCard() != null && !spell.getCard().isCopy() - && (spell.isInstant() || spell.isSorcery())) { + && spell.isInstantOrSorcery()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/f/FireServant.java b/Mage.Sets/src/mage/cards/f/FireServant.java index be773946ab..d923e23e7b 100644 --- a/Mage.Sets/src/mage/cards/f/FireServant.java +++ b/Mage.Sets/src/mage/cards/f/FireServant.java @@ -75,7 +75,7 @@ class FireServantEffect extends ReplacementEffectImpl { return spell != null && spell.isControlledBy(source.getControllerId()) && spell.getColor(game).isRed() && - (spell.isInstant() || spell.isSorcery()); + spell.isInstantOrSorcery(); } @Override diff --git a/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java b/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java index 94f3d49553..c009d43bff 100644 --- a/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java +++ b/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java @@ -75,7 +75,7 @@ class ForethoughtAmuletEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getAmount() >= 3) { MageObject object = game.getObject(event.getSourceId()); - return object != null && (object.isInstant() || object.isSorcery()); + return object != null && object.isInstantOrSorcery(); } return false; } diff --git a/Mage.Sets/src/mage/cards/g/Galvanoth.java b/Mage.Sets/src/mage/cards/g/Galvanoth.java index e1830588c0..5e0228d23c 100644 --- a/Mage.Sets/src/mage/cards/g/Galvanoth.java +++ b/Mage.Sets/src/mage/cards/g/Galvanoth.java @@ -60,7 +60,7 @@ class GalvanothEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.lookAtCards(source, null, new CardsImpl(card), game); - if (card.isInstant() || card.isSorcery()) { + if (card.isInstantOrSorcery()) { if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) { game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE); controller.cast(controller.chooseAbilityForCast(card, game, true), diff --git a/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java b/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java index 6832cb11b2..a6ccf14b7f 100644 --- a/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java +++ b/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java @@ -79,7 +79,7 @@ class HowlOfTheHordeDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/m/Mirari.java b/Mage.Sets/src/mage/cards/m/Mirari.java index eb0f346f74..c67e5a2cc3 100644 --- a/Mage.Sets/src/mage/cards/m/Mirari.java +++ b/Mage.Sets/src/mage/cards/m/Mirari.java @@ -87,8 +87,8 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null - && (spell.isControlledBy(this.getControllerId())) - && (spell.isInstant() || spell.isSorcery()); + && spell.isControlledBy(this.getControllerId()) + && spell.isInstantOrSorcery(); } @Override diff --git a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java index 3109ffae90..2a1f55ae4d 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java +++ b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java @@ -129,7 +129,7 @@ class NarsetTranscendentTriggeredAbility extends DelayedTriggeredAbility { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getFromZone() == Zone.HAND) { if (spell.getCard() != null - && spell.getCard().isInstant() || spell.getCard().isSorcery()) { + && spell.getCard().isInstantOrSorcery()) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(spell.getId())); } diff --git a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java index 21d3aca859..8b1e107973 100644 --- a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java +++ b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java @@ -77,7 +77,7 @@ class NivixAerieOfTheFiremindEffect extends OneShotEffect { Card card = library.getFromTop(game); if (card != null && controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)) - && (card.isInstant() || card.isSorcery())) { + && card.isInstantOrSorcery()) { ContinuousEffect effect = new NivixAerieOfTheFiremindCanCastEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/p/PastInFlames.java b/Mage.Sets/src/mage/cards/p/PastInFlames.java index 5566a948b9..e8339f0280 100644 --- a/Mage.Sets/src/mage/cards/p/PastInFlames.java +++ b/Mage.Sets/src/mage/cards/p/PastInFlames.java @@ -1,5 +1,6 @@ package mage.cards.p; +import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; @@ -63,7 +64,7 @@ class PastInFlamesEffect extends ContinuousEffectImpl { if (this.affectedObjectsSet) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - player.getGraveyard().stream().map((cardId) -> game.getCard(cardId)).filter((card) -> (card.isInstant() || card.isSorcery())).forEachOrdered((card) -> { + player.getGraveyard().stream().map((cardId) -> game.getCard(cardId)).filter(MageObject::isInstantOrSorcery).forEachOrdered((card) -> { affectedObjectList.add(new MageObjectReference(card, game)); }); } diff --git a/Mage.Sets/src/mage/cards/p/PyromancerAscension.java b/Mage.Sets/src/mage/cards/p/PyromancerAscension.java index af5a2ee11a..7be8d97c90 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancerAscension.java +++ b/Mage.Sets/src/mage/cards/p/PyromancerAscension.java @@ -87,8 +87,8 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null && - (spell.isControlledBy(this.getControllerId())) && - (spell.isInstant() || spell.isSorcery()); + spell.isControlledBy(this.getControllerId()) && + spell.isInstantOrSorcery(); } @Override @@ -134,8 +134,8 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl { private boolean isControlledInstantOrSorcery(Spell spell) { return spell != null && - (spell.isControlledBy(this.getControllerId())) && - (spell.isInstant() || spell.isSorcery()); + spell.isControlledBy(this.getControllerId()) && + spell.isInstantOrSorcery(); } @Override diff --git a/Mage.Sets/src/mage/cards/p/PyromancersSwath.java b/Mage.Sets/src/mage/cards/p/PyromancersSwath.java index 64c9d4e69d..3112bba39e 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersSwath.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersSwath.java @@ -68,7 +68,7 @@ class PyromancersSwathReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject object = game.getObject(event.getSourceId()); - return object != null && (object.isInstant() || object.isSorcery()); + return object != null && object.isInstantOrSorcery(); } return false; } diff --git a/Mage.Sets/src/mage/cards/r/RalStormConduit.java b/Mage.Sets/src/mage/cards/r/RalStormConduit.java index ca9a9e2911..679774d6a8 100644 --- a/Mage.Sets/src/mage/cards/r/RalStormConduit.java +++ b/Mage.Sets/src/mage/cards/r/RalStormConduit.java @@ -120,7 +120,7 @@ class RalStormConduitDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() || spell.isSorcery())) { + if (spell != null && spell.isInstantOrSorcery()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java b/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java index 6c78ddb103..a0b8c2fbfb 100644 --- a/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java +++ b/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java @@ -85,7 +85,7 @@ class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl { return false; } MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject == null || !(sourceObject.isInstant() || sourceObject.isSorcery())) { + if (sourceObject == null || !sourceObject.isInstantOrSorcery()) { return false; } for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/s/SentinelTower.java b/Mage.Sets/src/mage/cards/s/SentinelTower.java index 53bb9bf48c..5fafd90aa0 100644 --- a/Mage.Sets/src/mage/cards/s/SentinelTower.java +++ b/Mage.Sets/src/mage/cards/s/SentinelTower.java @@ -119,7 +119,7 @@ class SentinelTowerWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { MageObject object = game.getObject(event.getTargetId()); - if (object != null && (object.isInstant() || object.isSorcery())) { + if (object != null && object.isInstantOrSorcery()) { spellsThisTurn.add(new MageObjectReference(object, game)); } } diff --git a/Mage.Sets/src/mage/cards/s/SphinxsDecree.java b/Mage.Sets/src/mage/cards/s/SphinxsDecree.java index 5a84437a45..3a50cdb9c2 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxsDecree.java +++ b/Mage.Sets/src/mage/cards/s/SphinxsDecree.java @@ -111,7 +111,7 @@ class SphinxsDecreeCantCastEffect extends ContinuousRuleModifyingEffectImpl { if (opponentId.equals(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (event.getType() == GameEvent.EventType.CAST_SPELL) { - if (object != null && (object.isInstant() || object.isSorcery())) { + if (object != null && object.isInstantOrSorcery()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java b/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java index 2403ff9c53..e35a5ac062 100644 --- a/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java +++ b/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java @@ -96,7 +96,7 @@ class TaigamOjutaiMasterTriggeredAbility extends DelayedTriggeredAbility { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getFromZone() == Zone.HAND) { if (spell.getCard() != null - && spell.getCard().isInstant() || spell.getCard().isSorcery()) { + && spell.getCard().isInstantOrSorcery()) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(spell.getId())); } diff --git a/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java b/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java index 90c0cf08e5..e5f66b6bd5 100644 --- a/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java +++ b/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java @@ -120,7 +120,7 @@ class TergridGodOfFrightTriggeredAbility extends TriggeredAbilityImpl { if (event.getType() == GameEvent.EventType.DISCARDED_CARD) { Card discardedCard = game.getCard(event.getTargetId()); if (discardedCard != null - && !(discardedCard.isInstantOrSorcery())) { + && !discardedCard.isInstantOrSorcery()) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(discardedCard.getId(), game)); } diff --git a/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java b/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java index f3f57d6664..2f8fe7ad92 100644 --- a/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java +++ b/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java @@ -97,7 +97,7 @@ class TheMirariConjectureDelayedTriggeredAbility extends DelayedTriggeredAbility if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null - && (spell.isInstant() || spell.isSorcery())) { + && spell.isInstantOrSorcery()) { this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java index ac79bf03d5..a953b99f00 100644 --- a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java +++ b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java @@ -158,7 +158,7 @@ class ThousandYearStormWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { MageObject object = game.getObject(event.getTargetId()); - if (object != null && (object.isInstant() || object.isSorcery())) { + if (object != null && object.isInstantOrSorcery()) { UUID playerId = event.getPlayerId(); List spellsCast = spellsThisTurn.getOrDefault(playerId, new ArrayList()); spellsCast.add(new MageObjectReference(object, game)); diff --git a/Mage.Sets/src/mage/cards/w/WildDefiance.java b/Mage.Sets/src/mage/cards/w/WildDefiance.java index 322e75148e..34d41a6336 100644 --- a/Mage.Sets/src/mage/cards/w/WildDefiance.java +++ b/Mage.Sets/src/mage/cards/w/WildDefiance.java @@ -67,7 +67,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI MageObject object = game.getObject(event.getSourceId()); if (object instanceof Spell) { Card c = (Spell) object; - if (c.isInstant() || c.isSorcery()) { + if (c.isInstantOrSorcery()) { if (getTargets().isEmpty()) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java index 772b9ad0ad..fed07057b6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java @@ -46,7 +46,7 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { if (!this.used && super.applies(event, source, game)) { MageObject mageObject = game.getObject(event.getSourceId()); if (mageObject != null - && (mageObject.isInstant() || mageObject.isSorcery())) { + && mageObject.isInstantOrSorcery()) { for (Target target : source.getTargets()) { if (target instanceof TargetSpell) { if (((TargetSpell) target).getSourceIds().contains(event.getSourceId())) { diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/SupportEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/SupportEffect.java index c650a130b7..c473476a15 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/SupportEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/SupportEffect.java @@ -23,7 +23,7 @@ public class SupportEffect extends AddCountersTargetEffect { super(CounterType.P1P1.createInstance(0), StaticValue.get(1)); this.amountSupportTargets = StaticValue.get(amount); this.otherPermanent = otherPermanent; - if (card.isInstant() || card.isSorcery()) { + if (card.isInstantOrSorcery()) { card.getSpellAbility().addTarget(new TargetCreaturePermanent(0, amount, new FilterCreaturePermanent("target creatures"), false)); } staticText = setText(); diff --git a/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java b/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java index 500560a71f..586ca68625 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java @@ -99,7 +99,7 @@ public class ProtectionAbility extends StaticAbility { // object is still a card and not a spell yet. So return only if the source object can't be a spell // otherwise the following FilterObject check will be applied if (source instanceof StackObject - || (!source.isInstant() && !source.isSorcery())) { + || !source.isInstantOrSorcery()) { return true; } } @@ -107,7 +107,7 @@ public class ProtectionAbility extends StaticAbility { // Emrakul, the Aeons Torn if (filter instanceof FilterStackObject) { if (filter.match(source, game)) { - return (!source.isInstantOrSorcery()); + return !source.isInstantOrSorcery(); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/SupportAbility.java b/Mage/src/main/java/mage/abilities/keyword/SupportAbility.java index 11561359cd..aaef23be4f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SupportAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SupportAbility.java @@ -25,7 +25,7 @@ public class SupportAbility extends EntersBattlefieldTriggeredAbility { */ public SupportAbility(Card card, int amount, boolean otherPermanent) { super(new SupportEffect(card, amount, otherPermanent)); - if (!card.isInstant() && !card.isSorcery()) { + if (!card.isInstantOrSorcery()) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); if (card.isCreature()) { filter.add(AnotherPredicate.instance); diff --git a/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java b/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java index 62b2fbf003..a544ab73af 100644 --- a/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java +++ b/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java @@ -44,7 +44,7 @@ class InstantOrSorceryCastManaCondition extends ManaCondition implements Conditi public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - return object != null && (object.isInstant() || object.isSorcery()); + return object != null && object.isInstantOrSorcery(); } return false; } diff --git a/Mage/src/main/java/mage/game/draft/RateCard.java b/Mage/src/main/java/mage/game/draft/RateCard.java index ee8855e935..f1ea86e5f9 100644 --- a/Mage/src/main/java/mage/game/draft/RateCard.java +++ b/Mage/src/main/java/mage/game/draft/RateCard.java @@ -110,7 +110,7 @@ public final class RateCard { } private static int isRemoval(Card card) { - if (card.isEnchantment() || card.isInstant() || card.isSorcery()) { + if (card.isEnchantment() || card.isInstantOrSorcery()) { for (Ability ability : card.getAbilities()) { for (Effect effect : ability.getEffects()) { diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index a48d1dfc82..19536f3d99 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -207,7 +207,7 @@ public class Spell extends StackObjImpl implements Card { turnController.controlPlayersTurn(game, controller.getId()); } } - if (this.isInstant() || this.isSorcery()) { + if (this.isInstantOrSorcery()) { int index = 0; result = false; boolean legalParts = false;