From 39c9420ad281f1a775d567acfb44186d75a1edaa Mon Sep 17 00:00:00 2001 From: ingmargoudt Date: Thu, 2 Mar 2017 16:28:23 +0100 Subject: [PATCH] change enum equals to == in cards --- Mage.Sets/src/mage/cards/a/AccursedWitch.java | 2 +- .../src/mage/cards/a/AeonChronicler.java | 2 +- .../src/mage/cards/a/AjaniSteadfast.java | 4 ++-- .../src/mage/cards/a/AlhammarretsArchive.java | 2 +- .../src/mage/cards/a/AltarOfTheLost.java | 2 +- .../src/mage/cards/a/AnafenzaTheForemost.java | 2 +- .../src/mage/cards/a/AngelOfJubilation.java | 2 +- Mage.Sets/src/mage/cards/a/AngelsGrace.java | 2 +- Mage.Sets/src/mage/cards/a/AnimateDead.java | 2 +- .../src/mage/cards/a/AnthemOfRakdos.java | 2 +- .../src/mage/cards/a/AvacynGuardianAngel.java | 4 ++-- Mage.Sets/src/mage/cards/a/AvatarOfHope.java | 2 +- .../src/mage/cards/a/AwakenTheSkyTyrant.java | 2 +- Mage.Sets/src/mage/cards/b/BansheesBlade.java | 2 +- .../mage/cards/b/BattlefieldScrounger.java | 2 +- Mage.Sets/src/mage/cards/b/Berserk.java | 2 +- Mage.Sets/src/mage/cards/b/BlindingBeam.java | 4 ++-- .../src/mage/cards/b/BloodBaronOfVizkopa.java | 2 +- Mage.Sets/src/mage/cards/b/BloodFrenzy.java | 8 ++++---- .../src/mage/cards/b/BoonReflection.java | 2 +- .../src/mage/cards/c/CabalExecutioner.java | 2 +- .../src/mage/cards/c/ChandraPyromaster.java | 2 +- .../src/mage/cards/c/ConsecrateLand.java | 2 +- Mage.Sets/src/mage/cards/c/Conspiracy.java | 2 +- .../src/mage/cards/c/CurseOfBloodletting.java | 2 +- .../src/mage/cards/c/CurseOfInertia.java | 2 +- .../src/mage/cards/d/DarettiScrapSavant.java | 2 +- .../src/mage/cards/d/DaxosOfMeletis.java | 2 +- Mage.Sets/src/mage/cards/d/DecayingSoil.java | 2 +- Mage.Sets/src/mage/cards/d/Delay.java | 2 +- .../mage/cards/d/DereviEmpyrialTactician.java | 2 +- .../src/mage/cards/d/DescentIntoMadness.java | 4 ++-- .../src/mage/cards/d/DoublingSeason.java | 2 +- Mage.Sets/src/mage/cards/d/DraconicRoar.java | 2 +- Mage.Sets/src/mage/cards/d/DralnusPet.java | 2 +- .../src/mage/cards/e/EchoBaseCommando.java | 2 +- .../mage/cards/e/EliminateTheCompetition.java | 2 +- .../src/mage/cards/e/EndlessWhispers.java | 2 +- Mage.Sets/src/mage/cards/e/Epochrasite.java | 2 +- .../src/mage/cards/e/ErdwalIlluminator.java | 4 ++-- Mage.Sets/src/mage/cards/e/ErebossTitan.java | 2 +- .../src/mage/cards/e/ExtraplanarLens.java | 2 +- Mage.Sets/src/mage/cards/f/FactOrFiction.java | 20 +++++++++---------- Mage.Sets/src/mage/cards/f/FellShepherd.java | 2 +- Mage.Sets/src/mage/cards/f/FireServant.java | 6 +++--- Mage.Sets/src/mage/cards/f/FiremaneAngel.java | 4 ++-- Mage.Sets/src/mage/cards/f/Fluctuator.java | 2 +- .../src/mage/cards/f/FoeRazerRegent.java | 2 +- .../mage/cards/f/FoulTongueInvocation.java | 2 +- .../src/mage/cards/g/GhostlyFlicker.java | 2 +- .../mage/cards/g/GiselaBladeOfGoldnight.java | 14 ++++++------- Mage.Sets/src/mage/cards/g/Gloom.java | 2 +- .../src/mage/cards/g/GoldnightCastigator.java | 4 ++-- Mage.Sets/src/mage/cards/g/GroundSeal.java | 10 +++++----- Mage.Sets/src/mage/cards/g/GryffsBoon.java | 2 +- .../src/mage/cards/g/GuardianSeraph.java | 2 +- Mage.Sets/src/mage/cards/h/HarshJudgment.java | 2 +- Mage.Sets/src/mage/cards/h/HarvestHand.java | 2 +- Mage.Sets/src/mage/cards/h/Heartstone.java | 4 ++-- .../src/mage/cards/h/HedronFieldPurists.java | 4 ++-- .../src/mage/cards/h/HelmOfObedience.java | 2 +- Mage.Sets/src/mage/cards/h/HushwingGryff.java | 2 +- .../src/mage/cards/i/IllusionistsGambit.java | 8 ++++---- .../src/mage/cards/i/InquisitorsFlail.java | 6 +++--- .../src/mage/cards/j/JacesMindseeker.java | 2 +- Mage.Sets/src/mage/cards/j/JotunGrunt.java | 2 +- .../mage/cards/k/KalitasTraitorOfGhet.java | 2 +- .../mage/cards/k/KothophedSoulHoarder.java | 2 +- .../src/mage/cards/l/LeylineOfTheVoid.java | 19 +++++++++--------- Mage.Sets/src/mage/cards/l/LibraryOfLeng.java | 14 ++++++------- Mage.Sets/src/mage/cards/l/Lich.java | 2 +- Mage.Sets/src/mage/cards/l/LifeDeath.java | 2 +- .../src/mage/cards/l/LightOfSanction.java | 2 +- Mage.Sets/src/mage/cards/l/LongRoadHome.java | 2 +- Mage.Sets/src/mage/cards/l/Luminesce.java | 6 +++--- .../src/mage/cards/m/MagewrightsStone.java | 2 +- Mage.Sets/src/mage/cards/m/ManaMaze.java | 2 +- .../src/mage/cards/m/MeriekeRiBerit.java | 6 +++--- .../mage/cards/m/MichikoKondaTruthSeeker.java | 2 +- .../src/mage/cards/m/MinamosMeddling.java | 2 +- Mage.Sets/src/mage/cards/m/MoxDiamond.java | 2 +- Mage.Sets/src/mage/cards/m/MysticBarrier.java | 8 ++++---- .../src/mage/cards/n/NarsetTranscendent.java | 2 +- Mage.Sets/src/mage/cards/n/NaturesWill.java | 2 +- .../mage/cards/n/NecromancersMagemark.java | 4 ++-- Mage.Sets/src/mage/cards/n/Necromancy.java | 2 +- .../mage/cards/n/NecromanticSelection.java | 2 +- Mage.Sets/src/mage/cards/n/NefariousLich.java | 2 +- .../src/mage/cards/n/NephaliaAcademy.java | 14 ++++++------- .../src/mage/cards/n/NimDeathmantle.java | 2 +- .../mage/cards/n/NivixAerieOfTheFiremind.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfChandra.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfLiliana.java | 2 +- .../mage/cards/o/OngoingInvestigation.java | 2 +- .../mage/cards/o/OpalEyeKondasYojimbo.java | 6 +++--- .../src/mage/cards/o/OratorOfOjutai.java | 2 +- Mage.Sets/src/mage/cards/o/OrbsOfWarding.java | 2 +- Mage.Sets/src/mage/cards/o/OrimsChant.java | 2 +- Mage.Sets/src/mage/cards/o/Overblaze.java | 4 ++-- Mage.Sets/src/mage/cards/p/ParallelLives.java | 2 +- .../src/mage/cards/p/PhantomNantuko.java | 2 +- Mage.Sets/src/mage/cards/p/PhantomTiger.java | 6 +++--- Mage.Sets/src/mage/cards/p/PhantomWurm.java | 2 +- .../src/mage/cards/p/PiasRevolution.java | 4 ++-- Mage.Sets/src/mage/cards/p/Portcullis.java | 2 +- Mage.Sets/src/mage/cards/p/PowerArtifact.java | 4 ++-- Mage.Sets/src/mage/cards/p/PrimalClay.java | 2 +- Mage.Sets/src/mage/cards/p/PrimalPlasma.java | 2 +- .../src/mage/cards/p/PrismaticStrands.java | 6 +++--- Mage.Sets/src/mage/cards/p/PrizedAmalgam.java | 4 ++-- .../src/mage/cards/p/PsychogenicProbe.java | 2 +- .../src/mage/cards/p/PyrewildShaman.java | 6 +++--- .../src/mage/cards/p/PyromancersGauntlet.java | 6 +++--- .../src/mage/cards/p/PyromancersGoggles.java | 2 +- .../src/mage/cards/q/QuestForPureFlame.java | 4 ++-- Mage.Sets/src/mage/cards/r/Reincarnation.java | 2 +- .../src/mage/cards/r/ReinsOfTheVinesteed.java | 2 +- .../mage/cards/r/RescueFromTheUnderworld.java | 4 ++-- .../src/mage/cards/r/RestorationAngel.java | 2 +- Mage.Sets/src/mage/cards/r/Restore.java | 2 +- .../src/mage/cards/r/RetaliatorGriffin.java | 2 +- .../src/mage/cards/r/RhoxFaithmender.java | 2 +- .../src/mage/cards/r/RitualOfTheReturned.java | 2 +- .../src/mage/cards/r/RotfeasterMaggot.java | 2 +- .../src/mage/cards/s/ScaleguardSentinels.java | 2 +- Mage.Sets/src/mage/cards/s/SenTriplets.java | 4 ++-- .../src/mage/cards/s/SilumgarsScorn.java | 2 +- Mage.Sets/src/mage/cards/s/SoulFoundry.java | 2 +- .../src/mage/cards/s/SuddenSpoiling.java | 2 +- Mage.Sets/src/mage/cards/t/Tamanoa.java | 8 ++++---- .../src/mage/cards/t/TeferiMageOfZhalfir.java | 2 +- .../src/mage/cards/t/TestamentOfFaith.java | 2 +- .../src/mage/cards/t/ThopterSpyNetwork.java | 2 +- Mage.Sets/src/mage/cards/t/TorporOrb.java | 2 +- .../src/mage/cards/t/TorrentElemental.java | 2 +- .../src/mage/cards/t/TrainingGrounds.java | 4 ++-- Mage.Sets/src/mage/cards/u/UginsNexus.java | 2 +- Mage.Sets/src/mage/cards/u/UmezawasJitte.java | 2 +- .../src/mage/cards/u/UndergrowthChampion.java | 2 +- .../mage/cards/u/UnscytheKillerOfKings.java | 2 +- .../src/mage/cards/u/UrbanBurgeoning.java | 2 +- Mage.Sets/src/mage/cards/u/UrzasArmor.java | 2 +- .../src/mage/cards/v/ValeronWardens.java | 2 +- .../src/mage/cards/v/VanishIntoMemory.java | 4 ++-- .../src/mage/cards/v/VoiceOfResurgence.java | 2 +- Mage.Sets/src/mage/cards/w/WhipOfErebos.java | 4 ++-- .../mage/cards/y/YidrisMaelstromWielder.java | 2 +- .../src/mage/cards/z/ZameckGuildmage.java | 2 +- 148 files changed, 237 insertions(+), 238 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AccursedWitch.java b/Mage.Sets/src/mage/cards/a/AccursedWitch.java index ab4e6527f1..3535e8dda6 100644 --- a/Mage.Sets/src/mage/cards/a/AccursedWitch.java +++ b/Mage.Sets/src/mage/cards/a/AccursedWitch.java @@ -105,7 +105,7 @@ class AccursedWitchReturnTransformedEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); //note: should check for null after game.getCard Card card = game.getCard(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/a/AeonChronicler.java b/Mage.Sets/src/mage/cards/a/AeonChronicler.java index 90f5020b4f..c9117830c4 100644 --- a/Mage.Sets/src/mage/cards/a/AeonChronicler.java +++ b/Mage.Sets/src/mage/cards/a/AeonChronicler.java @@ -101,7 +101,7 @@ class AeonChroniclerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); + return event.getData() == CounterType.TIME.getName() && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java b/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java index 23794e9046..b0840dbbc8 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java +++ b/Mage.Sets/src/mage/cards/a/AjaniSteadfast.java @@ -152,12 +152,12 @@ class AjaniSteadfastPreventEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER && event.getTargetId().equals(source.getControllerId())) { return super.applies(event, source, game); } - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) { + if (event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { return super.applies(event, source, game); diff --git a/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java b/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java index f77c99a0e4..6d064dd8c4 100644 --- a/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java +++ b/Mage.Sets/src/mage/cards/a/AlhammarretsArchive.java @@ -142,7 +142,7 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { if (game.getActivePlayerId().equals(event.getPlayerId()) - && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) { + && game.getPhase().getStep().getType() == PhaseStep.DRAW) { CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep"); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/a/AltarOfTheLost.java b/Mage.Sets/src/mage/cards/a/AltarOfTheLost.java index 44c9efc228..52dcd8fa55 100644 --- a/Mage.Sets/src/mage/cards/a/AltarOfTheLost.java +++ b/Mage.Sets/src/mage/cards/a/AltarOfTheLost.java @@ -97,7 +97,7 @@ class AltarOfTheLostManaCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - if (object instanceof Spell && ((Spell) object).getFromZone().equals(Zone.GRAVEYARD)) { + if (object instanceof Spell && ((Spell) object).getFromZone() == Zone.GRAVEYARD) { for (Ability ability : ((Spell) object).getAbilities(game)) { if (ability instanceof FlashbackAbility) { return true; diff --git a/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java b/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java index 8146cba234..5a3e649b6d 100644 --- a/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java +++ b/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java @@ -118,7 +118,7 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { + if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null) { return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); diff --git a/Mage.Sets/src/mage/cards/a/AngelOfJubilation.java b/Mage.Sets/src/mage/cards/a/AngelOfJubilation.java index c1828a9ae1..169f9c16bc 100644 --- a/Mage.Sets/src/mage/cards/a/AngelOfJubilation.java +++ b/Mage.Sets/src/mage/cards/a/AngelOfJubilation.java @@ -148,7 +148,7 @@ class AngelOfJubilationSacrificeFilterEffect extends CostModificationEffectImpl @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - return abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) || + return abilityToModify.getAbilityType() == AbilityType.ACTIVATED || abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility; } diff --git a/Mage.Sets/src/mage/cards/a/AngelsGrace.java b/Mage.Sets/src/mage/cards/a/AngelsGrace.java index 44a0788898..9beff9bc78 100644 --- a/Mage.Sets/src/mage/cards/a/AngelsGrace.java +++ b/Mage.Sets/src/mage/cards/a/AngelsGrace.java @@ -117,7 +117,7 @@ class AngelsGraceReplacementEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CAUSES_LIFE_LOSS); + return event.getType() == EventType.DAMAGE_CAUSES_LIFE_LOSS; } diff --git a/Mage.Sets/src/mage/cards/a/AnimateDead.java b/Mage.Sets/src/mage/cards/a/AnimateDead.java index eb1b68d186..ed0575a5c7 100644 --- a/Mage.Sets/src/mage/cards/a/AnimateDead.java +++ b/Mage.Sets/src/mage/cards/a/AnimateDead.java @@ -205,7 +205,7 @@ class AnimateDeadAttachEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getFirstTarget()); - if (card != null && game.getState().getZone(source.getFirstTarget()).equals(Zone.GRAVEYARD)) { + if (card != null && game.getState().getZone(source.getFirstTarget()) == Zone.GRAVEYARD) { // Card have no attachedTo attribute yet so write ref only to enchantment now Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null) { diff --git a/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java b/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java index e6f3bac92f..db51d96ecc 100644 --- a/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java +++ b/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java @@ -95,7 +95,7 @@ class AnthemOfRakdosHellbentEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) + return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); } diff --git a/Mage.Sets/src/mage/cards/a/AvacynGuardianAngel.java b/Mage.Sets/src/mage/cards/a/AvacynGuardianAngel.java index 4831c2d8f4..9ce0dba303 100644 --- a/Mage.Sets/src/mage/cards/a/AvacynGuardianAngel.java +++ b/Mage.Sets/src/mage/cards/a/AvacynGuardianAngel.java @@ -154,7 +154,7 @@ class AvacynGuardianAngelPreventToCreaturePreventionEffect extends PreventionEff @Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) + if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE && event.getTargetId().equals(getTargetPointer().getFirst(game, source))) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).shares(this.color)) { @@ -223,7 +223,7 @@ class AvacynGuardianAngelPreventToPlayerPreventionEffect extends PreventionEffec @Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER && event.getTargetId().equals(getTargetPointer().getFirst(game, source))) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).shares(this.color)) { diff --git a/Mage.Sets/src/mage/cards/a/AvatarOfHope.java b/Mage.Sets/src/mage/cards/a/AvatarOfHope.java index f541564133..140598ea3a 100644 --- a/Mage.Sets/src/mage/cards/a/AvatarOfHope.java +++ b/Mage.Sets/src/mage/cards/a/AvatarOfHope.java @@ -104,7 +104,7 @@ class AdjustingCostsAbility extends SimpleStaticAbility implements AdjustingSour @Override public void adjustCosts(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { Player player = game.getPlayer(ability.getControllerId()); if (player != null && player.getLife() < 4) { CardUtil.adjustCost((SpellAbility)ability, 6); diff --git a/Mage.Sets/src/mage/cards/a/AwakenTheSkyTyrant.java b/Mage.Sets/src/mage/cards/a/AwakenTheSkyTyrant.java index 17bd6d3933..0e8f639eab 100644 --- a/Mage.Sets/src/mage/cards/a/AwakenTheSkyTyrant.java +++ b/Mage.Sets/src/mage/cards/a/AwakenTheSkyTyrant.java @@ -80,7 +80,7 @@ class AwakenTheSkyTyrantTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/b/BansheesBlade.java b/Mage.Sets/src/mage/cards/b/BansheesBlade.java index 162785fc68..366324a3cb 100644 --- a/Mage.Sets/src/mage/cards/b/BansheesBlade.java +++ b/Mage.Sets/src/mage/cards/b/BansheesBlade.java @@ -112,7 +112,7 @@ class BansheesBladeAbility extends TriggeredAbilityImpl { return true; } } - if (event.getType().equals(GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE)) { + if (event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE) { usedInPhase = false; } return false; diff --git a/Mage.Sets/src/mage/cards/b/BattlefieldScrounger.java b/Mage.Sets/src/mage/cards/b/BattlefieldScrounger.java index 84e823ac53..3b018f1a62 100644 --- a/Mage.Sets/src/mage/cards/b/BattlefieldScrounger.java +++ b/Mage.Sets/src/mage/cards/b/BattlefieldScrounger.java @@ -101,7 +101,7 @@ class BattlefieldScroungerCost extends CostImpl { if (targets.choose(Outcome.Removal, controllerId, sourceId, game)) { for (UUID targetId: targets.get(0).getTargets()) { Card card = game.getCard(targetId); - if (card == null || !game.getState().getZone(targetId).equals(Zone.GRAVEYARD)) { + if (card == null || game.getState().getZone(targetId) != Zone.GRAVEYARD) { return false; } paid |= controller.moveCardToLibraryWithInfo(card, sourceId, game, Zone.GRAVEYARD, false, true); diff --git a/Mage.Sets/src/mage/cards/b/Berserk.java b/Mage.Sets/src/mage/cards/b/Berserk.java index ee7bf5c4cf..ef1400a701 100644 --- a/Mage.Sets/src/mage/cards/b/Berserk.java +++ b/Mage.Sets/src/mage/cards/b/Berserk.java @@ -104,7 +104,7 @@ class BerserkReplacementEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) { + if (event.getType() == GameEvent.EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) { CombatDamageStepStartedWatcher watcher = (CombatDamageStepStartedWatcher) game.getState().getWatchers().get("CombatDamageStepStarted"); return watcher == null || watcher.conditionMet(); } diff --git a/Mage.Sets/src/mage/cards/b/BlindingBeam.java b/Mage.Sets/src/mage/cards/b/BlindingBeam.java index b7275c1b69..549a575b48 100644 --- a/Mage.Sets/src/mage/cards/b/BlindingBeam.java +++ b/Mage.Sets/src/mage/cards/b/BlindingBeam.java @@ -153,13 +153,13 @@ class BlindingBeamEffect2 extends ContinuousRuleModifyingEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.UNTAP); + return event.getType() == EventType.UNTAP; } @Override public boolean applies(GameEvent event, Ability source, Game game) { // prevent untap event of creatures of target player - if (game.getTurn().getStepType().equals(PhaseStep.UNTAP)) { + if (game.getTurn().getStepType() == PhaseStep.UNTAP) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getControllerId().equals(targetPlayerId) && filter.match(permanent, game)) { return true; diff --git a/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java b/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java index fb8bb55033..014b9ea236 100644 --- a/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java +++ b/Mage.Sets/src/mage/cards/b/BloodBaronOfVizkopa.java @@ -140,7 +140,7 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { @Override public boolean hasLayer(Layer layer) { - return (layer.equals(Layer.AbilityAddingRemovingEffects_6) || layer.equals(layer.PTChangingEffects_7)); + return (layer == Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7); } diff --git a/Mage.Sets/src/mage/cards/b/BloodFrenzy.java b/Mage.Sets/src/mage/cards/b/BloodFrenzy.java index 80086dcd8a..68b0b3c1b8 100644 --- a/Mage.Sets/src/mage/cards/b/BloodFrenzy.java +++ b/Mage.Sets/src/mage/cards/b/BloodFrenzy.java @@ -93,17 +93,17 @@ class BloodFrenzyCastRestriction extends ContinuousRuleModifyingEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.CAST_SPELL); + return event.getType() == GameEvent.EventType.CAST_SPELL; } @Override public boolean applies(GameEvent event, Ability source, Game game) { if(event.getSourceId().equals(source.getSourceId())) { - if(game.getPhase().getType().equals(TurnPhase.COMBAT) + if(game.getPhase().getType() == TurnPhase.COMBAT // There cannot be a legal target before declare attackers, // so in practice it is limited to these two steps. - && (game.getStep().getType().equals(PhaseStep.DECLARE_ATTACKERS) - || game.getStep().getType().equals(PhaseStep.DECLARE_BLOCKERS))) { + && (game.getStep().getType() == PhaseStep.DECLARE_ATTACKERS + || game.getStep().getType() == PhaseStep.DECLARE_BLOCKERS)) { return false; } return true; diff --git a/Mage.Sets/src/mage/cards/b/BoonReflection.java b/Mage.Sets/src/mage/cards/b/BoonReflection.java index 4b3826373b..6d17eb2bdc 100644 --- a/Mage.Sets/src/mage/cards/b/BoonReflection.java +++ b/Mage.Sets/src/mage/cards/b/BoonReflection.java @@ -94,7 +94,7 @@ class BoonReflectionEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.GAIN_LIFE); + return event.getType() == EventType.GAIN_LIFE; } @Override diff --git a/Mage.Sets/src/mage/cards/c/CabalExecutioner.java b/Mage.Sets/src/mage/cards/c/CabalExecutioner.java index 47721b20a5..0356d4d52e 100644 --- a/Mage.Sets/src/mage/cards/c/CabalExecutioner.java +++ b/Mage.Sets/src/mage/cards/c/CabalExecutioner.java @@ -92,7 +92,7 @@ class CabalExecutionerAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return EventType.DAMAGED_PLAYER.equals(event.getType()); + return event.getType() == EventType.DAMAGED_PLAYER; } diff --git a/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java b/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java index f49744f66c..71fff4c730 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java +++ b/Mage.Sets/src/mage/cards/c/ChandraPyromaster.java @@ -247,7 +247,7 @@ class ChandraPyromasterCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (targetPointer.getTargets(game, source).contains(sourceId)) { - return game.getState().getZone(sourceId).equals(Zone.EXILED); + return game.getState().getZone(sourceId) == Zone.EXILED; } return false; } diff --git a/Mage.Sets/src/mage/cards/c/ConsecrateLand.java b/Mage.Sets/src/mage/cards/c/ConsecrateLand.java index cdfd1047d0..8022f410aa 100644 --- a/Mage.Sets/src/mage/cards/c/ConsecrateLand.java +++ b/Mage.Sets/src/mage/cards/c/ConsecrateLand.java @@ -102,7 +102,7 @@ class ConsecrateLandRuleEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.ATTACH) || event.getType().equals(EventType.STAY_ATTACHED); + return event.getType() == EventType.ATTACH || event.getType() == EventType.STAY_ATTACHED; } @Override diff --git a/Mage.Sets/src/mage/cards/c/Conspiracy.java b/Mage.Sets/src/mage/cards/c/Conspiracy.java index 62c0634c38..2d6e48faa5 100644 --- a/Mage.Sets/src/mage/cards/c/Conspiracy.java +++ b/Mage.Sets/src/mage/cards/c/Conspiracy.java @@ -128,7 +128,7 @@ class ConspiracyEffect extends ContinuousEffectImpl { } // commander in command zone for (UUID commanderId : controller.getCommandersIds()) { - if (game.getState().getZone(commanderId).equals(Zone.COMMAND)) { + if (game.getState().getZone(commanderId) == Zone.COMMAND) { Card card = game.getCard(commanderId); if (card.getCardType().contains(CardType.CREATURE)) { setCreatureSubtype(card, choice, game); diff --git a/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java b/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java index 8b9f452e34..b2c1f194dc 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfBloodletting.java @@ -94,7 +94,7 @@ class CurseOfBloodlettingEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/c/CurseOfInertia.java b/Mage.Sets/src/mage/cards/c/CurseOfInertia.java index 42b80c5128..5e02adfbf8 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfInertia.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfInertia.java @@ -91,7 +91,7 @@ class CurseOfInertiaTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.DECLARED_ATTACKERS); + return event.getType() == EventType.DECLARED_ATTACKERS; } @Override diff --git a/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java b/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java index ef03ad53ff..79a7581ef0 100644 --- a/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java +++ b/Mage.Sets/src/mage/cards/d/DarettiScrapSavant.java @@ -240,7 +240,7 @@ class DarettiScrapSavantEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); - if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); effect.setText("return that card to the battlefield at the beginning of the next end step"); diff --git a/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java b/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java index 8f850baa6d..c0b2e411ae 100644 --- a/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java +++ b/Mage.Sets/src/mage/cards/d/DaxosOfMeletis.java @@ -211,7 +211,7 @@ class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl implements AsT && Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget()) && ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId) && (((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)) - && game.getState().getZone(objectId).equals(Zone.STACK); + && game.getState().getZone(objectId) == Zone.STACK; } @Override diff --git a/Mage.Sets/src/mage/cards/d/DecayingSoil.java b/Mage.Sets/src/mage/cards/d/DecayingSoil.java index 530a6910c0..2acd61d519 100644 --- a/Mage.Sets/src/mage/cards/d/DecayingSoil.java +++ b/Mage.Sets/src/mage/cards/d/DecayingSoil.java @@ -179,7 +179,7 @@ class DecayingSoilEffect extends OneShotEffect { if (target != null) { Card card = game.getCard(target); // check if it's still in graveyard - if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { card.moveToZone(Zone.HAND, source.getSourceId(), game, true); return true; } diff --git a/Mage.Sets/src/mage/cards/d/Delay.java b/Mage.Sets/src/mage/cards/d/Delay.java index 262845b5de..0960d08733 100644 --- a/Mage.Sets/src/mage/cards/d/Delay.java +++ b/Mage.Sets/src/mage/cards/d/Delay.java @@ -96,7 +96,7 @@ class DelayEffect extends OneShotEffect { Effect effect = new CounterTargetWithReplacementEffect(Zone.EXILED); effect.setTargetPointer(targetPointer); Card card = game.getCard(spell.getSourceId()); - if (card != null && effect.apply(game, source) && Zone.EXILED.equals(game.getState().getZone(card.getId()))) { + if (card != null && effect.apply(game, source) && game.getState().getZone(card.getId()) == Zone.EXILED) { boolean hasSuspend = card.getAbilities().containsClass(SuspendAbility.class); UUID exileId = SuspendAbility.getSuspendExileId(controller.getId(), game); if (controller.moveCardToExileWithInfo(card, exileId, "Suspended cards of " + controller.getLogName(), source.getSourceId(), game, Zone.HAND, true)) { diff --git a/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java b/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java index 61b5ae669e..326b6be9e9 100644 --- a/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java +++ b/Mage.Sets/src/mage/cards/d/DereviEmpyrialTactician.java @@ -139,7 +139,7 @@ class DereviEmpyrialTacticianTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean canActivate(UUID playerId, Game game) { Zone currentZone = game.getState().getZone(this.getSourceId()); - if (currentZone == null || !currentZone.equals(Zone.COMMAND)) { + if (currentZone == null || currentZone != Zone.COMMAND) { return false; } return super.canActivate(playerId, game); diff --git a/Mage.Sets/src/mage/cards/d/DescentIntoMadness.java b/Mage.Sets/src/mage/cards/d/DescentIntoMadness.java index 1a6db47f33..d2bcc20378 100644 --- a/Mage.Sets/src/mage/cards/d/DescentIntoMadness.java +++ b/Mage.Sets/src/mage/cards/d/DescentIntoMadness.java @@ -130,7 +130,7 @@ class DescentIntoMadnessEffect extends OneShotEffect { // move permanents and hand cards to exile for (UUID objectId : selectedObjects) { - if (game.getState().getZone(objectId).equals(Zone.BATTLEFIELD)) { + if (game.getState().getZone(objectId) == Zone.BATTLEFIELD) { Permanent permanent = game.getPermanent(objectId); if (permanent != null) { Player player = game.getPlayer(permanent.getControllerId()); @@ -138,7 +138,7 @@ class DescentIntoMadnessEffect extends OneShotEffect { player.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); } } - } else if (game.getState().getZone(objectId).equals(Zone.HAND)) { + } else if (game.getState().getZone(objectId) == Zone.HAND) { Card card = game.getCard(objectId); if (card != null) { Player player = game.getPlayer(card.getOwnerId()); diff --git a/Mage.Sets/src/mage/cards/d/DoublingSeason.java b/Mage.Sets/src/mage/cards/d/DoublingSeason.java index 29126779fc..72a86fd92c 100644 --- a/Mage.Sets/src/mage/cards/d/DoublingSeason.java +++ b/Mage.Sets/src/mage/cards/d/DoublingSeason.java @@ -85,7 +85,7 @@ class DoublingSeasonTokenEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.CREATE_TOKEN); + return event.getType() == GameEvent.EventType.CREATE_TOKEN; } @Override diff --git a/Mage.Sets/src/mage/cards/d/DraconicRoar.java b/Mage.Sets/src/mage/cards/d/DraconicRoar.java index 8f81c6b892..1ce30c3c26 100644 --- a/Mage.Sets/src/mage/cards/d/DraconicRoar.java +++ b/Mage.Sets/src/mage/cards/d/DraconicRoar.java @@ -75,7 +75,7 @@ public class DraconicRoar extends CardImpl { @Override public void adjustCosts(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { Player controller = game.getPlayer(ability.getControllerId()); if (controller != null) { if (controller.getHand().count(filter, game) > 0) { diff --git a/Mage.Sets/src/mage/cards/d/DralnusPet.java b/Mage.Sets/src/mage/cards/d/DralnusPet.java index 943197b875..ba5aa71a8e 100644 --- a/Mage.Sets/src/mage/cards/d/DralnusPet.java +++ b/Mage.Sets/src/mage/cards/d/DralnusPet.java @@ -111,7 +111,7 @@ class DralnusPetEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null && source.getAbilityType().equals(AbilityType.STATIC)) { + if (permanent == null && source.getAbilityType() == AbilityType.STATIC) { permanent = game.getPermanentEntering(source.getSourceId()); } if (controller != null && permanent != null) { diff --git a/Mage.Sets/src/mage/cards/e/EchoBaseCommando.java b/Mage.Sets/src/mage/cards/e/EchoBaseCommando.java index eb3667d2a4..835979e482 100644 --- a/Mage.Sets/src/mage/cards/e/EchoBaseCommando.java +++ b/Mage.Sets/src/mage/cards/e/EchoBaseCommando.java @@ -118,7 +118,7 @@ class EchoBaseCommandoEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { + if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED || (abilityToModify.getAbilityType() == AbilityType.MANA && (abilityToModify instanceof ActivatedAbility))) { Permanent permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null && filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { return true; diff --git a/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java b/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java index 17cad69fb1..03bee79302 100644 --- a/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java +++ b/Mage.Sets/src/mage/cards/e/EliminateTheCompetition.java @@ -66,7 +66,7 @@ public class EliminateTheCompetition extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { ability.getTargets().clear(); int sac = new GetXValue().calculate(game, ability, null); ability.addTarget(new TargetCreaturePermanent(sac, sac)); diff --git a/Mage.Sets/src/mage/cards/e/EndlessWhispers.java b/Mage.Sets/src/mage/cards/e/EndlessWhispers.java index 547b3a252b..36e78b8071 100644 --- a/Mage.Sets/src/mage/cards/e/EndlessWhispers.java +++ b/Mage.Sets/src/mage/cards/e/EndlessWhispers.java @@ -99,7 +99,7 @@ class ReturnSourceToBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if (!game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(source.getSourceId()) != Zone.GRAVEYARD) { return false; } Card card = game.getCard(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/e/Epochrasite.java b/Mage.Sets/src/mage/cards/e/Epochrasite.java index c29abb4ae6..eb59197334 100644 --- a/Mage.Sets/src/mage/cards/e/Epochrasite.java +++ b/Mage.Sets/src/mage/cards/e/Epochrasite.java @@ -105,7 +105,7 @@ class EpochrasiteEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(source.getSourceId()); if (controller != null && card != null) { - if (game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { UUID exileId = SuspendAbility.getSuspendExileId(controller.getId(), game); controller.moveCardToExileWithInfo(card, exileId, "Suspended cards of " + controller.getName(), source.getSourceId(), game, Zone.GRAVEYARD, true); card.addCounters(CounterType.TIME.createInstance(3), source, game); diff --git a/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java b/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java index cb5e23abe4..399844735b 100644 --- a/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java +++ b/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java @@ -85,7 +85,7 @@ class ErdwalIlluminatorTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.INVESTIGATED); + return event.getType() == EventType.INVESTIGATED; } @Override @@ -124,7 +124,7 @@ class InvestigatedWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (EventType.INVESTIGATED.equals(event.getType())) { + if (event.getType() == EventType.INVESTIGATED) { if (!timesInvestigated.containsKey(event.getPlayerId())) { timesInvestigated.put(event.getPlayerId(), 1); } else { diff --git a/Mage.Sets/src/mage/cards/e/ErebossTitan.java b/Mage.Sets/src/mage/cards/e/ErebossTitan.java index ba7979ec08..e3ebee7f1d 100644 --- a/Mage.Sets/src/mage/cards/e/ErebossTitan.java +++ b/Mage.Sets/src/mage/cards/e/ErebossTitan.java @@ -114,7 +114,7 @@ class ErebossTitanTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone().equals(Zone.GRAVEYARD)) { + if (zEvent.getFromZone() == Zone.GRAVEYARD) { Card card = game.getCard(zEvent.getTargetId()); Player controller = game.getPlayer(getControllerId()); return card != null diff --git a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java index 962a277092..6ad2bbcbc1 100644 --- a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java +++ b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java @@ -143,7 +143,7 @@ class ExtraplanarLensTriggeredAbility extends TriggeredManaAbility { && !extraplanarLens.getImprinted().isEmpty()) { Card imprinted = game.getCard(extraplanarLens.getImprinted().get(0)); if (imprinted != null - && game.getState().getZone(imprinted.getId()).equals(Zone.EXILED)) { + && game.getState().getZone(imprinted.getId()) == Zone.EXILED) { if (landTappedForMana.getName().equals(imprinted.getName()) && landTappedForMana.getCardType().contains(CardType.LAND)) { ManaEvent mEvent = (ManaEvent) event; diff --git a/Mage.Sets/src/mage/cards/f/FactOrFiction.java b/Mage.Sets/src/mage/cards/f/FactOrFiction.java index 1bc2dc39e8..47499ae08c 100644 --- a/Mage.Sets/src/mage/cards/f/FactOrFiction.java +++ b/Mage.Sets/src/mage/cards/f/FactOrFiction.java @@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.UUID; + import mage.MageObject; import mage.constants.CardType; import mage.constants.Outcome; @@ -48,13 +49,12 @@ import mage.players.Player; import mage.target.TargetCard; /** - * * @author North */ public class FactOrFiction extends CardImpl { public FactOrFiction(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}"); // Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard. this.getSpellAbility().addEffect(new FactOrFictionEffect()); @@ -115,9 +115,9 @@ class FactOrFictionEffect extends OneShotEffect { } List pile2 = new ArrayList<>(); pile2.addAll(cards.getCards(game)); - - boolean choice = controller.choosePile(outcome, "Choose a pile to put into your hand.", pile1, pile2, game); - + + boolean choice = controller.choosePile(outcome, "Choose a pile to put into your hand.", pile1, pile2, game); + Zone pile1Zone = Zone.GRAVEYARD; Zone pile2Zone = Zone.HAND; if (choice) { @@ -125,21 +125,21 @@ class FactOrFictionEffect extends OneShotEffect { pile2Zone = Zone.GRAVEYARD; } - StringBuilder sb = new StringBuilder("Pile 1, going to ").append(pile1Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (": "); + StringBuilder sb = new StringBuilder("Pile 1, going to ").append(pile1Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(": "); int i = 0; for (Card card : pile1) { i++; - sb.append(card.getName()); + sb.append(card.getName()); if (i < pile1.size()) { - sb.append(", "); + sb.append(", "); } card.moveToZone(pile1Zone, source.getSourceId(), game, false); } game.informPlayers(sb.toString()); - sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':'); + sb = new StringBuilder("Pile 2, going to ").append(pile2Zone == Zone.HAND ? "Hand" : "Graveyard").append(':'); i = 0; - for (Card card: pile2) { + for (Card card : pile2) { i++; sb.append(' ').append(card.getName()); if (i < pile2.size()) { diff --git a/Mage.Sets/src/mage/cards/f/FellShepherd.java b/Mage.Sets/src/mage/cards/f/FellShepherd.java index 4fab1fb1c5..0eb3fa2ac5 100644 --- a/Mage.Sets/src/mage/cards/f/FellShepherd.java +++ b/Mage.Sets/src/mage/cards/f/FellShepherd.java @@ -155,7 +155,7 @@ class FellShepherdEffect extends OneShotEffect { if (watcher != null) { StringBuilder sb = new StringBuilder(); for (UUID creatureId : watcher.getCreaturesIds()) { - if (game.getState().getZone(creatureId).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(creatureId) == Zone.GRAVEYARD) { Card card = game.getCard(creatureId); if (card != null) { card.moveToZone(Zone.HAND, source.getSourceId(), game, false); diff --git a/Mage.Sets/src/mage/cards/f/FireServant.java b/Mage.Sets/src/mage/cards/f/FireServant.java index bd24ad9bae..eec81b8f1a 100644 --- a/Mage.Sets/src/mage/cards/f/FireServant.java +++ b/Mage.Sets/src/mage/cards/f/FireServant.java @@ -89,9 +89,9 @@ class FireServantEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || + event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER || + event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/f/FiremaneAngel.java b/Mage.Sets/src/mage/cards/f/FiremaneAngel.java index 04b8f6dd4c..b6f8f19e17 100644 --- a/Mage.Sets/src/mage/cards/f/FiremaneAngel.java +++ b/Mage.Sets/src/mage/cards/f/FiremaneAngel.java @@ -96,8 +96,8 @@ class SourceOnBattelfieldOrGraveyardCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD) - || game.getState().getZone(source.getSourceId()).equals(Zone.BATTLEFIELD)); + return game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD + || game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD; } @Override diff --git a/Mage.Sets/src/mage/cards/f/Fluctuator.java b/Mage.Sets/src/mage/cards/f/Fluctuator.java index 85b8cbc4ed..707257c60c 100644 --- a/Mage.Sets/src/mage/cards/f/Fluctuator.java +++ b/Mage.Sets/src/mage/cards/f/Fluctuator.java @@ -102,7 +102,7 @@ class FluctuatorEffect extends CostModificationEffectImpl { } if (reduceMax > 0) { int reduce = 0; - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) + if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED && ((ActivatedAbility) abilityToModify).isCheckPlayableMode()) { reduce = reduceMax; } else { diff --git a/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java b/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java index 98ba8cb3b3..1461b35269 100644 --- a/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java +++ b/Mage.Sets/src/mage/cards/f/FoeRazerRegent.java @@ -110,7 +110,7 @@ class FoeRazerRegentTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.FIGHTED_PERMANENT); + return event.getType() == EventType.FIGHTED_PERMANENT; } @Override diff --git a/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java b/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java index c007c7f997..d55a933fed 100644 --- a/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java +++ b/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java @@ -76,7 +76,7 @@ public class FoulTongueInvocation extends CardImpl { @Override public void adjustCosts(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { Player controller = game.getPlayer(ability.getControllerId()); if (controller != null) { if (controller.getHand().count(filter, game) > 0) { diff --git a/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java b/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java index ee1bc2c82c..1838010f4b 100644 --- a/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java +++ b/Mage.Sets/src/mage/cards/g/GhostlyFlicker.java @@ -112,7 +112,7 @@ class GhostlyFlickerEffect extends OneShotEffect { Set toBattlefield = new HashSet<>(); for (Card card : toExile) { Zone currentZone = game.getState().getZone(card.getId()); - if (!Zone.BATTLEFIELD.equals(currentZone) && Zone.isPublicZone(currentZone)) { + if (!(Zone.BATTLEFIELD == currentZone) && Zone.isPublicZone(currentZone)) { toBattlefield.add(game.getCard(card.getId())); } } diff --git a/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java b/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java index 10467d03d1..7861dc84fa 100644 --- a/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java +++ b/Mage.Sets/src/mage/cards/g/GiselaBladeOfGoldnight.java @@ -28,6 +28,7 @@ package mage.cards.g; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -46,13 +47,12 @@ import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** - * * @author noxx */ public class GiselaBladeOfGoldnight extends CardImpl { public GiselaBladeOfGoldnight(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{W}{W}"); this.supertype.add("Legendary"); this.subtype.add("Angel"); @@ -82,7 +82,7 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl { public GiselaBladeOfGoldnightDoubleDamageEffect() { super(Duration.WhileOnBattlefield, Outcome.Damage); staticText = "If a source would deal damage to an opponent or a permanent an opponent controls, that source deals double that damage to that player or permanent instead." - + "If a source would deal damage to you or a permanent you control, prevent half that damage, rounded up"; + + "If a source would deal damage to you or a permanent you control, prevent half that damage, rounded up"; } public GiselaBladeOfGoldnightDoubleDamageEffect(final GiselaBladeOfGoldnightDoubleDamageEffect effect) { @@ -96,9 +96,9 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.DAMAGE_CREATURE) || - event.getType().equals(EventType.DAMAGE_PLANESWALKER) || - event.getType().equals(EventType.DAMAGE_PLAYER); + return event.getType() == EventType.DAMAGE_CREATURE || + event.getType() == EventType.DAMAGE_PLANESWALKER || + event.getType() == EventType.DAMAGE_PLAYER; } @@ -108,7 +108,7 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl { } private void preventDamage(GameEvent event, Ability source, UUID target, Game game) { - int amount = (int)Math.ceil(event.getAmount() / 2.0); + int amount = (int) Math.ceil(event.getAmount() / 2.0); GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getSourceId(), source.getControllerId(), amount, false); if (!game.replaceEvent(preventEvent)) { event.setAmount(event.getAmount() - amount); diff --git a/Mage.Sets/src/mage/cards/g/Gloom.java b/Mage.Sets/src/mage/cards/g/Gloom.java index 5b20b683d2..f70e852c7c 100644 --- a/Mage.Sets/src/mage/cards/g/Gloom.java +++ b/Mage.Sets/src/mage/cards/g/Gloom.java @@ -98,7 +98,7 @@ class GloomCostIncreaseEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { boolean isWhiteEnchantment = false; - boolean isActivated = abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED); + boolean isActivated = abilityToModify.getAbilityType() == AbilityType.ACTIVATED; if (isActivated) { MageObject permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null) { diff --git a/Mage.Sets/src/mage/cards/g/GoldnightCastigator.java b/Mage.Sets/src/mage/cards/g/GoldnightCastigator.java index dbf15ff4b9..8ac451994e 100644 --- a/Mage.Sets/src/mage/cards/g/GoldnightCastigator.java +++ b/Mage.Sets/src/mage/cards/g/GoldnightCastigator.java @@ -97,8 +97,8 @@ class GoldnightCastigatorDoubleDamageEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.DAMAGE_CREATURE) || - event.getType().equals(EventType.DAMAGE_PLAYER); + return event.getType() == EventType.DAMAGE_CREATURE || + event.getType() == EventType.DAMAGE_PLAYER; } diff --git a/Mage.Sets/src/mage/cards/g/GroundSeal.java b/Mage.Sets/src/mage/cards/g/GroundSeal.java index 9b92ff06e3..2a698d5365 100644 --- a/Mage.Sets/src/mage/cards/g/GroundSeal.java +++ b/Mage.Sets/src/mage/cards/g/GroundSeal.java @@ -28,6 +28,7 @@ package mage.cards.g; import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -45,18 +46,17 @@ import mage.game.events.GameEvent; import mage.game.stack.StackObject; /** - * * @author jeffwadsworth */ public class GroundSeal extends CardImpl { public GroundSeal(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); // When Ground Seal enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); - + // Cards in graveyards can't be the targets of spells or abilities. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GroundSealEffect())); } @@ -96,10 +96,10 @@ class GroundSealEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.TARGET) { Card targetCard = game.getCard(event.getTargetId()); - StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId()); + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); if (targetCard != null && stackObject != null) { Zone zone = game.getState().getZone(targetCard.getId()); - if (zone != null && zone.equals(Zone.GRAVEYARD)) { + if (zone != null && zone == Zone.GRAVEYARD) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GryffsBoon.java b/Mage.Sets/src/mage/cards/g/GryffsBoon.java index 406ce1620c..a80c666b04 100644 --- a/Mage.Sets/src/mage/cards/g/GryffsBoon.java +++ b/Mage.Sets/src/mage/cards/g/GryffsBoon.java @@ -107,7 +107,7 @@ class GryffsBoonEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Card aura = game.getCard(source.getSourceId()); if (aura != null - && game.getState().getZone(aura.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(aura.getId()) == Zone.GRAVEYARD) { Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (!targetPermanent.cantBeAttachedBy(aura, game)) { game.getState().setValue("attachTo:" + aura.getId(), targetPermanent); diff --git a/Mage.Sets/src/mage/cards/g/GuardianSeraph.java b/Mage.Sets/src/mage/cards/g/GuardianSeraph.java index 2904afa166..eed36159d0 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianSeraph.java +++ b/Mage.Sets/src/mage/cards/g/GuardianSeraph.java @@ -83,7 +83,7 @@ class GuardianSeraphEffect extends PreventionEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/h/HarshJudgment.java b/Mage.Sets/src/mage/cards/h/HarshJudgment.java index e0937bcaee..01656a55b0 100755 --- a/Mage.Sets/src/mage/cards/h/HarshJudgment.java +++ b/Mage.Sets/src/mage/cards/h/HarshJudgment.java @@ -91,7 +91,7 @@ class HarshJudgmentEffect extends RedirectionEffect { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/h/HarvestHand.java b/Mage.Sets/src/mage/cards/h/HarvestHand.java index 4aa010a41e..fd9661dc5e 100644 --- a/Mage.Sets/src/mage/cards/h/HarvestHand.java +++ b/Mage.Sets/src/mage/cards/h/HarvestHand.java @@ -93,7 +93,7 @@ class HarvestHandReturnTransformedEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); Card card = game.getCard(source.getSourceId()); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/h/Heartstone.java b/Mage.Sets/src/mage/cards/h/Heartstone.java index 1b466ef75d..ee67ca3798 100644 --- a/Mage.Sets/src/mage/cards/h/Heartstone.java +++ b/Mage.Sets/src/mage/cards/h/Heartstone.java @@ -99,8 +99,8 @@ class HeartstoneEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) - || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { + if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED + || (abilityToModify.getAbilityType() == AbilityType.MANA && (abilityToModify instanceof ActivatedAbility))) { // Activated abilities of creatures Permanent permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null && filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java b/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java index a37a419f03..0c48d4fa07 100644 --- a/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java +++ b/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java @@ -108,12 +108,12 @@ class HedronFieldPuristsEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER && event.getTargetId().equals(source.getControllerId())) { return super.applies(event, source, game); } - if (event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)) { + if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { return super.applies(event, source, game); diff --git a/Mage.Sets/src/mage/cards/h/HelmOfObedience.java b/Mage.Sets/src/mage/cards/h/HelmOfObedience.java index a360a1bf0c..ea51d3f18c 100644 --- a/Mage.Sets/src/mage/cards/h/HelmOfObedience.java +++ b/Mage.Sets/src/mage/cards/h/HelmOfObedience.java @@ -113,7 +113,7 @@ class HelmOfObedienceEffect extends OneShotEffect { if (sourcePermanent != null) { sourcePermanent.sacrifice(source.getSourceId(), game); } - if (game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); } break; diff --git a/Mage.Sets/src/mage/cards/h/HushwingGryff.java b/Mage.Sets/src/mage/cards/h/HushwingGryff.java index a1a2797ed8..5327817932 100644 --- a/Mage.Sets/src/mage/cards/h/HushwingGryff.java +++ b/Mage.Sets/src/mage/cards/h/HushwingGryff.java @@ -107,7 +107,7 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Ability ability = (Ability) getValue("targetAbility"); - if (ability != null && AbilityType.TRIGGERED.equals(ability.getAbilityType())) { + if (ability != null && ability.getAbilityType() == AbilityType.TRIGGERED) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java index 15a199ff09..8d0754973b 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java @@ -146,8 +146,8 @@ class IllusionistsGambitRequirementEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - if (game.getTurn().getStepType().equals(PhaseStep.END_COMBAT)) { - if (!game.getTurn().getPhase().equals(phase)) { + if (game.getTurn().getStepType() == PhaseStep.END_COMBAT) { + if (game.getTurn().getPhase() != phase) { return true; } } @@ -190,8 +190,8 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect { @Override public boolean isInactive(Ability source, Game game) { - if (game.getTurn().getStepType().equals(PhaseStep.END_COMBAT)) { - if (!game.getTurn().getPhase().equals(phase)) { + if (game.getTurn().getStepType() == PhaseStep.END_COMBAT) { + if (game.getTurn().getPhase() != phase) { return true; } } diff --git a/Mage.Sets/src/mage/cards/i/InquisitorsFlail.java b/Mage.Sets/src/mage/cards/i/InquisitorsFlail.java index e58b2dee9b..fcc6e67ef2 100644 --- a/Mage.Sets/src/mage/cards/i/InquisitorsFlail.java +++ b/Mage.Sets/src/mage/cards/i/InquisitorsFlail.java @@ -91,9 +91,9 @@ class InquisitorsFlailEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || + event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER || + event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/j/JacesMindseeker.java b/Mage.Sets/src/mage/cards/j/JacesMindseeker.java index c4d89b23ff..e23e7587b5 100644 --- a/Mage.Sets/src/mage/cards/j/JacesMindseeker.java +++ b/Mage.Sets/src/mage/cards/j/JacesMindseeker.java @@ -115,7 +115,7 @@ class JaceMindseekerEffect extends OneShotEffect { Zone zone = game.getState().getZone(card.getId()); // If the five cards are put into a public zone such as exile instead of a graveyard (perhaps due to the ability of Rest in Peace), // you can cast one of those instant or sorcery cards from that zone. - if (zone.equals(Zone.GRAVEYARD) || zone.equals(Zone.EXILED)) { + if (zone == Zone.GRAVEYARD || zone == Zone.EXILED) { cardsToCast.add(card); } } diff --git a/Mage.Sets/src/mage/cards/j/JotunGrunt.java b/Mage.Sets/src/mage/cards/j/JotunGrunt.java index 0066a2e301..025eac7b28 100644 --- a/Mage.Sets/src/mage/cards/j/JotunGrunt.java +++ b/Mage.Sets/src/mage/cards/j/JotunGrunt.java @@ -90,7 +90,7 @@ class JotunGruntCost extends CostImpl { if (targets.choose(Outcome.Removal, controllerId, sourceId, game)) { for (UUID targetId: targets.get(0).getTargets()) { Card card = game.getCard(targetId); - if (card == null || !game.getState().getZone(targetId).equals(Zone.GRAVEYARD)) { + if (card == null || game.getState().getZone(targetId) != Zone.GRAVEYARD) { return false; } paid |= controller.moveCardToLibraryWithInfo(card, sourceId, game, Zone.GRAVEYARD, false, true); diff --git a/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java b/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java index 4c1e810005..072fd8f1ce 100644 --- a/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java +++ b/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java @@ -127,7 +127,7 @@ class KalitasTraitorOfGhetEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { + if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null) { controller.moveCards(permanent, Zone.EXILED, source, game); diff --git a/Mage.Sets/src/mage/cards/k/KothophedSoulHoarder.java b/Mage.Sets/src/mage/cards/k/KothophedSoulHoarder.java index 5bff447237..2831cec1d7 100644 --- a/Mage.Sets/src/mage/cards/k/KothophedSoulHoarder.java +++ b/Mage.Sets/src/mage/cards/k/KothophedSoulHoarder.java @@ -115,7 +115,7 @@ class KothophedSoulHoarderTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone().equals(Zone.GRAVEYARD) && zEvent.getFromZone().equals(Zone.BATTLEFIELD)) { + if (zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD) { Card card = game.getCard(zEvent.getTargetId()); Player controller = game.getPlayer(getControllerId()); return card != null && controller != null && controller.hasOpponent(card.getOwnerId(), game); diff --git a/Mage.Sets/src/mage/cards/l/LeylineOfTheVoid.java b/Mage.Sets/src/mage/cards/l/LeylineOfTheVoid.java index a92a22aca3..ac38c1d3cd 100644 --- a/Mage.Sets/src/mage/cards/l/LeylineOfTheVoid.java +++ b/Mage.Sets/src/mage/cards/l/LeylineOfTheVoid.java @@ -29,6 +29,7 @@ package mage.cards.l; import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; @@ -48,13 +49,12 @@ import mage.game.permanent.Permanent; import mage.players.Player; /** - * * @author BetaSteward_at_googlemail.com */ public class LeylineOfTheVoid extends CardImpl { public LeylineOfTheVoid(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); // If Leyline of the Void is in your opening hand, you may begin the game with it on the battlefield. this.addAbility(LeylineAbility.getInstance()); @@ -93,30 +93,29 @@ class LeylineOfTheVoidEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (((ZoneChangeEvent)event).getFromZone().equals(Zone.BATTLEFIELD)) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null) { return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); } - } - else { + } else { Card card = game.getCard(event.getTargetId()); if (card != null) { - return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent)event).getFromZone(), true); + return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone(), true); } } } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ZONE_CHANGE; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) { + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { return true; diff --git a/Mage.Sets/src/mage/cards/l/LibraryOfLeng.java b/Mage.Sets/src/mage/cards/l/LibraryOfLeng.java index 9936bb326f..7a9dfe0c2b 100644 --- a/Mage.Sets/src/mage/cards/l/LibraryOfLeng.java +++ b/Mage.Sets/src/mage/cards/l/LibraryOfLeng.java @@ -99,18 +99,18 @@ class LibraryOfLengEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.DISCARD_CARD) - || event.getType().equals(EventType.ZONE_CHANGE); + return event.getType() == EventType.DISCARD_CARD + || event.getType() == EventType.ZONE_CHANGE; } @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(EventType.DISCARD_CARD)) { + if (event.getType() == EventType.DISCARD_CARD) { return event.getPlayerId().equals(source.getControllerId()); } - if (event.getType().equals(EventType.ZONE_CHANGE)) { + if (event.getType() == EventType.ZONE_CHANGE) { if (event.getTargetId().equals(cardId) && game.getState().getZoneChangeCounter(event.getTargetId()) == zoneChangeCounter) { - if (((ZoneChangeEvent) event).getFromZone().equals(Zone.HAND) && ((ZoneChangeEvent) event).getToZone().equals(Zone.GRAVEYARD)) { + if (((ZoneChangeEvent) event).getFromZone() == Zone.HAND && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { return true; } } @@ -120,7 +120,7 @@ class LibraryOfLengEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if (event.getType().equals(EventType.DISCARD_CARD)) { + if (event.getType() == EventType.DISCARD_CARD) { // only save card info Card card = game.getCard(event.getTargetId()); if (card != null) { @@ -129,7 +129,7 @@ class LibraryOfLengEffect extends ReplacementEffectImpl { } return false; } - if (event.getType().equals(EventType.ZONE_CHANGE)) { + if (event.getType() == EventType.ZONE_CHANGE) { Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(event.getTargetId()); if (controller != null && card != null) { diff --git a/Mage.Sets/src/mage/cards/l/Lich.java b/Mage.Sets/src/mage/cards/l/Lich.java index 96a08a6687..eb03dd6a21 100644 --- a/Mage.Sets/src/mage/cards/l/Lich.java +++ b/Mage.Sets/src/mage/cards/l/Lich.java @@ -119,7 +119,7 @@ class LichLifeGainReplacementEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.GAIN_LIFE); + return event.getType() == EventType.GAIN_LIFE; } @Override diff --git a/Mage.Sets/src/mage/cards/l/LifeDeath.java b/Mage.Sets/src/mage/cards/l/LifeDeath.java index e1d361fde3..28f858db07 100644 --- a/Mage.Sets/src/mage/cards/l/LifeDeath.java +++ b/Mage.Sets/src/mage/cards/l/LifeDeath.java @@ -112,7 +112,7 @@ class DeathEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (creatureCard != null && controller != null) { boolean result = false; - if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(creatureCard.getId()) == Zone.GRAVEYARD) { controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game); } controller.loseLife(creatureCard.getConvertedManaCost(), game, false); diff --git a/Mage.Sets/src/mage/cards/l/LightOfSanction.java b/Mage.Sets/src/mage/cards/l/LightOfSanction.java index 31864869a9..9f84c71fe8 100644 --- a/Mage.Sets/src/mage/cards/l/LightOfSanction.java +++ b/Mage.Sets/src/mage/cards/l/LightOfSanction.java @@ -80,7 +80,7 @@ class LightOfSanctionEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)) { + if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { MageObject damageSource = game.getObject(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/l/LongRoadHome.java b/Mage.Sets/src/mage/cards/l/LongRoadHome.java index a3632cf939..1dbb18589f 100644 --- a/Mage.Sets/src/mage/cards/l/LongRoadHome.java +++ b/Mage.Sets/src/mage/cards/l/LongRoadHome.java @@ -173,7 +173,7 @@ class LongRoadHomeEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return EventType.ENTERS_THE_BATTLEFIELD.equals(event.getType()); + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } @Override diff --git a/Mage.Sets/src/mage/cards/l/Luminesce.java b/Mage.Sets/src/mage/cards/l/Luminesce.java index 2e357b7000..75bee45c5c 100644 --- a/Mage.Sets/src/mage/cards/l/Luminesce.java +++ b/Mage.Sets/src/mage/cards/l/Luminesce.java @@ -81,9 +81,9 @@ class LuminescePreventionEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) - || event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) - || event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) { + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER + || event.getType() == GameEvent.EventType.DAMAGE_CREATURE + || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && (sourceObject.getColor(game).shares(ObjectColor.BLACK) || sourceObject.getColor(game).shares(ObjectColor.RED))) { diff --git a/Mage.Sets/src/mage/cards/m/MagewrightsStone.java b/Mage.Sets/src/mage/cards/m/MagewrightsStone.java index bc2ec0b07b..d5b70cb7af 100644 --- a/Mage.Sets/src/mage/cards/m/MagewrightsStone.java +++ b/Mage.Sets/src/mage/cards/m/MagewrightsStone.java @@ -91,7 +91,7 @@ class HasAbilityWithTapSymbolPredicate implements Predicate { } for (Ability ability : abilities) { - if (ability.getAbilityType().equals(AbilityType.ACTIVATED) && !ability.getCosts().isEmpty()) { + if (ability.getAbilityType() == AbilityType.ACTIVATED && !ability.getCosts().isEmpty()) { for (Cost cost : ability.getCosts()) { if (cost instanceof TapSourceCost) { return true; diff --git a/Mage.Sets/src/mage/cards/m/ManaMaze.java b/Mage.Sets/src/mage/cards/m/ManaMaze.java index 0456a4c8a2..84840aa727 100644 --- a/Mage.Sets/src/mage/cards/m/ManaMaze.java +++ b/Mage.Sets/src/mage/cards/m/ManaMaze.java @@ -130,7 +130,7 @@ class LastSpellCastWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (EventType.SPELL_CAST.equals(event.getType())) { + if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell == null) { MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.STACK); diff --git a/Mage.Sets/src/mage/cards/m/MeriekeRiBerit.java b/Mage.Sets/src/mage/cards/m/MeriekeRiBerit.java index 342a0cd410..e900b981d5 100644 --- a/Mage.Sets/src/mage/cards/m/MeriekeRiBerit.java +++ b/Mage.Sets/src/mage/cards/m/MeriekeRiBerit.java @@ -147,13 +147,13 @@ class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId() != null) { - if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - return zEvent.getFromZone().equals(Zone.BATTLEFIELD); + return zEvent.getFromZone() == Zone.BATTLEFIELD; } } - return GameEvent.EventType.UNTAPPED.equals(event.getType()) + return EventType.UNTAPPED == event.getType() && event.getTargetId() != null && event.getTargetId().equals(getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/m/MichikoKondaTruthSeeker.java b/Mage.Sets/src/mage/cards/m/MichikoKondaTruthSeeker.java index 351f0d8225..1f5fe4d38d 100644 --- a/Mage.Sets/src/mage/cards/m/MichikoKondaTruthSeeker.java +++ b/Mage.Sets/src/mage/cards/m/MichikoKondaTruthSeeker.java @@ -86,7 +86,7 @@ class MichikoKondaTruthSeekerAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MinamosMeddling.java b/Mage.Sets/src/mage/cards/m/MinamosMeddling.java index 565026bc11..5aed0d2d4b 100644 --- a/Mage.Sets/src/mage/cards/m/MinamosMeddling.java +++ b/Mage.Sets/src/mage/cards/m/MinamosMeddling.java @@ -102,7 +102,7 @@ class MinamosMeddlingCounterTargetEffect extends OneShotEffect { spellController.revealCards(sourceObject.getName(), spellController.getHand(), game); Cards cardsToDiscard = new CardsImpl(); for (SpellAbility spellAbility : spell.getSpellAbilities()) { - if (spellAbility.getSpellAbilityType().equals(SpellAbilityType.SPLICE)) { + if (spellAbility.getSpellAbilityType() == SpellAbilityType.SPLICE) { for (Card card: spellController.getHand().getCards(game)) { if (card.getName().equals(spellAbility.getCardName())) { cardsToDiscard.add(card); diff --git a/Mage.Sets/src/mage/cards/m/MoxDiamond.java b/Mage.Sets/src/mage/cards/m/MoxDiamond.java index f119c16681..8049ee9423 100644 --- a/Mage.Sets/src/mage/cards/m/MoxDiamond.java +++ b/Mage.Sets/src/mage/cards/m/MoxDiamond.java @@ -127,7 +127,7 @@ class MoxDiamondReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (source.getSourceId().equals(event.getTargetId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if(zEvent.getToZone().equals(Zone.BATTLEFIELD)){ + if(zEvent.getToZone() == Zone.BATTLEFIELD){ return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MysticBarrier.java b/Mage.Sets/src/mage/cards/m/MysticBarrier.java index 453b52b919..d7f4daf8a3 100644 --- a/Mage.Sets/src/mage/cards/m/MysticBarrier.java +++ b/Mage.Sets/src/mage/cards/m/MysticBarrier.java @@ -97,12 +97,12 @@ class MysticBarrierTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.ENTERS_THE_BATTLEFIELD) || event.getType().equals(EventType.UPKEEP_STEP_PRE); + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD || event.getType() == EventType.UPKEEP_STEP_PRE; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.ENTERS_THE_BATTLEFIELD)) { + if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { return event.getTargetId().equals(this.getSourceId()); } else { return event.getPlayerId().equals(this.getControllerId()); @@ -196,7 +196,7 @@ class MysticBarrierReplacementEffect extends ReplacementEffectImpl { } if (defender != null) { PlayerList playerList = game.getState().getPlayerList(event.getPlayerId()); - if (allowedDirection.equals(MysticBarrier.ALLOW_ATTACKING_LEFT)) { + if (allowedDirection == MysticBarrier.ALLOW_ATTACKING_LEFT) { if (!playerList.getNext().equals(defender.getId())) { // the defender is not the player to the left Player attacker = game.getPlayer(event.getPlayerId()); @@ -206,7 +206,7 @@ class MysticBarrierReplacementEffect extends ReplacementEffectImpl { return true; } } - if (allowedDirection.equals(MysticBarrier.ALLOW_ATTACKING_RIGHT)) { + if (allowedDirection == MysticBarrier.ALLOW_ATTACKING_RIGHT) { if (!playerList.getPrevious().equals(defender.getId())) { // the defender is not the player to the right Player attacker = game.getPlayer(event.getPlayerId()); diff --git a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java index a4480cfdbb..190dce6994 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java +++ b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java @@ -153,7 +153,7 @@ class NarsetTranscendentTriggeredAbility 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.getFromZone().equals(Zone.HAND)) { + if (spell != null && spell.getFromZone() == Zone.HAND) { if (spell.getCard() != null && spell.getCard().getCardType().contains(CardType.INSTANT) || spell.getCard().getCardType().contains(CardType.SORCERY)) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/n/NaturesWill.java b/Mage.Sets/src/mage/cards/n/NaturesWill.java index b60c149917..4ba7e84e89 100644 --- a/Mage.Sets/src/mage/cards/n/NaturesWill.java +++ b/Mage.Sets/src/mage/cards/n/NaturesWill.java @@ -108,7 +108,7 @@ class NaturesWillTriggeredAbility extends TriggeredAbilityImpl { damagedPlayers.add(event.getPlayerId()); } } - if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_POST)) { + if (event.getType() == EventType.COMBAT_DAMAGE_STEP_POST) { if (madeDamge) { Set damagedPlayersCopy = new HashSet<>(); damagedPlayersCopy.addAll(damagedPlayers); diff --git a/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java b/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java index e0a8e7450a..fb003ffb31 100644 --- a/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java +++ b/Mage.Sets/src/mage/cards/n/NecromancersMagemark.java @@ -130,13 +130,13 @@ class NecromancersMagemarkEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.ZONE_CHANGE); + return event.getType() == GameEvent.EventType.ZONE_CHANGE; } @Override public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) { + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { for (UUID attachmentId : permanent.getAttachments()) { diff --git a/Mage.Sets/src/mage/cards/n/Necromancy.java b/Mage.Sets/src/mage/cards/n/Necromancy.java index 3525e4b50b..73390856cb 100644 --- a/Mage.Sets/src/mage/cards/n/Necromancy.java +++ b/Mage.Sets/src/mage/cards/n/Necromancy.java @@ -235,7 +235,7 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour @Override public boolean hasLayer(Layer layer) { - return Layer.AbilityAddingRemovingEffects_6.equals(layer) || Layer.TypeChangingEffects_4.equals(layer); + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; } } diff --git a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java index 46b8e15555..a5740d6c7b 100644 --- a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java +++ b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java @@ -108,7 +108,7 @@ class NecromanticSelectionEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, false); - if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) { cards.add(permanent); } } diff --git a/Mage.Sets/src/mage/cards/n/NefariousLich.java b/Mage.Sets/src/mage/cards/n/NefariousLich.java index b9c77b2695..9789037b8a 100644 --- a/Mage.Sets/src/mage/cards/n/NefariousLich.java +++ b/Mage.Sets/src/mage/cards/n/NefariousLich.java @@ -163,7 +163,7 @@ class NefariousLichLifeGainReplacementEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.GAIN_LIFE); + return event.getType() == EventType.GAIN_LIFE; } @Override diff --git a/Mage.Sets/src/mage/cards/n/NephaliaAcademy.java b/Mage.Sets/src/mage/cards/n/NephaliaAcademy.java index 9202593b52..d286ecaf79 100644 --- a/Mage.Sets/src/mage/cards/n/NephaliaAcademy.java +++ b/Mage.Sets/src/mage/cards/n/NephaliaAcademy.java @@ -98,18 +98,18 @@ class NephaliaAcademyEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DISCARD_CARD) - || event.getType().equals(GameEvent.EventType.ZONE_CHANGE); + return event.getType() == GameEvent.EventType.DISCARD_CARD + || event.getType() == GameEvent.EventType.ZONE_CHANGE; } @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.DISCARD_CARD)) { + if (event.getType() == GameEvent.EventType.DISCARD_CARD) { return event.getPlayerId().equals(source.getControllerId()); } - if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE)) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { if (event.getTargetId().equals(cardId) && game.getState().getZoneChangeCounter(event.getTargetId()) == zoneChangeCounter) { - if (((ZoneChangeEvent) event).getFromZone().equals(Zone.HAND) && ((ZoneChangeEvent) event).getToZone().equals(Zone.GRAVEYARD)) { + if (((ZoneChangeEvent) event).getFromZone() == Zone.HAND && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { return true; } } @@ -119,7 +119,7 @@ class NephaliaAcademyEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if (event.getType().equals(GameEvent.EventType.DISCARD_CARD)) { + if (event.getType() == GameEvent.EventType.DISCARD_CARD) { // only save card info if it's an opponent effect Card card = game.getCard(event.getTargetId()); if (card != null) { @@ -142,7 +142,7 @@ class NephaliaAcademyEffect extends ReplacementEffectImpl { } return false; } - if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE)) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(event.getTargetId()); if (controller != null && card != null) { diff --git a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java index 8b53dab95e..4be71a5277 100644 --- a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java +++ b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java @@ -158,7 +158,7 @@ class NimDeathmantleEffect extends OneShotEffect { if (target != null) { Card card = game.getCard(target); // check if it's still in graveyard - if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { diff --git a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java index 78f3bb15fc..f720abb563 100644 --- a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java +++ b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java @@ -140,6 +140,6 @@ class NivixAerieOfTheFiremindCanCastEffect extends AsThoughEffectImpl { return this.getTargetPointer().getFirst(game, source) != null && this.getTargetPointer().getFirst(game, source).equals(sourceId) && source.getControllerId().equals(affectedControllerId) - && game.getState().getZone(sourceId).equals(Zone.EXILED); + && game.getState().getZone(sourceId) == Zone.EXILED; } } diff --git a/Mage.Sets/src/mage/cards/o/OathOfChandra.java b/Mage.Sets/src/mage/cards/o/OathOfChandra.java index 40cf6aa26b..351c11d8a9 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfChandra.java +++ b/Mage.Sets/src/mage/cards/o/OathOfChandra.java @@ -128,7 +128,7 @@ class OathOfChandraWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone().equals(Zone.BATTLEFIELD) + if (zEvent.getToZone() == Zone.BATTLEFIELD && zEvent.getTarget().getCardType().contains(CardType.PLANESWALKER)) { players.add(zEvent.getTarget().getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java index d7d51dce1c..ad8cd450fd 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java +++ b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java @@ -119,7 +119,7 @@ class OathOfLilianaWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone().equals(Zone.BATTLEFIELD) + if (zEvent.getToZone() == Zone.BATTLEFIELD && zEvent.getTarget().getCardType().contains(CardType.PLANESWALKER)) { players.add(zEvent.getTarget().getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/o/OngoingInvestigation.java b/Mage.Sets/src/mage/cards/o/OngoingInvestigation.java index 56b8527f32..92d436a4e3 100644 --- a/Mage.Sets/src/mage/cards/o/OngoingInvestigation.java +++ b/Mage.Sets/src/mage/cards/o/OngoingInvestigation.java @@ -116,7 +116,7 @@ class OngoingInvestigationTriggeredAbility extends TriggeredAbilityImpl { damagedPlayers.add(event.getPlayerId()); } } - if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_POST)) { + if (event.getType() == EventType.COMBAT_DAMAGE_STEP_POST) { if (madeDamage) { Set damagedPlayersCopy = new HashSet<>(); damagedPlayersCopy.addAll(damagedPlayers); diff --git a/Mage.Sets/src/mage/cards/o/OpalEyeKondasYojimbo.java b/Mage.Sets/src/mage/cards/o/OpalEyeKondasYojimbo.java index afe05f31ff..4f2ae6ad1a 100644 --- a/Mage.Sets/src/mage/cards/o/OpalEyeKondasYojimbo.java +++ b/Mage.Sets/src/mage/cards/o/OpalEyeKondasYojimbo.java @@ -115,9 +115,9 @@ class OpalEyeKondasYojimboRedirectionEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE ) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER ) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER ); + return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || + event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER || + event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/o/OratorOfOjutai.java b/Mage.Sets/src/mage/cards/o/OratorOfOjutai.java index dead549d7d..d6bc753316 100644 --- a/Mage.Sets/src/mage/cards/o/OratorOfOjutai.java +++ b/Mage.Sets/src/mage/cards/o/OratorOfOjutai.java @@ -84,7 +84,7 @@ public class OratorOfOjutai extends CardImpl { @Override public void adjustCosts(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { Player controller = game.getPlayer(ability.getControllerId()); if (controller != null) { if (controller.getHand().count(filter, game) > 0) { diff --git a/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java b/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java index 566f7e30d0..ef2e8b44e9 100644 --- a/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java +++ b/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java @@ -81,7 +81,7 @@ class OrbsOfWardingEffect extends PreventionEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/o/OrimsChant.java b/Mage.Sets/src/mage/cards/o/OrimsChant.java index df5ab3c060..0991b1416d 100644 --- a/Mage.Sets/src/mage/cards/o/OrimsChant.java +++ b/Mage.Sets/src/mage/cards/o/OrimsChant.java @@ -94,7 +94,7 @@ class OrimsChantCantCastEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return GameEvent.EventType.CAST_SPELL.equals(event.getType()); + return event.getType() == GameEvent.EventType.CAST_SPELL; } @Override diff --git a/Mage.Sets/src/mage/cards/o/Overblaze.java b/Mage.Sets/src/mage/cards/o/Overblaze.java index e3a276b82d..056099b752 100644 --- a/Mage.Sets/src/mage/cards/o/Overblaze.java +++ b/Mage.Sets/src/mage/cards/o/Overblaze.java @@ -86,8 +86,8 @@ class FireServantEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || + event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/p/ParallelLives.java b/Mage.Sets/src/mage/cards/p/ParallelLives.java index 196687d51c..558a58d56a 100644 --- a/Mage.Sets/src/mage/cards/p/ParallelLives.java +++ b/Mage.Sets/src/mage/cards/p/ParallelLives.java @@ -83,7 +83,7 @@ class ParallelLivesEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.CREATE_TOKEN); + return event.getType() == EventType.CREATE_TOKEN; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PhantomNantuko.java b/Mage.Sets/src/mage/cards/p/PhantomNantuko.java index 88eeac6385..fd1898d446 100644 --- a/Mage.Sets/src/mage/cards/p/PhantomNantuko.java +++ b/Mage.Sets/src/mage/cards/p/PhantomNantuko.java @@ -118,7 +118,7 @@ class PhantomNantukoPreventionEffect extends PreventionEffectImpl { if (permanent != null) { boolean removeCounter = true; // check if in the same combat damage step already a counter was removed - if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) { + if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) { if (game.getTurnNum() == turn && game.getTurn().getStep().equals(combatPhaseStep)) { removeCounter = false; diff --git a/Mage.Sets/src/mage/cards/p/PhantomTiger.java b/Mage.Sets/src/mage/cards/p/PhantomTiger.java index db97e011de..0f96aecb41 100644 --- a/Mage.Sets/src/mage/cards/p/PhantomTiger.java +++ b/Mage.Sets/src/mage/cards/p/PhantomTiger.java @@ -28,6 +28,7 @@ package mage.cards.p; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; @@ -47,13 +48,12 @@ import mage.game.permanent.Permanent; import mage.game.turn.Step; /** - * * @author Temba */ public class PhantomTiger extends CardImpl { public PhantomTiger(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add("Cat"); this.subtype.add("Spirit"); this.power = new MageInt(1); @@ -111,7 +111,7 @@ class PhantomTigerPreventionEffect extends PreventionEffectImpl { if (permanent != null) { boolean removeCounter = true; // check if in the same combat damage step already a counter was removed - if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) { + if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) { if (game.getTurnNum() == turn && game.getTurn().getStep().equals(combatPhaseStep)) { removeCounter = false; diff --git a/Mage.Sets/src/mage/cards/p/PhantomWurm.java b/Mage.Sets/src/mage/cards/p/PhantomWurm.java index a3f26a690a..13a03e1f84 100644 --- a/Mage.Sets/src/mage/cards/p/PhantomWurm.java +++ b/Mage.Sets/src/mage/cards/p/PhantomWurm.java @@ -113,7 +113,7 @@ class PhantomWurmPreventionEffect extends PreventionEffectImpl { if (permanent != null) { boolean removeCounter = true; // check if in the same combat damage step already a counter was removed - if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) { + if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) { if (game.getTurnNum() == turn && game.getTurn().getStep().equals(combatPhaseStep)) { removeCounter = false; diff --git a/Mage.Sets/src/mage/cards/p/PiasRevolution.java b/Mage.Sets/src/mage/cards/p/PiasRevolution.java index 7f3685af35..f8f9bdf085 100644 --- a/Mage.Sets/src/mage/cards/p/PiasRevolution.java +++ b/Mage.Sets/src/mage/cards/p/PiasRevolution.java @@ -103,7 +103,7 @@ class PiasRevolutionReturnEffect extends OneShotEffect { "Have Pia's Revolution deal 3 damage to you to prevent that " + permanent.getIdName() + " returns to " + controller.getName() + "'s hand?", source, game)) { opponent.damage(3, source.getSourceId(), game, false, true); - } else if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { + } else if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) { controller.moveCards(game.getCard(permanentId), Zone.HAND, source, game); } } @@ -144,7 +144,7 @@ class PiasRevolutionTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) { + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/p/Portcullis.java b/Mage.Sets/src/mage/cards/p/Portcullis.java index 8126383410..bb43e720aa 100644 --- a/Mage.Sets/src/mage/cards/p/Portcullis.java +++ b/Mage.Sets/src/mage/cards/p/Portcullis.java @@ -123,7 +123,7 @@ class PortcullisExileEffect extends OneShotEffect { if (permanent != null && creature != null) { Player controller = game.getPlayer(creature.getControllerId()); Zone currentZone = game.getState().getZone(creature.getId()); - if (currentZone.equals(Zone.BATTLEFIELD)) { + if (currentZone == Zone.BATTLEFIELD) { controller.moveCardsToExile(creature, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName()); } } diff --git a/Mage.Sets/src/mage/cards/p/PowerArtifact.java b/Mage.Sets/src/mage/cards/p/PowerArtifact.java index 5777e4d306..25337c32c5 100644 --- a/Mage.Sets/src/mage/cards/p/PowerArtifact.java +++ b/Mage.Sets/src/mage/cards/p/PowerArtifact.java @@ -93,8 +93,8 @@ class PowerArtifactCostModificationEffect extends CostModificationEffectImpl { public boolean applies(Ability abilityToModify, Ability source, Game game) { Permanent artifact = game.getPermanent(abilityToModify.getSourceId()); if (artifact != null && artifact.getAttachments().contains(source.getSourceId())) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) - || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { + if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED + || (abilityToModify.getAbilityType() == AbilityType.MANA && (abilityToModify instanceof ActivatedAbility))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PrimalClay.java b/Mage.Sets/src/mage/cards/p/PrimalClay.java index c5ea358606..a1c0b7deae 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalClay.java +++ b/Mage.Sets/src/mage/cards/p/PrimalClay.java @@ -94,7 +94,7 @@ public class PrimalClay extends CardImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.ENTERS_THE_BATTLEFIELD); + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PrimalPlasma.java b/Mage.Sets/src/mage/cards/p/PrimalPlasma.java index b17cb0cd28..078103dc3e 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalPlasma.java +++ b/Mage.Sets/src/mage/cards/p/PrimalPlasma.java @@ -95,7 +95,7 @@ public class PrimalPlasma extends CardImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.ENTERS_THE_BATTLEFIELD); + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PrismaticStrands.java b/Mage.Sets/src/mage/cards/p/PrismaticStrands.java index 83822e5bfe..0255cc370e 100644 --- a/Mage.Sets/src/mage/cards/p/PrismaticStrands.java +++ b/Mage.Sets/src/mage/cards/p/PrismaticStrands.java @@ -141,9 +141,9 @@ class PrismaticStrandsPreventionEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { - if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) - || event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) - || event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) { + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER + || event.getType() == GameEvent.EventType.DAMAGE_CREATURE + || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).shares(this.color)) { return true; diff --git a/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java b/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java index e0ac8f96fd..97374c1e38 100644 --- a/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java +++ b/Mage.Sets/src/mage/cards/p/PrizedAmalgam.java @@ -111,9 +111,9 @@ class PrizedAmalgamTriggerdAbility extends EntersBattlefieldAllTriggeredAbility boolean result = false; if (super.checkTrigger(event, game)) { EntersTheBattlefieldEvent entersEvent = (EntersTheBattlefieldEvent) event; - if (entersEvent.getFromZone().equals(Zone.GRAVEYARD)) { + if (entersEvent.getFromZone() == Zone.GRAVEYARD) { result = true; - } else if (entersEvent.getFromZone().equals(Zone.STACK) && entersEvent.getTarget().getControllerId().equals(getControllerId())) { + } else if (entersEvent.getFromZone() == Zone.STACK && entersEvent.getTarget().getControllerId().equals(getControllerId())) { CastFromGraveyardWatcher watcher = (CastFromGraveyardWatcher) game.getState().getWatchers().get(CastFromGraveyardWatcher.class.getName()); if (watcher != null) { int zcc = game.getState().getZoneChangeCounter(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/p/PsychogenicProbe.java b/Mage.Sets/src/mage/cards/p/PsychogenicProbe.java index 7cd5d39b18..7a34c269db 100644 --- a/Mage.Sets/src/mage/cards/p/PsychogenicProbe.java +++ b/Mage.Sets/src/mage/cards/p/PsychogenicProbe.java @@ -80,7 +80,7 @@ class PsychogenicProbeTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.LIBRARY_SHUFFLED); + return event.getType() == EventType.LIBRARY_SHUFFLED; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PyrewildShaman.java b/Mage.Sets/src/mage/cards/p/PyrewildShaman.java index b961c5ef5e..4e773f1f57 100644 --- a/Mage.Sets/src/mage/cards/p/PyrewildShaman.java +++ b/Mage.Sets/src/mage/cards/p/PyrewildShaman.java @@ -116,12 +116,12 @@ class PyrewildShamanTriggeredAbility extends TriggeredAbilityImpl { } } } - if (event.getType().equals(GameEvent.EventType.END_COMBAT_STEP_POST)){ + if (event.getType() == EventType.END_COMBAT_STEP_POST){ damagedPlayerIds.clear(); } - if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE) && event.getTargetId().equals(getSourceId())){ + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(getSourceId())){ ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone().equals(Zone.GRAVEYARD)) { + if (zEvent.getFromZone() == Zone.GRAVEYARD) { damagedPlayerIds.clear(); } } diff --git a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java index ff5c1bc3b4..29ad06a409 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java @@ -79,9 +79,9 @@ class PyromancersGauntletReplacementEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) - || event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) - || event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER); + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER + || event.getType() == GameEvent.EventType.DAMAGE_CREATURE + || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PyromancersGoggles.java b/Mage.Sets/src/mage/cards/p/PyromancersGoggles.java index 7977489d99..76b4680f61 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersGoggles.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersGoggles.java @@ -104,7 +104,7 @@ class PyromancersGogglesTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.MANA_PAYED); + return event.getType() == EventType.MANA_PAYED; } @Override diff --git a/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java b/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java index 48e2c72e14..4ac5e7ce40 100644 --- a/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java +++ b/Mage.Sets/src/mage/cards/q/QuestForPureFlame.java @@ -126,8 +126,8 @@ class QuestForPureFlameEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) || - event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == EventType.DAMAGE_CREATURE || + event.getType() == EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/r/Reincarnation.java b/Mage.Sets/src/mage/cards/r/Reincarnation.java index 7633843974..9c61c9a692 100644 --- a/Mage.Sets/src/mage/cards/r/Reincarnation.java +++ b/Mage.Sets/src/mage/cards/r/Reincarnation.java @@ -172,7 +172,7 @@ class ReincarnationDelayedEffect extends OneShotEffect { if (targetCreature.canChoose(source.getSourceId(), controller.getId(), game) && controller.chooseTarget(outcome, targetCreature, source, game)) { Card card = game.getCard(targetCreature.getFirstTarget()); - if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { return card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), player.getId()); } } diff --git a/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java b/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java index ac149fb4b4..104c6deb89 100644 --- a/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java +++ b/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java @@ -104,7 +104,7 @@ class ReinsOfTheVinesteedEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Card aura = game.getCard(source.getSourceId()); if (aura != null - && game.getState().getZone(aura.getId()).equals(Zone.GRAVEYARD)) { + && game.getState().getZone(aura.getId()) == Zone.GRAVEYARD) { Player controller = game.getPlayer(source.getControllerId()); Permanent lastStateAura = (Permanent) game.getLastKnownInformation(aura.getId(), Zone.BATTLEFIELD); Permanent lastStateCreature = game.getPermanentOrLKIBattlefield(lastStateAura.getAttachedTo()); diff --git a/Mage.Sets/src/mage/cards/r/RescueFromTheUnderworld.java b/Mage.Sets/src/mage/cards/r/RescueFromTheUnderworld.java index ed8419bd3f..9963651159 100644 --- a/Mage.Sets/src/mage/cards/r/RescueFromTheUnderworld.java +++ b/Mage.Sets/src/mage/cards/r/RescueFromTheUnderworld.java @@ -241,13 +241,13 @@ class RescueFromTheUnderworldReturnEffect extends OneShotEffect { // perhaps because it’s your commander or because of another replacement effect, it will return // to the battlefield from the zone it went to. if (source.getTargets().get(1) != null) { - for (UUID targetId : ((Target) source.getTargets().get(1)).getTargets()) { + for (UUID targetId : source.getTargets().get(1).getTargets()) { Card card = game.getCard(targetId); if (card != null && !card.isFaceDown(game)) { Player player = game.getPlayer(card.getOwnerId()); if (player != null) { Zone currentZone = game.getState().getZone(card.getId()); - if (currentZone.equals(Zone.COMMAND) || currentZone.equals(Zone.GRAVEYARD) || currentZone.equals(Zone.EXILED)) { + if (currentZone == Zone.COMMAND || currentZone == Zone.GRAVEYARD || currentZone == Zone.EXILED) { return player.moveCards(card, Zone.BATTLEFIELD, source, game); } } diff --git a/Mage.Sets/src/mage/cards/r/RestorationAngel.java b/Mage.Sets/src/mage/cards/r/RestorationAngel.java index 9fe10a2c9e..d636fbdb02 100644 --- a/Mage.Sets/src/mage/cards/r/RestorationAngel.java +++ b/Mage.Sets/src/mage/cards/r/RestorationAngel.java @@ -115,7 +115,7 @@ class RestorationAngelEffect extends OneShotEffect { Card card = game.getCard(permanent.getId()); if (card != null && card.getZoneChangeCounter(game) == zcc + 1 - && game.getState().getZone(card.getId()).equals(Zone.EXILED)) { + && game.getState().getZone(card.getId()) == Zone.EXILED) { return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } diff --git a/Mage.Sets/src/mage/cards/r/Restore.java b/Mage.Sets/src/mage/cards/r/Restore.java index 7be9184c45..804ab78032 100644 --- a/Mage.Sets/src/mage/cards/r/Restore.java +++ b/Mage.Sets/src/mage/cards/r/Restore.java @@ -90,7 +90,7 @@ class RestoreEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Card land = game.getCard(this.getTargetPointer().getFirst(game, source)); - if (controller != null && game.getState().getZone(land.getId()).equals(Zone.GRAVEYARD)) { + if (controller != null && game.getState().getZone(land.getId()) == Zone.GRAVEYARD) { return land.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), controller.getId()); } return false; diff --git a/Mage.Sets/src/mage/cards/r/RetaliatorGriffin.java b/Mage.Sets/src/mage/cards/r/RetaliatorGriffin.java index e2105777c2..d78ca92688 100644 --- a/Mage.Sets/src/mage/cards/r/RetaliatorGriffin.java +++ b/Mage.Sets/src/mage/cards/r/RetaliatorGriffin.java @@ -90,7 +90,7 @@ class RetaliatorGriffinTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RhoxFaithmender.java b/Mage.Sets/src/mage/cards/r/RhoxFaithmender.java index 83ca30b525..1cd0c92ad9 100644 --- a/Mage.Sets/src/mage/cards/r/RhoxFaithmender.java +++ b/Mage.Sets/src/mage/cards/r/RhoxFaithmender.java @@ -103,7 +103,7 @@ class RhoxFaithmenderEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.GAIN_LIFE); + return event.getType() == EventType.GAIN_LIFE; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java b/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java index 5390f4747f..5fcc47a897 100644 --- a/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java +++ b/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java @@ -90,7 +90,7 @@ class RitualOfTheReturnedExileEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); - if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.GRAVEYARD, true); return new CreateTokenEffect( new RitualOfTheReturnedZombieToken(card.getPower().getValue(), card.getToughness().getValue())).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/r/RotfeasterMaggot.java b/Mage.Sets/src/mage/cards/r/RotfeasterMaggot.java index 9e59654abe..a88dcb2e7a 100644 --- a/Mage.Sets/src/mage/cards/r/RotfeasterMaggot.java +++ b/Mage.Sets/src/mage/cards/r/RotfeasterMaggot.java @@ -94,7 +94,7 @@ class RotfeasterMaggotExileEffect extends OneShotEffect { if (controller != null) { Card targetCard = game.getCard(getTargetPointer().getFirst(game, source)); if (targetCard != null) { - if (game.getState().getZone(targetCard.getId()).equals(Zone.GRAVEYARD)) { + if (game.getState().getZone(targetCard.getId()) == Zone.GRAVEYARD) { controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); } controller.gainLife(targetCard.getToughness().getValue(), game); diff --git a/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java b/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java index 4053bba1e7..a9c84759ad 100644 --- a/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java +++ b/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java @@ -80,7 +80,7 @@ public class ScaleguardSentinels extends CardImpl { @Override public void adjustCosts(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { Player controller = game.getPlayer(ability.getControllerId()); if (controller != null) { if (controller.getHand().count(filter, game) > 0) { diff --git a/Mage.Sets/src/mage/cards/s/SenTriplets.java b/Mage.Sets/src/mage/cards/s/SenTriplets.java index 715c6d9873..886aed0764 100644 --- a/Mage.Sets/src/mage/cards/s/SenTriplets.java +++ b/Mage.Sets/src/mage/cards/s/SenTriplets.java @@ -180,8 +180,8 @@ 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)) && - game.getState().getZone(objectId).equals(Zone.HAND) && + card.getOwnerId().equals(getTargetPointer().getFirst(game, source)) && + game.getState().getZone(objectId) == Zone.HAND && affectedControllerId.equals(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/s/SilumgarsScorn.java b/Mage.Sets/src/mage/cards/s/SilumgarsScorn.java index 1a26fc7f7a..8ef8211f34 100644 --- a/Mage.Sets/src/mage/cards/s/SilumgarsScorn.java +++ b/Mage.Sets/src/mage/cards/s/SilumgarsScorn.java @@ -77,7 +77,7 @@ public class SilumgarsScorn extends CardImpl { @Override public void adjustCosts(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.SPELL)) { + if (ability.getAbilityType() == AbilityType.SPELL) { Player controller = game.getPlayer(ability.getControllerId()); if (controller != null) { if (controller.getHand().count(filter, game) > 0) { diff --git a/Mage.Sets/src/mage/cards/s/SoulFoundry.java b/Mage.Sets/src/mage/cards/s/SoulFoundry.java index c2cf92f80f..80e7ce2392 100644 --- a/Mage.Sets/src/mage/cards/s/SoulFoundry.java +++ b/Mage.Sets/src/mage/cards/s/SoulFoundry.java @@ -174,7 +174,7 @@ class SoulFoundryEffect extends OneShotEffect { && !soulFoundry.getImprinted().isEmpty()) { Card imprinted = game.getCard(soulFoundry.getImprinted().get(0)); if (imprinted != null - && game.getState().getZone(imprinted.getId()).equals(Zone.EXILED)) { + && game.getState().getZone(imprinted.getId()) == Zone.EXILED) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); effect.setTargetPointer(new FixedTarget(imprinted.getId(), imprinted.getZoneChangeCounter(game))); return effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java index cad3f11dc2..0734580f6c 100644 --- a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java +++ b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java @@ -111,7 +111,7 @@ class SuddenSpoilingEffect extends ContinuousEffectImpl { permanent.removeAllAbilities(source.getSourceId(), game); break; case PTChangingEffects_7: - if (sublayer.equals(SubLayer.SetPT_7b)) { + if (sublayer == SubLayer.SetPT_7b) { permanent.getPower().setValue(0); permanent.getToughness().setValue(2); } diff --git a/Mage.Sets/src/mage/cards/t/Tamanoa.java b/Mage.Sets/src/mage/cards/t/Tamanoa.java index 893bd2d0b7..995eba13da 100644 --- a/Mage.Sets/src/mage/cards/t/Tamanoa.java +++ b/Mage.Sets/src/mage/cards/t/Tamanoa.java @@ -88,9 +88,9 @@ class TamanoaDealsDamageTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE) - || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) - || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER); + return event.getType() == GameEvent.EventType.DAMAGED_CREATURE + || event.getType() == GameEvent.EventType.DAMAGED_PLAYER + || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER; } @Override @@ -98,7 +98,7 @@ class TamanoaDealsDamageTriggeredAbility extends TriggeredAbilityImpl { MageObject eventSourceObject = game.getObject(event.getSourceId()); if (eventSourceObject != null && !eventSourceObject.getCardType().contains(CardType.CREATURE)) { if (getControllerId().equals(game.getControllerId(event.getSourceId()))) { - this.getEffects().stream().forEach((effect) -> { + this.getEffects().forEach((effect) -> { effect.setValue("damage", event.getAmount()); }); return true; diff --git a/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java b/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java index 29c5b28af7..6848902fad 100644 --- a/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java +++ b/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java @@ -132,7 +132,7 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl { } // commander in command zone for (UUID commanderId : controller.getCommandersIds()) { - if (game.getState().getZone(commanderId).equals(Zone.COMMAND)) { + if (game.getState().getZone(commanderId) == Zone.COMMAND) { Card card = game.getCard(commanderId); if (card.getCardType().contains(CardType.CREATURE)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); diff --git a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java index 52a0b6cff3..752516f627 100644 --- a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java +++ b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java @@ -150,7 +150,7 @@ class TestamentOfFaithBecomesCreatureSourceEffect extends ContinuousEffectImpl i } return true; } else { - if (duration.equals(Duration.Custom)) { + if (duration == Duration.Custom) { this.discard(); } } diff --git a/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java b/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java index 8747b87163..943f8246ef 100644 --- a/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java +++ b/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java @@ -141,7 +141,7 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl { } } } - if (event.getType().equals(GameEvent.EventType.END_COMBAT_STEP_POST)) { + if (event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST) { damagedPlayerIds.clear(); } return false; diff --git a/Mage.Sets/src/mage/cards/t/TorporOrb.java b/Mage.Sets/src/mage/cards/t/TorporOrb.java index 97c59e837e..0c668e22da 100644 --- a/Mage.Sets/src/mage/cards/t/TorporOrb.java +++ b/Mage.Sets/src/mage/cards/t/TorporOrb.java @@ -86,7 +86,7 @@ class TorporOrbEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Ability ability = (Ability) getValue("targetAbility"); - if (ability != null && AbilityType.TRIGGERED.equals(ability.getAbilityType())) { + if (ability != null && ability.getAbilityType() == AbilityType.TRIGGERED) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; diff --git a/Mage.Sets/src/mage/cards/t/TorrentElemental.java b/Mage.Sets/src/mage/cards/t/TorrentElemental.java index aeb3c64089..663a072c60 100644 --- a/Mage.Sets/src/mage/cards/t/TorrentElemental.java +++ b/Mage.Sets/src/mage/cards/t/TorrentElemental.java @@ -117,7 +117,7 @@ class ReturnSourceFromExileToBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if (!game.getState().getZone(source.getSourceId()).equals(Zone.EXILED)) { + if (game.getState().getZone(source.getSourceId()) != Zone.EXILED) { return false; } Card card = game.getCard(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/t/TrainingGrounds.java b/Mage.Sets/src/mage/cards/t/TrainingGrounds.java index 4c6ac55266..5545a374dc 100644 --- a/Mage.Sets/src/mage/cards/t/TrainingGrounds.java +++ b/Mage.Sets/src/mage/cards/t/TrainingGrounds.java @@ -119,8 +119,8 @@ class TrainingGroundsEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) - || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { + if (abilityToModify.getAbilityType() == AbilityType.ACTIVATED + || (abilityToModify.getAbilityType() == AbilityType.MANA && (abilityToModify instanceof ActivatedAbility))) { //Activated abilities of creatures you control Permanent permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null && filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/cards/u/UginsNexus.java b/Mage.Sets/src/mage/cards/u/UginsNexus.java index 4598b6d410..314f518ce6 100644 --- a/Mage.Sets/src/mage/cards/u/UginsNexus.java +++ b/Mage.Sets/src/mage/cards/u/UginsNexus.java @@ -152,7 +152,7 @@ class UginsNexusExileEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone().equals(Zone.BATTLEFIELD)) { + if (zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD) { return true; } } diff --git a/Mage.Sets/src/mage/cards/u/UmezawasJitte.java b/Mage.Sets/src/mage/cards/u/UmezawasJitte.java index ec6d1c5858..830f3a2b2b 100644 --- a/Mage.Sets/src/mage/cards/u/UmezawasJitte.java +++ b/Mage.Sets/src/mage/cards/u/UmezawasJitte.java @@ -135,7 +135,7 @@ class UmezawasJitteAbility extends TriggeredAbilityImpl { return true; } } - if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_PRE)) { + if (event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE) { usedInPhase = false; } return false; diff --git a/Mage.Sets/src/mage/cards/u/UndergrowthChampion.java b/Mage.Sets/src/mage/cards/u/UndergrowthChampion.java index 95f9838531..6dccc83490 100644 --- a/Mage.Sets/src/mage/cards/u/UndergrowthChampion.java +++ b/Mage.Sets/src/mage/cards/u/UndergrowthChampion.java @@ -108,7 +108,7 @@ class UndergrowthChampionPreventionEffect extends PreventionEffectImpl { if (permanent != null) { boolean removeCounter = true; // check if in the same combat damage step already a counter was removed - if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) { + if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) { if (game.getTurnNum() == turn && game.getTurn().getStep().equals(combatPhaseStep)) { removeCounter = false; diff --git a/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java b/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java index e0a9dd195c..a468a6f198 100644 --- a/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java +++ b/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java @@ -161,7 +161,7 @@ class UnscytheEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getCard(targetPointer.getFirst(game, source)); - if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD) && controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true)) { + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD && controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true)) { ZombieToken zombie = new ZombieToken(); return zombie.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java b/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java index 5e3841faee..4a5c5bb4d7 100644 --- a/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java +++ b/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java @@ -118,7 +118,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl { land.untap(game); } } - } else if (applied && layer.equals(Layer.RulesEffects)) { + } else if (applied && layer == Layer.RulesEffects) { if (game.getStep().getType() == PhaseStep.END_TURN) { game.getState().setValue(source.getSourceId() + "applied", false); } diff --git a/Mage.Sets/src/mage/cards/u/UrzasArmor.java b/Mage.Sets/src/mage/cards/u/UrzasArmor.java index 17a7c78145..46ab246714 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasArmor.java +++ b/Mage.Sets/src/mage/cards/u/UrzasArmor.java @@ -75,7 +75,7 @@ class UrzasArmorEffect extends PreventionEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER); + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; } @Override diff --git a/Mage.Sets/src/mage/cards/v/ValeronWardens.java b/Mage.Sets/src/mage/cards/v/ValeronWardens.java index e56ac41b1d..66b8b9ce30 100644 --- a/Mage.Sets/src/mage/cards/v/ValeronWardens.java +++ b/Mage.Sets/src/mage/cards/v/ValeronWardens.java @@ -88,7 +88,7 @@ class ValeronWardensTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType().equals(EventType.BECOMES_RENOWNED); + return event.getType() == EventType.BECOMES_RENOWNED; } @Override diff --git a/Mage.Sets/src/mage/cards/v/VanishIntoMemory.java b/Mage.Sets/src/mage/cards/v/VanishIntoMemory.java index 7a15df5e00..620799bb45 100644 --- a/Mage.Sets/src/mage/cards/v/VanishIntoMemory.java +++ b/Mage.Sets/src/mage/cards/v/VanishIntoMemory.java @@ -30,6 +30,7 @@ package mage.cards.v; import java.util.HashSet; import java.util.Set; import java.util.UUID; + import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility; @@ -57,7 +58,6 @@ import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTargets; /** - * * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) */ public class VanishIntoMemory extends CardImpl { @@ -166,7 +166,7 @@ class VanishIntoMemoryEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return EventType.ENTERS_THE_BATTLEFIELD.equals(event.getType()); + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } @Override diff --git a/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java b/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java index 3e4d73c5bd..3b83b95d52 100644 --- a/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java +++ b/Mage.Sets/src/mage/cards/v/VoiceOfResurgence.java @@ -105,7 +105,7 @@ class VoiceOfResurgenceTriggeredAbility extends TriggeredAbilityImpl { // Voice of Resurgence Dies if (event.getType() == GameEvent.EventType.ZONE_CHANGE && getSourceId().equals(event.getTargetId())) { ZoneChangeEvent zce = (ZoneChangeEvent) event; - return zce.getFromZone().equals(Zone.BATTLEFIELD) && zce.getToZone().equals(Zone.GRAVEYARD); + return zce.getFromZone() == Zone.BATTLEFIELD && zce.getToZone() == Zone.GRAVEYARD; } return false; } diff --git a/Mage.Sets/src/mage/cards/w/WhipOfErebos.java b/Mage.Sets/src/mage/cards/w/WhipOfErebos.java index 2057aef756..543dcbf831 100644 --- a/Mage.Sets/src/mage/cards/w/WhipOfErebos.java +++ b/Mage.Sets/src/mage/cards/w/WhipOfErebos.java @@ -168,8 +168,8 @@ class WhipOfErebosReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getFirstTarget()) - && ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD) - && !((ZoneChangeEvent) event).getToZone().equals(Zone.EXILED)) { + && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD + && ((ZoneChangeEvent) event).getToZone() != Zone.EXILED) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java b/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java index 21106ee8bd..47e36a19ab 100644 --- a/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java +++ b/Mage.Sets/src/mage/cards/y/YidrisMaelstromWielder.java @@ -104,7 +104,7 @@ class YidrisMaelstromWielderGainCascadeEffect extends ContinuousEffectImpl { // only spells cast, so no copies of spells if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) stackObject; - if (spell.getFromZone().equals(Zone.HAND)) { + if (spell.getFromZone() == Zone.HAND) { game.getState().addOtherAbility(spell.getCard(), cascadeAbility); } } diff --git a/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java b/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java index c107228c59..a88412b5e8 100644 --- a/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java +++ b/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java @@ -94,7 +94,7 @@ class ZameckGuildmageEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.ENTERS_THE_BATTLEFIELD); + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } @Override