From 572104b8fcdb50b509c34b10e113cf39602374bb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 8 Jul 2021 23:28:43 -0400 Subject: [PATCH] Reworking card types in preparation for implementing Grist, the Hunger Tide (#7899) Co-authored-by: Oleg Agafonov --- .../card/arcane/ModernSplitCardRenderer.java | 9 +- .../src/main/java/mage/view/CardView.java | 14 +- .../main/java/mage/view/StackAbilityView.java | 4 +- .../src/mage/deck/Brawl.java | 6 +- .../src/mage/deck/Commander.java | 97 +++--- .../src/mage/deck/FreeformCommander.java | 3 +- .../src/mage/deck/Oathbreaker.java | 3 +- .../src/mage/deck/PennyDreadfulCommander.java | 5 +- .../src/mage/deck/TinyLeaders.java | 4 +- .../player/ai/ma/ArtificialScoringSystem.java | 24 +- .../java/mage/player/ai/ComputerPlayer.java | 28 +- .../mage/player/ai/PermanentEvaluator.java | 4 +- .../mage/player/ai/GameStateEvaluator.java | 2 +- .../src/mage/player/human/HumanPlayer.java | 2 +- .../java/mage/server/util/SystemUtil.java | 3 +- Mage.Sets/src/mage/cards/a/AAT1.java | 2 +- .../src/mage/cards/a/AberrantResearcher.java | 3 +- Mage.Sets/src/mage/cards/a/Abeyance.java | 2 +- .../src/mage/cards/a/AbundantHarvest.java | 2 +- Mage.Sets/src/mage/cards/a/AetherCharge.java | 3 +- Mage.Sets/src/mage/cards/a/AetherRift.java | 2 +- Mage.Sets/src/mage/cards/a/AetherSting.java | 3 +- Mage.Sets/src/mage/cards/a/AetherStorm.java | 2 +- Mage.Sets/src/mage/cards/a/Aetherplasm.java | 2 +- .../src/mage/cards/a/AjanisLastStand.java | 4 +- Mage.Sets/src/mage/cards/a/AkoumFirebird.java | 2 +- Mage.Sets/src/mage/cards/a/AkoumHellkite.java | 2 +- .../src/mage/cards/a/AlenaKessigTrapper.java | 2 +- Mage.Sets/src/mage/cards/a/AllHallowsEve.java | 2 +- .../mage/cards/a/AlrundGodOfTheCosmos.java | 2 +- .../src/mage/cards/a/AmarethTheLustrous.java | 2 +- .../src/mage/cards/a/AminatousAugury.java | 2 +- Mage.Sets/src/mage/cards/a/Amnesia.java | 3 +- Mage.Sets/src/mage/cards/a/Amplifire.java | 2 +- .../src/mage/cards/a/AnafenzaTheForemost.java | 4 +- .../src/mage/cards/a/AncientGreenwarden.java | 2 +- Mage.Sets/src/mage/cards/a/AngelicChorus.java | 3 +- .../src/mage/cards/a/AngelicGuardian.java | 3 +- .../mage/cards/a/AnimarSoulOfElements.java | 2 +- .../src/mage/cards/a/AnimateArtifact.java | 4 +- Mage.Sets/src/mage/cards/a/AnkhOfMishra.java | 3 +- .../src/mage/cards/a/AnsweredPrayers.java | 2 +- Mage.Sets/src/mage/cards/a/ApexOfPower.java | 2 +- .../mage/cards/a/ArahboRoarOfTheWorld.java | 2 +- .../src/mage/cards/a/ArcaneAdaptation.java | 12 +- Mage.Sets/src/mage/cards/a/ArcaneArtisan.java | 2 +- .../src/mage/cards/a/ArchonOfEmeria.java | 2 +- .../src/mage/cards/a/ArchonOfValorsReach.java | 2 +- .../src/mage/cards/a/ArclightPhoenix.java | 2 +- .../src/mage/cards/a/ArgothianPixies.java | 2 +- .../src/mage/cards/a/ArgothianTreefolk.java | 2 +- .../cards/a/ArixmethesSlumberingIsle.java | 4 +- .../mage/cards/a/ArlinnVoiceOfThePack.java | 2 +- .../src/mage/cards/a/ArmedAndArmored.java | 4 +- Mage.Sets/src/mage/cards/a/ArtificersHex.java | 2 +- Mage.Sets/src/mage/cards/a/AsForetold.java | 2 +- .../src/mage/cards/a/AscentOfTheWorthy.java | 2 +- .../src/mage/cards/a/AshayaSoulOfTheWild.java | 4 +- Mage.Sets/src/mage/cards/a/AshenGhoul.java | 2 +- .../src/mage/cards/a/AshesOfTheFallen.java | 2 +- .../src/mage/cards/a/AsmiraHolyAvenger.java | 2 +- .../src/mage/cards/a/AthreosShroudVeiled.java | 2 +- .../mage/cards/a/AtlaPalaniNestTender.java | 2 +- .../src/mage/cards/a/AudaciousReshapers.java | 2 +- .../src/mage/cards/a/AugmenterPugilist.java | 2 +- Mage.Sets/src/mage/cards/a/AuraBarbs.java | 2 +- Mage.Sets/src/mage/cards/a/AureliasFury.java | 4 +- Mage.Sets/src/mage/cards/a/Aurification.java | 4 +- .../src/mage/cards/a/AuspiciousStarrix.java | 2 +- .../mage/cards/a/AuthorityOfTheConsuls.java | 2 +- .../src/mage/cards/a/AwakenedAmalgam.java | 2 +- .../src/mage/cards/a/AzorTheLawbringer.java | 2 +- .../src/mage/cards/b/BackdraftHellkite.java | 7 +- .../src/mage/cards/b/BalduvianWarlord.java | 4 +- .../src/mage/cards/b/BalothCageTrap.java | 2 +- Mage.Sets/src/mage/cards/b/BalustradeSpy.java | 2 +- .../src/mage/cards/b/BanishIntoFable.java | 5 +- .../mage/cards/b/BattlefieldThaumaturge.java | 4 +- .../src/mage/cards/b/BeamsplitterMage.java | 5 +- Mage.Sets/src/mage/cards/b/BellowingElk.java | 2 +- .../src/mage/cards/b/BenefactionOfRhonas.java | 4 +- .../src/mage/cards/b/BenthicExplorers.java | 2 +- Mage.Sets/src/mage/cards/b/Bereavement.java | 3 +- .../src/mage/cards/b/BioessenceHydra.java | 2 +- .../src/mage/cards/b/BiomancersFamiliar.java | 3 +- Mage.Sets/src/mage/cards/b/Bioplasm.java | 2 +- .../src/mage/cards/b/BlackSunsZenith.java | 2 +- .../src/mage/cards/b/BlacksmithsSkill.java | 2 +- Mage.Sets/src/mage/cards/b/BlazeCommando.java | 3 +- .../mage/cards/b/BlessedReincarnation.java | 2 +- Mage.Sets/src/mage/cards/b/Blightbeetle.java | 2 +- Mage.Sets/src/mage/cards/b/BlindFury.java | 2 +- .../src/mage/cards/b/BlindObedience.java | 2 +- Mage.Sets/src/mage/cards/b/BloodForBones.java | 5 +- Mage.Sets/src/mage/cards/b/BloodOath.java | 2 +- .../src/mage/cards/b/BloodOfTheMartyr.java | 2 +- Mage.Sets/src/mage/cards/b/BloodSeeker.java | 3 +- .../src/mage/cards/b/BloodfireEnforcers.java | 4 +- .../src/mage/cards/b/BloodsporeThrinax.java | 2 +- Mage.Sets/src/mage/cards/b/BolassCitadel.java | 2 +- .../src/mage/cards/b/BoldPlagiarist.java | 2 +- Mage.Sets/src/mage/cards/b/BoneDancer.java | 2 +- Mage.Sets/src/mage/cards/b/BonusRound.java | 2 +- .../mage/cards/b/BoseijuWhoSheltersAll.java | 2 +- Mage.Sets/src/mage/cards/b/Bossk.java | 2 +- .../src/mage/cards/b/BramblewoodParagon.java | 2 +- .../src/mage/cards/b/BranchingEvolution.java | 2 +- .../src/mage/cards/b/BrandOfIllOmen.java | 2 +- .../src/mage/cards/b/BreathlessKnight.java | 2 +- .../src/mage/cards/b/BreathstealersCrypt.java | 3 +- .../src/mage/cards/b/BronzehideLion.java | 4 +- .../src/mage/cards/b/BrutalDeceiver.java | 2 +- .../BurningCinderFuryOfCrimsonChaosFire.java | 2 +- Mage.Sets/src/mage/cards/c/CagedSun.java | 3 +- Mage.Sets/src/mage/cards/c/CairnWanderer.java | 2 +- .../src/mage/cards/c/CalibratedBlast.java | 2 +- .../src/mage/cards/c/CalixDestinysHand.java | 3 +- Mage.Sets/src/mage/cards/c/CallOfTheWild.java | 2 +- .../src/mage/cards/c/CallerOfTheClaw.java | 2 +- .../src/mage/cards/c/CallousDeceiver.java | 2 +- Mage.Sets/src/mage/cards/c/Camouflage.java | 2 +- Mage.Sets/src/mage/cards/c/CarrionGrub.java | 2 +- .../src/mage/cards/c/CartoucheOfStrength.java | 2 +- .../src/mage/cards/c/CastleGarenbrig.java | 2 +- .../src/mage/cards/c/CataclysmicGearhulk.java | 2 +- .../src/mage/cards/c/CatacombDragon.java | 2 +- Mage.Sets/src/mage/cards/c/Catastrophe.java | 2 +- .../src/mage/cards/c/CavalierOfThorns.java | 2 +- Mage.Sets/src/mage/cards/c/CellarDoor.java | 2 +- .../src/mage/cards/c/CerebralEruption.java | 2 +- .../mage/cards/c/ChainerNightmareAdept.java | 4 +- .../src/mage/cards/c/ChallengerTroll.java | 2 +- Mage.Sets/src/mage/cards/c/ChameleonBlur.java | 2 +- .../src/mage/cards/c/ChampionLancer.java | 2 +- .../src/mage/cards/c/ChandraTheFirebrand.java | 3 +- .../mage/cards/c/ChandraTorchOfDefiance.java | 2 +- .../src/mage/cards/c/ChandrasPhoenix.java | 7 +- .../src/mage/cards/c/ChaosHarlequin.java | 2 +- Mage.Sets/src/mage/cards/c/ChaosMoon.java | 5 +- Mage.Sets/src/mage/cards/c/ChaosWand.java | 2 +- Mage.Sets/src/mage/cards/c/CheckForTraps.java | 2 +- .../src/mage/cards/c/CherishedHatchling.java | 2 +- Mage.Sets/src/mage/cards/c/ChimericCoils.java | 8 +- Mage.Sets/src/mage/cards/c/ChimericStaff.java | 8 +- .../src/mage/cards/c/ChorusOfTheConclave.java | 2 +- Mage.Sets/src/mage/cards/c/ChromeCourier.java | 2 +- .../src/mage/cards/c/ChronatogTotem.java | 2 +- Mage.Sets/src/mage/cards/c/CircleOfFlame.java | 3 +- .../src/mage/cards/c/CityOfTraitors.java | 3 +- .../src/mage/cards/c/CivilizedScholar.java | 2 +- Mage.Sets/src/mage/cards/c/Cleansing.java | 2 +- Mage.Sets/src/mage/cards/c/ClearTheLand.java | 2 +- Mage.Sets/src/mage/cards/c/ClingToDust.java | 2 +- Mage.Sets/src/mage/cards/c/CloneShell.java | 2 +- .../src/mage/cards/c/CloudstoneCurio.java | 2 +- Mage.Sets/src/mage/cards/c/CobraTrap.java | 3 +- .../mage/cards/c/CodieVociferousCodex.java | 4 +- .../src/mage/cards/c/CoercedConfession.java | 3 +- .../src/mage/cards/c/CollectorOuphe.java | 2 +- .../src/mage/cards/c/CombineGuildmage.java | 2 +- Mage.Sets/src/mage/cards/c/Comeuppance.java | 4 +- .../src/mage/cards/c/ConclaveMentor.java | 2 +- Mage.Sets/src/mage/cards/c/ConduitOfRuin.java | 4 +- .../mage/cards/c/ConfoundingConundrum.java | 2 +- .../src/mage/cards/c/ConfusionInTheRanks.java | 2 +- .../src/mage/cards/c/ConsecrateConsume.java | 2 +- Mage.Sets/src/mage/cards/c/Conspiracy.java | 14 +- .../src/mage/cards/c/ConsumingAberration.java | 2 +- .../src/mage/cards/c/ContainmentPriest.java | 2 +- Mage.Sets/src/mage/cards/c/Contamination.java | 5 +- .../src/mage/cards/c/ContestedWarZone.java | 2 +- Mage.Sets/src/mage/cards/c/Conversion.java | 2 +- .../src/mage/cards/c/CorneredMarket.java | 2 +- Mage.Sets/src/mage/cards/c/CorpseDance.java | 2 +- .../src/mage/cards/c/CorpsejackMenace.java | 2 +- .../mage/cards/c/CosimaGodOfTheVoyage.java | 6 +- Mage.Sets/src/mage/cards/c/Counterlash.java | 2 +- .../src/mage/cards/c/CountrysideCrusher.java | 2 +- Mage.Sets/src/mage/cards/c/CoverOfWinter.java | 2 +- Mage.Sets/src/mage/cards/c/Cowardice.java | 3 +- .../src/mage/cards/c/CrackdownConstruct.java | 2 +- .../src/mage/cards/c/CragganwickCremator.java | 2 +- .../src/mage/cards/c/CrawlingSensation.java | 2 +- .../src/mage/cards/c/CreativeTechnique.java | 2 +- Mage.Sets/src/mage/cards/c/CreepingDread.java | 4 +- Mage.Sets/src/mage/cards/c/CreepyDoll.java | 2 +- .../src/mage/cards/c/CrimePunishment.java | 6 +- Mage.Sets/src/mage/cards/c/CrimsonRoc.java | 2 +- Mage.Sets/src/mage/cards/c/CruelDeceiver.java | 2 +- .../src/mage/cards/c/CryOfTheCarnarium.java | 4 +- Mage.Sets/src/mage/cards/c/CuratorsWard.java | 2 +- Mage.Sets/src/mage/cards/c/CurseOfEchoes.java | 2 +- Mage.Sets/src/mage/cards/c/CursedTotem.java | 2 +- .../mage/cards/d/DalakosCrafterOfWonders.java | 2 +- Mage.Sets/src/mage/cards/d/DampingEngine.java | 8 +- Mage.Sets/src/mage/cards/d/DampingSphere.java | 3 +- Mage.Sets/src/mage/cards/d/DancingSword.java | 6 +- .../src/mage/cards/d/DargoTheShipwrecker.java | 2 +- Mage.Sets/src/mage/cards/d/DaringThief.java | 10 +- .../src/mage/cards/d/DaruSpiritualist.java | 3 +- .../src/mage/cards/d/DauntingDefender.java | 2 +- .../mage/cards/d/DaxosBlessedByTheSun.java | 2 +- .../src/mage/cards/d/DazzlingSphinx.java | 2 +- Mage.Sets/src/mage/cards/d/DeadMansChest.java | 2 +- .../src/mage/cards/d/DeadbridgeChant.java | 2 +- Mage.Sets/src/mage/cards/d/DeadlyBrew.java | 2 +- .../src/mage/cards/d/DeafeningSilence.java | 4 +- .../src/mage/cards/d/DeathMaskDuplicant.java | 2 +- .../src/mage/cards/d/DeathPitsOfRath.java | 2 +- Mage.Sets/src/mage/cards/d/DeathSpark.java | 2 +- .../src/mage/cards/d/DeathgorgeScavenger.java | 2 +- Mage.Sets/src/mage/cards/d/DeathsOasis.java | 2 +- .../src/mage/cards/d/DeathsPresence.java | 3 +- .../src/mage/cards/d/DeceiverOfForm.java | 2 +- Mage.Sets/src/mage/cards/d/DeepWater.java | 5 +- .../src/mage/cards/d/DeepwoodDenizen.java | 2 +- .../src/mage/cards/d/DemonlordBelzenlok.java | 2 +- .../src/mage/cards/d/DescendantsPath.java | 2 +- .../src/mage/cards/d/DesecratedTomb.java | 3 +- Mage.Sets/src/mage/cards/d/DesecratorHag.java | 2 +- Mage.Sets/src/mage/cards/d/Desertion.java | 2 +- Mage.Sets/src/mage/cards/d/Desolation.java | 2 +- .../src/mage/cards/d/DestroyTheEvidence.java | 2 +- Mage.Sets/src/mage/cards/d/DevoutHarpist.java | 2 +- .../mage/cards/d/DimensionalInfiltrator.java | 2 +- Mage.Sets/src/mage/cards/d/DingusEgg.java | 3 +- .../src/mage/cards/d/DisplacementWave.java | 2 +- .../cards/d/DivergentTransformations.java | 2 +- .../src/mage/cards/d/DivineVisitation.java | 4 +- .../src/mage/cards/d/DjeruWithEyesOpen.java | 2 +- .../src/mage/cards/d/DomriChaosBringer.java | 2 +- Mage.Sets/src/mage/cards/d/DomriRade.java | 2 +- Mage.Sets/src/mage/cards/d/DoubleVision.java | 3 +- Mage.Sets/src/mage/cards/d/Doublecast.java | 2 +- .../src/mage/cards/d/DoublingSeason.java | 2 +- .../src/mage/cards/d/DragonAppeasement.java | 3 +- .../src/mage/cards/d/DragonlordKolaghan.java | 2 +- Mage.Sets/src/mage/cards/d/DrainLife.java | 4 +- .../src/mage/cards/d/DralnuLichLord.java | 2 +- .../src/mage/cards/d/DraugrNecromancer.java | 4 +- Mage.Sets/src/mage/cards/d/Dread.java | 3 +- Mage.Sets/src/mage/cards/d/DreadSummons.java | 3 +- Mage.Sets/src/mage/cards/d/DreamDevourer.java | 4 +- Mage.Sets/src/mage/cards/d/DreamPillager.java | 3 +- .../src/mage/cards/d/DregscapeSliver.java | 2 +- Mage.Sets/src/mage/cards/d/DroolingOgre.java | 3 +- .../src/mage/cards/d/DruidicSatchel.java | 6 +- .../src/mage/cards/d/DryadGreenseeker.java | 2 +- Mage.Sets/src/mage/cards/d/DryadMilitant.java | 3 +- Mage.Sets/src/mage/cards/d/DualStrike.java | 2 +- Mage.Sets/src/mage/cards/d/Duplicant.java | 2 +- Mage.Sets/src/mage/cards/e/EchoingCalm.java | 2 +- Mage.Sets/src/mage/cards/e/EchoingRuin.java | 2 +- .../mage/cards/e/EidolonOfObstruction.java | 2 +- .../src/mage/cards/e/Electropotence.java | 3 +- .../src/mage/cards/e/EliteHeadhunter.java | 4 +- .../mage/cards/e/ElspethConquersDeath.java | 2 +- Mage.Sets/src/mage/cards/e/ElspethTirel.java | 2 +- Mage.Sets/src/mage/cards/e/ElvishHealer.java | 2 +- .../src/mage/cards/e/EmbodimentOfAgonies.java | 4 +- .../src/mage/cards/e/EmergentSequence.java | 2 +- .../src/mage/cards/e/EmperorCrocodile.java | 2 +- .../mage/cards/e/EmrakulThePromisedEnd.java | 2 +- .../src/mage/cards/e/EmryLurkerOfTheLoch.java | 2 +- .../src/mage/cards/e/EnchantedBeing.java | 4 +- .../src/mage/cards/e/EnchantedEvening.java | 2 +- .../mage/cards/e/EnchantmentAlteration.java | 8 +- .../src/mage/cards/e/EncirclingFissure.java | 2 +- .../src/mage/cards/e/EndHostilities.java | 4 +- .../src/mage/cards/e/EnduringRenewal.java | 2 +- .../src/mage/cards/e/EnduringScalelord.java | 2 +- Mage.Sets/src/mage/cards/e/Epicenter.java | 2 +- Mage.Sets/src/mage/cards/e/ErebossTitan.java | 2 +- .../src/mage/cards/e/ErraticCyclops.java | 2 +- .../src/mage/cards/e/ErraticExplosion.java | 2 +- .../src/mage/cards/e/ErraticMutation.java | 2 +- .../src/mage/cards/e/EsikaGodOfTheTree.java | 2 +- Mage.Sets/src/mage/cards/e/EsperSentinel.java | 4 +- .../src/mage/cards/e/EssenceOfTheWild.java | 3 +- .../src/mage/cards/e/EtherealAbsolution.java | 2 +- .../src/mage/cards/e/EtherealValkyrie.java | 4 +- .../src/mage/cards/e/EtherswornCanonist.java | 4 +- .../src/mage/cards/e/EverythingamajigC.java | 8 +- .../src/mage/cards/e/ExplorersScope.java | 2 +- .../src/mage/cards/e/ExplosiveRevelation.java | 2 +- .../src/mage/cards/e/ExtraplanarLens.java | 2 +- Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java | 3 +- .../src/mage/cards/e/EzzarootChanneler.java | 2 +- Mage.Sets/src/mage/cards/f/FaadiyahSeer.java | 2 +- Mage.Sets/src/mage/cards/f/FaeOffering.java | 5 +- .../src/mage/cards/f/FalkenrathNoble.java | 3 +- Mage.Sets/src/mage/cards/f/FalseOrders.java | 4 +- Mage.Sets/src/mage/cards/f/FathomTrawl.java | 2 +- .../src/mage/cards/f/FavorableDestiny.java | 2 +- .../src/mage/cards/f/FeatherTheRedeemed.java | 6 +- Mage.Sets/src/mage/cards/f/FeralDeceiver.java | 2 +- .../src/mage/cards/f/FertileImagination.java | 2 +- .../src/mage/cards/f/FiendslayerPaladin.java | 4 +- Mage.Sets/src/mage/cards/f/FieryEncore.java | 2 +- Mage.Sets/src/mage/cards/f/FireServant.java | 2 +- Mage.Sets/src/mage/cards/f/FirefluxSquad.java | 2 +- .../mage/cards/f/FiresongAndSunspeaker.java | 4 +- .../src/mage/cards/f/FirstDayOfClass.java | 2 +- .../mage/cards/f/FlamescrollCelebrant.java | 2 +- .../mage/cards/f/FlayerOfTheHatebound.java | 3 +- .../src/mage/cards/f/FlayingTendrils.java | 3 +- Mage.Sets/src/mage/cards/f/FleshAllergy.java | 3 +- Mage.Sets/src/mage/cards/f/FleshReaver.java | 2 +- .../src/mage/cards/f/FloodedWoodlands.java | 3 +- .../src/mage/cards/f/FlourishingDefenses.java | 2 +- Mage.Sets/src/mage/cards/f/FoodChain.java | 2 +- .../src/mage/cards/f/ForethoughtAmulet.java | 2 +- Mage.Sets/src/mage/cards/f/ForgeOfHeroes.java | 4 +- Mage.Sets/src/mage/cards/f/FoundryHelix.java | 2 +- Mage.Sets/src/mage/cards/f/Froghemoth.java | 2 +- Mage.Sets/src/mage/cards/f/FrontierSiege.java | 4 +- Mage.Sets/src/mage/cards/f/FrozenAether.java | 7 +- Mage.Sets/src/mage/cards/g/GaddockTeeg.java | 4 +- .../mage/cards/g/GadrakTheCrownScourge.java | 2 +- Mage.Sets/src/mage/cards/g/GaeasHerald.java | 2 +- Mage.Sets/src/mage/cards/g/Galvanoth.java | 2 +- Mage.Sets/src/mage/cards/g/GamePreserve.java | 2 +- .../src/mage/cards/g/GargantuanGorilla.java | 2 +- .../mage/cards/g/GargosViciousWatcher.java | 2 +- .../src/mage/cards/g/GarnaTheBloodflame.java | 2 +- .../src/mage/cards/g/GarrukSavageHerald.java | 2 +- .../src/mage/cards/g/GateToTheAether.java | 8 +- .../src/mage/cards/g/GatherSpecimens.java | 4 +- .../src/mage/cards/g/GauntletsOfChaos.java | 10 +- Mage.Sets/src/mage/cards/g/GazeOfGranite.java | 2 +- .../src/mage/cards/g/GeneralsEnforcer.java | 2 +- .../src/mage/cards/g/GeneratorServant.java | 2 +- .../src/mage/cards/g/GenerousPatron.java | 2 +- Mage.Sets/src/mage/cards/g/GenesisStorm.java | 2 +- Mage.Sets/src/mage/cards/g/Geosurge.java | 2 +- .../src/mage/cards/g/GhaltaPrimalHunger.java | 2 +- .../src/mage/cards/g/GhastlyConscription.java | 2 +- .../src/mage/cards/g/GideonTheOathsworn.java | 2 +- Mage.Sets/src/mage/cards/g/GideonsDefeat.java | 2 +- .../src/mage/cards/g/GideonsTriumph.java | 2 +- Mage.Sets/src/mage/cards/g/GisaAndGeralf.java | 2 +- Mage.Sets/src/mage/cards/g/Glaciers.java | 2 +- .../src/mage/cards/g/GladehartCavalry.java | 3 +- .../src/mage/cards/g/GlissaTheTraitor.java | 3 +- Mage.Sets/src/mage/cards/g/Gloom.java | 2 +- Mage.Sets/src/mage/cards/g/GlyphKeeper.java | 2 +- Mage.Sets/src/mage/cards/g/GlyphOfLife.java | 2 +- .../src/mage/cards/g/GnarlrootTrapper.java | 2 +- .../src/mage/cards/g/GoblinArtisans.java | 2 +- .../src/mage/cards/g/GoblinCharbelcher.java | 2 +- Mage.Sets/src/mage/cards/g/GoblinGuide.java | 3 +- .../src/mage/cards/g/GoblinMachinist.java | 2 +- Mage.Sets/src/mage/cards/g/GoblinWelder.java | 2 +- .../src/mage/cards/g/GodEternalKefnet.java | 4 +- .../src/mage/cards/g/GoldenGuardian.java | 2 +- Mage.Sets/src/mage/cards/g/GolemsHeart.java | 3 +- .../src/mage/cards/g/GontiLordOfLuxury.java | 4 +- .../src/mage/cards/g/GorgingVulture.java | 3 +- .../src/mage/cards/g/GrafdiggersCage.java | 2 +- .../src/mage/cards/g/GrandAbolisher.java | 4 +- .../src/mage/cards/g/GrandArchitect.java | 2 +- .../mage/cards/g/GrandMasterOfFlowers.java | 4 +- .../src/mage/cards/g/GratuitousViolence.java | 2 +- Mage.Sets/src/mage/cards/g/GraveBetrayal.java | 2 +- Mage.Sets/src/mage/cards/g/GravePact.java | 2 +- .../src/mage/cards/g/GraveyardShovel.java | 2 +- Mage.Sets/src/mage/cards/g/GreatbowDoyen.java | 3 +- Mage.Sets/src/mage/cards/g/GreenDragon.java | 2 +- .../src/mage/cards/g/GrenzoDungeonWarden.java | 2 +- Mage.Sets/src/mage/cards/g/GridMonitor.java | 2 +- Mage.Sets/src/mage/cards/g/GrimContest.java | 2 +- .../src/mage/cards/g/GrimoireOfTheDead.java | 2 +- .../src/mage/cards/g/GristTheHungerTide.java | 179 ++++++++++ .../mage/cards/g/GrothamaAllDevouring.java | 2 +- .../mage/cards/g/GrumgullyTheGenerous.java | 2 +- .../src/mage/cards/g/GruulRagebeast.java | 6 +- Mage.Sets/src/mage/cards/g/GuardianBeast.java | 5 +- .../src/mage/cards/g/GuardianOfTazeem.java | 2 +- Mage.Sets/src/mage/cards/g/GuidingSpirit.java | 2 +- .../src/mage/cards/g/GuildmagesForum.java | 2 +- Mage.Sets/src/mage/cards/g/GutterGrime.java | 3 +- .../src/mage/cards/g/GyomeMasterChef.java | 2 +- .../src/mage/cards/h/HalanaKessigRanger.java | 2 +- .../src/mage/cards/h/HaldanAvidArcanist.java | 4 +- .../src/mage/cards/h/HallOfGemstone.java | 2 +- Mage.Sets/src/mage/cards/h/HallOfOracles.java | 3 +- .../src/mage/cards/h/HallOfTheBanditLord.java | 3 +- .../src/mage/cards/h/HallowedMoonlight.java | 2 +- Mage.Sets/src/mage/cards/h/HallsOfMist.java | 2 +- .../src/mage/cards/h/HamletbackGoliath.java | 2 +- .../mage/cards/h/HamzaGuardianOfArashin.java | 2 +- Mage.Sets/src/mage/cards/h/HandToHand.java | 2 +- Mage.Sets/src/mage/cards/h/HansEriksson.java | 2 +- .../mage/cards/h/HapatraVizierOfPoisons.java | 2 +- .../src/mage/cards/h/HappilyEverAfter.java | 10 +- .../src/mage/cards/h/HardenedScales.java | 3 +- Mage.Sets/src/mage/cards/h/HarshDeceiver.java | 2 +- Mage.Sets/src/mage/cards/h/HarshMentor.java | 3 +- Mage.Sets/src/mage/cards/h/HarvestMage.java | 2 +- .../src/mage/cards/h/HatefulEidolon.java | 2 +- .../src/mage/cards/h/HauntingEchoes.java | 2 +- Mage.Sets/src/mage/cards/h/HauntingWind.java | 4 +- .../mage/cards/h/HavenOfTheSpiritDragon.java | 6 +- Mage.Sets/src/mage/cards/h/Heartstone.java | 4 +- .../mage/cards/h/HeartwoodStoryteller.java | 3 +- Mage.Sets/src/mage/cards/h/HeatStroke.java | 2 +- .../src/mage/cards/h/HedonistsTrove.java | 4 +- .../src/mage/cards/h/HedronFieldPurists.java | 2 +- Mage.Sets/src/mage/cards/h/HeirloomBlade.java | 2 +- .../src/mage/cards/h/HiddenPredators.java | 2 +- Mage.Sets/src/mage/cards/h/HiddenRetreat.java | 2 +- .../src/mage/cards/h/HintOfInsanity.java | 2 +- Mage.Sets/src/mage/cards/h/HiveMind.java | 4 +- .../src/mage/cards/h/HixusPrisonWarden.java | 2 +- .../src/mage/cards/h/HolisticWisdom.java | 4 +- .../src/mage/cards/h/HopeOfGhirapur.java | 3 +- .../src/mage/cards/h/HorobiDeathsWail.java | 2 +- .../src/mage/cards/h/HowlOfTheHorde.java | 2 +- Mage.Sets/src/mage/cards/h/HumOfTheRadix.java | 2 +- .../src/mage/cards/h/HuntersInsight.java | 2 +- Mage.Sets/src/mage/cards/h/Hushbringer.java | 2 +- Mage.Sets/src/mage/cards/h/HushwingGryff.java | 2 +- .../src/mage/cards/i/IchneumonDruid.java | 5 +- .../src/mage/cards/i/IdolOfEndurance.java | 2 +- .../mage/cards/i/IkraShidiqiTheUsurper.java | 3 +- .../src/mage/cards/i/IllunaApexOfWishes.java | 2 +- .../src/mage/cards/i/IllusionaryTerrain.java | 4 +- .../src/mage/cards/i/IllusionistsGambit.java | 2 +- .../src/mage/cards/i/ImmolationShaman.java | 2 +- .../src/mage/cards/i/ImmortalServitude.java | 2 +- .../src/mage/cards/i/ImposingSovereign.java | 2 +- Mage.Sets/src/mage/cards/i/Imprison.java | 3 +- .../src/mage/cards/i/ImprisonedInTheMoon.java | 4 +- .../src/mage/cards/i/ImpulsiveWager.java | 2 +- .../mage/cards/i/IndomitableCreativity.java | 2 +- .../src/mage/cards/i/InfernalDarkness.java | 3 +- .../src/mage/cards/i/InfernoProject.java | 2 +- Mage.Sets/src/mage/cards/i/InfernoTrap.java | 2 +- .../src/mage/cards/i/InfiniteReflection.java | 2 +- .../src/mage/cards/i/InkTreaderNephilim.java | 2 +- .../src/mage/cards/i/InsatiableRakghoul.java | 4 +- Mage.Sets/src/mage/cards/i/Insist.java | 2 +- Mage.Sets/src/mage/cards/i/Insurrection.java | 2 +- Mage.Sets/src/mage/cards/i/Interdict.java | 8 +- .../src/mage/cards/i/InterplanarBeacon.java | 2 +- Mage.Sets/src/mage/cards/i/IntoTheWilds.java | 2 +- .../src/mage/cards/i/InvokePrejudice.java | 2 +- .../src/mage/cards/i/IronscaleHydra.java | 2 +- .../src/mage/cards/i/IsolatedWatchtower.java | 2 +- Mage.Sets/src/mage/cards/i/IsolationCell.java | 2 +- .../mage/cards/j/JadziOracleOfArcavios.java | 2 +- .../src/mage/cards/j/JeskaiInfiltrator.java | 2 +- .../src/mage/cards/j/JourneyForTheElixir.java | 9 +- Mage.Sets/src/mage/cards/j/Justice.java | 3 +- .../mage/cards/k/KadenaSlinkingSorcerer.java | 2 +- .../mage/cards/k/KaheeraTheOrphanguard.java | 9 +- .../mage/cards/k/KalainReclusivePainter.java | 2 +- .../src/mage/cards/k/KalamaxTheStormsire.java | 7 +- .../mage/cards/k/KalitasTraitorOfGhet.java | 4 +- .../mage/cards/k/KaradorGhostChieftain.java | 2 +- .../src/mage/cards/k/KarfellHarbinger.java | 2 +- Mage.Sets/src/mage/cards/k/KarmicJustice.java | 3 +- Mage.Sets/src/mage/cards/k/KarnLiberated.java | 2 +- .../src/mage/cards/k/KarnSilverGolem.java | 4 +- .../src/mage/cards/k/KarnTheGreatCreator.java | 6 +- Mage.Sets/src/mage/cards/k/KarnsTouch.java | 8 +- .../mage/cards/k/KasminaEnigmaticMentor.java | 8 +- .../src/mage/cards/k/KatabaticWinds.java | 2 +- .../src/mage/cards/k/KayaOrzhovUsurper.java | 2 +- .../src/mage/cards/k/KazaRoilChaser.java | 4 +- .../mage/cards/k/KazarovSengirPureblood.java | 2 +- .../src/mage/cards/k/KelsFightFixer.java | 2 +- .../src/mage/cards/k/KeranosGodOfStorms.java | 3 +- .../src/mage/cards/k/KessDissidentMage.java | 2 +- .../mage/cards/k/KianneDeanOfSubstance.java | 2 +- .../src/mage/cards/k/KillerInstinct.java | 2 +- .../src/mage/cards/k/KillianInkDuelist.java | 5 +- .../src/mage/cards/k/KinjallisSunwing.java | 2 +- .../mage/cards/k/KioraMasterOfTheDepths.java | 4 +- .../mage/cards/k/KiraGreatGlassSpinner.java | 3 +- Mage.Sets/src/mage/cards/k/Kismet.java | 7 +- .../src/mage/cards/k/KlothysGodOfDestiny.java | 2 +- Mage.Sets/src/mage/cards/k/KnightsCharge.java | 3 +- .../src/mage/cards/k/KollTheForgemaster.java | 3 +- .../src/mage/cards/k/KrovikanHorror.java | 2 +- .../src/mage/cards/k/KrovikanVampire.java | 4 +- .../cards/k/KroxaTitanOfDeathsHunger.java | 2 +- Mage.Sets/src/mage/cards/k/Kudzu.java | 2 +- .../src/mage/cards/k/KumanosBlessing.java | 2 +- .../mage/cards/k/KunorosHoundOfAthreos.java | 2 +- .../mage/cards/k/KurkeshOnakkeAncient.java | 2 +- .../mage/cards/l/LagonnaBandStoryteller.java | 2 +- Mage.Sets/src/mage/cards/l/LandsEdge.java | 2 +- .../src/mage/cards/l/LashknifeBarrier.java | 2 +- Mage.Sets/src/mage/cards/l/LavaballTrap.java | 2 +- Mage.Sets/src/mage/cards/l/Leapfrog.java | 3 +- Mage.Sets/src/mage/cards/l/Legerdemain.java | 4 +- .../src/mage/cards/l/LeylineOfLifeforce.java | 3 +- .../src/mage/cards/l/LiegeOfTheTangle.java | 22 +- Mage.Sets/src/mage/cards/l/LifeAndLimb.java | 4 +- .../src/mage/cards/l/LifecraftAwakening.java | 2 +- .../src/mage/cards/l/LightOfSanction.java | 2 +- .../src/mage/cards/l/LilianasDefeat.java | 2 +- .../src/mage/cards/l/LilianasIndignation.java | 3 +- .../mage/cards/l/LilianasStandardBearer.java | 2 +- .../mage/cards/l/LimDulTheNecromancer.java | 2 +- .../mage/cards/l/LinvalaKeeperOfSilence.java | 2 +- .../src/mage/cards/l/LithoformEngine.java | 2 +- .../src/mage/cards/l/LlanowarEmpath.java | 2 +- Mage.Sets/src/mage/cards/l/LoafingGiant.java | 3 +- Mage.Sets/src/mage/cards/l/LordWindgrace.java | 2 +- .../src/mage/cards/l/LoxodonGatekeeper.java | 7 +- .../mage/cards/l/LukkaCoppercoatOutcast.java | 5 +- .../src/mage/cards/l/LumengridAugur.java | 2 +- .../src/mage/cards/l/LuminousBroodmoth.java | 2 +- .../src/mage/cards/l/LurkingJackals.java | 2 +- .../src/mage/cards/l/LurkingPredators.java | 2 +- .../src/mage/cards/l/LurrusOfTheDreamDen.java | 4 +- .../src/mage/cards/l/LutriTheSpellchaser.java | 2 +- .../src/mage/cards/m/MadcapExperiment.java | 2 +- Mage.Sets/src/mage/cards/m/MaelstromMuse.java | 4 +- Mage.Sets/src/mage/cards/m/MageDuel.java | 3 +- Mage.Sets/src/mage/cards/m/MageHunter.java | 2 +- .../src/mage/cards/m/MagisterOfWorth.java | 3 +- Mage.Sets/src/mage/cards/m/MagneticMine.java | 3 +- .../src/mage/cards/m/MagusOfTheBridge.java | 2 +- .../src/mage/cards/m/MalevolentNoble.java | 6 +- Mage.Sets/src/mage/cards/m/ManaWeb.java | 3 +- Mage.Sets/src/mage/cards/m/Manabond.java | 2 +- Mage.Sets/src/mage/cards/m/Manglehorn.java | 2 +- .../src/mage/cards/m/MarchOfTheMachines.java | 2 +- .../mage/cards/m/MarchesaTheBlackRose.java | 3 +- Mage.Sets/src/mage/cards/m/MartyrsBond.java | 4 +- .../src/mage/cards/m/MartyrsOfKorlis.java | 2 +- Mage.Sets/src/mage/cards/m/MaskwoodNexus.java | 12 +- Mage.Sets/src/mage/cards/m/MassPolymorph.java | 2 +- Mage.Sets/src/mage/cards/m/MassacreGirl.java | 2 +- Mage.Sets/src/mage/cards/m/MassacreWurm.java | 3 +- .../src/mage/cards/m/MasterBiomancer.java | 2 +- .../mage/cards/m/MasterOfPredicaments.java | 2 +- .../mage/cards/m/MasterfulReplication.java | 2 +- .../mage/cards/m/MavindaStudentsAdvocate.java | 3 +- Mage.Sets/src/mage/cards/m/Meddle.java | 2 +- .../src/mage/cards/m/MelekIzzetParagon.java | 4 +- .../src/mage/cards/m/MeliraSylvokOutcast.java | 3 +- Mage.Sets/src/mage/cards/m/Meltdown.java | 2 +- Mage.Sets/src/mage/cards/m/MetallicMimic.java | 2 +- .../mage/cards/m/MetamorphicAlteration.java | 6 +- .../mage/cards/m/MetzaliTowerOfTriumph.java | 2 +- .../src/mage/cards/m/MilaCraftyCompanion.java | 5 +- Mage.Sets/src/mage/cards/m/MimicVat.java | 3 +- Mage.Sets/src/mage/cards/m/MindFuneral.java | 2 +- Mage.Sets/src/mage/cards/m/MindGrind.java | 2 +- Mage.Sets/src/mage/cards/m/MindsDilation.java | 2 +- Mage.Sets/src/mage/cards/m/MineLayer.java | 2 +- Mage.Sets/src/mage/cards/m/Mirari.java | 7 +- .../mage/cards/m/MirkoVoskMindDrinker.java | 2 +- Mage.Sets/src/mage/cards/m/MirrorGolem.java | 2 +- Mage.Sets/src/mage/cards/m/MirrorMatch.java | 2 +- .../src/mage/cards/m/MirrorwingDragon.java | 2 +- .../mage/cards/m/MishraArtificerProdigy.java | 3 +- Mage.Sets/src/mage/cards/m/Mistcaller.java | 2 +- .../src/mage/cards/m/MistmoonGriffin.java | 2 +- .../src/mage/cards/m/MnemonicBetrayal.java | 2 +- Mage.Sets/src/mage/cards/m/MobMentality.java | 2 +- Mage.Sets/src/mage/cards/m/MolderBeast.java | 3 +- .../mage/cards/m/MomirVigSimicVisionary.java | 2 +- Mage.Sets/src/mage/cards/m/Moonhold.java | 2 +- .../src/mage/cards/m/MoritteOfTheFrost.java | 2 +- .../src/mage/cards/m/MorticianBeetle.java | 3 +- .../src/mage/cards/m/MossPitSkeleton.java | 2 +- .../src/mage/cards/m/MountVelusManticore.java | 2 +- .../src/mage/cards/m/MowuLoyalCompanion.java | 2 +- .../mage/cards/m/MuldrothaTheGravetide.java | 4 +- .../src/mage/cards/m/MurktideRegent.java | 4 +- .../src/mage/cards/m/MuxusGoblinGrandee.java | 2 +- .../src/mage/cards/m/MycosynthLattice.java | 2 +- .../mage/cards/m/MysteriousPathlighter.java | 2 +- .../src/mage/cards/m/MysticReflection.java | 4 +- Mage.Sets/src/mage/cards/m/MysticRemora.java | 2 +- .../src/mage/cards/m/MythosOfIlluna.java | 2 +- .../src/mage/cards/m/MythosOfNethroi.java | 2 +- .../cards/n/NadierAgentOfTheDuskenel.java | 2 +- .../src/mage/cards/n/NahirisLithoforming.java | 2 +- .../mage/cards/n/NarsetEnlightenedMaster.java | 4 +- .../mage/cards/n/NarsetOfTheAncientWay.java | 4 +- .../src/mage/cards/n/NarsetTranscendent.java | 4 +- .../src/mage/cards/n/NascentMetamorph.java | 2 +- Mage.Sets/src/mage/cards/n/NecroticOoze.java | 2 +- Mage.Sets/src/mage/cards/n/NestOfScarabs.java | 2 +- Mage.Sets/src/mage/cards/n/NetherShadow.java | 2 +- Mage.Sets/src/mage/cards/n/NetherTraitor.java | 2 +- .../src/mage/cards/n/NeurokFamiliar.java | 2 +- .../mage/cards/n/NicolBolasGodPharaoh.java | 2 +- .../src/mage/cards/n/NikyaOfTheOldWays.java | 2 +- .../src/mage/cards/n/NimDeathmantle.java | 3 +- .../src/mage/cards/n/NissaSageAnimist.java | 2 +- .../src/mage/cards/n/NissasRevelation.java | 2 +- .../mage/cards/n/NivixAerieOfTheFiremind.java | 2 +- Mage.Sets/src/mage/cards/n/NoMercy.java | 3 +- Mage.Sets/src/mage/cards/n/NoblePurpose.java | 3 +- Mage.Sets/src/mage/cards/n/NullRod.java | 2 +- Mage.Sets/src/mage/cards/n/NullhideFerox.java | 2 +- .../src/mage/cards/n/NullstoneGargoyle.java | 2 +- .../src/mage/cards/n/NykthosParagon.java | 2 +- Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfChandra.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfDruids.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfGideon.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfKaya.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfLiliana.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfNissa.java | 2 +- Mage.Sets/src/mage/cards/o/ObeliskSpider.java | 2 +- Mage.Sets/src/mage/cards/o/OblivionStone.java | 2 +- .../src/mage/cards/o/ObsidianCharmaw.java | 3 +- Mage.Sets/src/mage/cards/o/Occupation.java | 2 +- .../src/mage/cards/o/OldGrowthTroll.java | 6 +- Mage.Sets/src/mage/cards/o/OmenMachine.java | 3 +- .../src/mage/cards/o/OneWithTheStars.java | 4 +- .../src/mage/cards/o/OonasBlackguard.java | 2 +- Mage.Sets/src/mage/cards/o/OpalAvenger.java | 2 +- Mage.Sets/src/mage/cards/o/OpalTitan.java | 4 +- Mage.Sets/src/mage/cards/o/Opalescence.java | 4 +- Mage.Sets/src/mage/cards/o/OpenSeason.java | 2 +- .../src/mage/cards/o/OpenTheOmenpaths.java | 2 +- Mage.Sets/src/mage/cards/o/OpenTheVaults.java | 2 +- Mage.Sets/src/mage/cards/o/OranRiefHydra.java | 2 +- Mage.Sets/src/mage/cards/o/OrbsOfWarding.java | 2 +- Mage.Sets/src/mage/cards/o/OriqLoremage.java | 2 +- Mage.Sets/src/mage/cards/o/Overmaster.java | 2 +- .../src/mage/cards/p/PakoArcaneRetriever.java | 2 +- Mage.Sets/src/mage/cards/p/PaleMoon.java | 5 +- Mage.Sets/src/mage/cards/p/Panharmonicon.java | 5 +- Mage.Sets/src/mage/cards/p/Parcelbeast.java | 2 +- Mage.Sets/src/mage/cards/p/Paroxysm.java | 2 +- Mage.Sets/src/mage/cards/p/PastInFlames.java | 7 +- .../src/mage/cards/p/PatientRebuilding.java | 2 +- .../src/mage/cards/p/PatronOfTheVein.java | 2 +- Mage.Sets/src/mage/cards/p/PeaceTalks.java | 2 +- Mage.Sets/src/mage/cards/p/Peacekeeper.java | 2 +- .../src/mage/cards/p/PedanticLearning.java | 2 +- .../src/mage/cards/p/PermafrostTrap.java | 2 +- .../src/mage/cards/p/PestilenceDemon.java | 2 +- .../src/mage/cards/p/PhyrexianMetamorph.java | 4 +- .../src/mage/cards/p/PhyrexianTotem.java | 2 +- .../src/mage/cards/p/PistonFistCyclops.java | 2 +- .../mage/cards/p/PlaneswalkersMischief.java | 4 +- .../src/mage/cards/p/PlarggDeanOfChaos.java | 2 +- Mage.Sets/src/mage/cards/p/Polymorph.java | 2 +- .../src/mage/cards/p/PossibilityStorm.java | 17 +- Mage.Sets/src/mage/cards/p/PowerDepot.java | 2 +- Mage.Sets/src/mage/cards/p/Powerleech.java | 4 +- .../src/mage/cards/p/PrecursorGolem.java | 2 +- .../src/mage/cards/p/PredatoryAdvantage.java | 2 +- .../src/mage/cards/p/PresenceOfTheMaster.java | 2 +- Mage.Sets/src/mage/cards/p/PriceOfGlory.java | 3 +- Mage.Sets/src/mage/cards/p/PrimalEmpathy.java | 4 +- Mage.Sets/src/mage/cards/p/PrimalSurge.java | 2 +- Mage.Sets/src/mage/cards/p/PrimalVigor.java | 2 +- .../src/mage/cards/p/PrimitiveEtchings.java | 3 +- .../src/mage/cards/p/ProfaneMemento.java | 3 +- Mage.Sets/src/mage/cards/p/ProperBurial.java | 2 +- Mage.Sets/src/mage/cards/p/Prophecy.java | 2 +- Mage.Sets/src/mage/cards/p/ProteusStaff.java | 2 +- .../src/mage/cards/p/ProvokeTheTrolls.java | 2 +- Mage.Sets/src/mage/cards/p/PsychicMiasma.java | 2 +- .../src/mage/cards/p/PulseOfLlanowar.java | 2 +- Mage.Sets/src/mage/cards/p/Purgatory.java | 3 +- Mage.Sets/src/mage/cards/p/Pyramids.java | 2 +- .../src/mage/cards/p/PyromancerAscension.java | 12 +- .../src/mage/cards/p/PyromancersGauntlet.java | 6 +- .../src/mage/cards/p/PyromancersSwath.java | 2 +- .../src/mage/cards/p/PyrrhicRevival.java | 2 +- .../src/mage/cards/p/PyxisOfPandemonium.java | 2 +- .../src/mage/cards/q/QuestForUlasTemple.java | 2 +- Mage.Sets/src/mage/cards/q/QuestingBeast.java | 2 +- Mage.Sets/src/mage/cards/q/Quicken.java | 4 +- .../src/mage/cards/q/QuicksilverFountain.java | 4 +- Mage.Sets/src/mage/cards/r/RaidersKarve.java | 2 +- .../src/mage/cards/r/RakdosLordOfRiots.java | 3 +- .../mage/cards/r/RakdosTheShowstopper.java | 2 +- .../src/mage/cards/r/RalStormConduit.java | 4 +- Mage.Sets/src/mage/cards/r/RallyTheHorde.java | 2 +- .../src/mage/cards/r/RangerCaptainOfEos.java | 2 +- .../mage/cards/r/RashmiEternitiesCrafter.java | 2 +- Mage.Sets/src/mage/cards/r/RatchetBomb.java | 2 +- Mage.Sets/src/mage/cards/r/RavagerWurm.java | 2 +- Mage.Sets/src/mage/cards/r/RavenousSlime.java | 4 +- .../mage/cards/r/RayamiFirstOfTheFallen.java | 4 +- .../src/mage/cards/r/RealityScramble.java | 4 +- Mage.Sets/src/mage/cards/r/ReasonBelieve.java | 2 +- Mage.Sets/src/mage/cards/r/Reclamation.java | 3 +- .../src/mage/cards/r/ReflectiveGolem.java | 2 +- .../src/mage/cards/r/RefractionTrap.java | 2 +- .../mage/cards/r/ReidaneGodOfTheWorthy.java | 4 +- .../src/mage/cards/r/RelentlessPursuit.java | 4 +- Mage.Sets/src/mage/cards/r/RelicRunner.java | 2 +- .../src/mage/cards/r/RemoveEnchantments.java | 2 +- .../mage/cards/r/RenataCalledToTheHunt.java | 2 +- .../mage/cards/r/RenegadeDoppelganger.java | 2 +- .../src/mage/cards/r/RenownedWeaponsmith.java | 2 +- Mage.Sets/src/mage/cards/r/Reparations.java | 3 +- .../mage/cards/r/RepeatedReverberation.java | 2 +- Mage.Sets/src/mage/cards/r/Repercussion.java | 2 +- .../mage/cards/r/ReturnOfTheWildspeaker.java | 3 +- .../src/mage/cards/r/RevengeStarWars.java | 2 +- .../src/mage/cards/r/ReversePolarity.java | 2 +- Mage.Sets/src/mage/cards/r/Reweave.java | 6 +- .../mage/cards/r/ReyhanLastOfTheAbzan.java | 3 +- .../src/mage/cards/r/RhythmOfTheWild.java | 2 +- .../mage/cards/r/RienneAngelOfRebirth.java | 2 +- .../src/mage/cards/r/RionyaFireDancer.java | 2 +- .../src/mage/cards/r/RiptideShapeshifter.java | 2 +- .../src/mage/cards/r/RiseOfTheDarkRealms.java | 2 +- Mage.Sets/src/mage/cards/r/RisenReef.java | 2 +- .../src/mage/cards/r/RitualOfSubdual.java | 3 +- Mage.Sets/src/mage/cards/r/RoleReversal.java | 6 +- .../src/mage/cards/r/RonaDiscipleOfGix.java | 2 +- Mage.Sets/src/mage/cards/r/RoninWarclub.java | 3 +- Mage.Sets/src/mage/cards/r/RootMaze.java | 3 +- Mage.Sets/src/mage/cards/r/RowdyCrew.java | 2 +- Mage.Sets/src/mage/cards/r/Rowen.java | 3 +- Mage.Sets/src/mage/cards/r/RumblingRuin.java | 2 +- Mage.Sets/src/mage/cards/r/RunicArmasaur.java | 5 +- .../src/mage/cards/r/RuricTharTheUnbowed.java | 3 +- .../src/mage/cards/r/RuthlessDeathfang.java | 3 +- .../src/mage/cards/r/RuthlessInvasion.java | 2 +- Mage.Sets/src/mage/cards/s/SacredGround.java | 3 +- .../src/mage/cards/s/SaddledRimestag.java | 2 +- Mage.Sets/src/mage/cards/s/SageOfFables.java | 2 +- Mage.Sets/src/mage/cards/s/SagesReverie.java | 2 +- .../src/mage/cards/s/SanctumPrelate.java | 2 +- Mage.Sets/src/mage/cards/s/Sangromancer.java | 3 +- .../src/mage/cards/s/SaplingOfColfenor.java | 2 +- .../src/mage/cards/s/SaprazzanBailiff.java | 2 +- .../src/mage/cards/s/SaprazzanBreaker.java | 3 +- .../mage/cards/s/SarkhanTheDragonspeaker.java | 4 +- .../mage/cards/s/SarkhanTheMasterless.java | 6 +- .../src/mage/cards/s/SatyrFiredancer.java | 3 +- Mage.Sets/src/mage/cards/s/SavaenElves.java | 2 +- Mage.Sets/src/mage/cards/s/SavageFirecat.java | 3 +- .../src/mage/cards/s/SavageSummoning.java | 6 +- .../mage/cards/s/SavraQueenOfTheGolgari.java | 5 +- .../src/mage/cards/s/ScabClanBerserker.java | 2 +- .../src/mage/cards/s/ScavengingOoze.java | 2 +- .../mage/cards/s/ScholarOfTheLostTrove.java | 2 +- Mage.Sets/src/mage/cards/s/ScoutsWarning.java | 4 +- Mage.Sets/src/mage/cards/s/ScrapTrawler.java | 2 +- Mage.Sets/src/mage/cards/s/ScribNibblers.java | 2 +- Mage.Sets/src/mage/cards/s/ScrollOfFate.java | 2 +- .../src/mage/cards/s/ScytheOfTheWretched.java | 2 +- .../src/mage/cards/s/SeaGateStormcaller.java | 2 +- .../src/mage/cards/s/SearchForGlory.java | 2 +- .../src/mage/cards/s/SearchForSurvivors.java | 2 +- .../src/mage/cards/s/SeasonOfTheWitch.java | 4 +- .../mage/cards/s/SedrisTheTraitorKing.java | 2 +- .../src/mage/cards/s/SeekerOfInsight.java | 2 +- .../src/mage/cards/s/SelvalasStampede.java | 2 +- .../src/mage/cards/s/SemblanceAnvil.java | 2 +- Mage.Sets/src/mage/cards/s/SemestersEnd.java | 4 +- .../src/mage/cards/s/SenatorLottDod.java | 2 +- Mage.Sets/src/mage/cards/s/SentinelTower.java | 2 +- .../src/mage/cards/s/SerpentsSoulJar.java | 2 +- Mage.Sets/src/mage/cards/s/SerraBestiary.java | 2 +- .../mage/cards/s/SevinneTheChronoclasm.java | 2 +- Mage.Sets/src/mage/cards/s/ShallowGrave.java | 2 +- Mage.Sets/src/mage/cards/s/ShapeAnew.java | 2 +- .../src/mage/cards/s/ShapersSanctuary.java | 2 +- .../src/mage/cards/s/ShapeshiftersMarrow.java | 2 +- Mage.Sets/src/mage/cards/s/SharedSummons.java | 2 +- .../src/mage/cards/s/ShiftingLoyalties.java | 6 +- .../src/mage/cards/s/ShiftingShadow.java | 2 +- Mage.Sets/src/mage/cards/s/ShiningShoal.java | 2 +- .../mage/cards/s/ShireiShizosCaretaker.java | 3 +- .../src/mage/cards/s/ShowOfConfidence.java | 3 +- Mage.Sets/src/mage/cards/s/ShrivelingRot.java | 4 +- .../src/mage/cards/s/SidisiBroodTyrant.java | 2 +- .../src/mage/cards/s/SilburlindSnapper.java | 2 +- .../src/mage/cards/s/SilverfurPartisan.java | 4 +- .../src/mage/cards/s/SimicAscendancy.java | 2 +- Mage.Sets/src/mage/cards/s/Sindbad.java | 4 +- Mage.Sets/src/mage/cards/s/SingleCombat.java | 2 +- .../mage/cards/s/SionaCaptainOfThePyleas.java | 2 +- .../src/mage/cards/s/SirenStormtamer.java | 4 +- Mage.Sets/src/mage/cards/s/SirensCall.java | 2 +- .../src/mage/cards/s/SkophosMazeWarden.java | 4 +- .../src/mage/cards/s/SkullportMerchant.java | 2 +- .../src/mage/cards/s/SlumberingTora.java | 4 +- .../src/mage/cards/s/SmashingSuccess.java | 2 +- .../mage/cards/s/SmotheringAbomination.java | 3 +- .../src/mage/cards/s/SnapcasterMage.java | 2 +- Mage.Sets/src/mage/cards/s/SnowMercy.java | 2 +- .../src/mage/cards/s/SoldeviMachinist.java | 2 +- Mage.Sets/src/mage/cards/s/SongOfBlood.java | 4 +- .../src/mage/cards/s/SongOfTheDryads.java | 4 +- .../src/mage/cards/s/SosukeSonOfSeshiro.java | 2 +- Mage.Sets/src/mage/cards/s/SoulBurn.java | 4 +- Mage.Sets/src/mage/cards/s/SoulScarMage.java | 2 +- Mage.Sets/src/mage/cards/s/SoulSculptor.java | 6 +- Mage.Sets/src/mage/cards/s/Soulflayer.java | 2 +- Mage.Sets/src/mage/cards/s/Soulherder.java | 2 +- Mage.Sets/src/mage/cards/s/SparkDouble.java | 4 +- Mage.Sets/src/mage/cards/s/Spellshift.java | 2 +- .../mage/cards/s/SphereOfAnnihilation.java | 2 +- .../src/mage/cards/s/SphereOfPurity.java | 2 +- .../src/mage/cards/s/SphinxAmbassador.java | 2 +- Mage.Sets/src/mage/cards/s/SphinxsDecree.java | 2 +- .../src/mage/cards/s/SphinxsTutelage.java | 2 +- .../src/mage/cards/s/SpitefulReturned.java | 3 +- Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java | 3 +- Mage.Sets/src/mage/cards/s/Sporogenesis.java | 5 +- .../src/mage/cards/s/SquealingDevil.java | 2 +- Mage.Sets/src/mage/cards/s/Starfall.java | 2 +- .../src/mage/cards/s/StarfieldOfNyx.java | 7 +- .../src/mage/cards/s/StartYourEngines.java | 4 +- Mage.Sets/src/mage/cards/s/SteamVines.java | 2 +- Mage.Sets/src/mage/cards/s/SteelGolem.java | 2 +- Mage.Sets/src/mage/cards/s/StolenGoods.java | 2 +- .../src/mage/cards/s/StolenStrategy.java | 2 +- .../src/mage/cards/s/StoneworkPackbeast.java | 7 +- Mage.Sets/src/mage/cards/s/StonySilence.java | 2 +- Mage.Sets/src/mage/cards/s/StorageMatrix.java | 2 +- .../src/mage/cards/s/StormwingEntity.java | 2 +- .../src/mage/cards/s/StorrevDevkarinLich.java | 2 +- .../src/mage/cards/s/StrixhavenStadium.java | 2 +- .../src/mage/cards/s/StrongarmTactics.java | 2 +- .../src/mage/cards/s/StrongholdGambit.java | 4 +- .../mage/cards/s/SubiraTulzidiCaravanner.java | 2 +- Mage.Sets/src/mage/cards/s/SummonThePack.java | 2 +- Mage.Sets/src/mage/cards/s/SummonersEgg.java | 2 +- Mage.Sets/src/mage/cards/s/SummoningTrap.java | 3 +- Mage.Sets/src/mage/cards/s/SuturePriest.java | 3 +- .../src/mage/cards/s/SydriGalvanicGenius.java | 8 +- .../src/mage/cards/s/SynodCenturion.java | 2 +- .../src/mage/cards/s/SyntheticDestiny.java | 2 +- .../src/mage/cards/s/SyrCarahTheBold.java | 2 +- .../src/mage/cards/s/SyrKonradTheGrim.java | 4 +- Mage.Sets/src/mage/cards/s/SzatsWill.java | 2 +- .../src/mage/cards/t/TaigamOjutaiMaster.java | 2 +- Mage.Sets/src/mage/cards/t/TajuruParagon.java | 15 +- Mage.Sets/src/mage/cards/t/Tamanoa.java | 2 +- .../src/mage/cards/t/TapestryOfTheAges.java | 2 +- .../src/mage/cards/t/TayamLuminousEnigma.java | 2 +- .../src/mage/cards/t/TeachByExample.java | 2 +- .../src/mage/cards/t/TeferiMageOfZhalfir.java | 10 +- Mage.Sets/src/mage/cards/t/TeferisMoat.java | 2 +- .../src/mage/cards/t/TeferisTimeTwist.java | 2 +- .../src/mage/cards/t/TeleminPerformance.java | 2 +- .../src/mage/cards/t/TemporalAperture.java | 2 +- .../src/mage/cards/t/TemurWarShaman.java | 4 +- .../src/mage/cards/t/TergridGodOfFright.java | 2 +- .../src/mage/cards/t/TestamentOfFaith.java | 2 +- .../src/mage/cards/t/TeysaEnvoyOfGhosts.java | 2 +- Mage.Sets/src/mage/cards/t/TeysaKarlov.java | 2 +- .../mage/cards/t/TezzeretCruelMachinist.java | 6 +- .../cards/t/TezzeretMasterOfTheBridge.java | 2 +- .../src/mage/cards/t/TezzeretTheSeeker.java | 8 +- .../src/mage/cards/t/ThaliaHereticCathar.java | 4 +- .../src/mage/cards/t/TheAntiquitiesWar.java | 10 +- Mage.Sets/src/mage/cards/t/TheBiblioplex.java | 2 +- .../mage/cards/t/TheBindingOfTheTitans.java | 2 +- Mage.Sets/src/mage/cards/t/TheFallen.java | 2 +- .../src/mage/cards/t/TheGitrogMonster.java | 2 +- .../src/mage/cards/t/TheImmortalSun.java | 2 +- .../src/mage/cards/t/TheMirariConjecture.java | 3 +- .../src/mage/cards/t/TheScorpionGod.java | 2 +- .../mage/cards/t/TheTricksterGodsHeist.java | 6 +- .../mage/cards/t/TheoreticalDuplication.java | 2 +- Mage.Sets/src/mage/cards/t/ThiefOfSanity.java | 2 +- .../src/mage/cards/t/ThievingAmalgam.java | 2 +- .../src/mage/cards/t/ThievingSkydiver.java | 2 +- Mage.Sets/src/mage/cards/t/ThirstingAxe.java | 2 +- .../src/mage/cards/t/ThopterSpyNetwork.java | 2 +- .../src/mage/cards/t/ThoughtDissector.java | 2 +- .../src/mage/cards/t/ThousandYearElixir.java | 2 +- .../src/mage/cards/t/ThousandYearStorm.java | 2 +- .../src/mage/cards/t/ThrasiosTritonHero.java | 2 +- Mage.Sets/src/mage/cards/t/Thraximundar.java | 3 +- .../src/mage/cards/t/TianaShipsCaretaker.java | 5 +- Mage.Sets/src/mage/cards/t/TitaniasSong.java | 2 +- .../cards/t/TomikDistinguishedAdvokist.java | 2 +- .../src/mage/cards/t/ToppleTheStatue.java | 2 +- Mage.Sets/src/mage/cards/t/TorporOrb.java | 2 +- .../src/mage/cards/t/TorrentSculptor.java | 2 +- Mage.Sets/src/mage/cards/t/TotalWar.java | 3 +- .../src/mage/cards/t/TouchOfMoonglove.java | 3 +- Mage.Sets/src/mage/cards/t/Toymaker.java | 8 +- Mage.Sets/src/mage/cards/t/TrackDown.java | 2 +- .../src/mage/cards/t/TrainingGrounds.java | 3 +- Mage.Sets/src/mage/cards/t/Transmogrify.java | 2 +- Mage.Sets/src/mage/cards/t/TreasureHunt.java | 2 +- .../src/mage/cards/t/TreasureKeeper.java | 2 +- .../src/mage/cards/t/TreasureNabber.java | 3 +- .../src/mage/cards/t/TrepanationBlade.java | 2 +- .../src/mage/cards/t/TrespassersCurse.java | 2 +- .../mage/cards/t/TrostaniSelesnyasVoice.java | 3 +- Mage.Sets/src/mage/cards/t/TsabosWeb.java | 2 +- Mage.Sets/src/mage/cards/t/TunnelIgnus.java | 5 +- .../src/mage/cards/t/TurntimberSower.java | 2 +- .../src/mage/cards/t/TuvasaTheSunlit.java | 2 +- .../mage/cards/t/TymaretChosenFromDeath.java | 2 +- .../src/mage/cards/t/TyrantOfDiscord.java | 2 +- .../src/mage/cards/u/UmoriTheCollector.java | 4 +- .../src/mage/cards/u/UnboundFlourishing.java | 4 +- .../src/mage/cards/u/UncageTheMenagerie.java | 2 +- Mage.Sets/src/mage/cards/u/UncleIstvan.java | 2 +- .../mage/cards/u/UnconventionalTactics.java | 3 +- .../src/mage/cards/u/UndeadAlchemist.java | 2 +- .../src/mage/cards/u/UndercityInformer.java | 2 +- .../src/mage/cards/u/UnderworldBreach.java | 2 +- Mage.Sets/src/mage/cards/u/UndyingFlames.java | 2 +- .../src/mage/cards/u/UnexpectedResults.java | 2 +- .../mage/cards/u/UnpredictableCyclone.java | 4 +- .../mage/cards/u/UnscytheKillerOfKings.java | 3 +- Mage.Sets/src/mage/cards/u/UphillBattle.java | 6 +- .../src/mage/cards/u/UrabraskTheHidden.java | 3 +- Mage.Sets/src/mage/cards/u/UrzasChalice.java | 2 +- .../mage/cards/v/VaevictisAsmadiTheDire.java | 2 +- .../cards/v/ValakutTheMoltenPinnacle.java | 3 +- .../mage/cards/v/ValentinDeanOfTheVein.java | 2 +- .../mage/cards/v/VancesBlastingCannons.java | 4 +- .../src/mage/cards/v/VanquishersBanner.java | 3 +- .../mage/cards/v/VarolzTheScarStriped.java | 2 +- .../src/mage/cards/v/VedalkenEngineer.java | 2 +- .../src/mage/cards/v/VeiledCrocodile.java | 2 +- Mage.Sets/src/mage/cards/v/VeiledSentry.java | 4 +- .../src/mage/cards/v/VeilstoneAmulet.java | 4 +- .../src/mage/cards/v/VengefulPharaoh.java | 2 +- .../src/mage/cards/v/VengefulRebirth.java | 2 +- Mage.Sets/src/mage/cards/v/Vengevine.java | 3 +- .../src/mage/cards/v/VerdantCommand.java | 2 +- .../src/mage/cards/v/VerdantSunsAvatar.java | 3 +- Mage.Sets/src/mage/cards/v/VerityCircle.java | 2 +- .../src/mage/cards/v/VeteranAdventurer.java | 6 +- .../mage/cards/v/VeyranVoiceOfDuality.java | 2 +- Mage.Sets/src/mage/cards/v/ViashinoBey.java | 2 +- .../src/mage/cards/v/VigeanIntuition.java | 2 +- .../src/mage/cards/v/VigilForTheLost.java | 3 +- Mage.Sets/src/mage/cards/v/Vigor.java | 2 +- Mage.Sets/src/mage/cards/v/VileRedeemer.java | 2 +- .../src/mage/cards/v/VillageCannibals.java | 3 +- Mage.Sets/src/mage/cards/v/ViridianRevel.java | 3 +- .../cards/v/VivienChampionOfTheWilds.java | 4 +- .../mage/cards/v/VivienMonstersAdvocate.java | 2 +- .../src/mage/cards/v/ViviensGrizzly.java | 2 +- .../mage/cards/v/VizierOfTheMenagerie.java | 2 +- Mage.Sets/src/mage/cards/v/Void.java | 2 +- Mage.Sets/src/mage/cards/v/VoidMaw.java | 4 +- .../mage/cards/v/VolrathsShapeshifter.java | 8 +- .../mage/cards/v/VorinclexVoiceOfHunger.java | 2 +- .../mage/cards/v/VraskaSwarmsEminence.java | 2 +- .../src/mage/cards/v/VraskaTheUnseen.java | 2 +- .../src/mage/cards/w/WallOfCaltrops.java | 2 +- Mage.Sets/src/mage/cards/w/WallOfEssence.java | 2 +- .../src/mage/cards/w/WallOfPutridFlesh.java | 4 +- Mage.Sets/src/mage/cards/w/WandOfDenial.java | 2 +- Mage.Sets/src/mage/cards/w/WandOfIth.java | 2 +- .../src/mage/cards/w/WanderingArchaic.java | 4 +- Mage.Sets/src/mage/cards/w/WardOfBones.java | 8 +- Mage.Sets/src/mage/cards/w/WarpWorld.java | 8 +- Mage.Sets/src/mage/cards/w/WarstormSurge.java | 3 +- Mage.Sets/src/mage/cards/w/WasteNot.java | 7 +- Mage.Sets/src/mage/cards/w/WaveOfVitriol.java | 2 +- .../src/mage/cards/w/WeatheredRunestone.java | 2 +- .../src/mage/cards/w/WeatherseedTotem.java | 2 +- Mage.Sets/src/mage/cards/w/WellLaidPlans.java | 2 +- .../src/mage/cards/w/WharfInfiltrator.java | 3 +- Mage.Sets/src/mage/cards/w/WhiplashTrap.java | 2 +- .../src/mage/cards/w/WhispersteelDagger.java | 4 +- .../src/mage/cards/w/WidespreadBrutality.java | 2 +- Mage.Sets/src/mage/cards/w/WildDefiance.java | 4 +- Mage.Sets/src/mage/cards/w/WildEvocation.java | 2 +- .../src/mage/cards/w/WildfireDevils.java | 2 +- .../src/mage/cards/w/WildwoodScourge.java | 2 +- Mage.Sets/src/mage/cards/w/Willbreaker.java | 3 +- .../src/mage/cards/w/WindingConstrictor.java | 2 +- .../mage/cards/w/WingedTempleOfOrazca.java | 2 +- Mage.Sets/src/mage/cards/w/WookieeMystic.java | 2 +- Mage.Sets/src/mage/cards/w/WordOfCommand.java | 4 +- Mage.Sets/src/mage/cards/w/WorldAtWar.java | 3 +- .../src/mage/cards/w/WormsOfTheEarth.java | 2 +- .../src/mage/cards/x/XenicPoltergeist.java | 8 +- .../src/mage/cards/y/YedoraGraveGardener.java | 4 +- .../src/mage/cards/z/ZabazTheGlimmerwasp.java | 2 +- .../src/mage/cards/z/ZadaHedronGrinder.java | 2 +- .../mage/cards/z/ZagrasThiefOfHeartbeats.java | 4 +- .../src/mage/cards/z/ZameckGuildmage.java | 2 +- .../src/mage/cards/z/ZhalfirinDecoy.java | 2 +- .../src/mage/cards/z/ZirdaTheDawnwaker.java | 2 +- .../src/mage/cards/z/ZoZuThePunisher.java | 3 +- Mage.Sets/src/mage/cards/z/Zoologist.java | 2 +- Mage.Sets/src/mage/sets/ModernHorizons2.java | 1 + .../AI/basic/TestFrameworkCanPlayAITest.java | 4 +- .../cards/abilities/keywords/BestowTest.java | 71 +++- .../abilities/keywords/TransformTest.java | 4 +- .../LandTypeChangingEffectsTest.java | 2 +- .../SubTypeChangingEffectsTest.java | 60 ++-- .../BattlefieldTriggeredAbilitiesTest.java | 2 +- .../cards/copy/FelhideSpiritbinderTest.java | 4 +- .../test/cards/copy/PhantasmalImageTest.java | 20 +- .../test/cards/copy/ProgenitorMimicTest.java | 4 +- .../ModalDoubleFacesCardsTest.java | 6 +- .../cards/single/fut/DustOfMomentsTest.java | 2 +- .../single/mh2/GristTheHungerTideTest.java | 88 +++++ .../test/cards/single/plc/ChronozoaTest.java | 4 +- .../cards/single/ths/HeliodGodOfTheSun.java | 2 +- .../ths/PurphorosGodOfTheForgeTest.java | 6 +- .../commander/duel/CastCommanderTest.java | 4 +- .../java/org/mage/test/player/TestPlayer.java | 4 +- .../base/impl/CardTestPlayerAPIImpl.java | 24 +- .../test/serverside/deck/CompanionTest.java | 131 ++++++++ .../serverside/deck/DeckValidationUtil.java | 124 +++++++ .../serverside/deck/DeckValidatorTest.java | 306 +++++++----------- .../mage/test/sets/BoosterGenerationTest.java | 18 +- .../java/mage/verify/VerifyCardDataTest.java | 4 +- Mage/src/main/java/mage/MageObject.java | 161 +++++++-- Mage/src/main/java/mage/MageObjectImpl.java | 20 +- .../mage/abilities/TriggeredAbilityImpl.java | 2 +- .../abilityword/ConstellationAbility.java | 2 +- ...swalkerLoyaltyAbilityTriggeredAbility.java | 2 +- ...achedToCreatureSourceTriggeredAbility.java | 2 +- .../common/AttacksAllTriggeredAbility.java | 2 +- .../BecomesMonstrousTriggeredAbility.java | 2 +- ...mbatDamageToACreatureTriggeredAbility.java | 2 +- ...CombatDamageToAPlayerTriggeredAbility.java | 2 +- ...sDamageToACreatureAllTriggeredAbility.java | 2 +- .../DealsDamageToAPlayerTriggeredAbility.java | 2 +- ...aneswalkerWhenDamagedTriggeredAbility.java | 2 +- ...ertCreatureControllerTriggeredAbility.java | 2 +- .../abilities/common/LandfallAbility.java | 2 +- .../mage/abilities/common/LicidAbility.java | 4 +- .../abilities/common/MagecraftAbility.java | 2 +- .../TapLandForManaAllTriggeredAbility.java | 2 +- ...TapLandForManaAllTriggeredManaAbility.java | 2 +- .../common/EnchantedSourceCondition.java | 2 +- .../common/EnchantedTargetCondition.java | 2 +- .../common/SourceIsSpellCondition.java | 2 +- .../common/TargetHasCardTypeCondition.java | 2 +- .../common/TopLibraryCardTypeCondition.java | 8 +- .../ExileTopCreatureCardOfGraveyardCost.java | 2 +- .../abilities/costs/common/TapSourceCost.java | 2 +- .../costs/common/UntapSourceCost.java | 2 +- .../common/CardTypeAssignment.java | 2 +- .../common/CardTypesInGraveyardCount.java | 3 +- .../InstantSorceryExileGraveyardCount.java | 2 +- .../dynamicvalue/common/ParleyCount.java | 2 +- .../effects/ApplyCountersEffect.java | 2 +- .../abilities/effects/AsThoughEffectImpl.java | 2 +- .../effects/AuraReplacementEffect.java | 6 +- .../mage/abilities/effects/EquipEffect.java | 2 +- .../abilities/effects/common/CopyEffect.java | 6 +- .../effects/common/CopyTokenEffect.java | 6 +- .../effects/common/DamageEachOtherEffect.java | 4 +- .../common/FightTargetSourceEffect.java | 2 +- .../effects/common/FightTargetsEffect.java | 2 +- .../effects/common/FortifyEffect.java | 4 +- .../effects/common/HideawayPlayEffect.java | 2 +- .../common/PreventDamageByTargetEffect.java | 2 +- ...ealTopLandToBattlefieldElseHandEffect.java | 2 +- .../common/UntapAllThatAttackedEffect.java | 2 +- .../CantAttackYouUnlessPayManaAllEffect.java | 2 +- .../continuous/AddCardTypeAttachedEffect.java | 2 +- .../continuous/AddCardTypeSourceEffect.java | 5 +- .../continuous/AddCardTypeTargetEffect.java | 5 +- .../BecomesBasicLandTargetEffect.java | 4 +- .../continuous/BecomesCreatureAllEffect.java | 4 +- .../BecomesCreatureAttachedEffect.java | 6 +- .../BecomesCreatureIfVehicleEffect.java | 2 +- .../BecomesCreatureSourceEffect.java | 8 +- .../BecomesCreatureTargetEffect.java | 4 +- .../BecomesEnchantmentSourceEffect.java | 4 +- .../BecomesFaceDownCreatureAllEffect.java | 4 +- .../BecomesFaceDownCreatureEffect.java | 4 +- .../common/continuous/BoostTargetEffect.java | 2 +- .../CastAsThoughItHadFlashAllEffect.java | 6 +- .../continuous/HasSubtypesSourceEffect.java | 42 +-- .../LoseArtifactTypeTargetEffect.java | 2 +- .../LoseCreatureTypeSourceEffect.java | 4 +- .../continuous/PlayTheTopCardEffect.java | 2 +- ...ostReductionAllOfChosenCardTypeEffect.java | 2 +- .../DealtDamageToCreatureBySourceDies.java | 3 - ...layLandsFromGraveyardControllerEffect.java | 2 +- .../effects/keyword/ExploreSourceEffect.java | 2 +- .../effects/keyword/ManifestEffect.java | 2 +- .../keyword/ManifestTargetPlayerEffect.java | 2 +- .../hint/common/CardTypesInGraveyardHint.java | 3 +- .../mage/abilities/keyword/BestowAbility.java | 65 ++-- .../mage/abilities/keyword/BoastAbility.java | 2 +- .../abilities/keyword/CascadeAbility.java | 2 +- .../abilities/keyword/CompanionAbility.java | 4 +- .../abilities/keyword/CompanionCondition.java | 6 +- .../mage/abilities/keyword/EvolveAbility.java | 15 +- .../mage/abilities/keyword/FearAbility.java | 2 +- ...FromArtifactsCreaturesAndEnchantments.java | 2 +- .../HexproofFromPlaneswalkersAbility.java | 2 +- .../abilities/keyword/IntimidateAbility.java | 2 +- .../mage/abilities/keyword/MorphAbility.java | 10 +- .../abilities/keyword/OverloadAbility.java | 2 +- .../abilities/keyword/ProtectionAbility.java | 4 +- .../abilities/keyword/RecoverAbility.java | 2 +- .../abilities/keyword/SoulbondAbility.java | 8 +- .../SpliceOntoInstantOrSorceryAbility.java | 2 +- .../abilities/keyword/SunburstAbility.java | 4 +- .../abilities/keyword/SuspendAbility.java | 4 +- .../abilities/keyword/TransformAbility.java | 6 +- .../InstantOrSorcerySpellManaBuilder.java | 2 +- .../ArtifactCastManaCondition.java | 2 +- .../CreatureCastManaCondition.java | 2 +- .../PlaneswalkerCastManaCondition.java | 2 +- Mage/src/main/java/mage/cards/Card.java | 14 + Mage/src/main/java/mage/cards/CardImpl.java | 40 ++- .../main/java/mage/cards/ExpansionSet.java | 3 +- .../java/mage/cards/ModalDoubleFacesCard.java | 5 +- .../java/mage/cards/repository/CardInfo.java | 6 +- .../main/java/mage/constants/CardType.java | 5 +- .../src/main/java/mage/constants/SubType.java | 17 +- .../java/mage/designations/Designation.java | 5 +- .../main/java/mage/designations/Monarch.java | 2 +- .../common/FilterCreatureForAttack.java | 2 +- .../card/AuraCardCanAttachToPermanentId.java | 2 +- .../mageobject/HistoricPredicate.java | 2 +- .../other/ArtifactSourcePredicate.java | 2 +- ...AttachmentAttachedToCardTypePredicate.java | 2 +- .../permanent/EnchantedPredicate.java | 3 +- .../EnchantmentOrEnchantedPredicate.java | 4 +- Mage/src/main/java/mage/game/GameImpl.java | 20 +- .../java/mage/game/MageObjectAttribute.java | 9 + .../src/main/java/mage/game/ZonesHandler.java | 2 +- .../main/java/mage/game/combat/Combat.java | 4 +- .../java/mage/game/command/Commander.java | 4 +- .../main/java/mage/game/command/Dungeon.java | 4 +- .../main/java/mage/game/command/Emblem.java | 4 +- .../main/java/mage/game/command/Plane.java | 4 +- .../command/emblems/AjaniSteadfastEmblem.java | 2 +- .../emblems/DarettiScrapSavantEmblem.java | 3 +- .../command/emblems/JayaBallardEmblem.java | 5 +- .../emblems/KioraMasterOfTheDepthsEmblem.java | 4 +- .../emblems/NarsetTranscendentEmblem.java | 2 +- .../command/emblems/WrennAndSixEmblem.java | 2 +- .../mage/game/command/planes/AgyremPlane.java | 2 +- .../java/mage/game/permanent/Battlefield.java | 5 +- .../java/mage/game/permanent/Permanent.java | 2 +- .../mage/game/permanent/PermanentCard.java | 2 +- .../mage/game/permanent/PermanentImpl.java | 20 +- .../mage/game/permanent/PermanentToken.java | 2 +- Mage/src/main/java/mage/game/stack/Spell.java | 47 +-- .../java/mage/game/stack/StackAbility.java | 4 +- .../main/java/mage/players/PlayerImpl.java | 4 +- .../util/functions/CardTypeCopyApplier.java | 1 - .../util/functions/CopyTokenFunction.java | 5 +- .../main/java/mage/util/trace/TraceUtil.java | 2 +- .../common/CreatureWasCastWatcher.java | 4 +- .../watchers/common/CreaturesDiedWatcher.java | 2 +- .../watchers/common/DamagedByWatcher.java | 2 +- .../mage/watchers/common/LandfallWatcher.java | 2 +- .../mage/watchers/common/MorbidWatcher.java | 2 +- .../PermanentsEnteredBattlefieldWatcher.java | 2 +- .../mage/watchers/common/PlayLandWatcher.java | 2 +- .../common/PlayerCastCreatureWatcher.java | 2 +- 1159 files changed, 2704 insertions(+), 2203 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/g/GristTheHungerTide.java create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/mh2/GristTheHungerTideTest.java create mode 100644 Mage.Tests/src/test/java/org/mage/test/serverside/deck/CompanionTest.java create mode 100644 Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidationUtil.java diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java b/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java index 15d4448891..03f29d8fe5 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java @@ -9,6 +9,7 @@ import java.awt.*; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -16,7 +17,7 @@ import java.util.List; */ public class ModernSplitCardRenderer extends ModernCardRenderer { - private class HalfCardProps { + private static class HalfCardProps { int x, y, w, h, cw, ch; @@ -28,11 +29,7 @@ public class ModernSplitCardRenderer extends ModernCardRenderer { List keywords = new ArrayList<>(); } - private static final ArrayList ONLY_LAND_TYPE = new ArrayList() { - { - add(CardType.LAND); - } - }; + private static final List ONLY_LAND_TYPE = Arrays.asList(CardType.LAND); // Right and left halves of the card content private HalfCardProps rightHalf = new HalfCardProps(); diff --git a/Mage.Common/src/main/java/mage/view/CardView.java b/Mage.Common/src/main/java/mage/view/CardView.java index 0345dd999e..79afbb0a8a 100644 --- a/Mage.Common/src/main/java/mage/view/CardView.java +++ b/Mage.Common/src/main/java/mage/view/CardView.java @@ -59,7 +59,7 @@ public class CardView extends SimpleCardView { @Expose protected String loyalty = ""; protected String startingLoyalty; - protected ArrayList cardTypes; + protected List cardTypes; protected SubTypes subTypes; protected Set superTypes; protected ObjectColor color; @@ -246,7 +246,7 @@ public class CardView extends SimpleCardView { for (SuperType superType : card.getSuperType()) { sbType.append(superType).append(' '); } - for (CardType cardType : card.getCardType()) { + for (CardType cardType : card.getCardType(game)) { sbType.append(cardType.toString()).append(' '); } if (!card.getSubtype(game).isEmpty()) { @@ -312,7 +312,7 @@ public class CardView extends SimpleCardView { } else if (card instanceof Permanent) { this.power = Integer.toString(card.getPower().getValue()); this.toughness = Integer.toString(card.getToughness().getValue()); - this.cardTypes = card.getCardType(); + this.cardTypes = card.getCardType(game); this.faceDown = card.isFaceDown(game); } else { // this.hideInfo = true; @@ -434,7 +434,7 @@ public class CardView extends SimpleCardView { } this.power = Integer.toString(card.getPower().getValue()); this.toughness = Integer.toString(card.getToughness().getValue()); - this.cardTypes = card.getCardType(); + this.cardTypes = card.getCardType(game); this.subTypes = card.getSubtype(game); this.superTypes = card.getSuperType(); this.color = card.getColor(game); @@ -561,7 +561,7 @@ public class CardView extends SimpleCardView { this.toughness = object.getToughness().toString(); this.loyalty = ""; } - this.cardTypes = object.getCardType(); + this.cardTypes = object.getCardType(game); this.subTypes = object.getSubtype(game); this.superTypes = object.getSuperType(); this.color = object.getColor(game); @@ -749,7 +749,7 @@ public class CardView extends SimpleCardView { this.toughness = token.getToughness().toString(); this.loyalty = ""; this.startingLoyalty = ""; - this.cardTypes = token.getCardType(); + this.cardTypes = token.getCardType(game); this.subTypes = token.getSubtype(game); this.superTypes = token.getSuperType(); this.color = token.getColor(game); @@ -842,7 +842,7 @@ public class CardView extends SimpleCardView { return startingLoyalty; } - public ArrayList getCardTypes() { + public List getCardTypes() { return cardTypes; } diff --git a/Mage.Common/src/main/java/mage/view/StackAbilityView.java b/Mage.Common/src/main/java/mage/view/StackAbilityView.java index 177e6225ec..c9de06d7f6 100644 --- a/Mage.Common/src/main/java/mage/view/StackAbilityView.java +++ b/Mage.Common/src/main/java/mage/view/StackAbilityView.java @@ -40,13 +40,13 @@ public class StackAbilityView extends CardView { this.name = "Ability"; this.loyalty = ""; - this.cardTypes = ability.getCardType(); + this.cardTypes = ability.getCardType(game); this.subTypes = ability.getSubtype(game); this.superTypes = ability.getSuperType(); this.color = ability.getColor(game); this.manaCostLeftStr = String.join("", ability.getManaCostSymbols()); this.manaCostRightStr = ""; - this.cardTypes = ability.getCardType(); + this.cardTypes = ability.getCardType(game); this.subTypes = ability.getSubtype(game); this.superTypes = ability.getSuperType(); this.color = ability.getColor(game); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java index adcf497ad4..0b73210f0b 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Brawl.java @@ -7,6 +7,7 @@ import mage.cards.Card; import mage.cards.decks.Constructed; import mage.cards.decks.Deck; import mage.cards.decks.DeckValidatorErrorType; +import mage.constants.CardType; import mage.filter.FilterMana; import mage.util.ManaUtil; @@ -77,8 +78,9 @@ public class Brawl extends Constructed { addError(DeckValidatorErrorType.PRIMARY, brawler.getName(), "Brawler banned (" + brawler.getName() + ')', true); valid = false; } - if (!((brawler.isCreature() && brawler.isLegendary()) - || brawler.isPlaneswalker() || brawler.getAbilities().contains(CanBeYourCommanderAbility.getInstance()))) { + if (!((brawler.hasCardTypeForDeckbuilding(CardType.CREATURE) && brawler.isLegendary()) + || brawler.hasCardTypeForDeckbuilding(CardType.PLANESWALKER) + || brawler.getAbilities().contains(CanBeYourCommanderAbility.getInstance()))) { addError(DeckValidatorErrorType.PRIMARY, brawler.getName(), "Brawler Invalid (" + brawler.getName() + ')', true); valid = false; } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java index b731982025..07acf5df7d 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java @@ -3,7 +3,6 @@ package mage.deck; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.costs.mana.ManaCost; import mage.abilities.keyword.CompanionAbility; import mage.abilities.keyword.PartnerAbility; import mage.abilities.keyword.PartnerWithAbility; @@ -13,6 +12,7 @@ import mage.cards.Sets; import mage.cards.decks.Constructed; import mage.cards.decks.Deck; import mage.cards.decks.DeckValidatorErrorType; +import mage.constants.CardType; import mage.filter.FilterMana; import mage.util.ManaUtil; @@ -101,48 +101,61 @@ public class Commander extends Constructed { errorsList.clear(); FilterMana colorIdentity = new FilterMana(); Set commanders = new HashSet<>(); - Card companion = null; + Card companion; - if (deck.getSideboard().size() == 1) { - commanders.add(deck.getSideboard().iterator().next()); - } else if (deck.getSideboard().size() == 2) { - Iterator iter = deck.getSideboard().iterator(); - Card card1 = iter.next(); - Card card2 = iter.next(); - if (card1.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) { - companion = card1; - commanders.add(card2); - } else if (card2.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) { - companion = card2; - commanders.add(card1); - } else { - commanders.add(card1); - commanders.add(card2); - } - } else if (deck.getSideboard().size() == 3) { - Iterator iter = deck.getSideboard().iterator(); - Card card1 = iter.next(); - Card card2 = iter.next(); - Card card3 = iter.next(); - if (card1.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) { - companion = card1; - commanders.add(card2); - commanders.add(card3); - } else if (card2.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) { - companion = card2; - commanders.add(card1); - commanders.add(card3); - } else if (card3.getAbilities().stream().anyMatch(ability -> ability instanceof CompanionAbility)) { - companion = card3; - commanders.add(card1); - commanders.add(card2); - } else { + int sbsize = deck.getSideboard().size(); + Card card1; + Card card2; + Card card3; + Iterator iter; + switch (deck.getSideboard().size()) { + case 1: + companion = null; + commanders.add(deck.getSideboard().iterator().next()); + break; + case 2: + iter = deck.getSideboard().iterator(); + card1 = iter.next(); + card2 = iter.next(); + if (card1.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) { + companion = card1; + commanders.add(card2); + } else if (card2.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) { + companion = card2; + commanders.add(card1); + } else { + companion = null; + commanders.add(card1); + commanders.add(card2); + } + break; + case 3: + iter = deck.getSideboard().iterator(); + card1 = iter.next(); + card2 = iter.next(); + card3 = iter.next(); + if (card1.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) { + companion = card1; + commanders.add(card2); + commanders.add(card3); + } else if (card2.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) { + companion = card2; + commanders.add(card1); + commanders.add(card3); + } else if (card3.getAbilities().stream().anyMatch(CompanionAbility.class::isInstance)) { + companion = card3; + commanders.add(card1); + commanders.add(card2); + } else { + companion = null; + addError(DeckValidatorErrorType.PRIMARY, "Commander", "Sideboard must contain only the commander(s) and up to 1 companion"); + valid = false; + } + break; + default: + companion = null; addError(DeckValidatorErrorType.PRIMARY, "Commander", "Sideboard must contain only the commander(s) and up to 1 companion"); valid = false; - } - } else { - addError(DeckValidatorErrorType.PRIMARY, "Commander", "Sideboard must contain only the commander(s) and up to 1 companion"); - valid = false; } if (companion != null && deck.getCards().size() + deck.getSideboard().size() != 101) { @@ -174,8 +187,8 @@ public class Commander extends Constructed { addError(DeckValidatorErrorType.PRIMARY, commander.getName(), "Commander banned (" + commander.getName() + ')', true); valid = false; } - if ((!commander.isCreature() || !commander.isLegendary()) - && (!commander.isPlaneswalker() || !commander.getAbilities().contains(CanBeYourCommanderAbility.getInstance()))) { + if ((!commander.hasCardTypeForDeckbuilding(CardType.CREATURE) || !commander.isLegendary()) + && !commander.getAbilities().contains(CanBeYourCommanderAbility.getInstance())) { addError(DeckValidatorErrorType.PRIMARY, commander.getName(), "Commander invalid (" + commander.getName() + ')', true); valid = false; } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java index 7d77a141b6..314df58b40 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java @@ -10,6 +10,7 @@ import mage.cards.Sets; import mage.cards.decks.Constructed; import mage.cards.decks.Deck; import mage.cards.decks.DeckValidatorErrorType; +import mage.constants.CardType; import mage.filter.FilterMana; import mage.util.ManaUtil; @@ -119,7 +120,7 @@ public class FreeformCommander extends Constructed { commanderNames.add(commander.getName()); } for (Card commander : commanders) { - if (!(commander.isCreature() || commander.isLegendary())) { + if (!commander.hasCardTypeForDeckbuilding(CardType.CREATURE) && !commander.isLegendary()) { addError(DeckValidatorErrorType.PRIMARY, commander.getName(), "For Freeform Commander, the commander must be a creature or be legendary. Yours was: " + commander.getName(), true); valid = false; } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Oathbreaker.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Oathbreaker.java index e8935aebdc..fa01ecfdd5 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Oathbreaker.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Oathbreaker.java @@ -6,6 +6,7 @@ import mage.abilities.keyword.PartnerWithAbility; import mage.cards.Card; import mage.cards.decks.Deck; import mage.cards.decks.DeckValidatorErrorType; +import mage.constants.CardType; import mage.filter.FilterMana; import mage.util.ManaUtil; @@ -125,7 +126,7 @@ public class Oathbreaker extends Vintage { if (commander.isInstantOrSorcery()) { signatureSpells.add(commander.getName()); } else { - if (commander.isPlaneswalker()) { + if (commander.hasCardTypeForDeckbuilding(CardType.PLANESWALKER)) { commanderNames.add(commander.getName()); // color identity from commanders only, not spell diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java index f78cc37347..0e5289d4c7 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java @@ -12,6 +12,7 @@ import mage.cards.decks.Constructed; import mage.cards.decks.Deck; import mage.cards.decks.DeckValidatorErrorType; import mage.cards.decks.PennyDreadfulLegalityUtil; +import mage.constants.CardType; import mage.filter.FilterMana; import mage.util.ManaUtil; @@ -127,8 +128,8 @@ public class PennyDreadfulCommander extends Constructed { addError(DeckValidatorErrorType.PRIMARY, commander.getName(), "Commander banned (" + commander.getName() + ')', true); valid = false; } - if ((!commander.isCreature() || !commander.isLegendary()) - && (!commander.isPlaneswalker() || !commander.getAbilities().contains(CanBeYourCommanderAbility.getInstance()))) { + if ((!commander.hasCardTypeForDeckbuilding(CardType.CREATURE) || !commander.isLegendary()) + && !commander.getAbilities().contains(CanBeYourCommanderAbility.getInstance())) { addError(DeckValidatorErrorType.PRIMARY, commander.getName(), "Commander invalid (" + commander.getName() + ')', true); valid = false; } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java index 444b837f15..4e2c3907fc 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java @@ -4,6 +4,7 @@ import mage.cards.*; import mage.cards.decks.Constructed; import mage.cards.decks.Deck; import mage.cards.decks.DeckValidatorErrorType; +import mage.constants.CardType; import mage.filter.FilterMana; import mage.game.GameTinyLeadersImpl; @@ -146,7 +147,8 @@ public class TinyLeaders extends Constructed { } return false; } - if ((commander.isCreature() && commander.isLegendary()) || commander.isPlaneswalker()) { + if ((commander.hasCardTypeForDeckbuilding(CardType.CREATURE) && commander.isLegendary()) + || commander.hasCardTypeForDeckbuilding(CardType.PLANESWALKER)) { if (!bannedCommander.contains(commander.getName())) { FilterMana color = commander.getColorIdentity(); for (Card card : deck.getCards()) { diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java index 8954f642ca..ed27d2a447 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java @@ -28,7 +28,7 @@ public final class ArtificialScoringSystem { public static int getCardDefinitionScore(final Game game, final Card card) { int value = 3; //TODO: add new rating system card value - if (card.isLand()) { + if (card.isLand(game)) { int score = (int) ((value / 2.0f) * 50); //TODO: check this for "any color" lands //TODO: check this for dual and filter lands @@ -40,7 +40,7 @@ public final class ArtificialScoringSystem { } final int score = value * 100 - card.getManaCost().manaValue() * 20; - if (card.getCardType().contains(CardType.CREATURE)) { + if (card.getCardType(game).contains(CardType.CREATURE)) { return score + (card.getPower().getValue() + card.getToughness().getValue()) * 10; } else { return score + (/*card.getRemoval()*50*/+(card.getRarity() == null ? 0 : card.getRarity().getRating() * 30)); @@ -51,7 +51,7 @@ public final class ArtificialScoringSystem { //TODO: cache it inside Card int score = getCardDefinitionScore(game, permanent); score += PERMANENT_SCORE; - if (permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent.getCardType(game).contains(CardType.CREATURE)) { // TODO: implement in the mage core //score + =cardDefinition.getActivations().size()*50; //score += cardDefinition.getManaActivations().size()*80; @@ -68,10 +68,10 @@ public final class ArtificialScoringSystem { int score = permanent.getCounters(game).getCount(CounterType.CHARGE) * 30; score += permanent.getCounters(game).getCount(CounterType.LEVEL) * 30; score -= permanent.getDamage() * 2; - if (!canTap(permanent, game)) { - score += getTappedScore(permanent); + if (!canTap(game, permanent)) { + score += getTappedScore(game, permanent); } - if (permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent.getCardType(game).contains(CardType.CREATURE)) { final int power = permanent.getPower().getValue(); final int toughness = permanent.getToughness().getValue(); int abilityScore = 0; @@ -86,7 +86,7 @@ public final class ArtificialScoringSystem { if (object instanceof Card) { Card card = (Card) object; int outcomeScore = card.getAbilities(game).getOutcomeTotal(); - if (card.getCardType().contains(CardType.ENCHANTMENT)) { + if (card.getCardType(game).contains(CardType.ENCHANTMENT)) { enchantments = enchantments + outcomeScore * 100; } else { equipments = equipments + outcomeScore * 50; @@ -106,10 +106,10 @@ public final class ArtificialScoringSystem { return score; } - private static boolean canTap(Permanent permanent, Game game) { + private static boolean canTap(Game game, Permanent permanent) { return !permanent.isTapped() && (!permanent.hasSummoningSickness() - || !permanent.getCardType().contains(CardType.CREATURE) + || !permanent.getCardType(game).contains(CardType.CREATURE) || permanent.getAbilities(game).contains(HasteAbility.getInstance())); } @@ -117,10 +117,10 @@ public final class ArtificialScoringSystem { return Math.max(0, value); } - public static int getTappedScore(final Permanent permanent) { - if (permanent.getCardType().contains(CardType.CREATURE)) { + public static int getTappedScore(Game game, final Permanent permanent) { + if (permanent.isCreature(game)) { return -100; - } else if (permanent.getCardType().contains(CardType.LAND)) { + } else if (permanent.isLand(game)) { return -20; // means probably no mana available (should be greater than passivity penalty } else { return -2; diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index a65e789930..8f8af9a743 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -1034,7 +1034,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // planeswalker kill for (Permanent permanent : targets) { - if (permanent.isPlaneswalker() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isPlaneswalker(game) && target.canTarget(getId(), permanent.getId(), source, game)) { int loy = permanent.getCounters(game).getCount(CounterType.LOYALTY); if (loy <= target.getAmountRemaining()) { return tryAddTarget(target, permanent.getId(), loy, source, game); @@ -1044,7 +1044,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // creature kill for (Permanent permanent : targets) { - if (permanent.isCreature() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isCreature(game) && target.canTarget(getId(), permanent.getId(), source, game)) { if (permanent.getToughness().getValue() <= target.getAmountRemaining()) { return tryAddTarget(target, permanent.getId(), permanent.getToughness().getValue(), source, game); } @@ -1064,7 +1064,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // planeswalkers for (Permanent permanent : targets) { - if (permanent.isPlaneswalker() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isPlaneswalker(game) && target.canTarget(getId(), permanent.getId(), source, game)) { return tryAddTarget(target, permanent.getId(), target.getAmountRemaining(), source, game); } } @@ -1079,7 +1079,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // creature for (Permanent permanent : targets) { - if (permanent.isCreature() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isCreature(game) && target.canTarget(getId(), permanent.getId(), source, game)) { return tryAddTarget(target, permanent.getId(), target.getAmountRemaining(), source, game); } } @@ -1100,7 +1100,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // creatures - non killable (TODO: add extra skill checks like undestructeable) for (Permanent permanent : targets) { - if (permanent.isCreature() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isCreature(game) && target.canTarget(getId(), permanent.getId(), source, game)) { int safeDamage = Math.min(permanent.getToughness().getValue() - 1, target.getAmountRemaining()); if (safeDamage > 0) { return tryAddTarget(target, permanent.getId(), safeDamage, source, game); @@ -1110,14 +1110,14 @@ public class ComputerPlayer extends PlayerImpl implements Player { // creatures - all for (Permanent permanent : targets) { - if (permanent.isCreature() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isCreature(game) && target.canTarget(getId(), permanent.getId(), source, game)) { return tryAddTarget(target, permanent.getId(), target.getAmountRemaining(), source, game); } } // planeswalkers for (Permanent permanent : targets) { - if (permanent.isPlaneswalker() && target.canTarget(getId(), permanent.getId(), source, game)) { + if (permanent.isPlaneswalker(game) && target.canTarget(getId(), permanent.getId(), source, game)) { return tryAddTarget(target, permanent.getId(), target.getAmountRemaining(), source, game); } } @@ -1319,7 +1319,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { SpellAbility ability = card.getSpellAbility(); if (ability != null && ability.canActivate(playerId, game).canActivate() && !game.getContinuousEffects().preventedByRuleModification(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getSourceId(), ability, playerId), ability, game, true)) { - if (card.getCardType().contains(CardType.INSTANT) + if (card.getCardType(game).contains(CardType.INSTANT) || card.hasAbility(FlashAbility.getInstance(), game)) { playableInstant.add(card); } else { @@ -1689,9 +1689,9 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (score > 0) { // score mana producers that produce other mana types and have other uses higher score += mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, playerId, game).size(); score += mageObject.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD).size(); - if (!mageObject.getCardType().contains(CardType.LAND)) { + if (!mageObject.getCardType(game).contains(CardType.LAND)) { score += 2; - } else if (mageObject.getCardType().contains(CardType.CREATURE)) { + } else if (mageObject.getCardType(game).contains(CardType.CREATURE)) { score += 2; } } @@ -1823,7 +1823,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // choose a creature type of opponent on battlefield or graveyard for (Permanent permanent : game.getBattlefield().getActivePermanents(this.getId(), game)) { if (game.getOpponents(this.getId()).contains(permanent.getControllerId()) - && permanent.getCardType().contains(CardType.CREATURE) + && permanent.getCardType(game).contains(CardType.CREATURE) && !permanent.getSubtype(game).isEmpty()) { if (choice.getChoices().contains(permanent.getSubtype(game).get(0).toString())) { choice.setChoice(permanent.getSubtype(game).get(0).toString()); @@ -1836,7 +1836,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { for (UUID opponentId : game.getOpponents(this.getId())) { Player opponent = game.getPlayer(opponentId); for (Card card : opponent.getGraveyard().getCards(game)) { - if (card != null && card.getCardType().contains(CardType.CREATURE) && !card.getSubtype(game).isEmpty()) { + if (card != null && card.getCardType(game).contains(CardType.CREATURE) && !card.getSubtype(game).isEmpty()) { if (choice.getChoices().contains(card.getSubtype(game).get(0).toString())) { choice.setChoice(card.getSubtype(game).get(0).toString()); break; @@ -1852,7 +1852,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // choose a creature type of hand or library for (UUID cardId : this.getHand()) { Card card = game.getCard(cardId); - if (card != null && card.getCardType().contains(CardType.CREATURE) && !card.getSubtype(game).isEmpty()) { + if (card != null && card.getCardType(game).contains(CardType.CREATURE) && !card.getSubtype(game).isEmpty()) { if (choice.getChoices().contains(card.getSubtype(game).get(0).toString())) { choice.setChoice(card.getSubtype(game).get(0).toString()); break; @@ -1862,7 +1862,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (!choice.isChosen()) { for (UUID cardId : this.getLibrary().getCardList()) { Card card = game.getCard(cardId); - if (card != null && card.getCardType().contains(CardType.CREATURE) && !card.getSubtype(game).isEmpty()) { + if (card != null && card.getCardType(game).contains(CardType.CREATURE) && !card.getSubtype(game).isEmpty()) { if (choice.getChoices().contains(card.getSubtype(game).get(0).toString())) { choice.setChoice(card.getSubtype(game).get(0).toString()); break; diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/PermanentEvaluator.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/PermanentEvaluator.java index 74cff5d67d..d08667913b 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/PermanentEvaluator.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/PermanentEvaluator.java @@ -21,10 +21,10 @@ public class PermanentEvaluator { // more score -- more valueable/powerfull permanent if (!values.containsKey(permanent.getId())) { int value = 0; - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { value += combat.evaluate(permanent, game); } - if (permanent.isPlaneswalker()) { + if (permanent.isPlaneswalker(game)) { value += 2 * permanent.getCounters(game).getCount(CounterType.LOYALTY); // planeswalker is more valuable } value += permanent.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD).size(); diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java index 64a522c954..0ff2571cbd 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java @@ -80,7 +80,7 @@ public final class GameStateEvaluator { } else { value = permanent.isTapped() ? 4 : 5; } - if (permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent.getCardType(game).contains(CardType.CREATURE)) { value += evaluateCreature(permanent, game) * CREATURE_FACTOR; } value += permanent.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD).size(); diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index bf82021884..f264459bda 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -2062,7 +2062,7 @@ public class HumanPlayer extends PlayerImpl { return; } } - if (userData.isUseFirstManaAbility() && object instanceof Permanent && object.isLand()) { + if (userData.isUseFirstManaAbility() && object instanceof Permanent && object.isLand(game)) { ActivatedAbility ability = abilities.values().iterator().next(); if (ability instanceof ActivatedManaAbilityImpl) { activateAbility(ability, game); diff --git a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java index 5ce07c2f02..1f8d5988b8 100644 --- a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java @@ -17,7 +17,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Planes; import mage.constants.Zone; -import mage.counters.Counter; import mage.counters.CounterType; import mage.game.Game; import mage.game.GameCommanderImpl; @@ -518,7 +517,7 @@ public final class SystemUtil { } } else if ("loyalty".equalsIgnoreCase(command.zone)) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(player.getId())) { - if (perm.getName().equals(command.cardName) && perm.getCardType().contains(CardType.PLANESWALKER)) { + if (perm.getName().equals(command.cardName) && perm.getCardType(game).contains(CardType.PLANESWALKER)) { perm.addCounters(CounterType.LOYALTY.createInstance(command.Amount), fakeSourceAbility.getControllerId(), fakeSourceAbility, game); } } diff --git a/Mage.Sets/src/mage/cards/a/AAT1.java b/Mage.Sets/src/mage/cards/a/AAT1.java index 25bac2f46d..24ab920b8b 100644 --- a/Mage.Sets/src/mage/cards/a/AAT1.java +++ b/Mage.Sets/src/mage/cards/a/AAT1.java @@ -75,7 +75,7 @@ public final class AAT1 extends CardImpl { Card card = game.getCard(event.getTargetId()); if (card != null && event.getPlayerId().equals(game.getControllerId(sourceId)) - && card.isCreature() + && card.isCreature(game) && game.getState().getZone(card.getId()) == Zone.GRAVEYARD && event.getData().equals("repair")) { return true; diff --git a/Mage.Sets/src/mage/cards/a/AberrantResearcher.java b/Mage.Sets/src/mage/cards/a/AberrantResearcher.java index 1fcc79e17a..04fb935339 100644 --- a/Mage.Sets/src/mage/cards/a/AberrantResearcher.java +++ b/Mage.Sets/src/mage/cards/a/AberrantResearcher.java @@ -2,7 +2,6 @@ package mage.cards.a; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -69,7 +68,7 @@ class AberrantResearcherEffect extends OneShotEffect { .millCards(1, source, game) .getCards(game) .stream() - .noneMatch(MageObject::isInstantOrSorcery)) { + .noneMatch(card -> card.isInstantOrSorcery(game))) { return false; } new TransformSourceEffect(true).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/a/Abeyance.java b/Mage.Sets/src/mage/cards/a/Abeyance.java index f1ce9ca85f..5281148c49 100644 --- a/Mage.Sets/src/mage/cards/a/Abeyance.java +++ b/Mage.Sets/src/mage/cards/a/Abeyance.java @@ -87,7 +87,7 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl { return false; } if (event.getType() == GameEvent.EventType.CAST_SPELL - && object.isInstantOrSorcery()) { + && object.isInstantOrSorcery(game)) { return true; } if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { diff --git a/Mage.Sets/src/mage/cards/a/AbundantHarvest.java b/Mage.Sets/src/mage/cards/a/AbundantHarvest.java index cb2b947dde..02e5cf6ec9 100644 --- a/Mage.Sets/src/mage/cards/a/AbundantHarvest.java +++ b/Mage.Sets/src/mage/cards/a/AbundantHarvest.java @@ -68,7 +68,7 @@ class AbundantHarvestEffect extends OneShotEffect { continue; } toReveal.add(card); - if (card.isLand() == land) { + if (card.isLand(game) == land) { toHand = card; break; } diff --git a/Mage.Sets/src/mage/cards/a/AetherCharge.java b/Mage.Sets/src/mage/cards/a/AetherCharge.java index c2d77eae1c..1a72acabf3 100644 --- a/Mage.Sets/src/mage/cards/a/AetherCharge.java +++ b/Mage.Sets/src/mage/cards/a/AetherCharge.java @@ -13,7 +13,6 @@ import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetOpponentOrPlaneswalker; @@ -67,7 +66,7 @@ class AetherChargeTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() && permanent.hasSubtype(SubType.BEAST, game) + if (permanent != null && permanent.isCreature(game) && permanent.hasSubtype(SubType.BEAST, game) && permanent.isControlledBy(this.controllerId)) { Effect effect = this.getEffects().get(0); effect.setValue("damageSource", event.getTargetId()); diff --git a/Mage.Sets/src/mage/cards/a/AetherRift.java b/Mage.Sets/src/mage/cards/a/AetherRift.java index 373728c11a..a0a433cf07 100644 --- a/Mage.Sets/src/mage/cards/a/AetherRift.java +++ b/Mage.Sets/src/mage/cards/a/AetherRift.java @@ -65,7 +65,7 @@ class AetherRiftEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = controller.discardOne(true, false, source, game); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { Effect returnEffect = new ReturnFromGraveyardToBattlefieldTargetEffect(); returnEffect.setTargetPointer(new FixedTarget(card.getId())); Effect doEffect = new DoUnlessAnyPlayerPaysEffect(returnEffect, new PayLifeCost(5), diff --git a/Mage.Sets/src/mage/cards/a/AetherSting.java b/Mage.Sets/src/mage/cards/a/AetherSting.java index 3d81318304..cab1160c04 100644 --- a/Mage.Sets/src/mage/cards/a/AetherSting.java +++ b/Mage.Sets/src/mage/cards/a/AetherSting.java @@ -11,7 +11,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -62,7 +61,7 @@ class AetherStingTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Card card = game.getCard(event.getSourceId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/cards/a/AetherStorm.java b/Mage.Sets/src/mage/cards/a/AetherStorm.java index 3bc436ae30..4dc9a50110 100644 --- a/Mage.Sets/src/mage/cards/a/AetherStorm.java +++ b/Mage.Sets/src/mage/cards/a/AetherStorm.java @@ -75,7 +75,7 @@ class AetherStormReplacementEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Card card = game.getCard(event.getSourceId()); - return card != null && card.isCreature(); + return card != null && card.isCreature(game); } } diff --git a/Mage.Sets/src/mage/cards/a/Aetherplasm.java b/Mage.Sets/src/mage/cards/a/Aetherplasm.java index 5a9ff3d0dd..9636bde5c7 100644 --- a/Mage.Sets/src/mage/cards/a/Aetherplasm.java +++ b/Mage.Sets/src/mage/cards/a/Aetherplasm.java @@ -75,7 +75,7 @@ class AetherplasmEffect extends OneShotEffect { && game.getCombat() != null && blockedCreature != null) { CombatGroup attacker = game.getCombat().findGroup(blockedCreature.getId()); Permanent putIntoPlay = game.getPermanent(target.getFirstTarget()); - if (putIntoPlay != null && putIntoPlay.isCreature() && attacker != null) { + if (putIntoPlay != null && putIntoPlay.isCreature(game) && attacker != null) { game.getCombat().findGroup(blockedCreature.getId()).addBlocker(putIntoPlay.getId(), source.getControllerId(), game); } diff --git a/Mage.Sets/src/mage/cards/a/AjanisLastStand.java b/Mage.Sets/src/mage/cards/a/AjanisLastStand.java index f016e8ae85..998b0a37b0 100644 --- a/Mage.Sets/src/mage/cards/a/AjanisLastStand.java +++ b/Mage.Sets/src/mage/cards/a/AjanisLastStand.java @@ -84,8 +84,8 @@ class AjanisLastStandTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent()) { if (zEvent.getTarget().isControlledBy(controllerId) - && (zEvent.getTarget().isCreature() - || zEvent.getTarget().isPlaneswalker())) { + && (zEvent.getTarget().isCreature(game) + || zEvent.getTarget().isPlaneswalker(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/AkoumFirebird.java b/Mage.Sets/src/mage/cards/a/AkoumFirebird.java index e086f5456d..08b24af4ef 100644 --- a/Mage.Sets/src/mage/cards/a/AkoumFirebird.java +++ b/Mage.Sets/src/mage/cards/a/AkoumFirebird.java @@ -79,7 +79,7 @@ class AkoumFirebirdLandfallAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.isLand() && permanent.isControlledBy(this.controllerId); + return permanent != null && permanent.isLand(game) && permanent.isControlledBy(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/cards/a/AkoumHellkite.java b/Mage.Sets/src/mage/cards/a/AkoumHellkite.java index d75e81ef81..9c61c25c58 100644 --- a/Mage.Sets/src/mage/cards/a/AkoumHellkite.java +++ b/Mage.Sets/src/mage/cards/a/AkoumHellkite.java @@ -76,7 +76,7 @@ class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isLand() + && permanent.isLand(game) && permanent.isControlledBy(getControllerId())) { Permanent sourcePermanent = game.getPermanent(getSourceId()); if (sourcePermanent != null) { diff --git a/Mage.Sets/src/mage/cards/a/AlenaKessigTrapper.java b/Mage.Sets/src/mage/cards/a/AlenaKessigTrapper.java index e171bf2df3..e684434a66 100644 --- a/Mage.Sets/src/mage/cards/a/AlenaKessigTrapper.java +++ b/Mage.Sets/src/mage/cards/a/AlenaKessigTrapper.java @@ -112,7 +112,7 @@ class AlenaKessigTrapperWatcher extends Watcher { .filter(Objects::nonNull) .map(mor -> mor.getPermanent(game)) .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(permanent1 -> permanent1.isCreature(game)) .filter(permanent -> permanent.isControlledBy(playerId)) .map(MageObject::getPower) .mapToInt(MageInt::getValue) diff --git a/Mage.Sets/src/mage/cards/a/AllHallowsEve.java b/Mage.Sets/src/mage/cards/a/AllHallowsEve.java index 825b8ec750..eb9db02f15 100644 --- a/Mage.Sets/src/mage/cards/a/AllHallowsEve.java +++ b/Mage.Sets/src/mage/cards/a/AllHallowsEve.java @@ -95,7 +95,7 @@ class AllHallowsEveEffect extends OneShotEffect { .map(Player::getGraveyard) .map(g -> g.getCards(game)) .flatMap(Collection::stream) - .filter(MageObject::isCreature) + .filter(card1 -> card1.isCreature(game)) .forEach(cards::add); controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null); return true; diff --git a/Mage.Sets/src/mage/cards/a/AlrundGodOfTheCosmos.java b/Mage.Sets/src/mage/cards/a/AlrundGodOfTheCosmos.java index 4ea247f568..35b4748f59 100644 --- a/Mage.Sets/src/mage/cards/a/AlrundGodOfTheCosmos.java +++ b/Mage.Sets/src/mage/cards/a/AlrundGodOfTheCosmos.java @@ -113,7 +113,7 @@ class AlrundGodOfTheCosmosEffect extends OneShotEffect { cards.addAll(twoCardsFromTop); controller.revealCards(source, cards, game); for (Card card : cards.getCards(game)) { - if (card.getCardType().toString().contains(chosenCardType)) { + if (card.getCardType(game).toString().contains(chosenCardType)) { cardsToHand.add(card); } else { cardsToBottomOfLibrary.add(card); diff --git a/Mage.Sets/src/mage/cards/a/AmarethTheLustrous.java b/Mage.Sets/src/mage/cards/a/AmarethTheLustrous.java index f495459367..ee0264ccdb 100644 --- a/Mage.Sets/src/mage/cards/a/AmarethTheLustrous.java +++ b/Mage.Sets/src/mage/cards/a/AmarethTheLustrous.java @@ -88,7 +88,7 @@ class AmarethTheLustrousEffect extends OneShotEffect { permanent = (Permanent) obj; } if (permanent == null - || card.getCardType().stream().noneMatch(permanent.getCardType()::contains) + || card.getCardType(game).stream().noneMatch(permanent.getCardType(game)::contains) || !player.chooseUse(Outcome.DrawCard, "Reveal " + card.getName() + " and put it into your hand?", source, game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/a/AminatousAugury.java b/Mage.Sets/src/mage/cards/a/AminatousAugury.java index cfe5772cdf..53f6bb3a63 100644 --- a/Mage.Sets/src/mage/cards/a/AminatousAugury.java +++ b/Mage.Sets/src/mage/cards/a/AminatousAugury.java @@ -149,7 +149,7 @@ class AminatousAuguryCastFromExileEffect extends AsThoughEffectImpl { if (card != null && game.getState().getZone(objectId) == Zone.EXILED) { EnumSet unusedCardTypes = EnumSet.noneOf(CardType.class); - for (CardType cardT : card.getCardType()) { + for (CardType cardT : card.getCardType(game)) { if (!usedCardTypes.contains(cardT)) { unusedCardTypes.add(cardT); } diff --git a/Mage.Sets/src/mage/cards/a/Amnesia.java b/Mage.Sets/src/mage/cards/a/Amnesia.java index 276225e534..4c4991c352 100644 --- a/Mage.Sets/src/mage/cards/a/Amnesia.java +++ b/Mage.Sets/src/mage/cards/a/Amnesia.java @@ -1,6 +1,5 @@ package mage.cards.a; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.*; @@ -59,7 +58,7 @@ class AmnesiaEffect extends OneShotEffect { Cards hand = player.getHand(); player.revealCards(source, hand, game); Set cards = hand.getCards(game); - cards.removeIf(MageObject::isLand); + cards.removeIf(card -> card.isLand(game)); player.discard(new CardsImpl(cards), false, source, game); return true; } diff --git a/Mage.Sets/src/mage/cards/a/Amplifire.java b/Mage.Sets/src/mage/cards/a/Amplifire.java index a93e1f986f..b8a7cc9354 100644 --- a/Mage.Sets/src/mage/cards/a/Amplifire.java +++ b/Mage.Sets/src/mage/cards/a/Amplifire.java @@ -70,7 +70,7 @@ class AmplifireEffect extends OneShotEffect { for (Card card : player.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { lastCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java b/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java index e6b339500c..ae5f98c482 100644 --- a/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java +++ b/Mage.Sets/src/mage/cards/a/AnafenzaTheForemost.java @@ -117,10 +117,10 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl { Card card = game.getCard(event.getTargetId()); if (card != null && game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { // Anafenza only cares about cards if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield - if (zEvent.getTarget().isCreature()) { + if (zEvent.getTarget().isCreature(game)) { return true; } - } else if (card.isCreature()) { + } else if (card.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/AncientGreenwarden.java b/Mage.Sets/src/mage/cards/a/AncientGreenwarden.java index 95d3c0f35f..05c89acde1 100644 --- a/Mage.Sets/src/mage/cards/a/AncientGreenwarden.java +++ b/Mage.Sets/src/mage/cards/a/AncientGreenwarden.java @@ -86,7 +86,7 @@ class AncientGreenwardenEffect extends ReplacementEffectImpl { if (sourceEvent == null || sourceEvent.getType() != GameEvent.EventType.ENTERS_THE_BATTLEFIELD || !(sourceEvent instanceof EntersTheBattlefieldEvent) - || !((EntersTheBattlefieldEvent) sourceEvent).getTarget().isLand()) { + || !((EntersTheBattlefieldEvent) sourceEvent).getTarget().isLand(game)) { return false; } return game.getPermanent(numberOfTriggersEvent.getSourceId()) != null; diff --git a/Mage.Sets/src/mage/cards/a/AngelicChorus.java b/Mage.Sets/src/mage/cards/a/AngelicChorus.java index 31f42c914b..ac29181aa3 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicChorus.java +++ b/Mage.Sets/src/mage/cards/a/AngelicChorus.java @@ -10,7 +10,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -57,7 +56,7 @@ class AngelicChorusTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId)) { this.getEffects().get(0).setValue("lifeSource", event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/a/AngelicGuardian.java b/Mage.Sets/src/mage/cards/a/AngelicGuardian.java index 71751255a2..19b7df8c97 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicGuardian.java +++ b/Mage.Sets/src/mage/cards/a/AngelicGuardian.java @@ -1,7 +1,6 @@ package mage.cards.a; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; import mage.abilities.effects.ContinuousEffect; @@ -75,7 +74,7 @@ class AngelicGuardianGainEffect extends OneShotEffect { .map(game::getPermanent) .filter(Objects::nonNull) .filter(permanent -> permanent.isControlledBy(you.getId())) - .filter(MageObject::isCreature) + .filter(permanent1 -> permanent1.isCreature(game)) .forEach(permanent -> { ContinuousEffect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java b/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java index 845a40531a..e6307c8a25 100644 --- a/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java +++ b/Mage.Sets/src/mage/cards/a/AnimarSoulOfElements.java @@ -83,7 +83,7 @@ class AnimarCostReductionEffect extends CostModificationEffectImpl { if (abilityToModify.isControlledBy(source.getControllerId())) { Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); if (spellCard != null) { - return spellCard.isCreature(); + return spellCard.isCreature(game); } } } diff --git a/Mage.Sets/src/mage/cards/a/AnimateArtifact.java b/Mage.Sets/src/mage/cards/a/AnimateArtifact.java index 4a93d6f179..573bafd48c 100644 --- a/Mage.Sets/src/mage/cards/a/AnimateArtifact.java +++ b/Mage.Sets/src/mage/cards/a/AnimateArtifact.java @@ -77,9 +77,9 @@ class AnimateArtifactContinuousEffect extends ContinuousEffectImpl { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null && !permanent.isCreature()) { + if (permanent != null && !permanent.isCreature(game)) { if (sublayer == SubLayer.NA) { - permanent.addCardType(CardType.CREATURE); + permanent.addCardType(game, CardType.CREATURE); permanent.getPower().setValue(permanent.getManaValue()); permanent.getToughness().setValue(permanent.getManaValue()); } diff --git a/Mage.Sets/src/mage/cards/a/AnkhOfMishra.java b/Mage.Sets/src/mage/cards/a/AnkhOfMishra.java index bb8fe816bf..34b9f0c765 100644 --- a/Mage.Sets/src/mage/cards/a/AnkhOfMishra.java +++ b/Mage.Sets/src/mage/cards/a/AnkhOfMishra.java @@ -11,7 +11,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -64,7 +63,7 @@ class AnkhOfMishraAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { Player player = game.getPlayer(permanent.getControllerId()); if (player != null) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/a/AnsweredPrayers.java b/Mage.Sets/src/mage/cards/a/AnsweredPrayers.java index 5177ddc840..da33f97d18 100644 --- a/Mage.Sets/src/mage/cards/a/AnsweredPrayers.java +++ b/Mage.Sets/src/mage/cards/a/AnsweredPrayers.java @@ -68,7 +68,7 @@ class AnsweredPrayersEffect extends OneShotEffect { if (permanent == null) { return false; } - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { return true; } game.addEffect(new BecomesCreatureSourceEffect( diff --git a/Mage.Sets/src/mage/cards/a/ApexOfPower.java b/Mage.Sets/src/mage/cards/a/ApexOfPower.java index 854213f17a..a4aeefcf94 100644 --- a/Mage.Sets/src/mage/cards/a/ApexOfPower.java +++ b/Mage.Sets/src/mage/cards/a/ApexOfPower.java @@ -76,7 +76,7 @@ class ApexOfPowerSpellEffect extends OneShotEffect { } controller.moveCards(cards, Zone.EXILED, source, game); for (Card card : cards) { - if (card.isLand()) { + if (card.isLand(game)) { continue; } ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/a/ArahboRoarOfTheWorld.java b/Mage.Sets/src/mage/cards/a/ArahboRoarOfTheWorld.java index d6da198860..75b677d4e3 100644 --- a/Mage.Sets/src/mage/cards/a/ArahboRoarOfTheWorld.java +++ b/Mage.Sets/src/mage/cards/a/ArahboRoarOfTheWorld.java @@ -98,7 +98,7 @@ class ArahboEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); - if (creature != null && creature.isCreature()) { + if (creature != null && creature.isCreature(game)) { int pow = creature.getPower().getValue(); ContinuousEffect effect = new BoostTargetEffect(pow, pow, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(creature, game)); diff --git a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java index ddf7ceb57e..5b05457012 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneAdaptation.java @@ -76,26 +76,26 @@ class ArcaneAdaptationEffect extends ContinuousEffectImpl { // in graveyard for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature() && !card.hasSubtype(subType, game)) { + if (card != null && card.isCreature(game) && !card.hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); } } // on Hand for (UUID cardId : controller.getHand()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature() && !card.hasSubtype(subType, game)) { + if (card != null && card.isCreature(game) && !card.hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); } } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.isCreature() && !card.hasSubtype(subType, game)) { + if (card.isCreature(game) && !card.hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); } } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.isOwnedBy(controller.getId()) && card.isCreature() && !card.hasSubtype(subType, game)) { + if (card.isOwnedBy(controller.getId()) && card.isCreature(game) && !card.hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); } } @@ -104,7 +104,7 @@ class ArcaneAdaptationEffect extends ContinuousEffectImpl { if (commandObject instanceof Commander) { Card card = game.getCard(((Commander) commandObject).getId()); if (card != null && card.isOwnedBy(controller.getId()) - && card.isCreature() && !card.hasSubtype(subType, game)) { + && card.isCreature(game) && !card.hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); } } @@ -114,7 +114,7 @@ class ArcaneAdaptationEffect extends ContinuousEffectImpl { StackObject stackObject = iterator.next(); if (stackObject instanceof Spell && stackObject.isControlledBy(source.getControllerId()) - && stackObject.isCreature() + && stackObject.isCreature(game) && !stackObject.hasSubtype(subType, game)) { Card card = ((Spell) stackObject).getCard(); game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); diff --git a/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java b/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java index 3d8c43a218..60ad4f593b 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneArtisan.java @@ -101,7 +101,7 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect { return false; } - if (card.isCreature()) { + if (card.isCreature(game)) { CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(player.getId()); effect.setTargetPointer(new FixedTarget(card.getId(), game)); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/a/ArchonOfEmeria.java b/Mage.Sets/src/mage/cards/a/ArchonOfEmeria.java index 89e8e70e0e..f5bdb2b10f 100644 --- a/Mage.Sets/src/mage/cards/a/ArchonOfEmeria.java +++ b/Mage.Sets/src/mage/cards/a/ArchonOfEmeria.java @@ -77,7 +77,7 @@ class ArchonOfEmeriaEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isLand() && !permanent.isBasic()) { + if (permanent != null && permanent.isLand(game) && !permanent.isBasic()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java b/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java index 2efaf6d0a2..193ad45cda 100644 --- a/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java +++ b/Mage.Sets/src/mage/cards/a/ArchonOfValorsReach.java @@ -102,7 +102,7 @@ class ArchonOfValorsReachReplacementEffect extends ContinuousRuleModifyingEffect if (savedType instanceof String && card != null) { CardType cardType = CardType.fromString((String) savedType); - if (cardType != null && card.getCardType().contains(cardType)) { + if (cardType != null && card.getCardType(game).contains(cardType)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java b/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java index c7bfab4577..8c37909d32 100644 --- a/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java +++ b/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java @@ -84,7 +84,7 @@ class ArclightPhoenixWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return; } this.instantSorceryCount.putIfAbsent(spell.getControllerId(), 0); diff --git a/Mage.Sets/src/mage/cards/a/ArgothianPixies.java b/Mage.Sets/src/mage/cards/a/ArgothianPixies.java index f875c68e33..3a87d7f24c 100644 --- a/Mage.Sets/src/mage/cards/a/ArgothianPixies.java +++ b/Mage.Sets/src/mage/cards/a/ArgothianPixies.java @@ -76,7 +76,7 @@ class ArgothianPixiesPreventDamageFromArtifactsEffect extends PreventionEffectIm public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject != null && sourceObject.getCardType().contains(CardType.ARTIFACT)) { + if (sourceObject != null && sourceObject.getCardType(game).contains(CardType.ARTIFACT)) { return (event.getTargetId().equals(source.getSourceId())); } } diff --git a/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java b/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java index 7c2c0ca244..de204bb5b5 100644 --- a/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java +++ b/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java @@ -59,7 +59,7 @@ class PreventDamageToSourceByCardTypeEffect extends PreventAllDamageToSourceEffe public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject != null && sourceObject.getCardType().contains(cardType)) { + if (sourceObject != null && sourceObject.getCardType(game).contains(cardType)) { return event.getTargetId().equals(source.getSourceId()); } } diff --git a/Mage.Sets/src/mage/cards/a/ArixmethesSlumberingIsle.java b/Mage.Sets/src/mage/cards/a/ArixmethesSlumberingIsle.java index d0571a74df..c8df909829 100644 --- a/Mage.Sets/src/mage/cards/a/ArixmethesSlumberingIsle.java +++ b/Mage.Sets/src/mage/cards/a/ArixmethesSlumberingIsle.java @@ -92,8 +92,8 @@ class ArixmethesIsLandEffect extends ContinuousEffectImpl { if (permanent == null) { return false; } - permanent.getCardType().clear(); - permanent.addCardType(CardType.LAND); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.LAND); permanent.removeAllSubTypes(game); return true; } diff --git a/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java b/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java index 6495c38421..42d180f46d 100644 --- a/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java +++ b/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java @@ -68,7 +68,7 @@ class ArlinnVoiceOfThePackReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && (creature.hasSubtype(SubType.WOLF, game) || creature.hasSubtype(SubType.WEREWOLF, game)); } diff --git a/Mage.Sets/src/mage/cards/a/ArmedAndArmored.java b/Mage.Sets/src/mage/cards/a/ArmedAndArmored.java index 4a68eb83d3..29e95ca5be 100644 --- a/Mage.Sets/src/mage/cards/a/ArmedAndArmored.java +++ b/Mage.Sets/src/mage/cards/a/ArmedAndArmored.java @@ -62,8 +62,8 @@ class ArmedAndArmoredEffect extends ContinuousEffectImpl { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { if (permanent != null && permanent.hasSubtype(SubType.VEHICLE, game)) { if (sublayer == SubLayer.NA) { - permanent.addCardType(CardType.ARTIFACT); - permanent.addCardType(CardType.CREATURE);// TODO: Check if giving CREATURE Type is correct + permanent.addCardType(game, CardType.ARTIFACT); + permanent.addCardType(game, CardType.CREATURE);// TODO: Check if giving CREATURE Type is correct } } } diff --git a/Mage.Sets/src/mage/cards/a/ArtificersHex.java b/Mage.Sets/src/mage/cards/a/ArtificersHex.java index c7ec75948c..79550c79b2 100644 --- a/Mage.Sets/src/mage/cards/a/ArtificersHex.java +++ b/Mage.Sets/src/mage/cards/a/ArtificersHex.java @@ -76,7 +76,7 @@ class ArtificersHexEffect extends OneShotEffect { Permanent equipment = game.getPermanent(enchantment.getAttachedTo()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent creature = game.getPermanent(equipment.getAttachedTo()); - if (creature != null && creature.isCreature()) { + if (creature != null && creature.isCreature(game)) { return creature.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/a/AsForetold.java b/Mage.Sets/src/mage/cards/a/AsForetold.java index b07ad12083..d80d0d6474 100644 --- a/Mage.Sets/src/mage/cards/a/AsForetold.java +++ b/Mage.Sets/src/mage/cards/a/AsForetold.java @@ -71,7 +71,7 @@ class SpellWithManaCostLessThanOrEqualToCondition implements Condition { public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); return object != null - && !object.isLand() + && !object.isLand(game) && object.getManaValue() <= counters; } } diff --git a/Mage.Sets/src/mage/cards/a/AscentOfTheWorthy.java b/Mage.Sets/src/mage/cards/a/AscentOfTheWorthy.java index 46898f9818..c5035cdc54 100644 --- a/Mage.Sets/src/mage/cards/a/AscentOfTheWorthy.java +++ b/Mage.Sets/src/mage/cards/a/AscentOfTheWorthy.java @@ -134,7 +134,7 @@ class AscentOfTheWorthyRedirectEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId()); + return permanent != null && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java b/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java index 500c5ddc1a..f19cb8a4a5 100644 --- a/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java +++ b/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java @@ -86,8 +86,8 @@ class AshayaSoulOfTheWildEffect extends ContinuousEffectImpl { for (Permanent permanent : game.getBattlefield().getActivePermanents( filter, source.getControllerId(), source.getSourceId(), game )) { - if (!permanent.isLand()) { - permanent.addCardType(CardType.LAND); + if (!permanent.isLand(game)) { + permanent.addCardType(game, CardType.LAND); } permanent.addSubType(game, SubType.FOREST); if (!permanent.getAbilities(game).containsClass(GreenManaAbility.class)) { diff --git a/Mage.Sets/src/mage/cards/a/AshenGhoul.java b/Mage.Sets/src/mage/cards/a/AshenGhoul.java index c58c437abd..41e16e6cb9 100644 --- a/Mage.Sets/src/mage/cards/a/AshenGhoul.java +++ b/Mage.Sets/src/mage/cards/a/AshenGhoul.java @@ -69,7 +69,7 @@ enum AshenGhoulCondition implements Condition { int cardsAbove = 0; boolean aboveCards = false; for (Card card : controller.getGraveyard().getCards(game)) { - if (aboveCards && card.isCreature()) { + if (aboveCards && card.isCreature(game)) { cardsAbove++; if (cardsAbove > 2) { return true; diff --git a/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java b/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java index 4c8474460b..0dfd2a8290 100644 --- a/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java +++ b/Mage.Sets/src/mage/cards/a/AshesOfTheFallen.java @@ -61,7 +61,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl { if (subType != null) { for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature() && !card.hasSubtype(subType, game)) { + if (card != null && card.isCreature(game) && !card.hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().add(subType); } } diff --git a/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java b/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java index 4a7d734fed..2a9ae6fb83 100644 --- a/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java +++ b/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java @@ -68,7 +68,7 @@ class AsmiraHolyAvengerWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature()) { + if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature(game)) { creaturesCount++; } } diff --git a/Mage.Sets/src/mage/cards/a/AthreosShroudVeiled.java b/Mage.Sets/src/mage/cards/a/AthreosShroudVeiled.java index acad64c2ec..3a1bdb6c9f 100644 --- a/Mage.Sets/src/mage/cards/a/AthreosShroudVeiled.java +++ b/Mage.Sets/src/mage/cards/a/AthreosShroudVeiled.java @@ -103,7 +103,7 @@ class AthreosShroudVeiledTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; Permanent permanent = zEvent.getTarget(); if (permanent == null - || !permanent.isCreature() + || !permanent.isCreature(game) || !permanent.getCounters(game).containsKey(CounterType.COIN)) { return false; } diff --git a/Mage.Sets/src/mage/cards/a/AtlaPalaniNestTender.java b/Mage.Sets/src/mage/cards/a/AtlaPalaniNestTender.java index 12a8a63941..cda4369dc8 100644 --- a/Mage.Sets/src/mage/cards/a/AtlaPalaniNestTender.java +++ b/Mage.Sets/src/mage/cards/a/AtlaPalaniNestTender.java @@ -90,7 +90,7 @@ class AtlaPalaniNestTenderEffect extends OneShotEffect { Card toBattlefield = null; for (Card card : library.getCards(game)) { cards.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { toBattlefield = card; break; } diff --git a/Mage.Sets/src/mage/cards/a/AudaciousReshapers.java b/Mage.Sets/src/mage/cards/a/AudaciousReshapers.java index ec4298c9b8..e9ab69146e 100644 --- a/Mage.Sets/src/mage/cards/a/AudaciousReshapers.java +++ b/Mage.Sets/src/mage/cards/a/AudaciousReshapers.java @@ -80,7 +80,7 @@ class AudaciousReshapersEffect extends OneShotEffect { continue; } cards.add(card); - if (card.isArtifact()) { + if (card.isArtifact(game)) { artifact = card; break; } diff --git a/Mage.Sets/src/mage/cards/a/AugmenterPugilist.java b/Mage.Sets/src/mage/cards/a/AugmenterPugilist.java index 802f888fb7..8477ff6b56 100644 --- a/Mage.Sets/src/mage/cards/a/AugmenterPugilist.java +++ b/Mage.Sets/src/mage/cards/a/AugmenterPugilist.java @@ -95,7 +95,7 @@ class EchoingEquationEffect extends OneShotEffect { Permanent copyFrom = game.getPermanent(source.getFirstTarget()); if (copyFrom != null) { game.getBattlefield().getAllActivePermanents(source.getControllerId()).stream() - .filter(permanent -> permanent.isCreature() && !permanent.getId().equals(copyFrom.getId())) + .filter(permanent -> permanent.isCreature(game) && !permanent.getId().equals(copyFrom.getId())) .forEach(copyTo -> game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), source, new CopyApplier() { @Override public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) { diff --git a/Mage.Sets/src/mage/cards/a/AuraBarbs.java b/Mage.Sets/src/mage/cards/a/AuraBarbs.java index 29681c7185..9fc5d9157e 100644 --- a/Mage.Sets/src/mage/cards/a/AuraBarbs.java +++ b/Mage.Sets/src/mage/cards/a/AuraBarbs.java @@ -66,7 +66,7 @@ public final class AuraBarbs extends CardImpl { for (Permanent auraEnchantment : game.getBattlefield().getActivePermanents(filterEnchantments, source.getControllerId(), source.getSourceId(), game)) { if (auraEnchantment.getAttachedTo() != null) { Permanent attachedToCreature = game.getPermanent(auraEnchantment.getAttachedTo()); - if (attachedToCreature != null && attachedToCreature.isCreature()) { + if (attachedToCreature != null && attachedToCreature.isCreature(game)) { attachedToCreature.damage(2, auraEnchantment.getId(), source, game, false, true); game.informPlayers("2 damage assigned to " + attachedToCreature.getName() + " from " + auraEnchantment.getName()); } diff --git a/Mage.Sets/src/mage/cards/a/AureliasFury.java b/Mage.Sets/src/mage/cards/a/AureliasFury.java index 7b37b87ed4..5d5e32a7c5 100644 --- a/Mage.Sets/src/mage/cards/a/AureliasFury.java +++ b/Mage.Sets/src/mage/cards/a/AureliasFury.java @@ -157,7 +157,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifyingEffectImpl { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null && player.getId().equals(event.getPlayerId())) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isCreature()) { + if (card != null && !card.isCreature(game)) { return true; } } @@ -183,7 +183,7 @@ class AureliasFuryDamagedByWatcher extends Watcher { switch (event.getType()) { case DAMAGED_PERMANENT: Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { damagedCreatures.add(event.getTargetId()); } return; diff --git a/Mage.Sets/src/mage/cards/a/Aurification.java b/Mage.Sets/src/mage/cards/a/Aurification.java index 5f3cff9db9..0a70702e63 100644 --- a/Mage.Sets/src/mage/cards/a/Aurification.java +++ b/Mage.Sets/src/mage/cards/a/Aurification.java @@ -87,7 +87,7 @@ public final class Aurification extends CardImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getSourceId())); } @@ -121,7 +121,7 @@ public final class Aurification extends CardImpl { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE, game)) { if (permanent != null) { int numToRemove = permanent.getCounters(game).getCount(CounterType.GOLD); if (numToRemove > 0) { diff --git a/Mage.Sets/src/mage/cards/a/AuspiciousStarrix.java b/Mage.Sets/src/mage/cards/a/AuspiciousStarrix.java index e183749608..773db08f96 100644 --- a/Mage.Sets/src/mage/cards/a/AuspiciousStarrix.java +++ b/Mage.Sets/src/mage/cards/a/AuspiciousStarrix.java @@ -75,7 +75,7 @@ class AuspiciousStarrixEffect extends OneShotEffect { Cards toExile = new CardsImpl(); Cards toBattlefield = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { - if (card != null && card.isPermanent()) { + if (card != null && card.isPermanent(game)) { toBattlefield.add(card); count++; } diff --git a/Mage.Sets/src/mage/cards/a/AuthorityOfTheConsuls.java b/Mage.Sets/src/mage/cards/a/AuthorityOfTheConsuls.java index a696b47c06..57a3a22bd1 100644 --- a/Mage.Sets/src/mage/cards/a/AuthorityOfTheConsuls.java +++ b/Mage.Sets/src/mage/cards/a/AuthorityOfTheConsuls.java @@ -78,7 +78,7 @@ class AuthorityOfTheConsulsTapEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java b/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java index 3bf8f885d7..8d905c9666 100644 --- a/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java +++ b/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java @@ -59,7 +59,7 @@ class AwakenedAmalgamLandNamesCount implements DynamicValue { public int calculate(Game game, Ability sourceAbility, Effect effect) { Set landNames = new HashSet<>(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(sourceAbility.getControllerId())) { - if (permanent.isLand()) { + if (permanent.isLand(game)) { landNames.add(permanent.getName()); } } diff --git a/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java b/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java index 8326a5c688..49c90ae4d7 100644 --- a/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java +++ b/Mage.Sets/src/mage/cards/a/AzorTheLawbringer.java @@ -131,7 +131,7 @@ class AzorTheLawbringerCantCastEffect extends ContinuousRuleModifyingEffectImpl if (opponentId.equals(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (event.getType() == GameEvent.EventType.CAST_SPELL) { - if (object.isInstantOrSorcery()) { + if (object.isInstantOrSorcery(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java b/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java index b07ad16586..e500f89c21 100644 --- a/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java +++ b/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java @@ -1,7 +1,6 @@ package mage.cards.b; import mage.MageInt; -import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; @@ -76,7 +75,7 @@ class BackdraftHellkiteEffect extends ContinuousEffectImpl { player.getGraveyard() .stream() .map((cardId) -> game.getCard(cardId)) - .filter(MageObject::isInstantOrSorcery) + .filter(card1 -> card1.isInstantOrSorcery(game)) .forEachOrdered(card -> affectedObjectList.add(new MageObjectReference(card, game))); } @@ -95,9 +94,9 @@ class BackdraftHellkiteEffect extends ContinuousEffectImpl { return; } FlashbackAbility ability = null; - if (card.isInstant()) { + if (card.isInstant(game)) { ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); - } else if (card.isSorcery()) { + } else if (card.isSorcery(game)) { ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); } if (ability == null) { diff --git a/Mage.Sets/src/mage/cards/b/BalduvianWarlord.java b/Mage.Sets/src/mage/cards/b/BalduvianWarlord.java index 741bac471c..6bb41553fa 100644 --- a/Mage.Sets/src/mage/cards/b/BalduvianWarlord.java +++ b/Mage.Sets/src/mage/cards/b/BalduvianWarlord.java @@ -96,7 +96,7 @@ class BalduvianWarlordUnblockEffect extends OneShotEffect { } // Choose new creature to block - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { // according to the following mail response from MTG Rules Management about False Orders: // "if Player A attacks Players B and C, Player B's creatures cannot block creatures attacking Player C" // therefore we need to single out creatures attacking the target blocker's controller (disappointing, I know) @@ -123,7 +123,7 @@ class BalduvianWarlordUnblockEffect extends OneShotEffect { return true; } Permanent chosenPermanent = game.getPermanent(target.getFirstTarget()); - if (chosenPermanent != null && chosenPermanent.isCreature()) { + if (chosenPermanent != null && chosenPermanent.isCreature(game)) { CombatGroup chosenGroup = game.getCombat().findGroup(chosenPermanent.getId()); if (chosenGroup != null) { // Relevant ruling for Balduvian Warlord: diff --git a/Mage.Sets/src/mage/cards/b/BalothCageTrap.java b/Mage.Sets/src/mage/cards/b/BalothCageTrap.java index 8183bbf949..cfd9820c5f 100644 --- a/Mage.Sets/src/mage/cards/b/BalothCageTrap.java +++ b/Mage.Sets/src/mage/cards/b/BalothCageTrap.java @@ -56,7 +56,7 @@ enum BalothCageTrapCondition implements Condition { List permanents = watcher.getThisTurnEnteringPermanents(opponentId); if (permanents != null) { for (Permanent permanent : permanents) { - if (permanent.isArtifact()) { + if (permanent.isArtifact(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/BalustradeSpy.java b/Mage.Sets/src/mage/cards/b/BalustradeSpy.java index 7ae6e6ffe9..45d17b26f9 100644 --- a/Mage.Sets/src/mage/cards/b/BalustradeSpy.java +++ b/Mage.Sets/src/mage/cards/b/BalustradeSpy.java @@ -77,7 +77,7 @@ class BalustradeSpyEffect extends OneShotEffect { for (Card card : controller.getLibrary().getCards(game)) { if (card != null) { toGraveyard.add(card); - if (card.isLand()) { + if (card.isLand(game)) { break; } } diff --git a/Mage.Sets/src/mage/cards/b/BanishIntoFable.java b/Mage.Sets/src/mage/cards/b/BanishIntoFable.java index 79f947e179..7fecbc5d63 100644 --- a/Mage.Sets/src/mage/cards/b/BanishIntoFable.java +++ b/Mage.Sets/src/mage/cards/b/BanishIntoFable.java @@ -11,7 +11,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; import mage.game.permanent.token.KnightToken; import mage.game.stack.Spell; import mage.target.common.TargetNonlandPermanent; @@ -117,14 +116,14 @@ class BanishIntoFableEffect extends OneShotEffect { if (game.getBattlefield() .getAllActivePermanents(source.getControllerId()) .stream() - .filter(Permanent::isArtifact) + .filter(permanent -> permanent.isArtifact(game)) .count() > 0) { spell.createCopyOnStack(game, source, source.getControllerId(), true); } if (game.getBattlefield() .getAllActivePermanents(source.getControllerId()) .stream() - .filter(Permanent::isEnchantment) + .filter(permanent -> permanent.isEnchantment(game)) .count() > 0) { spell.createCopyOnStack(game, source, source.getControllerId(), true); } diff --git a/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java b/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java index 7c5cb33cd3..c911bd92af 100644 --- a/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java +++ b/Mage.Sets/src/mage/cards/b/BattlefieldThaumaturge.java @@ -79,7 +79,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf } for (UUID uuid : target.getTargets()) { Permanent permanent = game.getPermanent(uuid); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { creaturesTargeted.add(permanent.getId()); } } @@ -102,7 +102,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf Set possibleList = target.possibleTargets(ability.getSourceId(), ability.getControllerId(), game); possibleList.removeIf(id -> { Permanent permanent = game.getPermanent(id); - return permanent == null || !permanent.isCreature(); + return permanent == null || !permanent.isCreature(game); }); int possibleAmount = Math.min(possibleList.size(), target.getMaxNumberOfTargets()); maxAmount = Math.max(maxAmount, possibleAmount); diff --git a/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java b/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java index c7ce30bbfc..7e584d6b67 100644 --- a/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java +++ b/Mage.Sets/src/mage/cards/b/BeamsplitterMage.java @@ -1,7 +1,6 @@ package mage.cards.b; import mage.MageInt; -import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.AbilityImpl; @@ -85,7 +84,7 @@ class BeamsplitterMageTriggeredAbility extends TriggeredAbilityImpl { return false; } Spell spell = game.getSpellOrLKIStack(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } if (spell.getSpellAbilities() @@ -116,7 +115,7 @@ class BeamsplitterMageTriggeredAbility extends TriggeredAbilityImpl { getControllerId(), getSourceId(), game ).stream() .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(permanent -> permanent.isCreature(game)) .filter(p -> checkNotSource(p, game)) .anyMatch(p -> spell.canTarget(game, p.getId())); } diff --git a/Mage.Sets/src/mage/cards/b/BellowingElk.java b/Mage.Sets/src/mage/cards/b/BellowingElk.java index 7bdef94782..c94973dc3a 100644 --- a/Mage.Sets/src/mage/cards/b/BellowingElk.java +++ b/Mage.Sets/src/mage/cards/b/BellowingElk.java @@ -81,7 +81,7 @@ class BellowingElkWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { playerMap.putIfAbsent(zEvent.getTarget().getControllerId(), new HashSet<>()); playerMap.get(zEvent.getTarget().getControllerId()).add(zEvent.getTargetId()); } diff --git a/Mage.Sets/src/mage/cards/b/BenefactionOfRhonas.java b/Mage.Sets/src/mage/cards/b/BenefactionOfRhonas.java index 5ab0858e39..cccf835335 100644 --- a/Mage.Sets/src/mage/cards/b/BenefactionOfRhonas.java +++ b/Mage.Sets/src/mage/cards/b/BenefactionOfRhonas.java @@ -70,10 +70,10 @@ class BenefactionOfRhonasEffect extends OneShotEffect { Card card = game.getCard(cardId); if (card != null) { cards.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { creatureCardFound = true; } - if (card.isEnchantment()) { + if (card.isEnchantment(game)) { enchantmentCardFound = true; } } diff --git a/Mage.Sets/src/mage/cards/b/BenthicExplorers.java b/Mage.Sets/src/mage/cards/b/BenthicExplorers.java index 3ce7b04ff6..1b91349da2 100644 --- a/Mage.Sets/src/mage/cards/b/BenthicExplorers.java +++ b/Mage.Sets/src/mage/cards/b/BenthicExplorers.java @@ -142,7 +142,7 @@ class BenthicExplorersManaEffect extends ManaEffect { Set manaTypes = EnumSet.noneOf(ManaType.class); for (UUID opponentId : game.getOpponents(source.getControllerId())) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) { - if (permanent.isLand() && permanent.isTapped()) { + if (permanent.isLand(game) && permanent.isTapped()) { for (ActivatedManaAbilityImpl ability : permanent.getAbilities(game).getActivatedManaAbilities(Zone.BATTLEFIELD)) { manaTypes.addAll(ability.getProducableManaTypes(game)); } diff --git a/Mage.Sets/src/mage/cards/b/Bereavement.java b/Mage.Sets/src/mage/cards/b/Bereavement.java index 3b44098c60..34d19b1599 100644 --- a/Mage.Sets/src/mage/cards/b/Bereavement.java +++ b/Mage.Sets/src/mage/cards/b/Bereavement.java @@ -10,7 +10,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -63,7 +62,7 @@ class BereavementTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent)event).isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && permanent.isCreature() && permanent.getColor(game).isGreen()) { + if (permanent != null && permanent.isCreature(game) && permanent.getColor(game).isGreen()) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BioessenceHydra.java b/Mage.Sets/src/mage/cards/b/BioessenceHydra.java index 60ed9cec00..7284045002 100644 --- a/Mage.Sets/src/mage/cards/b/BioessenceHydra.java +++ b/Mage.Sets/src/mage/cards/b/BioessenceHydra.java @@ -113,7 +113,7 @@ class BioessenceHydraTriggeredAbility extends TriggeredAbilityImpl { } if (permanent != null && !event.getTargetId().equals(this.getSourceId()) - && permanent.isPlaneswalker() + && permanent.isPlaneswalker(game) && permanent.isControlledBy(this.getControllerId())) { this.getEffects().clear(); if (event.getAmount() > 0) { diff --git a/Mage.Sets/src/mage/cards/b/BiomancersFamiliar.java b/Mage.Sets/src/mage/cards/b/BiomancersFamiliar.java index 7767c8baeb..ec6e5e04d5 100644 --- a/Mage.Sets/src/mage/cards/b/BiomancersFamiliar.java +++ b/Mage.Sets/src/mage/cards/b/BiomancersFamiliar.java @@ -1,7 +1,6 @@ package mage.cards.b; import mage.MageInt; -import mage.Mana; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -93,7 +92,7 @@ class BiomancersFamiliarCostReductionEffect extends CostModificationEffectImpl { //Activated abilities of creatures you control Permanent permanent = game.getPermanentOrLKIBattlefield(abilityToModify.getSourceId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/b/Bioplasm.java b/Mage.Sets/src/mage/cards/b/Bioplasm.java index c49355f279..e568e2eb3e 100644 --- a/Mage.Sets/src/mage/cards/b/Bioplasm.java +++ b/Mage.Sets/src/mage/cards/b/Bioplasm.java @@ -76,7 +76,7 @@ class BioplasmEffect extends OneShotEffect { if (card == null) { return false; } - if (player.moveCards(card, Zone.EXILED, source, game) && card.isCreature()) { + if (player.moveCards(card, Zone.EXILED, source, game) && card.isCreature(game)) { game.addEffect(new BoostSourceEffect(card.getPower().getValue(), card.getToughness().getValue(), Duration.EndOfTurn), source); } return true; diff --git a/Mage.Sets/src/mage/cards/b/BlackSunsZenith.java b/Mage.Sets/src/mage/cards/b/BlackSunsZenith.java index 1ce9328421..8c27e8a6df 100644 --- a/Mage.Sets/src/mage/cards/b/BlackSunsZenith.java +++ b/Mage.Sets/src/mage/cards/b/BlackSunsZenith.java @@ -53,7 +53,7 @@ class BlackSunsZenithEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int amount = source.getManaCostsToPay().getX(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) { - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { permanent.addCounters(CounterType.M1M1.createInstance(amount), source.getControllerId(), source, game); } } diff --git a/Mage.Sets/src/mage/cards/b/BlacksmithsSkill.java b/Mage.Sets/src/mage/cards/b/BlacksmithsSkill.java index ad83eeceac..60e9ac5857 100644 --- a/Mage.Sets/src/mage/cards/b/BlacksmithsSkill.java +++ b/Mage.Sets/src/mage/cards/b/BlacksmithsSkill.java @@ -65,7 +65,7 @@ class BlacksmithsSkillEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null && permanent.isArtifact() && permanent.isCreature()) { + if (permanent != null && permanent.isArtifact(game) && permanent.isCreature(game)) { game.addEffect(new BoostTargetEffect(2, 2), source); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BlazeCommando.java b/Mage.Sets/src/mage/cards/b/BlazeCommando.java index ceb15534f6..89bfc14921 100644 --- a/Mage.Sets/src/mage/cards/b/BlazeCommando.java +++ b/Mage.Sets/src/mage/cards/b/BlazeCommando.java @@ -13,7 +13,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.SoldierTokenWithHaste; import java.util.ArrayList; @@ -93,7 +92,7 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl { if (isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject damageSource = game.getObject(event.getSourceId()); if (damageSource != null) { - if (damageSource.isInstantOrSorcery()) { + if (damageSource.isInstantOrSorcery(game)) { if (!handledStackObjects.contains(damageSource.getId())) { handledStackObjects.add(damageSource.getId()); return true; diff --git a/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java b/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java index a73ded97d1..e1df1ecc56 100644 --- a/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java +++ b/Mage.Sets/src/mage/cards/b/BlessedReincarnation.java @@ -83,7 +83,7 @@ class BlessedReincarnationEffect extends OneShotEffect { Cards toReveal = new CardsImpl(); for (Card card : library.getCards(game)) { toReveal.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { permanentController.moveCards(card, Zone.BATTLEFIELD, source, game); break; } diff --git a/Mage.Sets/src/mage/cards/b/Blightbeetle.java b/Mage.Sets/src/mage/cards/b/Blightbeetle.java index 9172cd7b7b..1c016e96dd 100644 --- a/Mage.Sets/src/mage/cards/b/Blightbeetle.java +++ b/Mage.Sets/src/mage/cards/b/Blightbeetle.java @@ -76,7 +76,7 @@ class BlightbeetleEffect extends ContinuousRuleModifyingEffectImpl { return false; } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } Player player = game.getPlayer(permanent.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/b/BlindFury.java b/Mage.Sets/src/mage/cards/b/BlindFury.java index 27b8597474..7350fb4fb7 100644 --- a/Mage.Sets/src/mage/cards/b/BlindFury.java +++ b/Mage.Sets/src/mage/cards/b/BlindFury.java @@ -70,7 +70,7 @@ class FurnaceOfRathEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getSourceId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && ((DamageEvent) event).isCombatDamage(); } diff --git a/Mage.Sets/src/mage/cards/b/BlindObedience.java b/Mage.Sets/src/mage/cards/b/BlindObedience.java index dae81b06d6..bdc871b193 100644 --- a/Mage.Sets/src/mage/cards/b/BlindObedience.java +++ b/Mage.Sets/src/mage/cards/b/BlindObedience.java @@ -73,7 +73,7 @@ class BlindObedienceTapEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && (permanent.isCreature() || permanent.isArtifact())) { + if (permanent != null && (permanent.isCreature(game) || permanent.isArtifact(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/b/BloodForBones.java b/Mage.Sets/src/mage/cards/b/BloodForBones.java index c0c4ea3716..cbfe5992e9 100644 --- a/Mage.Sets/src/mage/cards/b/BloodForBones.java +++ b/Mage.Sets/src/mage/cards/b/BloodForBones.java @@ -3,7 +3,6 @@ package mage.cards.b; import mage.abilities.Ability; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; @@ -73,14 +72,14 @@ class BloodForBonesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player == null || player.getGraveyard().getCards(game).stream().noneMatch(Card::isCreature)) { + if (player == null || player.getGraveyard().getCards(game).stream().noneMatch(card -> card.isCreature(game))) { return false; } TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter); if (player.choose(outcome, player.getGraveyard(), target, game)) { player.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game); } - if (player.getGraveyard().getCards(game).stream().noneMatch(Card::isCreature)) { + if (player.getGraveyard().getCards(game).stream().noneMatch(card -> card.isCreature(game))) { return true; } target = new TargetCardInYourGraveyard(filter2); diff --git a/Mage.Sets/src/mage/cards/b/BloodOath.java b/Mage.Sets/src/mage/cards/b/BloodOath.java index ecf38c7b4b..0893ebbd5d 100644 --- a/Mage.Sets/src/mage/cards/b/BloodOath.java +++ b/Mage.Sets/src/mage/cards/b/BloodOath.java @@ -106,7 +106,7 @@ class BloodOathEffect extends OneShotEffect { Set cards = hand.getCards(game); int damageToDeal = 0; for (Card card : cards) { - if (card != null && card.getCardType().contains(type)) { + if (card != null && card.getCardType(game).contains(type)) { damageToDeal += 3; } } diff --git a/Mage.Sets/src/mage/cards/b/BloodOfTheMartyr.java b/Mage.Sets/src/mage/cards/b/BloodOfTheMartyr.java index 4c4c25ebd2..e2a0a6f99f 100644 --- a/Mage.Sets/src/mage/cards/b/BloodOfTheMartyr.java +++ b/Mage.Sets/src/mage/cards/b/BloodOfTheMartyr.java @@ -82,7 +82,7 @@ class BloodOfTheMartyrEffect extends ReplacementEffectImpl { DamageEvent damageEvent = (DamageEvent) event; return controller != null && permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && controller.chooseUse(outcome, "Have " + damageEvent.getAmount() + " damage dealt to you instead of " + permanent.getLogName() + "?", source, game); } } diff --git a/Mage.Sets/src/mage/cards/b/BloodSeeker.java b/Mage.Sets/src/mage/cards/b/BloodSeeker.java index 8a2dd01ba6..9f23edc8c2 100644 --- a/Mage.Sets/src/mage/cards/b/BloodSeeker.java +++ b/Mage.Sets/src/mage/cards/b/BloodSeeker.java @@ -15,7 +15,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -70,7 +69,7 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl { if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent) event; Card card = zEvent.getTarget(); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/b/BloodfireEnforcers.java b/Mage.Sets/src/mage/cards/b/BloodfireEnforcers.java index dc322f30b5..6cd71a597d 100644 --- a/Mage.Sets/src/mage/cards/b/BloodfireEnforcers.java +++ b/Mage.Sets/src/mage/cards/b/BloodfireEnforcers.java @@ -65,12 +65,12 @@ class BloodfireEnforcersCondition implements Condition { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for(Card card : player.getGraveyard().getCards(game)) { - if (card.isInstant()) { + if (card.isInstant(game)) { if (sorceryFound) { return true; } instantFound = true; - } else if (card.isSorcery()) { + } else if (card.isSorcery(game)) { if (instantFound) { return true; } diff --git a/Mage.Sets/src/mage/cards/b/BloodsporeThrinax.java b/Mage.Sets/src/mage/cards/b/BloodsporeThrinax.java index cfab0eaef6..a2ca066086 100644 --- a/Mage.Sets/src/mage/cards/b/BloodsporeThrinax.java +++ b/Mage.Sets/src/mage/cards/b/BloodsporeThrinax.java @@ -66,7 +66,7 @@ class BloodsporeThrinaxEntersBattlefieldEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/b/BolassCitadel.java b/Mage.Sets/src/mage/cards/b/BolassCitadel.java index cae98223fd..b726107a3b 100644 --- a/Mage.Sets/src/mage/cards/b/BolassCitadel.java +++ b/Mage.Sets/src/mage/cards/b/BolassCitadel.java @@ -113,7 +113,7 @@ class BolassCitadelPlayTheTopCardEffect extends AsThoughEffectImpl { } // allows to play/cast with alternative life cost - if (!cardToCheck.isLand()) { + if (!cardToCheck.isLand(game)) { PayLifeCost lifeCost = new PayLifeCost(cardToCheck.getSpellAbility().getManaCosts().manaValue()); Costs newCosts = new CostsImpl(); newCosts.add(lifeCost); diff --git a/Mage.Sets/src/mage/cards/b/BoldPlagiarist.java b/Mage.Sets/src/mage/cards/b/BoldPlagiarist.java index d22749c8ce..f37b21033e 100644 --- a/Mage.Sets/src/mage/cards/b/BoldPlagiarist.java +++ b/Mage.Sets/src/mage/cards/b/BoldPlagiarist.java @@ -70,7 +70,7 @@ class BoldPlagiaristTriggeredAbility extends TriggeredAbilityImpl { } Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent == null - || !permanent.isCreature() + || !permanent.isCreature(game) || !permanent.isControlledBy(event.getPlayerId())) { return false; } diff --git a/Mage.Sets/src/mage/cards/b/BoneDancer.java b/Mage.Sets/src/mage/cards/b/BoneDancer.java index 5906a1009d..fc757ead16 100644 --- a/Mage.Sets/src/mage/cards/b/BoneDancer.java +++ b/Mage.Sets/src/mage/cards/b/BoneDancer.java @@ -65,7 +65,7 @@ class BoneDancerEffect extends OneShotEffect { if (controller != null && defendingPlayer != null) { Card lastCreatureCard = null; for (Card card : defendingPlayer.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { lastCreatureCard = card; } } diff --git a/Mage.Sets/src/mage/cards/b/BonusRound.java b/Mage.Sets/src/mage/cards/b/BonusRound.java index 6d33013704..1301ba34ae 100644 --- a/Mage.Sets/src/mage/cards/b/BonusRound.java +++ b/Mage.Sets/src/mage/cards/b/BonusRound.java @@ -60,7 +60,7 @@ class BonusRoundDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java b/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java index a551870815..54d3d5ab99 100644 --- a/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java +++ b/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java @@ -71,7 +71,7 @@ class BoseijuWhoSheltersAllWatcher extends Watcher { if (event.getType() == GameEvent.EventType.MANA_PAID) { if (event.getData() != null && event.getData().equals(originalId.toString()) && event.getTargetId() != null) { Card spell = game.getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { spells.add(new MageObjectReference(game.getObject(event.getTargetId()), game)); } } diff --git a/Mage.Sets/src/mage/cards/b/Bossk.java b/Mage.Sets/src/mage/cards/b/Bossk.java index ee4c5d874f..f4f07f8928 100644 --- a/Mage.Sets/src/mage/cards/b/Bossk.java +++ b/Mage.Sets/src/mage/cards/b/Bossk.java @@ -81,7 +81,7 @@ class BosskTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand() && permanent.isControlledBy(this.getControllerId())) { + if (permanent != null && permanent.isLand(game) && permanent.isControlledBy(this.getControllerId())) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java b/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java index 87c9d102ca..1424fdf67a 100644 --- a/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java +++ b/Mage.Sets/src/mage/cards/b/BramblewoodParagon.java @@ -79,7 +79,7 @@ class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && creature.hasSubtype(SubType.WARRIOR, game) && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/b/BranchingEvolution.java b/Mage.Sets/src/mage/cards/b/BranchingEvolution.java index 3a89869041..ae3f1215cb 100644 --- a/Mage.Sets/src/mage/cards/b/BranchingEvolution.java +++ b/Mage.Sets/src/mage/cards/b/BranchingEvolution.java @@ -69,7 +69,7 @@ class BranchingEvolutionEffect extends ReplacementEffectImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature(); + && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/b/BrandOfIllOmen.java b/Mage.Sets/src/mage/cards/b/BrandOfIllOmen.java index ffb3906e18..7cfb2e6c03 100644 --- a/Mage.Sets/src/mage/cards/b/BrandOfIllOmen.java +++ b/Mage.Sets/src/mage/cards/b/BrandOfIllOmen.java @@ -96,7 +96,7 @@ class BrandOfIllOmenEffect extends ContinuousRuleModifyingEffectImpl { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && brand != null && brand.getAttachedTo() != null) { UUID enchantedController = game.getPermanent(brand.getAttachedTo()).getControllerId(); - return Objects.equals(enchantedController, event.getPlayerId()) && sourceObject.isCreature(); + return Objects.equals(enchantedController, event.getPlayerId()) && sourceObject.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/b/BreathlessKnight.java b/Mage.Sets/src/mage/cards/b/BreathlessKnight.java index 50c3dca10b..3b1c4b1c32 100644 --- a/Mage.Sets/src/mage/cards/b/BreathlessKnight.java +++ b/Mage.Sets/src/mage/cards/b/BreathlessKnight.java @@ -77,7 +77,7 @@ class BreathlessKnightTriggeredAbility extends TriggeredAbilityImpl { if (event instanceof EntersTheBattlefieldEvent) { EntersTheBattlefieldEvent entersEvent = (EntersTheBattlefieldEvent) event; Permanent permanent = entersEvent.getTarget(); - if (permanent != null && permanent.isCreature() && permanent.isControlledBy(this.getControllerId())) { + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) { if (entersEvent.getFromZone() == Zone.GRAVEYARD) { return true; } diff --git a/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java b/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java index 22a4c8a879..ee38bbc91c 100644 --- a/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java +++ b/Mage.Sets/src/mage/cards/b/BreathstealersCrypt.java @@ -10,7 +10,6 @@ import mage.cards.*; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -73,7 +72,7 @@ class BreathstealersCryptEffect extends ReplacementEffectImpl { return true; } player.revealCards(source, new CardsImpl(cardDrawn), game); - if (!cardDrawn.isCreature()) { + if (!cardDrawn.isCreature(game)) { return true; } game.informPlayers("The card drawn by " + player.getName() + " is a creature card. They discard that card unless they pay 3 life."); diff --git a/Mage.Sets/src/mage/cards/b/BronzehideLion.java b/Mage.Sets/src/mage/cards/b/BronzehideLion.java index 36ef08e2a3..da5b0187de 100644 --- a/Mage.Sets/src/mage/cards/b/BronzehideLion.java +++ b/Mage.Sets/src/mage/cards/b/BronzehideLion.java @@ -142,8 +142,8 @@ class BronzehideLionContinuousEffect extends ContinuousEffectImpl { Permanent lion = sourceObject; switch (layer) { case TypeChangingEffects_4: - lion.getCardType().clear(); - lion.addCardType(CardType.ENCHANTMENT); + lion.removeAllCardTypes(game); + lion.addCardType(game, CardType.ENCHANTMENT); lion.removeAllSubTypes(game); lion.addSubType(game, SubType.AURA); break; diff --git a/Mage.Sets/src/mage/cards/b/BrutalDeceiver.java b/Mage.Sets/src/mage/cards/b/BrutalDeceiver.java index 6310e959e3..f20d4c21eb 100644 --- a/Mage.Sets/src/mage/cards/b/BrutalDeceiver.java +++ b/Mage.Sets/src/mage/cards/b/BrutalDeceiver.java @@ -79,7 +79,7 @@ class BrutalDeceiverEffect extends OneShotEffect { if (card != null) { cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source); game.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), source); } diff --git a/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java b/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java index 7d3ea5594f..3b83ba2bd6 100644 --- a/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java +++ b/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java @@ -205,7 +205,7 @@ class BurningCinderFuryOfCrimsonChaosFireWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.TAPPED) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && !permanent.isLand()) { + if (permanent != null && !permanent.isLand(game)) { tappedActivePlayerIds.add(permanent.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/c/CagedSun.java b/Mage.Sets/src/mage/cards/c/CagedSun.java index 5572d779d2..ae35a28088 100644 --- a/Mage.Sets/src/mage/cards/c/CagedSun.java +++ b/Mage.Sets/src/mage/cards/c/CagedSun.java @@ -18,7 +18,6 @@ import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -107,7 +106,7 @@ class CagedSunTriggeredAbility extends TriggeredManaAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(controllerId)) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { ObjectColor color = (ObjectColor) game.getState().getValue(this.sourceId + "_color"); return color != null && event.getData().contains(color.toString()); } diff --git a/Mage.Sets/src/mage/cards/c/CairnWanderer.java b/Mage.Sets/src/mage/cards/c/CairnWanderer.java index 300101ae57..c5a2652c96 100644 --- a/Mage.Sets/src/mage/cards/c/CairnWanderer.java +++ b/Mage.Sets/src/mage/cards/c/CairnWanderer.java @@ -70,7 +70,7 @@ public final class CairnWanderer extends CardImpl { if (player != null) { for (Card card : player.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { for (Ability ability : card.getAbilities(game)) { if (ability instanceof MageSingleton) { if (ability instanceof FlyingAbility diff --git a/Mage.Sets/src/mage/cards/c/CalibratedBlast.java b/Mage.Sets/src/mage/cards/c/CalibratedBlast.java index 3a1bc01af3..320cb6f805 100644 --- a/Mage.Sets/src/mage/cards/c/CalibratedBlast.java +++ b/Mage.Sets/src/mage/cards/c/CalibratedBlast.java @@ -68,7 +68,7 @@ class CalibratedBlastEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { continue; } ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java b/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java index 06862cc241..767f3873d6 100644 --- a/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java +++ b/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java @@ -1,6 +1,5 @@ package mage.cards.c; -import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -194,7 +193,7 @@ class CalixDestinysHandReturnEffect extends OneShotEffect { player.getGraveyard() .getCards(game) .stream() - .filter(MageObject::isEnchantment) + .filter(card -> card.isEnchantment(game)) .collect(Collectors.toSet()), Zone.BATTLEFIELD, source, game ); diff --git a/Mage.Sets/src/mage/cards/c/CallOfTheWild.java b/Mage.Sets/src/mage/cards/c/CallOfTheWild.java index ae0ce0fb22..0d0b40fc03 100644 --- a/Mage.Sets/src/mage/cards/c/CallOfTheWild.java +++ b/Mage.Sets/src/mage/cards/c/CallOfTheWild.java @@ -66,7 +66,7 @@ class CallOfTheWildEffect extends OneShotEffect { if (card != null) { Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { controller.moveCards(card, Zone.GRAVEYARD, source, game); diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java b/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java index c425153623..6c9e7cf4a9 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java @@ -72,7 +72,7 @@ class CallerOfTheClawWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { Permanent card = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (card != null && card.isOwnedBy(this.controllerId) && card.isCreature() && !(card instanceof PermanentToken)) { + if (card != null && card.isOwnedBy(this.controllerId) && card.isCreature(game) && !(card instanceof PermanentToken)) { creaturesCount++; } } diff --git a/Mage.Sets/src/mage/cards/c/CallousDeceiver.java b/Mage.Sets/src/mage/cards/c/CallousDeceiver.java index d804a49ad2..abd4a174e0 100644 --- a/Mage.Sets/src/mage/cards/c/CallousDeceiver.java +++ b/Mage.Sets/src/mage/cards/c/CallousDeceiver.java @@ -79,7 +79,7 @@ class CallousDeceiverEffect extends OneShotEffect { if (card != null) { cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source); game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source); } diff --git a/Mage.Sets/src/mage/cards/c/Camouflage.java b/Mage.Sets/src/mage/cards/c/Camouflage.java index fb1251bb11..0d21c27c13 100644 --- a/Mage.Sets/src/mage/cards/c/Camouflage.java +++ b/Mage.Sets/src/mage/cards/c/Camouflage.java @@ -160,7 +160,7 @@ class CamouflageEffect extends ContinuousRuleModifyingEffectImpl { if (combatGroup.getDefendingPlayerId().equals(playerId)) { for (UUID attackerId : combatGroup.getAttackers()) { Permanent permanent = game.getPermanent(attackerId); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { available.add(permanent); } } diff --git a/Mage.Sets/src/mage/cards/c/CarrionGrub.java b/Mage.Sets/src/mage/cards/c/CarrionGrub.java index 448a8aecda..a1d9768e8e 100644 --- a/Mage.Sets/src/mage/cards/c/CarrionGrub.java +++ b/Mage.Sets/src/mage/cards/c/CarrionGrub.java @@ -65,7 +65,7 @@ enum CarrionGrubValue implements DynamicValue { .getCards(game) .stream() .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(card -> card.isCreature(game)) .map(MageObject::getPower) .mapToInt(MageInt::getValue) .max() diff --git a/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java b/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java index dc21a7c036..1ce52f01ab 100644 --- a/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java +++ b/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java @@ -89,7 +89,7 @@ class FightEnchantedTargetEffect extends OneShotEffect { Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget()); // 20110930 - 701.10 if (creature1 != null && enchantedCreature != null) { - if (creature1.isCreature() && enchantedCreature.isCreature()) { + if (creature1.isCreature(game) && enchantedCreature.isCreature(game)) { return enchantedCreature.fight(creature1, source, game); } } diff --git a/Mage.Sets/src/mage/cards/c/CastleGarenbrig.java b/Mage.Sets/src/mage/cards/c/CastleGarenbrig.java index 4e79fc9239..b97b7bd31f 100644 --- a/Mage.Sets/src/mage/cards/c/CastleGarenbrig.java +++ b/Mage.Sets/src/mage/cards/c/CastleGarenbrig.java @@ -91,7 +91,7 @@ enum CastleGarenbrigManaCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.isCreature()) { + if (object != null && object.isCreature(game)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/c/CataclysmicGearhulk.java b/Mage.Sets/src/mage/cards/c/CataclysmicGearhulk.java index 254c831566..bcadd109ed 100644 --- a/Mage.Sets/src/mage/cards/c/CataclysmicGearhulk.java +++ b/Mage.Sets/src/mage/cards/c/CataclysmicGearhulk.java @@ -147,7 +147,7 @@ class CataclysmicGearhulkEffect extends OneShotEffect { } for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) { - if (!chosen.contains(permanent) && !permanent.isLand()) { + if (!chosen.contains(permanent) && !permanent.isLand(game)) { permanent.sacrifice(source, game); } } diff --git a/Mage.Sets/src/mage/cards/c/CatacombDragon.java b/Mage.Sets/src/mage/cards/c/CatacombDragon.java index b9f7928b42..eb8f7dcd63 100644 --- a/Mage.Sets/src/mage/cards/c/CatacombDragon.java +++ b/Mage.Sets/src/mage/cards/c/CatacombDragon.java @@ -74,7 +74,7 @@ class CatacombDragonEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } int unBoost = -1 * Math.floorDiv(permanent.getPower().getValue(), 2); diff --git a/Mage.Sets/src/mage/cards/c/Catastrophe.java b/Mage.Sets/src/mage/cards/c/Catastrophe.java index ffb9b8b570..fb8ae17279 100644 --- a/Mage.Sets/src/mage/cards/c/Catastrophe.java +++ b/Mage.Sets/src/mage/cards/c/Catastrophe.java @@ -59,7 +59,7 @@ class CatastropheEffect extends OneShotEffect { if (controller != null) { if (controller.chooseUse(outcome, "Destroy all lands? (otherwise all creatures are destroyed)", source, game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), controller.getId(), source.getSourceId(), game)) { - permanent.destroy(source, game, permanent.isCreature()); + permanent.destroy(source, game, permanent.isCreature(game)); } } else { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) { diff --git a/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java b/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java index 6f65acd4a1..f6c56822f9 100644 --- a/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java +++ b/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java @@ -93,7 +93,7 @@ class CavalierOfThornsEffect extends OneShotEffect { } controller.revealCards(source, cards, game); TargetCard target = new TargetCard(1, 1, Zone.LIBRARY, filter); - if (cards.getCards(game).stream().anyMatch(Card::isLand) + if (cards.getCards(game).stream().anyMatch(card1 -> card1.isLand(game)) && controller.choose(Outcome.PutCardInPlay, cards, target, game)) { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/c/CellarDoor.java b/Mage.Sets/src/mage/cards/c/CellarDoor.java index b1eb14e9c5..a8ee888f57 100644 --- a/Mage.Sets/src/mage/cards/c/CellarDoor.java +++ b/Mage.Sets/src/mage/cards/c/CellarDoor.java @@ -67,7 +67,7 @@ class CellarDoorEffect extends OneShotEffect { Card card = player.getLibrary().removeFromBottom(game); if (card != null) { player.moveCards(card, Zone.GRAVEYARD, source, game); - if (card.isCreature()) { + if (card.isCreature(game)) { ZombieToken token = new ZombieToken(); token.putOntoBattlefield(1, game, source, source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/c/CerebralEruption.java b/Mage.Sets/src/mage/cards/c/CerebralEruption.java index 518413092c..d72297536a 100644 --- a/Mage.Sets/src/mage/cards/c/CerebralEruption.java +++ b/Mage.Sets/src/mage/cards/c/CerebralEruption.java @@ -64,7 +64,7 @@ class CerebralEruptionEffect extends OneShotEffect { for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, player.getId(), game)) { perm.damage(damage, source.getSourceId(), source, game, false, true); } - if (card.isLand()) { + if (card.isLand(game)) { Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard(); if (spellCard != null) { player.moveCards(spellCard, Zone.HAND, source, game); diff --git a/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java b/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java index 9816668ce3..9af5de43ab 100644 --- a/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java +++ b/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java @@ -102,8 +102,8 @@ class ChainerNightmareAdeptContinuousEffect extends AsThoughEffectImpl { Card card = game.getCard(sourceId); return card != null && card.getOwnerId().equals(affectedControllerId) - && card.isCreature() - && !card.isLand(); + && card.isCreature(game) + && !card.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/c/ChallengerTroll.java b/Mage.Sets/src/mage/cards/c/ChallengerTroll.java index 65a3055c7a..009c88a411 100644 --- a/Mage.Sets/src/mage/cards/c/ChallengerTroll.java +++ b/Mage.Sets/src/mage/cards/c/ChallengerTroll.java @@ -61,7 +61,7 @@ class ChallengerTrollEffect extends ContinuousEffectImpl { } for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature() && permanent.getPower().getValue() >= 4) { + && permanent.isCreature(game) && permanent.getPower().getValue() >= 4) { permanent.setMaxBlockedBy(1); } } diff --git a/Mage.Sets/src/mage/cards/c/ChameleonBlur.java b/Mage.Sets/src/mage/cards/c/ChameleonBlur.java index 8c258299cd..5c04da36fd 100644 --- a/Mage.Sets/src/mage/cards/c/ChameleonBlur.java +++ b/Mage.Sets/src/mage/cards/c/ChameleonBlur.java @@ -57,7 +57,7 @@ class ChameleonBlurEffect extends PreventionEffectImpl { && event.getType() == GameEvent.EventType.DAMAGE_PLAYER && event.getAmount() > 0) { Permanent permanent = game.getPermanent(event.getSourceId()); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/c/ChampionLancer.java b/Mage.Sets/src/mage/cards/c/ChampionLancer.java index 668700a384..e19ca792b8 100644 --- a/Mage.Sets/src/mage/cards/c/ChampionLancer.java +++ b/Mage.Sets/src/mage/cards/c/ChampionLancer.java @@ -58,7 +58,7 @@ class PreventDamageToSourceByCardTypeEffect extends PreventAllDamageToSourceEffe public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject != null && sourceObject.isCreature()) { + if (sourceObject != null && sourceObject.isCreature(game)) { if (event.getTargetId().equals(source.getSourceId())) { return true; } diff --git a/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java b/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java index b384ba8985..2f18156678 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java +++ b/Mage.Sets/src/mage/cards/c/ChandraTheFirebrand.java @@ -17,7 +17,6 @@ import mage.constants.Duration; import mage.constants.SuperType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.common.TargetAnyTarget; import mage.target.targetpointer.FixedTarget; @@ -86,7 +85,7 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java b/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java index dd4a089218..0f921f1fd2 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java +++ b/Mage.Sets/src/mage/cards/c/ChandraTorchOfDefiance.java @@ -93,7 +93,7 @@ class ChandraTorchOfDefianceEffect extends OneShotEffect { boolean cardWasCast = false; controller.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName()); if (!card.getManaCost().isEmpty() - || !card.isLand()) { + || !card.isLand(game)) { if (controller.chooseUse(Outcome.Benefit, "Cast " + card.getName() + "? (You still pay the costs)", source, game) && (game.getState().getZone(card.getId()) == Zone.EXILED)) { // card must be in the exile zone game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE); // enable the card to be cast from the exile zone diff --git a/Mage.Sets/src/mage/cards/c/ChandrasPhoenix.java b/Mage.Sets/src/mage/cards/c/ChandrasPhoenix.java index 77a15e3066..90bf55821f 100644 --- a/Mage.Sets/src/mage/cards/c/ChandrasPhoenix.java +++ b/Mage.Sets/src/mage/cards/c/ChandrasPhoenix.java @@ -15,7 +15,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; import mage.game.stack.StackObject; @@ -89,9 +88,9 @@ class ChandrasPhoenixTriggeredAbility extends TriggeredAbilityImpl { } if (sourceObjectDamage != null) { if (sourceObjectDamage.getColor(game).isRed() - && (sourceObjectDamage.isPlaneswalker() - || sourceObjectDamage.isInstant() - || sourceObjectDamage.isSorcery())) { + && (sourceObjectDamage.isPlaneswalker(game) + || sourceObjectDamage.isInstant(game) + || sourceObjectDamage.isSorcery(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/c/ChaosHarlequin.java b/Mage.Sets/src/mage/cards/c/ChaosHarlequin.java index 74840d8cfc..09751d5786 100644 --- a/Mage.Sets/src/mage/cards/c/ChaosHarlequin.java +++ b/Mage.Sets/src/mage/cards/c/ChaosHarlequin.java @@ -68,7 +68,7 @@ class ChaosHarlequinEffect extends OneShotEffect { Card card = player.getLibrary().getFromTop(game); if (card != null) { player.moveCardToExileWithInfo(card, null, "", source, game, Zone.LIBRARY, true); - if (card.isLand()) { + if (card.isLand(game)) { game.addEffect(new BoostSourceEffect(-4, 0, Duration.EndOfTurn), source); } else { game.addEffect(new BoostSourceEffect(2, 0, Duration.EndOfTurn), source); diff --git a/Mage.Sets/src/mage/cards/c/ChaosMoon.java b/Mage.Sets/src/mage/cards/c/ChaosMoon.java index 9835bad390..426f250d58 100644 --- a/Mage.Sets/src/mage/cards/c/ChaosMoon.java +++ b/Mage.Sets/src/mage/cards/c/ChaosMoon.java @@ -2,7 +2,7 @@ package mage.cards.c; import java.util.UUID; -import mage.MageObject; + import mage.Mana; import mage.ObjectColor; import mage.abilities.Ability; @@ -23,7 +23,6 @@ import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -182,7 +181,7 @@ class ChaosMoonEvenReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return filter.match(permanent, game); } return false; diff --git a/Mage.Sets/src/mage/cards/c/ChaosWand.java b/Mage.Sets/src/mage/cards/c/ChaosWand.java index fc6f3a33aa..9fc955531e 100644 --- a/Mage.Sets/src/mage/cards/c/ChaosWand.java +++ b/Mage.Sets/src/mage/cards/c/ChaosWand.java @@ -82,7 +82,7 @@ class ChaosWandEffect extends OneShotEffect { } opponent.moveCards(card, Zone.EXILED, source, game); controller.revealCards(source, new CardsImpl(card), game); - if (card.isInstantOrSorcery()) { + if (card.isInstantOrSorcery(game)) { boolean cardWasCast = false; if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/c/CheckForTraps.java b/Mage.Sets/src/mage/cards/c/CheckForTraps.java index 8f7fca78c5..1674295a96 100644 --- a/Mage.Sets/src/mage/cards/c/CheckForTraps.java +++ b/Mage.Sets/src/mage/cards/c/CheckForTraps.java @@ -74,7 +74,7 @@ class CheckForTrapsEffect extends OneShotEffect { Card card = game.getCard(target.getFirstTarget()); if (card != null) { controller.moveCards(card, Zone.EXILED, source, game); - if (card.isInstant() || card.hasAbility(FlashAbility.getInstance(), game)) { + if (card.isInstant(game) || card.hasAbility(FlashAbility.getInstance(), game)) { opponentLoseLife = true; } } diff --git a/Mage.Sets/src/mage/cards/c/CherishedHatchling.java b/Mage.Sets/src/mage/cards/c/CherishedHatchling.java index 8babe2d93c..f8748d1b88 100644 --- a/Mage.Sets/src/mage/cards/c/CherishedHatchling.java +++ b/Mage.Sets/src/mage/cards/c/CherishedHatchling.java @@ -98,7 +98,7 @@ class CherishedHatchlingTriggeredAbility 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.isCreature() && spell.hasSubtype(SubType.DINOSAUR, game)) { + if (spell != null && spell.isCreature(game) && spell.hasSubtype(SubType.DINOSAUR, game)) { getEffects().setTargetPointer(new FixedTarget(spell.getSourceId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/ChimericCoils.java b/Mage.Sets/src/mage/cards/c/ChimericCoils.java index f172f273da..fa4d47d0cd 100644 --- a/Mage.Sets/src/mage/cards/c/ChimericCoils.java +++ b/Mage.Sets/src/mage/cards/c/ChimericCoils.java @@ -63,11 +63,11 @@ class ChimericCoilsEffect extends ContinuousEffectImpl { } switch (layer) { case TypeChangingEffects_4: - if (!permanent.isArtifact()) { - permanent.addCardType(CardType.ARTIFACT); + if (!permanent.isArtifact(game)) { + permanent.addCardType(game, CardType.ARTIFACT); } - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } permanent.removeAllCreatureTypes(game); permanent.addSubType(game, SubType.CONSTRUCT); diff --git a/Mage.Sets/src/mage/cards/c/ChimericStaff.java b/Mage.Sets/src/mage/cards/c/ChimericStaff.java index eb0eed108f..53fc70e267 100644 --- a/Mage.Sets/src/mage/cards/c/ChimericStaff.java +++ b/Mage.Sets/src/mage/cards/c/ChimericStaff.java @@ -58,11 +58,11 @@ class ChimericStaffEffect extends ContinuousEffectImpl { } switch (layer) { case TypeChangingEffects_4: - if (!permanent.isArtifact()) { - permanent.addCardType(CardType.ARTIFACT); + if (!permanent.isArtifact(game)) { + permanent.addCardType(game, CardType.ARTIFACT); } - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } permanent.removeAllCreatureTypes(game); permanent.addSubType(game, SubType.CONSTRUCT); diff --git a/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java b/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java index 767bb402a5..65aaa58059 100644 --- a/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java +++ b/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java @@ -79,7 +79,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { if (event.getPlayerId().equals(source.getControllerId())) { MageObject spellObject = game.getObject(event.getSourceId()); if (spellObject != null) { - return spellObject.isCreature(); + return spellObject.isCreature(game); } } return false; diff --git a/Mage.Sets/src/mage/cards/c/ChromeCourier.java b/Mage.Sets/src/mage/cards/c/ChromeCourier.java index 7ce54a0867..54429c7404 100644 --- a/Mage.Sets/src/mage/cards/c/ChromeCourier.java +++ b/Mage.Sets/src/mage/cards/c/ChromeCourier.java @@ -89,7 +89,7 @@ class ChromeCourierEffect extends OneShotEffect { player.moveCards(card, Zone.HAND, source, game); cards.remove(card); player.moveCards(cards, Zone.GRAVEYARD, source, game); - if (card != null && card.isArtifact()) { + if (card != null && card.isArtifact(game)) { player.gainLife(3, game, source); } return true; diff --git a/Mage.Sets/src/mage/cards/c/ChronatogTotem.java b/Mage.Sets/src/mage/cards/c/ChronatogTotem.java index c43f6848e1..df6e128c14 100644 --- a/Mage.Sets/src/mage/cards/c/ChronatogTotem.java +++ b/Mage.Sets/src/mage/cards/c/ChronatogTotem.java @@ -70,7 +70,7 @@ enum ChronatogTotemCondition implements Condition { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - return permanent.isCreature(); + return permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/c/CircleOfFlame.java b/Mage.Sets/src/mage/cards/c/CircleOfFlame.java index a953c17eb1..fa9e9fa090 100644 --- a/Mage.Sets/src/mage/cards/c/CircleOfFlame.java +++ b/Mage.Sets/src/mage/cards/c/CircleOfFlame.java @@ -12,7 +12,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -76,7 +75,7 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl { } else{ // check attacks your planeswalker Permanent permanent = game.getPermanent(event.getTargetId()); youOrYourPlaneswalker = permanent != null - && permanent.isPlaneswalker() + && permanent.isPlaneswalker(game) && permanent.isControlledBy(this.getControllerId()); } if (youOrYourPlaneswalker) { diff --git a/Mage.Sets/src/mage/cards/c/CityOfTraitors.java b/Mage.Sets/src/mage/cards/c/CityOfTraitors.java index 89d440e6f0..daf4e3c8c4 100644 --- a/Mage.Sets/src/mage/cards/c/CityOfTraitors.java +++ b/Mage.Sets/src/mage/cards/c/CityOfTraitors.java @@ -11,7 +11,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import java.util.Objects; @@ -61,7 +60,7 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent land = game.getPermanent(event.getTargetId()); return land != null - && land.isLand() + && land.isLand(game) && land.isControlledBy(this.controllerId) && !Objects.equals(event.getTargetId(), this.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/c/CivilizedScholar.java b/Mage.Sets/src/mage/cards/c/CivilizedScholar.java index 10cf74e07e..2810cb556d 100644 --- a/Mage.Sets/src/mage/cards/c/CivilizedScholar.java +++ b/Mage.Sets/src/mage/cards/c/CivilizedScholar.java @@ -76,7 +76,7 @@ class CivilizedScholarEffect extends OneShotEffect { if (player != null) { player.drawCards(1, source, game); Card card = player.discardOne(false, false, source, game); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.untap(game); diff --git a/Mage.Sets/src/mage/cards/c/Cleansing.java b/Mage.Sets/src/mage/cards/c/Cleansing.java index 7b0d1d355a..3929031987 100644 --- a/Mage.Sets/src/mage/cards/c/Cleansing.java +++ b/Mage.Sets/src/mage/cards/c/Cleansing.java @@ -54,7 +54,7 @@ class CleansingEffect extends OneShotEffect { while (permanents.hasNext()) { boolean paidLife = false; Permanent p = permanents.next(); - if (p.isLand()) { + if (p.isLand(game)) { game.informPlayers("Any player may pay 1 life to prevent the destruction of " + p.getLogName() + " controlled by " + game.getPlayer(p.getControllerId()).getLogName() + "."); PayLifeCost cost = new PayLifeCost(1); for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { diff --git a/Mage.Sets/src/mage/cards/c/ClearTheLand.java b/Mage.Sets/src/mage/cards/c/ClearTheLand.java index f7276c460d..787716e198 100644 --- a/Mage.Sets/src/mage/cards/c/ClearTheLand.java +++ b/Mage.Sets/src/mage/cards/c/ClearTheLand.java @@ -74,7 +74,7 @@ class ClearTheLandEffect extends OneShotEffect { Cards cardsToPutOnBattlefield = new CardsImpl(); Cards cardsToExile = new CardsImpl(); for (Card card : cardsToReveal.getCards(game)) { - if (card.isLand()) { + if (card.isLand(game)) { cardsToPutOnBattlefield.add(card); } else { cardsToExile.add(card); diff --git a/Mage.Sets/src/mage/cards/c/ClingToDust.java b/Mage.Sets/src/mage/cards/c/ClingToDust.java index c884a3b802..3e69a03ff5 100644 --- a/Mage.Sets/src/mage/cards/c/ClingToDust.java +++ b/Mage.Sets/src/mage/cards/c/ClingToDust.java @@ -65,7 +65,7 @@ class ClingToDustEffect extends OneShotEffect { if (player == null || card == null) { return false; } - boolean isCreature = card.isCreature(); + boolean isCreature = card.isCreature(game); if (!player.moveCards(card, Zone.EXILED, source, game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/c/CloneShell.java b/Mage.Sets/src/mage/cards/c/CloneShell.java index a1d1f85ae3..d31fd85d05 100644 --- a/Mage.Sets/src/mage/cards/c/CloneShell.java +++ b/Mage.Sets/src/mage/cards/c/CloneShell.java @@ -119,7 +119,7 @@ class CloneShellDiesEffect extends OneShotEffect { Card imprintedCard = game.getCard(imprinted.get(0)); if (imprintedCard != null) { imprintedCard.setFaceDown(false, game); - if (imprintedCard.isCreature()) { + if (imprintedCard.isCreature(game)) { controller.moveCards(imprintedCard, Zone.BATTLEFIELD, source, game); } } diff --git a/Mage.Sets/src/mage/cards/c/CloudstoneCurio.java b/Mage.Sets/src/mage/cards/c/CloudstoneCurio.java index d878c49f75..1f09255113 100644 --- a/Mage.Sets/src/mage/cards/c/CloudstoneCurio.java +++ b/Mage.Sets/src/mage/cards/c/CloudstoneCurio.java @@ -74,7 +74,7 @@ class CloudstoneCurioEffect extends OneShotEffect { filter.add(TargetController.YOU.getControllerPredicate()); filter.add(Predicates.or( triggeringCreature - .getCardType() + .getCardType(game) .stream() .filter(CardType::isPermanentType) .map(CardType::getPredicate) diff --git a/Mage.Sets/src/mage/cards/c/CobraTrap.java b/Mage.Sets/src/mage/cards/c/CobraTrap.java index 179525304a..8466634fb3 100644 --- a/Mage.Sets/src/mage/cards/c/CobraTrap.java +++ b/Mage.Sets/src/mage/cards/c/CobraTrap.java @@ -13,7 +13,6 @@ import mage.constants.SubType; import mage.constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.SnakeToken; import mage.game.stack.StackObject; @@ -78,7 +77,7 @@ class CobraTrapWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.DESTROYED_PERMANENT) { Permanent perm = game.getPermanentOrLKIBattlefield(event.getTargetId()); // can regenerate or be indestructible - if (perm != null && !perm.isCreature()) { + if (perm != null && !perm.isCreature(game)) { if (!game.getStack().isEmpty()) { StackObject spell = game.getStack().getStackObject(event.getSourceId()); if (spell != null && game.getOpponents(perm.getControllerId()).contains(spell.getControllerId())) { diff --git a/Mage.Sets/src/mage/cards/c/CodieVociferousCodex.java b/Mage.Sets/src/mage/cards/c/CodieVociferousCodex.java index 52b6aadb06..60716d75e2 100644 --- a/Mage.Sets/src/mage/cards/c/CodieVociferousCodex.java +++ b/Mage.Sets/src/mage/cards/c/CodieVociferousCodex.java @@ -83,7 +83,7 @@ class CodieVociferousCodexCantCastEffect extends ContinuousRuleModifyingEffectIm return false; } Card card = game.getCard(event.getSourceId()); - return card != null && card.isPermanent(); + return card != null && card.isPermanent(game); } } @@ -155,7 +155,7 @@ class CodieVociferousCodexEffect extends OneShotEffect { Card toCast = null; for (Card card : player.getLibrary().getCards(game)) { toExile.add(card); - if (card.isInstantOrSorcery() && card.getManaValue() < spell.getManaValue()) { + if (card.isInstantOrSorcery(game) && card.getManaValue() < spell.getManaValue()) { toCast = card; break; } diff --git a/Mage.Sets/src/mage/cards/c/CoercedConfession.java b/Mage.Sets/src/mage/cards/c/CoercedConfession.java index f6005997ef..15a7b0478b 100644 --- a/Mage.Sets/src/mage/cards/c/CoercedConfession.java +++ b/Mage.Sets/src/mage/cards/c/CoercedConfession.java @@ -1,6 +1,5 @@ package mage.cards.c; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -66,7 +65,7 @@ class CoercedConfessionMillEffect extends OneShotEffect { .stream() .filter(Objects::nonNull) .filter(card -> game.getState().getZone(card.getId()) == Zone.GRAVEYARD) - .filter(MageObject::isCreature) + .filter(card1 -> card1.isCreature(game)) .mapToInt(x -> 1) .sum(); if (creaturesMilled < 1) { diff --git a/Mage.Sets/src/mage/cards/c/CollectorOuphe.java b/Mage.Sets/src/mage/cards/c/CollectorOuphe.java index 48cf57ace3..4d5e265fc3 100644 --- a/Mage.Sets/src/mage/cards/c/CollectorOuphe.java +++ b/Mage.Sets/src/mage/cards/c/CollectorOuphe.java @@ -53,7 +53,7 @@ class CollectorOupheEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isArtifact(); + return permanent.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/c/CombineGuildmage.java b/Mage.Sets/src/mage/cards/c/CombineGuildmage.java index 6fbd7c994c..a1792bb695 100644 --- a/Mage.Sets/src/mage/cards/c/CombineGuildmage.java +++ b/Mage.Sets/src/mage/cards/c/CombineGuildmage.java @@ -88,7 +88,7 @@ class CombineGuildmageReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(); + return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/c/Comeuppance.java b/Mage.Sets/src/mage/cards/c/Comeuppance.java index 0af766fbec..81eb31a51d 100644 --- a/Mage.Sets/src/mage/cards/c/Comeuppance.java +++ b/Mage.Sets/src/mage/cards/c/Comeuppance.java @@ -71,7 +71,7 @@ class ComeuppanceEffect extends PreventionEffectImpl { MageObject damageDealingObject = game.getObject(event.getSourceId()); UUID objectControllerId = null; if (damageDealingObject instanceof Permanent) { - if (damageDealingObject.isCreature()) { + if (damageDealingObject.isCreature(game)) { ((Permanent) damageDealingObject).damage(preventionData.getPreventedDamage(), source.getSourceId(), source, game); } else { objectControllerId = ((Permanent) damageDealingObject).getControllerId(); @@ -103,7 +103,7 @@ class ComeuppanceEffect extends PreventionEffectImpl { Permanent targetPermanent = game.getPermanent(event.getTargetId()); if (targetPermanent != null && targetPermanent.isControlledBy(source.getControllerId()) && - targetPermanent.isPlaneswalker()) { + targetPermanent.isPlaneswalker(game)) { catched = true; } } diff --git a/Mage.Sets/src/mage/cards/c/ConclaveMentor.java b/Mage.Sets/src/mage/cards/c/ConclaveMentor.java index 28c1f1217a..6412ec6ef5 100644 --- a/Mage.Sets/src/mage/cards/c/ConclaveMentor.java +++ b/Mage.Sets/src/mage/cards/c/ConclaveMentor.java @@ -84,7 +84,7 @@ class ConclaveMentorEffect extends ReplacementEffectImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature(); + && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java b/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java index 3e4fdcfcd4..b08ee2cff9 100644 --- a/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java +++ b/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java @@ -83,7 +83,7 @@ class ConduitOfRuinWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell != null && spell.isCreature()) { + if (spell != null && spell.isCreature(game)) { playerCreatureSpells.put(event.getPlayerId(), creatureSpellsCastThisTurn(event.getPlayerId()) + 1); } } @@ -105,7 +105,7 @@ class FirstCastCreatureSpellPredicate implements ObjectPlayerPredicate input, Game game) { if (input.getObject() instanceof Card - && ((Card) input.getObject()).isCreature()) { + && ((Card) input.getObject()).isCreature(game)) { ConduitOfRuinWatcher watcher = game.getState().getWatcher(ConduitOfRuinWatcher.class); return watcher != null && watcher.creatureSpellsCastThisTurn(input.getPlayerId()) == 0; } diff --git a/Mage.Sets/src/mage/cards/c/ConfoundingConundrum.java b/Mage.Sets/src/mage/cards/c/ConfoundingConundrum.java index 3bdae2b4a8..3747315305 100644 --- a/Mage.Sets/src/mage/cards/c/ConfoundingConundrum.java +++ b/Mage.Sets/src/mage/cards/c/ConfoundingConundrum.java @@ -127,7 +127,7 @@ class ConfoundingConundrumWatcher extends Watcher { return; } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { playerMap.compute(permanent.getControllerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java b/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java index c60d847410..f6c9fbee9e 100644 --- a/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java +++ b/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java @@ -89,7 +89,7 @@ enum ConfusionInTheRanksAdjuster implements TargetAdjuster { String message = ""; filterTarget.add(Predicates.not(new ControllerIdPredicate(enteringPermanent.getControllerId()))); Set cardTypesPredicates = new HashSet<>(1); - for (CardType cardTypeEntering : enteringPermanent.getCardType()) { + for (CardType cardTypeEntering : enteringPermanent.getCardType(game)) { cardTypesPredicates.add(cardTypeEntering.getPredicate()); if (!message.isEmpty()) { message += "or "; diff --git a/Mage.Sets/src/mage/cards/c/ConsecrateConsume.java b/Mage.Sets/src/mage/cards/c/ConsecrateConsume.java index 72fc2b36a9..239bacda2c 100644 --- a/Mage.Sets/src/mage/cards/c/ConsecrateConsume.java +++ b/Mage.Sets/src/mage/cards/c/ConsecrateConsume.java @@ -81,7 +81,7 @@ class ConsumeEffect extends OneShotEffect { } int greatestPower = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { greatestPower = Math.max(permanent.getPower().getValue(), greatestPower); } } diff --git a/Mage.Sets/src/mage/cards/c/Conspiracy.java b/Mage.Sets/src/mage/cards/c/Conspiracy.java index 5c95b64131..8833f223fe 100644 --- a/Mage.Sets/src/mage/cards/c/Conspiracy.java +++ b/Mage.Sets/src/mage/cards/c/Conspiracy.java @@ -80,26 +80,26 @@ public final class Conspiracy extends CardImpl { // in graveyard for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { setCreatureSubtype(card, subType, game); } } // on Hand for (UUID cardId : controller.getHand()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { setCreatureSubtype(card, subType, game); } } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.isOwnedBy(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature(game)) { setCreatureSubtype(card, subType, game); } } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.isOwnedBy(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature(game)) { setCreatureSubtype(card, subType, game); } } @@ -107,7 +107,7 @@ public final class Conspiracy extends CardImpl { for (CommandObject commandObject : game.getState().getCommand()) { if (commandObject instanceof Commander) { Card card = game.getCard(((Commander) commandObject).getId()); - if (card != null && card.isCreature() && card.isOwnedBy(controller.getId())) { + if (card != null && card.isCreature(game) && card.isOwnedBy(controller.getId())) { setCreatureSubtype(card, subType, game); } } @@ -117,7 +117,7 @@ public final class Conspiracy extends CardImpl { StackObject stackObject = iterator.next(); if (stackObject instanceof Spell && stackObject.isControlledBy(controller.getId()) - && stackObject.isCreature()) { + && stackObject.isCreature(game)) { setCreatureSubtype(stackObject, subType, game); setCreatureSubtype(((Spell) stackObject).getCard(), subType, game); } @@ -125,7 +125,7 @@ public final class Conspiracy extends CardImpl { // creatures you control List permanents = game.getState().getBattlefield().getAllActivePermanents(controller.getId()); for (Permanent permanent : permanents) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { permanent.removeAllCreatureTypes(game); permanent.addSubType(game, subType); } diff --git a/Mage.Sets/src/mage/cards/c/ConsumingAberration.java b/Mage.Sets/src/mage/cards/c/ConsumingAberration.java index fcae14529f..ffa1d5439d 100644 --- a/Mage.Sets/src/mage/cards/c/ConsumingAberration.java +++ b/Mage.Sets/src/mage/cards/c/ConsumingAberration.java @@ -76,7 +76,7 @@ class ConsumingAberrationEffect extends OneShotEffect { for (Card card : player.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { break; } } diff --git a/Mage.Sets/src/mage/cards/c/ContainmentPriest.java b/Mage.Sets/src/mage/cards/c/ContainmentPriest.java index fa278d433c..01543f5fa1 100644 --- a/Mage.Sets/src/mage/cards/c/ContainmentPriest.java +++ b/Mage.Sets/src/mage/cards/c/ContainmentPriest.java @@ -95,7 +95,7 @@ class ContainmentPriestReplacementEffect extends ReplacementEffectImpl { if (card != null && entersTransformed instanceof Boolean && (Boolean) entersTransformed && card.getSecondCardFace() != null) { card = card.getSecondCardFace(); } - if (card != null && card.isCreature()) { // TODO: Bestow Card cast as Enchantment probably not handled correctly + if (card != null && card.isCreature(game)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly CreatureWasCastWatcher watcher = game.getState().getWatcher(CreatureWasCastWatcher.class); return watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId()); } diff --git a/Mage.Sets/src/mage/cards/c/Contamination.java b/Mage.Sets/src/mage/cards/c/Contamination.java index c90378d0b1..5bdaa34fec 100644 --- a/Mage.Sets/src/mage/cards/c/Contamination.java +++ b/Mage.Sets/src/mage/cards/c/Contamination.java @@ -2,7 +2,7 @@ package mage.cards.c; import java.util.UUID; -import mage.MageObject; + import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -16,7 +16,6 @@ import mage.constants.*; import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -85,6 +84,6 @@ class ContaminationReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - return permanent != null && permanent.isLand(); + return permanent != null && permanent.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/c/ContestedWarZone.java b/Mage.Sets/src/mage/cards/c/ContestedWarZone.java index 8f67ec6f2f..4e1ba74d20 100644 --- a/Mage.Sets/src/mage/cards/c/ContestedWarZone.java +++ b/Mage.Sets/src/mage/cards/c/ContestedWarZone.java @@ -79,7 +79,7 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; if (damageEvent.isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (damageEvent.getPlayerId().equals(getControllerId()) && permanent != null && permanent.isCreature()) { + if (damageEvent.getPlayerId().equals(getControllerId()) && permanent != null && permanent.isCreature(game)) { game.getState().setValue(getSourceId().toString(), permanent.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/c/Conversion.java b/Mage.Sets/src/mage/cards/c/Conversion.java index 882c37498b..97ee2e392f 100644 --- a/Mage.Sets/src/mage/cards/c/Conversion.java +++ b/Mage.Sets/src/mage/cards/c/Conversion.java @@ -72,7 +72,7 @@ public final class Conversion extends CardImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent land : game.getBattlefield().getAllActivePermanents(CardType.LAND)) { + for (Permanent land : game.getBattlefield().getAllActivePermanents(CardType.LAND, game)) { switch (layer) { case TypeChangingEffects_4: if (land.hasSubtype(SubType.MOUNTAIN, game)) { diff --git a/Mage.Sets/src/mage/cards/c/CorneredMarket.java b/Mage.Sets/src/mage/cards/c/CorneredMarket.java index 560d2e5321..13d1d74c81 100644 --- a/Mage.Sets/src/mage/cards/c/CorneredMarket.java +++ b/Mage.Sets/src/mage/cards/c/CorneredMarket.java @@ -79,7 +79,7 @@ class CorneredMarketReplacementEffect extends ContinuousRuleModifyingEffectImpl return false; } // play land check - if (card.isLand() + if (card.isLand(game) && !card.isBasic()) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { if (permanent != null) { diff --git a/Mage.Sets/src/mage/cards/c/CorpseDance.java b/Mage.Sets/src/mage/cards/c/CorpseDance.java index f221820a23..903ecb28ce 100644 --- a/Mage.Sets/src/mage/cards/c/CorpseDance.java +++ b/Mage.Sets/src/mage/cards/c/CorpseDance.java @@ -71,7 +71,7 @@ class CorpseDanceEffect extends OneShotEffect { if (controller != null) { Card lastCreatureCard = null; for (Card card : controller.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { lastCreatureCard = card; } } diff --git a/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java b/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java index abf85adc54..12aac5a584 100644 --- a/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java +++ b/Mage.Sets/src/mage/cards/c/CorpsejackMenace.java @@ -80,7 +80,7 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature(); + && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/c/CosimaGodOfTheVoyage.java b/Mage.Sets/src/mage/cards/c/CosimaGodOfTheVoyage.java index 288d1318c1..214326e7a5 100644 --- a/Mage.Sets/src/mage/cards/c/CosimaGodOfTheVoyage.java +++ b/Mage.Sets/src/mage/cards/c/CosimaGodOfTheVoyage.java @@ -168,7 +168,7 @@ class CosimaGodOfTheVoyageTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.isLand() && permanent.isControlledBy(getControllerId()); + return permanent != null && permanent.isLand(game) && permanent.isControlledBy(getControllerId()); } @Override @@ -266,7 +266,7 @@ class TheOmenkeelEffect extends OneShotEffect { Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, damage)); player.moveCards(cards, Zone.EXILED, source, game); cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.EXILED); - cards.removeIf(uuid -> !game.getCard(uuid).isLand()); + cards.removeIf(uuid -> !game.getCard(uuid).isLand(game)); game.addEffect(new TheOmenkeelPlayFromExileEffect(cards, game), source); return true; } @@ -304,7 +304,7 @@ class TheOmenkeelPlayFromExileEffect extends AsThoughEffectImpl { } Card card = game.getCard(sourceId); return card != null - && card.isLand() + && card.isLand(game) && morSet.stream().anyMatch(mor -> mor.refersTo(card, game)); } } diff --git a/Mage.Sets/src/mage/cards/c/Counterlash.java b/Mage.Sets/src/mage/cards/c/Counterlash.java index 6c1caa1b56..2e7eda53d1 100644 --- a/Mage.Sets/src/mage/cards/c/Counterlash.java +++ b/Mage.Sets/src/mage/cards/c/Counterlash.java @@ -75,7 +75,7 @@ class CounterlashEffect extends OneShotEffect { + "shares a card type with that spell without paying its mana cost?", source, game)) { FilterCard filter = new FilterCard(); List> types = new ArrayList<>(); - for (CardType type : stackObject.getCardType()) { + for (CardType type : stackObject.getCardType(game)) { if (type != CardType.LAND) { types.add(type.getPredicate()); } diff --git a/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java b/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java index 2fdb8d5e45..a2de61a754 100644 --- a/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java +++ b/Mage.Sets/src/mage/cards/c/CountrysideCrusher.java @@ -79,7 +79,7 @@ class CountrysideCrusherEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { controller.moveCards(card, Zone.GRAVEYARD, source, game); } else { break; diff --git a/Mage.Sets/src/mage/cards/c/CoverOfWinter.java b/Mage.Sets/src/mage/cards/c/CoverOfWinter.java index 30998303d8..7948dc8694 100644 --- a/Mage.Sets/src/mage/cards/c/CoverOfWinter.java +++ b/Mage.Sets/src/mage/cards/c/CoverOfWinter.java @@ -88,7 +88,7 @@ class CoverOfWinterEffect extends PreventionEffectImpl { if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId())) { + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/c/Cowardice.java b/Mage.Sets/src/mage/cards/c/Cowardice.java index 83f56f3695..f31103ddf8 100644 --- a/Mage.Sets/src/mage/cards/c/Cowardice.java +++ b/Mage.Sets/src/mage/cards/c/Cowardice.java @@ -10,7 +10,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -55,7 +54,7 @@ class CowardiceTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CrackdownConstruct.java b/Mage.Sets/src/mage/cards/c/CrackdownConstruct.java index 2257b8673d..d28e9337c8 100644 --- a/Mage.Sets/src/mage/cards/c/CrackdownConstruct.java +++ b/Mage.Sets/src/mage/cards/c/CrackdownConstruct.java @@ -68,7 +68,7 @@ class CrackdownConstructTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(getControllerId())) { Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (source != null && (source.isArtifact() || source.isCreature())) { + if (source != null && (source.isArtifact(game) || source.isCreature(game))) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (!(stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl)) { return true; diff --git a/Mage.Sets/src/mage/cards/c/CragganwickCremator.java b/Mage.Sets/src/mage/cards/c/CragganwickCremator.java index b305718b86..2106008dfe 100644 --- a/Mage.Sets/src/mage/cards/c/CragganwickCremator.java +++ b/Mage.Sets/src/mage/cards/c/CragganwickCremator.java @@ -70,7 +70,7 @@ class CragganwickCrematorEffect extends OneShotEffect { if (controller != null) { Card discardedCard = controller.discardOne(true, false, source, game); if (discardedCard != null - && discardedCard.isCreature()) { + && discardedCard.isCreature(game)) { int damage = discardedCard.getPower().getValue(); return new DamageTargetEffect(damage).apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/c/CrawlingSensation.java b/Mage.Sets/src/mage/cards/c/CrawlingSensation.java index d69eb77d14..9599064dbb 100644 --- a/Mage.Sets/src/mage/cards/c/CrawlingSensation.java +++ b/Mage.Sets/src/mage/cards/c/CrawlingSensation.java @@ -68,7 +68,7 @@ class CrawlingSensationTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); if (cardOwnerId != null && card.isOwnedBy(getControllerId()) - && card.isLand()) { + && card.isLand(game)) { game.getState().setValue("usedOnTurn" + getControllerId() + getOriginalId(), game.getTurnNum()); return true; } diff --git a/Mage.Sets/src/mage/cards/c/CreativeTechnique.java b/Mage.Sets/src/mage/cards/c/CreativeTechnique.java index 602bd986f0..8ad5c336c5 100644 --- a/Mage.Sets/src/mage/cards/c/CreativeTechnique.java +++ b/Mage.Sets/src/mage/cards/c/CreativeTechnique.java @@ -67,7 +67,7 @@ class CreativeTechniqueEffect extends OneShotEffect { Card toCast = null; for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { toCast = card; break; } diff --git a/Mage.Sets/src/mage/cards/c/CreepingDread.java b/Mage.Sets/src/mage/cards/c/CreepingDread.java index 22bc0f764e..1f2d0a2b42 100644 --- a/Mage.Sets/src/mage/cards/c/CreepingDread.java +++ b/Mage.Sets/src/mage/cards/c/CreepingDread.java @@ -79,7 +79,7 @@ class CreepingDreadEffect extends OneShotEffect { if(controller.choose(Outcome.Discard, controller.getHand(), controllerTarget, game)) { Card card = controller.getHand().get(controllerTarget.getFirstTarget(), game); if (card != null) { - typesChosen = new HashSet<>(card.getCardType()); + typesChosen = new HashSet<>(card.getCardType(game)); cardsChosen.put(controller, card); } } @@ -96,7 +96,7 @@ class CreepingDreadEffect extends OneShotEffect { if (card != null) { if (!typesChosen.isEmpty()) { for (CardType cType : typesChosen) { - for (CardType oType : card.getCardType()) { + for (CardType oType : card.getCardType(game)) { if (cType == oType) { opponentsAffected.add(opponent); break; diff --git a/Mage.Sets/src/mage/cards/c/CreepyDoll.java b/Mage.Sets/src/mage/cards/c/CreepyDoll.java index ca21b756e4..dfdff79ea9 100644 --- a/Mage.Sets/src/mage/cards/c/CreepyDoll.java +++ b/Mage.Sets/src/mage/cards/c/CreepyDoll.java @@ -73,7 +73,7 @@ class CreepyDollTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && ((DamagedEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) { getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); diff --git a/Mage.Sets/src/mage/cards/c/CrimePunishment.java b/Mage.Sets/src/mage/cards/c/CrimePunishment.java index e73445287b..b84a1093a8 100644 --- a/Mage.Sets/src/mage/cards/c/CrimePunishment.java +++ b/Mage.Sets/src/mage/cards/c/CrimePunishment.java @@ -70,9 +70,9 @@ class PunishmentEffect extends OneShotEffect { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent != null && permanent.getManaValue() == source.getManaCostsToPay().getX() - && (permanent.isArtifact() - || permanent.isCreature() - || permanent.isEnchantment())) { + && (permanent.isArtifact(game) + || permanent.isCreature(game) + || permanent.isEnchantment(game))) { permanent.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/c/CrimsonRoc.java b/Mage.Sets/src/mage/cards/c/CrimsonRoc.java index 1dab5eb0ff..72d8899a99 100644 --- a/Mage.Sets/src/mage/cards/c/CrimsonRoc.java +++ b/Mage.Sets/src/mage/cards/c/CrimsonRoc.java @@ -70,7 +70,7 @@ class CrimsonRocTriggeredAbility extends TriggeredAbilityImpl { } Permanent permanent = game.getPermanent(event.getTargetId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && !permanent.hasAbility(FlyingAbility.getInstance(), game); } diff --git a/Mage.Sets/src/mage/cards/c/CruelDeceiver.java b/Mage.Sets/src/mage/cards/c/CruelDeceiver.java index 74e02fa151..6a0ecde5bc 100644 --- a/Mage.Sets/src/mage/cards/c/CruelDeceiver.java +++ b/Mage.Sets/src/mage/cards/c/CruelDeceiver.java @@ -79,7 +79,7 @@ class CruelDeceiverEffect extends OneShotEffect { if (card != null) { cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source); } } diff --git a/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java b/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java index f6880f696e..ba9584e348 100644 --- a/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java +++ b/Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java @@ -70,7 +70,7 @@ class CryOfTheCarnariumExileEffect extends OneShotEffect { return false; } Cards cards = new CardsImpl(watcher.getCardsPutToGraveyardFromBattlefield(game)); - cards.removeIf(uuid -> !game.getCard(uuid).isCreature()); + cards.removeIf(uuid -> !game.getCard(uuid).isCreature(game)); player.moveCards(cards, Zone.EXILED, source, game); return true; } @@ -113,7 +113,7 @@ class CryOfTheCarnariumReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; return zEvent.getTarget() != null - && zEvent.getTarget().isCreature() + && zEvent.getTarget().isCreature(game) && zEvent.isDiesEvent(); } diff --git a/Mage.Sets/src/mage/cards/c/CuratorsWard.java b/Mage.Sets/src/mage/cards/c/CuratorsWard.java index 79cb7b062a..9d0fff91a0 100644 --- a/Mage.Sets/src/mage/cards/c/CuratorsWard.java +++ b/Mage.Sets/src/mage/cards/c/CuratorsWard.java @@ -80,7 +80,7 @@ class CuratorsWardTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD) { Permanent enchanted = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (enchanted != null && enchanted.getAttachments().contains(getSourceId()) && enchanted.isHistoric()) { + if (enchanted != null && enchanted.getAttachments().contains(getSourceId()) && enchanted.isHistoric(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java b/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java index 9675b80039..56c68113b3 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfEchoes.java @@ -85,7 +85,7 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/cards/c/CursedTotem.java b/Mage.Sets/src/mage/cards/c/CursedTotem.java index 2d3672e6e4..7d33b27e47 100644 --- a/Mage.Sets/src/mage/cards/c/CursedTotem.java +++ b/Mage.Sets/src/mage/cards/c/CursedTotem.java @@ -48,7 +48,7 @@ class CursedTotemCantActivateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature(); + return permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java b/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java index 646a56cfea..0e7fc4685c 100644 --- a/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java +++ b/Mage.Sets/src/mage/cards/d/DalakosCrafterOfWonders.java @@ -98,6 +98,6 @@ enum DalakosCrafterOfWondersCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - return object != null && object.isArtifact(); + return object != null && object.isArtifact(game); } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/d/DampingEngine.java b/Mage.Sets/src/mage/cards/d/DampingEngine.java index b75491e722..2c734cd971 100644 --- a/Mage.Sets/src/mage/cards/d/DampingEngine.java +++ b/Mage.Sets/src/mage/cards/d/DampingEngine.java @@ -134,10 +134,10 @@ class DampingEngineEffect extends ContinuousRuleModifyingEffectImpl { if (player == null || dampingEngine == null || card == null) { return false; } - if (!card.isCreature() - && !card.isArtifact() - && !card.isEnchantment() - && !card.isLand()) { + if (!card.isCreature(game) + && !card.isArtifact(game) + && !card.isEnchantment(game) + && !card.isLand(game)) { return false; } return DampingEngine.checkPlayer(player, game) diff --git a/Mage.Sets/src/mage/cards/d/DampingSphere.java b/Mage.Sets/src/mage/cards/d/DampingSphere.java index 98443dddac..f5644682ac 100644 --- a/Mage.Sets/src/mage/cards/d/DampingSphere.java +++ b/Mage.Sets/src/mage/cards/d/DampingSphere.java @@ -12,7 +12,6 @@ import mage.constants.*; import mage.filter.FilterCard; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.util.CardUtil; import mage.watchers.common.CastSpellLastTurnWatcher; @@ -83,7 +82,7 @@ class DampingSphereReplacementEffect extends ReplacementEffectImpl { MageObject mageObject = game.getPermanentOrLKIBattlefield(event.getSourceId()); ManaEvent manaEvent = (ManaEvent) event; Mana mana = manaEvent.getMana(); - return mageObject != null && mageObject.isLand() && mana.count() > 1; + return mageObject != null && mageObject.isLand(game) && mana.count() > 1; } } diff --git a/Mage.Sets/src/mage/cards/d/DancingSword.java b/Mage.Sets/src/mage/cards/d/DancingSword.java index 9a6c31857d..fb2b7b3922 100644 --- a/Mage.Sets/src/mage/cards/d/DancingSword.java +++ b/Mage.Sets/src/mage/cards/d/DancingSword.java @@ -75,9 +75,9 @@ class DancingSwordEffect extends ContinuousEffectImpl { } switch (layer) { case TypeChangingEffects_4: - permanent.getCardType().clear(); - permanent.getCardType().add(CardType.ARTIFACT); - permanent.getCardType().add(CardType.CREATURE); + permanent.removeAllCardTypes(); + permanent.addCardType(game, CardType.ARTIFACT); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); permanent.addSubType(game, SubType.CONSTRUCT); return true; diff --git a/Mage.Sets/src/mage/cards/d/DargoTheShipwrecker.java b/Mage.Sets/src/mage/cards/d/DargoTheShipwrecker.java index 7825414232..745f8fd3eb 100644 --- a/Mage.Sets/src/mage/cards/d/DargoTheShipwrecker.java +++ b/Mage.Sets/src/mage/cards/d/DargoTheShipwrecker.java @@ -125,7 +125,7 @@ class DargoTheShipwreckerWatcher extends Watcher { return; } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && (permanent.isCreature() || permanent.isArtifact())) { + if (permanent != null && (permanent.isCreature(game) || permanent.isArtifact(game))) { sacMap.compute(event.getPlayerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/d/DaringThief.java b/Mage.Sets/src/mage/cards/d/DaringThief.java index d66c8f8b7c..6638c65078 100644 --- a/Mage.Sets/src/mage/cards/d/DaringThief.java +++ b/Mage.Sets/src/mage/cards/d/DaringThief.java @@ -74,7 +74,7 @@ class TargetControlledPermanentSharingOpponentPermanentCardType extends TargetCo if (super.canTarget(controllerId, id, source, game)) { Set cardTypes = getOpponentPermanentCardTypes(source.getSourceId(), controllerId, game); Permanent permanent = game.getPermanent(id); - for (CardType type : permanent.getCardType()) { + for (CardType type : permanent.getCardType(game)) { if (cardTypes.contains(type)) { return true; } @@ -92,7 +92,7 @@ class TargetControlledPermanentSharingOpponentPermanentCardType extends TargetCo if (targetSource != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - for (CardType type : permanent.getCardType()) { + for (CardType type : permanent.getCardType(game)) { if (cardTypes.contains(type)) { possibleTargets.add(permanent.getId()); break; @@ -115,7 +115,7 @@ class TargetControlledPermanentSharingOpponentPermanentCardType extends TargetCo if (controller != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(sourceControllerId, game)) { if (controller.hasOpponent(permanent.getControllerId(), game)) { - cardTypes.addAll(permanent.getCardType()); + cardTypes.addAll(permanent.getCardType(game)); } } } @@ -147,7 +147,7 @@ class DaringThiefSecondTarget extends TargetPermanent { Permanent target1 = game.getPermanent(source.getFirstTarget()); Permanent opponentPermanent = game.getPermanent(id); if (target1 != null && opponentPermanent != null) { - return target1.shareTypes(opponentPermanent); + return target1.shareTypes(opponentPermanent, game); } } return false; @@ -161,7 +161,7 @@ class DaringThiefSecondTarget extends TargetPermanent { if (targetSource != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - if (permanent.shareTypes(firstTarget)) { + if (permanent.shareTypes(firstTarget, game)) { possibleTargets.add(permanent.getId()); } } diff --git a/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java b/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java index f214393985..807c11657d 100644 --- a/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java +++ b/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java @@ -13,7 +13,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -68,7 +67,7 @@ class DaruSpiritualistTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent creature = game.getPermanent(event.getTargetId()); - if (creature != null && creature.hasSubtype(SubType.CLERIC, game) && creature.getControllerId().equals(getControllerId()) && creature.isCreature()) { + if (creature != null && creature.hasSubtype(SubType.CLERIC, game) && creature.getControllerId().equals(getControllerId()) && creature.isCreature(game)) { this.getEffects().setTargetPointer(new FixedTarget(creature, game)); return true; } diff --git a/Mage.Sets/src/mage/cards/d/DauntingDefender.java b/Mage.Sets/src/mage/cards/d/DauntingDefender.java index 2f82af5c1e..32a4ed3063 100644 --- a/Mage.Sets/src/mage/cards/d/DauntingDefender.java +++ b/Mage.Sets/src/mage/cards/d/DauntingDefender.java @@ -65,7 +65,7 @@ class DauntingDefenderEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature() && permanent.hasSubtype(SubType.CLERIC, game)) { + if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(game) && permanent.hasSubtype(SubType.CLERIC, game)) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java b/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java index de0fb805e0..f860f780cf 100644 --- a/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java +++ b/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java @@ -74,7 +74,7 @@ class DaxosBlessedByTheSunAbility extends TriggeredAbilityImpl { } Permanent creature = game.getPermanentOrLKIBattlefield(event.getTargetId()); return creature != null - && creature.isCreature() + && creature.isCreature(game) && creature.isControlledBy(this.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/d/DazzlingSphinx.java b/Mage.Sets/src/mage/cards/d/DazzlingSphinx.java index adf8dafbae..172a3f0a1f 100644 --- a/Mage.Sets/src/mage/cards/d/DazzlingSphinx.java +++ b/Mage.Sets/src/mage/cards/d/DazzlingSphinx.java @@ -76,7 +76,7 @@ class DazzlingSphinxEffect extends OneShotEffect { Card toCast = null; for (Card card : opponent.getLibrary().getCards(game)) { cards.add(card); - if (card.isInstantOrSorcery()) { + if (card.isInstantOrSorcery(game)) { toCast = card; } } diff --git a/Mage.Sets/src/mage/cards/d/DeadMansChest.java b/Mage.Sets/src/mage/cards/d/DeadMansChest.java index ded0e21338..26e257a0c2 100644 --- a/Mage.Sets/src/mage/cards/d/DeadMansChest.java +++ b/Mage.Sets/src/mage/cards/d/DeadMansChest.java @@ -94,7 +94,7 @@ class DeadMansChestEffect extends OneShotEffect { if (!cards.isEmpty()) { controller.moveCardsToExile(cards, source, game, true, source.getSourceId(), sourceObject.getName()); for (Card card : cards) { - if (!card.isLand()) { + if (!card.isLand(game)) { ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, Duration.Custom); effect.setTargetPointer(new FixedTarget(card, game)); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/d/DeadbridgeChant.java b/Mage.Sets/src/mage/cards/d/DeadbridgeChant.java index 8f448eb55a..6718173a2c 100644 --- a/Mage.Sets/src/mage/cards/d/DeadbridgeChant.java +++ b/Mage.Sets/src/mage/cards/d/DeadbridgeChant.java @@ -67,7 +67,7 @@ class DeadbridgeChantEffect extends OneShotEffect { if (card != null) { Zone targetZone = Zone.HAND; String text = " put into hand of "; - if (card.isCreature()) { + if (card.isCreature(game)) { targetZone = Zone.BATTLEFIELD; text = " put onto battlefield for "; } diff --git a/Mage.Sets/src/mage/cards/d/DeadlyBrew.java b/Mage.Sets/src/mage/cards/d/DeadlyBrew.java index 75dc47eb45..35c6fcf026 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyBrew.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyBrew.java @@ -102,7 +102,7 @@ class DeadlyBrewEffect extends OneShotEffect { permanent.sacrifice(source, game); } Cards yourGrave = new CardsImpl(controller.getGraveyard()); - yourGrave.removeIf(uuid -> !game.getCard(uuid).isPermanent()); + yourGrave.removeIf(uuid -> !game.getCard(uuid).isPermanent(game)); if (yours == null || !yours.sacrifice(source, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/d/DeafeningSilence.java b/Mage.Sets/src/mage/cards/d/DeafeningSilence.java index 531fbd1cf5..7f7980d78d 100644 --- a/Mage.Sets/src/mage/cards/d/DeafeningSilence.java +++ b/Mage.Sets/src/mage/cards/d/DeafeningSilence.java @@ -75,7 +75,7 @@ class DeafeningSilenceEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Card card = game.getCard(event.getSourceId()); if (card == null - || card.isCreature()) { + || card.isCreature(game)) { return false; } DeafeningSilenceWatcher watcher = game.getState().getWatcher(DeafeningSilenceWatcher.class); @@ -99,7 +99,7 @@ class DeafeningSilenceWatcher extends Watcher { } Spell spell = game.getSpell(event.getTargetId()); if (spell == null - || spell.isCreature()) { + || spell.isCreature(game)) { return; } UUID playerId = event.getPlayerId(); diff --git a/Mage.Sets/src/mage/cards/d/DeathMaskDuplicant.java b/Mage.Sets/src/mage/cards/d/DeathMaskDuplicant.java index ff1620892e..bbe060867f 100644 --- a/Mage.Sets/src/mage/cards/d/DeathMaskDuplicant.java +++ b/Mage.Sets/src/mage/cards/d/DeathMaskDuplicant.java @@ -96,7 +96,7 @@ public final class DeathMaskDuplicant extends CardImpl { if (exileId != null) { for (UUID cardId : game.getState().getExile().getExileZone(exileId)) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { for (Ability ability : card.getAbilities(game)) { if (ability instanceof MageSingleton) { if (ability instanceof FlyingAbility diff --git a/Mage.Sets/src/mage/cards/d/DeathPitsOfRath.java b/Mage.Sets/src/mage/cards/d/DeathPitsOfRath.java index c89e27d75b..e6e1330c9e 100644 --- a/Mage.Sets/src/mage/cards/d/DeathPitsOfRath.java +++ b/Mage.Sets/src/mage/cards/d/DeathPitsOfRath.java @@ -59,7 +59,7 @@ class DeathPitsOfRathTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); diff --git a/Mage.Sets/src/mage/cards/d/DeathSpark.java b/Mage.Sets/src/mage/cards/d/DeathSpark.java index 9197eddb6d..b88f608392 100644 --- a/Mage.Sets/src/mage/cards/d/DeathSpark.java +++ b/Mage.Sets/src/mage/cards/d/DeathSpark.java @@ -66,7 +66,7 @@ enum DeathSparkCondition implements Condition { boolean nextCard = false; for (Card card : controller.getGraveyard().getCards(game)) { if (nextCard) { - return card.isCreature(); + return card.isCreature(game); } if (card.getId().equals(source.getSourceId())) { nextCard = true; diff --git a/Mage.Sets/src/mage/cards/d/DeathgorgeScavenger.java b/Mage.Sets/src/mage/cards/d/DeathgorgeScavenger.java index aa638d5eef..ccff4f97fa 100644 --- a/Mage.Sets/src/mage/cards/d/DeathgorgeScavenger.java +++ b/Mage.Sets/src/mage/cards/d/DeathgorgeScavenger.java @@ -71,7 +71,7 @@ class DeathgorgeScavengerEffect extends OneShotEffect { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { controller.moveCards(card, Zone.EXILED, source, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.gainLife(2, game, source); } else { game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), source); diff --git a/Mage.Sets/src/mage/cards/d/DeathsOasis.java b/Mage.Sets/src/mage/cards/d/DeathsOasis.java index 4e5d95e502..473a45e464 100644 --- a/Mage.Sets/src/mage/cards/d/DeathsOasis.java +++ b/Mage.Sets/src/mage/cards/d/DeathsOasis.java @@ -152,7 +152,7 @@ enum DeathsOasisValue implements DynamicValue { .getBattlefield() .getAllActivePermanents(sourceAbility.getControllerId()) .stream() - .filter(Permanent::isCreature) + .filter(permanent -> permanent.isCreature(game)) .mapToInt(Permanent::getManaValue) .max() .orElse(0); diff --git a/Mage.Sets/src/mage/cards/d/DeathsPresence.java b/Mage.Sets/src/mage/cards/d/DeathsPresence.java index fa567e26e2..3e26540287 100644 --- a/Mage.Sets/src/mage/cards/d/DeathsPresence.java +++ b/Mage.Sets/src/mage/cards/d/DeathsPresence.java @@ -12,7 +12,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -66,7 +65,7 @@ class DeathsPresenceTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zoneChangeEvent = (ZoneChangeEvent) event; if (zoneChangeEvent.isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { + if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(game)) { this.getTargets().clear(); this.addTarget(new TargetControlledCreaturePermanent()); this.getEffects().clear(); diff --git a/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java b/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java index 95e4fa0292..4d375c6bf0 100644 --- a/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java +++ b/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java @@ -70,7 +70,7 @@ class DeceiverOfFormEffect extends OneShotEffect { if (copyFromCard != null) { Cards cards = new CardsImpl(copyFromCard); controller.revealCards(sourceObject.getIdName(), cards, game); - if (copyFromCard.isCreature()) { + if (copyFromCard.isCreature(game)) { if (controller.chooseUse(outcome, "Let creatures you control other than " + sourceObject.getLogName() + " becomes copies of " + copyFromCard.getLogName() + " until end of turn?", source, game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { diff --git a/Mage.Sets/src/mage/cards/d/DeepWater.java b/Mage.Sets/src/mage/cards/d/DeepWater.java index d7212ff973..784f1e111e 100644 --- a/Mage.Sets/src/mage/cards/d/DeepWater.java +++ b/Mage.Sets/src/mage/cards/d/DeepWater.java @@ -2,7 +2,7 @@ package mage.cards.d; import java.util.UUID; -import mage.MageObject; + import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -17,7 +17,6 @@ import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; @@ -84,7 +83,7 @@ class DeepWaterReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return filter.match(permanent, game); } return false; diff --git a/Mage.Sets/src/mage/cards/d/DeepwoodDenizen.java b/Mage.Sets/src/mage/cards/d/DeepwoodDenizen.java index bf94d9fe8d..5733ba08da 100644 --- a/Mage.Sets/src/mage/cards/d/DeepwoodDenizen.java +++ b/Mage.Sets/src/mage/cards/d/DeepwoodDenizen.java @@ -74,7 +74,7 @@ enum DeepwoodDenizenValue implements DynamicValue { public int calculate(Game game, Ability sourceAbility, Effect effect) { int counters = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(sourceAbility.getControllerId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { counters += permanent.getCounters(game).getCount(CounterType.P1P1); } } diff --git a/Mage.Sets/src/mage/cards/d/DemonlordBelzenlok.java b/Mage.Sets/src/mage/cards/d/DemonlordBelzenlok.java index 6c11b5e926..28a20262d5 100644 --- a/Mage.Sets/src/mage/cards/d/DemonlordBelzenlok.java +++ b/Mage.Sets/src/mage/cards/d/DemonlordBelzenlok.java @@ -76,7 +76,7 @@ class DemonlordBelzenlokEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCards(card, Zone.EXILED, source, game); - if (!card.isLand()) { + if (!card.isLand(game)) { if (card.getManaValue() < 4) { cont = false; } diff --git a/Mage.Sets/src/mage/cards/d/DescendantsPath.java b/Mage.Sets/src/mage/cards/d/DescendantsPath.java index a7ed285fd5..60ea0e591d 100644 --- a/Mage.Sets/src/mage/cards/d/DescendantsPath.java +++ b/Mage.Sets/src/mage/cards/d/DescendantsPath.java @@ -75,7 +75,7 @@ class DescendantsPathEffect extends OneShotEffect { return false; } controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); - if (card.isCreature()) { + if (card.isCreature(game)) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); boolean found = false; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) { diff --git a/Mage.Sets/src/mage/cards/d/DesecratedTomb.java b/Mage.Sets/src/mage/cards/d/DesecratedTomb.java index 2533371d93..58fd0ebde1 100644 --- a/Mage.Sets/src/mage/cards/d/DesecratedTomb.java +++ b/Mage.Sets/src/mage/cards/d/DesecratedTomb.java @@ -1,6 +1,5 @@ package mage.cards.d; -import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.Card; @@ -63,7 +62,7 @@ class DesecratedTombTriggeredAbility extends TriggeredAbilityImpl { && zEvent.getCards() .stream() .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(card -> card.isCreature(game)) .map(Card::getOwnerId) .anyMatch(getControllerId()::equals); } diff --git a/Mage.Sets/src/mage/cards/d/DesecratorHag.java b/Mage.Sets/src/mage/cards/d/DesecratorHag.java index 1947beaf81..d10c71c298 100644 --- a/Mage.Sets/src/mage/cards/d/DesecratorHag.java +++ b/Mage.Sets/src/mage/cards/d/DesecratorHag.java @@ -70,7 +70,7 @@ class DesecratorHagEffect extends OneShotEffect { Player you = game.getPlayer(source.getControllerId()); if (you != null) { for (Card card : you.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { if (card.getPower().getValue() > creatureGreatestPower) { creatureGreatestPower = card.getPower().getValue(); cards.clear(); diff --git a/Mage.Sets/src/mage/cards/d/Desertion.java b/Mage.Sets/src/mage/cards/d/Desertion.java index 8fe5b50c07..329fd89eb3 100644 --- a/Mage.Sets/src/mage/cards/d/Desertion.java +++ b/Mage.Sets/src/mage/cards/d/Desertion.java @@ -87,6 +87,6 @@ class DesertionReplacementEffect extends ReplacementEffectImpl { } MageObject mageObject = game.getObject(event.getTargetId()); return mageObject != null - && (mageObject.isArtifact() || mageObject.isCreature()); + && (mageObject.isArtifact(game) || mageObject.isCreature(game)); } } diff --git a/Mage.Sets/src/mage/cards/d/Desolation.java b/Mage.Sets/src/mage/cards/d/Desolation.java index fadacf8892..555b54b836 100644 --- a/Mage.Sets/src/mage/cards/d/Desolation.java +++ b/Mage.Sets/src/mage/cards/d/Desolation.java @@ -113,7 +113,7 @@ class DesolationWatcher extends Watcher { UUID playerId = event.getPlayerId(); if (playerId != null) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); // need only info about permanent - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { tappedForManaThisTurnPlayers.add(playerId); } } diff --git a/Mage.Sets/src/mage/cards/d/DestroyTheEvidence.java b/Mage.Sets/src/mage/cards/d/DestroyTheEvidence.java index 47397f7f67..4ad3778ff3 100644 --- a/Mage.Sets/src/mage/cards/d/DestroyTheEvidence.java +++ b/Mage.Sets/src/mage/cards/d/DestroyTheEvidence.java @@ -69,7 +69,7 @@ class DestroyTheEvidenceEffect extends OneShotEffect { for (Card card : player.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { break; } } diff --git a/Mage.Sets/src/mage/cards/d/DevoutHarpist.java b/Mage.Sets/src/mage/cards/d/DevoutHarpist.java index 0ab8341dc4..20a3a42722 100644 --- a/Mage.Sets/src/mage/cards/d/DevoutHarpist.java +++ b/Mage.Sets/src/mage/cards/d/DevoutHarpist.java @@ -62,7 +62,7 @@ class DevoutHarpistPredicate implements ObjectPlayerPredicate> it = tokenEvent.getTokens().entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = it.next(); - if (entry.getKey().isCreature()) { + if (entry.getKey().isCreature(game)) { amount += entry.getValue(); it.remove(); } diff --git a/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java b/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java index 54acf82562..a1ea8f979a 100644 --- a/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java +++ b/Mage.Sets/src/mage/cards/d/DjeruWithEyesOpen.java @@ -86,7 +86,7 @@ class DjeruWithEyesOpenPreventEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isPlaneswalker() && permanent.isControlledBy(source.getControllerId())) { + if (permanent != null && permanent.isPlaneswalker(game) && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java b/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java index 6ef79ece29..17e1e62751 100644 --- a/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java +++ b/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java @@ -137,7 +137,7 @@ class DomriChaosBringerTriggeredAbility extends DelayedTriggeredAbility { return false; } MageObject mo = game.getObject(event.getTargetId()); - if (mo == null || !mo.isCreature()) { + if (mo == null || !mo.isCreature(game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/d/DomriRade.java b/Mage.Sets/src/mage/cards/d/DomriRade.java index 7bc987cc02..d7ce9c0100 100644 --- a/Mage.Sets/src/mage/cards/d/DomriRade.java +++ b/Mage.Sets/src/mage/cards/d/DomriRade.java @@ -96,7 +96,7 @@ class DomriRadeEffect1 extends OneShotEffect { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards(sourceObject.getName(), cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) { controller.moveCards(card, Zone.HAND, source, game); controller.revealCards(sourceObject.getIdName(), cards, game); diff --git a/Mage.Sets/src/mage/cards/d/DoubleVision.java b/Mage.Sets/src/mage/cards/d/DoubleVision.java index 57a49802c5..72bdb0c216 100644 --- a/Mage.Sets/src/mage/cards/d/DoubleVision.java +++ b/Mage.Sets/src/mage/cards/d/DoubleVision.java @@ -1,6 +1,5 @@ package mage.cards.d; -import mage.MageObject; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.cards.CardImpl; @@ -72,7 +71,7 @@ class DoubleVisionCopyTriggeredAbility extends SpellCastControllerTriggeredAbili if (watcher != null) { List eligibleSpells = watcher.getSpellsCastThisTurn(this.getControllerId()) .stream() - .filter(MageObject::isInstantOrSorcery) + .filter(spell1 -> spell1.isInstantOrSorcery(game)) .collect(Collectors.toList()); return eligibleSpells.size() == 1 && eligibleSpells.get(0).getId().equals(spell.getId()); } diff --git a/Mage.Sets/src/mage/cards/d/Doublecast.java b/Mage.Sets/src/mage/cards/d/Doublecast.java index 78376a5a5b..3ed707541c 100644 --- a/Mage.Sets/src/mage/cards/d/Doublecast.java +++ b/Mage.Sets/src/mage/cards/d/Doublecast.java @@ -66,7 +66,7 @@ class DoublecastAbility extends DelayedTriggeredAbility { return false; } Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/d/DoublingSeason.java b/Mage.Sets/src/mage/cards/d/DoublingSeason.java index 432ea08502..0a174d172f 100644 --- a/Mage.Sets/src/mage/cards/d/DoublingSeason.java +++ b/Mage.Sets/src/mage/cards/d/DoublingSeason.java @@ -111,7 +111,7 @@ class DoublingSeasonCounterEffect extends ReplacementEffectImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); landPlayed = (permanent != null - && permanent.isLand()); // a played land is not an effect + && permanent.isLand(game)); // a played land is not an effect } return permanent != null && permanent.isControlledBy(source.getControllerId()) diff --git a/Mage.Sets/src/mage/cards/d/DragonAppeasement.java b/Mage.Sets/src/mage/cards/d/DragonAppeasement.java index abc8abb62f..17796cfdc1 100644 --- a/Mage.Sets/src/mage/cards/d/DragonAppeasement.java +++ b/Mage.Sets/src/mage/cards/d/DragonAppeasement.java @@ -12,7 +12,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; /** * @@ -65,7 +64,7 @@ class DragonAppeasementTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java b/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java index a26010adaf..3c3bc99575 100644 --- a/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java +++ b/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java @@ -87,7 +87,7 @@ class DragonlordKolaghanTriggeredAbility extends TriggeredAbilityImpl { Player controller = game.getPlayer(getControllerId()); if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) { Spell spell = game.getStack().getSpell(event.getSourceId()); - if (spell != null && !spell.isFaceDown(game) && (spell.isCreature() || spell.isPlaneswalker())) { + if (spell != null && !spell.isFaceDown(game) && (spell.isCreature(game) || spell.isPlaneswalker(game))) { Player opponent = game.getPlayer(event.getPlayerId()); if(opponent != null) { boolean sameName = false; diff --git a/Mage.Sets/src/mage/cards/d/DrainLife.java b/Mage.Sets/src/mage/cards/d/DrainLife.java index 9ce3a1d556..03202ee281 100644 --- a/Mage.Sets/src/mage/cards/d/DrainLife.java +++ b/Mage.Sets/src/mage/cards/d/DrainLife.java @@ -80,9 +80,9 @@ class DrainLifeEffect extends OneShotEffect { } Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { lifetogain = Math.min(permanent.getToughness().getValue(), lifetogain); - } else if (permanent.isPlaneswalker()) { + } else if (permanent.isPlaneswalker(game)) { lifetogain = Math.min(permanent.getCounters(game).getCount(CounterType.LOYALTY), lifetogain); } else { return false; diff --git a/Mage.Sets/src/mage/cards/d/DralnuLichLord.java b/Mage.Sets/src/mage/cards/d/DralnuLichLord.java index c32b2780ab..1470d9d36d 100644 --- a/Mage.Sets/src/mage/cards/d/DralnuLichLord.java +++ b/Mage.Sets/src/mage/cards/d/DralnuLichLord.java @@ -118,7 +118,7 @@ class DralnuLichLordFlashbackEffect extends ContinuousEffectImpl { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { FlashbackAbility ability; - if (card.isInstant()) { + if (card.isInstant(game)) { ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); } else { diff --git a/Mage.Sets/src/mage/cards/d/DraugrNecromancer.java b/Mage.Sets/src/mage/cards/d/DraugrNecromancer.java index 776ee712a2..3e8d08a85f 100644 --- a/Mage.Sets/src/mage/cards/d/DraugrNecromancer.java +++ b/Mage.Sets/src/mage/cards/d/DraugrNecromancer.java @@ -94,7 +94,7 @@ class DraugrNecromancerReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zce = (ZoneChangeEvent) event; return zce.isDiesEvent() - && zce.getTarget().isCreature() + && zce.getTarget().isCreature(game) && !(zce.getTarget() instanceof PermanentToken); } } @@ -130,7 +130,7 @@ class DraugrNecromancerCastFromExileEffect extends AsThoughEffectImpl { || game.getState().getZone(card.getMainCard().getId()) != Zone.EXILED) { return false; } - return !card.isLand() + return !card.isLand(game) && game.getOpponents(card.getOwnerId()).contains(source.getControllerId()) && card.getMainCard().getCounters(game).getCount(CounterType.ICE) > 0; } diff --git a/Mage.Sets/src/mage/cards/d/Dread.java b/Mage.Sets/src/mage/cards/d/Dread.java index af10b87330..db93a7a379 100644 --- a/Mage.Sets/src/mage/cards/d/Dread.java +++ b/Mage.Sets/src/mage/cards/d/Dread.java @@ -15,7 +15,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -77,7 +76,7 @@ class DreadTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { this.getEffects().setTargetPointer(new FixedTarget(permanent, game)); return true; } diff --git a/Mage.Sets/src/mage/cards/d/DreadSummons.java b/Mage.Sets/src/mage/cards/d/DreadSummons.java index dc1f3d6fbb..1f109b5ffd 100644 --- a/Mage.Sets/src/mage/cards/d/DreadSummons.java +++ b/Mage.Sets/src/mage/cards/d/DreadSummons.java @@ -1,6 +1,5 @@ package mage.cards.d; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -71,7 +70,7 @@ class DreadSummonsEffect extends OneShotEffect { .stream() .filter(Objects::nonNull) .filter(card -> game.getState().getZone(card.getId()) == Zone.GRAVEYARD) - .filter(MageObject::isCreature) + .filter(card1 -> card1.isCreature(game)) .count(); } if (creatureCount > 0) { diff --git a/Mage.Sets/src/mage/cards/d/DreamDevourer.java b/Mage.Sets/src/mage/cards/d/DreamDevourer.java index e36428c291..17d271588e 100644 --- a/Mage.Sets/src/mage/cards/d/DreamDevourer.java +++ b/Mage.Sets/src/mage/cards/d/DreamDevourer.java @@ -93,10 +93,10 @@ class DreamDevourerAddAbilityEffect extends ContinuousEffectImpl { ModalDoubleFacesCardHalf leftHalfCard = ((ModalDoubleFacesCard) card).getLeftHalfCard(); // If front side of MDFC is land, do nothing as Dream Devourer does not apply to lands // MDFC cards in hand are considered lands if front side is land - if (!leftHalfCard.isLand()) { + if (!leftHalfCard.isLand(game)) { String leftHalfCost = CardUtil.reduceCost(leftHalfCard.getManaCost(), 2).getText(); ModalDoubleFacesCardHalf rightHalfCard = ((ModalDoubleFacesCard) card).getRightHalfCard(); - if (rightHalfCard.isLand()) { + if (rightHalfCard.isLand(game)) { foretellAbility = new ForetellAbility(card, leftHalfCost); } else { String rightHalfCost = CardUtil.reduceCost(rightHalfCard.getManaCost(), 2).getText(); diff --git a/Mage.Sets/src/mage/cards/d/DreamPillager.java b/Mage.Sets/src/mage/cards/d/DreamPillager.java index 4b9279b4d7..b1d321a76c 100644 --- a/Mage.Sets/src/mage/cards/d/DreamPillager.java +++ b/Mage.Sets/src/mage/cards/d/DreamPillager.java @@ -20,7 +20,6 @@ import mage.constants.*; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTargets; @@ -117,7 +116,7 @@ class DreamPillagerEffect extends OneShotEffect { controller.moveCards(cards, Zone.EXILED, source, game); Cards canBeCast = new CardsImpl(); for (Card card : cards) { - if (!card.isLand()) { + if (!card.isLand(game)) { canBeCast.add(card); } } diff --git a/Mage.Sets/src/mage/cards/d/DregscapeSliver.java b/Mage.Sets/src/mage/cards/d/DregscapeSliver.java index 81599781e5..f70883ad58 100644 --- a/Mage.Sets/src/mage/cards/d/DregscapeSliver.java +++ b/Mage.Sets/src/mage/cards/d/DregscapeSliver.java @@ -62,7 +62,7 @@ class DregscapeSliverEffect extends ContinuousEffectImpl { } for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card == null || !card.isCreature() || !card.hasSubtype(SubType.SLIVER, game)) { + if (card == null || !card.isCreature(game) || !card.hasSubtype(SubType.SLIVER, game)) { continue; } UnearthAbility ability = new UnearthAbility(new ManaCostsImpl("{2}")); diff --git a/Mage.Sets/src/mage/cards/d/DroolingOgre.java b/Mage.Sets/src/mage/cards/d/DroolingOgre.java index 2b907f3a1c..6c681bf573 100644 --- a/Mage.Sets/src/mage/cards/d/DroolingOgre.java +++ b/Mage.Sets/src/mage/cards/d/DroolingOgre.java @@ -18,7 +18,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -102,7 +101,7 @@ public final class DroolingOgre extends CardImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isArtifact()) { + if (spell != null && spell.isArtifact(game)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/cards/d/DruidicSatchel.java b/Mage.Sets/src/mage/cards/d/DruidicSatchel.java index 23c2402510..8c7d2c425e 100644 --- a/Mage.Sets/src/mage/cards/d/DruidicSatchel.java +++ b/Mage.Sets/src/mage/cards/d/DruidicSatchel.java @@ -62,13 +62,13 @@ class DruidicSatchelEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.revealCards(source, new CardsImpl(card), game); - if (card.isCreature()) { + if (card.isCreature(game)) { new SaprolingToken().putOntoBattlefield(1, game, source, source.getControllerId()); } - if (card.isLand()) { + if (card.isLand(game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - if (!card.isCreature() && !card.isLand()) { + if (!card.isCreature(game) && !card.isLand(game)) { controller.gainLife(2, game, source); } } diff --git a/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java b/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java index 0a63fe9865..04ba54fe0c 100644 --- a/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java +++ b/Mage.Sets/src/mage/cards/d/DryadGreenseeker.java @@ -75,7 +75,7 @@ class DryadGreenseekerEffect extends OneShotEffect { return false; } player.lookAtCards(null, card, game); - if (!card.isLand()) { + if (!card.isLand(game)) { return true; } if (!player.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/d/DryadMilitant.java b/Mage.Sets/src/mage/cards/d/DryadMilitant.java index 5665165eda..5cfc1daf23 100644 --- a/Mage.Sets/src/mage/cards/d/DryadMilitant.java +++ b/Mage.Sets/src/mage/cards/d/DryadMilitant.java @@ -17,7 +17,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; -import mage.players.Player; /** * @@ -83,7 +82,7 @@ class DryadMilitantReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && (card.isSorcery() || card.isInstant())) { + if (card != null && (card.isSorcery(game) || card.isInstant(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DualStrike.java b/Mage.Sets/src/mage/cards/d/DualStrike.java index bbc143e43f..0423b5e31d 100644 --- a/Mage.Sets/src/mage/cards/d/DualStrike.java +++ b/Mage.Sets/src/mage/cards/d/DualStrike.java @@ -67,7 +67,7 @@ class DualStrikeAbility extends DelayedTriggeredAbility { } Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell == null - || !spell.isInstantOrSorcery() + || !spell.isInstantOrSorcery(game) || spell.getManaValue() > 4) { return false; } diff --git a/Mage.Sets/src/mage/cards/d/Duplicant.java b/Mage.Sets/src/mage/cards/d/Duplicant.java index 594d83881b..ae384922d1 100644 --- a/Mage.Sets/src/mage/cards/d/Duplicant.java +++ b/Mage.Sets/src/mage/cards/d/Duplicant.java @@ -125,7 +125,7 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl { return false; } Card card = game.getCard(imprinted.get(imprinted.size() - 1)); - if (card == null || !card.isCreature()) { + if (card == null || !card.isCreature(game)) { return false; } switch (layer) { diff --git a/Mage.Sets/src/mage/cards/e/EchoingCalm.java b/Mage.Sets/src/mage/cards/e/EchoingCalm.java index cd7ee3b347..c0cf29ed12 100644 --- a/Mage.Sets/src/mage/cards/e/EchoingCalm.java +++ b/Mage.Sets/src/mage/cards/e/EchoingCalm.java @@ -61,7 +61,7 @@ class EchoingCalmEffect extends OneShotEffect { permanent.destroy(source, game, false); if (!CardUtil.haveEmptyName(permanent)) { // in case of face down enchantment creature for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (!perm.getId().equals(permanent.getId()) && CardUtil.haveSameNames(perm, permanent) && perm.isEnchantment()) { + if (!perm.getId().equals(permanent.getId()) && CardUtil.haveSameNames(perm, permanent) && perm.isEnchantment(game)) { perm.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/e/EchoingRuin.java b/Mage.Sets/src/mage/cards/e/EchoingRuin.java index f524308b37..1fd67440d6 100644 --- a/Mage.Sets/src/mage/cards/e/EchoingRuin.java +++ b/Mage.Sets/src/mage/cards/e/EchoingRuin.java @@ -67,7 +67,7 @@ class EchoingRuinEffect extends OneShotEffect { permanent.destroy(source, game, false); if (!CardUtil.haveEmptyName(permanent)) { // in case of face down artifact creature for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (!perm.getId().equals(permanent.getId()) && CardUtil.haveSameNames(perm, permanent) && perm.isArtifact()) { + if (!perm.getId().equals(permanent.getId()) && CardUtil.haveSameNames(perm, permanent) && perm.isArtifact(game)) { perm.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java b/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java index db4f205110..b926d70860 100644 --- a/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java +++ b/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java @@ -70,7 +70,7 @@ class EidolonOfObstructionEffect extends CostModificationEffectImpl { if (permanent == null) { return false; } - return permanent.isPlaneswalker() + return permanent.isPlaneswalker(game) && game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/e/Electropotence.java b/Mage.Sets/src/mage/cards/e/Electropotence.java index ee52e3bdfe..35c73df188 100644 --- a/Mage.Sets/src/mage/cards/e/Electropotence.java +++ b/Mage.Sets/src/mage/cards/e/Electropotence.java @@ -12,7 +12,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetAnyTarget; @@ -62,7 +61,7 @@ class ElectropotenceTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId)) { this.getEffects().get(0).setValue("damageSource", event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/e/EliteHeadhunter.java b/Mage.Sets/src/mage/cards/e/EliteHeadhunter.java index b5e86c7537..d06d5be260 100644 --- a/Mage.Sets/src/mage/cards/e/EliteHeadhunter.java +++ b/Mage.Sets/src/mage/cards/e/EliteHeadhunter.java @@ -70,8 +70,8 @@ enum EliteHeadhunterPredicate implements ObjectSourcePlayerPredicate input, Game game) { MageObject obj = input.getObject(); if (obj.getId().equals(input.getSourceId())) { - return obj.isArtifact(); + return obj.isArtifact(game); } - return obj.isCreature() || obj.isArtifact(); + return obj.isCreature(game) || obj.isArtifact(game); } } diff --git a/Mage.Sets/src/mage/cards/e/ElspethConquersDeath.java b/Mage.Sets/src/mage/cards/e/ElspethConquersDeath.java index ae9ac27fe7..8ba487dee2 100644 --- a/Mage.Sets/src/mage/cards/e/ElspethConquersDeath.java +++ b/Mage.Sets/src/mage/cards/e/ElspethConquersDeath.java @@ -102,7 +102,7 @@ class ElspethConquersDeathCostEffect extends CostModificationEffectImpl { && game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); if (spellCard != null) { - return !spellCard.isCreature(); + return !spellCard.isCreature(game); } } return false; diff --git a/Mage.Sets/src/mage/cards/e/ElspethTirel.java b/Mage.Sets/src/mage/cards/e/ElspethTirel.java index 4c4f9f8903..ee656aefad 100644 --- a/Mage.Sets/src/mage/cards/e/ElspethTirel.java +++ b/Mage.Sets/src/mage/cards/e/ElspethTirel.java @@ -90,7 +90,7 @@ class ElspethTirelThirdEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (!perm.getId().equals(source.getSourceId()) && !(perm instanceof PermanentToken) && !(perm.isLand())) { + if (!perm.getId().equals(source.getSourceId()) && !(perm instanceof PermanentToken) && !(perm.isLand(game))) { perm.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/e/ElvishHealer.java b/Mage.Sets/src/mage/cards/e/ElvishHealer.java index 616d450107..5b63b58922 100644 --- a/Mage.Sets/src/mage/cards/e/ElvishHealer.java +++ b/Mage.Sets/src/mage/cards/e/ElvishHealer.java @@ -69,7 +69,7 @@ class ElvishHealerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int toPrevent = 1; Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null && permanent.isCreature() && permanent.getColor(game).isGreen()) { + if (permanent != null && permanent.isCreature(game) && permanent.getColor(game).isGreen()) { toPrevent = 2; } game.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, toPrevent) diff --git a/Mage.Sets/src/mage/cards/e/EmbodimentOfAgonies.java b/Mage.Sets/src/mage/cards/e/EmbodimentOfAgonies.java index b52a0dc83a..a15390d04b 100644 --- a/Mage.Sets/src/mage/cards/e/EmbodimentOfAgonies.java +++ b/Mage.Sets/src/mage/cards/e/EmbodimentOfAgonies.java @@ -3,8 +3,6 @@ package mage.cards.e; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.costs.mana.ManaCost; -import mage.abilities.costs.mana.ManaCosts; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -67,7 +65,7 @@ enum EmbodimentOfAgoniesValue implements DynamicValue { player.getGraveyard() .getCards(game) .stream() - .filter(card -> !card.isLand()) + .filter(card -> !card.isLand(game)) .forEach(card -> stringSet.add(getCosts(card.getManaCostSymbols()))); stringSet.removeIf(s -> s == null || s.equals("")); return stringSet.size(); diff --git a/Mage.Sets/src/mage/cards/e/EmergentSequence.java b/Mage.Sets/src/mage/cards/e/EmergentSequence.java index adfc9479cf..559a15d878 100644 --- a/Mage.Sets/src/mage/cards/e/EmergentSequence.java +++ b/Mage.Sets/src/mage/cards/e/EmergentSequence.java @@ -105,7 +105,7 @@ class EmergentSequenceWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD - && ((EntersTheBattlefieldEvent) event).getTarget().isLand()) { + && ((EntersTheBattlefieldEvent) event).getTarget().isLand(game)) { playerMap.compute(event.getPlayerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/e/EmperorCrocodile.java b/Mage.Sets/src/mage/cards/e/EmperorCrocodile.java index 2957df3de7..a3f7f8fb6b 100644 --- a/Mage.Sets/src/mage/cards/e/EmperorCrocodile.java +++ b/Mage.Sets/src/mage/cards/e/EmperorCrocodile.java @@ -59,7 +59,7 @@ class EmperorCrocodileStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { - if (!perm.getId().equals(this.getSourceId()) && perm.isCreature()) { + if (!perm.getId().equals(this.getSourceId()) && perm.isCreature(game)) { return false; } } diff --git a/Mage.Sets/src/mage/cards/e/EmrakulThePromisedEnd.java b/Mage.Sets/src/mage/cards/e/EmrakulThePromisedEnd.java index bd2ae1412d..f7f99c4ab4 100644 --- a/Mage.Sets/src/mage/cards/e/EmrakulThePromisedEnd.java +++ b/Mage.Sets/src/mage/cards/e/EmrakulThePromisedEnd.java @@ -92,7 +92,7 @@ class EmrakulThePromisedEndCostReductionEffect extends CostModificationEffectImp if (controller != null) { Set foundCardTypes = new HashSet<>(8); for (Card card : controller.getGraveyard().getCards(game)) { - foundCardTypes.addAll(card.getCardType()); + foundCardTypes.addAll(card.getCardType(game)); } CardUtil.reduceCost(abilityToModify, foundCardTypes.size()); return true; diff --git a/Mage.Sets/src/mage/cards/e/EmryLurkerOfTheLoch.java b/Mage.Sets/src/mage/cards/e/EmryLurkerOfTheLoch.java index ddcc29da1f..89335d3048 100644 --- a/Mage.Sets/src/mage/cards/e/EmryLurkerOfTheLoch.java +++ b/Mage.Sets/src/mage/cards/e/EmryLurkerOfTheLoch.java @@ -88,7 +88,7 @@ class EmryLurkerOfTheLochPlayEffect extends AsThoughEffectImpl { return targetId.equals(objectId) && source.isControlledBy(affectedControllerId) && Zone.GRAVEYARD == game.getState().getZone(objectId) - && !game.getCard(targetId).isLand(); + && !game.getCard(targetId).isLand(game); } else { // the target card has changed zone meanwhile, so the effect is no longer needed discard(); diff --git a/Mage.Sets/src/mage/cards/e/EnchantedBeing.java b/Mage.Sets/src/mage/cards/e/EnchantedBeing.java index dd60b8a4b8..97ed5ade3e 100644 --- a/Mage.Sets/src/mage/cards/e/EnchantedBeing.java +++ b/Mage.Sets/src/mage/cards/e/EnchantedBeing.java @@ -65,12 +65,12 @@ class PreventDamageToSourceByEnchantedCreatures extends PreventAllDamageToSource } public boolean isEnchantedCreature(MageObject input, Game game) { - if (input == null || input.isCreature()) { + if (input == null || input.isCreature(game)) { return false; } for (UUID attachmentId : ((Permanent) input).getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.isEnchantment()) { + if (attachment != null && attachment.isEnchantment(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/e/EnchantedEvening.java b/Mage.Sets/src/mage/cards/e/EnchantedEvening.java index ba8156ca43..7cfb26dbc4 100644 --- a/Mage.Sets/src/mage/cards/e/EnchantedEvening.java +++ b/Mage.Sets/src/mage/cards/e/EnchantedEvening.java @@ -54,7 +54,7 @@ public final class EnchantedEvening extends CardImpl { source.getSourceId(), game )) { if (permanent != null) { - permanent.addCardType(CardType.ENCHANTMENT); + permanent.addCardType(game, CardType.ENCHANTMENT); } } return true; diff --git a/Mage.Sets/src/mage/cards/e/EnchantmentAlteration.java b/Mage.Sets/src/mage/cards/e/EnchantmentAlteration.java index db6b59c9e9..2b65428dec 100644 --- a/Mage.Sets/src/mage/cards/e/EnchantmentAlteration.java +++ b/Mage.Sets/src/mage/cards/e/EnchantmentAlteration.java @@ -86,12 +86,12 @@ class SharesEnchantedCardTypePredicate implements ObjectSourcePlayerPredicate toDestroy = new ArrayList<>(); for (Permanent permanent : game.getBattlefield().getActivePermanents(controller.getId(), game)) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { toDestroy.add(permanent); } else if (permanent.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(permanent.getAttachedTo()); - if (attachedTo != null && attachedTo.isCreature()) { + if (attachedTo != null && attachedTo.isCreature(game)) { toDestroy.add(permanent); } } diff --git a/Mage.Sets/src/mage/cards/e/EnduringRenewal.java b/Mage.Sets/src/mage/cards/e/EnduringRenewal.java index a9eb672aed..e55ceb5704 100644 --- a/Mage.Sets/src/mage/cards/e/EnduringRenewal.java +++ b/Mage.Sets/src/mage/cards/e/EnduringRenewal.java @@ -83,7 +83,7 @@ class EnduringRenewalReplacementEffect extends ReplacementEffectImpl { } Cards cards = new CardsImpl(card); controller.revealCards("Top card of " + controller.getName() + "'s library", cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.moveCards(card, Zone.GRAVEYARD, source, game); } else { // This is still replacing the draw, so we still return true diff --git a/Mage.Sets/src/mage/cards/e/EnduringScalelord.java b/Mage.Sets/src/mage/cards/e/EnduringScalelord.java index abbfd28ff2..2760261cbc 100644 --- a/Mage.Sets/src/mage/cards/e/EnduringScalelord.java +++ b/Mage.Sets/src/mage/cards/e/EnduringScalelord.java @@ -75,7 +75,7 @@ class EnduringScalelordTriggeredAbility extends TriggeredAbilityImpl { } return (permanent != null && !event.getTargetId().equals(this.getSourceId()) - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())); } return false; diff --git a/Mage.Sets/src/mage/cards/e/Epicenter.java b/Mage.Sets/src/mage/cards/e/Epicenter.java index 2734568cd5..5b7acbcbb4 100644 --- a/Mage.Sets/src/mage/cards/e/Epicenter.java +++ b/Mage.Sets/src/mage/cards/e/Epicenter.java @@ -69,7 +69,7 @@ class EpicenterEffect extends OneShotEffect { Iterator permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game).iterator(); while (permanents.hasNext()) { Permanent p = permanents.next(); - if (p.isLand()) { + if (p.isLand(game)) { p.sacrifice(source, game); } } diff --git a/Mage.Sets/src/mage/cards/e/ErebossTitan.java b/Mage.Sets/src/mage/cards/e/ErebossTitan.java index 50d6f88527..33c77a1956 100644 --- a/Mage.Sets/src/mage/cards/e/ErebossTitan.java +++ b/Mage.Sets/src/mage/cards/e/ErebossTitan.java @@ -93,7 +93,7 @@ class ErebossTitanTriggeredAbility extends TriggeredAbilityImpl { Card card = game.getCard(zEvent.getTargetId()); Player controller = game.getPlayer(getControllerId()); return card != null - && card.isCreature() + && card.isCreature(game) && controller != null && controller.hasOpponent(card.getOwnerId(), game); } diff --git a/Mage.Sets/src/mage/cards/e/ErraticCyclops.java b/Mage.Sets/src/mage/cards/e/ErraticCyclops.java index 80b8efce20..4274fdedd6 100644 --- a/Mage.Sets/src/mage/cards/e/ErraticCyclops.java +++ b/Mage.Sets/src/mage/cards/e/ErraticCyclops.java @@ -65,7 +65,7 @@ class ErraticCyclopsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isControlledBy(controllerId) - && spell.isInstantOrSorcery()) { + && spell.isInstantOrSorcery(game)) { this.getEffects().clear(); this.addEffect(new BoostSourceEffect( spell.getManaValue(), 0, Duration.EndOfTurn diff --git a/Mage.Sets/src/mage/cards/e/ErraticExplosion.java b/Mage.Sets/src/mage/cards/e/ErraticExplosion.java index 96e5f05795..1e8a304239 100644 --- a/Mage.Sets/src/mage/cards/e/ErraticExplosion.java +++ b/Mage.Sets/src/mage/cards/e/ErraticExplosion.java @@ -62,7 +62,7 @@ class ErraticExplosionEffect extends OneShotEffect { Card nonLandCard = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { nonLandCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/e/ErraticMutation.java b/Mage.Sets/src/mage/cards/e/ErraticMutation.java index 57e8637505..a7231d920c 100644 --- a/Mage.Sets/src/mage/cards/e/ErraticMutation.java +++ b/Mage.Sets/src/mage/cards/e/ErraticMutation.java @@ -69,7 +69,7 @@ class ErraticMutationEffect extends OneShotEffect { Card nonLandCard = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { nonLandCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/e/EsikaGodOfTheTree.java b/Mage.Sets/src/mage/cards/e/EsikaGodOfTheTree.java index 6b052110ad..fb69603af3 100644 --- a/Mage.Sets/src/mage/cards/e/EsikaGodOfTheTree.java +++ b/Mage.Sets/src/mage/cards/e/EsikaGodOfTheTree.java @@ -101,7 +101,7 @@ class PrismaticBridgeEffect extends OneShotEffect { Card toBattlefield = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); - if (card.isCreature() || card.isPlaneswalker()) { + if (card.isCreature(game) || card.isPlaneswalker(game)) { toBattlefield = card; break; } diff --git a/Mage.Sets/src/mage/cards/e/EsperSentinel.java b/Mage.Sets/src/mage/cards/e/EsperSentinel.java index 2bb832a333..8dceb20bc2 100644 --- a/Mage.Sets/src/mage/cards/e/EsperSentinel.java +++ b/Mage.Sets/src/mage/cards/e/EsperSentinel.java @@ -75,10 +75,10 @@ class EsperSentinelTriggeredAbility extends TriggeredAbilityImpl { Player controller = game.getPlayer(getControllerId()); Spell spell = game.getSpell(event.getTargetId()); SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class); - if (controller != null && spell != null && watcher != null && !spell.isCreature() && controller.hasOpponent(spell.getControllerId(), game)) { + if (controller != null && spell != null && watcher != null && !spell.isCreature(game) && controller.hasOpponent(spell.getControllerId(), game)) { int nonCreatureSpells = 0; for (Spell spellCastThisTurn : watcher.getSpellsCastThisTurn(spell.getControllerId())) { - if (!spellCastThisTurn.isCreature() && ++nonCreatureSpells > 1) { + if (!spellCastThisTurn.isCreature(game) && ++nonCreatureSpells > 1) { break; } } diff --git a/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java b/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java index ef45024676..2d7cc7f1a9 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java +++ b/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java @@ -11,7 +11,6 @@ import mage.constants.*; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -59,7 +58,7 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent perm = ((EntersTheBattlefieldEvent) event).getTarget(); - return perm != null && perm.isCreature() && perm.isControlledBy(source.getControllerId()); + return perm != null && perm.isCreature(game) && perm.isControlledBy(source.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/e/EtherealAbsolution.java b/Mage.Sets/src/mage/cards/e/EtherealAbsolution.java index 49bb668e5a..45cb967fb4 100644 --- a/Mage.Sets/src/mage/cards/e/EtherealAbsolution.java +++ b/Mage.Sets/src/mage/cards/e/EtherealAbsolution.java @@ -83,7 +83,7 @@ class EtherealAbsolutionEffect extends OneShotEffect { if (player == null || card == null) { return false; } - if (card.isCreature()) { + if (card.isCreature(game)) { new CreateTokenEffect(new WhiteBlackSpiritToken()).apply(game, source); } return player.moveCards(card, Zone.EXILED, source, game); diff --git a/Mage.Sets/src/mage/cards/e/EtherealValkyrie.java b/Mage.Sets/src/mage/cards/e/EtherealValkyrie.java index 4c716caa04..1456580eeb 100644 --- a/Mage.Sets/src/mage/cards/e/EtherealValkyrie.java +++ b/Mage.Sets/src/mage/cards/e/EtherealValkyrie.java @@ -140,11 +140,11 @@ class EtherealValkyrieEffect extends OneShotEffect { foretellAbility = new ForetellAbility(exileCard, leftHalfCost, rightHalfCost); } else if (exileCard instanceof ModalDoubleFacesCard) { ModalDoubleFacesCardHalf leftHalfCard = ((ModalDoubleFacesCard) exileCard).getLeftHalfCard(); - if (!leftHalfCard.isLand()) { + if (!leftHalfCard.isLand(game)) { String leftHalfCost = CardUtil.reduceCost(leftHalfCard.getManaCost(), 2).getText(); game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Cost", leftHalfCost); ModalDoubleFacesCardHalf rightHalfCard = ((ModalDoubleFacesCard) exileCard).getRightHalfCard(); - if (rightHalfCard.isLand()) { + if (rightHalfCard.isLand(game)) { foretellAbility = new ForetellAbility(exileCard, leftHalfCost); } else { String rightHalfCost = CardUtil.reduceCost(rightHalfCard.getManaCost(), 2).getText(); diff --git a/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java b/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java index e1200aa8b6..b718e1993b 100644 --- a/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java +++ b/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java @@ -64,7 +64,7 @@ class EtherswornCanonistWatcher extends Watcher { spell = (Spell) mageObject; } } - if (spell != null && !spell.isArtifact()) { + if (spell != null && !spell.isArtifact(game)) { castNonartifactSpell.add(event.getPlayerId()); } } @@ -104,7 +104,7 @@ class EtherswornCanonistReplacementEffect extends ContinuousRuleModifyingEffectI @Override public boolean applies(GameEvent event, Ability source, Game game) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isArtifact()) { + if (card != null && !card.isArtifact(game)) { EtherswornCanonistWatcher watcher = game.getState().getWatcher(EtherswornCanonistWatcher.class); return watcher != null && watcher.castNonArtifactSpell(event.getPlayerId()); } diff --git a/Mage.Sets/src/mage/cards/e/EverythingamajigC.java b/Mage.Sets/src/mage/cards/e/EverythingamajigC.java index bb42334f4a..47998b887a 100644 --- a/Mage.Sets/src/mage/cards/e/EverythingamajigC.java +++ b/Mage.Sets/src/mage/cards/e/EverythingamajigC.java @@ -147,11 +147,11 @@ class ChimericStaffEffect extends ContinuousEffectImpl { } switch (layer) { case TypeChangingEffects_4: - if (!permanent.isArtifact()) { - permanent.addCardType(CardType.ARTIFACT); + if (!permanent.isArtifact(game)) { + permanent.addCardType(game, CardType.ARTIFACT); } - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } permanent.removeAllCreatureTypes(game); permanent.addSubType(game, SubType.CONSTRUCT); diff --git a/Mage.Sets/src/mage/cards/e/ExplorersScope.java b/Mage.Sets/src/mage/cards/e/ExplorersScope.java index 46def7de0a..55c40c904b 100644 --- a/Mage.Sets/src/mage/cards/e/ExplorersScope.java +++ b/Mage.Sets/src/mage/cards/e/ExplorersScope.java @@ -71,7 +71,7 @@ class ExplorersScopeEffect extends OneShotEffect { if (card != null) { Cards cards = new CardsImpl(card); controller.lookAtCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { String message = "Put " + card.getLogName() + " onto the battlefield tapped?"; if (controller.chooseUse(Outcome.PutLandInPlay, message, source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); diff --git a/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java b/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java index 5957cac229..18e0513539 100644 --- a/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java +++ b/Mage.Sets/src/mage/cards/e/ExplosiveRevelation.java @@ -68,7 +68,7 @@ class ExplosiveRevelationEffect extends OneShotEffect { Card nonLandCard = null; for (Card card : library.getCards(game)) { toReveal.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { nonLandCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java index 2c5908ae32..b911acd109 100644 --- a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java +++ b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java @@ -122,7 +122,7 @@ class ExtraplanarLensTriggeredAbility extends TriggeredManaAbility { if (imprinted != null && game.getState().getZone(imprinted.getId()) == Zone.EXILED) { if (landTappedForMana.getName().equals(imprinted.getName()) - && landTappedForMana.isLand()) { + && landTappedForMana.isLand(game)) { ManaEvent mEvent = (ManaEvent) event; for (Effect effect : getEffects()) { effect.setValue("mana", mEvent.getMana()); diff --git a/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java b/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java index 164823125e..b38d643aa1 100644 --- a/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java +++ b/Mage.Sets/src/mage/cards/e/EyeOfTheStorm.java @@ -13,7 +13,6 @@ import mage.filter.FilterCard; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -72,7 +71,7 @@ class EyeOfTheStormAbility extends TriggeredAbilityImpl { && !spell.isCopy() && spell.getCard() != null && !spell.getCard().isCopy() - && spell.isInstantOrSorcery()) { + && spell.isInstantOrSorcery(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/e/EzzarootChanneler.java b/Mage.Sets/src/mage/cards/e/EzzarootChanneler.java index 9ab86356b5..079d39927c 100644 --- a/Mage.Sets/src/mage/cards/e/EzzarootChanneler.java +++ b/Mage.Sets/src/mage/cards/e/EzzarootChanneler.java @@ -79,7 +79,7 @@ class EzzarootChannelerEffect extends CostModificationEffectImpl { public boolean applies(Ability abilityToModify, Ability source, Game game) { return abilityToModify instanceof SpellAbility && abilityToModify.isControlledBy(source.getControllerId()) - && ((SpellAbility) abilityToModify).getCharacteristics(game).isCreature() + && ((SpellAbility) abilityToModify).getCharacteristics(game).isCreature(game) && game.getCard(abilityToModify.getSourceId()) != null; } diff --git a/Mage.Sets/src/mage/cards/f/FaadiyahSeer.java b/Mage.Sets/src/mage/cards/f/FaadiyahSeer.java index bf73c079aa..6f3f27aeee 100644 --- a/Mage.Sets/src/mage/cards/f/FaadiyahSeer.java +++ b/Mage.Sets/src/mage/cards/f/FaadiyahSeer.java @@ -80,7 +80,7 @@ class FaadiyahSeerEffect extends OneShotEffect { return true; } controller.revealCards(source, new CardsImpl(card), game); - if (!card.isLand()) { + if (!card.isLand(game)) { controller.discard(card, false, source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/f/FaeOffering.java b/Mage.Sets/src/mage/cards/f/FaeOffering.java index b9941d402a..ed325a03af 100644 --- a/Mage.Sets/src/mage/cards/f/FaeOffering.java +++ b/Mage.Sets/src/mage/cards/f/FaeOffering.java @@ -1,6 +1,5 @@ package mage.cards.f; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.Condition; @@ -67,7 +66,7 @@ enum FaeOfferingCondition implements Condition { return spells != null && spells .stream() .filter(Objects::nonNull) - .map(MageObject::isCreature) + .map(spell -> spell.isCreature(game)) .distinct() .count() == 2; } @@ -89,7 +88,7 @@ enum FaeOfferingHint implements Hint { List messages = spells .stream() .filter(Objects::nonNull) - .map(MageObject::isCreature) + .map(spell -> spell.isCreature(game)) .distinct() .map(b -> b ? "Creature spell" : "Noncreature spell") .sorted() diff --git a/Mage.Sets/src/mage/cards/f/FalkenrathNoble.java b/Mage.Sets/src/mage/cards/f/FalkenrathNoble.java index c57ded9fc7..5cbebc058e 100644 --- a/Mage.Sets/src/mage/cards/f/FalkenrathNoble.java +++ b/Mage.Sets/src/mage/cards/f/FalkenrathNoble.java @@ -12,7 +12,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.TargetPlayer; @@ -81,7 +80,7 @@ class FalkenrathNobleTriggeredAbility extends TriggeredAbilityImpl { if (permanent.getId().equals(this.getSourceId())) { return true; } - return permanent.isCreature(); + return permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/f/FalseOrders.java b/Mage.Sets/src/mage/cards/f/FalseOrders.java index 48ae91f333..ba4101ff11 100644 --- a/Mage.Sets/src/mage/cards/f/FalseOrders.java +++ b/Mage.Sets/src/mage/cards/f/FalseOrders.java @@ -114,7 +114,7 @@ class FalseOrdersUnblockEffect extends OneShotEffect { } } - if (!permanent.isCreature() + if (!permanent.isCreature(game) || !controller.chooseUse(Outcome.Benefit, "Have " + permanent.getLogName() + " block an attacking creature?", source, game)) { return false; } @@ -147,7 +147,7 @@ class FalseOrdersUnblockEffect extends OneShotEffect { return true; } Permanent chosenPermanent = game.getPermanent(target.getFirstTarget()); - if (chosenPermanent == null || !chosenPermanent.isCreature()) { + if (chosenPermanent == null || !chosenPermanent.isCreature(game)) { return false; } CombatGroup chosenGroup = game.getCombat().findGroup(chosenPermanent.getId()); diff --git a/Mage.Sets/src/mage/cards/f/FathomTrawl.java b/Mage.Sets/src/mage/cards/f/FathomTrawl.java index 3af71795cb..1815cb1a5e 100644 --- a/Mage.Sets/src/mage/cards/f/FathomTrawl.java +++ b/Mage.Sets/src/mage/cards/f/FathomTrawl.java @@ -63,7 +63,7 @@ public final class FathomTrawl extends CardImpl { for (Card card : controller.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { nonlandCards.add(card); if (nonlandCards.size() == 3) { break; diff --git a/Mage.Sets/src/mage/cards/f/FavorableDestiny.java b/Mage.Sets/src/mage/cards/f/FavorableDestiny.java index 7f40fe42b3..7b89786a65 100644 --- a/Mage.Sets/src/mage/cards/f/FavorableDestiny.java +++ b/Mage.Sets/src/mage/cards/f/FavorableDestiny.java @@ -91,7 +91,7 @@ class FavorableDestinyCondition implements Condition { if (controller != null) { for (Permanent perm : game.getBattlefield().getActivePermanents(controller.getId(), game)) { if (perm.isControlledBy(controller.getId()) - && perm.isCreature() + && perm.isCreature(game) && !perm.equals(creature)) { return true; } diff --git a/Mage.Sets/src/mage/cards/f/FeatherTheRedeemed.java b/Mage.Sets/src/mage/cards/f/FeatherTheRedeemed.java index 20305147a3..40308e5297 100644 --- a/Mage.Sets/src/mage/cards/f/FeatherTheRedeemed.java +++ b/Mage.Sets/src/mage/cards/f/FeatherTheRedeemed.java @@ -96,7 +96,7 @@ class FeatherTheRedeemedTriggeredAbility extends TriggeredAbilityImpl { for (Target target : mode.getTargets()) { for (UUID targetId : target.getTargets()) { Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(getControllerId())) { this.getEffects().clear(); this.addEffect(new FeatherTheRedeemedEffect(new MageObjectReference(spell, game))); @@ -107,7 +107,7 @@ class FeatherTheRedeemedTriggeredAbility extends TriggeredAbilityImpl { for (Effect effect : mode.getEffects()) { for (UUID targetId : effect.getTargetPointer().getTargets(game, sa)) { Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(getControllerId())) { this.getEffects().clear(); this.addEffect(new FeatherTheRedeemedEffect(new MageObjectReference(spell, game))); @@ -171,7 +171,7 @@ class FeatherTheRedeemedEffect extends ReplacementEffectImpl { && event.getSourceId() != null) { if (event.getSourceId().equals(event.getTargetId()) && mor.getZoneChangeCounter() == game.getState().getZoneChangeCounter(event.getSourceId())) { Spell spell = game.getStack().getSpell(mor.getSourceId()); - return spell != null && spell.isInstantOrSorcery(); + return spell != null && spell.isInstantOrSorcery(game); } } return false; diff --git a/Mage.Sets/src/mage/cards/f/FeralDeceiver.java b/Mage.Sets/src/mage/cards/f/FeralDeceiver.java index f08009ca53..ffaff745b6 100644 --- a/Mage.Sets/src/mage/cards/f/FeralDeceiver.java +++ b/Mage.Sets/src/mage/cards/f/FeralDeceiver.java @@ -82,7 +82,7 @@ class FeralDeceiverEffect extends OneShotEffect { if (card != null) { Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { game.addEffect(new BoostSourceEffect(2, 2, Duration.EndOfTurn), source); game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source); } diff --git a/Mage.Sets/src/mage/cards/f/FertileImagination.java b/Mage.Sets/src/mage/cards/f/FertileImagination.java index 1f580235fd..88f5964894 100644 --- a/Mage.Sets/src/mage/cards/f/FertileImagination.java +++ b/Mage.Sets/src/mage/cards/f/FertileImagination.java @@ -110,7 +110,7 @@ class FertileImaginationEffect extends OneShotEffect { Set cards = hand.getCards(game); int tokensToMake = 0; for (Card card : cards) { - if (card != null && card.getCardType().contains(type)) { + if (card != null && card.getCardType(game).contains(type)) { tokensToMake += 2; } } diff --git a/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java b/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java index eb32ef0d4b..5e752ab68a 100644 --- a/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java +++ b/Mage.Sets/src/mage/cards/f/FiendslayerPaladin.java @@ -98,8 +98,8 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifyingEffectImpl { if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) { if (stackObject.getColor(game).isBlack() || stackObject.getColor(game).isRed()) { if (!stackObject.isControlledBy(source.getControllerId()) - && stackObject.isInstant() - || stackObject.isSorcery()) { + && stackObject.isInstant(game) + || stackObject.isSorcery(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/f/FieryEncore.java b/Mage.Sets/src/mage/cards/f/FieryEncore.java index 99a4e7579b..d55536d9ea 100644 --- a/Mage.Sets/src/mage/cards/f/FieryEncore.java +++ b/Mage.Sets/src/mage/cards/f/FieryEncore.java @@ -66,7 +66,7 @@ class FieryEncoreEffect extends OneShotEffect { } Card card = player.discardOne(false, false, source, game); player.drawCards(1, source, game); - if (card == null || card.isLand()) { + if (card == null || card.isLand(game)) { return true; } ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/f/FireServant.java b/Mage.Sets/src/mage/cards/f/FireServant.java index d923e23e7b..13b98ae2e7 100644 --- a/Mage.Sets/src/mage/cards/f/FireServant.java +++ b/Mage.Sets/src/mage/cards/f/FireServant.java @@ -75,7 +75,7 @@ class FireServantEffect extends ReplacementEffectImpl { return spell != null && spell.isControlledBy(source.getControllerId()) && spell.getColor(game).isRed() && - spell.isInstantOrSorcery(); + spell.isInstantOrSorcery(game); } @Override diff --git a/Mage.Sets/src/mage/cards/f/FirefluxSquad.java b/Mage.Sets/src/mage/cards/f/FirefluxSquad.java index 90c6ea834a..93d1eefc6f 100644 --- a/Mage.Sets/src/mage/cards/f/FirefluxSquad.java +++ b/Mage.Sets/src/mage/cards/f/FirefluxSquad.java @@ -92,7 +92,7 @@ class FirefluxSquadEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { toBattlefield = card; break; } diff --git a/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java b/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java index 20d1ee3d33..06fea5557f 100644 --- a/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java +++ b/Mage.Sets/src/mage/cards/f/FiresongAndSunspeaker.java @@ -89,8 +89,8 @@ class FiresongAndSunspeakerTriggeredAbility extends TriggeredAbilityImpl { if (object instanceof Spell) { if (event.getTargetId().equals(this.getControllerId()) && object.getColor(game).contains(ObjectColor.WHITE) - && (object.isInstant() - || object.isSorcery())) { + && (object.isInstant(game) + || object.isSorcery(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/f/FirstDayOfClass.java b/Mage.Sets/src/mage/cards/f/FirstDayOfClass.java index 8f43c09fee..48c8052b6b 100644 --- a/Mage.Sets/src/mage/cards/f/FirstDayOfClass.java +++ b/Mage.Sets/src/mage/cards/f/FirstDayOfClass.java @@ -68,7 +68,7 @@ class FirstDayOfClassTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.isCreature() && permanent.isControlledBy(this.getControllerId())) { + if (permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) { getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); return true; } diff --git a/Mage.Sets/src/mage/cards/f/FlamescrollCelebrant.java b/Mage.Sets/src/mage/cards/f/FlamescrollCelebrant.java index af8f76575a..e901d7c39f 100644 --- a/Mage.Sets/src/mage/cards/f/FlamescrollCelebrant.java +++ b/Mage.Sets/src/mage/cards/f/FlamescrollCelebrant.java @@ -162,7 +162,7 @@ class RevelInSilenceEffect extends ContinuousRuleModifyingEffectImpl { return false; } Permanent permanent = game.getPermanent(event.getSourceId()); - return permanent != null && permanent.isPlaneswalker(); + return permanent != null && permanent.isPlaneswalker(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java b/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java index 7a8c17bf03..70197e2a85 100644 --- a/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java +++ b/Mage.Sets/src/mage/cards/f/FlayerOfTheHatebound.java @@ -15,7 +15,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetAnyTarget; @@ -73,7 +72,7 @@ class FlayerTriggeredAbility extends TriggeredAbilityImpl { if (permanent != null && ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD && permanent.isOwnedBy(controllerId) - && (permanent.isCreature() || permanent.getId().equals(getSourceId()))) { + && (permanent.isCreature(game) || permanent.getId().equals(getSourceId()))) { Effect effect = this.getEffects().get(0); effect.setValue("damageSource", event.getTargetId()); return true; diff --git a/Mage.Sets/src/mage/cards/f/FlayingTendrils.java b/Mage.Sets/src/mage/cards/f/FlayingTendrils.java index 008df44f2e..1e97ce3dd9 100644 --- a/Mage.Sets/src/mage/cards/f/FlayingTendrils.java +++ b/Mage.Sets/src/mage/cards/f/FlayingTendrils.java @@ -14,7 +14,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -79,7 +78,7 @@ class FlayingTendrilsReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zce = (ZoneChangeEvent) event; - return zce.isDiesEvent() && zce.getTarget().isCreature(); + return zce.isDiesEvent() && zce.getTarget().isCreature(game); } } diff --git a/Mage.Sets/src/mage/cards/f/FleshAllergy.java b/Mage.Sets/src/mage/cards/f/FleshAllergy.java index ab10aeb849..88135b15c9 100644 --- a/Mage.Sets/src/mage/cards/f/FleshAllergy.java +++ b/Mage.Sets/src/mage/cards/f/FleshAllergy.java @@ -16,7 +16,6 @@ import mage.constants.Zone; import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -64,7 +63,7 @@ class FleshAllergyWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { creaturesDiedThisTurn++; } } diff --git a/Mage.Sets/src/mage/cards/f/FleshReaver.java b/Mage.Sets/src/mage/cards/f/FleshReaver.java index 4009bc9b55..df4093ebc6 100644 --- a/Mage.Sets/src/mage/cards/f/FleshReaver.java +++ b/Mage.Sets/src/mage/cards/f/FleshReaver.java @@ -71,7 +71,7 @@ class FleshReaverTriggeredAbility extends TriggeredAbilityImpl { return false; } Permanent permanent = game.getPermanent(event.getTargetId()); - if ((permanent != null && permanent.isCreature()) + if ((permanent != null && permanent.isCreature(game)) || game.getOpponents(event.getTargetId()).contains(getControllerId())) { this.getEffects().setValue("damage", event.getAmount()); return true; diff --git a/Mage.Sets/src/mage/cards/f/FloodedWoodlands.java b/Mage.Sets/src/mage/cards/f/FloodedWoodlands.java index d37e4f2cbd..bc923db0ad 100644 --- a/Mage.Sets/src/mage/cards/f/FloodedWoodlands.java +++ b/Mage.Sets/src/mage/cards/f/FloodedWoodlands.java @@ -6,7 +6,6 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.PayCostToAttackBlockEffectImpl; -import mage.abilities.effects.PayCostToAttackBlockEffectImpl.RestrictType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -60,7 +59,7 @@ class FloodedWoodlandsCostToAttackBlockEffect extends PayCostToAttackBlockEffect public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getSourceId()); return (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getColor(game).isGreen()); } diff --git a/Mage.Sets/src/mage/cards/f/FlourishingDefenses.java b/Mage.Sets/src/mage/cards/f/FlourishingDefenses.java index 46494a5ed2..d9fc064214 100644 --- a/Mage.Sets/src/mage/cards/f/FlourishingDefenses.java +++ b/Mage.Sets/src/mage/cards/f/FlourishingDefenses.java @@ -61,7 +61,7 @@ class FlourishingDefensesTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getData().equals(CounterType.M1M1.getName())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/f/FoodChain.java b/Mage.Sets/src/mage/cards/f/FoodChain.java index ecd427045b..0baaf25c51 100644 --- a/Mage.Sets/src/mage/cards/f/FoodChain.java +++ b/Mage.Sets/src/mage/cards/f/FoodChain.java @@ -86,7 +86,7 @@ class FoodChainManaEffect extends ManaEffect { if (game != null) { int cmc = -1; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { cmc = Math.max(cmc, permanent.getManaCost().manaValue()); } } diff --git a/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java b/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java index c009d43bff..f534c9df27 100644 --- a/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java +++ b/Mage.Sets/src/mage/cards/f/ForethoughtAmulet.java @@ -75,7 +75,7 @@ class ForethoughtAmuletEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getAmount() >= 3) { MageObject object = game.getObject(event.getSourceId()); - return object != null && object.isInstantOrSorcery(); + return object != null && object.isInstantOrSorcery(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/f/ForgeOfHeroes.java b/Mage.Sets/src/mage/cards/f/ForgeOfHeroes.java index 84c22e247e..dbe57b36c1 100644 --- a/Mage.Sets/src/mage/cards/f/ForgeOfHeroes.java +++ b/Mage.Sets/src/mage/cards/f/ForgeOfHeroes.java @@ -82,11 +82,11 @@ class ForgeOfHeroesEffect extends OneShotEffect { if (permanent == null) { return false; } - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { new AddCountersTargetEffect( CounterType.P1P1.createInstance() ).apply(game, source); - } else if (permanent.isPlaneswalker()) { + } else if (permanent.isPlaneswalker(game)) { new AddCountersTargetEffect( CounterType.LOYALTY.createInstance() ).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/f/FoundryHelix.java b/Mage.Sets/src/mage/cards/f/FoundryHelix.java index 7a4fec404e..a8091b6bff 100644 --- a/Mage.Sets/src/mage/cards/f/FoundryHelix.java +++ b/Mage.Sets/src/mage/cards/f/FoundryHelix.java @@ -53,7 +53,7 @@ enum FoundryHelixCondition implements Condition { for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost) { for (Permanent permanent : ((SacrificeTargetCost) cost).getPermanents()) { - if (permanent.isArtifact()) { + if (permanent.isArtifact(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/f/Froghemoth.java b/Mage.Sets/src/mage/cards/f/Froghemoth.java index 63c469ad52..d4a9321c70 100644 --- a/Mage.Sets/src/mage/cards/f/Froghemoth.java +++ b/Mage.Sets/src/mage/cards/f/Froghemoth.java @@ -116,7 +116,7 @@ class FroghemothEffect extends OneShotEffect { for (UUID cardId : getTargetPointer().getTargets(game, source)) { Card card = game.getCard(cardId); if (card != null && game.getState().getZone(cardId) == Zone.GRAVEYARD && cardsToExile.add(card)) { - if (card.isCreature()) { + if (card.isCreature(game)) { numCounters++; } else { lifeGain++; diff --git a/Mage.Sets/src/mage/cards/f/FrontierSiege.java b/Mage.Sets/src/mage/cards/f/FrontierSiege.java index 3049ef6ec7..2e557dbb84 100644 --- a/Mage.Sets/src/mage/cards/f/FrontierSiege.java +++ b/Mage.Sets/src/mage/cards/f/FrontierSiege.java @@ -122,8 +122,8 @@ class FrontierSiegeFightEffect extends OneShotEffect { Permanent target = game.getPermanent(source.getFirstTarget()); if (triggeredCreature != null && target != null - && triggeredCreature.isCreature() - && target.isCreature()) { + && triggeredCreature.isCreature(game) + && target.isCreature(game)) { triggeredCreature.fight(target, source, game); return true; } diff --git a/Mage.Sets/src/mage/cards/f/FrozenAether.java b/Mage.Sets/src/mage/cards/f/FrozenAether.java index 9ded555714..e62b00f5b7 100644 --- a/Mage.Sets/src/mage/cards/f/FrozenAether.java +++ b/Mage.Sets/src/mage/cards/f/FrozenAether.java @@ -14,7 +14,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -70,9 +69,9 @@ class FrozenAetherTapEffect extends ReplacementEffectImpl { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null - && (permanent.isCreature() - || permanent.isLand() - || permanent.isArtifact())) { + && (permanent.isCreature(game) + || permanent.isLand(game) + || permanent.isArtifact(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GaddockTeeg.java b/Mage.Sets/src/mage/cards/g/GaddockTeeg.java index 9db17686d6..0850e7c965 100644 --- a/Mage.Sets/src/mage/cards/g/GaddockTeeg.java +++ b/Mage.Sets/src/mage/cards/g/GaddockTeeg.java @@ -73,7 +73,7 @@ class GaddockTeegReplacementEffect4 extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isCreature() && card.getManaValue() >= 4) { + if (card != null && !card.isCreature(game) && card.getManaValue() >= 4) { return true; } return false; @@ -110,7 +110,7 @@ class GaddockTeegReplacementEffectX extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isCreature() && card.getManaCost().getText().contains("X")) { + if (card != null && !card.isCreature(game) && card.getManaCost().getText().contains("X")) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/g/GadrakTheCrownScourge.java b/Mage.Sets/src/mage/cards/g/GadrakTheCrownScourge.java index 2fd15a1465..1bc00d3775 100644 --- a/Mage.Sets/src/mage/cards/g/GadrakTheCrownScourge.java +++ b/Mage.Sets/src/mage/cards/g/GadrakTheCrownScourge.java @@ -108,7 +108,7 @@ class GadrakTheCrownScourgeWatcher extends Watcher { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() && zEvent.getTarget() != null - && zEvent.getTarget().isCreature() + && zEvent.getTarget().isCreature(game) && !(zEvent.getTarget() instanceof PermanentToken)) { diedThisTurn++; } diff --git a/Mage.Sets/src/mage/cards/g/GaeasHerald.java b/Mage.Sets/src/mage/cards/g/GaeasHerald.java index 9c7b8a3128..691e7e522f 100644 --- a/Mage.Sets/src/mage/cards/g/GaeasHerald.java +++ b/Mage.Sets/src/mage/cards/g/GaeasHerald.java @@ -75,7 +75,7 @@ class CantCounterEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isCreature()) { + if (spell != null && spell.isCreature(game)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/g/Galvanoth.java b/Mage.Sets/src/mage/cards/g/Galvanoth.java index 5e0228d23c..7be18590ff 100644 --- a/Mage.Sets/src/mage/cards/g/Galvanoth.java +++ b/Mage.Sets/src/mage/cards/g/Galvanoth.java @@ -60,7 +60,7 @@ class GalvanothEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.lookAtCards(source, null, new CardsImpl(card), game); - if (card.isInstantOrSorcery()) { + if (card.isInstantOrSorcery(game)) { if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) { game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE); controller.cast(controller.chooseAbilityForCast(card, game, true), diff --git a/Mage.Sets/src/mage/cards/g/GamePreserve.java b/Mage.Sets/src/mage/cards/g/GamePreserve.java index ae319a795d..cd4a840eaf 100644 --- a/Mage.Sets/src/mage/cards/g/GamePreserve.java +++ b/Mage.Sets/src/mage/cards/g/GamePreserve.java @@ -67,7 +67,7 @@ class DuskmarEffect extends OneShotEffect { Card card = player.getLibrary().removeFromTop(game); if (card != null) { cards.add(card); - if (!card.isCreature()) { + if (!card.isCreature(game)) { putToPlay = false; } player.revealCards(source, "- Revealed by " + player.getName(), cards, game); diff --git a/Mage.Sets/src/mage/cards/g/GargantuanGorilla.java b/Mage.Sets/src/mage/cards/g/GargantuanGorilla.java index 0ccdda8805..8407c642d7 100644 --- a/Mage.Sets/src/mage/cards/g/GargantuanGorilla.java +++ b/Mage.Sets/src/mage/cards/g/GargantuanGorilla.java @@ -126,7 +126,7 @@ class GargantuanGorillaFightEffect extends OneShotEffect { Permanent creature1 = game.getPermanent(getTargetPointer().getFirst(game, source)); // 20110930 - 701.10 if (creature1 != null && sourcePermanent != null) { - if (creature1.isCreature() && sourcePermanent.isCreature()) { + if (creature1.isCreature(game) && sourcePermanent.isCreature(game)) { sourcePermanent.damage(creature1.getPower().getValue(), creature1.getId(), source, game, false, true); creature1.damage(sourcePermanent.getPower().getValue(), sourcePermanent.getId(), source, game, false, true); return true; diff --git a/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java b/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java index 3ed6116d62..8fffa17abc 100644 --- a/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java +++ b/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java @@ -91,7 +91,7 @@ class GargosViciousWatcherTriggeredAbility extends TriggeredAbilityImpl { if (permanent == null || object == null || !permanent.isControlledBy(this.controllerId) - || !permanent.isCreature()) { + || !permanent.isCreature(game)) { return false; } return object instanceof Spell; // must be a type of spell (instant, sorcery, or aura) diff --git a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java index b5aeb3b3fa..5f97faac40 100644 --- a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java +++ b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java @@ -116,7 +116,7 @@ class GarnaTheBloodflameWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { cards.add(event.getTargetId()); } } diff --git a/Mage.Sets/src/mage/cards/g/GarrukSavageHerald.java b/Mage.Sets/src/mage/cards/g/GarrukSavageHerald.java index c8c2e32740..d668ae3abe 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukSavageHerald.java +++ b/Mage.Sets/src/mage/cards/g/GarrukSavageHerald.java @@ -104,7 +104,7 @@ class GarrukSavageHeraldEffect extends OneShotEffect { return false; } player.revealCards(source, new CardsImpl(card), game); - if (card.isCreature()) { + if (card.isCreature(game)) { return player.moveCards(card, Zone.HAND, source, game); } else { return player.putCardsOnBottomOfLibrary(card, game, source, false); diff --git a/Mage.Sets/src/mage/cards/g/GateToTheAether.java b/Mage.Sets/src/mage/cards/g/GateToTheAether.java index 1a64a2a20f..c460cd2635 100644 --- a/Mage.Sets/src/mage/cards/g/GateToTheAether.java +++ b/Mage.Sets/src/mage/cards/g/GateToTheAether.java @@ -62,10 +62,10 @@ class GateToTheAetherEffect extends OneShotEffect { Card card = activePlayer.getLibrary().getFromTop(game); if (card != null) { activePlayer.revealCards("Gate to the Aether", new CardsImpl(card), game); - if (card.isArtifact() - || card.isCreature() - || card.isEnchantment() - || card.isLand()) { + if (card.isArtifact(game) + || card.isCreature(game) + || card.isEnchantment(game) + || card.isLand(game)) { if (activePlayer.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", source, game)) { activePlayer.moveCards(card, Zone.BATTLEFIELD, source, game); } diff --git a/Mage.Sets/src/mage/cards/g/GatherSpecimens.java b/Mage.Sets/src/mage/cards/g/GatherSpecimens.java index 0c0ae278dc..7161d90ef2 100644 --- a/Mage.Sets/src/mage/cards/g/GatherSpecimens.java +++ b/Mage.Sets/src/mage/cards/g/GatherSpecimens.java @@ -71,7 +71,7 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone().match(Zone.BATTLEFIELD)) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.isCreature()) { // TODO: Bestow Card cast as Enchantment probably not handled correctly + if (card != null && card.isCreature(game)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) { return true; @@ -82,7 +82,7 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) { for (Token token : ((CreateTokenEvent) event).getTokens().keySet()) { - if (token.isCreature()) { + if (token.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GauntletsOfChaos.java b/Mage.Sets/src/mage/cards/g/GauntletsOfChaos.java index c6fad29ba8..62b186cb37 100644 --- a/Mage.Sets/src/mage/cards/g/GauntletsOfChaos.java +++ b/Mage.Sets/src/mage/cards/g/GauntletsOfChaos.java @@ -73,7 +73,7 @@ class GauntletsOfChaosFirstTarget extends TargetControlledPermanent { if (super.canTarget(controllerId, id, source, game)) { Set cardTypes = getOpponentPermanentCardTypes(source.getSourceId(), controllerId, game); Permanent permanent = game.getPermanent(id); - for (CardType type : permanent.getCardType()) { + for (CardType type : permanent.getCardType(game)) { if (cardTypes.contains(type)) { return true; } @@ -91,7 +91,7 @@ class GauntletsOfChaosFirstTarget extends TargetControlledPermanent { if (targetSource != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - for (CardType type : permanent.getCardType()) { + for (CardType type : permanent.getCardType(game)) { if (cardTypes.contains(type)) { possibleTargets.add(permanent.getId()); break; @@ -114,7 +114,7 @@ class GauntletsOfChaosFirstTarget extends TargetControlledPermanent { if (controller != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(sourceControllerId, game)) { if (controller.hasOpponent(permanent.getControllerId(), game)) { - cardTypes.addAll(permanent.getCardType()); + cardTypes.addAll(permanent.getCardType(game)); } } } @@ -146,7 +146,7 @@ class GauntletsOfChaosSecondTarget extends TargetPermanent { Permanent target1 = game.getPermanent(source.getFirstTarget()); Permanent opponentPermanent = game.getPermanent(id); if (target1 != null && opponentPermanent != null) { - return target1.shareTypes(opponentPermanent); + return target1.shareTypes(opponentPermanent, game); } } return false; @@ -160,7 +160,7 @@ class GauntletsOfChaosSecondTarget extends TargetPermanent { if (targetSource != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - if (permanent.shareTypes(firstTarget)) { + if (permanent.shareTypes(firstTarget, game)) { possibleTargets.add(permanent.getId()); } } diff --git a/Mage.Sets/src/mage/cards/g/GazeOfGranite.java b/Mage.Sets/src/mage/cards/g/GazeOfGranite.java index dae39139fa..59be636e61 100644 --- a/Mage.Sets/src/mage/cards/g/GazeOfGranite.java +++ b/Mage.Sets/src/mage/cards/g/GazeOfGranite.java @@ -62,7 +62,7 @@ class GazeOfGraniteEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (!permanent.isLand() && permanent.getManaValue() <= source.getManaCostsToPay().getX()) { + if (!permanent.isLand(game) && permanent.getManaValue() <= source.getManaCostsToPay().getX()) { permanent.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/g/GeneralsEnforcer.java b/Mage.Sets/src/mage/cards/g/GeneralsEnforcer.java index 736afab6b8..88e416018e 100644 --- a/Mage.Sets/src/mage/cards/g/GeneralsEnforcer.java +++ b/Mage.Sets/src/mage/cards/g/GeneralsEnforcer.java @@ -87,7 +87,7 @@ class GeneralsEnforcerEffect extends OneShotEffect { if (player == null || card == null) { return false; } - boolean isCreature = card.isCreature(); + boolean isCreature = card.isCreature(game); if (player.moveCards(card, Zone.EXILED, source, game) && isCreature) { token.putOntoBattlefield(1, game, source, source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/g/GeneratorServant.java b/Mage.Sets/src/mage/cards/g/GeneratorServant.java index 31bd03c29f..9b3e06bbc5 100644 --- a/Mage.Sets/src/mage/cards/g/GeneratorServant.java +++ b/Mage.Sets/src/mage/cards/g/GeneratorServant.java @@ -71,7 +71,7 @@ class GeneratorServantWatcher extends Watcher { if (event.getType() == GameEvent.EventType.MANA_PAID) { MageObject target = game.getObject(event.getTargetId()); if (event.getSourceId() != null - && event.getSourceId().equals(this.getSourceId()) && target != null && target.isCreature() && event.getFlag()) { + && event.getSourceId().equals(this.getSourceId()) && target != null && target.isCreature(game) && event.getFlag()) { if (target instanceof Spell) { this.creatures.add(((Spell) target).getCard().getId()); } diff --git a/Mage.Sets/src/mage/cards/g/GenerousPatron.java b/Mage.Sets/src/mage/cards/g/GenerousPatron.java index 07033dc2b8..4395f9bfea 100644 --- a/Mage.Sets/src/mage/cards/g/GenerousPatron.java +++ b/Mage.Sets/src/mage/cards/g/GenerousPatron.java @@ -70,7 +70,7 @@ class GenerousPatronTriggeredAbility extends TriggeredAbilityImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && !permanent.isControlledBy(getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/g/GenesisStorm.java b/Mage.Sets/src/mage/cards/g/GenesisStorm.java index d7b1c6e61d..df1c7d0ffb 100644 --- a/Mage.Sets/src/mage/cards/g/GenesisStorm.java +++ b/Mage.Sets/src/mage/cards/g/GenesisStorm.java @@ -67,7 +67,7 @@ class GenesisStormEffect extends OneShotEffect { Card nonLandCard = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); - if (card.isPermanent() && !card.isLand()) { + if (card.isPermanent(game) && !card.isLand(game)) { nonLandCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/g/Geosurge.java b/Mage.Sets/src/mage/cards/g/Geosurge.java index 272515e400..e79e47e332 100644 --- a/Mage.Sets/src/mage/cards/g/Geosurge.java +++ b/Mage.Sets/src/mage/cards/g/Geosurge.java @@ -52,7 +52,7 @@ class GeosurgeManaCondition implements Condition { public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { Card card = game.getCard(source.getSourceId()); - if (card != null && (card.isArtifact() || card.isCreature())) { + if (card != null && (card.isArtifact(game) || card.isCreature(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GhaltaPrimalHunger.java b/Mage.Sets/src/mage/cards/g/GhaltaPrimalHunger.java index 82d3296a5b..46054ae76f 100644 --- a/Mage.Sets/src/mage/cards/g/GhaltaPrimalHunger.java +++ b/Mage.Sets/src/mage/cards/g/GhaltaPrimalHunger.java @@ -77,7 +77,7 @@ class GhaltaPrimalHungerCostReductionEffect extends CostModificationEffectImpl { public boolean apply(Game game, Ability source, Ability abilityToModify) { int totalPower = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { totalPower += permanent.getPower().getValue(); } diff --git a/Mage.Sets/src/mage/cards/g/GhastlyConscription.java b/Mage.Sets/src/mage/cards/g/GhastlyConscription.java index e02bdef26e..036d42425a 100644 --- a/Mage.Sets/src/mage/cards/g/GhastlyConscription.java +++ b/Mage.Sets/src/mage/cards/g/GhastlyConscription.java @@ -79,7 +79,7 @@ class GhastlyConscriptionEffect extends OneShotEffect { newSource.setWorksFaceDown(true); for (Card card : cardsToManifest) { ManaCosts manaCosts = null; - if (card.isCreature()) { + if (card.isCreature(game)) { manaCosts = card.getSpellAbility().getManaCosts(); if (manaCosts == null) { manaCosts = new ManaCostsImpl("{0}"); diff --git a/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java b/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java index 3d84770511..e110f6619a 100644 --- a/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java +++ b/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java @@ -94,7 +94,7 @@ class GideonTheOathswornTriggeredAbility extends TriggeredAbilityImpl { Set attackers = new HashSet(); for (UUID attackerId : game.getCombat().getAttackers()) { Permanent permanent = game.getPermanent(attackerId); - if (permanent != null && permanent.isCreature() && !permanent.hasSubtype(SubType.GIDEON, game)) { + if (permanent != null && permanent.isCreature(game) && !permanent.hasSubtype(SubType.GIDEON, game)) { attackerCount++; attackers.add(new MageObjectReference(permanent, game)); } diff --git a/Mage.Sets/src/mage/cards/g/GideonsDefeat.java b/Mage.Sets/src/mage/cards/g/GideonsDefeat.java index 8a5dbd19df..3fe0945393 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsDefeat.java +++ b/Mage.Sets/src/mage/cards/g/GideonsDefeat.java @@ -72,7 +72,7 @@ class GideonsDefeatEffect extends OneShotEffect { if (controller != null && permanent != null) { controller.moveCards(permanent, Zone.EXILED, source, game); game.getState().processAction(game); - if (permanent.isPlaneswalker() && permanent.hasSubtype(SubType.GIDEON, game)) { + if (permanent.isPlaneswalker(game) && permanent.hasSubtype(SubType.GIDEON, game)) { controller.gainLife(5, game, source); } return true; diff --git a/Mage.Sets/src/mage/cards/g/GideonsTriumph.java b/Mage.Sets/src/mage/cards/g/GideonsTriumph.java index 8a9cec0d9d..4b395f6d60 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsTriumph.java +++ b/Mage.Sets/src/mage/cards/g/GideonsTriumph.java @@ -89,7 +89,7 @@ enum GideonsTriumphPredicate implements Predicate { @Override public boolean apply(Permanent input, Game game) { GideonsTriumphWatcher watcher = game.getState().getWatcher(GideonsTriumphWatcher.class); - return input.isCreature() && watcher.attackedOrBlockedThisTurn(input, game); + return input.isCreature(game) && watcher.attackedOrBlockedThisTurn(input, game); } } diff --git a/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java b/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java index b8caf5cecc..5218e38613 100644 --- a/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java +++ b/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java @@ -83,7 +83,7 @@ class GisaAndGeralfCastFromGraveyardEffect extends AsThoughEffectImpl { Permanent sourceObject = game.getPermanent(source.getSourceId()); if (sourceObject != null && objectCard != null && objectCard.isOwnedBy(source.getControllerId()) - && objectCard.isCreature() + && objectCard.isCreature(game) && objectCard.hasSubtype(SubType.ZOMBIE, game) && objectCard.getSpellAbility() != null && objectCard.getSpellAbility().spellCanBeActivatedRegularlyNow(affectedControllerId, game)) { diff --git a/Mage.Sets/src/mage/cards/g/Glaciers.java b/Mage.Sets/src/mage/cards/g/Glaciers.java index 6fde0e971d..dfb36138d0 100644 --- a/Mage.Sets/src/mage/cards/g/Glaciers.java +++ b/Mage.Sets/src/mage/cards/g/Glaciers.java @@ -68,7 +68,7 @@ public final class Glaciers extends CardImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent land : game.getBattlefield().getAllActivePermanents(CardType.LAND)) { + for (Permanent land : game.getBattlefield().getAllActivePermanents(CardType.LAND, game)) { switch (layer) { case TypeChangingEffects_4: // the land mana ability is intrinsic, so apply at this layer not layer 6 diff --git a/Mage.Sets/src/mage/cards/g/GladehartCavalry.java b/Mage.Sets/src/mage/cards/g/GladehartCavalry.java index 5a4fcf035b..a1fbc94b2d 100644 --- a/Mage.Sets/src/mage/cards/g/GladehartCavalry.java +++ b/Mage.Sets/src/mage/cards/g/GladehartCavalry.java @@ -14,7 +14,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -75,7 +74,7 @@ class GladehartCavalryTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.isControlledBy(this.getControllerId()) - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getCounters(game).getCount(CounterType.P1P1) > 0) { return true; } diff --git a/Mage.Sets/src/mage/cards/g/GlissaTheTraitor.java b/Mage.Sets/src/mage/cards/g/GlissaTheTraitor.java index 0a6d9f23ef..80cec22216 100644 --- a/Mage.Sets/src/mage/cards/g/GlissaTheTraitor.java +++ b/Mage.Sets/src/mage/cards/g/GlissaTheTraitor.java @@ -17,7 +17,6 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInYourGraveyard; @@ -86,7 +85,7 @@ class GlissaTheTraitorTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent)event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.isCreature() && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { + if (p != null && p.isCreature(game) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/Gloom.java b/Mage.Sets/src/mage/cards/g/Gloom.java index 3e494a0986..5becac7d4d 100644 --- a/Mage.Sets/src/mage/cards/g/Gloom.java +++ b/Mage.Sets/src/mage/cards/g/Gloom.java @@ -71,7 +71,7 @@ class GloomCostIncreaseEffect extends CostModificationEffectImpl { if (isActivated) { MageObject permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null) { - isWhiteEnchantment = permanent.isEnchantment() && permanent.getColor(game).isWhite(); + isWhiteEnchantment = permanent.isEnchantment(game) && permanent.getColor(game).isWhite(); } } return isActivated && isWhiteEnchantment; diff --git a/Mage.Sets/src/mage/cards/g/GlyphKeeper.java b/Mage.Sets/src/mage/cards/g/GlyphKeeper.java index bae48cc9ca..cb9944378e 100644 --- a/Mage.Sets/src/mage/cards/g/GlyphKeeper.java +++ b/Mage.Sets/src/mage/cards/g/GlyphKeeper.java @@ -78,7 +78,7 @@ class GlyphKeeperAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { NumberOfTimesPermanentTargetedATurnWatcher watcher = game.getState().getWatcher(NumberOfTimesPermanentTargetedATurnWatcher.class); if (watcher != null && watcher.notMoreThanOnceTargetedThisTurn(permanent, game)) { diff --git a/Mage.Sets/src/mage/cards/g/GlyphOfLife.java b/Mage.Sets/src/mage/cards/g/GlyphOfLife.java index 7c91d7128d..10f426bee3 100644 --- a/Mage.Sets/src/mage/cards/g/GlyphOfLife.java +++ b/Mage.Sets/src/mage/cards/g/GlyphOfLife.java @@ -77,7 +77,7 @@ class GlyphOfLifeTriggeredAbility extends DelayedTriggeredAbility { if (event.getTargetId().equals(this.getFirstTarget())) { DamagedEvent damageEvent = (DamagedEvent) event; Permanent attackingCreature = game.getPermanentOrLKIBattlefield(damageEvent.getSourceId()); - if (attackingCreature != null && attackingCreature.isCreature() && attackingCreature.isAttacking()) { + if (attackingCreature != null && attackingCreature.isCreature(game) && attackingCreature.isAttacking()) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/cards/g/GnarlrootTrapper.java b/Mage.Sets/src/mage/cards/g/GnarlrootTrapper.java index 458397a3b8..2453f52ae2 100644 --- a/Mage.Sets/src/mage/cards/g/GnarlrootTrapper.java +++ b/Mage.Sets/src/mage/cards/g/GnarlrootTrapper.java @@ -90,7 +90,7 @@ class GnarlrootTrapperManaCondition extends CreatureCastManaCondition { if (super.apply(game, source)) { MageObject object = game.getObject(source.getSourceId()); return object != null && object.hasSubtype(SubType.ELF, game) - && object.isCreature(); + && object.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/g/GoblinArtisans.java b/Mage.Sets/src/mage/cards/g/GoblinArtisans.java index d675fafe7c..3c51f15624 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinArtisans.java +++ b/Mage.Sets/src/mage/cards/g/GoblinArtisans.java @@ -97,7 +97,7 @@ class GoblinArtisansTarget extends TargetSpell { Permanent permanent = ((StackAbility) stackObject).getSourcePermanentOrLKI(game); if (permanent != null && !sourceRef.refersTo(permanent, game) - && permanent.isCreature() + && permanent.isCreature(game) && "Goblin Artisans".equals(permanent.getName()) && stackObject .getStackAbility() diff --git a/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java b/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java index 48df2412ef..4c3cebb581 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java +++ b/Mage.Sets/src/mage/cards/g/GoblinCharbelcher.java @@ -72,7 +72,7 @@ class GoblinCharbelcherEffect extends OneShotEffect { for (Card card : controller.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { landFound = true; if (card.hasSubtype(SubType.MOUNTAIN, game)) { isMountain = true; diff --git a/Mage.Sets/src/mage/cards/g/GoblinGuide.java b/Mage.Sets/src/mage/cards/g/GoblinGuide.java index 402a21b8e3..11747cdd9f 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinGuide.java +++ b/Mage.Sets/src/mage/cards/g/GoblinGuide.java @@ -16,7 +16,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -130,7 +129,7 @@ class GoblinGuideEffect extends OneShotEffect { if (card != null) { Cards cards = new CardsImpl(card); defender.revealCards(sourceObject.getName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { defender.moveCards(card, Zone.HAND, source, game); } } diff --git a/Mage.Sets/src/mage/cards/g/GoblinMachinist.java b/Mage.Sets/src/mage/cards/g/GoblinMachinist.java index 33dc8bea4a..3e81b03652 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinMachinist.java +++ b/Mage.Sets/src/mage/cards/g/GoblinMachinist.java @@ -70,7 +70,7 @@ class GoblinMachinistEffect extends OneShotEffect { for (Card card : controller.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { if (card.getManaValue() > 0) { game.addEffect(new BoostSourceEffect(card.getManaValue(), 0, Duration.EndOfTurn), source); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinWelder.java b/Mage.Sets/src/mage/cards/g/GoblinWelder.java index 816297c771..7cdbbaca99 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinWelder.java +++ b/Mage.Sets/src/mage/cards/g/GoblinWelder.java @@ -112,7 +112,7 @@ public final class GoblinWelder extends CardImpl { } Card card = game.getCard(id); return card != null - && card.isArtifact() + && card.isArtifact(game) && card.isOwnedBy(permanent.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/g/GodEternalKefnet.java b/Mage.Sets/src/mage/cards/g/GodEternalKefnet.java index 9f7b37a5dd..62fd6aa972 100644 --- a/Mage.Sets/src/mage/cards/g/GodEternalKefnet.java +++ b/Mage.Sets/src/mage/cards/g/GodEternalKefnet.java @@ -90,7 +90,7 @@ class GodEternalKefnetDrawCardReplacementEffect extends ReplacementEffectImpl { you.setTopCardRevealed(true); // cast copy - if (topCard.isInstantOrSorcery() + if (topCard.isInstantOrSorcery(game) && you.chooseUse(outcome, "Copy " + topCard.getName() + " and cast it for {2} less?", source, game)) { Card blueprint = topCard.copy(); if (blueprint instanceof SplitCard) { @@ -154,7 +154,7 @@ class GodEternalKefnetDrawCardReplacementEffect extends ReplacementEffectImpl { game.getState().setValue(mark, true); // ask player to reveal top cards - String mes = topCard.getName() + ", " + (topCard.isInstantOrSorcery() + String mes = topCard.getName() + ", " + (topCard.isInstantOrSorcery(game) ? HintUtils.prepareText("you can copy it and cast {2} less", Color.green) : HintUtils.prepareText("you can't copy it", Color.red)); return you.chooseUse(Outcome.Benefit, "Reveal first drawn card (" + mes + ")?", source, game); diff --git a/Mage.Sets/src/mage/cards/g/GoldenGuardian.java b/Mage.Sets/src/mage/cards/g/GoldenGuardian.java index 1314a1e26e..fe45d4b46d 100644 --- a/Mage.Sets/src/mage/cards/g/GoldenGuardian.java +++ b/Mage.Sets/src/mage/cards/g/GoldenGuardian.java @@ -94,7 +94,7 @@ class GoldenGuardianEffect extends OneShotEffect { Permanent creature2 = game.getPermanent(source.getFirstTarget()); // 20110930 - 701.10 if (creature1 != null && creature2 != null) { - if (creature1.isCreature() && creature2.isCreature()) { + if (creature1.isCreature(game) && creature2.isCreature(game)) { return creature1.fight(creature2, source, game); } } diff --git a/Mage.Sets/src/mage/cards/g/GolemsHeart.java b/Mage.Sets/src/mage/cards/g/GolemsHeart.java index 2c8920c8c2..d3c0d8c17a 100644 --- a/Mage.Sets/src/mage/cards/g/GolemsHeart.java +++ b/Mage.Sets/src/mage/cards/g/GolemsHeart.java @@ -10,7 +10,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -60,7 +59,7 @@ class GolemsHeartAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.isArtifact(); + return spell != null && spell.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java b/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java index 5cfae9d44e..ffd0b7369a 100644 --- a/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java +++ b/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java @@ -4,7 +4,6 @@ import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.AsThoughManaEffect; import mage.abilities.effects.ContinuousEffect; @@ -13,7 +12,6 @@ import mage.abilities.keyword.DeathtouchAbility; import mage.cards.*; import mage.constants.*; import mage.filter.FilterCard; -import mage.game.ExileZone; import mage.game.Game; import mage.players.ManaPoolItem; import mage.players.Player; @@ -156,7 +154,7 @@ class GontiLordOfLuxuryCastFromExileEffect extends AsThoughEffectImpl { return false; } Card theCard = game.getCard(objectId); - if (theCard == null || theCard.isLand()) { + if (theCard == null || theCard.isLand(game)) { return false; } objectId = theCard.getMainCard().getId(); // for split cards diff --git a/Mage.Sets/src/mage/cards/g/GorgingVulture.java b/Mage.Sets/src/mage/cards/g/GorgingVulture.java index 1c35c788b6..2369084452 100644 --- a/Mage.Sets/src/mage/cards/g/GorgingVulture.java +++ b/Mage.Sets/src/mage/cards/g/GorgingVulture.java @@ -5,7 +5,6 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -72,7 +71,7 @@ class GorgingVultureEffect extends OneShotEffect { .millCards(4, source, game) .getCards(game) .stream() - .filter(Card::isCreature) + .filter(card1 -> card1.isCreature(game)) .mapToInt(card -> game.getState().getZone(card.getId()) == Zone.GRAVEYARD ? 1 : 0) .sum(); return player.gainLife(lifeToGain, game, source) > 0; diff --git a/Mage.Sets/src/mage/cards/g/GrafdiggersCage.java b/Mage.Sets/src/mage/cards/g/GrafdiggersCage.java index 50a5c8e2fe..d57d0c621e 100644 --- a/Mage.Sets/src/mage/cards/g/GrafdiggersCage.java +++ b/Mage.Sets/src/mage/cards/g/GrafdiggersCage.java @@ -69,7 +69,7 @@ class GrafdiggersCageEffect extends ContinuousRuleModifyingEffectImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD && (zEvent.getFromZone() == Zone.GRAVEYARD || zEvent.getFromZone() == Zone.LIBRARY)) { Card card = game.getCard(zEvent.getTargetId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GrandAbolisher.java b/Mage.Sets/src/mage/cards/g/GrandAbolisher.java index 15fc9fc742..87043a8ced 100644 --- a/Mage.Sets/src/mage/cards/g/GrandAbolisher.java +++ b/Mage.Sets/src/mage/cards/g/GrandAbolisher.java @@ -92,8 +92,8 @@ class GrandAbolisherEffect extends ContinuousRuleModifyingEffectImpl { case ACTIVATE_ABILITY: Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null) { - return permanent.isArtifact() || permanent.isCreature() - || permanent.isEnchantment(); + return permanent.isArtifact(game) || permanent.isCreature(game) + || permanent.isEnchantment(game); } } } diff --git a/Mage.Sets/src/mage/cards/g/GrandArchitect.java b/Mage.Sets/src/mage/cards/g/GrandArchitect.java index 0a8978c699..27dc7d00e9 100644 --- a/Mage.Sets/src/mage/cards/g/GrandArchitect.java +++ b/Mage.Sets/src/mage/cards/g/GrandArchitect.java @@ -141,6 +141,6 @@ class GrandArchitectManaCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - return object != null && object.isArtifact(); + return object != null && object.isArtifact(game); } } diff --git a/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java b/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java index ef0be1c767..14815a5691 100644 --- a/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java +++ b/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java @@ -101,8 +101,8 @@ class GrandMasterOfFlowersEffect extends ContinuousEffectImpl { } switch (layer) { case TypeChangingEffects_4: - permanent.getCardType().clear(); - permanent.getCardType().add(CardType.CREATURE); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); permanent.addSubType(game, SubType.DRAGON); permanent.addSubType(game, SubType.GOD); diff --git a/Mage.Sets/src/mage/cards/g/GratuitousViolence.java b/Mage.Sets/src/mage/cards/g/GratuitousViolence.java index eb60b065e7..f0065a838e 100644 --- a/Mage.Sets/src/mage/cards/g/GratuitousViolence.java +++ b/Mage.Sets/src/mage/cards/g/GratuitousViolence.java @@ -70,7 +70,7 @@ class GratuitousViolenceReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java index 6d1743d6a5..c3b7d8e102 100644 --- a/Mage.Sets/src/mage/cards/g/GraveBetrayal.java +++ b/Mage.Sets/src/mage/cards/g/GraveBetrayal.java @@ -74,7 +74,7 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zoneChangeEvent = (ZoneChangeEvent) event; if (zoneChangeEvent.isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && !permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { + if (permanent != null && !permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(game)) { Card card = (Card) game.getObject(permanent.getId()); if (card != null) { Effect effect = new GraveBetrayalEffect(); diff --git a/Mage.Sets/src/mage/cards/g/GravePact.java b/Mage.Sets/src/mage/cards/g/GravePact.java index 076dd41195..221302a659 100644 --- a/Mage.Sets/src/mage/cards/g/GravePact.java +++ b/Mage.Sets/src/mage/cards/g/GravePact.java @@ -67,7 +67,7 @@ class GravePactTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zoneChangeEvent = (ZoneChangeEvent) event; if (zoneChangeEvent.isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - return permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(); + return permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/g/GraveyardShovel.java b/Mage.Sets/src/mage/cards/g/GraveyardShovel.java index e6e9e9dc9a..a8aae6009b 100644 --- a/Mage.Sets/src/mage/cards/g/GraveyardShovel.java +++ b/Mage.Sets/src/mage/cards/g/GraveyardShovel.java @@ -74,7 +74,7 @@ class GraveyardShovelEffect extends OneShotEffect { return true; } targetPlayer.moveCards(card, Zone.EXILED, source, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.gainLife(2, game, source); } return true; diff --git a/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java b/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java index 9da3f0a5d0..daaa07b860 100644 --- a/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java +++ b/Mage.Sets/src/mage/cards/g/GreatbowDoyen.java @@ -12,7 +12,6 @@ import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -80,7 +79,7 @@ class GreatbowDoyenTriggeredAbility extends TriggeredAbilityImpl { Permanent creature = game.getPermanent(event.getSourceId()); Permanent damagedCreature = game.getPermanent(event.getTargetId()); if (creature != null && damagedCreature != null - && creature.isCreature() + && creature.isCreature(game) && creature.hasSubtype(SubType.ARCHER, game) && creature.isControlledBy(controllerId)) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); diff --git a/Mage.Sets/src/mage/cards/g/GreenDragon.java b/Mage.Sets/src/mage/cards/g/GreenDragon.java index 38d3520e72..620d99f265 100644 --- a/Mage.Sets/src/mage/cards/g/GreenDragon.java +++ b/Mage.Sets/src/mage/cards/g/GreenDragon.java @@ -72,7 +72,7 @@ class GreenDragonDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && game.getOpponents(permanent.getControllerId()).contains(this.getControllerId())) { this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); return true; diff --git a/Mage.Sets/src/mage/cards/g/GrenzoDungeonWarden.java b/Mage.Sets/src/mage/cards/g/GrenzoDungeonWarden.java index ab0dc5887a..bbd3178bc5 100644 --- a/Mage.Sets/src/mage/cards/g/GrenzoDungeonWarden.java +++ b/Mage.Sets/src/mage/cards/g/GrenzoDungeonWarden.java @@ -78,7 +78,7 @@ class GrenzoDungeonWardenEffect extends OneShotEffect { Card card = controller.getLibrary().getFromBottom(game); if (card != null) { controller.moveCards(card, Zone.GRAVEYARD, source, game); - if (card.isCreature()) { + if (card.isCreature(game)) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourcePermanent != null && card.getPower().getValue() <= sourcePermanent.getPower().getValue()) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/g/GridMonitor.java b/Mage.Sets/src/mage/cards/g/GridMonitor.java index c2f7ac14cd..546a264e5c 100644 --- a/Mage.Sets/src/mage/cards/g/GridMonitor.java +++ b/Mage.Sets/src/mage/cards/g/GridMonitor.java @@ -68,7 +68,7 @@ class GridMonitorEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.CAST_SPELL && event.getPlayerId().equals(source.getControllerId())) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.isCreature()) { + if (object != null && object.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GrimContest.java b/Mage.Sets/src/mage/cards/g/GrimContest.java index 29f4ee54f7..69e7b42a21 100644 --- a/Mage.Sets/src/mage/cards/g/GrimContest.java +++ b/Mage.Sets/src/mage/cards/g/GrimContest.java @@ -70,7 +70,7 @@ class GrimContestEffect extends OneShotEffect { Permanent creature1 = game.getPermanent(getTargetPointer().getFirst(game, source)); Permanent creature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget()); if (creature1 != null && creature2 != null) { - if (creature1.isCreature() && creature2.isCreature()) { + if (creature1.isCreature(game) && creature2.isCreature(game)) { creature1.damage(creature2.getToughness().getValue(), creature2.getId(), source, game, false, true); game.informPlayers(creature2.getLogName() + " deals " + creature2.getToughness().getValue() + " damage to " + creature1.getLogName()); creature2.damage(creature1.getToughness().getValue(), creature1.getId(), source, game, false, true); diff --git a/Mage.Sets/src/mage/cards/g/GrimoireOfTheDead.java b/Mage.Sets/src/mage/cards/g/GrimoireOfTheDead.java index aa41a4ca63..b9a809e0e3 100644 --- a/Mage.Sets/src/mage/cards/g/GrimoireOfTheDead.java +++ b/Mage.Sets/src/mage/cards/g/GrimoireOfTheDead.java @@ -76,7 +76,7 @@ class GrimoireOfTheDeadEffect extends OneShotEffect { Set creatureCards = new LinkedHashSet<>(); for (Player player : game.getPlayers().values()) { for (Card card : player.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { creatureCards.add(card); game.addEffect(new GrimoireOfTheDeadEffect2(card.getId()), source); } diff --git a/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java b/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java new file mode 100644 index 0000000000..f27f3dd5d4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java @@ -0,0 +1,179 @@ +package mage.cards.g; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DoWhenCostPaid; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.IzoniInsectToken; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlaneswalker; + +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GristTheHungerTide extends CardImpl { + + private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES); + + public GristTheHungerTide(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{B}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.GRIST); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); + + // As long as Grist, the Hunger Tide isn't on the battlefield, it's a 1/1 Insect creature in addition to its other types. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new GristTheHungerTideTypeEffect())); + + // +1: Create a 1/1 black and green Insect creature token, then mill a card. If an Insect card was milled this way, put a loyalty counter on Grist and repeat this process. + this.addAbility(new LoyaltyAbility(new GristTheHungerTideTokenEffect(), 1)); + + // −2: You may sacrifice a creature. When you do, destroy target creature or planeswalker. + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DestroyTargetEffect(), false, "destroy target creature or planeswalker"); + ability.addTarget(new TargetCreatureOrPlaneswalker()); + this.addAbility(new LoyaltyAbility(new DoWhenCostPaid(ability, new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT)), "Sacrifice a creature?"), -2)); + + // −5: Each opponent loses life equal to the number of creature cards in your graveyard. + this.addAbility(new LoyaltyAbility(new LoseLifeOpponentsEffect(xValue), -5)); + } + + private GristTheHungerTide(final GristTheHungerTide card) { + super(card); + } + + @Override + public GristTheHungerTide copy() { + return new GristTheHungerTide(this); + } + + @Override + public List getCardTypeForDeckbuilding() { + return Arrays.asList(CardType.PLANESWALKER, CardType.CREATURE); + } + + @Override + public boolean hasSubTypeForDeckbuilding(SubType subType) { + return subType == SubType.INSECT || super.hasSubTypeForDeckbuilding(subType); + } +} + +class GristTheHungerTideTypeEffect extends ContinuousEffectImpl { + + GristTheHungerTideTypeEffect() { + super(Duration.Custom, Outcome.Benefit); + staticText = "as long as {this} isn't on the battlefield, " + + "it's a 1/1 Insect creature in addition to its other types"; + } + + private GristTheHungerTideTypeEffect(final GristTheHungerTideTypeEffect effect) { + super(effect); + } + + @Override + public GristTheHungerTideTypeEffect copy() { + return new GristTheHungerTideTypeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + if (game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) { + return false; + } + MageObject sourceObject = game.getCard(source.getSourceId()); + if (sourceObject == null) { + return false; + } + switch (layer) { + case TypeChangingEffects_4: + sourceObject.addCardType(game, CardType.CREATURE); + sourceObject.addSubType(game, SubType.INSECT); + break; + case PTChangingEffects_7: + if (sublayer != SubLayer.SetPT_7b) { + break; + } + sourceObject.getPower().setValue(1); + sourceObject.getToughness().setValue(1); + break; + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7; + } +} + +class GristTheHungerTideTokenEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(SubType.INSECT.getPredicate()); + } + + GristTheHungerTideTokenEffect() { + super(Outcome.Benefit); + staticText = "create a 1/1 black and green Insect creature token, then mill a card. " + + "If an Insect card was milled this way, put a loyalty counter on {this} and repeat this process"; + } + + private GristTheHungerTideTokenEffect(final GristTheHungerTideTokenEffect effect) { + super(effect); + } + + @Override + public GristTheHungerTideTokenEffect copy() { + return new GristTheHungerTideTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getSourceId()); + if (player == null) { + return false; + } + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + Token token = new IzoniInsectToken(); + while (true) { + token.putOntoBattlefield(1, game, source, source.getControllerId()); + if (player.millCards(1, source, game).count(filter, game) < 1) { + break; + } + if (permanent != null) { + permanent.addCounters(CounterType.LOYALTY.createInstance(), source.getControllerId(), source, game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java b/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java index 3a1703b9a1..c048ea8b23 100644 --- a/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java +++ b/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java @@ -181,7 +181,7 @@ class GrothamaAllDevouringWatcher extends Watcher { } UUID damageControllerId = game.getControllerId(event.getSourceId()); Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (damaged == null || !damaged.isCreature() || damageControllerId == null) { + if (damaged == null || !damaged.isCreature(game) || damageControllerId == null) { return; } MageObjectReference mor = new MageObjectReference(damaged, game); diff --git a/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java b/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java index 713b18449d..c2177708c5 100644 --- a/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java +++ b/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java @@ -64,7 +64,7 @@ class GrumgullyTheGenerousReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null - && creature.isCreature() + && creature.isCreature(game) && !source.getSourceId().equals(creature.getId()) && creature.isControlledBy(source.getControllerId()) && !creature.hasSubtype(SubType.HUMAN, game); diff --git a/Mage.Sets/src/mage/cards/g/GruulRagebeast.java b/Mage.Sets/src/mage/cards/g/GruulRagebeast.java index 2f1e85a203..0429477a36 100644 --- a/Mage.Sets/src/mage/cards/g/GruulRagebeast.java +++ b/Mage.Sets/src/mage/cards/g/GruulRagebeast.java @@ -75,7 +75,7 @@ class GruulRagebeastTriggeredAbility extends TriggeredAbilityImpl { if (sourceObject != null && permanent != null && permanent.isControlledBy(this.getControllerId()) - && permanent.isCreature()) { + && permanent.isCreature(game)) { for (Effect effect : this.getEffects()) { if (effect instanceof GruulRagebeastEffect) { effect.setTargetPointer( @@ -117,8 +117,8 @@ class GruulRagebeastEffect extends OneShotEffect { Permanent target = game.getPermanent(source.getFirstTarget()); if (triggeredCreature != null && target != null - && triggeredCreature.isCreature() - && target.isCreature()) { + && triggeredCreature.isCreature(game) + && target.isCreature(game)) { return triggeredCreature.fight(target, source, game); } return false; diff --git a/Mage.Sets/src/mage/cards/g/GuardianBeast.java b/Mage.Sets/src/mage/cards/g/GuardianBeast.java index 505ee233d6..8bc09b6a62 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianBeast.java +++ b/Mage.Sets/src/mage/cards/g/GuardianBeast.java @@ -22,7 +22,6 @@ import mage.filter.common.FilterControlledArtifactPermanent; import mage.filter.predicate.Predicates; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.StackObject; @@ -116,9 +115,9 @@ class GuardianBeastConditionalEffect extends ContinuousRuleModifyingEffectImpl { if (event.getType() == GameEvent.EventType.GAIN_CONTROL || ((event.getType() == GameEvent.EventType.ATTACH || event.getType() == GameEvent.EventType.TARGET) - && spell != null && spell.isEnchantment() && spell.hasSubtype(SubType.AURA, game))) { + && spell != null && spell.isEnchantment(game) && spell.hasSubtype(SubType.AURA, game))) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_ARTIFACTS_NON_CREATURE, source.getControllerId(), game)) { - if (perm != null && Objects.equals(perm.getId(), targetPermanent.getId()) && !perm.isCreature()) { + if (perm != null && Objects.equals(perm.getId(), targetPermanent.getId()) && !perm.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java b/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java index 57fd1a450e..37a7a1e235 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java +++ b/Mage.Sets/src/mage/cards/g/GuardianOfTazeem.java @@ -83,7 +83,7 @@ class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isLand() + && permanent.isLand(game) && permanent.isControlledBy(getControllerId())) { for (Effect effect : getEffects()) { if (effect instanceof GuardianOfTazeemEffect) { diff --git a/Mage.Sets/src/mage/cards/g/GuidingSpirit.java b/Mage.Sets/src/mage/cards/g/GuidingSpirit.java index 657366f43f..f001a1bcd8 100644 --- a/Mage.Sets/src/mage/cards/g/GuidingSpirit.java +++ b/Mage.Sets/src/mage/cards/g/GuidingSpirit.java @@ -75,7 +75,7 @@ class GuidingSpiritEffect extends OneShotEffect { return false; } Card card = player.getGraveyard().getTopCard(game); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { player.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false); } return true; diff --git a/Mage.Sets/src/mage/cards/g/GuildmagesForum.java b/Mage.Sets/src/mage/cards/g/GuildmagesForum.java index e4dc30747f..a8e3f19c65 100644 --- a/Mage.Sets/src/mage/cards/g/GuildmagesForum.java +++ b/Mage.Sets/src/mage/cards/g/GuildmagesForum.java @@ -67,7 +67,7 @@ class GuildmagesForumWatcher extends Watcher { MageObject target = game.getObject(event.getTargetId()); if (event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()) - && target != null && target.isCreature() && target.getColor(game).isMulticolored() + && target != null && target.isCreature(game) && target.getColor(game).isMulticolored() && event.getFlag()) { if (target instanceof Spell) { game.getState().addEffect(new GuildmagesForumEntersBattlefieldEffect( diff --git a/Mage.Sets/src/mage/cards/g/GutterGrime.java b/Mage.Sets/src/mage/cards/g/GutterGrime.java index 5c6105ddfa..f3646f919b 100644 --- a/Mage.Sets/src/mage/cards/g/GutterGrime.java +++ b/Mage.Sets/src/mage/cards/g/GutterGrime.java @@ -15,7 +15,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; @@ -75,7 +74,7 @@ class GutterGrimeTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.isDiesEvent() && permanent.isControlledBy(this.controllerId) && (targetId.equals(this.getSourceId()) - || (permanent.isCreature() + || (permanent.isCreature(game) && !(permanent instanceof PermanentToken)))) { return true; } diff --git a/Mage.Sets/src/mage/cards/g/GyomeMasterChef.java b/Mage.Sets/src/mage/cards/g/GyomeMasterChef.java index 69b4fda07b..eb9764ca01 100644 --- a/Mage.Sets/src/mage/cards/g/GyomeMasterChef.java +++ b/Mage.Sets/src/mage/cards/g/GyomeMasterChef.java @@ -115,7 +115,7 @@ class GyomeMasterChefWatcher extends Watcher { return; } Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent == null || permanent instanceof PermanentToken || !permanent.isCreature()) { + if (permanent == null || permanent instanceof PermanentToken || !permanent.isCreature(game)) { return; } playerMap.compute(event.getPlayerId(), (u, i) -> i != null ? Integer.sum(i, 1) : 1); diff --git a/Mage.Sets/src/mage/cards/h/HalanaKessigRanger.java b/Mage.Sets/src/mage/cards/h/HalanaKessigRanger.java index 5d8003a8b9..7a2babd3bb 100644 --- a/Mage.Sets/src/mage/cards/h/HalanaKessigRanger.java +++ b/Mage.Sets/src/mage/cards/h/HalanaKessigRanger.java @@ -111,7 +111,7 @@ class HalanaKessigRangerDamageEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent1 = mor.getPermanentOrLKIBattlefield(game); Permanent permanent2 = game.getPermanent(source.getFirstTarget()); - if (permanent1 == null || !permanent1.isCreature() || permanent2 == null) { + if (permanent1 == null || !permanent1.isCreature(game) || permanent2 == null) { return false; } permanent2.damage(permanent1.getPower().getValue(), permanent1.getId(), source, game); diff --git a/Mage.Sets/src/mage/cards/h/HaldanAvidArcanist.java b/Mage.Sets/src/mage/cards/h/HaldanAvidArcanist.java index 45662193de..6981d96022 100644 --- a/Mage.Sets/src/mage/cards/h/HaldanAvidArcanist.java +++ b/Mage.Sets/src/mage/cards/h/HaldanAvidArcanist.java @@ -80,7 +80,7 @@ class HaldanAvidArcanistCastFromExileEffect extends AsThoughEffectImpl { || !PakoArcaneRetriever.checkWatcher(affectedControllerId, card, game)) { return false; } - return !card.isCreature() && card.getCounters(game).containsKey(CounterType.FETCH); + return !card.isCreature(game) && card.getCounters(game).containsKey(CounterType.FETCH); } } @@ -117,7 +117,7 @@ class HaldanAvidArcanistSpendAnyManaEffect extends AsThoughEffectImpl implements || !PakoArcaneRetriever.checkWatcher(affectedControllerId, card, game)) { return false; } - return !card.isCreature() && (card.getCounters(game).containsKey(CounterType.FETCH) || zone == Zone.STACK); + return !card.isCreature(game) && (card.getCounters(game).containsKey(CounterType.FETCH) || zone == Zone.STACK); } @Override diff --git a/Mage.Sets/src/mage/cards/h/HallOfGemstone.java b/Mage.Sets/src/mage/cards/h/HallOfGemstone.java index 3d56c1d7b8..41297db54d 100644 --- a/Mage.Sets/src/mage/cards/h/HallOfGemstone.java +++ b/Mage.Sets/src/mage/cards/h/HallOfGemstone.java @@ -125,6 +125,6 @@ class HallOfGemstoneEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - return permanent != null && permanent.isLand(); + return permanent != null && permanent.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/h/HallOfOracles.java b/Mage.Sets/src/mage/cards/h/HallOfOracles.java index 0b7518cf1e..a7006526eb 100644 --- a/Mage.Sets/src/mage/cards/h/HallOfOracles.java +++ b/Mage.Sets/src/mage/cards/h/HallOfOracles.java @@ -1,6 +1,5 @@ package mage.cards.h; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.condition.Condition; @@ -70,6 +69,6 @@ enum HallOfOraclesCondition implements Condition { && watcher.getSpellsCastThisTurn(source.getControllerId()) .stream() .filter(Objects::nonNull) - .anyMatch(MageObject::isInstantOrSorcery); + .anyMatch(spell -> spell.isInstantOrSorcery(game)); } } diff --git a/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java b/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java index df38b39eb8..377f17144e 100644 --- a/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java +++ b/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java @@ -21,7 +21,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -76,7 +75,7 @@ class HallOfTheBanditLordWatcher extends Watcher { MageObject target = game.getObject(event.getTargetId()); if (event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()) - && target != null && target.isCreature() + && target != null && target.isCreature(game) && event.getFlag()) { if (target instanceof Spell) { this.creatures.add(((Spell) target).getCard().getId()); diff --git a/Mage.Sets/src/mage/cards/h/HallowedMoonlight.java b/Mage.Sets/src/mage/cards/h/HallowedMoonlight.java index ee308ab584..7b44377db2 100644 --- a/Mage.Sets/src/mage/cards/h/HallowedMoonlight.java +++ b/Mage.Sets/src/mage/cards/h/HallowedMoonlight.java @@ -82,7 +82,7 @@ class HallowedMoonlightEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { EntersTheBattlefieldEvent entersTheBattlefieldEvent = (EntersTheBattlefieldEvent) event; - if (entersTheBattlefieldEvent.getTarget().isCreature()) { + if (entersTheBattlefieldEvent.getTarget().isCreature(game)) { CreatureWasCastWatcher watcher = game.getState().getWatcher(CreatureWasCastWatcher.class); if (watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId())) { return true; diff --git a/Mage.Sets/src/mage/cards/h/HallsOfMist.java b/Mage.Sets/src/mage/cards/h/HallsOfMist.java index 00a6393e79..6042460d5b 100644 --- a/Mage.Sets/src/mage/cards/h/HallsOfMist.java +++ b/Mage.Sets/src/mage/cards/h/HallsOfMist.java @@ -56,7 +56,7 @@ class CantAttackIfAttackedLastTurnAllEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature(); + return permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/h/HamletbackGoliath.java b/Mage.Sets/src/mage/cards/h/HamletbackGoliath.java index 8f4f05dc46..c72536537b 100644 --- a/Mage.Sets/src/mage/cards/h/HamletbackGoliath.java +++ b/Mage.Sets/src/mage/cards/h/HamletbackGoliath.java @@ -70,7 +70,7 @@ class HamletbackGoliathTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { UUID targetId = event.getTargetId(); Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && !(targetId.equals(this.getSourceId()))) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/h/HamzaGuardianOfArashin.java b/Mage.Sets/src/mage/cards/h/HamzaGuardianOfArashin.java index da92b1ee68..72f66411d2 100644 --- a/Mage.Sets/src/mage/cards/h/HamzaGuardianOfArashin.java +++ b/Mage.Sets/src/mage/cards/h/HamzaGuardianOfArashin.java @@ -99,7 +99,7 @@ class HamzaGuardianOfArashinEffect extends CostModificationEffectImpl { Card sourceCard = game.getCard(abilityToModify.getSourceId()); return sourceCard != null && abilityToModify.isControlledBy(source.getControllerId()) - && sourceCard.isCreature(); + && sourceCard.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/h/HandToHand.java b/Mage.Sets/src/mage/cards/h/HandToHand.java index 6365f9a0c7..8592b589bb 100644 --- a/Mage.Sets/src/mage/cards/h/HandToHand.java +++ b/Mage.Sets/src/mage/cards/h/HandToHand.java @@ -72,7 +72,7 @@ class HandToHandEffect extends ContinuousRuleModifyingEffectImpl { if (game.getPhase().getType() == TurnPhase.COMBAT) { MageObject object = game.getObject(event.getSourceId()); if (event.getType() == GameEvent.EventType.CAST_SPELL) { - if (object != null && object.isInstant()) { + if (object != null && object.isInstant(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/h/HansEriksson.java b/Mage.Sets/src/mage/cards/h/HansEriksson.java index e5e2cf55e3..8b9d8743c6 100644 --- a/Mage.Sets/src/mage/cards/h/HansEriksson.java +++ b/Mage.Sets/src/mage/cards/h/HansEriksson.java @@ -84,7 +84,7 @@ class HansErikssonEffect extends OneShotEffect { return false; } player.revealCards(source, new CardsImpl(card), game); - if (!card.isCreature()) { + if (!card.isCreature(game)) { return player.moveCards(card, Zone.HAND, source, game); } player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); diff --git a/Mage.Sets/src/mage/cards/h/HapatraVizierOfPoisons.java b/Mage.Sets/src/mage/cards/h/HapatraVizierOfPoisons.java index 4fc30f99bd..0213799a5c 100644 --- a/Mage.Sets/src/mage/cards/h/HapatraVizierOfPoisons.java +++ b/Mage.Sets/src/mage/cards/h/HapatraVizierOfPoisons.java @@ -80,7 +80,7 @@ class HapatraVizierOfPoisonsTriggeredAbility extends TriggeredAbilityImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } diff --git a/Mage.Sets/src/mage/cards/h/HappilyEverAfter.java b/Mage.Sets/src/mage/cards/h/HappilyEverAfter.java index 4b542b5a4b..f4f010f7be 100644 --- a/Mage.Sets/src/mage/cards/h/HappilyEverAfter.java +++ b/Mage.Sets/src/mage/cards/h/HappilyEverAfter.java @@ -9,14 +9,12 @@ import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.WinGameSourceControllerEffect; import mage.abilities.hint.Hint; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.TargetController; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; import java.util.*; @@ -106,7 +104,7 @@ enum HappilyEverAfterCondition implements Condition { game.getBattlefield() .getAllActivePermanents(source.getControllerId()) .stream() - .map(Permanent::getCardType) + .map(permanent -> permanent.getCardType(game)) .flatMap(Collection::stream) .forEach(cardTypeEnumSet::add); if (cardTypeEnumSet.size() >= 6) { @@ -115,7 +113,7 @@ enum HappilyEverAfterCondition implements Condition { player.getGraveyard() .getCards(game) .stream() - .map(Card::getCardType) + .map(card -> card.getCardType(game)) .flatMap(Collection::stream) .forEach(cardTypeEnumSet::add); return cardTypeEnumSet.size() >= 6; @@ -178,13 +176,13 @@ enum HappilyEverAfterCardTypeHint implements Hint { game.getBattlefield() .getAllActivePermanents(ability.getControllerId()) .stream() - .map(Permanent::getCardType) + .map(permanent -> permanent.getCardType(game)) .flatMap(Collection::stream) .forEach(cardTypeSet::add); player.getGraveyard() .getCards(game) .stream() - .map(Card::getCardType) + .map(card -> card.getCardType(game)) .flatMap(Collection::stream) .forEach(cardTypeSet::add); if (cardTypeSet.isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/h/HardenedScales.java b/Mage.Sets/src/mage/cards/h/HardenedScales.java index 5360f15e6a..9fbbd80b02 100644 --- a/Mage.Sets/src/mage/cards/h/HardenedScales.java +++ b/Mage.Sets/src/mage/cards/h/HardenedScales.java @@ -12,7 +12,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import java.util.UUID; @@ -70,7 +69,7 @@ class HardenedScalesEffect extends ReplacementEffectImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature(); + && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/h/HarshDeceiver.java b/Mage.Sets/src/mage/cards/h/HarshDeceiver.java index 28954f110a..8b7a253b78 100644 --- a/Mage.Sets/src/mage/cards/h/HarshDeceiver.java +++ b/Mage.Sets/src/mage/cards/h/HarshDeceiver.java @@ -81,7 +81,7 @@ class HarshDeceiverEffect extends OneShotEffect { if (card != null) { Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { new UntapSourceEffect().apply(game, source); game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), source); } diff --git a/Mage.Sets/src/mage/cards/h/HarshMentor.java b/Mage.Sets/src/mage/cards/h/HarshMentor.java index 963e5b4fa6..a00fdb3b5a 100644 --- a/Mage.Sets/src/mage/cards/h/HarshMentor.java +++ b/Mage.Sets/src/mage/cards/h/HarshMentor.java @@ -14,7 +14,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; import mage.target.targetpointer.FixedTarget; @@ -71,7 +70,7 @@ class HarshMentorTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (!event.getPlayerId().equals(getControllerId())) { Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (source != null && (source.isArtifact() || source.isCreature() || source.isLand())) { + if (source != null && (source.isArtifact(game) || source.isCreature(game) || source.isLand(game))) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (!(stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl)) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/h/HarvestMage.java b/Mage.Sets/src/mage/cards/h/HarvestMage.java index c2549dd0e8..3bc13c5fed 100644 --- a/Mage.Sets/src/mage/cards/h/HarvestMage.java +++ b/Mage.Sets/src/mage/cards/h/HarvestMage.java @@ -99,7 +99,7 @@ class HarvestMageReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return filter.match(permanent, game); } return false; diff --git a/Mage.Sets/src/mage/cards/h/HatefulEidolon.java b/Mage.Sets/src/mage/cards/h/HatefulEidolon.java index bfe608dbdf..a615cf25fc 100644 --- a/Mage.Sets/src/mage/cards/h/HatefulEidolon.java +++ b/Mage.Sets/src/mage/cards/h/HatefulEidolon.java @@ -81,7 +81,7 @@ class HatefulEidolonTriggeredAbility extends TriggeredAbilityImpl { for (UUID auraId : deadCreature.getAttachments()) { Permanent attachment = game.getPermanentOrLKIBattlefield(auraId); if (attachment.getControllerId().equals(controllerId) - && attachment.isEnchantment()) { // Shadowspear or any other equipment does not count + && attachment.isEnchantment(game)) { // Shadowspear or any other equipment does not count auraCount += 1; } } diff --git a/Mage.Sets/src/mage/cards/h/HauntingEchoes.java b/Mage.Sets/src/mage/cards/h/HauntingEchoes.java index 1fe9a2e261..f4529b8e01 100644 --- a/Mage.Sets/src/mage/cards/h/HauntingEchoes.java +++ b/Mage.Sets/src/mage/cards/h/HauntingEchoes.java @@ -64,7 +64,7 @@ class HauntingEchoesEffect extends OneShotEffect { .getCards(game) .stream() .filter(Objects::nonNull) - .filter(card -> !card.isBasic() || !card.isLand()) + .filter(card -> !card.isBasic() || !card.isLand(game)) .forEach(cards::add); controller.moveCards(cards, Zone.EXILED, source, game); cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.EXILED); diff --git a/Mage.Sets/src/mage/cards/h/HauntingWind.java b/Mage.Sets/src/mage/cards/h/HauntingWind.java index 0b57f2bbdd..8cbf2d35d8 100644 --- a/Mage.Sets/src/mage/cards/h/HauntingWind.java +++ b/Mage.Sets/src/mage/cards/h/HauntingWind.java @@ -63,7 +63,7 @@ class HauntingWindTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent == null || !permanent.isArtifact()) { + if (permanent == null || !permanent.isArtifact(game)) { return false; } StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); @@ -81,7 +81,7 @@ class HauntingWindTriggeredAbility extends TriggeredAbilityImpl { } if (event.getType() == GameEvent.EventType.TAPPED) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent == null || !permanent.isArtifact()) { + if (permanent == null || !permanent.isArtifact(game)) { return false; } for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java b/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java index 328a862904..5dc1de2f5c 100644 --- a/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java +++ b/Mage.Sets/src/mage/cards/h/HavenOfTheSpiritDragon.java @@ -98,7 +98,7 @@ class HavenOfTheSpiritManaCondition extends CreatureCastManaCondition { if (super.apply(game, source)) { MageObject object = game.getObject(source.getSourceId()); if (object != null && object.hasSubtype(SubType.DRAGON, game) - && object.isCreature()) { + && object.isCreature(game)) { return true; } } @@ -113,7 +113,7 @@ class DragonCreatureCardPredicate implements Predicate { @Override public boolean apply(Card input, Game game) { - return input.isCreature() + return input.isCreature(game) && input.hasSubtype(SubType.DRAGON, game); } @@ -130,7 +130,7 @@ class UginPlaneswalkerCardPredicate implements Predicate { @Override public boolean apply(Card input, Game game) { - return input.isPlaneswalker() + return input.isPlaneswalker(game) && input.hasSubtype(SubType.UGIN, game); } diff --git a/Mage.Sets/src/mage/cards/h/Heartstone.java b/Mage.Sets/src/mage/cards/h/Heartstone.java index 6024309318..3444fbd614 100644 --- a/Mage.Sets/src/mage/cards/h/Heartstone.java +++ b/Mage.Sets/src/mage/cards/h/Heartstone.java @@ -7,14 +7,12 @@ import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; import java.util.UUID; -import mage.Mana; /** * @author pcasaretto_at_gmail.com @@ -75,7 +73,7 @@ class HeartstoneEffect extends CostModificationEffectImpl { && (abilityToModify instanceof ActivatedAbility))) { // Activated abilities of creatures Permanent permanent = game.getPermanentOrLKIBattlefield(abilityToModify.getSourceId()); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/h/HeartwoodStoryteller.java b/Mage.Sets/src/mage/cards/h/HeartwoodStoryteller.java index 4ed9e311fe..7bf41a049a 100644 --- a/Mage.Sets/src/mage/cards/h/HeartwoodStoryteller.java +++ b/Mage.Sets/src/mage/cards/h/HeartwoodStoryteller.java @@ -15,7 +15,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -69,7 +68,7 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && !spell.isCreature()) { + if (spell != null && !spell.isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/h/HeatStroke.java b/Mage.Sets/src/mage/cards/h/HeatStroke.java index 132252e7f9..a24d538a28 100644 --- a/Mage.Sets/src/mage/cards/h/HeatStroke.java +++ b/Mage.Sets/src/mage/cards/h/HeatStroke.java @@ -73,7 +73,7 @@ class HeatStrokeEffect extends OneShotEffect { for (MageObjectReference mor : toDestroy) { Permanent permanent = mor.getPermanent(game); - if (permanent != null && permanent.isCreature() && inROI.contains(permanent)){ + if (permanent != null && permanent.isCreature(game) && inROI.contains(permanent)){ permanent.destroy(source, game, false); toRet = true; } diff --git a/Mage.Sets/src/mage/cards/h/HedonistsTrove.java b/Mage.Sets/src/mage/cards/h/HedonistsTrove.java index a101b8fd71..b74a635823 100644 --- a/Mage.Sets/src/mage/cards/h/HedonistsTrove.java +++ b/Mage.Sets/src/mage/cards/h/HedonistsTrove.java @@ -107,7 +107,7 @@ class HedonistsTrovePlayLandEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Card cardToCheck = game.getCard(objectId); - if (cardToCheck == null || !cardToCheck.isLand() || !source.isControlledBy(affectedControllerId)) { + if (cardToCheck == null || !cardToCheck.isLand(game) || !source.isControlledBy(affectedControllerId)) { return false; } ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source)); @@ -146,7 +146,7 @@ class HedonistsTroveCastNonlandCardsEffect extends AsThoughEffectImpl { Card cardToCheck = game.getCard(objectId); ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source)); return cardToCheck != null - && !cardToCheck.isLand() + && !cardToCheck.isLand(game) && source.isControlledBy(affectedControllerId) && exileZone != null && exileZone.contains(cardToCheck.getMainCard()); diff --git a/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java b/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java index 9e3bc541d4..766ff6e246 100644 --- a/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java +++ b/Mage.Sets/src/mage/cards/h/HedronFieldPurists.java @@ -90,7 +90,7 @@ class HedronFieldPuristsEffect extends PreventionEffectImpl { if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId())) { + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/h/HeirloomBlade.java b/Mage.Sets/src/mage/cards/h/HeirloomBlade.java index c7e5275e9f..1bf90d759d 100644 --- a/Mage.Sets/src/mage/cards/h/HeirloomBlade.java +++ b/Mage.Sets/src/mage/cards/h/HeirloomBlade.java @@ -82,7 +82,7 @@ class HeirloomBladeEffect extends OneShotEffect { Cards otherCards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { revealed.add(card); - if (card != null && card.isCreature() && equipped.shareCreatureTypes(game, card)) { + if (card != null && card.isCreature(game) && equipped.shareCreatureTypes(game, card)) { controller.moveCardToHandWithInfo(card, source, game, true); break; } else { diff --git a/Mage.Sets/src/mage/cards/h/HiddenPredators.java b/Mage.Sets/src/mage/cards/h/HiddenPredators.java index 238b72434f..85b798e1cb 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenPredators.java +++ b/Mage.Sets/src/mage/cards/h/HiddenPredators.java @@ -66,7 +66,7 @@ class HiddenPredatorsStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkInterveningIfClause(Game game) { if (getSourcePermanentIfItStillExists(game) != null) { - return getSourcePermanentIfItStillExists(game).isEnchantment(); + return getSourcePermanentIfItStillExists(game).isEnchantment(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/h/HiddenRetreat.java b/Mage.Sets/src/mage/cards/h/HiddenRetreat.java index 7cf7ab8744..7dd07f57e6 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenRetreat.java +++ b/Mage.Sets/src/mage/cards/h/HiddenRetreat.java @@ -71,6 +71,6 @@ class HiddenRetreatEffect extends PreventionEffectImpl { && game.getObject(source.getFirstTarget()) != null && game.getObject(event.getSourceId()) != null && game.getObject(source.getFirstTarget()).equals(game.getObject(event.getSourceId())) - && game.getObject(source.getFirstTarget()).isInstantOrSorcery()); + && game.getObject(source.getFirstTarget()).isInstantOrSorcery(game)); } } diff --git a/Mage.Sets/src/mage/cards/h/HintOfInsanity.java b/Mage.Sets/src/mage/cards/h/HintOfInsanity.java index 5054c06ac0..e236b81163 100644 --- a/Mage.Sets/src/mage/cards/h/HintOfInsanity.java +++ b/Mage.Sets/src/mage/cards/h/HintOfInsanity.java @@ -76,7 +76,7 @@ class HintOfInsanityEffect extends OneShotEffect { .getCards(game) .stream() .filter(Objects::nonNull) - .filter(card -> !card.isLand()) + .filter(card -> !card.isLand(game)) .filter(card -> nameCounts.getOrDefault(card.getName(), 0) > 1) .collect(Collectors.toSet()) ); diff --git a/Mage.Sets/src/mage/cards/h/HiveMind.java b/Mage.Sets/src/mage/cards/h/HiveMind.java index e843af5c84..047f8c6d7d 100644 --- a/Mage.Sets/src/mage/cards/h/HiveMind.java +++ b/Mage.Sets/src/mage/cards/h/HiveMind.java @@ -64,8 +64,8 @@ class HiveMindTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isInstant() - || spell.isSorcery())) { + if (spell != null && (spell.isInstant(game) + || spell.isSorcery(game))) { for (Effect effect : getEffects()) { if (effect instanceof HiveMindEffect) { effect.setTargetPointer(new FixedTarget(spell.getId())); diff --git a/Mage.Sets/src/mage/cards/h/HixusPrisonWarden.java b/Mage.Sets/src/mage/cards/h/HixusPrisonWarden.java index 07c43b86ce..d6d498a2d0 100644 --- a/Mage.Sets/src/mage/cards/h/HixusPrisonWarden.java +++ b/Mage.Sets/src/mage/cards/h/HixusPrisonWarden.java @@ -91,7 +91,7 @@ class HixusPrisonWardenTriggeredAbility extends TriggeredAbilityImpl { if (damageEvent.getPlayerId().equals(getControllerId()) && damageEvent.isCombatDamage() && sourcePermanent != null - && sourcePermanent.isCreature()) { + && sourcePermanent.isCreature(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); return true; } diff --git a/Mage.Sets/src/mage/cards/h/HolisticWisdom.java b/Mage.Sets/src/mage/cards/h/HolisticWisdom.java index 6300db8c46..4e4dd5a403 100644 --- a/Mage.Sets/src/mage/cards/h/HolisticWisdom.java +++ b/Mage.Sets/src/mage/cards/h/HolisticWisdom.java @@ -74,10 +74,10 @@ class HolisticWisdomEffect extends OneShotEffect { if (cost instanceof ExileFromHandCost) { List cardtypes = new ArrayList<>(); ExileFromHandCost exileCost = (ExileFromHandCost) cost; - for (CardType cardtype : exileCost.getCards().get(0).getCardType()) { + for (CardType cardtype : exileCost.getCards().get(0).getCardType(game)) { cardtypes.add(cardtype); } - for (CardType cardtype : card.getCardType()) { + for (CardType cardtype : card.getCardType(game)) { if (cardtypes.contains(cardtype)) { Effect effect = new ReturnToHandTargetEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); diff --git a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java index a5346bb0ec..f9a870d5b4 100644 --- a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java +++ b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java @@ -21,7 +21,6 @@ import mage.filter.predicate.ObjectSourcePlayerPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; import mage.game.stack.StackObject; import mage.players.Player; @@ -107,7 +106,7 @@ class HopeOfGhirapurCantCastEffect extends ContinuousRuleModifyingEffectImpl { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null && player.getId().equals(event.getPlayerId())) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isCreature()) { + if (card != null && !card.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/h/HorobiDeathsWail.java b/Mage.Sets/src/mage/cards/h/HorobiDeathsWail.java index 15a1986aeb..6b23543391 100644 --- a/Mage.Sets/src/mage/cards/h/HorobiDeathsWail.java +++ b/Mage.Sets/src/mage/cards/h/HorobiDeathsWail.java @@ -73,7 +73,7 @@ class HorobiDeathsWailAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent creature = game.getPermanent(event.getTargetId()); - if (creature != null && creature.isCreature()) { + if (creature != null && creature.isCreature(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java b/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java index a6ccf14b7f..011b9b4bc0 100644 --- a/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java +++ b/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java @@ -79,7 +79,7 @@ class HowlOfTheHordeDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/h/HumOfTheRadix.java b/Mage.Sets/src/mage/cards/h/HumOfTheRadix.java index c603c516cb..adb9333440 100644 --- a/Mage.Sets/src/mage/cards/h/HumOfTheRadix.java +++ b/Mage.Sets/src/mage/cards/h/HumOfTheRadix.java @@ -65,7 +65,7 @@ class HumOfTheRadixCostIncreaseEffect extends CostModificationEffectImpl { return false; } Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); - return spellCard != null && spellCard.isArtifact(); + return spellCard != null && spellCard.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/h/HuntersInsight.java b/Mage.Sets/src/mage/cards/h/HuntersInsight.java index c15b511947..1baa658a7e 100644 --- a/Mage.Sets/src/mage/cards/h/HuntersInsight.java +++ b/Mage.Sets/src/mage/cards/h/HuntersInsight.java @@ -101,7 +101,7 @@ class HuntersInsightTriggeredAbility extends DelayedTriggeredAbility { return false; } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && !permanent.isPlaneswalker()) { + if (permanent != null && !permanent.isPlaneswalker(game)) { return false; } this.getEffects().clear(); diff --git a/Mage.Sets/src/mage/cards/h/Hushbringer.java b/Mage.Sets/src/mage/cards/h/Hushbringer.java index 76e83933fb..868fbef763 100644 --- a/Mage.Sets/src/mage/cards/h/Hushbringer.java +++ b/Mage.Sets/src/mage/cards/h/Hushbringer.java @@ -90,7 +90,7 @@ class HushbringerEffect extends ContinuousRuleModifyingEffectImpl { return false; } - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } return (((TriggeredAbility) ability).checkTrigger(event, game)); diff --git a/Mage.Sets/src/mage/cards/h/HushwingGryff.java b/Mage.Sets/src/mage/cards/h/HushwingGryff.java index dc73889a68..6dacad7ea2 100644 --- a/Mage.Sets/src/mage/cards/h/HushwingGryff.java +++ b/Mage.Sets/src/mage/cards/h/HushwingGryff.java @@ -90,7 +90,7 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl { Ability ability = (Ability) getValue("targetAbility"); if (ability != null && ability.getAbilityType() == AbilityType.TRIGGERED) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return (((TriggeredAbility) ability).checkTrigger(event, game)); } } diff --git a/Mage.Sets/src/mage/cards/i/IchneumonDruid.java b/Mage.Sets/src/mage/cards/i/IchneumonDruid.java index 079dfdf2c6..50ee9925cc 100644 --- a/Mage.Sets/src/mage/cards/i/IchneumonDruid.java +++ b/Mage.Sets/src/mage/cards/i/IchneumonDruid.java @@ -17,7 +17,6 @@ import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; import mage.watchers.Watcher; @@ -73,7 +72,7 @@ class IchneumonDruidAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (!event.getPlayerId().equals(controllerId)) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstant()) { + if (spell != null && spell.isInstant(game)) { IchneumonDruidWatcher watcher = game.getState().getWatcher(IchneumonDruidWatcher.class); if (watcher != null && watcher.moreThanTwoInstantsCast(event.getPlayerId(), game)) { for (Effect effect : getEffects()) { @@ -105,7 +104,7 @@ class IchneumonDruidWatcher extends Watcher { if (event.getType() == GameEvent.EventType.SPELL_CAST) { UUID playerId = event.getPlayerId(); Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstant()) { + if (spell != null && spell.isInstant(game)) { playerInstantCount.putIfAbsent(event.getPlayerId(), 0); playerInstantCount.compute(playerId, (k, v) -> v + 1); } diff --git a/Mage.Sets/src/mage/cards/i/IdolOfEndurance.java b/Mage.Sets/src/mage/cards/i/IdolOfEndurance.java index c11171f6e3..e23c609a88 100644 --- a/Mage.Sets/src/mage/cards/i/IdolOfEndurance.java +++ b/Mage.Sets/src/mage/cards/i/IdolOfEndurance.java @@ -224,7 +224,7 @@ class IdolOfEnduranceCastFromExileEffect extends AsThoughEffectImpl { return false; } Card card = game.getCard(sourceId); - if (card == null || !card.isCreature() || card.isLand()) { + if (card == null || !card.isCreature(game) || card.isLand(game)) { return false; } return allowCardToPlayWithoutMana(sourceId, source, affectedControllerId, game); diff --git a/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java b/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java index 335c00ecb5..c81b3b2cd2 100644 --- a/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java +++ b/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java @@ -16,7 +16,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -79,7 +78,7 @@ class IkraShidiqiTheUsurperTriggeredAbility extends TriggeredAbilityImpl { DamagedEvent damageEvent = (DamagedEvent) event; if (damageEvent.isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isCreature() && permanent.isControlledBy(this.getControllerId())) { + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) { this.getEffects().clear(); this.getEffects().add(new GainLifeEffect(permanent.getToughness().getValue())); return true; diff --git a/Mage.Sets/src/mage/cards/i/IllunaApexOfWishes.java b/Mage.Sets/src/mage/cards/i/IllunaApexOfWishes.java index 8251d17684..03f84f37c2 100644 --- a/Mage.Sets/src/mage/cards/i/IllunaApexOfWishes.java +++ b/Mage.Sets/src/mage/cards/i/IllunaApexOfWishes.java @@ -79,7 +79,7 @@ class IllunaApexOfWishesEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (card == null || card.isLand() || !card.isPermanent()) { + if (card == null || card.isLand(game) || !card.isPermanent(game)) { continue; } permCard = card; diff --git a/Mage.Sets/src/mage/cards/i/IllusionaryTerrain.java b/Mage.Sets/src/mage/cards/i/IllusionaryTerrain.java index cc1535af07..ef07e66981 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionaryTerrain.java +++ b/Mage.Sets/src/mage/cards/i/IllusionaryTerrain.java @@ -21,8 +21,6 @@ import mage.choices.ChoiceBasicLandType; import mage.choices.ChoiceImpl; import mage.constants.*; -import static mage.constants.Layer.TypeChangingEffects_4; - import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -79,7 +77,7 @@ class IllusionaryTerrainEffect extends ContinuousEffectImpl { Player controller = game.getPlayer(source.getControllerId()); SubType firstChoice = SubType.byDescription((String) game.getState().getValue(source.getSourceId().toString() + "firstChoice")); SubType secondChoice = SubType.byDescription((String) game.getState().getValue(source.getSourceId().toString() + "secondChoice")); - List lands = game.getBattlefield().getAllActivePermanents(CardType.LAND); + List lands = game.getBattlefield().getAllActivePermanents(CardType.LAND, game); if (controller != null && firstChoice != null && secondChoice != null) { diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java index 0f09869fd7..b7c678c7ae 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java @@ -175,7 +175,7 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect { // planeswalker Permanent permanent = game.getPermanent(defenderId); return permanent == null || !permanent.isControlledBy(source.getControllerId()) - || !permanent.isPlaneswalker(); + || !permanent.isPlaneswalker(game); } @Override diff --git a/Mage.Sets/src/mage/cards/i/ImmolationShaman.java b/Mage.Sets/src/mage/cards/i/ImmolationShaman.java index f7bc1ddca0..bfac0a745f 100644 --- a/Mage.Sets/src/mage/cards/i/ImmolationShaman.java +++ b/Mage.Sets/src/mage/cards/i/ImmolationShaman.java @@ -90,7 +90,7 @@ class ImmolationShamanTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (!event.getPlayerId().equals(getControllerId())) { Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (source != null && (source.isArtifact() || source.isCreature() || source.isLand())) { + if (source != null && (source.isArtifact(game) || source.isCreature(game) || source.isLand(game))) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (!(stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl)) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/i/ImmortalServitude.java b/Mage.Sets/src/mage/cards/i/ImmortalServitude.java index 5704d4df4a..a9361aff59 100644 --- a/Mage.Sets/src/mage/cards/i/ImmortalServitude.java +++ b/Mage.Sets/src/mage/cards/i/ImmortalServitude.java @@ -63,7 +63,7 @@ class ImmortalServitudeEffect extends OneShotEffect { int count = source.getManaCostsToPay().getX(); Set cards = you.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game); cards.removeIf(Objects::isNull); - cards.removeIf(card -> !card.isCreature()); + cards.removeIf(card -> !card.isCreature(game)); cards.removeIf(card -> card.getManaValue() != count); return you.moveCards(cards, Zone.BATTLEFIELD, source, game); } diff --git a/Mage.Sets/src/mage/cards/i/ImposingSovereign.java b/Mage.Sets/src/mage/cards/i/ImposingSovereign.java index b9431f7417..0d3b5b03c1 100644 --- a/Mage.Sets/src/mage/cards/i/ImposingSovereign.java +++ b/Mage.Sets/src/mage/cards/i/ImposingSovereign.java @@ -72,7 +72,7 @@ class ImposingSovereignEffect extends ReplacementEffectImpl { return false; } Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/i/Imprison.java b/Mage.Sets/src/mage/cards/i/Imprison.java index 58ec6d922d..82d8cddc00 100644 --- a/Mage.Sets/src/mage/cards/i/Imprison.java +++ b/Mage.Sets/src/mage/cards/i/Imprison.java @@ -25,7 +25,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.combat.CombatGroup; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.StackAbility; import mage.target.TargetPermanent; @@ -134,7 +133,7 @@ class ImprisonUnblockEffect extends OneShotEffect { if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); if (permanent != null) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { // Tap the creature permanent.tap(source, game); diff --git a/Mage.Sets/src/mage/cards/i/ImprisonedInTheMoon.java b/Mage.Sets/src/mage/cards/i/ImprisonedInTheMoon.java index 40abc9d361..85e73d1adf 100644 --- a/Mage.Sets/src/mage/cards/i/ImprisonedInTheMoon.java +++ b/Mage.Sets/src/mage/cards/i/ImprisonedInTheMoon.java @@ -95,8 +95,8 @@ class ImprisonedInTheMoonEffect extends ContinuousEffectImpl { // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects // So the ability removing has to be done before Layer 6 permanent.removeAllAbilities(source.getSourceId(), game); - permanent.getCardType().clear(); - permanent.addCardType(CardType.LAND); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.LAND); permanent.retainAllLandSubTypes(game); break; case ColorChangingEffects_5: diff --git a/Mage.Sets/src/mage/cards/i/ImpulsiveWager.java b/Mage.Sets/src/mage/cards/i/ImpulsiveWager.java index d7717a3372..acd922344e 100644 --- a/Mage.Sets/src/mage/cards/i/ImpulsiveWager.java +++ b/Mage.Sets/src/mage/cards/i/ImpulsiveWager.java @@ -63,7 +63,7 @@ class ImpulsiveWagerEffect extends OneShotEffect { DiscardCardCost cost = (DiscardCardCost) source.getCosts().get(0); if (cost != null) { List cards = cost.getCards(); - if (cards.size() == 1 && cards.get(0).isLand()) { + if (cards.size() == 1 && cards.get(0).isLand(game)) { Effect effect = new AddCountersTargetEffect(CounterType.BOUNTY.createInstance()); effect.setTargetPointer(getTargetPointer()); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java b/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java index 3d911d0f44..679e186ad3 100644 --- a/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java +++ b/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java @@ -104,7 +104,7 @@ class IndomitableCreativityEffect extends OneShotEffect { Cards cardsToReaveal = new CardsImpl(); for (Card card : library.getCards(game)) { cardsToReaveal.add(card); - if (card.isCreature() || card.isArtifact()) { + if (card.isCreature(game) || card.isArtifact(game)) { controllerOfDestroyedCreature.moveCards(card, Zone.EXILED, source, game); controllerOfDestroyedCreature.moveCards(card, Zone.BATTLEFIELD, source, game); break; diff --git a/Mage.Sets/src/mage/cards/i/InfernalDarkness.java b/Mage.Sets/src/mage/cards/i/InfernalDarkness.java index 4819d857f6..991a7315ec 100644 --- a/Mage.Sets/src/mage/cards/i/InfernalDarkness.java +++ b/Mage.Sets/src/mage/cards/i/InfernalDarkness.java @@ -20,7 +20,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.players.Player; @@ -141,6 +140,6 @@ class InfernalDarknessReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { MageObject mageObject = game.getPermanentOrLKIBattlefield(event.getSourceId()); - return mageObject != null && mageObject.isLand(); + return mageObject != null && mageObject.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/i/InfernoProject.java b/Mage.Sets/src/mage/cards/i/InfernoProject.java index b99734de10..28fa26a08b 100644 --- a/Mage.Sets/src/mage/cards/i/InfernoProject.java +++ b/Mage.Sets/src/mage/cards/i/InfernoProject.java @@ -71,7 +71,7 @@ enum InfernoProjectValue implements DynamicValue { .getCards(game) .stream() .filter(Objects::nonNull) - .filter(MageObject::isInstantOrSorcery) + .filter(card -> card.isInstantOrSorcery(game)) .mapToInt(MageObject::getManaValue) .sum(); } diff --git a/Mage.Sets/src/mage/cards/i/InfernoTrap.java b/Mage.Sets/src/mage/cards/i/InfernoTrap.java index 180e1399f7..16153c7ab5 100644 --- a/Mage.Sets/src/mage/cards/i/InfernoTrap.java +++ b/Mage.Sets/src/mage/cards/i/InfernoTrap.java @@ -80,7 +80,7 @@ class InfernoTrapWatcher extends Watcher { if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(controllerId)) { Permanent damageBy = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (damageBy != null && damageBy.isCreature()) { + if (damageBy != null && damageBy.isCreature(game)) { Set damagingCreatures = playerDamagedByCreature.getOrDefault(event.getTargetId(), new HashSet<>()); MageObjectReference damagingCreature = new MageObjectReference(damageBy, game); diff --git a/Mage.Sets/src/mage/cards/i/InfiniteReflection.java b/Mage.Sets/src/mage/cards/i/InfiniteReflection.java index abfa9b58ba..7c5c6d6f0e 100644 --- a/Mage.Sets/src/mage/cards/i/InfiniteReflection.java +++ b/Mage.Sets/src/mage/cards/i/InfiniteReflection.java @@ -118,7 +118,7 @@ class InfiniteReflectionEntersBattlefieldEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); return permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature() + && permanent.isCreature(game) && !(permanent instanceof PermanentToken); } diff --git a/Mage.Sets/src/mage/cards/i/InkTreaderNephilim.java b/Mage.Sets/src/mage/cards/i/InkTreaderNephilim.java index a0703ce003..499978e3e2 100644 --- a/Mage.Sets/src/mage/cards/i/InkTreaderNephilim.java +++ b/Mage.Sets/src/mage/cards/i/InkTreaderNephilim.java @@ -75,7 +75,7 @@ class InkTreaderNephilimTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { getEffects().setValue("triggeringSpell", spell); return true; } diff --git a/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java b/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java index 4bcc5a445a..783f84ef55 100644 --- a/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java +++ b/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java @@ -91,8 +91,8 @@ class NonArtifactCreaturesDiedWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() && zEvent.getTarget() != null - && zEvent.getTarget().isCreature() - && !zEvent.getTarget().isArtifact()) { + && zEvent.getTarget().isCreature(game) + && !zEvent.getTarget().isArtifact(game)) { condition = true; } } diff --git a/Mage.Sets/src/mage/cards/i/Insist.java b/Mage.Sets/src/mage/cards/i/Insist.java index 82799af6e0..68bc2c4508 100644 --- a/Mage.Sets/src/mage/cards/i/Insist.java +++ b/Mage.Sets/src/mage/cards/i/Insist.java @@ -112,7 +112,7 @@ class InsistWatcher extends Watcher { if (event.getType() == GameEvent.EventType.SPELL_CAST && ready) { if (uncounterableSpell == null && event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isCreature())) { + if (spell != null && (spell.isCreature(game))) { uncounterableSpell = spell.getId(); ready = false; } diff --git a/Mage.Sets/src/mage/cards/i/Insurrection.java b/Mage.Sets/src/mage/cards/i/Insurrection.java index 408c74e9da..f1ce3e979f 100644 --- a/Mage.Sets/src/mage/cards/i/Insurrection.java +++ b/Mage.Sets/src/mage/cards/i/Insurrection.java @@ -62,7 +62,7 @@ class InsurrectionEffect extends OneShotEffect { boolean result = false; ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfTurn); ContinuousEffect gainHaste = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - for (Permanent creature : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(CardType.CREATURE, game)) { creature.untap(game); gainControl.setTargetPointer(new FixedTarget(creature.getId())); gainHaste.setTargetPointer(new FixedTarget(creature.getId())); diff --git a/Mage.Sets/src/mage/cards/i/Interdict.java b/Mage.Sets/src/mage/cards/i/Interdict.java index 26d4692eb7..1b50fd7595 100644 --- a/Mage.Sets/src/mage/cards/i/Interdict.java +++ b/Mage.Sets/src/mage/cards/i/Interdict.java @@ -64,10 +64,10 @@ class InterdictPredicate implements Predicate { if (input instanceof StackAbility && ((StackAbility) input).getAbilityType() == AbilityType.ACTIVATED) { MageObject sourceObject = ((StackAbility) input).getSourceObject(game); if (sourceObject != null) { - return (sourceObject.isArtifact() - || sourceObject.isEnchantment() - || sourceObject.isCreature() - || sourceObject.isLand()); + return (sourceObject.isArtifact(game) + || sourceObject.isEnchantment(game) + || sourceObject.isCreature(game) + || sourceObject.isLand(game)); } } return false; diff --git a/Mage.Sets/src/mage/cards/i/InterplanarBeacon.java b/Mage.Sets/src/mage/cards/i/InterplanarBeacon.java index 465be4256b..d47a6c5484 100644 --- a/Mage.Sets/src/mage/cards/i/InterplanarBeacon.java +++ b/Mage.Sets/src/mage/cards/i/InterplanarBeacon.java @@ -89,6 +89,6 @@ class InterplanarBeaconManaCondition implements Condition { public boolean apply(Game game, Ability source) { MageObject object = source.getSourceObject(game); return object instanceof Spell - && object.isPlaneswalker(); + && object.isPlaneswalker(game); } } diff --git a/Mage.Sets/src/mage/cards/i/IntoTheWilds.java b/Mage.Sets/src/mage/cards/i/IntoTheWilds.java index 41a68c9304..1f4b63bdbd 100644 --- a/Mage.Sets/src/mage/cards/i/IntoTheWilds.java +++ b/Mage.Sets/src/mage/cards/i/IntoTheWilds.java @@ -66,7 +66,7 @@ class IntoTheWildsEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.lookAtCards(source, "", new CardsImpl(card), game); - if (card.isLand()) { + if (card.isLand(game)) { String message = "Put " + card.getName() + " onto the battlefield?"; if (controller.chooseUse(outcome, message, source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/i/InvokePrejudice.java b/Mage.Sets/src/mage/cards/i/InvokePrejudice.java index e3cea30c48..54a182e823 100644 --- a/Mage.Sets/src/mage/cards/i/InvokePrejudice.java +++ b/Mage.Sets/src/mage/cards/i/InvokePrejudice.java @@ -66,7 +66,7 @@ class InvokePrejudiceTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell != null && spell.isCreature()) { + if (spell != null && spell.isCreature(game)) { boolean creatureSharesAColor = false; ObjectColor spellColor = spell.getColor(game); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterControlledCreaturePermanent(), getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/cards/i/IronscaleHydra.java b/Mage.Sets/src/mage/cards/i/IronscaleHydra.java index b9c8cfd6fb..6f35e66091 100644 --- a/Mage.Sets/src/mage/cards/i/IronscaleHydra.java +++ b/Mage.Sets/src/mage/cards/i/IronscaleHydra.java @@ -70,7 +70,7 @@ class IronscaleHydraEffect extends PreventionEffectImpl { return false; } Permanent damageSource = game.getPermanent(event.getSourceId()); - return damageSource != null && damageSource.isCreature(); + return damageSource != null && damageSource.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/i/IsolatedWatchtower.java b/Mage.Sets/src/mage/cards/i/IsolatedWatchtower.java index e4e0f63bdb..b5ee2b6b6f 100644 --- a/Mage.Sets/src/mage/cards/i/IsolatedWatchtower.java +++ b/Mage.Sets/src/mage/cards/i/IsolatedWatchtower.java @@ -84,7 +84,7 @@ class IsolatedWatchtowerEffect extends OneShotEffect { } Card card = player.getLibrary().getFromTop(game); player.revealCards(source, new CardsImpl(card), game); - if (card.isBasic() && card.isLand()) { + if (card.isBasic() && card.isLand(game)) { player.moveCards( card, Zone.BATTLEFIELD, source, game, true, false, true, null diff --git a/Mage.Sets/src/mage/cards/i/IsolationCell.java b/Mage.Sets/src/mage/cards/i/IsolationCell.java index 0c80e461e9..ef996b1f8b 100644 --- a/Mage.Sets/src/mage/cards/i/IsolationCell.java +++ b/Mage.Sets/src/mage/cards/i/IsolationCell.java @@ -65,7 +65,7 @@ class IsolationCellTriggeredAbility extends TriggeredAbilityImpl { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Card card = game.getCard(event.getSourceId()); if (card != null - && card.isCreature()) { + && card.isCreature(game)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/cards/j/JadziOracleOfArcavios.java b/Mage.Sets/src/mage/cards/j/JadziOracleOfArcavios.java index f44089be34..0fa53272ab 100644 --- a/Mage.Sets/src/mage/cards/j/JadziOracleOfArcavios.java +++ b/Mage.Sets/src/mage/cards/j/JadziOracleOfArcavios.java @@ -109,7 +109,7 @@ class JadziOracleOfArcaviosEffect extends OneShotEffect { return false; } player.revealCards(source, new CardsImpl(card), game); - if (card.isLand()) { + if (card.isLand(game)) { return player.moveCards(card, Zone.BATTLEFIELD, source, game); } if (!player.chooseUse(outcome, "Cast " + card.getName() + " by paying {1}?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/j/JeskaiInfiltrator.java b/Mage.Sets/src/mage/cards/j/JeskaiInfiltrator.java index e81677b99e..e70a5dd390 100644 --- a/Mage.Sets/src/mage/cards/j/JeskaiInfiltrator.java +++ b/Mage.Sets/src/mage/cards/j/JeskaiInfiltrator.java @@ -99,7 +99,7 @@ class JeskaiInfiltratorEffect extends OneShotEffect { //the Set will mimic the Shuffling exileZone.getCards(game).forEach(card -> { ManaCosts manaCosts = null; - if (card.isCreature()) { + if (card.isCreature(game)) { manaCosts = card.getSpellAbility().getManaCosts(); if (manaCosts == null) { manaCosts = new ManaCostsImpl("{0}"); diff --git a/Mage.Sets/src/mage/cards/j/JourneyForTheElixir.java b/Mage.Sets/src/mage/cards/j/JourneyForTheElixir.java index 3051f4f118..659918ec2b 100644 --- a/Mage.Sets/src/mage/cards/j/JourneyForTheElixir.java +++ b/Mage.Sets/src/mage/cards/j/JourneyForTheElixir.java @@ -3,7 +3,6 @@ package mage.cards.j; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; @@ -123,13 +122,13 @@ class JourneyForTheElixirLibraryTarget extends TargetCardInLibrary { } Cards cards = new CardsImpl(this.getTargets()); if (card.isBasic() - && card.isLand() + && card.isLand(game) && cards .getCards(game) .stream() .filter(Objects::nonNull) .filter(MageObject::isBasic) - .anyMatch(MageObject::isLand)) { + .anyMatch(card1 -> card1.isLand(game))) { return false; } if (name.equals(card.getName()) @@ -186,13 +185,13 @@ class JourneyForTheElixirGraveyardTarget extends TargetCardInYourGraveyard { .getCards(game) .stream() .filter(Objects::nonNull) - .filter(MageObject::isLand) + .filter(card1 -> card1.isLand(game)) .anyMatch(MageObject::isBasic); possibleTargets.removeIf(uuid -> { Card card = game.getCard(uuid); return card != null && hasBasic - && card.isLand() + && card.isLand(game) && card.isBasic(); }); boolean hasYanggu = alreadyTargeted diff --git a/Mage.Sets/src/mage/cards/j/Justice.java b/Mage.Sets/src/mage/cards/j/Justice.java index 72342d4c48..0b2dc989fb 100644 --- a/Mage.Sets/src/mage/cards/j/Justice.java +++ b/Mage.Sets/src/mage/cards/j/Justice.java @@ -16,7 +16,6 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -75,7 +74,7 @@ class JusticeTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).isRed()) { - if (sourceObject instanceof Permanent && sourceObject.isCreature() + if (sourceObject instanceof Permanent && sourceObject.isCreature(game) || sourceObject instanceof Spell) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId()))); diff --git a/Mage.Sets/src/mage/cards/k/KadenaSlinkingSorcerer.java b/Mage.Sets/src/mage/cards/k/KadenaSlinkingSorcerer.java index 00c25107f6..acd3d4a7a4 100644 --- a/Mage.Sets/src/mage/cards/k/KadenaSlinkingSorcerer.java +++ b/Mage.Sets/src/mage/cards/k/KadenaSlinkingSorcerer.java @@ -101,7 +101,7 @@ class KadenaSlinkingSorcererWatcher extends Watcher { return; } Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell == null || !spell.isCreature() || !spell.isFaceDown(game)) { + if (spell == null || !spell.isCreature(game) || !spell.isFaceDown(game)) { return; } castFaceDown.add(event.getPlayerId()); diff --git a/Mage.Sets/src/mage/cards/k/KaheeraTheOrphanguard.java b/Mage.Sets/src/mage/cards/k/KaheeraTheOrphanguard.java index 5220c04e96..c6c0b3580d 100644 --- a/Mage.Sets/src/mage/cards/k/KaheeraTheOrphanguard.java +++ b/Mage.Sets/src/mage/cards/k/KaheeraTheOrphanguard.java @@ -1,7 +1,6 @@ package mage.cards.k; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.BoostAllEffect; @@ -92,14 +91,14 @@ enum KaheeraTheOrphanguardCompanionCondition implements CompanionCondition { SubType.BEAST ); - private static boolean checkTypes(Card card) { - return subtypes.stream().anyMatch(subtype -> card.hasSubtype(subtype, null)); + private static boolean isCardLegal(Card card) { + return subtypes.stream().anyMatch(card::hasSubTypeForDeckbuilding); } @Override public boolean isLegal(Set deck, int startingSize) { return deck.stream() - .filter(MageObject::isCreature) - .allMatch(KaheeraTheOrphanguardCompanionCondition::checkTypes); + .filter(card -> card.hasCardTypeForDeckbuilding(CardType.CREATURE)) + .allMatch(KaheeraTheOrphanguardCompanionCondition::isCardLegal); } } diff --git a/Mage.Sets/src/mage/cards/k/KalainReclusivePainter.java b/Mage.Sets/src/mage/cards/k/KalainReclusivePainter.java index 2e9f11c270..69ee7b4fc0 100644 --- a/Mage.Sets/src/mage/cards/k/KalainReclusivePainter.java +++ b/Mage.Sets/src/mage/cards/k/KalainReclusivePainter.java @@ -74,7 +74,7 @@ class KalainReclusivePainterEffect extends ReplacementEffectImpl { return creature != null && !creature.getId().equals(source.getSourceId()) && creature.isControlledBy(source.getControllerId()) - && creature.isCreature(); + && creature.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KalamaxTheStormsire.java b/Mage.Sets/src/mage/cards/k/KalamaxTheStormsire.java index 3d6a039102..3397237f61 100644 --- a/Mage.Sets/src/mage/cards/k/KalamaxTheStormsire.java +++ b/Mage.Sets/src/mage/cards/k/KalamaxTheStormsire.java @@ -1,7 +1,6 @@ package mage.cards.k; import mage.MageInt; -import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.Effect; @@ -75,9 +74,9 @@ class KalamaxTheStormsireSpellCastAbility extends SpellCastControllerTriggeredAb SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class); if (watcher != null) { List spells = watcher.getSpellsCastThisTurn(event.getPlayerId()); - if (spells != null && spells.stream().filter(MageObject::isInstant).count() == 1) { + if (spells != null && spells.stream().filter(spell1 -> spell1.isInstant(game)).count() == 1) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstant()) { + if (spell != null && spell.isInstant(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } @@ -121,7 +120,7 @@ class KalamaxTheStormsireCopyTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getSpell(event.getTargetId()); - return spell != null && spell.isControlledBy(getControllerId()) && spell.isInstant(); + return spell != null && spell.isControlledBy(getControllerId()) && spell.isInstant(game); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java b/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java index 5d1723c60c..03e404c4fb 100644 --- a/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java +++ b/Mage.Sets/src/mage/cards/k/KalitasTraitorOfGhet.java @@ -120,10 +120,10 @@ class KalitasTraitorOfGhetEffect extends ReplacementEffectImpl { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId()) && !(permanent instanceof PermanentToken)) { if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield - if (zEvent.getTarget().isCreature()) { + if (zEvent.getTarget().isCreature(game)) { return true; } - } else if (permanent.isCreature()) { + } else if (permanent.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java index ad828b3935..ee268fd63c 100644 --- a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java +++ b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java @@ -125,7 +125,7 @@ class KaradorGhostChieftainCastFromGraveyardEffect extends AsThoughEffectImpl { if (objectCard != null && sourceObject != null && objectCard.isOwnedBy(source.getControllerId()) - && objectCard.isCreature() + && objectCard.isCreature(game) && objectCard.getSpellAbility() != null && objectCard.getSpellAbility().spellCanBeActivatedRegularlyNow(affectedControllerId, game)) { KaradorGhostChieftainWatcher watcher diff --git a/Mage.Sets/src/mage/cards/k/KarfellHarbinger.java b/Mage.Sets/src/mage/cards/k/KarfellHarbinger.java index ead6a8cfe0..1130d6edb6 100644 --- a/Mage.Sets/src/mage/cards/k/KarfellHarbinger.java +++ b/Mage.Sets/src/mage/cards/k/KarfellHarbinger.java @@ -76,7 +76,7 @@ class KarfellHarbingerManaCondition extends ManaCondition implements Condition { public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - return object != null && object.isInstantOrSorcery(); + return object != null && object.isInstantOrSorcery(game); } return source instanceof ForetellAbility; } diff --git a/Mage.Sets/src/mage/cards/k/KarmicJustice.java b/Mage.Sets/src/mage/cards/k/KarmicJustice.java index 768ba931f3..548b8d629f 100644 --- a/Mage.Sets/src/mage/cards/k/KarmicJustice.java +++ b/Mage.Sets/src/mage/cards/k/KarmicJustice.java @@ -13,7 +13,6 @@ import mage.filter.FilterPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.Target; import mage.target.TargetPermanent; @@ -66,7 +65,7 @@ class KarmicJusticeTriggeredAbility extends TriggeredAbilityImpl { if (event.getPlayerId().equals(controllerId) && game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) { MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (!mageObject.isCreature()) { + if (!mageObject.isCreature(game)) { this.getTargets().clear(); FilterPermanent filter = new FilterPermanent("target permanent that opponent controls"); filter.add(new ControllerIdPredicate(game.getControllerId(event.getSourceId()))); diff --git a/Mage.Sets/src/mage/cards/k/KarnLiberated.java b/Mage.Sets/src/mage/cards/k/KarnLiberated.java index b614f8a9b5..f9fb4e0cfd 100644 --- a/Mage.Sets/src/mage/cards/k/KarnLiberated.java +++ b/Mage.Sets/src/mage/cards/k/KarnLiberated.java @@ -86,7 +86,7 @@ class KarnLiberatedEffect extends OneShotEffect { if (zone.getId().equals(exileId)) { for (Card card : zone.getCards(game)) { if (!card.hasSubtype(SubType.AURA, game) - && card.isPermanent()) { + && card.isPermanent(game)) { cards.add(card); } } diff --git a/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java b/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java index d84895174f..6a92f4ac25 100644 --- a/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java +++ b/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java @@ -81,8 +81,8 @@ class KarnSilverGolemEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!artifact.isCreature()) { - artifact.addCardType(CardType.CREATURE); + if (!artifact.isCreature(game)) { + artifact.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java b/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java index 8f85098a32..9a25f54331 100644 --- a/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java +++ b/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java @@ -76,7 +76,7 @@ class KarnTheGreatCreatorCantActivateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isArtifact() && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId()); + return permanent.isArtifact(game) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId()); } @Override @@ -116,8 +116,8 @@ class KarnTheGreatCreatorAnimateEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!artifact.isCreature()) { - artifact.addCardType(CardType.CREATURE); + if (!artifact.isCreature(game)) { + artifact.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/k/KarnsTouch.java b/Mage.Sets/src/mage/cards/k/KarnsTouch.java index 4353daac74..f619af90fb 100644 --- a/Mage.Sets/src/mage/cards/k/KarnsTouch.java +++ b/Mage.Sets/src/mage/cards/k/KarnsTouch.java @@ -72,11 +72,11 @@ class KarnsTouchEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!artifact.isArtifact()) { - artifact.addCardType(CardType.ARTIFACT); + if (!artifact.isArtifact(game)) { + artifact.addCardType(game, CardType.ARTIFACT); } - if (!artifact.isCreature()) { - artifact.addCardType(CardType.CREATURE); + if (!artifact.isCreature(game)) { + artifact.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/k/KasminaEnigmaticMentor.java b/Mage.Sets/src/mage/cards/k/KasminaEnigmaticMentor.java index fb2e41862b..1d88da9af4 100644 --- a/Mage.Sets/src/mage/cards/k/KasminaEnigmaticMentor.java +++ b/Mage.Sets/src/mage/cards/k/KasminaEnigmaticMentor.java @@ -94,7 +94,7 @@ class KasminaEnigmaticMentorCostModificationEffect extends CostModificationEffec if (allTargets.stream() .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(permanent -> !isTargetCompatible(permanent, source))) { + .anyMatch(permanent -> !isTargetCompatible(permanent, source, game))) { return false; } ; @@ -103,13 +103,13 @@ class KasminaEnigmaticMentorCostModificationEffect extends CostModificationEffec return allTargets.stream() .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(permanent -> isTargetCompatible(permanent, source)); + .anyMatch(permanent -> isTargetCompatible(permanent, source, game)); } - private boolean isTargetCompatible(Permanent permanent, Ability source) { + private boolean isTargetCompatible(Permanent permanent, Ability source, Game game) { // target a creature or planeswalker you control return permanent.isControlledBy(source.getControllerId()) - && (permanent.isCreature() || permanent.isPlaneswalker()); + && (permanent.isCreature(game) || permanent.isPlaneswalker(game)); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KatabaticWinds.java b/Mage.Sets/src/mage/cards/k/KatabaticWinds.java index 5fb7065a2d..c3e29e029d 100644 --- a/Mage.Sets/src/mage/cards/k/KatabaticWinds.java +++ b/Mage.Sets/src/mage/cards/k/KatabaticWinds.java @@ -120,7 +120,7 @@ class KatabaticWindsRuleModifyingEffect extends ContinuousRuleModifyingEffectImp Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); return ability.isPresent() && object != null - && object.isCreature() + && object.isCreature(game) && object.getAbilities().contains(FlyingAbility.getInstance()) && game.getState().getPlayersInRange(source.getControllerId(), game).contains(event.getPlayerId()) && ability.get().hasTapCost(); diff --git a/Mage.Sets/src/mage/cards/k/KayaOrzhovUsurper.java b/Mage.Sets/src/mage/cards/k/KayaOrzhovUsurper.java index dd8eb03591..5b9dc2e380 100644 --- a/Mage.Sets/src/mage/cards/k/KayaOrzhovUsurper.java +++ b/Mage.Sets/src/mage/cards/k/KayaOrzhovUsurper.java @@ -99,7 +99,7 @@ class KayaOrzhovUsurperExileEffect extends OneShotEffect { } player.moveCards(cards, Zone.EXILED, source, game); for (Card card : cards.getCards(game)) { - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { player.gainLife(2, game, source); break; } diff --git a/Mage.Sets/src/mage/cards/k/KazaRoilChaser.java b/Mage.Sets/src/mage/cards/k/KazaRoilChaser.java index faef776560..1beb5ca09d 100644 --- a/Mage.Sets/src/mage/cards/k/KazaRoilChaser.java +++ b/Mage.Sets/src/mage/cards/k/KazaRoilChaser.java @@ -117,7 +117,7 @@ class KazaRoilChaserEffect extends CostModificationEffectImpl { return false; } Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); - return spellCard != null && spellCard.isInstantOrSorcery(); + return spellCard != null && spellCard.isInstantOrSorcery(game); } @Override @@ -140,7 +140,7 @@ class KazaRoilChaserWatcher extends Watcher { return; } Spell spell = game.getSpell(event.getSourceId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { playerMap.compute(event.getPlayerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java b/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java index ac9021f9df..bb100be098 100644 --- a/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java +++ b/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java @@ -82,7 +82,7 @@ class KazarovSengirPurebloodTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); return permanent!=null - && permanent.isCreature() + && permanent.isCreature(game) && game.getOpponents(permanent.getControllerId()).contains(this.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/k/KelsFightFixer.java b/Mage.Sets/src/mage/cards/k/KelsFightFixer.java index 3762736bc8..eec62911cf 100644 --- a/Mage.Sets/src/mage/cards/k/KelsFightFixer.java +++ b/Mage.Sets/src/mage/cards/k/KelsFightFixer.java @@ -84,7 +84,7 @@ class KelsFightFixerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java b/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java index 27270c0729..b6889b7b0a 100644 --- a/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java +++ b/Mage.Sets/src/mage/cards/k/KeranosGodOfStorms.java @@ -19,7 +19,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetAnyTarget; @@ -105,7 +104,7 @@ class KeranosGodOfStormsTriggeredAbility extends TriggeredAbilityImpl { controller.revealCards(sourcePermanent.getIdName(), new CardsImpl(card), game); this.getTargets().clear(); this.getEffects().clear(); - if (card.isLand()) { + if (card.isLand(game)) { this.addEffect(new DrawCardSourceControllerEffect(1)); } else { this.addEffect(new DamageTargetEffect(3)); diff --git a/Mage.Sets/src/mage/cards/k/KessDissidentMage.java b/Mage.Sets/src/mage/cards/k/KessDissidentMage.java index c14a4f08da..b448fce6e6 100644 --- a/Mage.Sets/src/mage/cards/k/KessDissidentMage.java +++ b/Mage.Sets/src/mage/cards/k/KessDissidentMage.java @@ -87,7 +87,7 @@ class KessDissidentMageCastFromGraveyardEffect extends AsThoughEffectImpl { } Card card = game.getCard(objectId); if (card == null - || !card.isInstantOrSorcery() + || !card.isInstantOrSorcery(game) || !game.getState().getZone(objectId).equals(Zone.GRAVEYARD) || !card.isOwnedBy(source.getControllerId())) { return false; diff --git a/Mage.Sets/src/mage/cards/k/KianneDeanOfSubstance.java b/Mage.Sets/src/mage/cards/k/KianneDeanOfSubstance.java index 2dd530f0e1..3ea00ec138 100644 --- a/Mage.Sets/src/mage/cards/k/KianneDeanOfSubstance.java +++ b/Mage.Sets/src/mage/cards/k/KianneDeanOfSubstance.java @@ -108,7 +108,7 @@ class KianneDeanOfSubstanceExileEffect extends OneShotEffect { return false; } player.moveCards(card, Zone.EXILED, source, game); - if (card.isLand()) { + if (card.isLand(game)) { return player.moveCards(card, Zone.HAND, source, game); } return card.getMainCard().addCounters( diff --git a/Mage.Sets/src/mage/cards/k/KillerInstinct.java b/Mage.Sets/src/mage/cards/k/KillerInstinct.java index 8cc5340b58..424d621eaa 100644 --- a/Mage.Sets/src/mage/cards/k/KillerInstinct.java +++ b/Mage.Sets/src/mage/cards/k/KillerInstinct.java @@ -82,7 +82,7 @@ class KillerInstinctEffect extends OneShotEffect { return false; } player.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); - if (card.isCreature() && player.moveCards(card, Zone.BATTLEFIELD, source, game)) { + if (card.isCreature(game) && player.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { FixedTarget ft = new FixedTarget(permanent, game); diff --git a/Mage.Sets/src/mage/cards/k/KillianInkDuelist.java b/Mage.Sets/src/mage/cards/k/KillianInkDuelist.java index 81594d6127..919045c436 100644 --- a/Mage.Sets/src/mage/cards/k/KillianInkDuelist.java +++ b/Mage.Sets/src/mage/cards/k/KillianInkDuelist.java @@ -1,7 +1,6 @@ package mage.cards.k; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; @@ -76,7 +75,7 @@ class KillianInkDuelistEffect extends CostModificationEffectImpl { .stream() .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(MageObject::isCreature)) { + .anyMatch(permanent -> permanent.isCreature(game))) { CardUtil.reduceCost(abilityToModify, 2); } // Check selected targets on actual cast @@ -84,7 +83,7 @@ class KillianInkDuelistEffect extends CostModificationEffectImpl { .stream() .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(MageObject::isCreature)) { + .anyMatch(permanent -> permanent.isCreature(game))) { CardUtil.reduceCost(abilityToModify, 2); } return true; diff --git a/Mage.Sets/src/mage/cards/k/KinjallisSunwing.java b/Mage.Sets/src/mage/cards/k/KinjallisSunwing.java index 5bbb7303f8..6f06f3eb83 100644 --- a/Mage.Sets/src/mage/cards/k/KinjallisSunwing.java +++ b/Mage.Sets/src/mage/cards/k/KinjallisSunwing.java @@ -78,7 +78,7 @@ class KinjallisSunwingEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java index 806fcb6a48..dafd0b930d 100644 --- a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java +++ b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java @@ -130,8 +130,8 @@ class KioraRevealEffect extends OneShotEffect { controller.revealCards(sourceObject.getName(), cards, game); - boolean creatureCardFound = cards.getCards(game).stream().anyMatch(Card::isCreature); - boolean landCardFound = cards.getCards(game).stream().anyMatch(Card::isLand); + boolean creatureCardFound = cards.getCards(game).stream().anyMatch(card -> card.isCreature(game)); + boolean landCardFound = cards.getCards(game).stream().anyMatch(card -> card.isLand(game)); if (!creatureCardFound && !landCardFound) { controller.moveCards(cards, Zone.GRAVEYARD, source, game); diff --git a/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java index 209ce1f90d..eb2d7f3252 100644 --- a/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java +++ b/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java @@ -15,7 +15,6 @@ import mage.constants.*; import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.watchers.common.NumberOfTimesPermanentTargetedATurnWatcher; @@ -81,7 +80,7 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { NumberOfTimesPermanentTargetedATurnWatcher watcher = game.getState().getWatcher(NumberOfTimesPermanentTargetedATurnWatcher.class); if (watcher != null && watcher.notMoreThanOnceTargetedThisTurn(permanent, game)) { for (Effect effect : getEffects()) { diff --git a/Mage.Sets/src/mage/cards/k/Kismet.java b/Mage.Sets/src/mage/cards/k/Kismet.java index cb814e9a40..7d4e907210 100644 --- a/Mage.Sets/src/mage/cards/k/Kismet.java +++ b/Mage.Sets/src/mage/cards/k/Kismet.java @@ -14,7 +14,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -69,9 +68,9 @@ class KismetEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && (permanent.isArtifact() - || permanent.isCreature() - || permanent.isLand())) { + if (permanent != null && (permanent.isArtifact(game) + || permanent.isCreature(game) + || permanent.isLand(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/k/KlothysGodOfDestiny.java b/Mage.Sets/src/mage/cards/k/KlothysGodOfDestiny.java index 19b964740a..b18b1b92dc 100644 --- a/Mage.Sets/src/mage/cards/k/KlothysGodOfDestiny.java +++ b/Mage.Sets/src/mage/cards/k/KlothysGodOfDestiny.java @@ -82,7 +82,7 @@ class KlothysGodOfDestinyEffect extends OneShotEffect { if (player == null || card == null) { return false; } - boolean isLand = card.isLand(); + boolean isLand = card.isLand(game); player.moveCards(card, Zone.EXILED, source, game); if (isLand) { Mana mana = new Mana(); diff --git a/Mage.Sets/src/mage/cards/k/KnightsCharge.java b/Mage.Sets/src/mage/cards/k/KnightsCharge.java index 31d33c18a2..0b3b78a4e0 100644 --- a/Mage.Sets/src/mage/cards/k/KnightsCharge.java +++ b/Mage.Sets/src/mage/cards/k/KnightsCharge.java @@ -8,7 +8,6 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeOpponentsEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; @@ -80,7 +79,7 @@ class KnightsChargeEffect extends OneShotEffect { player.getGraveyard() .getCards(game) .stream() - .filter(Card::isCreature) + .filter(card1 -> card1.isCreature(game)) .filter(card -> card.hasSubtype(SubType.KNIGHT, game)) .collect(Collectors.toSet()) ), Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/k/KollTheForgemaster.java b/Mage.Sets/src/mage/cards/k/KollTheForgemaster.java index 86c30a4676..74980457ea 100644 --- a/Mage.Sets/src/mage/cards/k/KollTheForgemaster.java +++ b/Mage.Sets/src/mage/cards/k/KollTheForgemaster.java @@ -3,7 +3,6 @@ package mage.cards.k; import java.util.Objects; import java.util.UUID; import mage.MageInt; -import mage.MageObject; import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -83,7 +82,7 @@ enum KollTheForgemasterEnchantedPredicate implements Predicate { .stream() .map(game::getPermanentOrLKIBattlefield) .filter(Objects::nonNull) - .anyMatch(MageObject::isEnchantment); + .anyMatch(permanent -> permanent.isEnchantment(game)); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KrovikanHorror.java b/Mage.Sets/src/mage/cards/k/KrovikanHorror.java index f1b1517b6c..f0795abacd 100644 --- a/Mage.Sets/src/mage/cards/k/KrovikanHorror.java +++ b/Mage.Sets/src/mage/cards/k/KrovikanHorror.java @@ -72,7 +72,7 @@ enum KrovikanHorrorCondition implements Condition { boolean nextCard = false; for (Card card : controller.getGraveyard().getCards(game)) { if (nextCard) { - return card.isCreature(); + return card.isCreature(game); } if (card.getId().equals(source.getSourceId())) { nextCard = true; diff --git a/Mage.Sets/src/mage/cards/k/KrovikanVampire.java b/Mage.Sets/src/mage/cards/k/KrovikanVampire.java index 62c46d6957..8acfa763d2 100644 --- a/Mage.Sets/src/mage/cards/k/KrovikanVampire.java +++ b/Mage.Sets/src/mage/cards/k/KrovikanVampire.java @@ -147,7 +147,7 @@ class KrovikanVampireCreaturesDamagedWatcher extends Watcher { return; } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return; } damagedBySource.add(event.getTargetId()); @@ -177,7 +177,7 @@ class KrovikanVampireCreaturesDiedWatcher extends Watcher { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() && zEvent.getTarget() != null - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { diedThisTurn.add(zEvent.getTargetId()); } } diff --git a/Mage.Sets/src/mage/cards/k/KroxaTitanOfDeathsHunger.java b/Mage.Sets/src/mage/cards/k/KroxaTitanOfDeathsHunger.java index 74102000d1..8ec9977e8b 100644 --- a/Mage.Sets/src/mage/cards/k/KroxaTitanOfDeathsHunger.java +++ b/Mage.Sets/src/mage/cards/k/KroxaTitanOfDeathsHunger.java @@ -128,7 +128,7 @@ class KroxaTitanOfDeathsHungerDiscardEffect extends OneShotEffect { Player player = game.getPlayer(card.getOwnerId()); if (player == null || !player.discard(card, false, source, game) - || card.isLand()) { + || card.isLand(game)) { return; } playerSet.add(player.getId()); diff --git a/Mage.Sets/src/mage/cards/k/Kudzu.java b/Mage.Sets/src/mage/cards/k/Kudzu.java index aa2867903f..ddbfa6d95c 100644 --- a/Mage.Sets/src/mage/cards/k/Kudzu.java +++ b/Mage.Sets/src/mage/cards/k/Kudzu.java @@ -81,7 +81,7 @@ class KudzuEffect extends OneShotEffect { if (game.getState().getZone(enchantedLand.getId()) == Zone.BATTLEFIELD) { // if 2 or more Kudzu's were on a land enchantedLand.destroy(source, game, false); } - if (!game.getBattlefield().getAllActivePermanents(CardType.LAND).isEmpty()) { //lands are available on the battlefield + if (!game.getBattlefield().getAllActivePermanents(CardType.LAND, game).isEmpty()) { //lands are available on the battlefield Target target = new TargetLandPermanent(); target.setNotTarget(true); //not a target, it is chosen Card kudzuCard = game.getCard(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/k/KumanosBlessing.java b/Mage.Sets/src/mage/cards/k/KumanosBlessing.java index 282c12f1cb..e833259df2 100644 --- a/Mage.Sets/src/mage/cards/k/KumanosBlessing.java +++ b/Mage.Sets/src/mage/cards/k/KumanosBlessing.java @@ -112,7 +112,7 @@ class DamagedByEnchantedWatcher extends Watcher { Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null && enchantment.isAttachedTo(event.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { MageObjectReference mor = new MageObjectReference(event.getTargetId(), game); damagedCreatures.add(mor); } diff --git a/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java b/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java index f6eddc8ae6..2f1c71eedc 100644 --- a/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java +++ b/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java @@ -85,7 +85,7 @@ class KunorosHoundOfAthreosEnterEffect extends ContinuousRuleModifyingEffectImpl return false; } Card card = game.getCard(zEvent.getTargetId()); - return card != null && card.isCreature(); + return card != null && card.isCreature(game); } } diff --git a/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java b/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java index fedfda95bc..e0571186a9 100644 --- a/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java +++ b/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java @@ -73,7 +73,7 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl { return false; } Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (source == null || !source.isArtifact()) { + if (source == null || !source.isArtifact(game)) { return false; } StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java b/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java index a4d23f6b06..264cfd1ce9 100644 --- a/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java +++ b/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java @@ -76,7 +76,7 @@ class LagonnaBandStorytellerEffect extends OneShotEffect { Card card = game.getCard(source.getFirstTarget()); if (controller == null || card == null - || !card.isEnchantment() + || !card.isEnchantment(game) || game.getState().getZone(card.getId()) != Zone.GRAVEYARD) { return false; } diff --git a/Mage.Sets/src/mage/cards/l/LandsEdge.java b/Mage.Sets/src/mage/cards/l/LandsEdge.java index c8c3db00cb..78804aa248 100644 --- a/Mage.Sets/src/mage/cards/l/LandsEdge.java +++ b/Mage.Sets/src/mage/cards/l/LandsEdge.java @@ -68,7 +68,7 @@ class LandsEdgeEffect extends OneShotEffect { DiscardCardCost cost = (DiscardCardCost) source.getCosts().get(0); if (cost != null) { List cards = cost.getCards(); - if (cards.size() == 1 && cards.get(0).isLand()) { + if (cards.size() == 1 && cards.get(0).isLand(game)) { Effect effect = new DamageTargetEffect(2); effect.setTargetPointer(getTargetPointer()); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java b/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java index 620f2fd552..c865e2d874 100644 --- a/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java +++ b/Mage.Sets/src/mage/cards/l/LashknifeBarrier.java @@ -77,7 +77,7 @@ class LashknifeBarrierEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = game.getPermanent(event.getTargetId()); - return creature != null && creature.isPlaneswalker() && creature.isControlledBy(source.getControllerId()); + return creature != null && creature.isPlaneswalker(game) && creature.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/l/LavaballTrap.java b/Mage.Sets/src/mage/cards/l/LavaballTrap.java index dbb3b4947a..f6bd230a4b 100644 --- a/Mage.Sets/src/mage/cards/l/LavaballTrap.java +++ b/Mage.Sets/src/mage/cards/l/LavaballTrap.java @@ -64,7 +64,7 @@ enum LavaballTrapCondition implements Condition { if (permanents != null) { int count = 0; for (Permanent permanent : permanents) { - if (permanent.isLand()) { + if (permanent.isLand(game)) { count++; if (count == 2) { return true; diff --git a/Mage.Sets/src/mage/cards/l/Leapfrog.java b/Mage.Sets/src/mage/cards/l/Leapfrog.java index 9ddeea02e3..da51d0a1cc 100644 --- a/Mage.Sets/src/mage/cards/l/Leapfrog.java +++ b/Mage.Sets/src/mage/cards/l/Leapfrog.java @@ -1,7 +1,6 @@ package mage.cards.l; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; @@ -65,6 +64,6 @@ enum LeapfrogCondition implements Condition { return spells != null && spells .stream() .filter(Objects::nonNull) - .anyMatch(MageObject::isInstantOrSorcery); + .anyMatch(spell -> spell.isInstantOrSorcery(game)); } } diff --git a/Mage.Sets/src/mage/cards/l/Legerdemain.java b/Mage.Sets/src/mage/cards/l/Legerdemain.java index 422d59c73c..89cff853c4 100644 --- a/Mage.Sets/src/mage/cards/l/Legerdemain.java +++ b/Mage.Sets/src/mage/cards/l/Legerdemain.java @@ -69,10 +69,10 @@ class SharesTypePredicate implements ObjectSourcePlayerPredicate game.getState().getZone(card.getId()) == Zone.GRAVEYARD) - .filter(MageObject::isCreature) + .filter(card1 -> card1.isCreature(game)) .mapToInt(x -> 2) .sum(); if (creatures > 0) { diff --git a/Mage.Sets/src/mage/cards/l/LilianasStandardBearer.java b/Mage.Sets/src/mage/cards/l/LilianasStandardBearer.java index 791b089bba..af65fc92e7 100644 --- a/Mage.Sets/src/mage/cards/l/LilianasStandardBearer.java +++ b/Mage.Sets/src/mage/cards/l/LilianasStandardBearer.java @@ -88,7 +88,7 @@ class LilianasStandardBearerWatcher extends Watcher { return; } ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.isDiesEvent() && zEvent.getTarget().isCreature()) { + if (zEvent.isDiesEvent() && zEvent.getTarget().isCreature(game)) { playerMap.compute(zEvent.getTarget().getControllerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/l/LimDulTheNecromancer.java b/Mage.Sets/src/mage/cards/l/LimDulTheNecromancer.java index 3ad3b4ebbe..7a7c774461 100644 --- a/Mage.Sets/src/mage/cards/l/LimDulTheNecromancer.java +++ b/Mage.Sets/src/mage/cards/l/LimDulTheNecromancer.java @@ -88,7 +88,7 @@ class LimDulTheNecromancerEffect extends OneShotEffect { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { if (controller.moveCards(card, Zone.BATTLEFIELD, source, game) - && card.isCreature()) { + && card.isCreature(game)) { Permanent creature = game.getPermanent(card.getId()); ContinuousEffect effect = new AddCardSubTypeTargetEffect(SubType.ZOMBIE, Duration.WhileOnBattlefield); effect.setTargetPointer(new FixedTarget(creature.getId())); diff --git a/Mage.Sets/src/mage/cards/l/LinvalaKeeperOfSilence.java b/Mage.Sets/src/mage/cards/l/LinvalaKeeperOfSilence.java index e287b6a370..f101b2ca5c 100644 --- a/Mage.Sets/src/mage/cards/l/LinvalaKeeperOfSilence.java +++ b/Mage.Sets/src/mage/cards/l/LinvalaKeeperOfSilence.java @@ -56,7 +56,7 @@ class LinvalaKeeperOfSilenceCantActivateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature() + return permanent.isCreature(game) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/l/LithoformEngine.java b/Mage.Sets/src/mage/cards/l/LithoformEngine.java index 5994af0f03..32aef36c80 100644 --- a/Mage.Sets/src/mage/cards/l/LithoformEngine.java +++ b/Mage.Sets/src/mage/cards/l/LithoformEngine.java @@ -87,7 +87,7 @@ enum LithoformEnginePredicate implements Predicate { @Override public boolean apply(StackObject input, Game game) { - return input.isPermanent(); + return input.isPermanent(game); } } diff --git a/Mage.Sets/src/mage/cards/l/LlanowarEmpath.java b/Mage.Sets/src/mage/cards/l/LlanowarEmpath.java index a5291dda46..6e205ca21c 100644 --- a/Mage.Sets/src/mage/cards/l/LlanowarEmpath.java +++ b/Mage.Sets/src/mage/cards/l/LlanowarEmpath.java @@ -78,7 +78,7 @@ class LlanowarEmpathEffect extends OneShotEffect { Cards cards = new CardsImpl(); cards.add(card); controller.revealCards(sourceObject.getName(), cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.moveCards(card, Zone.HAND, source, game); } } diff --git a/Mage.Sets/src/mage/cards/l/LoafingGiant.java b/Mage.Sets/src/mage/cards/l/LoafingGiant.java index 25109b32c5..ac3ff7827d 100644 --- a/Mage.Sets/src/mage/cards/l/LoafingGiant.java +++ b/Mage.Sets/src/mage/cards/l/LoafingGiant.java @@ -1,7 +1,6 @@ package mage.cards.l; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AttacksOrBlocksTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -69,7 +68,7 @@ class LoafingGiantEffect extends OneShotEffect { .getCards(game) .stream() .filter(Objects::nonNull) - .anyMatch(MageObject::isLand)) { + .anyMatch(card -> card.isLand(game))) { game.addEffect(new PreventCombatDamageBySourceEffect(Duration.EndOfTurn), source); return true; } diff --git a/Mage.Sets/src/mage/cards/l/LordWindgrace.java b/Mage.Sets/src/mage/cards/l/LordWindgrace.java index f6a2790fb1..e57753a410 100644 --- a/Mage.Sets/src/mage/cards/l/LordWindgrace.java +++ b/Mage.Sets/src/mage/cards/l/LordWindgrace.java @@ -102,7 +102,7 @@ class LordWindgraceEffect extends OneShotEffect { return false; } Card card = player.discardOne(false, false, source, game); - if (card == null || !card.isLand()) { + if (card == null || !card.isLand(game)) { player.drawCards(1, source, game); } else { player.drawCards(2, source, game); diff --git a/Mage.Sets/src/mage/cards/l/LoxodonGatekeeper.java b/Mage.Sets/src/mage/cards/l/LoxodonGatekeeper.java index 1ea28fa168..33c57eb93c 100644 --- a/Mage.Sets/src/mage/cards/l/LoxodonGatekeeper.java +++ b/Mage.Sets/src/mage/cards/l/LoxodonGatekeeper.java @@ -16,7 +16,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -78,9 +77,9 @@ class LoxodonGatekeeperTapEffect extends ReplacementEffectImpl { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null - && (permanent.isCreature() - || permanent.isLand() - || permanent.isArtifact())) { + && (permanent.isCreature(game) + || permanent.isLand(game) + || permanent.isArtifact(game))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/l/LukkaCoppercoatOutcast.java b/Mage.Sets/src/mage/cards/l/LukkaCoppercoatOutcast.java index 3a91a6827f..0cfdb483c9 100644 --- a/Mage.Sets/src/mage/cards/l/LukkaCoppercoatOutcast.java +++ b/Mage.Sets/src/mage/cards/l/LukkaCoppercoatOutcast.java @@ -1,6 +1,5 @@ package mage.cards.l; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; @@ -84,7 +83,7 @@ class LukkaCoppercoatOutcastExileEffect extends OneShotEffect { Set cards = controller.getLibrary().getTopCards(game, 3); controller.moveCards(cards, Zone.EXILED, source, game); - cards.stream().filter(MageObject::isCreature).forEach(card -> { + cards.stream().filter(card1 -> card1.isCreature(game)).forEach(card -> { ContinuousEffect effect = new LukkaCoppercoatOutcastCastEffect(); effect.setTargetPointer(new FixedTarget(card, game)); game.addEffect(effect, source); @@ -155,7 +154,7 @@ class LukkaCoppercoatOutcastPolymorphEffect extends OneShotEffect { Cards toReveal = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { toReveal.add(card); - if (card.isCreature() && card.getManaValue() > cmc) { + if (card.isCreature(game) && card.getManaValue() > cmc) { toBattlefield = card; break; } diff --git a/Mage.Sets/src/mage/cards/l/LumengridAugur.java b/Mage.Sets/src/mage/cards/l/LumengridAugur.java index 6fb94f7031..8bd1149786 100644 --- a/Mage.Sets/src/mage/cards/l/LumengridAugur.java +++ b/Mage.Sets/src/mage/cards/l/LumengridAugur.java @@ -73,7 +73,7 @@ class LumengridAugurEffect extends OneShotEffect { if (player != null) { player.drawCards(1, source, game); Card discardedCard = player.discardOne(false, false, source, game); - if (discardedCard != null && discardedCard.isArtifact()) { + if (discardedCard != null && discardedCard.isArtifact(game)) { if (sourcePermanent != null) { sourcePermanent.untap(game); } diff --git a/Mage.Sets/src/mage/cards/l/LuminousBroodmoth.java b/Mage.Sets/src/mage/cards/l/LuminousBroodmoth.java index c40c03cb8c..224178c0dc 100644 --- a/Mage.Sets/src/mage/cards/l/LuminousBroodmoth.java +++ b/Mage.Sets/src/mage/cards/l/LuminousBroodmoth.java @@ -81,7 +81,7 @@ class LuminousBroodmothTriggeredAbility extends TriggeredAbilityImpl { if (permanent != null && zEvent.isDiesEvent() - && permanent.isCreature() + && permanent.isCreature(game) && !permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId()) && permanent.isControlledBy(this.controllerId)) { this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/l/LurkingJackals.java b/Mage.Sets/src/mage/cards/l/LurkingJackals.java index 0ed7de68dd..3877140726 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingJackals.java +++ b/Mage.Sets/src/mage/cards/l/LurkingJackals.java @@ -67,7 +67,7 @@ class LurkingJackalsStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkInterveningIfClause(Game game) { if (getSourcePermanentIfItStillExists(game) != null) { - return getSourcePermanentIfItStillExists(game).isEnchantment(); + return getSourcePermanentIfItStillExists(game).isEnchantment(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/l/LurkingPredators.java b/Mage.Sets/src/mage/cards/l/LurkingPredators.java index 54f1a5b1cc..e9adf690e5 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingPredators.java +++ b/Mage.Sets/src/mage/cards/l/LurkingPredators.java @@ -70,7 +70,7 @@ class LurkingPredatorsEffect extends OneShotEffect { controller.revealCards(sourceObject.getIdName(), cards, game); if (card != null) { - if (card.isCreature()) { + if (card.isCreature(game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " on the bottom of your library?", source, game)) { controller.putCardsOnBottomOfLibrary(cards, game, source, false); diff --git a/Mage.Sets/src/mage/cards/l/LurrusOfTheDreamDen.java b/Mage.Sets/src/mage/cards/l/LurrusOfTheDreamDen.java index 300e4886a3..50311b5754 100644 --- a/Mage.Sets/src/mage/cards/l/LurrusOfTheDreamDen.java +++ b/Mage.Sets/src/mage/cards/l/LurrusOfTheDreamDen.java @@ -69,7 +69,7 @@ enum LurrusOfTheDreamDenCompanionCondition implements CompanionCondition { @Override public boolean isLegal(Set deck, int startingSize) { return deck.stream() - .filter(MageObject::isPermanent) + .filter(card -> card.isPermanent()) .mapToInt(MageObject::getManaValue) .max() .orElse(0) <= 2; @@ -105,7 +105,7 @@ class LurrusOfTheDreamDenCastFromGraveyardEffect extends AsThoughEffectImpl { Card objectCard = game.getCard(objectId); Permanent sourceObject = game.getPermanent(source.getSourceId()); if (sourceObject != null && objectCard != null - && objectCard.isPermanent() + && objectCard.isPermanent(game) && objectCard.isOwnedBy(source.getControllerId()) && objectCard.getManaValue() < 3 && objectCard.getSpellAbility() != null diff --git a/Mage.Sets/src/mage/cards/l/LutriTheSpellchaser.java b/Mage.Sets/src/mage/cards/l/LutriTheSpellchaser.java index 77ee48fc26..c8b377537b 100644 --- a/Mage.Sets/src/mage/cards/l/LutriTheSpellchaser.java +++ b/Mage.Sets/src/mage/cards/l/LutriTheSpellchaser.java @@ -84,7 +84,7 @@ enum LutriTheSpellchaserCompanionCondition implements CompanionCondition { @Override public boolean isLegal(Set deck, int startingSize) { - Map cardMap = new HashMap(); + Map cardMap = new HashMap<>(); deck.stream() .filter(card -> !card.isLand()) .map(MageObject::getName) diff --git a/Mage.Sets/src/mage/cards/m/MadcapExperiment.java b/Mage.Sets/src/mage/cards/m/MadcapExperiment.java index 394bd139f5..7b26267ea7 100644 --- a/Mage.Sets/src/mage/cards/m/MadcapExperiment.java +++ b/Mage.Sets/src/mage/cards/m/MadcapExperiment.java @@ -61,7 +61,7 @@ class MadcapExperimentEffect extends OneShotEffect { for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); game.fireUpdatePlayersEvent(); - if (card.isArtifact()) { + if (card.isArtifact(game)) { toBattlefield = card; break; diff --git a/Mage.Sets/src/mage/cards/m/MaelstromMuse.java b/Mage.Sets/src/mage/cards/m/MaelstromMuse.java index f590efbe39..cdb2b60064 100644 --- a/Mage.Sets/src/mage/cards/m/MaelstromMuse.java +++ b/Mage.Sets/src/mage/cards/m/MaelstromMuse.java @@ -102,7 +102,7 @@ class MaelstromMuseEffect extends CostModificationEffectImpl { return false; } Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); - return spellCard != null && spellCard.isInstantOrSorcery(); + return spellCard != null && spellCard.isInstantOrSorcery(game); } @Override @@ -125,7 +125,7 @@ class MaelstromMuseWatcher extends Watcher { return; } Spell spell = game.getSpell(event.getSourceId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { playerMap.compute(event.getPlayerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/m/MageDuel.java b/Mage.Sets/src/mage/cards/m/MageDuel.java index deaaec9299..521ed8d635 100644 --- a/Mage.Sets/src/mage/cards/m/MageDuel.java +++ b/Mage.Sets/src/mage/cards/m/MageDuel.java @@ -1,6 +1,5 @@ package mage.cards.m; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; @@ -72,7 +71,7 @@ enum MageDuelCondition implements Condition { return spells != null && spells .stream() .filter(Objects::nonNull) - .filter(MageObject::isInstantOrSorcery) + .filter(spell -> spell.isInstantOrSorcery(game)) .map(Spell::getSourceId) .anyMatch(source.getSourceId()::equals); } diff --git a/Mage.Sets/src/mage/cards/m/MageHunter.java b/Mage.Sets/src/mage/cards/m/MageHunter.java index 5bb0320092..c383b091da 100644 --- a/Mage.Sets/src/mage/cards/m/MageHunter.java +++ b/Mage.Sets/src/mage/cards/m/MageHunter.java @@ -62,7 +62,7 @@ class MageHunterTriggeredAbility extends TriggeredAbilityImpl { Spell spell = game.getSpell(event.getTargetId()); if (spell == null || !game.getOpponents(getControllerId()).contains(spell.getControllerId()) - || !spell.isInstantOrSorcery()) { + || !spell.isInstantOrSorcery(game)) { return false; } getEffects().setTargetPointer(new FixedTarget(spell.getControllerId())); diff --git a/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java b/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java index f4022832bf..e17c33b70c 100644 --- a/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java +++ b/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java @@ -1,7 +1,6 @@ package mage.cards.m; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -110,7 +109,7 @@ class MagisterOfWorthEffect extends OneShotEffect { .map(g -> g.getCards(game)) .flatMap(Collection::stream) .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(card -> card.isCreature(game)) .forEach(cards::add); return controller.moveCards( cards.getCards(game), Zone.BATTLEFIELD, source, game, diff --git a/Mage.Sets/src/mage/cards/m/MagneticMine.java b/Mage.Sets/src/mage/cards/m/MagneticMine.java index 5022fc1493..27d50a1bf7 100644 --- a/Mage.Sets/src/mage/cards/m/MagneticMine.java +++ b/Mage.Sets/src/mage/cards/m/MagneticMine.java @@ -12,7 +12,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.target.TargetPlayer; @@ -59,7 +58,7 @@ class MagneticMineTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() - && zEvent.getTarget().isArtifact() + && zEvent.getTarget().isArtifact(game) && !Objects.equals(zEvent.getTarget().getId(), this.getSourceId())) { this.getTargets().get(0).add(zEvent.getTarget().getControllerId(), game); return true; diff --git a/Mage.Sets/src/mage/cards/m/MagusOfTheBridge.java b/Mage.Sets/src/mage/cards/m/MagusOfTheBridge.java index d87ec7c5b9..744370ba99 100644 --- a/Mage.Sets/src/mage/cards/m/MagusOfTheBridge.java +++ b/Mage.Sets/src/mage/cards/m/MagusOfTheBridge.java @@ -87,7 +87,7 @@ class MagusOfTheBridgeTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = zEvent.getTarget(); Player controller = game.getPlayer(getControllerId()); return permanent != null && controller != null - && permanent.isCreature() && controller.hasOpponent(permanent.getOwnerId(), game); + && permanent.isCreature(game) && controller.hasOpponent(permanent.getOwnerId(), game); } return false; } diff --git a/Mage.Sets/src/mage/cards/m/MalevolentNoble.java b/Mage.Sets/src/mage/cards/m/MalevolentNoble.java index 4c7f6ff3bf..611ecf4f3b 100644 --- a/Mage.Sets/src/mage/cards/m/MalevolentNoble.java +++ b/Mage.Sets/src/mage/cards/m/MalevolentNoble.java @@ -65,9 +65,9 @@ enum MalevolentNoblePredicate implements ObjectSourcePlayerPredicate input, Game game) { MageObject obj = input.getObject(); if (obj.getId().equals(input.getSourceId())) { - return obj.isArtifact(); + return obj.isArtifact(game); } - return obj.isArtifact() - || obj.isCreature(); + return obj.isArtifact(game) + || obj.isCreature(game); } } diff --git a/Mage.Sets/src/mage/cards/m/ManaWeb.java b/Mage.Sets/src/mage/cards/m/ManaWeb.java index 259fdb105c..1732303ae8 100644 --- a/Mage.Sets/src/mage/cards/m/ManaWeb.java +++ b/Mage.Sets/src/mage/cards/m/ManaWeb.java @@ -17,7 +17,6 @@ import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -67,7 +66,7 @@ class ManaWebTriggeredAbility extends TriggeredAbilityImpl { } if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); return true; } diff --git a/Mage.Sets/src/mage/cards/m/Manabond.java b/Mage.Sets/src/mage/cards/m/Manabond.java index 7dcde194ae..34456d5b70 100644 --- a/Mage.Sets/src/mage/cards/m/Manabond.java +++ b/Mage.Sets/src/mage/cards/m/Manabond.java @@ -61,7 +61,7 @@ class ManabondEffect extends OneShotEffect { Set toBattlefield = new LinkedHashSet<>(); for (UUID uuid : controller.getHand()) { Card card = game.getCard(uuid); - if (card != null && card.isLand()) { + if (card != null && card.isLand(game)) { toBattlefield.add(card); } diff --git a/Mage.Sets/src/mage/cards/m/Manglehorn.java b/Mage.Sets/src/mage/cards/m/Manglehorn.java index d8e19cbcf2..65beee2ad8 100644 --- a/Mage.Sets/src/mage/cards/m/Manglehorn.java +++ b/Mage.Sets/src/mage/cards/m/Manglehorn.java @@ -82,7 +82,7 @@ class ManglehornTapEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isArtifact()) { + if (permanent != null && permanent.isArtifact(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java b/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java index c5fbacfabc..8c1f382159 100644 --- a/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java +++ b/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java @@ -70,7 +70,7 @@ class MarchOfTheMachinesEffect extends ContinuousEffectImpl { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { if (permanent != null) { affectedObjectList.add(new MageObjectReference(permanent, game)); - permanent.addCardType(CardType.CREATURE); + permanent.addCardType(game, CardType.CREATURE); } } } diff --git a/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java b/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java index dcf8613e1f..74867ade01 100644 --- a/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java +++ b/Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java @@ -21,7 +21,6 @@ import mage.counters.CounterType; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -90,7 +89,7 @@ class MarchesaTheBlackRoseTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null && permanent.isControlledBy(this.getControllerId()) - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getCounters(game).getCount(CounterType.P1P1) > 0) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game) + 1)); diff --git a/Mage.Sets/src/mage/cards/m/MartyrsBond.java b/Mage.Sets/src/mage/cards/m/MartyrsBond.java index b14472a8ad..2b9d47bb5c 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrsBond.java +++ b/Mage.Sets/src/mage/cards/m/MartyrsBond.java @@ -72,7 +72,7 @@ class MartyrsBondTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.isControlledBy(this.getControllerId()) - && !permanent.isLand()) { + && !permanent.isLand(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent, game)); } @@ -118,7 +118,7 @@ class MartyrsBondEffect extends OneShotEffect { List cardTypes = new ArrayList<>(); - for (CardType type : saccedPermanent.getCardType()) { + for (CardType type : saccedPermanent.getCardType(game)) { cardTypes.add(type.getPredicate()); if (firstType) { message += type; diff --git a/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java b/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java index 272bfe0d70..e6078c6520 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java +++ b/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java @@ -69,7 +69,7 @@ class RedirectArtifactDamageFromPlayerToSourceEffect extends RedirectionEffect { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getControllerId()) && - game.getPermanentOrLKIBattlefield(event.getSourceId()).isArtifact()) { + game.getPermanentOrLKIBattlefield(event.getSourceId()).isArtifact(game)) { TargetPermanent target = new TargetPermanent(); target.add(source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/m/MaskwoodNexus.java b/Mage.Sets/src/mage/cards/m/MaskwoodNexus.java index 54bbd66295..fa0eb4ef87 100644 --- a/Mage.Sets/src/mage/cards/m/MaskwoodNexus.java +++ b/Mage.Sets/src/mage/cards/m/MaskwoodNexus.java @@ -82,26 +82,26 @@ class MaskwoodNexusEffect extends ContinuousEffectImpl { // in graveyard for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().setIsAllCreatureTypes(true); } } // on Hand for (UUID cardId : controller.getHand()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().setIsAllCreatureTypes(true); } } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.isCreature() && card.isOwnedBy(controller.getId())) { + if (card.isCreature(game) && card.isOwnedBy(controller.getId())) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().setIsAllCreatureTypes(true); } } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.isOwnedBy(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature(game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().setIsAllCreatureTypes(true); } } @@ -113,7 +113,7 @@ class MaskwoodNexusEffect extends ContinuousEffectImpl { Card card = game.getCard(((Commander) commandObject).getId()); if (card != null && card.isOwnedBy(controller.getId()) - && card.isCreature()) { + && card.isCreature(game)) { game.getState().getCreateMageObjectAttribute(card, game).getSubtype().setIsAllCreatureTypes(true); } } @@ -122,7 +122,7 @@ class MaskwoodNexusEffect extends ContinuousEffectImpl { StackObject stackObject = iterator.next(); if (stackObject instanceof Spell && stackObject.isControlledBy(source.getControllerId()) - && stackObject.isCreature()) { + && stackObject.isCreature(game)) { Card card = ((Spell) stackObject).getCard(); game.getState().getCreateMageObjectAttribute(card, game).getSubtype().setIsAllCreatureTypes(true); } diff --git a/Mage.Sets/src/mage/cards/m/MassPolymorph.java b/Mage.Sets/src/mage/cards/m/MassPolymorph.java index 509ea75bb0..f91b977e7d 100644 --- a/Mage.Sets/src/mage/cards/m/MassPolymorph.java +++ b/Mage.Sets/src/mage/cards/m/MassPolymorph.java @@ -67,7 +67,7 @@ class MassPolymorphEffect extends OneShotEffect { Set creatureCards = new LinkedHashSet<>(); for (Card card : controller.getLibrary().getCards(game)) { revealed.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { creatureCards.add(card); if (creatureCards.size() == count) { break; diff --git a/Mage.Sets/src/mage/cards/m/MassacreGirl.java b/Mage.Sets/src/mage/cards/m/MassacreGirl.java index 593f96b51d..62197082b3 100644 --- a/Mage.Sets/src/mage/cards/m/MassacreGirl.java +++ b/Mage.Sets/src/mage/cards/m/MassacreGirl.java @@ -91,7 +91,7 @@ class MassacreGirlDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - return zEvent.isDiesEvent() && zEvent.getTarget().isCreature(); + return zEvent.isDiesEvent() && zEvent.getTarget().isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/m/MassacreWurm.java b/Mage.Sets/src/mage/cards/m/MassacreWurm.java index efab6b7e59..499199fb8e 100644 --- a/Mage.Sets/src/mage/cards/m/MassacreWurm.java +++ b/Mage.Sets/src/mage/cards/m/MassacreWurm.java @@ -15,7 +15,6 @@ import mage.constants.Duration; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -72,7 +71,7 @@ class MassacreWurmTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent) event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.isCreature() && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { + if (p != null && p.isCreature(game) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(p.getControllerId())); } diff --git a/Mage.Sets/src/mage/cards/m/MasterBiomancer.java b/Mage.Sets/src/mage/cards/m/MasterBiomancer.java index 5f94fbb447..62d05d23ac 100644 --- a/Mage.Sets/src/mage/cards/m/MasterBiomancer.java +++ b/Mage.Sets/src/mage/cards/m/MasterBiomancer.java @@ -69,7 +69,7 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/m/MasterOfPredicaments.java b/Mage.Sets/src/mage/cards/m/MasterOfPredicaments.java index 3e8a73bf88..9674342e0c 100644 --- a/Mage.Sets/src/mage/cards/m/MasterOfPredicaments.java +++ b/Mage.Sets/src/mage/cards/m/MasterOfPredicaments.java @@ -104,7 +104,7 @@ class MasterOfPredicamentsEffect extends OneShotEffect { } game.informPlayers(attackedPlayer.getLogName() + " guessed " + (guessWrong ? "wrong" : "right")); if (guessWrong) { - if (cardFromHand.isLand()) { + if (cardFromHand.isLand(game)) { // If the revealed card is a land, you can't cast it. So nothing happens } else { if (controller.chooseUse(outcome, "Cast " + cardFromHand.getName() diff --git a/Mage.Sets/src/mage/cards/m/MasterfulReplication.java b/Mage.Sets/src/mage/cards/m/MasterfulReplication.java index 6fed41c2f3..10c9c99457 100644 --- a/Mage.Sets/src/mage/cards/m/MasterfulReplication.java +++ b/Mage.Sets/src/mage/cards/m/MasterfulReplication.java @@ -70,7 +70,7 @@ class MasterfulReplicationEffect extends OneShotEffect { return false; } for (Permanent copyToArtifact : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (copyToArtifact.isArtifact() && !copyToArtifact.getId().equals(copyFromArtifact.getId())) { + if (copyToArtifact.isArtifact(game) && !copyToArtifact.getId().equals(copyFromArtifact.getId())) { game.copyPermanent(Duration.EndOfTurn, copyFromArtifact, copyToArtifact.getId(), source, new EmptyCopyApplier()); } } diff --git a/Mage.Sets/src/mage/cards/m/MavindaStudentsAdvocate.java b/Mage.Sets/src/mage/cards/m/MavindaStudentsAdvocate.java index 58003f53d1..ca7a3532d3 100644 --- a/Mage.Sets/src/mage/cards/m/MavindaStudentsAdvocate.java +++ b/Mage.Sets/src/mage/cards/m/MavindaStudentsAdvocate.java @@ -1,7 +1,6 @@ package mage.cards.m; import mage.MageInt; -import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.SpellAbility; @@ -126,7 +125,7 @@ class MavindaStudentsAdvocateCostEffect extends CostModificationEffectImpl { .flatMap(Collection::stream) .map(game::getPermanent) .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(permanent -> permanent.isCreature(game)) .map(Controllable::getControllerId) .noneMatch(source::isControlledBy); } diff --git a/Mage.Sets/src/mage/cards/m/Meddle.java b/Mage.Sets/src/mage/cards/m/Meddle.java index e99d398ad3..7aa1f5a805 100644 --- a/Mage.Sets/src/mage/cards/m/Meddle.java +++ b/Mage.Sets/src/mage/cards/m/Meddle.java @@ -80,7 +80,7 @@ class MeddleEffect extends OneShotEffect { return false; } Permanent permanent = game.getPermanent(targetId); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } } diff --git a/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java b/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java index 40a46a08f3..c28d833729 100644 --- a/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java +++ b/Mage.Sets/src/mage/cards/m/MelekIzzetParagon.java @@ -91,8 +91,8 @@ class MelekIzzetParagonTriggeredAbility extends TriggeredAbilityImpl { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isOwnedBy(super.getControllerId()) - && (spell.isInstant() - || spell.isSorcery())) { + && (spell.isInstant(game) + || spell.isSorcery(game))) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java b/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java index b9322897b3..9c7231e052 100644 --- a/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java +++ b/Mage.Sets/src/mage/cards/m/MeliraSylvokOutcast.java @@ -13,7 +13,6 @@ import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import java.util.Set; @@ -120,7 +119,7 @@ class MeliraSylvokOutcastEffect2 extends ReplacementEffectImpl { if (perm == null) { perm = game.getPermanentEntering(event.getTargetId()); } - return perm != null && perm.isCreature() && perm.isControlledBy(source.getControllerId()); + return perm != null && perm.isCreature(game) && perm.isControlledBy(source.getControllerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/m/Meltdown.java b/Mage.Sets/src/mage/cards/m/Meltdown.java index 686ecf57d7..34115929f0 100644 --- a/Mage.Sets/src/mage/cards/m/Meltdown.java +++ b/Mage.Sets/src/mage/cards/m/Meltdown.java @@ -54,7 +54,7 @@ class MeltdownEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (permanent != null && permanent.isArtifact() && permanent.getManaValue() <= source.getManaCostsToPay().getX()) { + if (permanent != null && permanent.isArtifact(game) && permanent.getManaValue() <= source.getManaCostsToPay().getX()) { permanent.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/m/MetallicMimic.java b/Mage.Sets/src/mage/cards/m/MetallicMimic.java index 1269a7fcc1..261fbc3e11 100644 --- a/Mage.Sets/src/mage/cards/m/MetallicMimic.java +++ b/Mage.Sets/src/mage/cards/m/MetallicMimic.java @@ -78,7 +78,7 @@ class MetallicMimicReplacementEffect extends ReplacementEffectImpl { Permanent enteringCreature = ((EntersTheBattlefieldEvent) event).getTarget(); if (enteringCreature != null && sourcePermanent != null && enteringCreature.isControlledBy(source.getControllerId()) - && enteringCreature.isCreature() + && enteringCreature.isCreature(game) && !event.getTargetId().equals(source.getSourceId())) { SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); return subType != null && enteringCreature.hasSubtype(subType, game); diff --git a/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java b/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java index f9a2336b6c..973849eea1 100644 --- a/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java +++ b/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java @@ -128,9 +128,9 @@ class MetamorphicAlterationEffect extends ContinuousEffectImpl { for (SuperType t : copied.getSuperType()) { permanent.addSuperType(t); } - permanent.getCardType().clear(); - for (CardType cardType : copied.getCardType()) { - permanent.addCardType(cardType); + permanent.removeAllCardTypes(game); + for (CardType cardType : copied.getCardType(game)) { + permanent.addCardType(game, cardType); } permanent.removeAllSubTypes(game); permanent.copySubTypesFrom(game, copied); diff --git a/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java b/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java index 325a3b0eab..82690f4422 100644 --- a/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java +++ b/Mage.Sets/src/mage/cards/m/MetzaliTowerOfTriumph.java @@ -96,7 +96,7 @@ class MetzaliTowerOfTriumphEffect extends OneShotEffect { List available = new ArrayList<>(); for (MageObjectReference mor : attackedThisTurn) { Permanent permanent = mor.getPermanent(game); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { available.add(permanent); } } diff --git a/Mage.Sets/src/mage/cards/m/MilaCraftyCompanion.java b/Mage.Sets/src/mage/cards/m/MilaCraftyCompanion.java index 8c91fdf913..26e8c32f14 100644 --- a/Mage.Sets/src/mage/cards/m/MilaCraftyCompanion.java +++ b/Mage.Sets/src/mage/cards/m/MilaCraftyCompanion.java @@ -1,6 +1,5 @@ package mage.cards.m; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; @@ -122,7 +121,7 @@ class MilaCraftyCompanionTriggeredAbility extends TriggeredAbilityImpl { .map(game.getCombat()::getDefenderId) .map(game::getPermanent) .filter(Objects::nonNull) - .filter(MageObject::isPlaneswalker) + .filter(permanent -> permanent.isPlaneswalker(game)) .map(Controllable::getControllerId) .anyMatch(getControllerId()::equals); } @@ -161,7 +160,7 @@ class LukkaWaywardBonderDiscardEffect extends OneShotEffect { if (card == null) { return false; } - player.drawCards(card.isCreature() ? 2 : 1, source, game); + player.drawCards(card.isCreature(game) ? 2 : 1, source, game); return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MimicVat.java b/Mage.Sets/src/mage/cards/m/MimicVat.java index acd490f362..116f55e005 100644 --- a/Mage.Sets/src/mage/cards/m/MimicVat.java +++ b/Mage.Sets/src/mage/cards/m/MimicVat.java @@ -22,7 +22,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; @@ -93,7 +92,7 @@ class MimicVatTriggeredAbility extends TriggeredAbilityImpl { if (permanent != null && zEvent.isDiesEvent() && !(permanent instanceof PermanentToken) - && permanent.isCreature()) { + && permanent.isCreature(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId(), game)); return true; diff --git a/Mage.Sets/src/mage/cards/m/MindFuneral.java b/Mage.Sets/src/mage/cards/m/MindFuneral.java index c631f9098b..e2b2f4af60 100644 --- a/Mage.Sets/src/mage/cards/m/MindFuneral.java +++ b/Mage.Sets/src/mage/cards/m/MindFuneral.java @@ -65,7 +65,7 @@ class MindFuneralEffect extends OneShotEffect { int landsFound = 0; for (Card card : opponent.getLibrary().getCards(game)) { cards.add(card); - if (card.isLand() && ++landsFound == 4) { + if (card.isLand(game) && ++landsFound == 4) { break; } } diff --git a/Mage.Sets/src/mage/cards/m/MindGrind.java b/Mage.Sets/src/mage/cards/m/MindGrind.java index fcc8ef288b..933ee3dade 100644 --- a/Mage.Sets/src/mage/cards/m/MindGrind.java +++ b/Mage.Sets/src/mage/cards/m/MindGrind.java @@ -77,7 +77,7 @@ class MindGrindEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (card.isLand() && --landsToReveal == 0) { + if (card.isLand(game) && --landsToReveal == 0) { break; } } diff --git a/Mage.Sets/src/mage/cards/m/MindsDilation.java b/Mage.Sets/src/mage/cards/m/MindsDilation.java index a574a13301..e1be5b3464 100644 --- a/Mage.Sets/src/mage/cards/m/MindsDilation.java +++ b/Mage.Sets/src/mage/cards/m/MindsDilation.java @@ -118,7 +118,7 @@ class MindsDilationEffect extends OneShotEffect { Card card = opponent.getLibrary().getFromTop(game); if (card != null && opponent.moveCards(card, Zone.EXILED, source, game)) { - if (!card.isLand()) { + if (!card.isLand(game)) { if (controller.chooseUse(outcome, "Cast " + card.getLogName() + " without paying its mana cost from exile?", source, game)) { game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE); diff --git a/Mage.Sets/src/mage/cards/m/MineLayer.java b/Mage.Sets/src/mage/cards/m/MineLayer.java index b21d54a499..29241524a1 100644 --- a/Mage.Sets/src/mage/cards/m/MineLayer.java +++ b/Mage.Sets/src/mage/cards/m/MineLayer.java @@ -83,7 +83,7 @@ class RemoveAllMineCountersEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.LAND)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.LAND, game)) { if (permanent != null) { int numToRemove = permanent.getCounters(game).getCount(CounterType.MINE); if (numToRemove > 0) { diff --git a/Mage.Sets/src/mage/cards/m/Mirari.java b/Mage.Sets/src/mage/cards/m/Mirari.java index c67e5a2cc3..4766663880 100644 --- a/Mage.Sets/src/mage/cards/m/Mirari.java +++ b/Mage.Sets/src/mage/cards/m/Mirari.java @@ -13,7 +13,6 @@ import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -77,7 +76,7 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (isControlledInstantOrSorcery(spell)) { + if (isControlledInstantOrSorcery(spell, game)) { getEffects().setTargetPointer(new FixedTarget(spell.getId())); return true; } @@ -85,10 +84,10 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { return false; } - private boolean isControlledInstantOrSorcery(Spell spell) { + private boolean isControlledInstantOrSorcery(Spell spell, Game game) { return spell != null && spell.isControlledBy(this.getControllerId()) - && spell.isInstantOrSorcery(); + && spell.isInstantOrSorcery(game); } @Override diff --git a/Mage.Sets/src/mage/cards/m/MirkoVoskMindDrinker.java b/Mage.Sets/src/mage/cards/m/MirkoVoskMindDrinker.java index 2e17ebaa8a..1cdb2802e2 100644 --- a/Mage.Sets/src/mage/cards/m/MirkoVoskMindDrinker.java +++ b/Mage.Sets/src/mage/cards/m/MirkoVoskMindDrinker.java @@ -74,7 +74,7 @@ class MirkoVoskMindDrinkerEffect extends OneShotEffect { for (Card card : player.getLibrary().getCards(game)) { if (card != null) { cards.add(card); - if (card.isLand() && --landsToReveal < 1) { + if (card.isLand(game) && --landsToReveal < 1) { break; } } diff --git a/Mage.Sets/src/mage/cards/m/MirrorGolem.java b/Mage.Sets/src/mage/cards/m/MirrorGolem.java index 4e5c524e1c..9da0c889a9 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorGolem.java +++ b/Mage.Sets/src/mage/cards/m/MirrorGolem.java @@ -112,7 +112,7 @@ class MirrorGolemEffect extends ContinuousEffectImpl { if (imprinted != null && exileZone.contains(imprinted)) { Card card = game.getCard(imprinted); if (card != null) { - for (CardType cardType : card.getCardType()) { + for (CardType cardType : card.getCardType(game)) { FilterCard filterCard; if (cardType.equals(CardType.SORCERY)) { filterCard = new FilterCard("sorceries"); diff --git a/Mage.Sets/src/mage/cards/m/MirrorMatch.java b/Mage.Sets/src/mage/cards/m/MirrorMatch.java index 6665c7bc0e..33688df516 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorMatch.java +++ b/Mage.Sets/src/mage/cards/m/MirrorMatch.java @@ -78,7 +78,7 @@ class MirrorMatchEffect extends OneShotEffect { boolean isCreature = false; if (group != null) { for (Permanent addedToken : effect.getAddedPermanent()) { - if (addedToken.isCreature()) { + if (addedToken.isCreature(game)) { group.addBlockerToGroup(addedToken.getId(), attackerId, game); isCreature = true; } diff --git a/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java b/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java index 18673de1ea..d5d6bf1b28 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java +++ b/Mage.Sets/src/mage/cards/m/MirrorwingDragon.java @@ -83,7 +83,7 @@ class MirrorwingDragonCopyTriggeredAbility extends TriggeredAbilityImpl { } private boolean checkSpell(Spell spell, Game game) { - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } boolean noTargets = true; diff --git a/Mage.Sets/src/mage/cards/m/MishraArtificerProdigy.java b/Mage.Sets/src/mage/cards/m/MishraArtificerProdigy.java index 8ac2cbe56d..09bce971cf 100644 --- a/Mage.Sets/src/mage/cards/m/MishraArtificerProdigy.java +++ b/Mage.Sets/src/mage/cards/m/MishraArtificerProdigy.java @@ -18,7 +18,6 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -77,7 +76,7 @@ class MishraArtificerProdigyTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isArtifact()) { + if (spell != null && spell.isArtifact(game)) { ((MishraArtificerProdigyEffect) this.getEffects().get(0)).setName(spell.getName()); return true; } diff --git a/Mage.Sets/src/mage/cards/m/Mistcaller.java b/Mage.Sets/src/mage/cards/m/Mistcaller.java index 6e995824fd..e67ea0a599 100644 --- a/Mage.Sets/src/mage/cards/m/Mistcaller.java +++ b/Mage.Sets/src/mage/cards/m/Mistcaller.java @@ -97,7 +97,7 @@ class ContainmentPriestReplacementEffect extends ReplacementEffectImpl { if (entersTransformed instanceof Boolean && (Boolean) entersTransformed && card.getSecondCardFace() != null) { card = card.getSecondCardFace(); } - if (card != null && card.isCreature()) { // TODO: Bestow Card cast as Enchantment probably not handled correctly + if (card != null && card.isCreature(game)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly CreatureWasCastWatcher watcher = game.getState().getWatcher(CreatureWasCastWatcher.class); return watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId()); } diff --git a/Mage.Sets/src/mage/cards/m/MistmoonGriffin.java b/Mage.Sets/src/mage/cards/m/MistmoonGriffin.java index 4a2781b5d6..a7e3fca0ae 100644 --- a/Mage.Sets/src/mage/cards/m/MistmoonGriffin.java +++ b/Mage.Sets/src/mage/cards/m/MistmoonGriffin.java @@ -72,7 +72,7 @@ class MistmoonGriffinEffect extends OneShotEffect { if (controller != null) { Card lastCreatureCard = null; for (Card card : controller.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { lastCreatureCard = card; } } diff --git a/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java b/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java index 140c0efb82..fa7f94a7c3 100644 --- a/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java +++ b/Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java @@ -88,7 +88,7 @@ class MnemonicBetrayalExileEffect extends OneShotEffect { source.getSourceId(), CardUtil.getSourceLogName(game, source) ); for (Card card : cards.getCards(game)) { - if (card.isLand()) { + if (card.isLand(game)) { continue; } CardUtil.makeCardPlayable(game, source, card, Duration.EndOfTurn, true); diff --git a/Mage.Sets/src/mage/cards/m/MobMentality.java b/Mage.Sets/src/mage/cards/m/MobMentality.java index 37f711f872..c8fd82c2cf 100644 --- a/Mage.Sets/src/mage/cards/m/MobMentality.java +++ b/Mage.Sets/src/mage/cards/m/MobMentality.java @@ -93,7 +93,7 @@ class MobMentalityTriggeredAbility extends TriggeredAbilityImpl { effect.setTargetPointer(new FixedTarget(creature, game)); } for (Permanent permanent : game.getBattlefield().getAllActivePermanents(getControllerId())) { - if (permanent.isCreature() + if (permanent.isCreature(game) && !permanent.hasSubtype(SubType.WALL, game) && !permanent.isAttacking()) { return false; diff --git a/Mage.Sets/src/mage/cards/m/MolderBeast.java b/Mage.Sets/src/mage/cards/m/MolderBeast.java index 2b71bd1715..ae7f473a4f 100644 --- a/Mage.Sets/src/mage/cards/m/MolderBeast.java +++ b/Mage.Sets/src/mage/cards/m/MolderBeast.java @@ -14,7 +14,6 @@ import mage.constants.Duration; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; /** @@ -63,7 +62,7 @@ class MolderBeastTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; return zEvent.isDiesEvent() - && zEvent.getTarget().isArtifact(); + && zEvent.getTarget().isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java b/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java index c7bc45c34d..fe4eadf03d 100644 --- a/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java +++ b/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java @@ -100,7 +100,7 @@ class MomirVigSimicVisionaryEffect extends OneShotEffect { Set cardsList = cards.getCards(game); Cards cardsToHand = new CardsImpl(); for (Card card : cardsList) { - if (card.isCreature()) { + if (card.isCreature(game)) { cardsToHand.add(card); cards.remove(card); } diff --git a/Mage.Sets/src/mage/cards/m/Moonhold.java b/Mage.Sets/src/mage/cards/m/Moonhold.java index 752e63a3bc..de153b6071 100644 --- a/Mage.Sets/src/mage/cards/m/Moonhold.java +++ b/Mage.Sets/src/mage/cards/m/Moonhold.java @@ -136,7 +136,7 @@ class MoonholdEffect2 extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getFirstTarget())) { Card card = game.getCard(event.getSourceId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MoritteOfTheFrost.java b/Mage.Sets/src/mage/cards/m/MoritteOfTheFrost.java index 0a409ea6ed..4c5f5a16ad 100644 --- a/Mage.Sets/src/mage/cards/m/MoritteOfTheFrost.java +++ b/Mage.Sets/src/mage/cards/m/MoritteOfTheFrost.java @@ -65,7 +65,7 @@ class MoritteOfTheFrostCopyApplier extends CopyApplier { blueprint.addSuperType(SuperType.LEGENDARY); blueprint.addSuperType(SuperType.SNOW); - if (!isCopyOfCopy(source, blueprint, copyToObjectId) && blueprint.isCreature()) { + if (!isCopyOfCopy(source, blueprint, copyToObjectId) && blueprint.isCreature(game)) { blueprint.getAbilities().add(new ChangelingAbility()); blueprint.getAbilities().add(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2), false) diff --git a/Mage.Sets/src/mage/cards/m/MorticianBeetle.java b/Mage.Sets/src/mage/cards/m/MorticianBeetle.java index 18faa52dd9..88c10f0991 100644 --- a/Mage.Sets/src/mage/cards/m/MorticianBeetle.java +++ b/Mage.Sets/src/mage/cards/m/MorticianBeetle.java @@ -15,7 +15,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; /** * @@ -62,7 +61,7 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (mageObject != null && mageObject.isCreature()) { + if (mageObject != null && mageObject.isCreature(game)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/m/MossPitSkeleton.java b/Mage.Sets/src/mage/cards/m/MossPitSkeleton.java index 3ee734b4d6..5a84f950f6 100644 --- a/Mage.Sets/src/mage/cards/m/MossPitSkeleton.java +++ b/Mage.Sets/src/mage/cards/m/MossPitSkeleton.java @@ -83,7 +83,7 @@ class MossPitSkeletonTriggeredAbility extends TriggeredAbilityImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())); } return false; diff --git a/Mage.Sets/src/mage/cards/m/MountVelusManticore.java b/Mage.Sets/src/mage/cards/m/MountVelusManticore.java index 7e89c53c29..a2eac121d3 100644 --- a/Mage.Sets/src/mage/cards/m/MountVelusManticore.java +++ b/Mage.Sets/src/mage/cards/m/MountVelusManticore.java @@ -75,7 +75,7 @@ class MountVelusManticoreEffect extends OneShotEffect { return false; } ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( - new DamageTargetEffect(card.getCardType().size()), false, "{this} deals X damage " + + new DamageTargetEffect(card.getCardType(game).size()), false, "{this} deals X damage " + "to any target, where X is the number of card types the discarded card has" ); ability.addTarget(new TargetAnyTarget()); diff --git a/Mage.Sets/src/mage/cards/m/MowuLoyalCompanion.java b/Mage.Sets/src/mage/cards/m/MowuLoyalCompanion.java index e0bb8a412d..ee31f36e5d 100644 --- a/Mage.Sets/src/mage/cards/m/MowuLoyalCompanion.java +++ b/Mage.Sets/src/mage/cards/m/MowuLoyalCompanion.java @@ -80,7 +80,7 @@ class MowuLoyalCompanionEffect extends ReplacementEffectImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return permanent != null && permanent.getId().equals(source.getSourceId()) - && permanent.isCreature(); + && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java index f02fb79acd..fec90018a9 100644 --- a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java +++ b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java @@ -94,7 +94,7 @@ class MuldrothaTheGravetideCastFromGraveyardEffect extends AsThoughEffectImpl { MuldrothaTheGravetideWatcher watcher = game.getState().getWatcher(MuldrothaTheGravetideWatcher.class); MageObject mageObject = game.getObject(objectId); if (mageObject != null && watcher != null) { - for (CardType cardType : mageObject.getCardType()) { + for (CardType cardType : mageObject.getCardType(game)) { if (cardType.isPermanentType()) { MageObjectReference mor = new MageObjectReference(source.getSourceObject(game), game); if (!watcher.permanentTypePlayedFromGraveyard(mor, cardType)) { @@ -161,7 +161,7 @@ class MuldrothaTheGravetideWatcher extends Watcher { sourcePlayedPermanentTypes.put(event.getAdditionalReference().getApprovingMageObjectReference(), permanentTypes); } Set typesNotCast = EnumSet.noneOf(CardType.class); - for (CardType cardType : mageObject.getCardType()) { + for (CardType cardType : mageObject.getCardType(game)) { if (cardType.isPermanentType()) { if (!permanentTypes.contains(cardType)) { typesNotCast.add(cardType); diff --git a/Mage.Sets/src/mage/cards/m/MurktideRegent.java b/Mage.Sets/src/mage/cards/m/MurktideRegent.java index b1bc527639..966e6ef672 100644 --- a/Mage.Sets/src/mage/cards/m/MurktideRegent.java +++ b/Mage.Sets/src/mage/cards/m/MurktideRegent.java @@ -72,7 +72,7 @@ enum MurktideRegentValue implements DynamicValue { if (delvedCards != null) { for (UUID cardId : delvedCards) { Card card = game.getCard(cardId); - if (card != null && card.isInstantOrSorcery()) { + if (card != null && card.isInstantOrSorcery(game)) { amount++; } } @@ -121,7 +121,7 @@ class MurktideRegentTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.GRAVEYARD) { Card card = game.getCard(zEvent.getTargetId()); - return card != null && card.isInstantOrSorcery() && card.getOwnerId().equals(getControllerId()); + return card != null && card.isInstantOrSorcery(game) && card.getOwnerId().equals(getControllerId()); } return false; } diff --git a/Mage.Sets/src/mage/cards/m/MuxusGoblinGrandee.java b/Mage.Sets/src/mage/cards/m/MuxusGoblinGrandee.java index c46314ad76..05798d1db8 100644 --- a/Mage.Sets/src/mage/cards/m/MuxusGoblinGrandee.java +++ b/Mage.Sets/src/mage/cards/m/MuxusGoblinGrandee.java @@ -95,7 +95,7 @@ class MuxusGoblinGrandeeEffect extends OneShotEffect { .stream() .filter(Objects::nonNull) .forEach(card -> { - if (card.isCreature() + if (card.isCreature(game) && card.hasSubtype(SubType.GOBLIN, game) && card.getManaValue() <= 5) { toBattlfield.add(card); diff --git a/Mage.Sets/src/mage/cards/m/MycosynthLattice.java b/Mage.Sets/src/mage/cards/m/MycosynthLattice.java index f45e77ddab..d1fe186ce6 100644 --- a/Mage.Sets/src/mage/cards/m/MycosynthLattice.java +++ b/Mage.Sets/src/mage/cards/m/MycosynthLattice.java @@ -62,7 +62,7 @@ class PermanentsAreArtifactsEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - perm.addCardType(CardType.ARTIFACT); + perm.addCardType(game, CardType.ARTIFACT); } return true; } diff --git a/Mage.Sets/src/mage/cards/m/MysteriousPathlighter.java b/Mage.Sets/src/mage/cards/m/MysteriousPathlighter.java index 6acba62a9b..943610c12f 100644 --- a/Mage.Sets/src/mage/cards/m/MysteriousPathlighter.java +++ b/Mage.Sets/src/mage/cards/m/MysteriousPathlighter.java @@ -73,7 +73,7 @@ class MysteriousPathlighterEffect extends ReplacementEffectImpl { return permanent instanceof PermanentCard && ((PermanentCard) permanent).getCard() instanceof AdventureCard && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature(); + && permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/m/MysticReflection.java b/Mage.Sets/src/mage/cards/m/MysticReflection.java index e127d63eb1..8cc8f5ebba 100644 --- a/Mage.Sets/src/mage/cards/m/MysticReflection.java +++ b/Mage.Sets/src/mage/cards/m/MysticReflection.java @@ -131,7 +131,7 @@ class MysticReflectionReplacementEffect extends ReplacementEffectImpl { Permanent targetedPermanent = (Permanent) game.getState().getValue("MysticReflection" + identifier); return permanentEnteringTheBattlefield != null && targetedPermanent != null - && permanentEnteringTheBattlefield.isCreature(); + && permanentEnteringTheBattlefield.isCreature(game); } @Override @@ -174,7 +174,7 @@ class MysticReflectionWatcher extends Watcher { .map(MageItem::getId) .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(p -> p.isPlaneswalker() || p.isCreature())) { + .anyMatch(p -> p.isPlaneswalker(game) || p.isCreature(game))) { enteredThisTurn++; } } diff --git a/Mage.Sets/src/mage/cards/m/MysticRemora.java b/Mage.Sets/src/mage/cards/m/MysticRemora.java index 8971c0a5c4..235e9cf1bb 100644 --- a/Mage.Sets/src/mage/cards/m/MysticRemora.java +++ b/Mage.Sets/src/mage/cards/m/MysticRemora.java @@ -75,7 +75,7 @@ class MysticRemoraTriggeredAbility extends TriggeredAbilityImpl { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && !spell.isCreature()) { + if (spell != null && !spell.isCreature(game)) { Player controller = game.getPlayer(game.getControllerId(this.controllerId)); Player player = game.getPlayer(spell.getControllerId()); if (!Objects.equals(controller, player)) { diff --git a/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java b/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java index 34ed73ced4..c1be42fde4 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfIlluna.java @@ -94,6 +94,6 @@ enum MythosOfIllunaCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } } diff --git a/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java b/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java index 9d7ef4e85e..ecb84cd8ba 100644 --- a/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java +++ b/Mage.Sets/src/mage/cards/m/MythosOfNethroi.java @@ -63,7 +63,7 @@ class MythosOfNethroiEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent == null || (!permanent.isCreature() && !condition.apply(game, source))) { + if (permanent == null || (!permanent.isCreature(game) && !condition.apply(game, source))) { return false; } return permanent.destroy(source, game, false); diff --git a/Mage.Sets/src/mage/cards/n/NadierAgentOfTheDuskenel.java b/Mage.Sets/src/mage/cards/n/NadierAgentOfTheDuskenel.java index 648faaf965..30df05b6ca 100644 --- a/Mage.Sets/src/mage/cards/n/NadierAgentOfTheDuskenel.java +++ b/Mage.Sets/src/mage/cards/n/NadierAgentOfTheDuskenel.java @@ -88,7 +88,7 @@ class NadierAgentOfTheDuskenelEffect extends OneShotEffect { return false; } Permanent permanent = (Permanent) obj; - if (!permanent.isCreature() || permanent.getPower().getValue() < 1) { + if (!permanent.isCreature(game) || permanent.getPower().getValue() < 1) { return false; } return new ElfWarriorToken().putOntoBattlefield(permanent.getPower().getValue(), game, source, source.getControllerId() diff --git a/Mage.Sets/src/mage/cards/n/NahirisLithoforming.java b/Mage.Sets/src/mage/cards/n/NahirisLithoforming.java index 778d95f3d5..612f280fba 100644 --- a/Mage.Sets/src/mage/cards/n/NahirisLithoforming.java +++ b/Mage.Sets/src/mage/cards/n/NahirisLithoforming.java @@ -118,7 +118,7 @@ class NahirisLithoformingTappedEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (source.getControllerId().equals(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java b/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java index 205b132dc7..b13e842261 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java +++ b/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java @@ -73,8 +73,8 @@ class NarsetEnlightenedMasterExileEffect extends OneShotEffect { player.moveCards(cards, Zone.EXILED, source, game); for (Card card : cards) { if (game.getState().getZone(card.getId()) == Zone.EXILED - && !card.isCreature() - && !card.isLand()) { + && !card.isCreature(game) + && !card.isLand(game)) { ContinuousEffect effect = new NarsetEnlightenedMasterCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card, game)); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/n/NarsetOfTheAncientWay.java b/Mage.Sets/src/mage/cards/n/NarsetOfTheAncientWay.java index 00c0cd9b37..b69562ce7e 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetOfTheAncientWay.java +++ b/Mage.Sets/src/mage/cards/n/NarsetOfTheAncientWay.java @@ -102,7 +102,7 @@ class NarsetOfTheAncientWayManaCondition extends ManaCondition implements Condit return false; } MageObject object = game.getObject(source.getSourceId()); - return object != null && !object.isCreature(); + return object != null && !object.isCreature(game); } @Override @@ -139,7 +139,7 @@ class NarsetOfTheAncientWayDrawEffect extends OneShotEffect { return false; } Card card = player.discardOne(false, false, source, game); - if (card == null || card.isLand()) { + if (card == null || card.isLand(game)) { return false; } ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java index 2a1f55ae4d..5881b72d53 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java +++ b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java @@ -90,7 +90,7 @@ class NarsetTranscendentEffect1 extends OneShotEffect { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards(sourceObject.getIdName(), cards, game); - if (!card.isCreature() && !card.isLand()) { + if (!card.isCreature(game) && !card.isLand(game)) { if (controller.chooseUse(outcome, "Reveal " + card.getLogName() + " and put it into your hand?", source, game)) { controller.moveCards(card, Zone.HAND, source, game); controller.revealCards(sourceObject.getIdName(), cards, game); @@ -129,7 +129,7 @@ class NarsetTranscendentTriggeredAbility extends DelayedTriggeredAbility { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getFromZone() == Zone.HAND) { if (spell.getCard() != null - && spell.getCard().isInstantOrSorcery()) { + && spell.getCard().isInstantOrSorcery(game)) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(spell.getId())); } diff --git a/Mage.Sets/src/mage/cards/n/NascentMetamorph.java b/Mage.Sets/src/mage/cards/n/NascentMetamorph.java index 3d35080cd4..2900f74532 100644 --- a/Mage.Sets/src/mage/cards/n/NascentMetamorph.java +++ b/Mage.Sets/src/mage/cards/n/NascentMetamorph.java @@ -76,7 +76,7 @@ class NascentMetamorphEffect extends OneShotEffect { Card toCopy = null; for (Card card : player.getLibrary().getCards(game)) { toReveal.add(card); - if (card == null || !card.isCreature()) { + if (card == null || !card.isCreature(game)) { continue; } toCopy = card; diff --git a/Mage.Sets/src/mage/cards/n/NecroticOoze.java b/Mage.Sets/src/mage/cards/n/NecroticOoze.java index 383b4d3e90..ddce676fbc 100644 --- a/Mage.Sets/src/mage/cards/n/NecroticOoze.java +++ b/Mage.Sets/src/mage/cards/n/NecroticOoze.java @@ -63,7 +63,7 @@ public final class NecroticOoze extends CardImpl { Player player = game.getPlayer(playerId); if (player != null) { for (Card card : player.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { for (Ability ability : card.getAbilities(game)) { if (ability instanceof ActivatedAbility && !perm.getAbilities().contains(ability)) { diff --git a/Mage.Sets/src/mage/cards/n/NestOfScarabs.java b/Mage.Sets/src/mage/cards/n/NestOfScarabs.java index 2a135405ad..c759de2aa8 100644 --- a/Mage.Sets/src/mage/cards/n/NestOfScarabs.java +++ b/Mage.Sets/src/mage/cards/n/NestOfScarabs.java @@ -62,7 +62,7 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { getEffects().setValue("countersAdded", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/cards/n/NetherShadow.java b/Mage.Sets/src/mage/cards/n/NetherShadow.java index de9674d7bf..d3828ab680 100644 --- a/Mage.Sets/src/mage/cards/n/NetherShadow.java +++ b/Mage.Sets/src/mage/cards/n/NetherShadow.java @@ -70,7 +70,7 @@ class NetherShadowTriggerdAbility extends BeginningOfUpkeepTriggeredAbility{ } else{ Card card = game.getCard(uuid); - if(card != null && card.isCreature()){ + if(card != null && card.isCreature(game)){ count++; } } diff --git a/Mage.Sets/src/mage/cards/n/NetherTraitor.java b/Mage.Sets/src/mage/cards/n/NetherTraitor.java index 8d2629f068..6a66d196ab 100644 --- a/Mage.Sets/src/mage/cards/n/NetherTraitor.java +++ b/Mage.Sets/src/mage/cards/n/NetherTraitor.java @@ -82,7 +82,7 @@ class NetherTraitorTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.isDiesEvent()) { if (zEvent.getTarget() != null && zEvent.getTarget().isOwnedBy(this.getControllerId()) && - zEvent.getTarget().isCreature()&& + zEvent.getTarget().isCreature(game)&& !zEvent.getTarget().getId().equals(this.getSourceId())) { return true; } diff --git a/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java b/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java index 83a063c23a..5dfb644671 100644 --- a/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java +++ b/Mage.Sets/src/mage/cards/n/NeurokFamiliar.java @@ -78,7 +78,7 @@ class NeurokFamiliarEffect extends OneShotEffect { if (card != null) { Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isArtifact()) { + if (card.isArtifact(game)) { controller.moveCards(card, Zone.HAND, source, game); } else { controller.moveCards(card, Zone.GRAVEYARD, source, game); diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java b/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java index e49404b6c1..a496767a99 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java @@ -164,7 +164,7 @@ class NicolBolasGodPharaohPlusTwoEffect extends OneShotEffect { continue; } opponent.moveCards(card, Zone.EXILED, source, game); - if (card.isLand()) { + if (card.isLand(game)) { continue; } ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, TargetController.YOU, Duration.EndOfTurn, true); diff --git a/Mage.Sets/src/mage/cards/n/NikyaOfTheOldWays.java b/Mage.Sets/src/mage/cards/n/NikyaOfTheOldWays.java index cdb990392d..ac2374c738 100644 --- a/Mage.Sets/src/mage/cards/n/NikyaOfTheOldWays.java +++ b/Mage.Sets/src/mage/cards/n/NikyaOfTheOldWays.java @@ -80,7 +80,7 @@ class NikyaOfTheOldWaysCantCastEffect extends ContinuousRuleModifyingEffectImpl public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { Card card = game.getCard(event.getSourceId()); - return card != null && !card.isCreature(); + return card != null && !card.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java index b233244d4c..15ff6988cf 100644 --- a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java +++ b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java @@ -19,7 +19,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; @@ -96,7 +95,7 @@ class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl { && permanent.isOwnedBy(this.controllerId) && zEvent.isDiesEvent() && !(permanent instanceof PermanentToken) - && permanent.isCreature()) { + && permanent.isCreature(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game) + 1)); return true; diff --git a/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java b/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java index 417626c5db..0d50bfa2ba 100644 --- a/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java +++ b/Mage.Sets/src/mage/cards/n/NissaSageAnimist.java @@ -90,7 +90,7 @@ class NissaSageAnimistPlusOneEffect extends OneShotEffect { } controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); Zone targetZone = Zone.HAND; - if (card.isLand()) { + if (card.isLand(game)) { targetZone = Zone.BATTLEFIELD; } return controller.moveCards(card, targetZone, source, game); diff --git a/Mage.Sets/src/mage/cards/n/NissasRevelation.java b/Mage.Sets/src/mage/cards/n/NissasRevelation.java index 0f45236c23..6d22867dd0 100644 --- a/Mage.Sets/src/mage/cards/n/NissasRevelation.java +++ b/Mage.Sets/src/mage/cards/n/NissasRevelation.java @@ -68,7 +68,7 @@ class NissasRevelationEffect extends OneShotEffect { Cards cards = new CardsImpl(); cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.drawCards(card.getPower().getValue(), source, game); controller.gainLife(card.getToughness().getValue(), game, source); } diff --git a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java index 8b1e107973..669fc8331f 100644 --- a/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java +++ b/Mage.Sets/src/mage/cards/n/NivixAerieOfTheFiremind.java @@ -77,7 +77,7 @@ class NivixAerieOfTheFiremindEffect extends OneShotEffect { Card card = library.getFromTop(game); if (card != null && controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)) - && card.isInstantOrSorcery()) { + && card.isInstantOrSorcery(game)) { ContinuousEffect effect = new NivixAerieOfTheFiremindCanCastEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/n/NoMercy.java b/Mage.Sets/src/mage/cards/n/NoMercy.java index bc4a87b6e7..d2179a5b7b 100644 --- a/Mage.Sets/src/mage/cards/n/NoMercy.java +++ b/Mage.Sets/src/mage/cards/n/NoMercy.java @@ -10,7 +10,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -60,7 +59,7 @@ public final class NoMercy extends CardImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { this.getEffects().setTargetPointer(new FixedTarget(permanent, game)); return true; } diff --git a/Mage.Sets/src/mage/cards/n/NoblePurpose.java b/Mage.Sets/src/mage/cards/n/NoblePurpose.java index ff867527a5..2e57ccc36c 100644 --- a/Mage.Sets/src/mage/cards/n/NoblePurpose.java +++ b/Mage.Sets/src/mage/cards/n/NoblePurpose.java @@ -11,7 +11,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -64,7 +63,7 @@ class NoblePurposeTriggeredAbility extends TriggeredAbilityImpl { DamagedEvent damageEvent = (DamagedEvent) event; if (damageEvent.isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) { this.getEffects().clear(); this.getEffects().add(new GainLifeEffect(damageEvent.getAmount())); diff --git a/Mage.Sets/src/mage/cards/n/NullRod.java b/Mage.Sets/src/mage/cards/n/NullRod.java index 7873ef6d42..577189136b 100644 --- a/Mage.Sets/src/mage/cards/n/NullRod.java +++ b/Mage.Sets/src/mage/cards/n/NullRod.java @@ -48,7 +48,7 @@ class NullRodCantActivateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isArtifact(); + return permanent.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/n/NullhideFerox.java b/Mage.Sets/src/mage/cards/n/NullhideFerox.java index 2a11aea1fe..4c719717bc 100644 --- a/Mage.Sets/src/mage/cards/n/NullhideFerox.java +++ b/Mage.Sets/src/mage/cards/n/NullhideFerox.java @@ -95,7 +95,7 @@ class NullhideFeroxCantCastEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { Card card = game.getCard(event.getSourceId()); - return card != null && !card.isCreature(); + return card != null && !card.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java b/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java index 4385ae3144..53fdcaf535 100644 --- a/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java +++ b/Mage.Sets/src/mage/cards/n/NullstoneGargoyle.java @@ -71,7 +71,7 @@ class NullstoneGargoyleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getSpell(event.getTargetId()); - if (spell.isCreature()) { + if (spell.isCreature(game)) { return false; } SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class); diff --git a/Mage.Sets/src/mage/cards/n/NykthosParagon.java b/Mage.Sets/src/mage/cards/n/NykthosParagon.java index 40ffbb9a8b..73027ff59e 100644 --- a/Mage.Sets/src/mage/cards/n/NykthosParagon.java +++ b/Mage.Sets/src/mage/cards/n/NykthosParagon.java @@ -125,7 +125,7 @@ class NykthosParagonEffect extends OneShotEffect { Integer life = (Integer) this.getValue("gainedLife"); if (controller != null && sourceObject != null && life != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { permanent.addCounters(CounterType.P1P1.createInstance(life), source.getControllerId(), source, game); if (!game.isSimulation()) { game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + life diff --git a/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java b/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java index 63fb63780c..1d28a140f7 100644 --- a/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java +++ b/Mage.Sets/src/mage/cards/n/NyleaKeenEyed.java @@ -89,7 +89,7 @@ class NyleaKeenEyedEffect extends OneShotEffect { return false; } player.revealCards(source, new CardsImpl(card), game); - if (card.isCreature()) { + if (card.isCreature(game)) { return player.moveCards(card, Zone.HAND, source, game); } if (!player.chooseUse(Outcome.Detriment, "Put " + card.getName() + " into your graveyard?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/o/OathOfChandra.java b/Mage.Sets/src/mage/cards/o/OathOfChandra.java index 1ffccad17a..e57dc28125 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfChandra.java +++ b/Mage.Sets/src/mage/cards/o/OathOfChandra.java @@ -92,7 +92,7 @@ class OathOfChandraWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD - && zEvent.getTarget().isPlaneswalker()) { + && zEvent.getTarget().isPlaneswalker(game)) { players.add(zEvent.getTarget().getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/o/OathOfDruids.java b/Mage.Sets/src/mage/cards/o/OathOfDruids.java index 46b0188a3e..ae1f201e04 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfDruids.java +++ b/Mage.Sets/src/mage/cards/o/OathOfDruids.java @@ -122,7 +122,7 @@ class OathOfDruidsEffect extends OneShotEffect { for (Card card : controller.getLibrary().getCards(game)) { revealed.add(card); // until they reveal a creature card. - if (card.isCreature()) { + if (card.isCreature(game)) { selectedCard = card; break; } else { diff --git a/Mage.Sets/src/mage/cards/o/OathOfGideon.java b/Mage.Sets/src/mage/cards/o/OathOfGideon.java index b62589a2c5..f374713465 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfGideon.java +++ b/Mage.Sets/src/mage/cards/o/OathOfGideon.java @@ -64,7 +64,7 @@ class OathOfGideonReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isPlaneswalker() + && creature.isPlaneswalker(game) && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/o/OathOfKaya.java b/Mage.Sets/src/mage/cards/o/OathOfKaya.java index 235d0d0ff7..9983228817 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfKaya.java +++ b/Mage.Sets/src/mage/cards/o/OathOfKaya.java @@ -81,7 +81,7 @@ class OathOfKayaTriggeredAbility extends TriggeredAbilityImpl { if (game.getCombat().isPlaneswalkerAttacked(you.getId(), game)) { for (UUID attacker : game.getCombat().getAttackers()) { Permanent attackingPermanent = game.getPermanent(attacker); - if (attackingPermanent != null && attackingPermanent.isCreature()) { + if (attackingPermanent != null && attackingPermanent.isCreature(game)) { getEffects().setTargetPointer(new FixedTarget(attackingPermanent.getControllerId(), game)); return true; } diff --git a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java index b014cbf745..4fdb3b498f 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java +++ b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java @@ -81,7 +81,7 @@ class OathOfLilianaWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD - && zEvent.getTarget().isPlaneswalker()) { + && zEvent.getTarget().isPlaneswalker(game)) { players.add(zEvent.getTarget().getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/o/OathOfNissa.java b/Mage.Sets/src/mage/cards/o/OathOfNissa.java index 5c7d6704c9..83381439d6 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfNissa.java +++ b/Mage.Sets/src/mage/cards/o/OathOfNissa.java @@ -132,7 +132,7 @@ class OathOfNissaSpendAnyManaEffect extends AsThoughEffectImpl implements AsThou objectId = CardUtil.getMainCardId(game, objectId); // for split cards if (source.isControlledBy(affectedControllerId)) { MageObject mageObject = game.getObject(objectId); - return mageObject != null && mageObject.isPlaneswalker(); + return mageObject != null && mageObject.isPlaneswalker(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/o/ObeliskSpider.java b/Mage.Sets/src/mage/cards/o/ObeliskSpider.java index 01fdf93343..b385f078ab 100644 --- a/Mage.Sets/src/mage/cards/o/ObeliskSpider.java +++ b/Mage.Sets/src/mage/cards/o/ObeliskSpider.java @@ -82,7 +82,7 @@ class ObeliskSpiderTriggeredAbility extends TriggeredAbilityImpl { permanent = game.getPermanentEntering(event.getTargetId()); } return (permanent != null - && permanent.isCreature()); + && permanent.isCreature(game)); } return false; diff --git a/Mage.Sets/src/mage/cards/o/OblivionStone.java b/Mage.Sets/src/mage/cards/o/OblivionStone.java index 1e8f900b76..0d3695ff2d 100644 --- a/Mage.Sets/src/mage/cards/o/OblivionStone.java +++ b/Mage.Sets/src/mage/cards/o/OblivionStone.java @@ -63,7 +63,7 @@ class OblivionStoneEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent p : game.getBattlefield().getAllActivePermanents()) { - if (!(p.isLand() || p.getCounters(game).containsKey(CounterType.FATE))) { + if (!(p.isLand(game) || p.getCounters(game).containsKey(CounterType.FATE))) { p.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/o/ObsidianCharmaw.java b/Mage.Sets/src/mage/cards/o/ObsidianCharmaw.java index f38091b1d2..753e468e5b 100644 --- a/Mage.Sets/src/mage/cards/o/ObsidianCharmaw.java +++ b/Mage.Sets/src/mage/cards/o/ObsidianCharmaw.java @@ -1,7 +1,6 @@ package mage.cards.o; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -84,7 +83,7 @@ enum ObsidianCharmawValue implements DynamicValue { sourceAbility.getControllerId(), sourceAbility.getSourceId(), game ).stream() .filter(Objects::nonNull) - .filter(MageObject::isLand) + .filter(permanent1 -> permanent1.isLand(game)) .filter(permanent -> permanent .getAbilities() .getActivatedManaAbilities(Zone.BATTLEFIELD) diff --git a/Mage.Sets/src/mage/cards/o/Occupation.java b/Mage.Sets/src/mage/cards/o/Occupation.java index c31cedff12..eb24b256b1 100644 --- a/Mage.Sets/src/mage/cards/o/Occupation.java +++ b/Mage.Sets/src/mage/cards/o/Occupation.java @@ -78,7 +78,7 @@ class OccupationTapEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java b/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java index b7d9bc0e3e..20d851174a 100644 --- a/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java +++ b/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java @@ -77,7 +77,7 @@ enum OldGrowthTrollCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Permanent permanent = (Permanent) source.getEffects().get(0).getValue("permanentLeftBattlefield"); - return permanent != null && permanent.isCreature(); + return permanent != null && permanent.isCreature(game); } } @@ -164,8 +164,8 @@ class OldGrowthTrollContinuousEffect extends ContinuousEffectImpl { Permanent troll = sourceObject; switch (layer) { case TypeChangingEffects_4: - troll.getCardType().clear(); - troll.addCardType(CardType.ENCHANTMENT); + troll.removeAllCardTypes(game); + troll.addCardType(game, CardType.ENCHANTMENT); troll.removeAllSubTypes(game); troll.addSubType(game, SubType.AURA); break; diff --git a/Mage.Sets/src/mage/cards/o/OmenMachine.java b/Mage.Sets/src/mage/cards/o/OmenMachine.java index 058e05f0b6..b0c7a5bf1d 100644 --- a/Mage.Sets/src/mage/cards/o/OmenMachine.java +++ b/Mage.Sets/src/mage/cards/o/OmenMachine.java @@ -18,7 +18,6 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -98,7 +97,7 @@ class OmenMachineEffect2 extends OneShotEffect { Card card = player.getLibrary().getFromTop(game); if (card != null) { player.moveCards(card, Zone.EXILED, source, game); - if (card.isLand()) { + if (card.isLand(game)) { player.moveCards(card, Zone.BATTLEFIELD, source, game); } else { player.cast(card.getSpellAbility(), game, true, new ApprovingObject(source, game)); diff --git a/Mage.Sets/src/mage/cards/o/OneWithTheStars.java b/Mage.Sets/src/mage/cards/o/OneWithTheStars.java index 9b145c93d3..366ece0b2c 100644 --- a/Mage.Sets/src/mage/cards/o/OneWithTheStars.java +++ b/Mage.Sets/src/mage/cards/o/OneWithTheStars.java @@ -89,8 +89,8 @@ class OneWithTheStarsEffect extends ContinuousEffectImpl { } permanent.setIsAllCreatureTypes(game, false); permanent.retainAllEnchantmentSubTypes(game); - permanent.getCardType().clear(); - permanent.addCardType(CardType.ENCHANTMENT); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.ENCHANTMENT); return true; } } diff --git a/Mage.Sets/src/mage/cards/o/OonasBlackguard.java b/Mage.Sets/src/mage/cards/o/OonasBlackguard.java index 9c8b990c2f..03736059a4 100644 --- a/Mage.Sets/src/mage/cards/o/OonasBlackguard.java +++ b/Mage.Sets/src/mage/cards/o/OonasBlackguard.java @@ -74,7 +74,7 @@ class OonasBlackguardReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && creature.hasSubtype(SubType.ROGUE, game) && !event.getTargetId().equals(source.getSourceId())) { return true; diff --git a/Mage.Sets/src/mage/cards/o/OpalAvenger.java b/Mage.Sets/src/mage/cards/o/OpalAvenger.java index 6484a5527b..7a04a1acc8 100644 --- a/Mage.Sets/src/mage/cards/o/OpalAvenger.java +++ b/Mage.Sets/src/mage/cards/o/OpalAvenger.java @@ -63,7 +63,7 @@ class OpalAvengerStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkInterveningIfClause(Game game) { if (getSourcePermanentIfItStillExists(game) != null) { - return getSourcePermanentIfItStillExists(game).isEnchantment(); + return getSourcePermanentIfItStillExists(game).isEnchantment(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/o/OpalTitan.java b/Mage.Sets/src/mage/cards/o/OpalTitan.java index 8f1fdb616b..b6872753b9 100644 --- a/Mage.Sets/src/mage/cards/o/OpalTitan.java +++ b/Mage.Sets/src/mage/cards/o/OpalTitan.java @@ -88,8 +88,8 @@ class OpalTitanBecomesCreatureEffect extends ContinuousEffectImpl implements Sou switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - permanent.getCardType().clear(); - permanent.addCardType(CardType.CREATURE); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); permanent.addSubType(game, SubType.GIANT); } diff --git a/Mage.Sets/src/mage/cards/o/Opalescence.java b/Mage.Sets/src/mage/cards/o/Opalescence.java index 1d897919a3..633f335bc2 100644 --- a/Mage.Sets/src/mage/cards/o/Opalescence.java +++ b/Mage.Sets/src/mage/cards/o/Opalescence.java @@ -75,8 +75,8 @@ public final class Opalescence extends CardImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/o/OpenSeason.java b/Mage.Sets/src/mage/cards/o/OpenSeason.java index 4df509f1fa..80c7a4c644 100644 --- a/Mage.Sets/src/mage/cards/o/OpenSeason.java +++ b/Mage.Sets/src/mage/cards/o/OpenSeason.java @@ -85,7 +85,7 @@ class OpenSeasonRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature() + return permanent.isCreature(game) && permanent.getCounters(game).getCount(CounterType.BOUNTY) > 0 && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/o/OpenTheOmenpaths.java b/Mage.Sets/src/mage/cards/o/OpenTheOmenpaths.java index e76e3239da..3b72e24161 100644 --- a/Mage.Sets/src/mage/cards/o/OpenTheOmenpaths.java +++ b/Mage.Sets/src/mage/cards/o/OpenTheOmenpaths.java @@ -88,7 +88,7 @@ class OpenTheOmenpathsCondition extends ManaCondition implements Condition { return false; } MageObject object = game.getObject(source.getSourceId()); - return object != null && (object.isCreature() || object.isEnchantment()); + return object != null && (object.isCreature(game) || object.isEnchantment(game)); } @Override diff --git a/Mage.Sets/src/mage/cards/o/OpenTheVaults.java b/Mage.Sets/src/mage/cards/o/OpenTheVaults.java index 6c2bc284ca..6deeb31086 100644 --- a/Mage.Sets/src/mage/cards/o/OpenTheVaults.java +++ b/Mage.Sets/src/mage/cards/o/OpenTheVaults.java @@ -65,7 +65,7 @@ class OpenTheVaultsEffect extends OneShotEffect { for (UUID cardId : graveyard) { Card card = game.getCard(cardId); if (card != null - && (card.isEnchantment() || card.isArtifact())) { + && (card.isEnchantment(game) || card.isArtifact(game))) { cardsToReturn.add(card); } } diff --git a/Mage.Sets/src/mage/cards/o/OranRiefHydra.java b/Mage.Sets/src/mage/cards/o/OranRiefHydra.java index e8bf6c8111..27f88e0d5b 100644 --- a/Mage.Sets/src/mage/cards/o/OranRiefHydra.java +++ b/Mage.Sets/src/mage/cards/o/OranRiefHydra.java @@ -78,7 +78,7 @@ class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isLand() + && permanent.isLand(game) && permanent.isControlledBy(getControllerId())) { Permanent sourcePermanent = game.getPermanent(getSourceId()); if (sourcePermanent != null) { diff --git a/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java b/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java index 8632aeb06c..d5d3d698fc 100644 --- a/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java +++ b/Mage.Sets/src/mage/cards/o/OrbsOfWarding.java @@ -62,7 +62,7 @@ class OrbsOfWardingEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getControllerId())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/o/OriqLoremage.java b/Mage.Sets/src/mage/cards/o/OriqLoremage.java index 12c8efe52a..e1f3daa3ce 100644 --- a/Mage.Sets/src/mage/cards/o/OriqLoremage.java +++ b/Mage.Sets/src/mage/cards/o/OriqLoremage.java @@ -80,7 +80,7 @@ class OriqLoremageEffect extends OneShotEffect { player.moveCards(card, Zone.GRAVEYARD, source, game); player.shuffleLibrary(source, game); Permanent permanent = source.getSourcePermanentIfItStillExists(game); - if (!card.isInstantOrSorcery() || permanent == null) { + if (!card.isInstantOrSorcery(game) || permanent == null) { return true; } permanent.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game); diff --git a/Mage.Sets/src/mage/cards/o/Overmaster.java b/Mage.Sets/src/mage/cards/o/Overmaster.java index 9cb336648a..0dd8c73c6c 100644 --- a/Mage.Sets/src/mage/cards/o/Overmaster.java +++ b/Mage.Sets/src/mage/cards/o/Overmaster.java @@ -115,7 +115,7 @@ class OvermasterWatcher extends Watcher { if (event.getType() == GameEvent.EventType.SPELL_CAST && ready) { if (uncounterableSpell == null && event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isSorcery() || spell.isInstant())) { + if (spell != null && (spell.isSorcery(game) || spell.isInstant(game))) { uncounterableSpell = spell.getId(); ready = false; } diff --git a/Mage.Sets/src/mage/cards/p/PakoArcaneRetriever.java b/Mage.Sets/src/mage/cards/p/PakoArcaneRetriever.java index 805c31fa51..c7efce02e4 100644 --- a/Mage.Sets/src/mage/cards/p/PakoArcaneRetriever.java +++ b/Mage.Sets/src/mage/cards/p/PakoArcaneRetriever.java @@ -105,7 +105,7 @@ class PakoArcaneRetrieverEffect extends OneShotEffect { cards.getCards(game) .stream() .filter(card -> card.addCounters(CounterType.FETCH.createInstance(), source.getControllerId(), source, game)) - .filter(card -> !card.isCreature()) + .filter(card -> !card.isCreature(game)) .forEach(card -> watcher.addCard(controller.getId(), card, game)); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent == null || counters == 0) { diff --git a/Mage.Sets/src/mage/cards/p/PaleMoon.java b/Mage.Sets/src/mage/cards/p/PaleMoon.java index 165490904e..48a5f4e42a 100644 --- a/Mage.Sets/src/mage/cards/p/PaleMoon.java +++ b/Mage.Sets/src/mage/cards/p/PaleMoon.java @@ -2,7 +2,7 @@ package mage.cards.p; import java.util.UUID; -import mage.MageObject; + import mage.Mana; import mage.abilities.Ability; import mage.abilities.effects.ReplacementEffectImpl; @@ -14,7 +14,6 @@ import mage.constants.Outcome; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; @@ -80,7 +79,7 @@ class PaleMoonReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return filter.match(permanent, game); } return false; diff --git a/Mage.Sets/src/mage/cards/p/Panharmonicon.java b/Mage.Sets/src/mage/cards/p/Panharmonicon.java index 94897ff1ac..0c3fd099f2 100644 --- a/Mage.Sets/src/mage/cards/p/Panharmonicon.java +++ b/Mage.Sets/src/mage/cards/p/Panharmonicon.java @@ -14,7 +14,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.NumberOfTriggersEvent; /** @@ -74,8 +73,8 @@ class PanharmoniconEffect extends ReplacementEffectImpl { && sourceEvent instanceof EntersTheBattlefieldEvent) { EntersTheBattlefieldEvent entersTheBattlefieldEvent = (EntersTheBattlefieldEvent) sourceEvent; // Only for entering artifacts or creatures - if (entersTheBattlefieldEvent.getTarget().isArtifact() - || entersTheBattlefieldEvent.getTarget().isCreature()) { + if (entersTheBattlefieldEvent.getTarget().isArtifact(game) + || entersTheBattlefieldEvent.getTarget().isCreature(game)) { // Only for triggers of permanents if (game.getPermanent(numberOfTriggersEvent.getSourceId()) != null) { return true; diff --git a/Mage.Sets/src/mage/cards/p/Parcelbeast.java b/Mage.Sets/src/mage/cards/p/Parcelbeast.java index 6df3f1873e..bea62d7e04 100644 --- a/Mage.Sets/src/mage/cards/p/Parcelbeast.java +++ b/Mage.Sets/src/mage/cards/p/Parcelbeast.java @@ -80,7 +80,7 @@ class ParcelbeastEffect extends OneShotEffect { return false; } player.lookAtCards("", card, game); - if (card.isLand() && player.chooseUse( + if (card.isLand(game) && player.chooseUse( outcome, "Put " + card.getName() + " onto the battlefield?", "(otherwise put it into your hand", "To battlefield", "To hand", source, game)) { diff --git a/Mage.Sets/src/mage/cards/p/Paroxysm.java b/Mage.Sets/src/mage/cards/p/Paroxysm.java index 98c4b340ca..c3b1a0228d 100644 --- a/Mage.Sets/src/mage/cards/p/Paroxysm.java +++ b/Mage.Sets/src/mage/cards/p/Paroxysm.java @@ -93,7 +93,7 @@ class ParoxysmEffect extends OneShotEffect { if (revealCardFromTop != null) { Cards cards = new CardsImpl(revealCardFromTop); controllerOfCreature.revealCards(source, cards, game); - if (revealCardFromTop.isLand()) { + if (revealCardFromTop.isLand(game)) { creatureAttachedTo.destroy(source, game, false); } else { ContinuousEffect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn); diff --git a/Mage.Sets/src/mage/cards/p/PastInFlames.java b/Mage.Sets/src/mage/cards/p/PastInFlames.java index e8339f0280..509c98ec84 100644 --- a/Mage.Sets/src/mage/cards/p/PastInFlames.java +++ b/Mage.Sets/src/mage/cards/p/PastInFlames.java @@ -1,6 +1,5 @@ package mage.cards.p; -import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; @@ -64,7 +63,7 @@ class PastInFlamesEffect extends ContinuousEffectImpl { if (this.affectedObjectsSet) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - player.getGraveyard().stream().map((cardId) -> game.getCard(cardId)).filter(MageObject::isInstantOrSorcery).forEachOrdered((card) -> { + player.getGraveyard().stream().map((cardId) -> game.getCard(cardId)).filter(card1 -> card1.isInstantOrSorcery(game)).forEachOrdered((card) -> { affectedObjectList.add(new MageObjectReference(card, game)); }); } @@ -79,9 +78,9 @@ class PastInFlamesEffect extends ContinuousEffectImpl { Card card = game.getCard(cardId); if (card != null) { FlashbackAbility ability = null; - if (card.isInstant()) { + if (card.isInstant(game)) { ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); - } else if (card.isSorcery()) { + } else if (card.isSorcery(game)) { ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); } if (ability != null) { diff --git a/Mage.Sets/src/mage/cards/p/PatientRebuilding.java b/Mage.Sets/src/mage/cards/p/PatientRebuilding.java index e54baa49e5..31a9a63304 100644 --- a/Mage.Sets/src/mage/cards/p/PatientRebuilding.java +++ b/Mage.Sets/src/mage/cards/p/PatientRebuilding.java @@ -71,7 +71,7 @@ class PatientRebuildingEffect extends OneShotEffect { int numberOfLandCards = 0; Set movedCards = player.millCards(3, source, game).getCards(game); for (Card card : movedCards) { - if (card.isLand()) { + if (card.isLand(game)) { numberOfLandCards++; } } diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java b/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java index a9119309e1..df94f64b77 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java @@ -99,7 +99,7 @@ class PatronOfTheVeinCreatureDiesTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).isDiesEvent()) { if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { Card creature = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (creature != null && creature.isCreature()) { + if (creature != null && creature.isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(creature.getId())); } diff --git a/Mage.Sets/src/mage/cards/p/PeaceTalks.java b/Mage.Sets/src/mage/cards/p/PeaceTalks.java index 79d01f6043..5a7f19dab1 100644 --- a/Mage.Sets/src/mage/cards/p/PeaceTalks.java +++ b/Mage.Sets/src/mage/cards/p/PeaceTalks.java @@ -91,7 +91,7 @@ class PeaceTalksCantAttackEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature(); + return permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/p/Peacekeeper.java b/Mage.Sets/src/mage/cards/p/Peacekeeper.java index e6d0fab885..c03256df29 100644 --- a/Mage.Sets/src/mage/cards/p/Peacekeeper.java +++ b/Mage.Sets/src/mage/cards/p/Peacekeeper.java @@ -57,7 +57,7 @@ class PeacekeeperCantAttackEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature(); + return permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/p/PedanticLearning.java b/Mage.Sets/src/mage/cards/p/PedanticLearning.java index 0ea6ecaeee..90b64d3527 100644 --- a/Mage.Sets/src/mage/cards/p/PedanticLearning.java +++ b/Mage.Sets/src/mage/cards/p/PedanticLearning.java @@ -61,7 +61,7 @@ class PedanticLearningTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); if (cardOwnerId != null && card.isOwnedBy(getControllerId()) - && card.isLand()) { + && card.isLand(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PermafrostTrap.java b/Mage.Sets/src/mage/cards/p/PermafrostTrap.java index 84ea3520db..0403f4a816 100644 --- a/Mage.Sets/src/mage/cards/p/PermafrostTrap.java +++ b/Mage.Sets/src/mage/cards/p/PermafrostTrap.java @@ -60,7 +60,7 @@ enum PermafrostTrapCondition implements Condition { List permanents = watcher.getThisTurnEnteringPermanents(opponentId); if (permanents != null) { for (Permanent permanent : permanents) { - if (permanent.isCreature() && permanent.getColor(game).isGreen()) { + if (permanent.isCreature(game) && permanent.getColor(game).isGreen()) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PestilenceDemon.java b/Mage.Sets/src/mage/cards/p/PestilenceDemon.java index b856995f63..90c376e646 100644 --- a/Mage.Sets/src/mage/cards/p/PestilenceDemon.java +++ b/Mage.Sets/src/mage/cards/p/PestilenceDemon.java @@ -59,7 +59,7 @@ class PestilenceDemonEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { for (UUID permanentId : game.getBattlefield().getAllPermanentIds()) { Permanent p = game.getPermanent(permanentId); - if (p != null && p.isCreature()) { + if (p != null && p.isCreature(game)) { p.damage(1, source.getSourceId(), source, game, false, true); } } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianMetamorph.java b/Mage.Sets/src/mage/cards/p/PhyrexianMetamorph.java index e50d5505b8..8acb010d79 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianMetamorph.java @@ -44,8 +44,8 @@ public final class PhyrexianMetamorph extends CardImpl { CopyApplier phyrexianMetamorphCopyApplier = new CopyApplier() { @Override public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) { - if (!blueprint.isArtifact()) { - blueprint.addCardType(CardType.ARTIFACT); + if (!blueprint.isArtifact(game)) { + blueprint.addCardType(game, CardType.ARTIFACT); } return true; } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianTotem.java b/Mage.Sets/src/mage/cards/p/PhyrexianTotem.java index 645aec63ee..2bb514daa1 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianTotem.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianTotem.java @@ -92,7 +92,7 @@ class PhyrexianTotemTriggeredAbility extends TriggeredAbilityImpl { public boolean checkInterveningIfClause(Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(getSourceId()); if (permanent != null) { - return permanent.isCreature(); + return permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java b/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java index 8e0b6619cd..befe0cefbf 100644 --- a/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java +++ b/Mage.Sets/src/mage/cards/p/PistonFistCyclops.java @@ -76,7 +76,7 @@ enum PistonFistCyclopsCondition implements Condition { } for (Spell spell : spells) { if (!spell.getSourceId().equals(source.getSourceId()) - && spell.isInstantOrSorcery()) { + && spell.isInstantOrSorcery(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java b/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java index 565c3a6c02..b20ed2ff54 100644 --- a/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java +++ b/Mage.Sets/src/mage/cards/p/PlaneswalkersMischief.java @@ -74,8 +74,8 @@ class PlaneswalkersMischiefEffect extends OneShotEffect { } Cards cards = new CardsImpl(revealedCard); opponent.revealCards(source, cards, game); - if (revealedCard.isInstant() - || revealedCard.isSorcery()) { + if (revealedCard.isInstant(game) + || revealedCard.isSorcery(game)) { opponent.moveCardToExileWithInfo(revealedCard, source.getSourceId(), "Planeswalker's Mischief", source, game, Zone.HAND, true); AsThoughEffect effect = new PlaneswalkersMischiefCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(revealedCard.getId())); diff --git a/Mage.Sets/src/mage/cards/p/PlarggDeanOfChaos.java b/Mage.Sets/src/mage/cards/p/PlarggDeanOfChaos.java index 0468eceb13..e13e052308 100644 --- a/Mage.Sets/src/mage/cards/p/PlarggDeanOfChaos.java +++ b/Mage.Sets/src/mage/cards/p/PlarggDeanOfChaos.java @@ -120,7 +120,7 @@ class PlarggDeanOfChaosEffect extends OneShotEffect { Card eligibleCard = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); - if (!card.isLand() && !card.isLegendary() && card.getManaValue() < 4) { + if (!card.isLand(game) && !card.isLegendary() && card.getManaValue() < 4) { eligibleCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/p/Polymorph.java b/Mage.Sets/src/mage/cards/p/Polymorph.java index 9accdc6294..a3da10887a 100644 --- a/Mage.Sets/src/mage/cards/p/Polymorph.java +++ b/Mage.Sets/src/mage/cards/p/Polymorph.java @@ -74,7 +74,7 @@ class PolymorphEffect extends OneShotEffect { Card toBattlefield = null; for (Card card : library.getCards(game)) { cards.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { toBattlefield = card; break; } diff --git a/Mage.Sets/src/mage/cards/p/PossibilityStorm.java b/Mage.Sets/src/mage/cards/p/PossibilityStorm.java index 6593c79dcf..be94a252b8 100644 --- a/Mage.Sets/src/mage/cards/p/PossibilityStorm.java +++ b/Mage.Sets/src/mage/cards/p/PossibilityStorm.java @@ -1,7 +1,5 @@ package mage.cards.p; -import java.util.ArrayList; -import java.util.UUID; import mage.ApprovingObject; import mage.MageObject; import mage.abilities.Ability; @@ -17,14 +15,15 @@ import mage.constants.Zone; import mage.game.ExileZone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.players.Library; import mage.players.Player; import mage.target.targetpointer.FixedTarget; +import java.util.List; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class PossibilityStorm extends CardImpl { @@ -123,10 +122,10 @@ class PossibilityStormEffect extends OneShotEffect { if (card != null) { spellController.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName()); } - } while (library.hasCards() && card != null && !sharesType(card, spell.getCardType())); + } while (library.hasCards() && card != null && !sharesType(card, spell.getCardType(game), game)); - if (card != null && sharesType(card, spell.getCardType()) - && !card.isLand() + if (card != null && sharesType(card, spell.getCardType(game), game) + && !card.isLand(game) && card.getSpellAbility().canChooseTarget(game, spellController.getId())) { if (spellController.chooseUse(Outcome.PlayForFree, "Cast " + card.getLogName() + " without paying cost?", source, game)) { spellController.cast(card.getSpellAbility(), game, true, new ApprovingObject(source, game)); @@ -145,8 +144,8 @@ class PossibilityStormEffect extends OneShotEffect { return false; } - private boolean sharesType(Card card, ArrayList cardTypes) { - for (CardType type : card.getCardType()) { + private boolean sharesType(Card card, List cardTypes, Game game) { + for (CardType type : card.getCardType(game)) { if (cardTypes.contains(type)) { return true; } diff --git a/Mage.Sets/src/mage/cards/p/PowerDepot.java b/Mage.Sets/src/mage/cards/p/PowerDepot.java index 2d379362e1..73b5ea4fe6 100644 --- a/Mage.Sets/src/mage/cards/p/PowerDepot.java +++ b/Mage.Sets/src/mage/cards/p/PowerDepot.java @@ -75,6 +75,6 @@ enum PowerDepotCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - return object != null && object.isArtifact(); + return object != null && object.isArtifact(game); } } diff --git a/Mage.Sets/src/mage/cards/p/Powerleech.java b/Mage.Sets/src/mage/cards/p/Powerleech.java index 42da8330f7..0ef4bd2737 100644 --- a/Mage.Sets/src/mage/cards/p/Powerleech.java +++ b/Mage.Sets/src/mage/cards/p/Powerleech.java @@ -66,7 +66,7 @@ class PowerleechTriggeredAbility extends TriggeredAbilityImpl { } if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent == null || !permanent.isArtifact()) { + if (permanent == null || !permanent.isArtifact(game)) { return false; } StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); @@ -78,7 +78,7 @@ class PowerleechTriggeredAbility extends TriggeredAbilityImpl { } if (event.getType() == GameEvent.EventType.TAPPED) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent == null || !permanent.isArtifact()) { + if (permanent == null || !permanent.isArtifact(game)) { return false; } return player.hasOpponent(permanent.getControllerId(), game); diff --git a/Mage.Sets/src/mage/cards/p/PrecursorGolem.java b/Mage.Sets/src/mage/cards/p/PrecursorGolem.java index 7efddf7d75..b35e5df9cc 100644 --- a/Mage.Sets/src/mage/cards/p/PrecursorGolem.java +++ b/Mage.Sets/src/mage/cards/p/PrecursorGolem.java @@ -81,7 +81,7 @@ class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } UUID targetGolem = null; diff --git a/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java b/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java index 5b65696427..4f05d6a527 100644 --- a/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java +++ b/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java @@ -74,7 +74,7 @@ class CastCreatureWatcher extends Watcher { && game.isActivePlayer(event.getPlayerId()) && game.getOpponents(controllerId).contains(event.getPlayerId())) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell.isCreature()) { + if (spell.isCreature(game)) { condition = true; } } diff --git a/Mage.Sets/src/mage/cards/p/PresenceOfTheMaster.java b/Mage.Sets/src/mage/cards/p/PresenceOfTheMaster.java index ad153a7c7d..6935386571 100644 --- a/Mage.Sets/src/mage/cards/p/PresenceOfTheMaster.java +++ b/Mage.Sets/src/mage/cards/p/PresenceOfTheMaster.java @@ -64,7 +64,7 @@ class PresenceOfTheMasterTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && (spell.isEnchantment())){ + if (spell != null && (spell.isEnchantment(game))){ for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/p/PriceOfGlory.java b/Mage.Sets/src/mage/cards/p/PriceOfGlory.java index 348c2ee3de..f6c14910e6 100644 --- a/Mage.Sets/src/mage/cards/p/PriceOfGlory.java +++ b/Mage.Sets/src/mage/cards/p/PriceOfGlory.java @@ -11,7 +11,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -64,7 +63,7 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl { if (permanent == null) { return false; } - if (permanent.isLand() + if (permanent.isLand(game) && game.getState().getPlayersInRange(controllerId, game).contains(permanent.getControllerId()) && !permanent.isControlledBy(game.getActivePlayerId())) { // intervening if clause getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/p/PrimalEmpathy.java b/Mage.Sets/src/mage/cards/p/PrimalEmpathy.java index 180813b72d..c4f3c0acbf 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalEmpathy.java +++ b/Mage.Sets/src/mage/cards/p/PrimalEmpathy.java @@ -70,7 +70,7 @@ class PrimalEmpathyEffect extends OneShotEffect { .getBattlefield() .getActivePermanents(source.getControllerId(), game) .stream() - .filter(Permanent::isCreature) + .filter(permanent1 -> permanent1.isCreature(game)) .map(Permanent::getPower) .mapToInt(MageInt::getValue) .max() @@ -78,7 +78,7 @@ class PrimalEmpathyEffect extends OneShotEffect { boolean flag = game.getBattlefield() .getAllActivePermanents(source.getControllerId()) .stream() - .filter(Permanent::isCreature) + .filter(permanent1 -> permanent1.isCreature(game)) .map(Permanent::getPower) .mapToInt(MageInt::getValue) .anyMatch(i -> i >= highestPower); diff --git a/Mage.Sets/src/mage/cards/p/PrimalSurge.java b/Mage.Sets/src/mage/cards/p/PrimalSurge.java index b6b1f970f5..909868e0db 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalSurge.java +++ b/Mage.Sets/src/mage/cards/p/PrimalSurge.java @@ -65,7 +65,7 @@ class PrimalSurgeEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCards(card, Zone.EXILED, source, game); - if (card.isPermanent() + if (card.isPermanent(game) && controller.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); repeat = true; diff --git a/Mage.Sets/src/mage/cards/p/PrimalVigor.java b/Mage.Sets/src/mage/cards/p/PrimalVigor.java index 377f203e93..45c6160af8 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalVigor.java +++ b/Mage.Sets/src/mage/cards/p/PrimalVigor.java @@ -110,7 +110,7 @@ class PrimalVigorCounterEffect extends ReplacementEffectImpl { if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - return permanent != null && event.getAmount() > 0 && permanent.isCreature() + return permanent != null && event.getAmount() > 0 && permanent.isCreature(game) && event.getData() != null && event.getData().equals("+1/+1"); } diff --git a/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java b/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java index 58cb83a4c9..fefca12943 100644 --- a/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java +++ b/Mage.Sets/src/mage/cards/p/PrimitiveEtchings.java @@ -13,7 +13,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -73,7 +72,7 @@ class PrimitiveEtchingsAbility extends TriggeredAbilityImpl { lastTriggeredTurn = game.getTurnNum(); controller.revealCards(sourcePermanent.getName(), new CardsImpl(card), game); this.getEffects().clear(); - if (card.isCreature()) { + if (card.isCreature(game)) { this.addEffect(new DrawCardSourceControllerEffect(1)); } return true; diff --git a/Mage.Sets/src/mage/cards/p/ProfaneMemento.java b/Mage.Sets/src/mage/cards/p/ProfaneMemento.java index caaa772710..56827266d6 100644 --- a/Mage.Sets/src/mage/cards/p/ProfaneMemento.java +++ b/Mage.Sets/src/mage/cards/p/ProfaneMemento.java @@ -11,7 +11,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; /** @@ -61,7 +60,7 @@ class ProfaneMementoTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.isCreature() && game.getOpponents(controllerId).contains(card.getOwnerId())) { + if (card != null && card.isCreature(game) && game.getOpponents(controllerId).contains(card.getOwnerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/ProperBurial.java b/Mage.Sets/src/mage/cards/p/ProperBurial.java index b26e970143..27e7547eaf 100644 --- a/Mage.Sets/src/mage/cards/p/ProperBurial.java +++ b/Mage.Sets/src/mage/cards/p/ProperBurial.java @@ -63,7 +63,7 @@ class ProperBurialTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.isControlledBy(this.getControllerId()) - && permanent.isCreature()) { + && permanent.isCreature(game)) { this.getEffects().clear(); this.addEffect(new GainLifeEffect(permanent.getToughness().getValue())); return true; diff --git a/Mage.Sets/src/mage/cards/p/Prophecy.java b/Mage.Sets/src/mage/cards/p/Prophecy.java index 466fab7f20..26d3f8daa7 100644 --- a/Mage.Sets/src/mage/cards/p/Prophecy.java +++ b/Mage.Sets/src/mage/cards/p/Prophecy.java @@ -78,7 +78,7 @@ class ProphecyEffect extends OneShotEffect { } cards.add(card); targetPlayer.revealCards(sourceObject.getIdName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { controller.gainLife(1, game, source); } targetPlayer.shuffleLibrary(source, game); diff --git a/Mage.Sets/src/mage/cards/p/ProteusStaff.java b/Mage.Sets/src/mage/cards/p/ProteusStaff.java index 6e405e1648..02cb5d0a06 100644 --- a/Mage.Sets/src/mage/cards/p/ProteusStaff.java +++ b/Mage.Sets/src/mage/cards/p/ProteusStaff.java @@ -78,7 +78,7 @@ class ProteusStaffEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { if (card != null) { - if (card.isCreature()) { + if (card.isCreature(game)) { // The player puts that card onto the battlefield controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; diff --git a/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java b/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java index 066b18c9b1..bda08e1af1 100644 --- a/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java +++ b/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java @@ -64,7 +64,7 @@ class ProvokeTheTrollsEffect extends OneShotEffect { if (permanent == null || permanent.damage(3, source.getSourceId(), source, game) < 1) { return false; } - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { game.addEffect(new BoostTargetEffect(3, 0), source); } return true; diff --git a/Mage.Sets/src/mage/cards/p/PsychicMiasma.java b/Mage.Sets/src/mage/cards/p/PsychicMiasma.java index 38a6e68d13..8289664922 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicMiasma.java +++ b/Mage.Sets/src/mage/cards/p/PsychicMiasma.java @@ -55,7 +55,7 @@ class PsychicMiasmaEffect extends OneShotEffect { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { Card discardedCard = player.discardOne(false, false, source, game); - if (discardedCard != null && discardedCard.isLand()) { + if (discardedCard != null && discardedCard.isLand(game)) { Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard(); if (spellCard != null) { player.moveCards(spellCard, Zone.HAND, source, game); diff --git a/Mage.Sets/src/mage/cards/p/PulseOfLlanowar.java b/Mage.Sets/src/mage/cards/p/PulseOfLlanowar.java index 7ac910fe1e..f22455c29d 100644 --- a/Mage.Sets/src/mage/cards/p/PulseOfLlanowar.java +++ b/Mage.Sets/src/mage/cards/p/PulseOfLlanowar.java @@ -87,7 +87,7 @@ class PulseOfLlanowarReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return filter.match(permanent, game); } return false; diff --git a/Mage.Sets/src/mage/cards/p/Purgatory.java b/Mage.Sets/src/mage/cards/p/Purgatory.java index 283230ab34..8fd479af93 100644 --- a/Mage.Sets/src/mage/cards/p/Purgatory.java +++ b/Mage.Sets/src/mage/cards/p/Purgatory.java @@ -22,7 +22,6 @@ import mage.filter.FilterCard; import mage.game.ExileZone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; @@ -91,7 +90,7 @@ class PurgatoryTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = zEvent.getTarget(); if (permanent != null && zEvent.isDiesEvent() && !(permanent instanceof PermanentToken) - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isOwnedBy(controller.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/p/Pyramids.java b/Mage.Sets/src/mage/cards/p/Pyramids.java index 8af5e429e3..d0281ba7f5 100644 --- a/Mage.Sets/src/mage/cards/p/Pyramids.java +++ b/Mage.Sets/src/mage/cards/p/Pyramids.java @@ -66,7 +66,7 @@ class PyramidsPredicate implements ObjectPlayerPredicate Permanent attachment = input.getObject(); if (attachment != null) { Permanent permanent = game.getPermanent(attachment.getAttachedTo()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PyromancerAscension.java b/Mage.Sets/src/mage/cards/p/PyromancerAscension.java index 7be8d97c90..0f9f1bd47b 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancerAscension.java +++ b/Mage.Sets/src/mage/cards/p/PyromancerAscension.java @@ -68,7 +68,7 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (isControlledInstantOrSorcery(spell)) { + if (isControlledInstantOrSorcery(spell, game)) { Card sourceCard = game.getCard(spell.getSourceId()); if (sourceCard != null) { for (UUID uuid : game.getPlayer(this.getControllerId()).getGraveyard()) { @@ -85,10 +85,10 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { return false; } - private boolean isControlledInstantOrSorcery(Spell spell) { + private boolean isControlledInstantOrSorcery(Spell spell, Game game) { return spell != null && spell.isControlledBy(this.getControllerId()) && - spell.isInstantOrSorcery(); + spell.isInstantOrSorcery(game); } @Override @@ -121,7 +121,7 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (isControlledInstantOrSorcery(spell)) { + if (isControlledInstantOrSorcery(spell, game)) { Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId()); if (permanent != null && permanent.getCounters(game).getCount(CounterType.QUEST) >= 2) { this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); @@ -132,10 +132,10 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl { return false; } - private boolean isControlledInstantOrSorcery(Spell spell) { + private boolean isControlledInstantOrSorcery(Spell spell, Game game) { return spell != null && spell.isControlledBy(this.getControllerId()) && - spell.isInstantOrSorcery(); + spell.isInstantOrSorcery(game); } @Override diff --git a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java index 416d45ff55..6adff9f3fb 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersGauntlet.java @@ -62,14 +62,14 @@ class PyromancersGauntletReplacementEffect extends ReplacementEffectImpl { MageObject object = game.getObject(event.getSourceId()); if (object instanceof Spell) { if (((Spell) object).isControlledBy(source.getControllerId()) - && (object.isInstant() - || object.isSorcery())) { + && (object.isInstant(game) + || object.isSorcery(game))) { return true; } } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); return permanent != null - && permanent.isPlaneswalker() + && permanent.isPlaneswalker(game) && source.isControlledBy(permanent.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/p/PyromancersSwath.java b/Mage.Sets/src/mage/cards/p/PyromancersSwath.java index 3112bba39e..28a0a29b74 100644 --- a/Mage.Sets/src/mage/cards/p/PyromancersSwath.java +++ b/Mage.Sets/src/mage/cards/p/PyromancersSwath.java @@ -68,7 +68,7 @@ class PyromancersSwathReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject object = game.getObject(event.getSourceId()); - return object != null && object.isInstantOrSorcery(); + return object != null && object.isInstantOrSorcery(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/p/PyrrhicRevival.java b/Mage.Sets/src/mage/cards/p/PyrrhicRevival.java index 8cec85d21b..178886270d 100644 --- a/Mage.Sets/src/mage/cards/p/PyrrhicRevival.java +++ b/Mage.Sets/src/mage/cards/p/PyrrhicRevival.java @@ -73,7 +73,7 @@ class PyrrhicRevivalEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { for (Card card : player.getGraveyard().getCards(game)) { - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { toBattlefield.add(card); ContinuousEffect effect = new EntersBattlefieldEffect(new AddCountersTargetEffect(CounterType.M1M1.createInstance())); effect.setDuration(Duration.OneUse); diff --git a/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java b/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java index be41843a15..cbfa3bf042 100644 --- a/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java +++ b/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java @@ -153,7 +153,7 @@ class PyxisOfPandemoniumPutOntoBattlefieldEffect extends OneShotEffect { exileZone.getCards(game).stream().map((card) -> { card.setFaceDown(false, game); return card; - }).filter((card) -> (card.isPermanent())).forEachOrdered((card) -> { + }).filter((card) -> (card.isPermanent(game))).forEachOrdered((card) -> { cardsToBringIntoPlay.add(card); }); } diff --git a/Mage.Sets/src/mage/cards/q/QuestForUlasTemple.java b/Mage.Sets/src/mage/cards/q/QuestForUlasTemple.java index c50d55078e..8f65a26bf1 100644 --- a/Mage.Sets/src/mage/cards/q/QuestForUlasTemple.java +++ b/Mage.Sets/src/mage/cards/q/QuestForUlasTemple.java @@ -78,7 +78,7 @@ class QuestForUlasTempleEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); Cards cards = new CardsImpl(card); controller.lookAtCards(sourcePermanent.getName(), cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { if (controller.chooseUse(Outcome.DrawCard, "Reveal the top card of your library?", source, game)) { controller.revealCards(sourcePermanent.getName(), cards, game); Permanent questForUlasTemple = game.getPermanent(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/q/QuestingBeast.java b/Mage.Sets/src/mage/cards/q/QuestingBeast.java index a44d3972af..c657b047ef 100644 --- a/Mage.Sets/src/mage/cards/q/QuestingBeast.java +++ b/Mage.Sets/src/mage/cards/q/QuestingBeast.java @@ -96,7 +96,7 @@ class QuestingBeastPreventionEffect extends ContinuousRuleModifyingEffectImpl { } Permanent permanent = game.getPermanent(event.getSourceId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/q/Quicken.java b/Mage.Sets/src/mage/cards/q/Quicken.java index 42ee5230a5..030d811376 100644 --- a/Mage.Sets/src/mage/cards/q/Quicken.java +++ b/Mage.Sets/src/mage/cards/q/Quicken.java @@ -86,7 +86,7 @@ class QuickenAsThoughEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (quickenWatcher.isQuickenSpellActive(affectedControllerId, source.getSourceId(), zoneChangeCounter)) { Card card = game.getCard(sourceId); - if (card != null && card.isSorcery() && source.isControlledBy(affectedControllerId)) { + if (card != null && card.isSorcery(game) && source.isControlledBy(affectedControllerId)) { return true; } } @@ -108,7 +108,7 @@ class QuickenWatcher extends Watcher { if (event.getType() == GameEvent.EventType.SPELL_CAST) { if (!activeQuickenSpells.isEmpty() && event.getPlayerId().equals(getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isSorcery()) { + if (spell != null && spell.isSorcery(game)) { activeQuickenSpells.clear(); } } diff --git a/Mage.Sets/src/mage/cards/q/QuicksilverFountain.java b/Mage.Sets/src/mage/cards/q/QuicksilverFountain.java index 875e7610b2..cfd1f6faa2 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksilverFountain.java +++ b/Mage.Sets/src/mage/cards/q/QuicksilverFountain.java @@ -129,7 +129,7 @@ class QuicksilverFountainEffect2 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Permanent land : game.getBattlefield().getAllActivePermanents(CardType.LAND)) { + for (Permanent land : game.getBattlefield().getAllActivePermanents(CardType.LAND, game)) { land.removeCounters(CounterType.FLOOD.createInstance(land.getCounters(game).getCount(CounterType.FLOOD)), source, game); } return true; @@ -153,7 +153,7 @@ class AllLandsAreSubtypeCondition implements Condition { public boolean apply(Game game, Ability source) { FilterLandPermanent filterLand = new FilterLandPermanent(); filterLand.add(subtype.getPredicate()); - int landCount = game.getBattlefield().getAllActivePermanents(CardType.LAND).size(); + int landCount = game.getBattlefield().getAllActivePermanents(CardType.LAND, game).size(); return game.getBattlefield().getAllActivePermanents(filterLand, game).size() == landCount; } diff --git a/Mage.Sets/src/mage/cards/r/RaidersKarve.java b/Mage.Sets/src/mage/cards/r/RaidersKarve.java index aab9c532f8..84a58022cc 100644 --- a/Mage.Sets/src/mage/cards/r/RaidersKarve.java +++ b/Mage.Sets/src/mage/cards/r/RaidersKarve.java @@ -77,7 +77,7 @@ class RaidersKarveEffect extends OneShotEffect { return true; } controller.lookAtCards(sourceObject.getIdName(), new CardsImpl(card), game); - if (!card.isLand()) { + if (!card.isLand(game)) { return true; } String message = "Put " + card.getLogName() + " onto the battlefield tapped?"; diff --git a/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java b/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java index 5186ce272d..484a298127 100644 --- a/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java +++ b/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java @@ -14,7 +14,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.util.CardUtil; import java.util.UUID; @@ -117,7 +116,7 @@ class RakdosLordOfRiotsCostReductionEffect extends CostModificationEffectImpl { if (abilityToModify.isControlledBy(source.getControllerId())) { Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); if (spellCard != null) { - return spellCard.isCreature(); + return spellCard.isCreature(game); } } } diff --git a/Mage.Sets/src/mage/cards/r/RakdosTheShowstopper.java b/Mage.Sets/src/mage/cards/r/RakdosTheShowstopper.java index 89f84c0577..eeb87fcaed 100644 --- a/Mage.Sets/src/mage/cards/r/RakdosTheShowstopper.java +++ b/Mage.Sets/src/mage/cards/r/RakdosTheShowstopper.java @@ -76,7 +76,7 @@ class RakdosTheShowstopperEffect extends OneShotEffect { } for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && !permanent.hasSubtype(SubType.DEMON, game) && !permanent.hasSubtype(SubType.DEVIL, game) && !permanent.hasSubtype(SubType.IMP, game) diff --git a/Mage.Sets/src/mage/cards/r/RalStormConduit.java b/Mage.Sets/src/mage/cards/r/RalStormConduit.java index 679774d6a8..65049ed91f 100644 --- a/Mage.Sets/src/mage/cards/r/RalStormConduit.java +++ b/Mage.Sets/src/mage/cards/r/RalStormConduit.java @@ -81,7 +81,7 @@ class RalStormConduitTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getSpell(event.getTargetId()); - return spell != null && spell.isControlledBy(getControllerId()) && spell.isInstantOrSorcery(); + return spell != null && spell.isControlledBy(getControllerId()) && spell.isInstantOrSorcery(game); } @Override @@ -120,7 +120,7 @@ class RalStormConduitDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/cards/r/RallyTheHorde.java b/Mage.Sets/src/mage/cards/r/RallyTheHorde.java index 3c2bc175b7..b6c7adaca2 100644 --- a/Mage.Sets/src/mage/cards/r/RallyTheHorde.java +++ b/Mage.Sets/src/mage/cards/r/RallyTheHorde.java @@ -82,7 +82,7 @@ class RallyTheHordeEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.LIBRARY, true); - return card.isLand() ? 0 : 1; + return card.isLand(game) ? 0 : 1; } return 0; } diff --git a/Mage.Sets/src/mage/cards/r/RangerCaptainOfEos.java b/Mage.Sets/src/mage/cards/r/RangerCaptainOfEos.java index 348e09f4d6..8d6122791c 100644 --- a/Mage.Sets/src/mage/cards/r/RangerCaptainOfEos.java +++ b/Mage.Sets/src/mage/cards/r/RangerCaptainOfEos.java @@ -102,7 +102,7 @@ class RangerCaptainOfEosEffect extends ContinuousRuleModifyingEffectImpl { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isCreature()) { + if (card != null && !card.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RashmiEternitiesCrafter.java b/Mage.Sets/src/mage/cards/r/RashmiEternitiesCrafter.java index 4e99b475a9..0a9376a954 100644 --- a/Mage.Sets/src/mage/cards/r/RashmiEternitiesCrafter.java +++ b/Mage.Sets/src/mage/cards/r/RashmiEternitiesCrafter.java @@ -124,7 +124,7 @@ class RashmiEternitiesCrafterEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.revealCards("Rashmi, Eternities Crafter", new CardsImpl(card), game); - if (card.isLand()) { + if (card.isLand(game)) { controller.moveCards(card, Zone.HAND, source, game); return true; } diff --git a/Mage.Sets/src/mage/cards/r/RatchetBomb.java b/Mage.Sets/src/mage/cards/r/RatchetBomb.java index 43efd7acff..678ed3535a 100644 --- a/Mage.Sets/src/mage/cards/r/RatchetBomb.java +++ b/Mage.Sets/src/mage/cards/r/RatchetBomb.java @@ -68,7 +68,7 @@ public final class RatchetBomb extends CardImpl { int count = p.getCounters(game).getCount(CounterType.CHARGE); for (Permanent perm: game.getBattlefield().getAllActivePermanents()) { - if (perm.getManaValue() == count && !(perm.isLand())) { + if (perm.getManaValue() == count && !(perm.isLand(game))) { perm.destroy(source, game, false); } } diff --git a/Mage.Sets/src/mage/cards/r/RavagerWurm.java b/Mage.Sets/src/mage/cards/r/RavagerWurm.java index f6214f280d..7becb36ad8 100644 --- a/Mage.Sets/src/mage/cards/r/RavagerWurm.java +++ b/Mage.Sets/src/mage/cards/r/RavagerWurm.java @@ -74,7 +74,7 @@ enum RavagerWurmPredicate implements Predicate { @Override public boolean apply(Permanent input, Game game) { - return input != null && input.isLand() + return input != null && input.isLand(game) && input .getAbilities(game) .stream() diff --git a/Mage.Sets/src/mage/cards/r/RavenousSlime.java b/Mage.Sets/src/mage/cards/r/RavenousSlime.java index 38dc32027d..7f5bd444f7 100644 --- a/Mage.Sets/src/mage/cards/r/RavenousSlime.java +++ b/Mage.Sets/src/mage/cards/r/RavenousSlime.java @@ -108,7 +108,7 @@ class RavenousSlimeEffect extends ReplacementEffectImpl { return false; } if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield - return zEvent.getTarget().isCreature(); - } else return permanent.isCreature(); + return zEvent.getTarget().isCreature(game); + } else return permanent.isCreature(game); } } diff --git a/Mage.Sets/src/mage/cards/r/RayamiFirstOfTheFallen.java b/Mage.Sets/src/mage/cards/r/RayamiFirstOfTheFallen.java index 40561ecddc..df3e0cade5 100644 --- a/Mage.Sets/src/mage/cards/r/RayamiFirstOfTheFallen.java +++ b/Mage.Sets/src/mage/cards/r/RayamiFirstOfTheFallen.java @@ -75,7 +75,7 @@ class RayamiFirstOfTheFallenEffect extends ContinuousEffectImpl { game.getExile() .getAllCards(game) .stream() - .filter(Card::isCreature) + .filter(card1 -> card1.isCreature(game)) .filter(card -> card.getCounters(game).getCount(CounterType.BLOOD) > 0) .map(card -> card.getAbilities(game)) .flatMap(Collection::stream) @@ -143,7 +143,7 @@ class RayamiFirstOfTheFallenReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zce = (ZoneChangeEvent) event; return zce.isDiesEvent() - && zce.getTarget().isCreature() + && zce.getTarget().isCreature(game) && !(zce.getTarget() instanceof PermanentToken); } } diff --git a/Mage.Sets/src/mage/cards/r/RealityScramble.java b/Mage.Sets/src/mage/cards/r/RealityScramble.java index f41b08e44b..4ed6adfb27 100644 --- a/Mage.Sets/src/mage/cards/r/RealityScramble.java +++ b/Mage.Sets/src/mage/cards/r/RealityScramble.java @@ -86,7 +86,7 @@ class RealityScrambleEffect extends OneShotEffect { return false; } Set types = EnumSet.noneOf(CardType.class); - types.addAll(permanent.getCardType()); + types.addAll(permanent.getCardType(game)); controller.putCardsOnBottomOfLibrary( new CardsImpl(permanent), game, source, false ); @@ -95,7 +95,7 @@ class RealityScrambleEffect extends OneShotEffect { for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); for (CardType type : types) { - if (card.getCardType().contains(type)) { + if (card.getCardType(game).contains(type)) { cardToPlay = card; break; } diff --git a/Mage.Sets/src/mage/cards/r/ReasonBelieve.java b/Mage.Sets/src/mage/cards/r/ReasonBelieve.java index ef815d2669..2b00461005 100644 --- a/Mage.Sets/src/mage/cards/r/ReasonBelieve.java +++ b/Mage.Sets/src/mage/cards/r/ReasonBelieve.java @@ -69,7 +69,7 @@ class BelieveEffect extends OneShotEffect { if (controller != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { - if (card.isCreature() && controller.chooseUse(outcome, "Put " + card.getIdName() + " onto the battlefield?", source, game)) { + if (card.isCreature(game) && controller.chooseUse(outcome, "Put " + card.getIdName() + " onto the battlefield?", source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { controller.moveCards(card, Zone.HAND, source, game); diff --git a/Mage.Sets/src/mage/cards/r/Reclamation.java b/Mage.Sets/src/mage/cards/r/Reclamation.java index 9aed9592cf..b958d2ffe7 100644 --- a/Mage.Sets/src/mage/cards/r/Reclamation.java +++ b/Mage.Sets/src/mage/cards/r/Reclamation.java @@ -6,7 +6,6 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.PayCostToAttackBlockEffectImpl; -import mage.abilities.effects.PayCostToAttackBlockEffectImpl.RestrictType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -60,7 +59,7 @@ class ReclamationCostToAttackBlockEffect extends PayCostToAttackBlockEffectImpl public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getSourceId()); return (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getColor(game).isBlack()); } diff --git a/Mage.Sets/src/mage/cards/r/ReflectiveGolem.java b/Mage.Sets/src/mage/cards/r/ReflectiveGolem.java index e1653f08b3..2daf3b4736 100644 --- a/Mage.Sets/src/mage/cards/r/ReflectiveGolem.java +++ b/Mage.Sets/src/mage/cards/r/ReflectiveGolem.java @@ -74,7 +74,7 @@ class ReflectiveGolemTriggeredAbility extends TriggeredAbilityImpl { return false; } Spell spell = game.getSpellOrLKIStack(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } if (spell.getSpellAbilities() diff --git a/Mage.Sets/src/mage/cards/r/RefractionTrap.java b/Mage.Sets/src/mage/cards/r/RefractionTrap.java index fcad52addf..c7d8f93093 100644 --- a/Mage.Sets/src/mage/cards/r/RefractionTrap.java +++ b/Mage.Sets/src/mage/cards/r/RefractionTrap.java @@ -64,7 +64,7 @@ enum RefractionTrapCondition implements Condition { List spells = watcher.getSpellsCastThisTurn(opponentId); if (spells != null) { for (Spell spell : spells) { - if ((spell.isSorcery() || spell.isInstant()) + if ((spell.isSorcery(game) || spell.isInstant(game)) && spell.getColor(game).isRed()) { return true; } diff --git a/Mage.Sets/src/mage/cards/r/ReidaneGodOfTheWorthy.java b/Mage.Sets/src/mage/cards/r/ReidaneGodOfTheWorthy.java index a8d2bd400e..b87cb13d6c 100644 --- a/Mage.Sets/src/mage/cards/r/ReidaneGodOfTheWorthy.java +++ b/Mage.Sets/src/mage/cards/r/ReidaneGodOfTheWorthy.java @@ -108,7 +108,7 @@ class ReidaneGodOfTheWorthyTapEffect extends ReplacementEffectImpl { return false; } Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.isLand() && permanent.isSnow(); + return permanent != null && permanent.isLand(game) && permanent.isSnow(); } @Override @@ -142,7 +142,7 @@ class ReidaneGodOfTheWorthyCostEffect extends CostModificationEffectImpl { return false; } Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game); - return spellCard != null && !spellCard.isCreature() && spellCard.getManaValue() >= 4; + return spellCard != null && !spellCard.isCreature(game) && spellCard.getManaValue() >= 4; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RelentlessPursuit.java b/Mage.Sets/src/mage/cards/r/RelentlessPursuit.java index 534cadebd9..b67f29782e 100644 --- a/Mage.Sets/src/mage/cards/r/RelentlessPursuit.java +++ b/Mage.Sets/src/mage/cards/r/RelentlessPursuit.java @@ -76,8 +76,8 @@ class RelentlessPursuitEffect extends OneShotEffect { controller.revealCards(sourceObject.getName(), cards, game); - boolean creatureCardFound = cards.getCards(game).stream().anyMatch(Card::isCreature); - boolean landCardFound = cards.getCards(game).stream().anyMatch(Card::isLand); + boolean creatureCardFound = cards.getCards(game).stream().anyMatch(card -> card.isCreature(game)); + boolean landCardFound = cards.getCards(game).stream().anyMatch(card -> card.isLand(game)); if (!creatureCardFound && !landCardFound) { controller.moveCards(cards, Zone.GRAVEYARD, source, game); diff --git a/Mage.Sets/src/mage/cards/r/RelicRunner.java b/Mage.Sets/src/mage/cards/r/RelicRunner.java index c546dc5aa7..7fcb8a6148 100644 --- a/Mage.Sets/src/mage/cards/r/RelicRunner.java +++ b/Mage.Sets/src/mage/cards/r/RelicRunner.java @@ -63,7 +63,7 @@ class CastHistoricSpellThisTurnCondition implements Condition { List spells = watcher.getSpellsCastThisTurn(source.getControllerId()); if (spells != null) { for (Spell spell : spells) { - if (!spell.getSourceId().equals(source.getSourceId()) && spell.isHistoric()) { + if (!spell.getSourceId().equals(source.getSourceId()) && spell.isHistoric(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java b/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java index 3fcc6f0294..89a4b0a853 100644 --- a/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java +++ b/Mage.Sets/src/mage/cards/r/RemoveEnchantments.java @@ -82,7 +82,7 @@ class AttachedToOpponentControlledAttackingCreaturePredicate implements ObjectPl if (attachement != null) { Permanent permanent = game.getPermanent(attachement.getAttachedTo()); if (permanent != null) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { if (permanent.isAttacking()) { if (!permanent.isControlledBy(input.getPlayerId()) && game.getPlayer(input.getPlayerId()).hasOpponent(permanent.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java b/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java index 71cc0c6f66..0f0a9f9083 100644 --- a/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java +++ b/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java @@ -71,7 +71,7 @@ class RenataCalledToTheHuntReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null - && creature.isCreature() + && creature.isCreature(game) && !source.getSourceId().equals(creature.getId()) && creature.isControlledBy(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java b/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java index a6eef5b585..b6b94035d9 100644 --- a/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java +++ b/Mage.Sets/src/mage/cards/r/RenegadeDoppelganger.java @@ -70,7 +70,7 @@ class RenegadeDoppelgangerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (!event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() && permanent.isControlledBy(this.getControllerId())) { + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(permanent, game)); } diff --git a/Mage.Sets/src/mage/cards/r/RenownedWeaponsmith.java b/Mage.Sets/src/mage/cards/r/RenownedWeaponsmith.java index 1a7ef3fd54..cba2d148b1 100644 --- a/Mage.Sets/src/mage/cards/r/RenownedWeaponsmith.java +++ b/Mage.Sets/src/mage/cards/r/RenownedWeaponsmith.java @@ -85,7 +85,7 @@ class RenownedWeaponsmithCondition implements Condition { public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); return (object != null - && object.isArtifact()); + && object.isArtifact(game)); } } diff --git a/Mage.Sets/src/mage/cards/r/Reparations.java b/Mage.Sets/src/mage/cards/r/Reparations.java index 94f07d7abc..33f67f00e7 100644 --- a/Mage.Sets/src/mage/cards/r/Reparations.java +++ b/Mage.Sets/src/mage/cards/r/Reparations.java @@ -10,7 +10,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.StackObject; import mage.players.Player; @@ -73,7 +72,7 @@ class ReparationsTriggeredAbility extends TriggeredAbilityImpl { return true; } if (targetPermanent != null - && targetPermanent.isCreature() + && targetPermanent.isCreature(game) && targetPermanent.isControlledBy(controllerId)) { return true; } diff --git a/Mage.Sets/src/mage/cards/r/RepeatedReverberation.java b/Mage.Sets/src/mage/cards/r/RepeatedReverberation.java index 12c0ea3a1d..4763a16e24 100644 --- a/Mage.Sets/src/mage/cards/r/RepeatedReverberation.java +++ b/Mage.Sets/src/mage/cards/r/RepeatedReverberation.java @@ -86,7 +86,7 @@ class RepeatedReverberationTriggeredAbility extends DelayedTriggeredAbility { // spell if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { this.getEffects().clear(); this.addEffect( new CopyTargetSpellEffect(true) diff --git a/Mage.Sets/src/mage/cards/r/Repercussion.java b/Mage.Sets/src/mage/cards/r/Repercussion.java index 1f3eff928d..6b42b444f1 100644 --- a/Mage.Sets/src/mage/cards/r/Repercussion.java +++ b/Mage.Sets/src/mage/cards/r/Repercussion.java @@ -61,7 +61,7 @@ class RepercussionTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } getEffects().setValue(PLAYER_DAMAGE_AMOUNT_KEY, event.getAmount()); diff --git a/Mage.Sets/src/mage/cards/r/ReturnOfTheWildspeaker.java b/Mage.Sets/src/mage/cards/r/ReturnOfTheWildspeaker.java index 840bc2aeab..69e01e5b72 100644 --- a/Mage.Sets/src/mage/cards/r/ReturnOfTheWildspeaker.java +++ b/Mage.Sets/src/mage/cards/r/ReturnOfTheWildspeaker.java @@ -16,7 +16,6 @@ import mage.constants.SubType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.game.Game; -import mage.game.permanent.Permanent; import java.util.UUID; @@ -63,7 +62,7 @@ enum ReturnOfTheWildspeakerValue implements DynamicValue { return game.getBattlefield() .getAllActivePermanents(sourceAbility.getControllerId()) .stream() - .filter(Permanent::isCreature) + .filter(permanent1 -> permanent1.isCreature(game)) .filter(permanent -> !permanent.hasSubtype(SubType.HUMAN, game)) .map(MageObject::getPower) .mapToInt(MageInt::getValue) diff --git a/Mage.Sets/src/mage/cards/r/RevengeStarWars.java b/Mage.Sets/src/mage/cards/r/RevengeStarWars.java index d6d2fa9238..a005bdf42a 100644 --- a/Mage.Sets/src/mage/cards/r/RevengeStarWars.java +++ b/Mage.Sets/src/mage/cards/r/RevengeStarWars.java @@ -90,7 +90,7 @@ class RevengeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); - if (target != null && target.isCreature()) { + if (target != null && target.isCreature(game)) { ContinuousEffect effect = new BoostTargetEffect(4, 0, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(target.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/r/ReversePolarity.java b/Mage.Sets/src/mage/cards/r/ReversePolarity.java index e8ed3d88b6..fea9b5e987 100644 --- a/Mage.Sets/src/mage/cards/r/ReversePolarity.java +++ b/Mage.Sets/src/mage/cards/r/ReversePolarity.java @@ -77,7 +77,7 @@ class ReversePolarityWatcher extends Watcher { UUID playerId = event.getTargetId(); if (playerId != null) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isArtifact()) { + if (permanent != null && permanent.isArtifact(game)) { artifactDamageReceivedThisTurn.putIfAbsent(playerId, 0); artifactDamageReceivedThisTurn.compute(playerId, (k, v) -> v + event.getAmount()); } diff --git a/Mage.Sets/src/mage/cards/r/Reweave.java b/Mage.Sets/src/mage/cards/r/Reweave.java index 9ee0a52621..445a40bef6 100644 --- a/Mage.Sets/src/mage/cards/r/Reweave.java +++ b/Mage.Sets/src/mage/cards/r/Reweave.java @@ -80,9 +80,9 @@ class ReweaveEffect extends OneShotEffect { Card permanentCard = null; for (Card card : permanentController.getLibrary().getCards(game)) { cards.add(card); - if (card.isPermanent()) { - for (CardType cardType : permanent.getCardType()) { - if (card.getCardType().contains(cardType)) { + if (card.isPermanent(game)) { + for (CardType cardType : permanent.getCardType(game)) { + if (card.getCardType(game).contains(cardType)) { permanentCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java b/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java index 4a5fe471db..b47ff34177 100644 --- a/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java +++ b/Mage.Sets/src/mage/cards/r/ReyhanLastOfTheAbzan.java @@ -17,7 +17,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -93,7 +92,7 @@ class ReyhanLastOfTheAbzanTriggeredAbility extends TriggeredAbilityImpl { // A creature Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java b/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java index 1520dacbaa..5ce861ef7d 100644 --- a/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java +++ b/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java @@ -95,7 +95,7 @@ class RhythmOfTheWildEffect extends ReplacementEffectImpl { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && !(creature instanceof PermanentToken); } diff --git a/Mage.Sets/src/mage/cards/r/RienneAngelOfRebirth.java b/Mage.Sets/src/mage/cards/r/RienneAngelOfRebirth.java index 3f69785df4..1b1de08013 100644 --- a/Mage.Sets/src/mage/cards/r/RienneAngelOfRebirth.java +++ b/Mage.Sets/src/mage/cards/r/RienneAngelOfRebirth.java @@ -95,7 +95,7 @@ class RienneAngelOfRebirthTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTarget().getId()); if (permanent != null && zEvent.isDiesEvent() - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getColor(game).isMulticolored() && permanent.isControlledBy(this.controllerId)) { this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/r/RionyaFireDancer.java b/Mage.Sets/src/mage/cards/r/RionyaFireDancer.java index a9992efb0b..4d0ab71efc 100644 --- a/Mage.Sets/src/mage/cards/r/RionyaFireDancer.java +++ b/Mage.Sets/src/mage/cards/r/RionyaFireDancer.java @@ -120,7 +120,7 @@ class RionyaFireDancerWatcher extends Watcher { return; } Spell spell = game.getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { playerMap.compute(spell.getControllerId(), (u, i) -> i == null ? 1 : Integer.sum(i, 1)); } } diff --git a/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java b/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java index e30570173b..9d4b8e6ae7 100644 --- a/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java +++ b/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java @@ -75,7 +75,7 @@ class RiptideShapeshifterEffect extends OneShotEffect { } Cards revealedCards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { - if (card.isCreature() && card.hasSubtype(SubType.byDescription(choice.getChoice()), game)) { + if (card.isCreature(game) && card.hasSubtype(SubType.byDescription(choice.getChoice()), game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; } diff --git a/Mage.Sets/src/mage/cards/r/RiseOfTheDarkRealms.java b/Mage.Sets/src/mage/cards/r/RiseOfTheDarkRealms.java index ba4eff58c3..499e38a457 100644 --- a/Mage.Sets/src/mage/cards/r/RiseOfTheDarkRealms.java +++ b/Mage.Sets/src/mage/cards/r/RiseOfTheDarkRealms.java @@ -58,7 +58,7 @@ class RiseOfTheDarkRealmsEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { for (Card card : player.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { creatureCards.add(card); } } diff --git a/Mage.Sets/src/mage/cards/r/RisenReef.java b/Mage.Sets/src/mage/cards/r/RisenReef.java index 8b58944b89..516fc6e01a 100644 --- a/Mage.Sets/src/mage/cards/r/RisenReef.java +++ b/Mage.Sets/src/mage/cards/r/RisenReef.java @@ -76,7 +76,7 @@ class RisenReefEffect extends OneShotEffect { return false; } player.lookAtCards("", card, game); - if (card.isLand() && player.chooseUse( + if (card.isLand(game) && player.chooseUse( outcome, "Put " + card.getName() + " onto the battlefield tapped?", "(otherwise put it into your hand", "To battlefield", "To hand", source, game)) { diff --git a/Mage.Sets/src/mage/cards/r/RitualOfSubdual.java b/Mage.Sets/src/mage/cards/r/RitualOfSubdual.java index 5365ec748e..377f33f839 100644 --- a/Mage.Sets/src/mage/cards/r/RitualOfSubdual.java +++ b/Mage.Sets/src/mage/cards/r/RitualOfSubdual.java @@ -17,7 +17,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; /** @@ -84,6 +83,6 @@ class RitualOfSubdualReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { MageObject mageObject = game.getPermanentOrLKIBattlefield(event.getSourceId()); - return mageObject != null && mageObject.isLand(); + return mageObject != null && mageObject.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/r/RoleReversal.java b/Mage.Sets/src/mage/cards/r/RoleReversal.java index f568a24904..5e5c884367 100644 --- a/Mage.Sets/src/mage/cards/r/RoleReversal.java +++ b/Mage.Sets/src/mage/cards/r/RoleReversal.java @@ -61,7 +61,7 @@ class TargetPermanentsThatShareCardType extends TargetPermanent { if (targetOne == null || targetTwo == null) { return false; } - return targetOne.shareTypes(targetTwo); + return targetOne.shareTypes(targetTwo, game); } return true; } @@ -75,12 +75,12 @@ class TargetPermanentsThatShareCardType extends TargetPermanent { if (targetSource != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - for (CardType cardType : permanent.getCardType()) { + for (CardType cardType : permanent.getCardType(game)) { if (cardTypes.contains(cardType)) { return true; } } - cardTypes.addAll(permanent.getCardType()); + cardTypes.addAll(permanent.getCardType(game)); } } } diff --git a/Mage.Sets/src/mage/cards/r/RonaDiscipleOfGix.java b/Mage.Sets/src/mage/cards/r/RonaDiscipleOfGix.java index 10daadc715..5ba2ecda51 100644 --- a/Mage.Sets/src/mage/cards/r/RonaDiscipleOfGix.java +++ b/Mage.Sets/src/mage/cards/r/RonaDiscipleOfGix.java @@ -100,7 +100,7 @@ class RonaDiscipleOfGixPlayNonLandEffect extends AsThoughEffectImpl { if (affectedControllerId.equals(source.getControllerId())) { Card card = game.getCard(objectId); MageObject sourceObject = game.getObject(source.getSourceId()); - if (card != null && !card.isLand() && sourceObject != null) { + if (card != null && !card.isLand(game) && sourceObject != null) { UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), sourceObject.getZoneChangeCounter(game)); if (exileId != null) { ExileZone exileZone = game.getState().getExile().getExileZone(exileId); diff --git a/Mage.Sets/src/mage/cards/r/RoninWarclub.java b/Mage.Sets/src/mage/cards/r/RoninWarclub.java index d73c4f00ca..9abbde787c 100644 --- a/Mage.Sets/src/mage/cards/r/RoninWarclub.java +++ b/Mage.Sets/src/mage/cards/r/RoninWarclub.java @@ -15,7 +15,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -70,7 +69,7 @@ public final class RoninWarclub extends CardImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId)) { if (!this.getTargets().isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/r/RootMaze.java b/Mage.Sets/src/mage/cards/r/RootMaze.java index c0b0868aed..713624f3bd 100644 --- a/Mage.Sets/src/mage/cards/r/RootMaze.java +++ b/Mage.Sets/src/mage/cards/r/RootMaze.java @@ -14,7 +14,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -68,7 +67,7 @@ class RootMazeEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && (permanent.isLand() || permanent.isArtifact()); + return permanent != null && (permanent.isLand(game) || permanent.isArtifact(game)); } @Override diff --git a/Mage.Sets/src/mage/cards/r/RowdyCrew.java b/Mage.Sets/src/mage/cards/r/RowdyCrew.java index b133e6919c..876730c6d1 100644 --- a/Mage.Sets/src/mage/cards/r/RowdyCrew.java +++ b/Mage.Sets/src/mage/cards/r/RowdyCrew.java @@ -87,7 +87,7 @@ class RowdyCrewEffect extends OneShotEffect { for (CardType type : CardType.values()) { int count = 0; for (UUID cardId : cards) { - if (game.getCard(cardId).getCardType().contains(type)) { + if (game.getCard(cardId).getCardType(game).contains(type)) { count++; if (count > 1) { creature.addCounters(CounterType.P1P1.createInstance(2), source.getControllerId(), source, game); diff --git a/Mage.Sets/src/mage/cards/r/Rowen.java b/Mage.Sets/src/mage/cards/r/Rowen.java index 1423ac89d7..5b0a7a0863 100644 --- a/Mage.Sets/src/mage/cards/r/Rowen.java +++ b/Mage.Sets/src/mage/cards/r/Rowen.java @@ -13,7 +13,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -73,7 +72,7 @@ class RowenAbility extends TriggeredAbilityImpl { lastTriggeredTurn = game.getTurnNum(); controller.revealCards(sourcePermanent.getName(), new CardsImpl(card), game); this.getEffects().clear(); - if (card.isLand() && card.isBasic()) { + if (card.isLand(game) && card.isBasic()) { this.addEffect(new DrawCardSourceControllerEffect(1)); } return true; diff --git a/Mage.Sets/src/mage/cards/r/RumblingRuin.java b/Mage.Sets/src/mage/cards/r/RumblingRuin.java index f4a611f453..ee210b75bf 100644 --- a/Mage.Sets/src/mage/cards/r/RumblingRuin.java +++ b/Mage.Sets/src/mage/cards/r/RumblingRuin.java @@ -64,7 +64,7 @@ class RumblingRuinEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int counter = 1; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { continue; } counter += permanent.getCounters(game).getCount(CounterType.P1P1); diff --git a/Mage.Sets/src/mage/cards/r/RunicArmasaur.java b/Mage.Sets/src/mage/cards/r/RunicArmasaur.java index f314df3748..f90f87561a 100644 --- a/Mage.Sets/src/mage/cards/r/RunicArmasaur.java +++ b/Mage.Sets/src/mage/cards/r/RunicArmasaur.java @@ -13,7 +13,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; /** @@ -72,8 +71,8 @@ class RunicArmasaurTriggeredAbility extends TriggeredAbilityImpl { && stackAbility.getSourcePermanentOrLKI(game) != null) { // must be a permanent MageObject abilitySourceObject = stackAbility.getSourceObject(game); return abilitySourceObject != null - && (abilitySourceObject.isLand() - || abilitySourceObject.isCreature()); + && (abilitySourceObject.isLand(game) + || abilitySourceObject.isCreature(game)); } return false; } diff --git a/Mage.Sets/src/mage/cards/r/RuricTharTheUnbowed.java b/Mage.Sets/src/mage/cards/r/RuricTharTheUnbowed.java index 9308857267..dc5dbda8b9 100644 --- a/Mage.Sets/src/mage/cards/r/RuricTharTheUnbowed.java +++ b/Mage.Sets/src/mage/cards/r/RuricTharTheUnbowed.java @@ -17,7 +17,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -82,7 +81,7 @@ class RuricTharTheUnbowedAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && !spell.isCreature()) { + if (spell != null && !spell.isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/r/RuthlessDeathfang.java b/Mage.Sets/src/mage/cards/r/RuthlessDeathfang.java index 47f0c36e81..c8a0493892 100644 --- a/Mage.Sets/src/mage/cards/r/RuthlessDeathfang.java +++ b/Mage.Sets/src/mage/cards/r/RuthlessDeathfang.java @@ -15,7 +15,6 @@ import mage.constants.Zone; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.common.TargetOpponent; /** @@ -73,7 +72,7 @@ class RuthlessDeathfangTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(); + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/r/RuthlessInvasion.java b/Mage.Sets/src/mage/cards/r/RuthlessInvasion.java index 083dbdfd72..bcfdb2ded1 100644 --- a/Mage.Sets/src/mage/cards/r/RuthlessInvasion.java +++ b/Mage.Sets/src/mage/cards/r/RuthlessInvasion.java @@ -45,7 +45,7 @@ class RuthlessInvasionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return !permanent.isArtifact(); + return !permanent.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/s/SacredGround.java b/Mage.Sets/src/mage/cards/s/SacredGround.java index b9f7d329c9..68de16b949 100644 --- a/Mage.Sets/src/mage/cards/s/SacredGround.java +++ b/Mage.Sets/src/mage/cards/s/SacredGround.java @@ -10,7 +10,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -64,7 +63,7 @@ class SacredGroundTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zce = (ZoneChangeEvent) event; if (Zone.BATTLEFIELD == zce.getFromZone() && Zone.GRAVEYARD == zce.getToZone()) { Permanent targetPermanent = zce.getTarget(); - if (targetPermanent.isLand() && targetPermanent.isControlledBy(getControllerId())) { + if (targetPermanent.isLand(game) && targetPermanent.isControlledBy(getControllerId())) { getEffects().get(0).setTargetPointer(new FixedTarget(targetPermanent.getId(), game.getState().getZoneChangeCounter(targetPermanent.getId()))); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SaddledRimestag.java b/Mage.Sets/src/mage/cards/s/SaddledRimestag.java index 92190b5aab..a47d542a16 100644 --- a/Mage.Sets/src/mage/cards/s/SaddledRimestag.java +++ b/Mage.Sets/src/mage/cards/s/SaddledRimestag.java @@ -75,7 +75,7 @@ class SaddledRimestagWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { playerMap.putIfAbsent(zEvent.getTarget().getControllerId(), new HashSet<>()); playerMap.get(zEvent.getTarget().getControllerId()).add(zEvent.getTargetId()); } diff --git a/Mage.Sets/src/mage/cards/s/SageOfFables.java b/Mage.Sets/src/mage/cards/s/SageOfFables.java index 66b8159325..5a3e5f9ae2 100644 --- a/Mage.Sets/src/mage/cards/s/SageOfFables.java +++ b/Mage.Sets/src/mage/cards/s/SageOfFables.java @@ -72,7 +72,7 @@ class SageOfFablesReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null && creature.isControlledBy(source.getControllerId()) - && creature.isCreature() + && creature.isCreature(game) && creature.hasSubtype(SubType.WIZARD, game) && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/s/SagesReverie.java b/Mage.Sets/src/mage/cards/s/SagesReverie.java index f3a0c3900e..337ec7a587 100644 --- a/Mage.Sets/src/mage/cards/s/SagesReverie.java +++ b/Mage.Sets/src/mage/cards/s/SagesReverie.java @@ -69,7 +69,7 @@ class SagesReveriePredicate implements Predicate { public boolean apply(Permanent input, Game game) { UUID attachedTo = input.getAttachedTo(); Permanent attachedToPermanent = game.getPermanent(attachedTo); - return attachedToPermanent != null && attachedToPermanent.isCreature(); + return attachedToPermanent != null && attachedToPermanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/s/SanctumPrelate.java b/Mage.Sets/src/mage/cards/s/SanctumPrelate.java index 250130906a..b7e04f22e9 100644 --- a/Mage.Sets/src/mage/cards/s/SanctumPrelate.java +++ b/Mage.Sets/src/mage/cards/s/SanctumPrelate.java @@ -128,7 +128,7 @@ class SanctumPrelateReplacementEffect extends ContinuousRuleModifyingEffectImpl choiceValue = (Integer) game.getState().getValue(source.getSourceId().toString()); Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && !spell.isCreature()) { + if (spell != null && !spell.isCreature(game)) { return spell.getManaValue() == choiceValue; } return false; diff --git a/Mage.Sets/src/mage/cards/s/Sangromancer.java b/Mage.Sets/src/mage/cards/s/Sangromancer.java index 523571ccaa..3bb855bc11 100644 --- a/Mage.Sets/src/mage/cards/s/Sangromancer.java +++ b/Mage.Sets/src/mage/cards/s/Sangromancer.java @@ -14,7 +14,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -69,7 +68,7 @@ class SangromancerFirstTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent) event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.isCreature() && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { + if (p != null && p.isCreature(game) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SaplingOfColfenor.java b/Mage.Sets/src/mage/cards/s/SaplingOfColfenor.java index 23ab4afa9b..ecd210ae77 100644 --- a/Mage.Sets/src/mage/cards/s/SaplingOfColfenor.java +++ b/Mage.Sets/src/mage/cards/s/SaplingOfColfenor.java @@ -77,7 +77,7 @@ class SaplingOfColfenorEffect extends OneShotEffect { if(card != null) { Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); - if (card.isCreature()) { + if (card.isCreature(game)) { controller.gainLife(card.getToughness().getValue(), game, source); controller.loseLife(card.getPower().getValue(), game, source, false); return controller.moveCards(cards.getCards(game), Zone.HAND, source, game); diff --git a/Mage.Sets/src/mage/cards/s/SaprazzanBailiff.java b/Mage.Sets/src/mage/cards/s/SaprazzanBailiff.java index 06500b05ef..ad123271a0 100644 --- a/Mage.Sets/src/mage/cards/s/SaprazzanBailiff.java +++ b/Mage.Sets/src/mage/cards/s/SaprazzanBailiff.java @@ -85,7 +85,7 @@ class SaprazzanBailiffEffect extends OneShotEffect { if (player != null) { for (UUID cid : player.getGraveyard().copy()) { Card card = game.getCard(cid); - if (card != null && (card.isArtifact() || card.isEnchantment())) { + if (card != null && (card.isArtifact(game) || card.isEnchantment(game))) { controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.GRAVEYARD, true); } } diff --git a/Mage.Sets/src/mage/cards/s/SaprazzanBreaker.java b/Mage.Sets/src/mage/cards/s/SaprazzanBreaker.java index 336099b071..b2668897b6 100644 --- a/Mage.Sets/src/mage/cards/s/SaprazzanBreaker.java +++ b/Mage.Sets/src/mage/cards/s/SaprazzanBreaker.java @@ -2,7 +2,6 @@ package mage.cards.s; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -65,7 +64,7 @@ class SaprazzanBreakerEffect extends OneShotEffect { if (player == null) { return false; } - if (player.millCards(1, source, game).getCards(game).stream().filter(Objects::nonNull).anyMatch(MageObject::isLand)) { + if (player.millCards(1, source, game).getCards(game).stream().filter(Objects::nonNull).anyMatch(card -> card.isLand(game))) { game.addEffect(new CantBeBlockedByAllSourceEffect(StaticFilters.FILTER_PERMANENT_CREATURES, Duration.EndOfTurn), source); } return true; diff --git a/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java b/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java index 42a5e0c417..628e26ff4e 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java @@ -89,8 +89,8 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - permanent.getCardType().clear(); - permanent.addCardType(CardType.CREATURE); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); permanent.addSubType(game, SubType.DRAGON); permanent.getSuperType().clear(); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java b/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java index 52e3ca4cb3..2751d320e6 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java @@ -107,7 +107,7 @@ class SarkhanTheMasterlessBecomeDragonEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { - if (permanent != null && permanent.isPlaneswalker()) { + if (permanent != null && permanent.isPlaneswalker(game)) { affectedObjectList.add(new MageObjectReference(permanent, game)); } } @@ -125,8 +125,8 @@ class SarkhanTheMasterlessBecomeDragonEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - permanent.getCardType().clear(); - permanent.addCardType(CardType.CREATURE); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); permanent.addSubType(game, SubType.DRAGON); } diff --git a/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java b/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java index a0b8c2fbfb..8cbf43cffc 100644 --- a/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java +++ b/Mage.Sets/src/mage/cards/s/SatyrFiredancer.java @@ -17,7 +17,6 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -85,7 +84,7 @@ class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl { return false; } MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject == null || !sourceObject.isInstantOrSorcery()) { + if (sourceObject == null || !sourceObject.isInstantOrSorcery(game)) { return false; } for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/s/SavaenElves.java b/Mage.Sets/src/mage/cards/s/SavaenElves.java index 8fd19115e5..2c48c386ef 100644 --- a/Mage.Sets/src/mage/cards/s/SavaenElves.java +++ b/Mage.Sets/src/mage/cards/s/SavaenElves.java @@ -65,7 +65,7 @@ class SavaenElvesPredicate implements ObjectPlayerPredicate(savageSummoningSpells)); String cardKey = spell.getCard().getId().toString() + '_' + spell.getCard().getZoneChangeCounter(game); cardsCastWithSavageSummoning.put(cardKey, new HashSet<>(savageSummoningSpells)); diff --git a/Mage.Sets/src/mage/cards/s/SavraQueenOfTheGolgari.java b/Mage.Sets/src/mage/cards/s/SavraQueenOfTheGolgari.java index 9c2e698dff..8790fb04ec 100644 --- a/Mage.Sets/src/mage/cards/s/SavraQueenOfTheGolgari.java +++ b/Mage.Sets/src/mage/cards/s/SavraQueenOfTheGolgari.java @@ -20,7 +20,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -80,7 +79,7 @@ class SavraSacrificeBlackCreatureAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature() + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(game) && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getColor(game).isBlack(); } @@ -157,7 +156,7 @@ class SavraSacrificeGreenCreatureAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature() + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature(game) && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getColor(game).isGreen(); } diff --git a/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java b/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java index 699853f7a1..a8551474f2 100644 --- a/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java +++ b/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java @@ -82,7 +82,7 @@ class ScabClanBerserkerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && !spell.isCreature()){ + if (spell != null && !spell.isCreature(game)){ for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/s/ScavengingOoze.java b/Mage.Sets/src/mage/cards/s/ScavengingOoze.java index 202f296f62..dd8e386a75 100644 --- a/Mage.Sets/src/mage/cards/s/ScavengingOoze.java +++ b/Mage.Sets/src/mage/cards/s/ScavengingOoze.java @@ -71,7 +71,7 @@ class ScavengingOozeEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && card != null) { controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.GRAVEYARD, true); - if (card.isCreature()) { + if (card.isCreature(game)) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null) { sourcePermanent.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game); diff --git a/Mage.Sets/src/mage/cards/s/ScholarOfTheLostTrove.java b/Mage.Sets/src/mage/cards/s/ScholarOfTheLostTrove.java index 1b6a6e65fe..d8f0f9e632 100644 --- a/Mage.Sets/src/mage/cards/s/ScholarOfTheLostTrove.java +++ b/Mage.Sets/src/mage/cards/s/ScholarOfTheLostTrove.java @@ -99,7 +99,7 @@ class ScholarOfTheLostTroveEffect extends OneShotEffect { Boolean cardWasCast = controller.cast(controller.chooseAbilityForCast(card, game, true), game, true, new ApprovingObject(source, game)); game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null); - if (!cardWasCast || !card.isInstantOrSorcery()) { + if (!cardWasCast || !card.isInstantOrSorcery(game)) { return true; } ContinuousEffect effect = new ScholarOfTheLostTroveReplacementEffect(card.getId()); diff --git a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java index 61dbcccb9e..baadc72a93 100644 --- a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java +++ b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java @@ -87,7 +87,7 @@ class ScoutsWarningAsThoughEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (watcher.isScoutsWarningSpellActive(source.getSourceId(), zoneChangeCounter)) { Card card = game.getCard(sourceId); - if (card != null && card.isCreature() && source.isControlledBy(affectedControllerId)) { + if (card != null && card.isCreature(game) && source.isControlledBy(affectedControllerId)) { return true; } } @@ -109,7 +109,7 @@ class ScoutsWarningWatcher extends Watcher { if (event.getType() == GameEvent.EventType.SPELL_CAST) { if (!getActiveScoutsWarningSpells().isEmpty() && event.getPlayerId().equals(getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isCreature()) { + if (spell != null && spell.isCreature(game)) { getActiveScoutsWarningSpells().clear(); } } diff --git a/Mage.Sets/src/mage/cards/s/ScrapTrawler.java b/Mage.Sets/src/mage/cards/s/ScrapTrawler.java index 5934f5854c..cc90a4f1f2 100644 --- a/Mage.Sets/src/mage/cards/s/ScrapTrawler.java +++ b/Mage.Sets/src/mage/cards/s/ScrapTrawler.java @@ -78,7 +78,7 @@ class ScrapTrawlerTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null && permanent.isControlledBy(this.getControllerId()) - && permanent.isArtifact()) { + && permanent.isArtifact(game)) { FilterCard filter = new FilterArtifactCard("artifact card in your graveyard with mana value less than " + permanent.getManaCost().manaValue()); filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, permanent.getManaCost().manaValue())); TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter); diff --git a/Mage.Sets/src/mage/cards/s/ScribNibblers.java b/Mage.Sets/src/mage/cards/s/ScribNibblers.java index 7ce7ded1fe..0e614007b0 100644 --- a/Mage.Sets/src/mage/cards/s/ScribNibblers.java +++ b/Mage.Sets/src/mage/cards/s/ScribNibblers.java @@ -75,7 +75,7 @@ class ScribNibblersEffect extends OneShotEffect { if (targetPlayer != null && targetPlayer.getLibrary().hasCards()) { Card card = targetPlayer.getLibrary().getFromTop(game); card.moveToExile(id, "Scrib Nibblers Exile", source, game); - if (card.isLand() && you != null) { + if (card.isLand(game) && you != null) { you.gainLife(1, game, source); return true; } diff --git a/Mage.Sets/src/mage/cards/s/ScrollOfFate.java b/Mage.Sets/src/mage/cards/s/ScrollOfFate.java index 882eff8bab..fd3e2773af 100644 --- a/Mage.Sets/src/mage/cards/s/ScrollOfFate.java +++ b/Mage.Sets/src/mage/cards/s/ScrollOfFate.java @@ -85,7 +85,7 @@ class ScrollOfFateEffect extends OneShotEffect { .collect(Collectors.toSet()); cards.stream().forEach(card -> { ManaCosts manaCosts = null; - if (card.isCreature()) { + if (card.isCreature(game)) { manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null; if (manaCosts == null) { manaCosts = new ManaCostsImpl("{0}"); diff --git a/Mage.Sets/src/mage/cards/s/ScytheOfTheWretched.java b/Mage.Sets/src/mage/cards/s/ScytheOfTheWretched.java index 2ed2f405b3..e7a293c34d 100644 --- a/Mage.Sets/src/mage/cards/s/ScytheOfTheWretched.java +++ b/Mage.Sets/src/mage/cards/s/ScytheOfTheWretched.java @@ -82,7 +82,7 @@ class ScytheOfTheWretchedTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zoneChange = (ZoneChangeEvent) event; - if (zoneChange.isDiesEvent() && zoneChange.getTarget().isCreature()) { + if (zoneChange.isDiesEvent() && zoneChange.getTarget().isCreature(game)) { Permanent equippedCreature = getEquippedCreature(game); for (MageObjectReference mor : zoneChange.getTarget().getDealtDamageByThisTurn()) { Permanent permanent = (Permanent) game.getLastKnownInformation(mor.getSourceId(), Zone.BATTLEFIELD); diff --git a/Mage.Sets/src/mage/cards/s/SeaGateStormcaller.java b/Mage.Sets/src/mage/cards/s/SeaGateStormcaller.java index 348aaaf66d..00392dfd66 100644 --- a/Mage.Sets/src/mage/cards/s/SeaGateStormcaller.java +++ b/Mage.Sets/src/mage/cards/s/SeaGateStormcaller.java @@ -90,7 +90,7 @@ class SeaGateStormcallerDelayedTriggeredAbility extends DelayedTriggeredAbility return false; } Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery() || spell.getManaValue() > 2) { + if (spell == null || !spell.isInstantOrSorcery(game) || spell.getManaValue() > 2) { return false; } for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/s/SearchForGlory.java b/Mage.Sets/src/mage/cards/s/SearchForGlory.java index 01207f0d06..3d83b60d91 100644 --- a/Mage.Sets/src/mage/cards/s/SearchForGlory.java +++ b/Mage.Sets/src/mage/cards/s/SearchForGlory.java @@ -60,7 +60,7 @@ enum SearchForGloryPredicate implements Predicate { @Override public boolean apply(Card input, Game game) { - return (input.isPermanent() && input.isSnow()) + return (input.isPermanent(game) && input.isSnow()) || input.isLegendary() || input.hasSubtype(SubType.SAGA, game); } diff --git a/Mage.Sets/src/mage/cards/s/SearchForSurvivors.java b/Mage.Sets/src/mage/cards/s/SearchForSurvivors.java index b539cc8a93..60d4aa3073 100644 --- a/Mage.Sets/src/mage/cards/s/SearchForSurvivors.java +++ b/Mage.Sets/src/mage/cards/s/SearchForSurvivors.java @@ -88,7 +88,7 @@ class SearchForSurvivorsEffect extends OneShotEffect { cards.clear(); cards.add(card); controller.revealCards(source, cards, game); // reveal the card randomly chosen. - if (card.isCreature()) { + if (card.isCreature(game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { controller.moveCards(card, Zone.EXILED, source, game); diff --git a/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java b/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java index db84203882..762311a5c7 100644 --- a/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java +++ b/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java @@ -80,7 +80,7 @@ class SeasonOfTheWitchEffect extends OneShotEffect { if (activePlayer != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) { // Noncreature cards are safe. - if (!permanent.isCreature()) { + if (!permanent.isCreature(game)) { continue; } // Tapped cards are safe. @@ -124,7 +124,7 @@ class CouldAttackThisTurnWatcher extends Watcher { return; } for (Permanent permanent : game.getBattlefield().getAllActivePermanents(activePlayer.getId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { for (UUID defender : game.getCombat().getDefenders()) { if (!defender.equals(activePlayer.getId())) { if (permanent.canAttack(defender, game)) { diff --git a/Mage.Sets/src/mage/cards/s/SedrisTheTraitorKing.java b/Mage.Sets/src/mage/cards/s/SedrisTheTraitorKing.java index e34c149f1a..2825f28381 100644 --- a/Mage.Sets/src/mage/cards/s/SedrisTheTraitorKing.java +++ b/Mage.Sets/src/mage/cards/s/SedrisTheTraitorKing.java @@ -59,7 +59,7 @@ class SedrisTheTraitorKingEffect extends ContinuousEffectImpl { if (controller != null) { for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { UnearthAbility ability = new UnearthAbility(new ManaCostsImpl("{2}{B}")); ability.setSourceId(cardId); ability.setControllerId(card.getOwnerId()); diff --git a/Mage.Sets/src/mage/cards/s/SeekerOfInsight.java b/Mage.Sets/src/mage/cards/s/SeekerOfInsight.java index 85e447773f..273ca35408 100644 --- a/Mage.Sets/src/mage/cards/s/SeekerOfInsight.java +++ b/Mage.Sets/src/mage/cards/s/SeekerOfInsight.java @@ -61,7 +61,7 @@ class CastNonCreatureSpellCondition implements Condition { List spellsCast = watcher.getSpellsCastThisTurn(source.getControllerId()); if (spellsCast != null) { for (Spell spell : spellsCast) { - if (!spell.isCreature()) { + if (!spell.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SelvalasStampede.java b/Mage.Sets/src/mage/cards/s/SelvalasStampede.java index 1902217202..34e715c5a3 100644 --- a/Mage.Sets/src/mage/cards/s/SelvalasStampede.java +++ b/Mage.Sets/src/mage/cards/s/SelvalasStampede.java @@ -78,7 +78,7 @@ class SelvalasStampedeEffect extends OneShotEffect { if (creatureCards.size() >= wildCount) { break; } - if (card.isCreature()) { + if (card.isCreature(game)) { creatureCards.add(card); } toReveal.add(card); diff --git a/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java b/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java index b24e386835..afef026fe8 100644 --- a/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java +++ b/Mage.Sets/src/mage/cards/s/SemblanceAnvil.java @@ -115,7 +115,7 @@ class SemblanceAnvilCostReductionEffect extends CostModificationEffectImpl { List imprinted = permanent.getImprinted(); if (imprinted != null && !imprinted.isEmpty()) { Card imprintedCard = game.getCard(imprinted.get(0)); - return imprintedCard != null && imprintedCard.shareTypes(spellCard); + return imprintedCard != null && imprintedCard.shareTypes(spellCard, game); } } } diff --git a/Mage.Sets/src/mage/cards/s/SemestersEnd.java b/Mage.Sets/src/mage/cards/s/SemestersEnd.java index b6b1fc6cde..1cd697622a 100644 --- a/Mage.Sets/src/mage/cards/s/SemestersEnd.java +++ b/Mage.Sets/src/mage/cards/s/SemestersEnd.java @@ -126,10 +126,10 @@ class SemestersEndReturnEffect extends OneShotEffect { return false; } cards.stream().map(game::getPermanent).filter(Objects::nonNull).forEach(p -> { - if (p.isCreature()) { + if (p.isCreature(game)) { p.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game); } - if (p.isPlaneswalker()) { + if (p.isPlaneswalker(game)) { p.addCounters(CounterType.LOYALTY.createInstance(), source.getControllerId(), source, game); } }); diff --git a/Mage.Sets/src/mage/cards/s/SenatorLottDod.java b/Mage.Sets/src/mage/cards/s/SenatorLottDod.java index e9db7d4efe..30c904dcfc 100644 --- a/Mage.Sets/src/mage/cards/s/SenatorLottDod.java +++ b/Mage.Sets/src/mage/cards/s/SenatorLottDod.java @@ -96,7 +96,7 @@ class SenatorLottDodSpellsTargetingCreatureCostModificationEffect extends CostMo private boolean isTargetCompatible(UUID target, Ability source, Game game) { // target a creature you control Permanent targetPermanent = game.getPermanent(target); - if (targetPermanent != null && targetPermanent.isCreature() && targetPermanent.isControlledBy(source.getControllerId())) { + if (targetPermanent != null && targetPermanent.isCreature(game) && targetPermanent.isControlledBy(source.getControllerId())) { return true; } diff --git a/Mage.Sets/src/mage/cards/s/SentinelTower.java b/Mage.Sets/src/mage/cards/s/SentinelTower.java index 5fafd90aa0..e42ea32de8 100644 --- a/Mage.Sets/src/mage/cards/s/SentinelTower.java +++ b/Mage.Sets/src/mage/cards/s/SentinelTower.java @@ -119,7 +119,7 @@ class SentinelTowerWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { MageObject object = game.getObject(event.getTargetId()); - if (object != null && object.isInstantOrSorcery()) { + if (object != null && object.isInstantOrSorcery(game)) { spellsThisTurn.add(new MageObjectReference(object, game)); } } diff --git a/Mage.Sets/src/mage/cards/s/SerpentsSoulJar.java b/Mage.Sets/src/mage/cards/s/SerpentsSoulJar.java index 5ec711551d..e5a3f7c327 100644 --- a/Mage.Sets/src/mage/cards/s/SerpentsSoulJar.java +++ b/Mage.Sets/src/mage/cards/s/SerpentsSoulJar.java @@ -137,7 +137,7 @@ class SerpentsSoulJarCastFromExileEffect extends AsThoughEffectImpl { return false; } Card card = game.getCard(sourceId); - return card != null && card.isCreature() && !card.isLand(); + return card != null && card.isCreature(game) && !card.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/s/SerraBestiary.java b/Mage.Sets/src/mage/cards/s/SerraBestiary.java index d34071a219..8275578b8b 100644 --- a/Mage.Sets/src/mage/cards/s/SerraBestiary.java +++ b/Mage.Sets/src/mage/cards/s/SerraBestiary.java @@ -109,7 +109,7 @@ class SerraBestiaryRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); return ability.isPresent() && object != null - && object.isCreature() + && object.isCreature(game) && object.getId().equals(enchantedCreature.getId()) && game.getState().getPlayersInRange(source.getControllerId(), game).contains(event.getPlayerId()) && ability.get().hasTapCost(); diff --git a/Mage.Sets/src/mage/cards/s/SevinneTheChronoclasm.java b/Mage.Sets/src/mage/cards/s/SevinneTheChronoclasm.java index 55c53e5313..18b1f3183e 100644 --- a/Mage.Sets/src/mage/cards/s/SevinneTheChronoclasm.java +++ b/Mage.Sets/src/mage/cards/s/SevinneTheChronoclasm.java @@ -104,7 +104,7 @@ class SevinneTheChronoclasmWatcher extends Watcher { return; } Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { firstSpellThisTurn.putIfAbsent(event.getPlayerId(), spell.getId()); } } diff --git a/Mage.Sets/src/mage/cards/s/ShallowGrave.java b/Mage.Sets/src/mage/cards/s/ShallowGrave.java index 00a6aea763..1f70eaab1e 100644 --- a/Mage.Sets/src/mage/cards/s/ShallowGrave.java +++ b/Mage.Sets/src/mage/cards/s/ShallowGrave.java @@ -68,7 +68,7 @@ class ShallowGraveEffect extends OneShotEffect { if (controller != null) { Card lastCreatureCard = null; for (Card card : controller.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { lastCreatureCard = card; } } diff --git a/Mage.Sets/src/mage/cards/s/ShapeAnew.java b/Mage.Sets/src/mage/cards/s/ShapeAnew.java index 386c5245a2..6f6227dcd6 100644 --- a/Mage.Sets/src/mage/cards/s/ShapeAnew.java +++ b/Mage.Sets/src/mage/cards/s/ShapeAnew.java @@ -65,7 +65,7 @@ public final class ShapeAnew extends CardImpl { Card artifactCard = null; for (Card card : targetController.getLibrary().getCards(game)) { revealed.add(card); - if (card.isArtifact()) { + if (card.isArtifact(game)) { artifactCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java b/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java index 501730e40c..1896b085d6 100644 --- a/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java +++ b/Mage.Sets/src/mage/cards/s/ShapersSanctuary.java @@ -61,7 +61,7 @@ class CreaturesYouControlTargetedTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); Player targetter = game.getPlayer(event.getPlayerId()); - if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature()) { + if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(game)) { Object object = game.getObject(event.getSourceId()); if (object != null && targetter != null && targetter.hasOpponent(this.getControllerId(), game)) { return true; diff --git a/Mage.Sets/src/mage/cards/s/ShapeshiftersMarrow.java b/Mage.Sets/src/mage/cards/s/ShapeshiftersMarrow.java index 327eb00da0..2752086927 100644 --- a/Mage.Sets/src/mage/cards/s/ShapeshiftersMarrow.java +++ b/Mage.Sets/src/mage/cards/s/ShapeshiftersMarrow.java @@ -61,7 +61,7 @@ public final class ShapeshiftersMarrow extends CardImpl { Card card = activePlayer.getLibrary().getFromTop(game); if (card != null) { activePlayer.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); - if (card.isCreature()) { + if (card.isCreature(game)) { activePlayer.moveCards(activePlayer.getLibrary().getTopCards(game, 1), Zone.GRAVEYARD, source, game); CopyEffect copyEffect = new CopyEffect(Duration.Custom, card, source.getSourceId()); game.addEffect(copyEffect, source); diff --git a/Mage.Sets/src/mage/cards/s/SharedSummons.java b/Mage.Sets/src/mage/cards/s/SharedSummons.java index e8c306985e..10e0cc3c56 100644 --- a/Mage.Sets/src/mage/cards/s/SharedSummons.java +++ b/Mage.Sets/src/mage/cards/s/SharedSummons.java @@ -59,7 +59,7 @@ class SharedSummonsTarget extends TargetCardInLibrary { @Override public boolean canTarget(UUID playerId, UUID id, Ability source, Cards cards, Game game) { Card card = cards.get(id, game); - if (card == null || !card.isCreature()) { + if (card == null || !card.isCreature(game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/s/ShiftingLoyalties.java b/Mage.Sets/src/mage/cards/s/ShiftingLoyalties.java index 5c502625ee..360516f3d9 100644 --- a/Mage.Sets/src/mage/cards/s/ShiftingLoyalties.java +++ b/Mage.Sets/src/mage/cards/s/ShiftingLoyalties.java @@ -61,7 +61,7 @@ class TargetPermanentsThatShareCardType extends TargetPermanent { if (targetOne == null || targetTwo == null) { return false; } - return targetOne.shareTypes(targetTwo); + return targetOne.shareTypes(targetTwo, game); } return true; } @@ -75,12 +75,12 @@ class TargetPermanentsThatShareCardType extends TargetPermanent { if (targetSource != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { - for (CardType cardType : permanent.getCardType()) { + for (CardType cardType : permanent.getCardType(game)) { if (cardTypes.contains(cardType)) { return true; } } - cardTypes.addAll(permanent.getCardType()); + cardTypes.addAll(permanent.getCardType(game)); } } } diff --git a/Mage.Sets/src/mage/cards/s/ShiftingShadow.java b/Mage.Sets/src/mage/cards/s/ShiftingShadow.java index 7c74bc0d38..a10eba3cba 100644 --- a/Mage.Sets/src/mage/cards/s/ShiftingShadow.java +++ b/Mage.Sets/src/mage/cards/s/ShiftingShadow.java @@ -116,7 +116,7 @@ class ShiftingShadowEffect extends OneShotEffect { Cards otherCards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { revealed.add(card); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); Permanent newEnchanted = game.getPermanent(card.getId()); FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); diff --git a/Mage.Sets/src/mage/cards/s/ShiningShoal.java b/Mage.Sets/src/mage/cards/s/ShiningShoal.java index f918585c71..7685e0eae5 100644 --- a/Mage.Sets/src/mage/cards/s/ShiningShoal.java +++ b/Mage.Sets/src/mage/cards/s/ShiningShoal.java @@ -110,7 +110,7 @@ class ShiningShoalRedirectDamageTargetEffect extends RedirectDamageFromSourceToT // check target // check creature first Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { if (permanent.isControlledBy(source.getControllerId())) { // it's your creature redirectTarget = source.getTargets().get(1); diff --git a/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java b/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java index 02fc5a9f99..d030d0a960 100644 --- a/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java +++ b/Mage.Sets/src/mage/cards/s/ShireiShizosCaretaker.java @@ -14,7 +14,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -77,7 +76,7 @@ class ShireiShizosCaretakerTriggeredAbility extends TriggeredAbilityImpl { && LKIpermanent != null && card.isOwnedBy(this.controllerId) && zEvent.isDiesEvent() - && card.isCreature() + && card.isCreature(game) && LKIpermanent.getPower().getValue() <= 1) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(zEvent.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/s/ShowOfConfidence.java b/Mage.Sets/src/mage/cards/s/ShowOfConfidence.java index b688eca27f..30de275acb 100644 --- a/Mage.Sets/src/mage/cards/s/ShowOfConfidence.java +++ b/Mage.Sets/src/mage/cards/s/ShowOfConfidence.java @@ -1,6 +1,5 @@ package mage.cards.s; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CastSourceTriggeredAbility; @@ -77,7 +76,7 @@ class ShowOfConfidenceEffect extends OneShotEffect { int copies = watcher.getSpellsCastThisTurn(source.getControllerId()) .stream() .filter(Objects::nonNull) - .filter(MageObject::isInstantOrSorcery) + .filter(spell1 -> spell1.isInstantOrSorcery(game)) .filter(s -> !s.getSourceId().equals(source.getSourceId()) || s.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) .mapToInt(x -> 1) diff --git a/Mage.Sets/src/mage/cards/s/ShrivelingRot.java b/Mage.Sets/src/mage/cards/s/ShrivelingRot.java index 2b2dc3c01b..9629342113 100644 --- a/Mage.Sets/src/mage/cards/s/ShrivelingRot.java +++ b/Mage.Sets/src/mage/cards/s/ShrivelingRot.java @@ -78,7 +78,7 @@ class ShrivelingRotDestroyTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); @@ -115,7 +115,7 @@ class ShrivelingRotLoseLifeTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent()) { - if (zEvent.getTarget().isCreature()) { + if (zEvent.getTarget().isCreature(game)) { Effect effect = this.getEffects().get(0); effect.setTargetPointer(new FixedTarget(event.getTargetId())); return true; diff --git a/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java b/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java index e18449ce7b..ff94ff398b 100644 --- a/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java +++ b/Mage.Sets/src/mage/cards/s/SidisiBroodTyrant.java @@ -77,7 +77,7 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); if (cardOwnerId != null && card.isOwnedBy(getControllerId()) - && card.isCreature()) { + && card.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SilburlindSnapper.java b/Mage.Sets/src/mage/cards/s/SilburlindSnapper.java index 7893b16372..8cf0407bd9 100644 --- a/Mage.Sets/src/mage/cards/s/SilburlindSnapper.java +++ b/Mage.Sets/src/mage/cards/s/SilburlindSnapper.java @@ -72,7 +72,7 @@ class SilburlindSnapperEffect extends RestrictionEffect { List spellsCast = watcher.getSpellsCastThisTurn(source.getControllerId()); if (spellsCast != null) { for (Spell spell : spellsCast) { - if (!spell.isCreature()) { + if (!spell.isCreature(game)) { return false; } } diff --git a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java index a17622fee4..17745fbfe4 100644 --- a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java +++ b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java @@ -79,8 +79,8 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI && (permanent.hasSubtype(SubType.WOLF, game) || permanent.hasSubtype(SubType.WEREWOLF, game))) { if (object instanceof StackObject) { - if (object.isInstant() - || object.isSorcery()) { + if (object.isInstant(game) + || object.isSorcery(game)) { if (getTargets().isEmpty()) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/s/SimicAscendancy.java b/Mage.Sets/src/mage/cards/s/SimicAscendancy.java index 22738f02fe..df75a5edaf 100644 --- a/Mage.Sets/src/mage/cards/s/SimicAscendancy.java +++ b/Mage.Sets/src/mage/cards/s/SimicAscendancy.java @@ -90,7 +90,7 @@ class SimicAscendancyTriggeredAbility extends TriggeredAbilityImpl { } if (permanent != null && !event.getTargetId().equals(this.getSourceId()) - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) { this.getEffects().clear(); if (event.getAmount() > 0) { diff --git a/Mage.Sets/src/mage/cards/s/Sindbad.java b/Mage.Sets/src/mage/cards/s/Sindbad.java index ab5eede3ec..ed407a4b33 100644 --- a/Mage.Sets/src/mage/cards/s/Sindbad.java +++ b/Mage.Sets/src/mage/cards/s/Sindbad.java @@ -15,8 +15,6 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.common.FilterLandCard; import mage.game.Game; import mage.players.Player; @@ -75,7 +73,7 @@ class SindbadEffect extends OneShotEffect { return true; } controller.revealCards(source, new CardsImpl(card), game); - if (!card.isLand()) { + if (!card.isLand(game)) { controller.discard(card, false, source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/s/SingleCombat.java b/Mage.Sets/src/mage/cards/s/SingleCombat.java index 496c1566c6..b854a8abea 100644 --- a/Mage.Sets/src/mage/cards/s/SingleCombat.java +++ b/Mage.Sets/src/mage/cards/s/SingleCombat.java @@ -122,6 +122,6 @@ class SingleCombatRestrictionEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Card card = game.getCard(event.getSourceId()); - return card != null && (card.isCreature() || card.isPlaneswalker()); + return card != null && (card.isCreature(game) || card.isPlaneswalker(game)); } } diff --git a/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java b/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java index 5b428368e6..f9b6a388f1 100644 --- a/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java +++ b/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java @@ -87,7 +87,7 @@ class SionaCaptainOfThePyleasAbility extends TriggeredAbilityImpl { return permanent != null && attachment != null && permanent.isControlledBy(getControllerId()) - && permanent.isCreature() + && permanent.isCreature(game) && attachment.isControlledBy(getControllerId()) && attachment.hasSubtype(SubType.AURA, game); } diff --git a/Mage.Sets/src/mage/cards/s/SirenStormtamer.java b/Mage.Sets/src/mage/cards/s/SirenStormtamer.java index 1a8cea283e..8e5b4d30a4 100644 --- a/Mage.Sets/src/mage/cards/s/SirenStormtamer.java +++ b/Mage.Sets/src/mage/cards/s/SirenStormtamer.java @@ -97,7 +97,7 @@ class SirenStormtamerTargetObject extends TargetObject { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); if (targetedPermanent != null && targetedPermanent.isControlledBy(sourceControllerId) - && targetedPermanent.isCreature()) { + && targetedPermanent.isCreature(game)) { return true; } @@ -131,7 +131,7 @@ class SirenStormtamerTargetObject extends TargetObject { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); if (targetedPermanent != null && targetedPermanent.isControlledBy(sourceControllerId) - && targetedPermanent.isCreature()) { + && targetedPermanent.isCreature(game)) { possibleTargets.add(stackObject.getId()); } diff --git a/Mage.Sets/src/mage/cards/s/SirensCall.java b/Mage.Sets/src/mage/cards/s/SirensCall.java index 845190bbd3..6162aff1f2 100644 --- a/Mage.Sets/src/mage/cards/s/SirensCall.java +++ b/Mage.Sets/src/mage/cards/s/SirensCall.java @@ -111,7 +111,7 @@ class SirensCallDestroyEffect extends OneShotEffect { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(player.getId())) { // Non Creature Cards are safe. - if (!permanent.isCreature()) { + if (!permanent.isCreature(game)) { continue; } diff --git a/Mage.Sets/src/mage/cards/s/SkophosMazeWarden.java b/Mage.Sets/src/mage/cards/s/SkophosMazeWarden.java index 3882336ce8..3362476b6b 100644 --- a/Mage.Sets/src/mage/cards/s/SkophosMazeWarden.java +++ b/Mage.Sets/src/mage/cards/s/SkophosMazeWarden.java @@ -81,13 +81,13 @@ class SkophosMazeWardenTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanent(stackObject.getSourceId()); if (permanent == null || !permanent.isControlledBy(getControllerId()) - || !permanent.isLand() + || !permanent.isLand(game) || !permanent.getName().equals("Labyrinth of Skophos")) { return false; } Permanent creature = game.getPermanent(event.getTargetId()); if (creature == null - || !creature.isCreature() + || !creature.isCreature(game) || creature.getId().equals(getSourceId())) { return false; } diff --git a/Mage.Sets/src/mage/cards/s/SkullportMerchant.java b/Mage.Sets/src/mage/cards/s/SkullportMerchant.java index 582e93115a..077336654e 100644 --- a/Mage.Sets/src/mage/cards/s/SkullportMerchant.java +++ b/Mage.Sets/src/mage/cards/s/SkullportMerchant.java @@ -71,6 +71,6 @@ enum SkullportMerchantPredicate implements ObjectSourcePlayerPredicate game.getState().getZone(card.getId()) == Zone.GRAVEYARD) - .filter(MageObject::isCreature) + .filter(card1 -> card1.isCreature(game)) .mapToInt(x -> 1) .sum(); // Setup a delayed trigger to give +X/+0 to any creature attacking this turn.. diff --git a/Mage.Sets/src/mage/cards/s/SongOfTheDryads.java b/Mage.Sets/src/mage/cards/s/SongOfTheDryads.java index 646cbdb4b4..aef644aa67 100644 --- a/Mage.Sets/src/mage/cards/s/SongOfTheDryads.java +++ b/Mage.Sets/src/mage/cards/s/SongOfTheDryads.java @@ -86,8 +86,8 @@ class BecomesColorlessForestLandEffect extends ContinuousEffectImpl { permanent.getColor(game).setRed(false); break; case TypeChangingEffects_4: - permanent.getCardType().clear(); - permanent.addCardType(CardType.LAND); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.LAND); permanent.removeAllSubTypes(game); permanent.addSubType(game, SubType.FOREST); permanent.removeAllAbilities(source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/s/SosukeSonOfSeshiro.java b/Mage.Sets/src/mage/cards/s/SosukeSonOfSeshiro.java index 25dd0700ee..20dbca03e4 100644 --- a/Mage.Sets/src/mage/cards/s/SosukeSonOfSeshiro.java +++ b/Mage.Sets/src/mage/cards/s/SosukeSonOfSeshiro.java @@ -90,7 +90,7 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl { if (sourceCreature == null || !sourceCreature.isControlledBy(this.getControllerId()) || targetCreature == null - || !targetCreature.isCreature() + || !targetCreature.isCreature(game) || !sourceCreature.hasSubtype(SubType.WARRIOR, game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/s/SoulBurn.java b/Mage.Sets/src/mage/cards/s/SoulBurn.java index 5c85a3286f..3aebdbbc30 100644 --- a/Mage.Sets/src/mage/cards/s/SoulBurn.java +++ b/Mage.Sets/src/mage/cards/s/SoulBurn.java @@ -137,9 +137,9 @@ class SoulBurnEffect extends OneShotEffect { } Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { lifetogain = Math.min(permanent.getToughness().getValue(), lifetogain); - } else if (permanent.isPlaneswalker()) { + } else if (permanent.isPlaneswalker(game)) { lifetogain = Math.min(permanent.getCounters(game).getCount(CounterType.LOYALTY), lifetogain); } else { return false; diff --git a/Mage.Sets/src/mage/cards/s/SoulScarMage.java b/Mage.Sets/src/mage/cards/s/SoulScarMage.java index cca5bb549e..ba360f06b9 100644 --- a/Mage.Sets/src/mage/cards/s/SoulScarMage.java +++ b/Mage.Sets/src/mage/cards/s/SoulScarMage.java @@ -87,7 +87,7 @@ class SoulScarMageDamageReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && !((DamageEvent) event).isCombatDamage() && game.getOpponents(permanent.getControllerId()).contains(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/s/SoulSculptor.java b/Mage.Sets/src/mage/cards/s/SoulSculptor.java index 7528bc88d6..a16517620d 100644 --- a/Mage.Sets/src/mage/cards/s/SoulSculptor.java +++ b/Mage.Sets/src/mage/cards/s/SoulSculptor.java @@ -88,9 +88,9 @@ class SoulSculptorEffect extends ContinuousEffectImpl { } switch (layer) { case TypeChangingEffects_4: - permanent.getCardType().clear(); + permanent.removeAllCardTypes(game); permanent.retainAllEnchantmentSubTypes(game); - permanent.getCardType().add(CardType.ENCHANTMENT); + permanent.addCardType(game, CardType.ENCHANTMENT); break; case AbilityAddingRemovingEffects_6: if (sublayer == SubLayer.NA) { @@ -123,7 +123,7 @@ enum SoulSculptorCondition implements Condition { if (!game.getStack().isEmpty()) { StackObject stackObject = game.getStack().getFirst(); if (stackObject != null) { - return !stackObject.getCardType().contains(CardType.CREATURE); + return !stackObject.getCardType(game).contains(CardType.CREATURE); } } return true; diff --git a/Mage.Sets/src/mage/cards/s/Soulflayer.java b/Mage.Sets/src/mage/cards/s/Soulflayer.java index 417731e206..6e184d3993 100644 --- a/Mage.Sets/src/mage/cards/s/Soulflayer.java +++ b/Mage.Sets/src/mage/cards/s/Soulflayer.java @@ -88,7 +88,7 @@ class SoulflayerEffect extends ContinuousEffectImpl implements SourceEffect { Cards delvedCards = (Cards) game.getState().getValue(keyString); if (delvedCards != null) { for (Card card : delvedCards.getCards(game)) { - if (!card.isCreature()) { + if (!card.isCreature(game)) { continue; } for (Ability cardAbility : card.getAbilities(game)) { diff --git a/Mage.Sets/src/mage/cards/s/Soulherder.java b/Mage.Sets/src/mage/cards/s/Soulherder.java index 4dae7e4345..adb1ffe805 100644 --- a/Mage.Sets/src/mage/cards/s/Soulherder.java +++ b/Mage.Sets/src/mage/cards/s/Soulherder.java @@ -87,7 +87,7 @@ class SoulherderTriggeredAbility extends ZoneChangeTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { // custom check cause ZoneChangeTriggeredAbility for source object only ZoneChangeEvent zEvent = (ZoneChangeEvent) event; return (fromZone == null || zEvent.getFromZone() == fromZone) diff --git a/Mage.Sets/src/mage/cards/s/SparkDouble.java b/Mage.Sets/src/mage/cards/s/SparkDouble.java index be54d96203..fd55f2e0df 100644 --- a/Mage.Sets/src/mage/cards/s/SparkDouble.java +++ b/Mage.Sets/src/mage/cards/s/SparkDouble.java @@ -92,7 +92,7 @@ class SparkDoubleCopyApplier extends CopyApplier { // counters only for original card, not copies if (!isCopyOfCopy(source, blueprint, copyToObjectId)) { // enters with an additional +1/+1 counter on it if it’s a creature - if (blueprint.isCreature()) { + if (blueprint.isCreature(game)) { blueprint.getAbilities().add(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(), false) .setText("with an additional +1/+1 counter on it") @@ -100,7 +100,7 @@ class SparkDoubleCopyApplier extends CopyApplier { } // enters with an additional loyalty counter on it if it’s a planeswalker - if (blueprint.isPlaneswalker()) { + if (blueprint.isPlaneswalker(game)) { blueprint.getAbilities().add(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(), false) .setText("with an additional loyalty counter on it") diff --git a/Mage.Sets/src/mage/cards/s/Spellshift.java b/Mage.Sets/src/mage/cards/s/Spellshift.java index af7f49e149..274482596d 100644 --- a/Mage.Sets/src/mage/cards/s/Spellshift.java +++ b/Mage.Sets/src/mage/cards/s/Spellshift.java @@ -71,7 +71,7 @@ class SpellshiftEffect extends OneShotEffect { Card toCast = null; for (Card card : spellController.getLibrary().getCards(game)) { cardsToReveal.add(card); - if (card.isSorcery() || card.isInstant()) { + if (card.isSorcery(game) || card.isInstant(game)) { toCast = card; break; } diff --git a/Mage.Sets/src/mage/cards/s/SphereOfAnnihilation.java b/Mage.Sets/src/mage/cards/s/SphereOfAnnihilation.java index aaadd0bb4d..9f9069c38e 100644 --- a/Mage.Sets/src/mage/cards/s/SphereOfAnnihilation.java +++ b/Mage.Sets/src/mage/cards/s/SphereOfAnnihilation.java @@ -89,7 +89,7 @@ class SphereOfAnnihilationEffect extends OneShotEffect { .map(Player::getGraveyard) .map(g -> g.getCards(game)) .flatMap(Collection::stream) - .filter(card -> card.isCreature() || card.isPlaneswalker()) + .filter(card -> card.isCreature(game) || card.isPlaneswalker(game)) .filter(card -> card.getManaValue() <= counters) .forEach(cards::add); return player.moveCards(cards, Zone.EXILED, source, game); diff --git a/Mage.Sets/src/mage/cards/s/SphereOfPurity.java b/Mage.Sets/src/mage/cards/s/SphereOfPurity.java index fbdccff594..6fc9535e93 100644 --- a/Mage.Sets/src/mage/cards/s/SphereOfPurity.java +++ b/Mage.Sets/src/mage/cards/s/SphereOfPurity.java @@ -57,7 +57,7 @@ class SphereOfPurityEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getControllerId())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isArtifact()) { + if (permanent != null && permanent.isArtifact(game)) { return super.applies(event, source, game); } } diff --git a/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java b/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java index 90c2ee2772..7ca92711ef 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java +++ b/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java @@ -95,7 +95,7 @@ class SphinxAmbassadorEffect extends OneShotEffect { String cardName = cardChoice.getChoice(); game.informPlayers(sourcePermanent.getName() + ", named card: [" + cardName + ']'); - if (!card.getName().equals(cardName) && card.isCreature()) { + if (!card.getName().equals(cardName) && card.isCreature(game)) { if (controller.chooseUse(outcome, "Put " + card.getName() + " onto the battlefield?", source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } diff --git a/Mage.Sets/src/mage/cards/s/SphinxsDecree.java b/Mage.Sets/src/mage/cards/s/SphinxsDecree.java index 3a50cdb9c2..2a954e2695 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxsDecree.java +++ b/Mage.Sets/src/mage/cards/s/SphinxsDecree.java @@ -111,7 +111,7 @@ class SphinxsDecreeCantCastEffect extends ContinuousRuleModifyingEffectImpl { if (opponentId.equals(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (event.getType() == GameEvent.EventType.CAST_SPELL) { - if (object != null && object.isInstantOrSorcery()) { + if (object != null && object.isInstantOrSorcery(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SphinxsTutelage.java b/Mage.Sets/src/mage/cards/s/SphinxsTutelage.java index 501efad3e1..6189c1d24e 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxsTutelage.java +++ b/Mage.Sets/src/mage/cards/s/SphinxsTutelage.java @@ -88,7 +88,7 @@ class SphinxsTutelageEffect extends OneShotEffect { .millCards(2, source, game) .getCards(game) .stream() - .filter(card -> !card.isLand()) + .filter(card -> !card.isLand(game)) .collect(Collectors.toList()); if (cards.size() < 2) { break; diff --git a/Mage.Sets/src/mage/cards/s/SpitefulReturned.java b/Mage.Sets/src/mage/cards/s/SpitefulReturned.java index c49b428159..47310ba05c 100644 --- a/Mage.Sets/src/mage/cards/s/SpitefulReturned.java +++ b/Mage.Sets/src/mage/cards/s/SpitefulReturned.java @@ -17,7 +17,6 @@ import mage.constants.Duration; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -78,7 +77,7 @@ class SpitefulReturnedTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent sourcePermanent = game.getPermanent(this.getSourceId()); if (sourcePermanent != null) { - if (sourcePermanent.isCreature()) { + if (sourcePermanent.isCreature(game)) { if (event.getSourceId() != null && event.getSourceId().equals(this.getSourceId())) { UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java b/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java index 3af51cc253..3183e1c1fc 100644 --- a/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java +++ b/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java @@ -14,7 +14,6 @@ import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.token.SpoilsOfBloodHorrorToken; import mage.players.Player; @@ -91,7 +90,7 @@ class CreaturesDiedThisTurnWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (mageObject != null && mageObject.isCreature()) { + if (mageObject != null && mageObject.isCreature(game)) { creaturesDiedThisTurn++; } } diff --git a/Mage.Sets/src/mage/cards/s/Sporogenesis.java b/Mage.Sets/src/mage/cards/s/Sporogenesis.java index 0cfb877625..b023c6b39b 100644 --- a/Mage.Sets/src/mage/cards/s/Sporogenesis.java +++ b/Mage.Sets/src/mage/cards/s/Sporogenesis.java @@ -23,7 +23,6 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.token.SaprolingToken; @@ -93,7 +92,7 @@ class SporogenesisTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.isDiesEvent()) { Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getCounters(game).containsKey(CounterType.FUNGUS)) { Effect effect = this.getEffects().get(0); effect.setTargetPointer(new FixedTarget(event.getTargetId())); @@ -154,7 +153,7 @@ class SporogenesisRemoveCountersEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE, game)) { permanent.removeCounters(CounterType.FUNGUS.createInstance(permanent.getCounters(game).getCount(CounterType.FUNGUS)), source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/s/SquealingDevil.java b/Mage.Sets/src/mage/cards/s/SquealingDevil.java index b96ec07eed..89c2fbae5f 100644 --- a/Mage.Sets/src/mage/cards/s/SquealingDevil.java +++ b/Mage.Sets/src/mage/cards/s/SquealingDevil.java @@ -84,7 +84,7 @@ class SquealingDevilEffect extends OneShotEffect { cost.add(new GenericManaCost(costX)); if (cost.pay(source, game, source, source.getControllerId(), false, null)) { Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { ContinuousEffect effect = new BoostTargetEffect(costX, 0, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/s/Starfall.java b/Mage.Sets/src/mage/cards/s/Starfall.java index d28452cb93..e4bc4b3043 100644 --- a/Mage.Sets/src/mage/cards/s/Starfall.java +++ b/Mage.Sets/src/mage/cards/s/Starfall.java @@ -59,7 +59,7 @@ class StarfallEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { permanent.damage(3, source.getSourceId(), source, game, false, true); - if (permanent.isEnchantment()) { + if (permanent.isEnchantment(game)) { Player targetController = game.getPlayer(permanent.getControllerId()); if (targetController != null) { targetController.damage(3, source.getSourceId(), source, game); diff --git a/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java b/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java index 76f698f279..9bf5979fb4 100644 --- a/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java +++ b/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java @@ -18,7 +18,6 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInYourGraveyard; /** @@ -117,16 +116,16 @@ public final class StarfieldOfNyx extends CardImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!permanent.isCreature() + if (!permanent.isCreature(game) && !permanent.hasSubtype(SubType.AURA, game)) { - permanent.addCardType(CardType.CREATURE); + permanent.addCardType(game, CardType.CREATURE); } } break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b - && permanent.isCreature() + && permanent.isCreature(game) && !permanent.hasSubtype(SubType.AURA, game)) { int manaCost = permanent.getManaValue(); permanent.getPower().setValue(manaCost); diff --git a/Mage.Sets/src/mage/cards/s/StartYourEngines.java b/Mage.Sets/src/mage/cards/s/StartYourEngines.java index 28157a9c9f..d641230ef8 100644 --- a/Mage.Sets/src/mage/cards/s/StartYourEngines.java +++ b/Mage.Sets/src/mage/cards/s/StartYourEngines.java @@ -60,8 +60,8 @@ class StartYourEnginesEffect extends ContinuousEffectImpl { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { if (permanent != null && permanent.hasSubtype(SubType.VEHICLE, game)) { if (sublayer == SubLayer.NA) { - permanent.addCardType(CardType.ARTIFACT); - permanent.addCardType(CardType.CREATURE);// TODO: Check if giving CREATURE Type is correct + permanent.addCardType(game, CardType.ARTIFACT); + permanent.addCardType(game, CardType.CREATURE);// TODO: Check if giving CREATURE Type is correct } } } diff --git a/Mage.Sets/src/mage/cards/s/SteamVines.java b/Mage.Sets/src/mage/cards/s/SteamVines.java index 2598cc2b68..8bfd128b2f 100644 --- a/Mage.Sets/src/mage/cards/s/SteamVines.java +++ b/Mage.Sets/src/mage/cards/s/SteamVines.java @@ -87,7 +87,7 @@ class SteamVinesEffect extends OneShotEffect { landsController.damage(1, source.getSourceId(), source, game); } } - if (!game.getBattlefield().getAllActivePermanents(CardType.LAND).isEmpty()) { //lands are available on the battlefield + if (!game.getBattlefield().getAllActivePermanents(CardType.LAND, game).isEmpty()) { //lands are available on the battlefield Target target = new TargetLandPermanent(); target.setNotTarget(true); //not a target, it is chosen Card steamVinesCard = game.getCard(source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/s/SteelGolem.java b/Mage.Sets/src/mage/cards/s/SteelGolem.java index 3aafa30e83..217391cfd1 100644 --- a/Mage.Sets/src/mage/cards/s/SteelGolem.java +++ b/Mage.Sets/src/mage/cards/s/SteelGolem.java @@ -65,7 +65,7 @@ class SteelGolemEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { Card card = game.getCard(event.getSourceId()); - return card != null && card.isCreature(); + return card != null && card.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/s/StolenGoods.java b/Mage.Sets/src/mage/cards/s/StolenGoods.java index ee623e7420..eea404db6f 100644 --- a/Mage.Sets/src/mage/cards/s/StolenGoods.java +++ b/Mage.Sets/src/mage/cards/s/StolenGoods.java @@ -68,7 +68,7 @@ class StolenGoodsEffect extends OneShotEffect { if (card != null) { opponent.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)); } - } while (card != null && card.isLand()); + } while (card != null && card.isLand(game)); if (card != null) { ContinuousEffect effect = new StolenGoodsCastFromExileEffect(); diff --git a/Mage.Sets/src/mage/cards/s/StolenStrategy.java b/Mage.Sets/src/mage/cards/s/StolenStrategy.java index 33f5156eaa..797c7b6892 100644 --- a/Mage.Sets/src/mage/cards/s/StolenStrategy.java +++ b/Mage.Sets/src/mage/cards/s/StolenStrategy.java @@ -75,7 +75,7 @@ class StolenStrategyEffect extends OneShotEffect { // move card to exile controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source, game, Zone.LIBRARY, true); // Add effects only if the card has a spellAbility (e.g. not for lands). - if (!card.isLand() && card.getSpellAbility() != null) { + if (!card.isLand(game) && card.getSpellAbility() != null) { // allow to cast the card // and you may spend mana as though it were mana of any color to cast it CardUtil.makeCardPlayable(game, source, card, Duration.EndOfTurn, true); diff --git a/Mage.Sets/src/mage/cards/s/StoneworkPackbeast.java b/Mage.Sets/src/mage/cards/s/StoneworkPackbeast.java index 1327ee5efe..090cc1b301 100644 --- a/Mage.Sets/src/mage/cards/s/StoneworkPackbeast.java +++ b/Mage.Sets/src/mage/cards/s/StoneworkPackbeast.java @@ -3,7 +3,6 @@ package mage.cards.s; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.continuous.HasSubtypesSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; @@ -27,9 +26,9 @@ public final class StoneworkPackbeast extends CardImpl { this.toughness = new MageInt(1); // Stonework Packbeast is also a Cleric, Rogue, Warrior, and Wizard. - this.addAbility(new SimpleStaticAbility( - Zone.ALL, new HasSubtypesSourceEffect(SubType.CLERIC, SubType.ROGUE, SubType.WARRIOR, SubType.WIZARD) - )); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new HasSubtypesSourceEffect( + SubType.CLERIC, SubType.ROGUE, SubType.WARRIOR, SubType.WIZARD + ))); // {2}: Add one mana of any color. this.addAbility(new AnyColorManaAbility(new GenericManaCost(2))); diff --git a/Mage.Sets/src/mage/cards/s/StonySilence.java b/Mage.Sets/src/mage/cards/s/StonySilence.java index 0951001a6c..c0d0aa62e7 100644 --- a/Mage.Sets/src/mage/cards/s/StonySilence.java +++ b/Mage.Sets/src/mage/cards/s/StonySilence.java @@ -50,7 +50,7 @@ class StonySilenceCantActivateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isArtifact(); + return permanent.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/s/StorageMatrix.java b/Mage.Sets/src/mage/cards/s/StorageMatrix.java index a1c350ff87..c5f05bec69 100644 --- a/Mage.Sets/src/mage/cards/s/StorageMatrix.java +++ b/Mage.Sets/src/mage/cards/s/StorageMatrix.java @@ -97,7 +97,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect { } } if (applies) { - return !permanent.getCardType().contains(type); + return !permanent.getCardType(game).contains(type); } } return false; diff --git a/Mage.Sets/src/mage/cards/s/StormwingEntity.java b/Mage.Sets/src/mage/cards/s/StormwingEntity.java index 12d426aae5..076af362ea 100644 --- a/Mage.Sets/src/mage/cards/s/StormwingEntity.java +++ b/Mage.Sets/src/mage/cards/s/StormwingEntity.java @@ -79,7 +79,7 @@ enum StormwingEntityCondition implements Condition { } for (Spell spell : spells) { if (!spell.getSourceId().equals(source.getSourceId()) - && spell.isInstantOrSorcery()) { + && spell.isInstantOrSorcery(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/StorrevDevkarinLich.java b/Mage.Sets/src/mage/cards/s/StorrevDevkarinLich.java index 9224fee889..02104cee7f 100644 --- a/Mage.Sets/src/mage/cards/s/StorrevDevkarinLich.java +++ b/Mage.Sets/src/mage/cards/s/StorrevDevkarinLich.java @@ -100,7 +100,7 @@ class StorrevDevkarinLichWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && (card.isCreature() || card.isPlaneswalker())) { + if (card != null && (card.isCreature(game) || card.isPlaneswalker(game))) { cards.add(new MageObjectReference(card, game)); } } diff --git a/Mage.Sets/src/mage/cards/s/StrixhavenStadium.java b/Mage.Sets/src/mage/cards/s/StrixhavenStadium.java index 9d7c328387..8c36dd0c6a 100644 --- a/Mage.Sets/src/mage/cards/s/StrixhavenStadium.java +++ b/Mage.Sets/src/mage/cards/s/StrixhavenStadium.java @@ -83,7 +83,7 @@ class StrixhavenStadiumTriggeredAbility extends TriggeredAbilityImpl { return isControlledBy(damageEvent.getTargetId()) && damageEvent.isCombatDamage() && sourcePermanent != null - && sourcePermanent.isCreature(); + && sourcePermanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/s/StrongarmTactics.java b/Mage.Sets/src/mage/cards/s/StrongarmTactics.java index ada6160176..8df5451682 100644 --- a/Mage.Sets/src/mage/cards/s/StrongarmTactics.java +++ b/Mage.Sets/src/mage/cards/s/StrongarmTactics.java @@ -85,7 +85,7 @@ class StrongarmTacticsEffect extends OneShotEffect { for (UUID cardId : cardsPlayer) { Card card = game.getCard(cardId); if (card != null) { - if (!(player.discard(card, false, source, game) && card.isCreature())) { + if (!(player.discard(card, false, source, game) && card.isCreature(game))) { player.loseLife(4, game, source, false); } } diff --git a/Mage.Sets/src/mage/cards/s/StrongholdGambit.java b/Mage.Sets/src/mage/cards/s/StrongholdGambit.java index 33c9d58f81..e5acf21277 100644 --- a/Mage.Sets/src/mage/cards/s/StrongholdGambit.java +++ b/Mage.Sets/src/mage/cards/s/StrongholdGambit.java @@ -81,7 +81,7 @@ class StrongholdGambitEffect extends OneShotEffect { if (card != null) { Cards cardsToReveal = new CardsImpl(card); player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', cardsToReveal, game); - if (card.isCreature() + if (card.isCreature(game) && lowestCMC > card.getManaValue()) { lowestCMC = card.getManaValue(); } @@ -95,7 +95,7 @@ class StrongholdGambitEffect extends OneShotEffect { if (player != null && choosenCard.containsKey(playerId)) { Card card = game.getCard(choosenCard.get(playerId)); if (card != null) { - if (card.isCreature() + if (card.isCreature(game) && lowestCMC == card.getManaValue()) { creaturesToBattlefield.add(card); } diff --git a/Mage.Sets/src/mage/cards/s/SubiraTulzidiCaravanner.java b/Mage.Sets/src/mage/cards/s/SubiraTulzidiCaravanner.java index abc8cb8022..f7bfca6bd7 100644 --- a/Mage.Sets/src/mage/cards/s/SubiraTulzidiCaravanner.java +++ b/Mage.Sets/src/mage/cards/s/SubiraTulzidiCaravanner.java @@ -103,7 +103,7 @@ class SubiraTulzidiCaravannerAbility extends DelayedTriggeredAbility { Permanent permanent = game.getPermanent(event.getSourceId()); return permanent != null && permanent.isControlledBy(getControllerId()) - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getPower().getValue() <= 2; } diff --git a/Mage.Sets/src/mage/cards/s/SummonThePack.java b/Mage.Sets/src/mage/cards/s/SummonThePack.java index f5dd5c3753..c6ca36a5d3 100644 --- a/Mage.Sets/src/mage/cards/s/SummonThePack.java +++ b/Mage.Sets/src/mage/cards/s/SummonThePack.java @@ -86,7 +86,7 @@ class SummonThePackEffect extends OneShotEffect { StringBuilder message = new StringBuilder(controller.getLogName()).append(" opened: "); for (Card c : boosterPack) { - if (c != null && c.isCreature()) { + if (c != null && c.isCreature(game)) { message.append(c.getName()).append(" "); message.append(" (creature card) "); ContinuousEffect effect2 = new BecomesBlackZombieAdditionEffect(false); diff --git a/Mage.Sets/src/mage/cards/s/SummonersEgg.java b/Mage.Sets/src/mage/cards/s/SummonersEgg.java index 45ba29e963..af57aa40e2 100644 --- a/Mage.Sets/src/mage/cards/s/SummonersEgg.java +++ b/Mage.Sets/src/mage/cards/s/SummonersEgg.java @@ -123,7 +123,7 @@ class SummonersEggPutOntoBattlefieldEffect extends OneShotEffect { //turn the exiled card face up. imprintedCard.turnFaceUp(source, game, source.getControllerId()); //If it's a creature card, - if (imprintedCard.isCreature()) { + if (imprintedCard.isCreature(game)) { //put it onto the battlefield under your control controller.moveCards(imprintedCard, Zone.BATTLEFIELD, source, game); } diff --git a/Mage.Sets/src/mage/cards/s/SummoningTrap.java b/Mage.Sets/src/mage/cards/s/SummoningTrap.java index 08ad098692..dadc579e06 100644 --- a/Mage.Sets/src/mage/cards/s/SummoningTrap.java +++ b/Mage.Sets/src/mage/cards/s/SummoningTrap.java @@ -11,7 +11,6 @@ import mage.constants.*; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.game.stack.StackObject; import mage.players.Player; @@ -82,7 +81,7 @@ class SummoningTrapWatcher extends Watcher { } if (counteredSpell instanceof Spell && !players.contains(counteredSpell.getControllerId()) - && counteredSpell.isCreature()) { + && counteredSpell.isCreature(game)) { StackObject counteringStackObject = game.getStack().getStackObject(event.getSourceId()); if (counteringStackObject == null) { counteringStackObject = (StackObject) game.getLastKnownInformation(event.getSourceId(), Zone.STACK); diff --git a/Mage.Sets/src/mage/cards/s/SuturePriest.java b/Mage.Sets/src/mage/cards/s/SuturePriest.java index 5baa7e14a6..60bda7f4ce 100644 --- a/Mage.Sets/src/mage/cards/s/SuturePriest.java +++ b/Mage.Sets/src/mage/cards/s/SuturePriest.java @@ -18,7 +18,6 @@ import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -79,7 +78,7 @@ class SuturePriestSecondTriggeredAbility extends TriggeredAbilityImpl { if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent) event; Card card = zEvent.getTarget(); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java b/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java index 9b4a4cd9be..9b8b07c61d 100644 --- a/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java +++ b/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java @@ -93,11 +93,11 @@ class SydriGalvanicGeniusEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!artifact.isArtifact()) { - artifact.addCardType(CardType.ARTIFACT); + if (!artifact.isArtifact(game)) { + artifact.addCardType(game, CardType.ARTIFACT); } - if (!artifact.isCreature()) { - artifact.addCardType(CardType.CREATURE); + if (!artifact.isCreature(game)) { + artifact.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/s/SynodCenturion.java b/Mage.Sets/src/mage/cards/s/SynodCenturion.java index 875df595aa..5bbcc6b9c7 100644 --- a/Mage.Sets/src/mage/cards/s/SynodCenturion.java +++ b/Mage.Sets/src/mage/cards/s/SynodCenturion.java @@ -58,7 +58,7 @@ public final class SynodCenturion extends CardImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { - if (!perm.getId().equals(this.getSourceId()) && perm.isArtifact()) { + if (!perm.getId().equals(this.getSourceId()) && perm.isArtifact(game)) { return false; } } diff --git a/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java b/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java index 8432f670fe..9c84b0f9a8 100644 --- a/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java +++ b/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java @@ -104,7 +104,7 @@ class SyntheticDestinyDelayedEffect extends OneShotEffect { Set creatureCards = new LinkedHashSet<>(); for (Card card : controller.getLibrary().getCards(game)) { revealed.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { creatureCards.add(card); } if (creatureCards.size() >= numberOfCards) { diff --git a/Mage.Sets/src/mage/cards/s/SyrCarahTheBold.java b/Mage.Sets/src/mage/cards/s/SyrCarahTheBold.java index cb0794bce3..424d0e9740 100644 --- a/Mage.Sets/src/mage/cards/s/SyrCarahTheBold.java +++ b/Mage.Sets/src/mage/cards/s/SyrCarahTheBold.java @@ -79,7 +79,7 @@ class SyrCarahTheBoldTriggeredAbility extends TriggeredAbilityImpl { return true; } Spell spell = game.getSpellOrLKIStack(event.getSourceId()); - return spell != null && spell.isInstantOrSorcery() + return spell != null && spell.isInstantOrSorcery(game) && spell.isControlledBy(this.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/s/SyrKonradTheGrim.java b/Mage.Sets/src/mage/cards/s/SyrKonradTheGrim.java index bcc151f780..42c196ddee 100644 --- a/Mage.Sets/src/mage/cards/s/SyrKonradTheGrim.java +++ b/Mage.Sets/src/mage/cards/s/SyrKonradTheGrim.java @@ -76,12 +76,12 @@ class SyrKonradTheGrimTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.isDiesEvent() && zEvent.getTarget() != null && !zEvent.getTargetId().equals(this.getSourceId()) - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { return true; } Card card = game.getCard(zEvent.getTargetId()); // Or a creature card is put into a graveyard from anywhere other than the battlefield - if (card == null || !card.isCreature()) { + if (card == null || !card.isCreature(game)) { return false; } if (zEvent.getToZone() == Zone.GRAVEYARD diff --git a/Mage.Sets/src/mage/cards/s/SzatsWill.java b/Mage.Sets/src/mage/cards/s/SzatsWill.java index ec5c182894..b4941126f7 100644 --- a/Mage.Sets/src/mage/cards/s/SzatsWill.java +++ b/Mage.Sets/src/mage/cards/s/SzatsWill.java @@ -102,7 +102,7 @@ class SzatsWillEffect extends OneShotEffect { .getCards(game) .stream() .filter(Objects::nonNull) - .filter(MageObject::isCreature) + .filter(card -> card.isCreature(game)) .map(MageObject::getPower) .mapToInt(MageInt::getValue) .max() diff --git a/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java b/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java index e35a5ac062..89d8e09852 100644 --- a/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java +++ b/Mage.Sets/src/mage/cards/t/TaigamOjutaiMaster.java @@ -96,7 +96,7 @@ class TaigamOjutaiMasterTriggeredAbility extends DelayedTriggeredAbility { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getFromZone() == Zone.HAND) { if (spell.getCard() != null - && spell.getCard().isInstantOrSorcery()) { + && spell.getCard().isInstantOrSorcery(game)) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(spell.getId())); } diff --git a/Mage.Sets/src/mage/cards/t/TajuruParagon.java b/Mage.Sets/src/mage/cards/t/TajuruParagon.java index 33f030c525..434cf35e49 100644 --- a/Mage.Sets/src/mage/cards/t/TajuruParagon.java +++ b/Mage.Sets/src/mage/cards/t/TajuruParagon.java @@ -37,19 +37,20 @@ public final class TajuruParagon extends CardImpl { this.toughness = new MageInt(2); // Tajuru Paragon is also a Cleric, Rogue, Warrior, and Wizard. - this.addAbility(new SimpleStaticAbility( - Zone.ALL, new HasSubtypesSourceEffect(SubType.CLERIC, SubType.ROGUE, SubType.WARRIOR, SubType.WIZARD) - )); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new HasSubtypesSourceEffect( + SubType.CLERIC, SubType.ROGUE, SubType.WARRIOR, SubType.WIZARD + ))); // Kicker {3} this.addAbility(new KickerAbility("{3}")); // When Tajuru Paragon enters the battlefield, if it was kicked, reveal the top six cards of your library. You may put a card that shares a creature type with it from among them into your hand. Put the rest on the bottom of your library in a random order. this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new TajuruParagonEffect()), KickedCondition.instance, - "When {this} enters the battlefield, if it was kicked, reveal the top six cards of your library. " + - "You may put a card that shares a creature type with it " + - "from among them into your hand. Put the rest on the bottom of your library in a random order." + new EntersBattlefieldTriggeredAbility(new TajuruParagonEffect()), + KickedCondition.instance, "When {this} enters the battlefield, " + + "if it was kicked, reveal the top six cards of your library. " + + "You may put a card that shares a creature type with it from among them into your hand. " + + "Put the rest on the bottom of your library in a random order." )); } diff --git a/Mage.Sets/src/mage/cards/t/Tamanoa.java b/Mage.Sets/src/mage/cards/t/Tamanoa.java index 4712488b90..9ceb89f25f 100644 --- a/Mage.Sets/src/mage/cards/t/Tamanoa.java +++ b/Mage.Sets/src/mage/cards/t/Tamanoa.java @@ -70,7 +70,7 @@ class TamanoaDealsDamageTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject eventSourceObject = game.getObject(event.getSourceId()); - if (eventSourceObject != null && !eventSourceObject.isCreature()) { + if (eventSourceObject != null && !eventSourceObject.isCreature(game)) { if (isControlledBy(game.getControllerId(event.getSourceId()))) { this.getEffects().forEach((effect) -> { effect.setValue("damage", event.getAmount()); diff --git a/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java b/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java index 3cc8a841cd..f4743421a6 100644 --- a/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java +++ b/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java @@ -78,7 +78,7 @@ class PlayerCastNonCreatureSpellWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (!spell.isCreature()) { + if (!spell.isCreature(game)) { playerIds.add(spell.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/t/TayamLuminousEnigma.java b/Mage.Sets/src/mage/cards/t/TayamLuminousEnigma.java index 7f3b35592d..720399c292 100644 --- a/Mage.Sets/src/mage/cards/t/TayamLuminousEnigma.java +++ b/Mage.Sets/src/mage/cards/t/TayamLuminousEnigma.java @@ -215,7 +215,7 @@ class TayamLuminousEnigmaReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); return creature != null - && creature.isCreature() + && creature.isCreature(game) && !source.getSourceId().equals(creature.getId()) && creature.isControlledBy(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/t/TeachByExample.java b/Mage.Sets/src/mage/cards/t/TeachByExample.java index 5aceb1021b..2783df7c27 100644 --- a/Mage.Sets/src/mage/cards/t/TeachByExample.java +++ b/Mage.Sets/src/mage/cards/t/TeachByExample.java @@ -66,7 +66,7 @@ class TeachByExampleAbility extends DelayedTriggeredAbility { return false; } Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java b/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java index 8574de0e60..f3e94a8b3e 100644 --- a/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java +++ b/Mage.Sets/src/mage/cards/t/TeferiMageOfZhalfir.java @@ -75,32 +75,32 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl { // in graveyard for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // on Hand for (UUID cardId : controller.getHand()) { Card card = game.getCard(cardId); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // in Exile for (Card card : game.getState().getExile().getAllCards(game)) { - if (card.isOwnedBy(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature(game)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // in Library (e.g. for Mystical Teachings) for (Card card : controller.getLibrary().getCards(game)) { - if (card.isOwnedBy(controller.getId()) && card.isCreature()) { + if (card.isOwnedBy(controller.getId()) && card.isCreature(game)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // cards in command zone game.getCommanderCardsFromCommandZone(controller, CommanderCardType.ANY).stream() - .filter(MageObject::isCreature) + .filter(card1 -> card1.isCreature(game)) .forEach(card -> { game.getState().addOtherAbility(card, FlashAbility.getInstance()); }); diff --git a/Mage.Sets/src/mage/cards/t/TeferisMoat.java b/Mage.Sets/src/mage/cards/t/TeferisMoat.java index b3fa499988..60e003a4db 100644 --- a/Mage.Sets/src/mage/cards/t/TeferisMoat.java +++ b/Mage.Sets/src/mage/cards/t/TeferisMoat.java @@ -60,7 +60,7 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect { return chosenColor != null && !permanent.getAbilities().contains(FlyingAbility.getInstance()) && permanent.getColor(game).shares(chosenColor) && - permanent.isCreature(); + permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/t/TeferisTimeTwist.java b/Mage.Sets/src/mage/cards/t/TeferisTimeTwist.java index d84c0d1e2f..6997269a61 100644 --- a/Mage.Sets/src/mage/cards/t/TeferisTimeTwist.java +++ b/Mage.Sets/src/mage/cards/t/TeferisTimeTwist.java @@ -112,7 +112,7 @@ class TeferisTimeTwistReturnEffect extends OneShotEffect { return true; } Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { // TODO: This is technically wrong as it should enter with the counters, // however there's currently no way to know that for sure // this is similar to the blood moon issue diff --git a/Mage.Sets/src/mage/cards/t/TeleminPerformance.java b/Mage.Sets/src/mage/cards/t/TeleminPerformance.java index ee55efbb99..c095ecab97 100644 --- a/Mage.Sets/src/mage/cards/t/TeleminPerformance.java +++ b/Mage.Sets/src/mage/cards/t/TeleminPerformance.java @@ -67,7 +67,7 @@ class TeleminPerformanceEffect extends OneShotEffect { CardsImpl reveal = new CardsImpl(); for (Card card : opponent.getLibrary().getCards(game)) { reveal.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { creature = card; break; } else { diff --git a/Mage.Sets/src/mage/cards/t/TemporalAperture.java b/Mage.Sets/src/mage/cards/t/TemporalAperture.java index 5190c21092..5e4b74f6f7 100644 --- a/Mage.Sets/src/mage/cards/t/TemporalAperture.java +++ b/Mage.Sets/src/mage/cards/t/TemporalAperture.java @@ -120,7 +120,7 @@ class TemporalApertureTopCardCastEffect extends AsThoughEffectImpl { if (controller != null && game.getState().getZone(objectId) == Zone.LIBRARY) { if (controller.getLibrary().getFromTop(game).equals(card)) { - if (objectCard == card && (objectCard.getSpellAbility() != null || objectCard.isLand())) { // only if castable or land + if (objectCard == card && (objectCard.getSpellAbility() != null || objectCard.isLand(game))) { // only if castable or land allowCardToPlayWithoutMana(objectId, source, affectedControllerId, game); return true; } diff --git a/Mage.Sets/src/mage/cards/t/TemurWarShaman.java b/Mage.Sets/src/mage/cards/t/TemurWarShaman.java index 948dfefb60..1c4c79b223 100644 --- a/Mage.Sets/src/mage/cards/t/TemurWarShaman.java +++ b/Mage.Sets/src/mage/cards/t/TemurWarShaman.java @@ -88,8 +88,8 @@ class TemurWarShamanFightEffect extends OneShotEffect { Permanent target = game.getPermanent(source.getFirstTarget()); if (triggeredCreature != null && target != null - && triggeredCreature.isCreature() - && target.isCreature()) { + && triggeredCreature.isCreature(game) + && target.isCreature(game)) { triggeredCreature.fight(target, source, game); return true; } diff --git a/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java b/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java index b7ebac854e..7b8e7c9a99 100644 --- a/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java +++ b/Mage.Sets/src/mage/cards/t/TergridGodOfFright.java @@ -117,7 +117,7 @@ class TergridGodOfFrightTriggeredAbility extends TriggeredAbilityImpl { break; case DISCARDED_CARD: Card discardedCard = game.getCard(event.getTargetId()); - if (discardedCard == null || !discardedCard.isPermanent()) { + if (discardedCard == null || !discardedCard.isPermanent(game)) { return false; } break; diff --git a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java index c0178b34c6..f7d9846f4b 100644 --- a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java +++ b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java @@ -67,7 +67,7 @@ class TestamentOfFaithEffect extends ContinuousEffectImpl { if (permanent == null) { return false; } - permanent.addCardType(CardType.CREATURE); + permanent.addCardType(game, CardType.CREATURE); permanent.addSubType(game, SubType.WALL); return true; } diff --git a/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java b/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java index 9494fe1e6b..965440553c 100644 --- a/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java +++ b/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java @@ -86,7 +86,7 @@ class TeysaEnvoyOfGhostsTriggeredAbility extends TriggeredAbilityImpl { if (damageEvent.getPlayerId().equals(getControllerId()) && damageEvent.isCombatDamage() && sourcePermanent != null - && sourcePermanent.isCreature()) { + && sourcePermanent.isCreature(game)) { game.getState().setValue(sourceId.toString(), sourcePermanent.getControllerId()); getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); return true; diff --git a/Mage.Sets/src/mage/cards/t/TeysaKarlov.java b/Mage.Sets/src/mage/cards/t/TeysaKarlov.java index 4563c6a515..d279d2a2dd 100644 --- a/Mage.Sets/src/mage/cards/t/TeysaKarlov.java +++ b/Mage.Sets/src/mage/cards/t/TeysaKarlov.java @@ -94,7 +94,7 @@ class TeysaKarlovEffect extends ReplacementEffectImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) numberOfTriggersEvent.getSourceEvent(); return zEvent.isDiesEvent() && zEvent.getTarget() != null - && zEvent.getTarget().isCreature(); + && zEvent.getTarget().isCreature(game); } } return false; diff --git a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java index bcd04fe050..a8ffc25434 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java @@ -133,10 +133,10 @@ class TezzeretCruelMachinistCardTypeEffect extends ContinuousEffectImpl { } flag = true; target.getSuperType().clear(); - target.getCardType().clear(); + target.removeAllCardTypes(game); target.removeAllSubTypes(game); - target.addCardType(CardType.ARTIFACT); - target.addCardType(CardType.CREATURE); + target.addCardType(game, CardType.ARTIFACT); + target.addCardType(game, CardType.CREATURE); target.getPower().setValue(5); target.getToughness().setValue(5); } diff --git a/Mage.Sets/src/mage/cards/t/TezzeretMasterOfTheBridge.java b/Mage.Sets/src/mage/cards/t/TezzeretMasterOfTheBridge.java index 2493c99a92..90e4661e19 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretMasterOfTheBridge.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretMasterOfTheBridge.java @@ -131,7 +131,7 @@ class TezzeretMasterOfTheBridgeEffect2 extends OneShotEffect { player.moveCards(cards, Zone.EXILED, source, game); Cards cards2 = new CardsImpl(); for (Card card : cards.getCards(game)) { - if (card.isArtifact()) { + if (card.isArtifact(game)) { cards2.add(card); } } diff --git a/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java b/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java index 8790069986..581046db95 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java @@ -128,11 +128,11 @@ class TezzeretTheSeekerEffect3 extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!permanent.isArtifact()) { - permanent.addCardType(CardType.ARTIFACT); + if (!permanent.isArtifact(game)) { + permanent.addCardType(game, CardType.ARTIFACT); } - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/t/ThaliaHereticCathar.java b/Mage.Sets/src/mage/cards/t/ThaliaHereticCathar.java index 33790cd7e4..75d5482e11 100644 --- a/Mage.Sets/src/mage/cards/t/ThaliaHereticCathar.java +++ b/Mage.Sets/src/mage/cards/t/ThaliaHereticCathar.java @@ -75,8 +75,8 @@ class ThaliaTapEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && (permanent.isCreature() || - (permanent.isLand() && !permanent.isBasic()))) { + if (permanent != null && (permanent.isCreature(game) || + (permanent.isLand(game) && !permanent.isBasic()))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java index b1be1e73ae..8e239c44d1 100644 --- a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java +++ b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java @@ -13,8 +13,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; -import static mage.constants.Layer.PTChangingEffects_7; -import static mage.constants.Layer.TypeChangingEffects_4; import mage.constants.Outcome; import mage.constants.SagaChapter; import mage.constants.SubLayer; @@ -92,11 +90,11 @@ class TheAntiquitiesWarEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!permanent.isArtifact()) { - permanent.addCardType(CardType.ARTIFACT); + if (!permanent.isArtifact(game)) { + permanent.addCardType(game, CardType.ARTIFACT); } - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/t/TheBiblioplex.java b/Mage.Sets/src/mage/cards/t/TheBiblioplex.java index 8b7c164943..48d479931f 100644 --- a/Mage.Sets/src/mage/cards/t/TheBiblioplex.java +++ b/Mage.Sets/src/mage/cards/t/TheBiblioplex.java @@ -93,7 +93,7 @@ class TheBiblioplexEffect extends OneShotEffect { return false; } player.lookAtCards("Top of library", card, game); - if (card.isInstantOrSorcery() && player.chooseUse( + if (card.isInstantOrSorcery(game) && player.chooseUse( Outcome.DrawCard, "Reveal that card and put it into your hand?", source, game )) { player.revealCards(source, new CardsImpl(card), game); diff --git a/Mage.Sets/src/mage/cards/t/TheBindingOfTheTitans.java b/Mage.Sets/src/mage/cards/t/TheBindingOfTheTitans.java index 0f60ac6920..e76f919bbd 100644 --- a/Mage.Sets/src/mage/cards/t/TheBindingOfTheTitans.java +++ b/Mage.Sets/src/mage/cards/t/TheBindingOfTheTitans.java @@ -107,7 +107,7 @@ class TheBindingOfTheTitansEffect extends OneShotEffect { int lifeToGain = cards .getCards(game) .stream() - .filter(Card::isCreature) + .filter(card -> card.isCreature(game)) .map(Card::getId) .map(game.getState()::getZone) .map(Zone.EXILED::equals) diff --git a/Mage.Sets/src/mage/cards/t/TheFallen.java b/Mage.Sets/src/mage/cards/t/TheFallen.java index 65e16a5df6..5d925087e8 100644 --- a/Mage.Sets/src/mage/cards/t/TheFallen.java +++ b/Mage.Sets/src/mage/cards/t/TheFallen.java @@ -86,7 +86,7 @@ class TheFallenWatcher extends Watcher { return; } Permanent damaged = game.getPermanent(event.getTargetId()); - if (damaged != null && !damaged.isPlaneswalker()) { + if (damaged != null && !damaged.isPlaneswalker(game)) { return; } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java b/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java index fa09ee3798..32e02c7008 100644 --- a/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java +++ b/Mage.Sets/src/mage/cards/t/TheGitrogMonster.java @@ -83,7 +83,7 @@ class TheGitrogMonsterTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); if (cardOwnerId != null && card.isOwnedBy(getControllerId()) - && card.isLand()) { + && card.isLand(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TheImmortalSun.java b/Mage.Sets/src/mage/cards/t/TheImmortalSun.java index 1db5f7b722..cae359e027 100644 --- a/Mage.Sets/src/mage/cards/t/TheImmortalSun.java +++ b/Mage.Sets/src/mage/cards/t/TheImmortalSun.java @@ -91,7 +91,7 @@ class TheImmortalSunCantActivateEffect extends ContinuousRuleModifyingEffectImpl if (permanent == null) { return false; } - if (permanent.isPlaneswalker()) { + if (permanent.isPlaneswalker(game)) { Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); return ability.isPresent() && (ability.get() instanceof LoyaltyAbility); } diff --git a/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java b/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java index 2f8fe7ad92..b73f2a0f1c 100644 --- a/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java +++ b/Mage.Sets/src/mage/cards/t/TheMirariConjecture.java @@ -16,7 +16,6 @@ import mage.constants.SubType; import mage.filter.FilterCard; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTarget; @@ -97,7 +96,7 @@ class TheMirariConjectureDelayedTriggeredAbility extends DelayedTriggeredAbility if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null - && spell.isInstantOrSorcery()) { + && spell.isInstantOrSorcery(game)) { this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/cards/t/TheScorpionGod.java b/Mage.Sets/src/mage/cards/t/TheScorpionGod.java index f7e40ecea7..d994b58d3d 100644 --- a/Mage.Sets/src/mage/cards/t/TheScorpionGod.java +++ b/Mage.Sets/src/mage/cards/t/TheScorpionGod.java @@ -100,7 +100,7 @@ class TheScorpionGodTriggeredAbility extends TriggeredAbilityImpl { if (zEvent.isDiesEvent()) { Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.getCounters(game).containsKey(CounterType.M1M1)) { return true; } diff --git a/Mage.Sets/src/mage/cards/t/TheTricksterGodsHeist.java b/Mage.Sets/src/mage/cards/t/TheTricksterGodsHeist.java index 7a117cd6a3..8806563e78 100644 --- a/Mage.Sets/src/mage/cards/t/TheTricksterGodsHeist.java +++ b/Mage.Sets/src/mage/cards/t/TheTricksterGodsHeist.java @@ -104,7 +104,7 @@ class TheTricksterGodsHeistTarget extends TargetPermanent { if (targetOne == null || targetTwo == null) { return false; } - return targetOne.shareTypes(targetTwo); + return targetOne.shareTypes(targetTwo, game); } @Override @@ -118,12 +118,12 @@ class TheTricksterGodsHeistTarget extends TargetPermanent { if (!permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { continue; } - for (CardType cardType : permanent.getCardType()) { + for (CardType cardType : permanent.getCardType(game)) { if (cardTypes.contains(cardType)) { return true; } } - cardTypes.addAll(permanent.getCardType()); + cardTypes.addAll(permanent.getCardType(game)); } return false; } diff --git a/Mage.Sets/src/mage/cards/t/TheoreticalDuplication.java b/Mage.Sets/src/mage/cards/t/TheoreticalDuplication.java index 03b6b2b61f..beb61b3a5e 100644 --- a/Mage.Sets/src/mage/cards/t/TheoreticalDuplication.java +++ b/Mage.Sets/src/mage/cards/t/TheoreticalDuplication.java @@ -61,7 +61,7 @@ class TheoreticalDuplicationTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { EntersTheBattlefieldEvent eEvent = (EntersTheBattlefieldEvent) event; - if (!eEvent.getTarget().isCreature() + if (!eEvent.getTarget().isCreature(game) || eEvent.getTarget() instanceof PermanentToken || !game.getOpponents(getControllerId()).contains(eEvent.getTarget().getControllerId())) { return false; diff --git a/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java b/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java index 74d521c0fc..66f18ec01a 100644 --- a/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java +++ b/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java @@ -153,7 +153,7 @@ class ThiefOfSanityCastFromExileEffect extends AsThoughEffectImpl { return false; } Card theCard = game.getCard(objectId); - if (theCard == null || theCard.isLand()) { + if (theCard == null || theCard.isLand(game)) { return false; } objectId = theCard.getMainCard().getId(); // for split cards diff --git a/Mage.Sets/src/mage/cards/t/ThievingAmalgam.java b/Mage.Sets/src/mage/cards/t/ThievingAmalgam.java index 6e683da46c..23ae3c69f1 100644 --- a/Mage.Sets/src/mage/cards/t/ThievingAmalgam.java +++ b/Mage.Sets/src/mage/cards/t/ThievingAmalgam.java @@ -92,7 +92,7 @@ class ThievingAmalgamManifestEffect extends OneShotEffect { Set cards = active.getLibrary().getTopCards(game, 1); cards.stream().forEach(card -> { ManaCosts manaCosts = null; - if (card.isCreature()) { + if (card.isCreature(game)) { manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null; if (manaCosts == null) { manaCosts = new ManaCostsImpl("{0}"); diff --git a/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java b/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java index e58c14ff18..36a1bbf83f 100644 --- a/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java +++ b/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java @@ -105,7 +105,7 @@ class ThievingSkydiverEffect extends OneShotEffect { Permanent artifact = game.getPermanent(source.getFirstTarget()); if (permanent == null || artifact == null - || !artifact.isArtifact() + || !artifact.isArtifact(game) || !artifact.hasSubtype(SubType.EQUIPMENT, game)) { return false; } diff --git a/Mage.Sets/src/mage/cards/t/ThirstingAxe.java b/Mage.Sets/src/mage/cards/t/ThirstingAxe.java index 44faef4166..a72069a206 100644 --- a/Mage.Sets/src/mage/cards/t/ThirstingAxe.java +++ b/Mage.Sets/src/mage/cards/t/ThirstingAxe.java @@ -97,7 +97,7 @@ class CombatDamageToCreatureWatcher extends Watcher { return; } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return; } MageObjectReference damageSource = new MageObjectReference(event.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java b/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java index bd4b10cef6..7f3f104d41 100644 --- a/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java +++ b/Mage.Sets/src/mage/cards/t/ThopterSpyNetwork.java @@ -109,7 +109,7 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null && creature.isControlledBy(controllerId) - && creature.isArtifact() && !damagedPlayerIds.contains(event.getTargetId())) { + && creature.isArtifact(game) && !damagedPlayerIds.contains(event.getTargetId())) { damagedPlayerIds.add(event.getTargetId()); return true; } diff --git a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java index 0a64be464c..45155f63e6 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtDissector.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtDissector.java @@ -77,7 +77,7 @@ class ThoughtDissectorEffect extends OneShotEffect { CardsImpl reveal = new CardsImpl(); for (Card card : targetOpponent.getLibrary().getCards(game)) { reveal.add(card); - if (card.isArtifact()) { + if (card.isArtifact(game)) { artifact = card; break; } else { diff --git a/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java b/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java index b553cee1d0..4966750d83 100644 --- a/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java +++ b/Mage.Sets/src/mage/cards/t/ThousandYearElixir.java @@ -75,7 +75,7 @@ class ThousandYearElixirEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { Permanent permanent = game.getPermanent(sourceId); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java index a953b99f00..e125bf3eb8 100644 --- a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java +++ b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java @@ -158,7 +158,7 @@ class ThousandYearStormWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { MageObject object = game.getObject(event.getTargetId()); - if (object != null && object.isInstantOrSorcery()) { + if (object != null && object.isInstantOrSorcery(game)) { UUID playerId = event.getPlayerId(); List spellsCast = spellsThisTurn.getOrDefault(playerId, new ArrayList()); spellsCast.add(new MageObjectReference(object, game)); diff --git a/Mage.Sets/src/mage/cards/t/ThrasiosTritonHero.java b/Mage.Sets/src/mage/cards/t/ThrasiosTritonHero.java index c25d3e425d..4ef4f92a45 100644 --- a/Mage.Sets/src/mage/cards/t/ThrasiosTritonHero.java +++ b/Mage.Sets/src/mage/cards/t/ThrasiosTritonHero.java @@ -81,7 +81,7 @@ class ThrasiosTritonHeroEffect extends OneShotEffect { } cards.add(card); controller.revealCards(source, cards, game); - if (card.isLand()) { + if (card.isLand(game)) { return controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } controller.drawCards(1, source, game); diff --git a/Mage.Sets/src/mage/cards/t/Thraximundar.java b/Mage.Sets/src/mage/cards/t/Thraximundar.java index eb55ac02c5..c3fb77530a 100644 --- a/Mage.Sets/src/mage/cards/t/Thraximundar.java +++ b/Mage.Sets/src/mage/cards/t/Thraximundar.java @@ -19,7 +19,6 @@ import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -120,7 +119,7 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - return mageObject != null && mageObject.isCreature(); + return mageObject != null && mageObject.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java b/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java index 4ac1931725..64c9feeb5c 100644 --- a/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java +++ b/Mage.Sets/src/mage/cards/t/TianaShipsCaretaker.java @@ -21,7 +21,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -90,8 +89,8 @@ class TianaShipsCaretakerTriggeredAbility extends TriggeredAbilityImpl { Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTarget().getId()); if (permanent != null && zEvent.isDiesEvent() - && (permanent.isArtifact() && permanent.hasSubtype(SubType.EQUIPMENT, game) - || permanent.isEnchantment() && permanent.hasSubtype(SubType.AURA, game)) + && (permanent.isArtifact(game) && permanent.hasSubtype(SubType.EQUIPMENT, game) + || permanent.isEnchantment(game) && permanent.hasSubtype(SubType.AURA, game)) && permanent.isControlledBy(this.controllerId)) { this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId())); return true; diff --git a/Mage.Sets/src/mage/cards/t/TitaniasSong.java b/Mage.Sets/src/mage/cards/t/TitaniasSong.java index 00ff36cf50..d236882851 100644 --- a/Mage.Sets/src/mage/cards/t/TitaniasSong.java +++ b/Mage.Sets/src/mage/cards/t/TitaniasSong.java @@ -76,7 +76,7 @@ class TitaniasSongEffect extends ContinuousEffectImpl { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { if (permanent != null) { affectedObjectList.add(new MageObjectReference(permanent, game)); - permanent.addCardType(CardType.CREATURE); + permanent.addCardType(game, CardType.CREATURE); } } } diff --git a/Mage.Sets/src/mage/cards/t/TomikDistinguishedAdvokist.java b/Mage.Sets/src/mage/cards/t/TomikDistinguishedAdvokist.java index 905eaad9eb..2250dea4f3 100644 --- a/Mage.Sets/src/mage/cards/t/TomikDistinguishedAdvokist.java +++ b/Mage.Sets/src/mage/cards/t/TomikDistinguishedAdvokist.java @@ -122,7 +122,7 @@ class TomikDistinguishedAdvokistTargetEffect extends ContinuousRuleModifyingEffe return targetCard != null && stackObject != null && player != null && player.hasOpponent(stackObject.getControllerId(), game) && game.getState().getZone(targetCard.getId()) == Zone.GRAVEYARD - && targetCard.isLand(); + && targetCard.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/t/ToppleTheStatue.java b/Mage.Sets/src/mage/cards/t/ToppleTheStatue.java index eacfaa360d..5aeca852a8 100644 --- a/Mage.Sets/src/mage/cards/t/ToppleTheStatue.java +++ b/Mage.Sets/src/mage/cards/t/ToppleTheStatue.java @@ -60,7 +60,7 @@ class ToppleTheStatueEffect extends OneShotEffect { return false; } permanent.tap(source, game); - if (permanent.isArtifact()) { + if (permanent.isArtifact(game)) { permanent.destroy(source, game, false); } return new DrawCardSourceControllerEffect(1).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/t/TorporOrb.java b/Mage.Sets/src/mage/cards/t/TorporOrb.java index b552e29300..0307fa147a 100644 --- a/Mage.Sets/src/mage/cards/t/TorporOrb.java +++ b/Mage.Sets/src/mage/cards/t/TorporOrb.java @@ -63,7 +63,7 @@ class TorporOrbEffect extends ContinuousRuleModifyingEffectImpl { Ability ability = (Ability) getValue("targetAbility"); if (ability != null && ability.getAbilityType() == AbilityType.TRIGGERED) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return (((TriggeredAbility) ability).checkTrigger(event, game)); } } diff --git a/Mage.Sets/src/mage/cards/t/TorrentSculptor.java b/Mage.Sets/src/mage/cards/t/TorrentSculptor.java index 9ac297f97b..fa325a6775 100644 --- a/Mage.Sets/src/mage/cards/t/TorrentSculptor.java +++ b/Mage.Sets/src/mage/cards/t/TorrentSculptor.java @@ -137,7 +137,7 @@ class FlamethrowerSonataEffect extends OneShotEffect { } Card card = player.discardOne(false, false, source, game); player.drawCards(1, source, game); - if (card == null || !card.isInstantOrSorcery()) { + if (card == null || !card.isInstantOrSorcery(game)) { return true; } ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/t/TotalWar.java b/Mage.Sets/src/mage/cards/t/TotalWar.java index 66c8859a0a..e763fcc98b 100644 --- a/Mage.Sets/src/mage/cards/t/TotalWar.java +++ b/Mage.Sets/src/mage/cards/t/TotalWar.java @@ -14,7 +14,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.watchers.common.AttackedOrBlockedThisCombatWatcher; @@ -95,7 +94,7 @@ class TotalWarDestroyEffect extends OneShotEffect { if (activePlayer != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(activePlayer.getId())) { // Noncreature cards are safe. - if (!permanent.isCreature()) { + if (!permanent.isCreature(game)) { continue; } // Tapped cards are safe. diff --git a/Mage.Sets/src/mage/cards/t/TouchOfMoonglove.java b/Mage.Sets/src/mage/cards/t/TouchOfMoonglove.java index 2563356b52..fdd0c7d2cd 100644 --- a/Mage.Sets/src/mage/cards/t/TouchOfMoonglove.java +++ b/Mage.Sets/src/mage/cards/t/TouchOfMoonglove.java @@ -18,7 +18,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -105,7 +104,7 @@ class TouchOfMoongloveDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { boolean damageDealt = false; for (MageObjectReference mor : zEvent.getTarget().getDealtDamageByThisTurn()) { if (mor.equals(creatureToCheck)) { diff --git a/Mage.Sets/src/mage/cards/t/Toymaker.java b/Mage.Sets/src/mage/cards/t/Toymaker.java index 075479dd3c..2e1a6c3241 100644 --- a/Mage.Sets/src/mage/cards/t/Toymaker.java +++ b/Mage.Sets/src/mage/cards/t/Toymaker.java @@ -86,11 +86,11 @@ class ToymakerEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { - if (!artifact.isArtifact()) { - artifact.addCardType(CardType.ARTIFACT); + if (!artifact.isArtifact(game)) { + artifact.addCardType(game, CardType.ARTIFACT); } - if (!artifact.isCreature()) { - artifact.addCardType(CardType.CREATURE); + if (!artifact.isCreature(game)) { + artifact.addCardType(game, CardType.CREATURE); } } break; diff --git a/Mage.Sets/src/mage/cards/t/TrackDown.java b/Mage.Sets/src/mage/cards/t/TrackDown.java index 95dde52aae..9b0ac81b09 100644 --- a/Mage.Sets/src/mage/cards/t/TrackDown.java +++ b/Mage.Sets/src/mage/cards/t/TrackDown.java @@ -75,7 +75,7 @@ class TrackDownEffect extends OneShotEffect { CardsImpl cards = new CardsImpl(); cards.add(card); controller.revealCards(sourceObject.getName(), cards, game); - if (card.isLand() || card.isCreature()) { + if (card.isLand(game) || card.isCreature(game)) { controller.drawCards(1, source, game); } diff --git a/Mage.Sets/src/mage/cards/t/TrainingGrounds.java b/Mage.Sets/src/mage/cards/t/TrainingGrounds.java index 14e5770001..9494bc9864 100644 --- a/Mage.Sets/src/mage/cards/t/TrainingGrounds.java +++ b/Mage.Sets/src/mage/cards/t/TrainingGrounds.java @@ -1,6 +1,5 @@ package mage.cards.t; -import mage.Mana; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -97,7 +96,7 @@ class TrainingGroundsEffect extends CostModificationEffectImpl { //Activated abilities of creatures you control Permanent permanent = game.getPermanentOrLKIBattlefield(abilityToModify.getSourceId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/t/Transmogrify.java b/Mage.Sets/src/mage/cards/t/Transmogrify.java index 2a02ba4790..7ea80c4db1 100644 --- a/Mage.Sets/src/mage/cards/t/Transmogrify.java +++ b/Mage.Sets/src/mage/cards/t/Transmogrify.java @@ -70,7 +70,7 @@ class TransmogrifyEffect extends OneShotEffect { Card toBattlefield = null; for (Card card : library.getCards(game)) { cards.add(card); - if (card.isCreature()) { + if (card.isCreature(game)) { toBattlefield = card; break; } diff --git a/Mage.Sets/src/mage/cards/t/TreasureHunt.java b/Mage.Sets/src/mage/cards/t/TreasureHunt.java index 8810d3ab6b..5bee3af63e 100644 --- a/Mage.Sets/src/mage/cards/t/TreasureHunt.java +++ b/Mage.Sets/src/mage/cards/t/TreasureHunt.java @@ -60,7 +60,7 @@ class TreasureHuntEffect extends OneShotEffect { CardsImpl cards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { cards.add(card); - if (!card.isLand()) { + if (!card.isLand(game)) { break; } } diff --git a/Mage.Sets/src/mage/cards/t/TreasureKeeper.java b/Mage.Sets/src/mage/cards/t/TreasureKeeper.java index 2302070739..a96ffb0093 100644 --- a/Mage.Sets/src/mage/cards/t/TreasureKeeper.java +++ b/Mage.Sets/src/mage/cards/t/TreasureKeeper.java @@ -67,7 +67,7 @@ class TreasureKeeperEffect extends OneShotEffect { Card nonLandCard = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); - if (!card.isLand() && card.getManaValue() < 4) { + if (!card.isLand(game) && card.getManaValue() < 4) { nonLandCard = card; break; } diff --git a/Mage.Sets/src/mage/cards/t/TreasureNabber.java b/Mage.Sets/src/mage/cards/t/TreasureNabber.java index a690c1503e..b285e52ac1 100644 --- a/Mage.Sets/src/mage/cards/t/TreasureNabber.java +++ b/Mage.Sets/src/mage/cards/t/TreasureNabber.java @@ -9,7 +9,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTargets; @@ -66,7 +65,7 @@ class TreasureNabberAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isArtifact()) { + if (permanent != null && permanent.isArtifact(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game)); return true; } diff --git a/Mage.Sets/src/mage/cards/t/TrepanationBlade.java b/Mage.Sets/src/mage/cards/t/TrepanationBlade.java index 651d5d839a..839a8c07c5 100644 --- a/Mage.Sets/src/mage/cards/t/TrepanationBlade.java +++ b/Mage.Sets/src/mage/cards/t/TrepanationBlade.java @@ -83,7 +83,7 @@ class TrepanationBladeDiscardEffect extends OneShotEffect { CardsImpl cards = new CardsImpl(); for (Card card : defendingPlayer.getLibrary().getCards(game)) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { break; } } diff --git a/Mage.Sets/src/mage/cards/t/TrespassersCurse.java b/Mage.Sets/src/mage/cards/t/TrespassersCurse.java index 8abf8a897f..07f1cfdda2 100644 --- a/Mage.Sets/src/mage/cards/t/TrespassersCurse.java +++ b/Mage.Sets/src/mage/cards/t/TrespassersCurse.java @@ -75,7 +75,7 @@ class TrespassersCurseTriggeredAbility extends TriggeredAbilityImpl { if (enchantment != null && enchantment.getAttachedTo() != null && game.getControllerId(event.getTargetId()).equals(enchantment.getAttachedTo()) - && game.getPermanent(event.getTargetId()).isCreature()) { + && game.getPermanent(event.getTargetId()).isCreature(game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); } diff --git a/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java b/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java index 116e5c3401..26aa7dff2a 100644 --- a/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java +++ b/Mage.Sets/src/mage/cards/t/TrostaniSelesnyasVoice.java @@ -22,7 +22,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -78,7 +77,7 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId) && !Objects.equals(event.getTargetId(), this.getSourceId())) { Effect effect = this.getEffects().get(0); diff --git a/Mage.Sets/src/mage/cards/t/TsabosWeb.java b/Mage.Sets/src/mage/cards/t/TsabosWeb.java index b6d684073b..8e3c736b30 100644 --- a/Mage.Sets/src/mage/cards/t/TsabosWeb.java +++ b/Mage.Sets/src/mage/cards/t/TsabosWeb.java @@ -71,7 +71,7 @@ class TsabosWebPreventUntapEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getTurn().getStepType() == PhaseStep.UNTAP) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { for (Ability ability :permanent.getAbilities()) { if (!(ability instanceof PlayLandAbility) && !(ability instanceof ActivatedManaAbilityImpl) diff --git a/Mage.Sets/src/mage/cards/t/TunnelIgnus.java b/Mage.Sets/src/mage/cards/t/TunnelIgnus.java index b99eaee557..60aead4d7e 100644 --- a/Mage.Sets/src/mage/cards/t/TunnelIgnus.java +++ b/Mage.Sets/src/mage/cards/t/TunnelIgnus.java @@ -12,7 +12,6 @@ import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.watchers.Watcher; @@ -59,7 +58,7 @@ class TunnelIgnusWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand() && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { + if (permanent != null && permanent.isLand(game) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { int count = counts.getOrDefault(permanent.getControllerId(), 0); counts.put(permanent.getControllerId(), count + 1); } @@ -96,7 +95,7 @@ class TunnelIgnusTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand() && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { + if (permanent != null && permanent.isLand(game) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { TunnelIgnusWatcher watcher = game.getState().getWatcher(TunnelIgnusWatcher.class, this.controllerId); if (watcher != null && watcher.counts.get(permanent.getControllerId()) > 1) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/t/TurntimberSower.java b/Mage.Sets/src/mage/cards/t/TurntimberSower.java index de29cbcee4..d52069b3c5 100644 --- a/Mage.Sets/src/mage/cards/t/TurntimberSower.java +++ b/Mage.Sets/src/mage/cards/t/TurntimberSower.java @@ -95,7 +95,7 @@ class TurntimberSowerTriggeredAbility extends TriggeredAbilityImpl { UUID cardOwnerId = card.getOwnerId(); if (cardOwnerId != null && card.isOwnedBy(getControllerId()) - && card.isLand()) { + && card.isLand(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java b/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java index 135100eb3a..5aa7bf1a4f 100644 --- a/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java +++ b/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java @@ -124,7 +124,7 @@ class TuvasaTheSunlitWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isEnchantment()) { + if (spell != null && spell.isEnchantment(game)) { firstEnchantmentThisTurn.putIfAbsent( event.getPlayerId(), spell.getId() diff --git a/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java b/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java index 3f35790507..90c4a3c57a 100644 --- a/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java +++ b/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java @@ -90,7 +90,7 @@ class TymaretChosenFromDeathEffect extends OneShotEffect { int lifeGain = cards .getCards(game) .stream() - .filter(Card::isCreature) + .filter(card -> card.isCreature(game)) .map(Card::getId) .map(game.getState()::getZone) .filter(Zone.EXILED::equals) diff --git a/Mage.Sets/src/mage/cards/t/TyrantOfDiscord.java b/Mage.Sets/src/mage/cards/t/TyrantOfDiscord.java index 48a5f9ad8e..6b5cc98213 100644 --- a/Mage.Sets/src/mage/cards/t/TyrantOfDiscord.java +++ b/Mage.Sets/src/mage/cards/t/TyrantOfDiscord.java @@ -75,7 +75,7 @@ class TyrantOfDiscordEffect extends OneShotEffect { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponent.getId())) { if (index == random) { if (permanent.sacrifice(source, game)) { - if (permanent.isLand()) { + if (permanent.isLand(game)) { stop = true; game.informPlayers("Land permanent has been sacrificed: " + permanent.getName() + ". Stopping process."); } else { diff --git a/Mage.Sets/src/mage/cards/u/UmoriTheCollector.java b/Mage.Sets/src/mage/cards/u/UmoriTheCollector.java index a56cab1d0a..9e740c5d26 100644 --- a/Mage.Sets/src/mage/cards/u/UmoriTheCollector.java +++ b/Mage.Sets/src/mage/cards/u/UmoriTheCollector.java @@ -73,9 +73,9 @@ enum UmoriCondition implements CompanionCondition { } // First nonland checked. if (cardTypes.isEmpty()) { - cardTypes.addAll(card.getCardType()); + cardTypes.addAll(card.getCardTypeForDeckbuilding()); } else { - cardTypes.retainAll(card.getCardType()); + cardTypes.retainAll(card.getCardTypeForDeckbuilding()); if (cardTypes.isEmpty()) { return false; } diff --git a/Mage.Sets/src/mage/cards/u/UnboundFlourishing.java b/Mage.Sets/src/mage/cards/u/UnboundFlourishing.java index fbca56b270..0210a36624 100644 --- a/Mage.Sets/src/mage/cards/u/UnboundFlourishing.java +++ b/Mage.Sets/src/mage/cards/u/UnboundFlourishing.java @@ -75,7 +75,7 @@ class UnboundFlourishingDoubleXEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Spell spell = game.getSpell(event.getTargetId()); - return spell != null && spell.isPermanent() && spell.isControlledBy(source.getControllerId()); + return spell != null && spell.isPermanent(game) && spell.isControlledBy(source.getControllerId()); } @Override @@ -128,7 +128,7 @@ class UnboundFlourishingCopyAbility extends TriggeredAbilityImpl { // spell if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isInstantOrSorcery()) { + if (spell != null && spell.isInstantOrSorcery(game)) { if (spell.getSpellAbility().getManaCostsToPay().containsX()) { game.getState().setValue(this.getSourceId() + UnboundFlourishing.needPrefix, spell); return true; diff --git a/Mage.Sets/src/mage/cards/u/UncageTheMenagerie.java b/Mage.Sets/src/mage/cards/u/UncageTheMenagerie.java index 549b58af8b..7e2e932ed0 100644 --- a/Mage.Sets/src/mage/cards/u/UncageTheMenagerie.java +++ b/Mage.Sets/src/mage/cards/u/UncageTheMenagerie.java @@ -119,7 +119,7 @@ class UncageTheMenagerieTarget extends TargetCardInLibrary { } } - if (!(card.isCreature() && card.getManaValue() == xValue)) { + if (!(card.isCreature(game) && card.getManaValue() == xValue)) { return false; } diff --git a/Mage.Sets/src/mage/cards/u/UncleIstvan.java b/Mage.Sets/src/mage/cards/u/UncleIstvan.java index 7c3e9651f7..036fb58712 100644 --- a/Mage.Sets/src/mage/cards/u/UncleIstvan.java +++ b/Mage.Sets/src/mage/cards/u/UncleIstvan.java @@ -57,7 +57,7 @@ class PreventDamageToSourceByCardTypeEffect extends PreventAllDamageToSourceEffe public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject != null && sourceObject.isCreature()) { + if (sourceObject != null && sourceObject.isCreature(game)) { if (event.getTargetId().equals(source.getSourceId())) { return true; } diff --git a/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java b/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java index 94ba89f965..8ee507703b 100644 --- a/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java +++ b/Mage.Sets/src/mage/cards/u/UnconventionalTactics.java @@ -17,7 +17,6 @@ import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -90,7 +89,7 @@ class UnconventionalTacticsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId) && filter.match(permanent, game); } diff --git a/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java b/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java index 6ef6b8af7d..9a8e25dad7 100644 --- a/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java +++ b/Mage.Sets/src/mage/cards/u/UndeadAlchemist.java @@ -78,7 +78,7 @@ class UndeadAlchemistTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.LIBRARY && zEvent.getToZone() == Zone.GRAVEYARD && game.getOpponents(this.getControllerId()).contains(zEvent.getPlayerId())) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { this.getEffects().get(0).setTargetPointer(new FixedTarget(card, game)); } diff --git a/Mage.Sets/src/mage/cards/u/UndercityInformer.java b/Mage.Sets/src/mage/cards/u/UndercityInformer.java index a030dbea5f..2083f93618 100644 --- a/Mage.Sets/src/mage/cards/u/UndercityInformer.java +++ b/Mage.Sets/src/mage/cards/u/UndercityInformer.java @@ -79,7 +79,7 @@ class UndercityInformerEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (card.isLand()) { + if (card.isLand(game)) { break; } } diff --git a/Mage.Sets/src/mage/cards/u/UnderworldBreach.java b/Mage.Sets/src/mage/cards/u/UnderworldBreach.java index f0274ff3e7..a4d4f0c8a6 100644 --- a/Mage.Sets/src/mage/cards/u/UnderworldBreach.java +++ b/Mage.Sets/src/mage/cards/u/UnderworldBreach.java @@ -66,7 +66,7 @@ class UnderworldBreachEffect extends ContinuousEffectImpl { .stream() .filter(Objects::nonNull) .filter(card -> !card.getManaCost().getText().isEmpty()) // card must have a mana cost - .filter(card -> !card.isLand()) + .filter(card -> !card.isLand(game)) .forEach(card -> { Ability ability = new EscapeAbility(card, card.getManaCost().getText(), 3); ability.setSourceId(card.getId()); diff --git a/Mage.Sets/src/mage/cards/u/UndyingFlames.java b/Mage.Sets/src/mage/cards/u/UndyingFlames.java index 79e434cd03..0fe67e37b9 100644 --- a/Mage.Sets/src/mage/cards/u/UndyingFlames.java +++ b/Mage.Sets/src/mage/cards/u/UndyingFlames.java @@ -63,7 +63,7 @@ class UndyingFlamesEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCards(card, Zone.EXILED, source, game); - if (!card.isLand()) { + if (!card.isLand(game)) { new DamageTargetEffect(card.getManaValue()).apply(game, source); break; } diff --git a/Mage.Sets/src/mage/cards/u/UnexpectedResults.java b/Mage.Sets/src/mage/cards/u/UnexpectedResults.java index e048d1315d..da2cd3b82e 100644 --- a/Mage.Sets/src/mage/cards/u/UnexpectedResults.java +++ b/Mage.Sets/src/mage/cards/u/UnexpectedResults.java @@ -97,7 +97,7 @@ class UnexpectedResultEffect extends OneShotEffect { return false; } controller.revealCards(sourceCard.getName(), new CardsImpl(card), game); - if (card.isLand()) { + if (card.isLand(game)) { String message = "Put " + card.getName() + " onto the battlefield?"; if (controller.chooseUse(Outcome.PutLandInPlay, message, source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/u/UnpredictableCyclone.java b/Mage.Sets/src/mage/cards/u/UnpredictableCyclone.java index 043acbc613..7e0765339f 100644 --- a/Mage.Sets/src/mage/cards/u/UnpredictableCyclone.java +++ b/Mage.Sets/src/mage/cards/u/UnpredictableCyclone.java @@ -82,7 +82,7 @@ class UnpredictableCycloneReplacementEffect extends ReplacementEffectImpl { Card toCast = null; for (Card card : player.getLibrary().getCards(game)) { cards.add(card); - if (card.getCardType().stream().anyMatch(sourceCard.getCardType()::contains)) { + if (card.getCardType(game).stream().anyMatch(sourceCard.getCardType(game)::contains)) { toCast = card; break; } @@ -119,6 +119,6 @@ class UnpredictableCycloneReplacementEffect extends ReplacementEffectImpl { return false; } Card sourceCard = game.getCard(stackObject.getSourceId()); - return sourceCard != null && !sourceCard.isLand(); + return sourceCard != null && !sourceCard.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java b/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java index 7aa69f27d9..95ed5e050c 100644 --- a/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java +++ b/Mage.Sets/src/mage/cards/u/UnscytheKillerOfKings.java @@ -19,7 +19,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.token.ZombieToken; @@ -83,7 +82,7 @@ class UnscytheKillerOfKingsTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent) event).isDiesEvent()) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getTarget().isCreature()) { // target token can't create Zombie + if (zEvent.getTarget().isCreature(game)) { // target token can't create Zombie Permanent equipment = game.getPermanent(getSourceId()); // the currently equiped creature must have done damage to the dying creature if (equipment != null && equipment.getAttachedTo() != null) { diff --git a/Mage.Sets/src/mage/cards/u/UphillBattle.java b/Mage.Sets/src/mage/cards/u/UphillBattle.java index 7523a76eab..4cf557658a 100644 --- a/Mage.Sets/src/mage/cards/u/UphillBattle.java +++ b/Mage.Sets/src/mage/cards/u/UphillBattle.java @@ -58,8 +58,8 @@ class PlayCreatureLandWatcher extends Watcher { if (event.getType() == GameEvent.EventType.PLAY_LAND) { Card card = game.getCard(event.getTargetId()); if (card != null - && card.isLand() - && card.isCreature() + && card.isLand(game) + && card.isCreature(game) && !playerPlayedLand.contains(event.getPlayerId())) { playerPlayedLand.add(event.getPlayerId()); landPlayed.add(event.getTargetId()); @@ -117,7 +117,7 @@ class UphillBattleTapEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/u/UrabraskTheHidden.java b/Mage.Sets/src/mage/cards/u/UrabraskTheHidden.java index b70145d94f..79d3d04360 100644 --- a/Mage.Sets/src/mage/cards/u/UrabraskTheHidden.java +++ b/Mage.Sets/src/mage/cards/u/UrabraskTheHidden.java @@ -15,7 +15,6 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -76,7 +75,7 @@ class UrabraskTheHiddenEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/u/UrzasChalice.java b/Mage.Sets/src/mage/cards/u/UrzasChalice.java index 3ac7a2f8ed..a56c05acbb 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasChalice.java +++ b/Mage.Sets/src/mage/cards/u/UrzasChalice.java @@ -59,7 +59,7 @@ class UrzasChaliceAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.isArtifact(); + return spell != null && spell.isArtifact(game); } @Override diff --git a/Mage.Sets/src/mage/cards/v/VaevictisAsmadiTheDire.java b/Mage.Sets/src/mage/cards/v/VaevictisAsmadiTheDire.java index 412f7f04ed..66c3926efd 100644 --- a/Mage.Sets/src/mage/cards/v/VaevictisAsmadiTheDire.java +++ b/Mage.Sets/src/mage/cards/v/VaevictisAsmadiTheDire.java @@ -151,7 +151,7 @@ class VaevictisAsmadiTheDireEffect extends OneShotEffect { continue; } player.revealCards(source, new CardsImpl(card), game); - if (card.isPermanent()) { + if (card.isPermanent(game)) { player.moveCards(card, Zone.BATTLEFIELD, source, game); } } diff --git a/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java index 1fe79a08ce..b1410f17f1 100644 --- a/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/cards/v/ValakutTheMoltenPinnacle.java @@ -15,7 +15,6 @@ import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetAnyTarget; @@ -78,7 +77,7 @@ class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand() && permanent.isControlledBy(this.getControllerId())) { + if (permanent != null && permanent.isLand(game) && permanent.isControlledBy(this.getControllerId())) { if (permanent.hasSubtype(SubType.MOUNTAIN, game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/v/ValentinDeanOfTheVein.java b/Mage.Sets/src/mage/cards/v/ValentinDeanOfTheVein.java index c055c843b1..113ebfeda1 100644 --- a/Mage.Sets/src/mage/cards/v/ValentinDeanOfTheVein.java +++ b/Mage.Sets/src/mage/cards/v/ValentinDeanOfTheVein.java @@ -120,7 +120,7 @@ class ValentinDeanOfTheVeinEffect extends ReplacementEffectImpl { return zEvent.isDiesEvent() && zEvent.getTarget() != null && !(zEvent.getTarget() instanceof PermanentToken) - && zEvent.getTarget().isCreature() + && zEvent.getTarget().isCreature(game) && game.getOpponents(zEvent.getTarget().getControllerId()).contains(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java b/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java index c7b94a362c..2c8eac60ff 100644 --- a/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java +++ b/Mage.Sets/src/mage/cards/v/VancesBlastingCannons.java @@ -81,9 +81,9 @@ class VancesBlastingCannonsExileEffect extends OneShotEffect { if (controller != null && sourcePermanent != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { - String exileName = sourcePermanent.getIdName() + (card.isLand() ? "" : " { return false; } Permanent permanent = ((LoyaltyAbility) input).getSourcePermanentOrLKI(game); - return permanent != null && permanent.isPlaneswalker(); + return permanent != null && permanent.isPlaneswalker(game); } } diff --git a/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java b/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java index 53fbaffa25..ab829563c0 100644 --- a/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java +++ b/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java @@ -15,7 +15,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -65,7 +64,7 @@ class VerdantSunsAvatarTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId)) { Effect effect = this.getEffects().get(0); // Life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution) diff --git a/Mage.Sets/src/mage/cards/v/VerityCircle.java b/Mage.Sets/src/mage/cards/v/VerityCircle.java index 73f08b397f..18cf5119a3 100644 --- a/Mage.Sets/src/mage/cards/v/VerityCircle.java +++ b/Mage.Sets/src/mage/cards/v/VerityCircle.java @@ -82,7 +82,7 @@ class VerityCircleTriggeredAbility extends TriggeredAbilityImpl { } Permanent permanent = game.getPermanent(event.getTargetId()); Player player = game.getPlayer(controllerId); - return permanent != null && player != null && permanent.isCreature() + return permanent != null && player != null && permanent.isCreature(game) && player.hasOpponent(permanent.getControllerId(), game); } diff --git a/Mage.Sets/src/mage/cards/v/VeteranAdventurer.java b/Mage.Sets/src/mage/cards/v/VeteranAdventurer.java index b5da4fa64d..5d5047f784 100644 --- a/Mage.Sets/src/mage/cards/v/VeteranAdventurer.java +++ b/Mage.Sets/src/mage/cards/v/VeteranAdventurer.java @@ -28,9 +28,9 @@ public final class VeteranAdventurer extends CardImpl { this.toughness = new MageInt(5); // Veteran Adventurer is also a Cleric, Rogue, Warrior, and Wizard. - this.addAbility(new SimpleStaticAbility( - Zone.ALL, new HasSubtypesSourceEffect(SubType.CLERIC, SubType.ROGUE, SubType.WARRIOR, SubType.WIZARD) - )); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new HasSubtypesSourceEffect( + SubType.CLERIC, SubType.ROGUE, SubType.WARRIOR, SubType.WIZARD + ))); // This spell costs {1} less to cast for each creature in your party. this.addAbility(new SimpleStaticAbility( diff --git a/Mage.Sets/src/mage/cards/v/VeyranVoiceOfDuality.java b/Mage.Sets/src/mage/cards/v/VeyranVoiceOfDuality.java index e2ff76afff..d9513a2bf4 100644 --- a/Mage.Sets/src/mage/cards/v/VeyranVoiceOfDuality.java +++ b/Mage.Sets/src/mage/cards/v/VeyranVoiceOfDuality.java @@ -85,7 +85,7 @@ class VeyranVoiceOfDualityEffect extends ReplacementEffectImpl { } // Only for entering artifacts or creatures Spell spell = game.getSpell(sourceEvent.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } // Only for triggers of permanents diff --git a/Mage.Sets/src/mage/cards/v/ViashinoBey.java b/Mage.Sets/src/mage/cards/v/ViashinoBey.java index 74a230518e..d9dafab5b2 100644 --- a/Mage.Sets/src/mage/cards/v/ViashinoBey.java +++ b/Mage.Sets/src/mage/cards/v/ViashinoBey.java @@ -72,7 +72,7 @@ class ViashinoBeyEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); TargetOpponent targetDefender = new TargetOpponent(); if (controller != null) { - game.getBattlefield().getAllActivePermanents(CardType.CREATURE).stream().filter((permanent) -> (filter.match(permanent, source.getSourceId(), source.getControllerId(), game))).forEachOrdered((permanent) -> { + game.getBattlefield().getAllActivePermanents(CardType.CREATURE, game).stream().filter((permanent) -> (filter.match(permanent, source.getSourceId(), source.getControllerId(), game))).forEachOrdered((permanent) -> { if (game.getOpponents(controller.getId()).size() > 1) { controller.choose(outcome.Benefit, targetDefender, source.getSourceId(), game); } else { diff --git a/Mage.Sets/src/mage/cards/v/VigeanIntuition.java b/Mage.Sets/src/mage/cards/v/VigeanIntuition.java index deeeb722b5..ee22e29524 100644 --- a/Mage.Sets/src/mage/cards/v/VigeanIntuition.java +++ b/Mage.Sets/src/mage/cards/v/VigeanIntuition.java @@ -113,7 +113,7 @@ class VigeanIntuitionEffect extends OneShotEffect { Cards putInHand = new CardsImpl(); Cards putInGraveyard = new CardsImpl(); for (Card card : top) { - if (card != null && card.getCardType().contains(type)) { + if (card != null && card.getCardType(game).contains(type)) { putInHand.add(card); } else { putInGraveyard.add(card); diff --git a/Mage.Sets/src/mage/cards/v/VigilForTheLost.java b/Mage.Sets/src/mage/cards/v/VigilForTheLost.java index 2a92c5cffe..2387712903 100644 --- a/Mage.Sets/src/mage/cards/v/VigilForTheLost.java +++ b/Mage.Sets/src/mage/cards/v/VigilForTheLost.java @@ -15,7 +15,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -66,7 +65,7 @@ class VigilForTheLostTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zoneChangeEvent = (ZoneChangeEvent) event; if (zoneChangeEvent.isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p.isControlledBy(this.getControllerId()) && p.isCreature()) { + if (p.isControlledBy(this.getControllerId()) && p.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/v/Vigor.java b/Mage.Sets/src/mage/cards/v/Vigor.java index a010a90d1e..22ccb02da7 100644 --- a/Mage.Sets/src/mage/cards/v/Vigor.java +++ b/Mage.Sets/src/mage/cards/v/Vigor.java @@ -89,7 +89,7 @@ class VigorReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); return permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(source.getControllerId()) && !event.getTargetId().equals(source.getSourceId()); } diff --git a/Mage.Sets/src/mage/cards/v/VileRedeemer.java b/Mage.Sets/src/mage/cards/v/VileRedeemer.java index 2a95885560..23ab9ed989 100644 --- a/Mage.Sets/src/mage/cards/v/VileRedeemer.java +++ b/Mage.Sets/src/mage/cards/v/VileRedeemer.java @@ -106,7 +106,7 @@ class VileRedeemerNonTokenCreaturesDiedWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() && zEvent.getTarget() != null - && zEvent.getTarget().isCreature() + && zEvent.getTarget().isCreature(game) && !(zEvent.getTarget() instanceof PermanentToken)) { int count = getAmountOfNontokenCreatureDiedThisTurn(zEvent.getTargetId()); amountOfCreaturesThatDied.put(zEvent.getTarget().getControllerId(), ++count); diff --git a/Mage.Sets/src/mage/cards/v/VillageCannibals.java b/Mage.Sets/src/mage/cards/v/VillageCannibals.java index 1c4b690c55..9e4974fe0d 100644 --- a/Mage.Sets/src/mage/cards/v/VillageCannibals.java +++ b/Mage.Sets/src/mage/cards/v/VillageCannibals.java @@ -13,7 +13,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -69,7 +68,7 @@ class VillageCannibalsTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && permanent.isCreature() && permanent.hasSubtype(SubType.HUMAN, game) + if (permanent != null && permanent.isCreature(game) && permanent.hasSubtype(SubType.HUMAN, game) && !permanent.getId().equals(this.getSourceId())) { return true; } diff --git a/Mage.Sets/src/mage/cards/v/ViridianRevel.java b/Mage.Sets/src/mage/cards/v/ViridianRevel.java index 1e832e007a..dc1b74caca 100644 --- a/Mage.Sets/src/mage/cards/v/ViridianRevel.java +++ b/Mage.Sets/src/mage/cards/v/ViridianRevel.java @@ -12,7 +12,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.players.Player; @@ -64,7 +63,7 @@ class ViridianRevelTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent)event).isDiesEvent()) { Card card = game.getPermanentOrLKIBattlefield(event.getTargetId()); Player controller = game.getPlayer(getControllerId()); - if (controller != null && card != null && card.isArtifact() + if (controller != null && card != null && card.isArtifact(game) && controller.hasOpponent(card.getOwnerId(), game)) { return true; } diff --git a/Mage.Sets/src/mage/cards/v/VivienChampionOfTheWilds.java b/Mage.Sets/src/mage/cards/v/VivienChampionOfTheWilds.java index 1560c2360e..2549312f7e 100644 --- a/Mage.Sets/src/mage/cards/v/VivienChampionOfTheWilds.java +++ b/Mage.Sets/src/mage/cards/v/VivienChampionOfTheWilds.java @@ -119,7 +119,7 @@ class VivienChampionOfTheWildsEffect extends OneShotEffect { ContinuousEffect effect = new VivienChampionOfTheWildsLookEffect(player.getId()); effect.setTargetPointer(new FixedTarget(cardToExile, game)); game.addEffect(effect, source); - if (cardToExile.isCreature()) { + if (cardToExile.isCreature(game)) { effect = new VivienChampionOfTheWildsCastFromExileEffect(player.getId()); effect.setTargetPointer(new FixedTarget(cardToExile, game)); game.addEffect(effect, source); @@ -202,7 +202,7 @@ class VivienChampionOfTheWildsCastFromExileEffect extends AsThoughEffectImpl { && affectedControllerId.equals(authorizedPlayerId)) { Card card = game.getCard(objectId); // TODO: Allow to cast Zoetic Cavern face down - return card != null && !card.isLand(); + return card != null && !card.isLand(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/v/VivienMonstersAdvocate.java b/Mage.Sets/src/mage/cards/v/VivienMonstersAdvocate.java index bfc0d69358..cd715c1990 100644 --- a/Mage.Sets/src/mage/cards/v/VivienMonstersAdvocate.java +++ b/Mage.Sets/src/mage/cards/v/VivienMonstersAdvocate.java @@ -141,7 +141,7 @@ class VivienMonstersAdvocateTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getSpell(event.getTargetId()); if (spell != null - && spell.isCreature()) { + && spell.isCreature(game)) { int cmc = spell.getManaValue(); FilterCard filter = new FilterCreatureCard("creature card with mana value less than " + cmc); filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, cmc)); diff --git a/Mage.Sets/src/mage/cards/v/ViviensGrizzly.java b/Mage.Sets/src/mage/cards/v/ViviensGrizzly.java index 769942ef6e..ed5c8912ac 100644 --- a/Mage.Sets/src/mage/cards/v/ViviensGrizzly.java +++ b/Mage.Sets/src/mage/cards/v/ViviensGrizzly.java @@ -73,7 +73,7 @@ class ViviensGrizzlyEffect extends OneShotEffect { Card card = player.getLibrary().getFromTop(game); Cards cards = new CardsImpl(card); player.lookAtCards(source, null, cards, game); - if ((!card.isPlaneswalker() && !card.isCreature()) + if ((!card.isPlaneswalker(game) && !card.isCreature(game)) || !player.chooseUse(outcome, "Put this card in your hand?", source, game)) { player.putCardsOnBottomOfLibrary(cards, game, source, false); } else { diff --git a/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java b/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java index 7ad95d44d1..05c575f963 100644 --- a/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java +++ b/Mage.Sets/src/mage/cards/v/VizierOfTheMenagerie.java @@ -80,7 +80,7 @@ class VizierOfTheMenagerieManaEffect extends AsThoughEffectImpl implements AsTho objectId = CardUtil.getMainCardId(game, objectId); // for split cards if (source.isControlledBy(affectedControllerId)) { MageObject mageObject = game.getObject(objectId); - return mageObject != null && mageObject.isCreature(); + return mageObject != null && mageObject.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/v/Void.java b/Mage.Sets/src/mage/cards/v/Void.java index 56b1ba6e11..d0404a666d 100644 --- a/Mage.Sets/src/mage/cards/v/Void.java +++ b/Mage.Sets/src/mage/cards/v/Void.java @@ -68,7 +68,7 @@ class VoidEffect extends OneShotEffect { game.informPlayers(controller.getLogName() + " chooses " + number + '.'); for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if ((permanent.isArtifact() || permanent.isCreature()) + if ((permanent.isArtifact(game) || permanent.isCreature(game)) && permanent.getManaValue() == number) { permanent.destroy(source, game, false); } diff --git a/Mage.Sets/src/mage/cards/v/VoidMaw.java b/Mage.Sets/src/mage/cards/v/VoidMaw.java index 7b75a7e9d3..6b3eae1e82 100644 --- a/Mage.Sets/src/mage/cards/v/VoidMaw.java +++ b/Mage.Sets/src/mage/cards/v/VoidMaw.java @@ -108,10 +108,10 @@ class VoidMawEffect extends ReplacementEffectImpl { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null && !permanent.getId().equals(source.getSourceId())) { if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield - if (zEvent.getTarget().isCreature()) { + if (zEvent.getTarget().isCreature(game)) { return true; } - } else if (permanent.isCreature()) { + } else if (permanent.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java b/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java index aa2c8058ab..73fca45fda 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java @@ -70,7 +70,7 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl { if (card == null || permanent == null - || !card.isCreature()) { + || !card.isCreature(game)) { return false; } @@ -79,11 +79,11 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl { permanent.getColor(game).setColor(card.getColor(game)); permanent.getManaCost().clear(); permanent.getManaCost().add(card.getManaCost()); - permanent.getCardType().clear(); + permanent.removeAllCardTypes(game); permanent.setName(card.getName()); - for (CardType type : card.getCardType()) { - permanent.addCardType(type); + for (CardType type : card.getCardType(game)) { + permanent.addCardType(game, type); } permanent.removeAllSubTypes(game); diff --git a/Mage.Sets/src/mage/cards/v/VorinclexVoiceOfHunger.java b/Mage.Sets/src/mage/cards/v/VorinclexVoiceOfHunger.java index 252dcc66d7..0b419d7fb1 100644 --- a/Mage.Sets/src/mage/cards/v/VorinclexVoiceOfHunger.java +++ b/Mage.Sets/src/mage/cards/v/VorinclexVoiceOfHunger.java @@ -82,7 +82,7 @@ class VorinclexTriggeredAbility2 extends TriggeredAbilityImpl { } if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game)); return true; } diff --git a/Mage.Sets/src/mage/cards/v/VraskaSwarmsEminence.java b/Mage.Sets/src/mage/cards/v/VraskaSwarmsEminence.java index 2285bde5e1..3328544fd4 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaSwarmsEminence.java +++ b/Mage.Sets/src/mage/cards/v/VraskaSwarmsEminence.java @@ -95,7 +95,7 @@ class VraskaSwarmsEminenceTriggeredAbility extends TriggeredAbilityImpl { return false; } Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (damaged != null && !damaged.isPlaneswalker()) { + if (damaged != null && !damaged.isPlaneswalker(game)) { return false; } getEffects().setValue("damage", event.getAmount()); diff --git a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java index d329426ab1..d4bebd570b 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java +++ b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java @@ -121,7 +121,7 @@ class VraskaTheUnseenTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (((DamagedEvent) event).isCombatDamage() && getSourceId().equals(event.getTargetId())) { Permanent sourceOfDamage = game.getPermanent(event.getSourceId()); - if (sourceOfDamage != null && sourceOfDamage.isCreature()) { + if (sourceOfDamage != null && sourceOfDamage.isCreature(game)) { Effect effect = this.getEffects().get(0); effect.setTargetPointer(new FixedTarget(sourceOfDamage.getId())); return true; diff --git a/Mage.Sets/src/mage/cards/w/WallOfCaltrops.java b/Mage.Sets/src/mage/cards/w/WallOfCaltrops.java index bc2a02064e..6fb5850498 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfCaltrops.java +++ b/Mage.Sets/src/mage/cards/w/WallOfCaltrops.java @@ -73,7 +73,7 @@ class WallOfCaltropsAbility extends BlocksSourceTriggeredAbility { if (event.getSourceId().equals(this.getSourceId())) { Permanent targetPermanent = game.getPermanent(event.getTargetId()); if (targetPermanent != null - && targetPermanent.isCreature()) { + && targetPermanent.isCreature(game)) { CombatGroup group = game.getCombat().findGroup(targetPermanent.getId()); if (group != null) { for (UUID blockerId : group.getBlockers()) { diff --git a/Mage.Sets/src/mage/cards/w/WallOfEssence.java b/Mage.Sets/src/mage/cards/w/WallOfEssence.java index bb45ba86be..3abe99d586 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfEssence.java +++ b/Mage.Sets/src/mage/cards/w/WallOfEssence.java @@ -72,7 +72,7 @@ class WallOfEssenceTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent == null - || !permanent.isCreature() + || !permanent.isCreature(game) || !event.getTargetId().equals(this.sourceId) || !((DamagedEvent) event).isCombatDamage()) { return false; diff --git a/Mage.Sets/src/mage/cards/w/WallOfPutridFlesh.java b/Mage.Sets/src/mage/cards/w/WallOfPutridFlesh.java index 70a28745e8..a37bb24baf 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfPutridFlesh.java +++ b/Mage.Sets/src/mage/cards/w/WallOfPutridFlesh.java @@ -74,12 +74,12 @@ class PreventDamageToSourceByEnchantedCreatures extends PreventAllDamageToSource } public boolean isEnchantedCreature(MageObject input, Game game) { - if (input == null || input.isCreature()) { + if (input == null || input.isCreature(game)) { return false; } for (UUID attachmentId : ((Permanent) input).getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.isEnchantment()) { + if (attachment != null && attachment.isEnchantment(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WandOfDenial.java b/Mage.Sets/src/mage/cards/w/WandOfDenial.java index d7ae910e87..525da0ebd2 100644 --- a/Mage.Sets/src/mage/cards/w/WandOfDenial.java +++ b/Mage.Sets/src/mage/cards/w/WandOfDenial.java @@ -68,7 +68,7 @@ class WandOfDenialEffect extends OneShotEffect { if (card != null) { MageObject sourceObject = game.getObject(source.getSourceId()); controller.lookAtCards(sourceObject != null ? sourceObject.getName() : "", new CardsImpl(card), game); - if (!card.isLand() + if (!card.isLand(game) && controller.canPayLifeCost(source) && controller.getLife() >= 2 && controller.chooseUse(Outcome.Neutral, "Pay 2 life to put " + card.getLogName() + " into graveyard?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/w/WandOfIth.java b/Mage.Sets/src/mage/cards/w/WandOfIth.java index 8b4032d751..e62f17ed4b 100644 --- a/Mage.Sets/src/mage/cards/w/WandOfIth.java +++ b/Mage.Sets/src/mage/cards/w/WandOfIth.java @@ -66,7 +66,7 @@ class WandOfIthEffect extends OneShotEffect { if (card != null) { revealed.add(card); player.revealCards(sourcePermanent.getName(), revealed, game); - int lifeToPay = card.isLand() ? 1 : card.getManaValue(); + int lifeToPay = card.isLand(game) ? 1 : card.getManaValue(); PayLifeCost cost = new PayLifeCost(lifeToPay); if (cost.canPay(source, source, player.getId(), game) && player.chooseUse(outcome, "Pay " + lifeToPay + " life to prevent discarding " + card.getLogName() + "?", source, game) diff --git a/Mage.Sets/src/mage/cards/w/WanderingArchaic.java b/Mage.Sets/src/mage/cards/w/WanderingArchaic.java index 9132fe4f92..95775a39e8 100644 --- a/Mage.Sets/src/mage/cards/w/WanderingArchaic.java +++ b/Mage.Sets/src/mage/cards/w/WanderingArchaic.java @@ -181,11 +181,11 @@ class ExploreTheVastlandsTarget extends TargetCardInLibrary { if (this.getTargets().isEmpty()) { return true; } - boolean isLand = card.isLand(); + boolean isLand = card.isLand(game); return this.getTargets() .stream() .map(game::getCard) .filter(Objects::nonNull) - .noneMatch(c -> card.isLand() && c.isLand() || card.isInstantOrSorcery() && c.isInstantOrSorcery()); + .noneMatch(c -> card.isLand(game) && c.isLand(game) || card.isInstantOrSorcery(game) && c.isInstantOrSorcery(game)); } } diff --git a/Mage.Sets/src/mage/cards/w/WardOfBones.java b/Mage.Sets/src/mage/cards/w/WardOfBones.java index c794dbce80..04e2a74093 100644 --- a/Mage.Sets/src/mage/cards/w/WardOfBones.java +++ b/Mage.Sets/src/mage/cards/w/WardOfBones.java @@ -92,23 +92,23 @@ class WardOfBonesEffect extends ContinuousRuleModifyingEffectImpl { if (card == null || opponent == null) { return false; } - if (card.isCreature() + if (card.isCreature(game) && game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game) > game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { return true; } - if (card.isArtifact() + if (card.isArtifact(game) && game.getBattlefield().countAll(new FilterArtifactPermanent(), opponent.getId(), game) > game.getBattlefield().countAll(new FilterArtifactPermanent(), source.getControllerId(), game)) { return true; } - if (card.isEnchantment() + if (card.isEnchantment(game) && game.getBattlefield().countAll(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, opponent.getId(), game) > game.getBattlefield().countAll(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, source.getControllerId(), game)) { return true; } final int yourLands = game.getBattlefield().countAll(new FilterLandPermanent(), source.getControllerId(), game); - if (card.isLand() + if (card.isLand(game) && game.getBattlefield().countAll(new FilterLandPermanent(), opponent.getId(), game) > yourLands) { return true; } diff --git a/Mage.Sets/src/mage/cards/w/WarpWorld.java b/Mage.Sets/src/mage/cards/w/WarpWorld.java index 4304c19183..07eb256b3b 100644 --- a/Mage.Sets/src/mage/cards/w/WarpWorld.java +++ b/Mage.Sets/src/mage/cards/w/WarpWorld.java @@ -119,9 +119,9 @@ class WarpWorldEffect extends OneShotEffect { Set toBattlefield = new HashSet<>(); CardsImpl cards = cardsRevealed.get(player.getId()); for (Card card : cards.getCards(game)) { - if (card != null && (card.isArtifact() - || card.isCreature() - || card.isLand())) { + if (card != null && (card.isArtifact(game) + || card.isCreature(game) + || card.isLand(game))) { toBattlefield.add(card); cards.remove(card); } @@ -137,7 +137,7 @@ class WarpWorldEffect extends OneShotEffect { Set toBattlefield = new HashSet<>(); CardsImpl cards = cardsRevealed.get(player.getId()); for (Card card : cards.getCards(game)) { - if (card != null && card.isEnchantment()) { + if (card != null && card.isEnchantment(game)) { toBattlefield.add(card); cards.remove(card); } diff --git a/Mage.Sets/src/mage/cards/w/WarstormSurge.java b/Mage.Sets/src/mage/cards/w/WarstormSurge.java index 8455bd4a44..0b0b39d62e 100644 --- a/Mage.Sets/src/mage/cards/w/WarstormSurge.java +++ b/Mage.Sets/src/mage/cards/w/WarstormSurge.java @@ -11,7 +11,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetAnyTarget; @@ -61,7 +60,7 @@ class WarstormSurgeTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isCreature() + && permanent.isCreature(game) && permanent.isControlledBy(this.controllerId)) { Effect effect = this.getEffects().get(0); effect.setValue("damageSource", event.getTargetId()); diff --git a/Mage.Sets/src/mage/cards/w/WasteNot.java b/Mage.Sets/src/mage/cards/w/WasteNot.java index a697441d63..34d1fe0035 100644 --- a/Mage.Sets/src/mage/cards/w/WasteNot.java +++ b/Mage.Sets/src/mage/cards/w/WasteNot.java @@ -14,7 +14,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.ZombieToken; /** @@ -70,7 +69,7 @@ class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); - if (discarded != null && discarded.isCreature()) { + if (discarded != null && discarded.isCreature(game)) { return true; } } @@ -107,7 +106,7 @@ class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); - if (discarded != null && discarded.isLand()) { + if (discarded != null && discarded.isLand(game)) { return true; } } @@ -144,7 +143,7 @@ class WasteNotOtherTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); - if (discarded != null && !discarded.isLand() && !discarded.isCreature()) { + if (discarded != null && !discarded.isLand(game) && !discarded.isCreature(game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java b/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java index 6c681600ef..219ae76705 100644 --- a/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java +++ b/Mage.Sets/src/mage/cards/w/WaveOfVitriol.java @@ -83,7 +83,7 @@ class WaveOfVitriolEffect extends OneShotEffect { if (player != null) { int count = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, playerId, game)) { - if (permanent.sacrifice(source, game) && permanent.isLand()) { + if (permanent.sacrifice(source, game) && permanent.isLand(game)) { count++; } } diff --git a/Mage.Sets/src/mage/cards/w/WeatheredRunestone.java b/Mage.Sets/src/mage/cards/w/WeatheredRunestone.java index bde7639db8..df361a999b 100644 --- a/Mage.Sets/src/mage/cards/w/WeatheredRunestone.java +++ b/Mage.Sets/src/mage/cards/w/WeatheredRunestone.java @@ -68,7 +68,7 @@ class WeatheredRunestoneEffect extends ContinuousRuleModifyingEffectImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD && (zEvent.getFromZone() == Zone.GRAVEYARD || zEvent.getFromZone() == Zone.LIBRARY)) { Card card = game.getCard(zEvent.getTargetId()); - return card != null && !card.isLand() && card.isPermanent(); + return card != null && !card.isLand(game) && card.isPermanent(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/w/WeatherseedTotem.java b/Mage.Sets/src/mage/cards/w/WeatherseedTotem.java index f301edb723..c19b02d91f 100644 --- a/Mage.Sets/src/mage/cards/w/WeatherseedTotem.java +++ b/Mage.Sets/src/mage/cards/w/WeatherseedTotem.java @@ -66,7 +66,7 @@ class WeatherseedTotemCondition implements Condition { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (permanent != null) { - return permanent.isCreature(); + return permanent.isCreature(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/w/WellLaidPlans.java b/Mage.Sets/src/mage/cards/w/WellLaidPlans.java index 4ca87d2804..49272aa539 100644 --- a/Mage.Sets/src/mage/cards/w/WellLaidPlans.java +++ b/Mage.Sets/src/mage/cards/w/WellLaidPlans.java @@ -61,7 +61,7 @@ class WellLaidPlansPreventionEffect extends PreventionEffectImpl { Permanent attacker = game.getPermanentOrLKIBattlefield(event.getSourceId()); Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId()); if (attacker == null || damaged == null - || !attacker.isCreature() || !damaged.isCreature()) { + || !attacker.isCreature(game) || !damaged.isCreature(game)) { return false; } return !attacker.getColor(game).intersection(damaged.getColor(game)).isColorless(); diff --git a/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java b/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java index b5933bce42..0c8e12111b 100644 --- a/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java +++ b/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java @@ -19,7 +19,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.EldraziHorrorToken; /** @@ -83,7 +82,7 @@ class WharfInfiltratorDiscardAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Card card = game.getCard(event.getTargetId()); - if (isControlledBy(event.getPlayerId()) && card != null && card.isCreature()) { + if (isControlledBy(event.getPlayerId()) && card != null && card.isCreature(game)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/w/WhiplashTrap.java b/Mage.Sets/src/mage/cards/w/WhiplashTrap.java index 2540f6cce5..b2acb46a77 100644 --- a/Mage.Sets/src/mage/cards/w/WhiplashTrap.java +++ b/Mage.Sets/src/mage/cards/w/WhiplashTrap.java @@ -59,7 +59,7 @@ enum WhiplashTrapCondition implements Condition { if (permanents != null) { int count = 0; for (Permanent permanent : permanents) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { count++; if (count == 2) { return true; diff --git a/Mage.Sets/src/mage/cards/w/WhispersteelDagger.java b/Mage.Sets/src/mage/cards/w/WhispersteelDagger.java index 21e2025b80..ee3e33bb52 100644 --- a/Mage.Sets/src/mage/cards/w/WhispersteelDagger.java +++ b/Mage.Sets/src/mage/cards/w/WhispersteelDagger.java @@ -102,8 +102,8 @@ class WhispersteelDaggerCastFromExileEffect extends AsThoughEffectImpl { Card card = game.getCard(sourceId); return card != null && card.getOwnerId().equals(targetId) - && card.isCreature() - && !card.isLand(); + && card.isCreature(game) + && !card.isLand(game); } } diff --git a/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java b/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java index da7d34c173..92173b23d7 100644 --- a/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java +++ b/Mage.Sets/src/mage/cards/w/WidespreadBrutality.java @@ -64,7 +64,7 @@ class WidespreadBrutalityEffect extends OneShotEffect { game.getState().processAction(game); int power = amassedArmy.getPower().getValue(); for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (permanent != null && permanent.isCreature() && !permanent.hasSubtype(SubType.ARMY, game)) { + if (permanent != null && permanent.isCreature(game) && !permanent.hasSubtype(SubType.ARMY, game)) { permanent.damage(power, amassedArmy.getId(), source, game); } } diff --git a/Mage.Sets/src/mage/cards/w/WildDefiance.java b/Mage.Sets/src/mage/cards/w/WildDefiance.java index 34d41a6336..1ec4341a2a 100644 --- a/Mage.Sets/src/mage/cards/w/WildDefiance.java +++ b/Mage.Sets/src/mage/cards/w/WildDefiance.java @@ -63,11 +63,11 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isControlledBy(this.controllerId) && permanent.isCreature()) { + if (permanent != null && permanent.isControlledBy(this.controllerId) && permanent.isCreature(game)) { MageObject object = game.getObject(event.getSourceId()); if (object instanceof Spell) { Card c = (Spell) object; - if (c.isInstantOrSorcery()) { + if (c.isInstantOrSorcery(game)) { if (getTargets().isEmpty()) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/w/WildEvocation.java b/Mage.Sets/src/mage/cards/w/WildEvocation.java index 42e6bec874..60ffae042c 100644 --- a/Mage.Sets/src/mage/cards/w/WildEvocation.java +++ b/Mage.Sets/src/mage/cards/w/WildEvocation.java @@ -70,7 +70,7 @@ class WildEvocationEffect extends OneShotEffect { Cards cards = new CardsImpl(card); player.revealCards(sourceObject.getIdName() + " Turn: " + game.getTurnNum(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { player.moveCards(card, Zone.BATTLEFIELD, source, game); } else if (card.getSpellAbility() != null) { game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE); diff --git a/Mage.Sets/src/mage/cards/w/WildfireDevils.java b/Mage.Sets/src/mage/cards/w/WildfireDevils.java index 0b27433909..8c2cddcf45 100644 --- a/Mage.Sets/src/mage/cards/w/WildfireDevils.java +++ b/Mage.Sets/src/mage/cards/w/WildfireDevils.java @@ -82,7 +82,7 @@ class WildfireDevilsEffect extends OneShotEffect { return false; } game.informPlayers("The chosen random player is " + randomPlayer.getLogName()); - if (randomPlayer.getGraveyard().getCards(game).stream().noneMatch(Card::isInstantOrSorcery)) { + if (randomPlayer.getGraveyard().getCards(game).stream().noneMatch(card1 -> card1.isInstantOrSorcery(game))) { return false; } TargetCardInGraveyard targetCard = new TargetCardInGraveyard(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY); diff --git a/Mage.Sets/src/mage/cards/w/WildwoodScourge.java b/Mage.Sets/src/mage/cards/w/WildwoodScourge.java index a67d78efe1..1c9abf67c3 100644 --- a/Mage.Sets/src/mage/cards/w/WildwoodScourge.java +++ b/Mage.Sets/src/mage/cards/w/WildwoodScourge.java @@ -75,7 +75,7 @@ class WildwoodScourgeTriggeredAbility extends TriggeredAbilityImpl { } return permanent != null && !event.getTargetId().equals(this.getSourceId()) - && permanent.isCreature() + && permanent.isCreature(game) && !permanent.hasSubtype(SubType.HYDRA, game) && permanent.isControlledBy(this.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/w/Willbreaker.java b/Mage.Sets/src/mage/cards/w/Willbreaker.java index 3d3b609bc1..18c46e33f6 100644 --- a/Mage.Sets/src/mage/cards/w/Willbreaker.java +++ b/Mage.Sets/src/mage/cards/w/Willbreaker.java @@ -15,7 +15,6 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -69,7 +68,7 @@ class WillbreakerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (isControlledBy(event.getPlayerId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { Player controller = game.getPlayer(getControllerId()); if (controller != null && controller.hasOpponent(permanent.getControllerId(), game)) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/w/WindingConstrictor.java b/Mage.Sets/src/mage/cards/w/WindingConstrictor.java index 83a7e1b5cc..8cf5ab95ba 100644 --- a/Mage.Sets/src/mage/cards/w/WindingConstrictor.java +++ b/Mage.Sets/src/mage/cards/w/WindingConstrictor.java @@ -74,7 +74,7 @@ class WindingConstrictorPermanentEffect extends ReplacementEffectImpl { } return permanent != null && event.getAmount() > 0 - && (permanent.isCreature() || permanent.isArtifact()) + && (permanent.isCreature(game) || permanent.isArtifact(game)) && permanent.isControlledBy(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java b/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java index 5515d9112e..d92058fb21 100644 --- a/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java +++ b/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java @@ -80,7 +80,7 @@ class WingedTempleOfOrazcaEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); - if (creature != null && creature.isCreature()) { + if (creature != null && creature.isCreature(game)) { int pow = creature.getPower().getValue(); ContinuousEffect effect = new BoostTargetEffect(pow, pow, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(creature, game)); diff --git a/Mage.Sets/src/mage/cards/w/WookieeMystic.java b/Mage.Sets/src/mage/cards/w/WookieeMystic.java index 30d05bda8b..767f11fc27 100644 --- a/Mage.Sets/src/mage/cards/w/WookieeMystic.java +++ b/Mage.Sets/src/mage/cards/w/WookieeMystic.java @@ -91,7 +91,7 @@ class WookieeMysticWatcher extends Watcher { MageObject target = game.getObject(event.getTargetId()); if (event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()) - && target != null && target.isCreature() + && target != null && target.isCreature(game) && event.getFlag()) { if (target instanceof Spell) { this.creatures.add(((Spell) target).getCard().getId()); diff --git a/Mage.Sets/src/mage/cards/w/WordOfCommand.java b/Mage.Sets/src/mage/cards/w/WordOfCommand.java index 43f6b83269..ca70b2d307 100644 --- a/Mage.Sets/src/mage/cards/w/WordOfCommand.java +++ b/Mage.Sets/src/mage/cards/w/WordOfCommand.java @@ -162,7 +162,7 @@ class WordOfCommandEffect extends OneShotEffect { private boolean checkPlayability(Card card, Player targetPlayer, Game game, Ability source) { // check for card playability boolean canPlay = false; - if (card.isLand()) { // we can't use getPlayableObjects(game) in here because it disallows playing lands outside the main step // TODO: replace to getPlayable() checks with disable step condition? + if (card.isLand(game)) { // we can't use getPlayableObjects(game) in here because it disallows playing lands outside the main step // TODO: replace to getPlayable() checks with disable step condition? if (targetPlayer.canPlayLand() && game.getActivePlayerId().equals(targetPlayer.getId())) { for (Ability ability : card.getAbilities(game)) { @@ -207,7 +207,7 @@ class WordOfCommandCantActivateEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return !permanent.isLand() && permanent.getControllerId().equals(this.targetPointer.getFirst(game, source)); + return !permanent.isLand(game) && permanent.getControllerId().equals(this.targetPointer.getFirst(game, source)); } @Override diff --git a/Mage.Sets/src/mage/cards/w/WorldAtWar.java b/Mage.Sets/src/mage/cards/w/WorldAtWar.java index 1990f89b54..a9f1f19c5e 100644 --- a/Mage.Sets/src/mage/cards/w/WorldAtWar.java +++ b/Mage.Sets/src/mage/cards/w/WorldAtWar.java @@ -15,7 +15,6 @@ import mage.constants.Outcome; import mage.constants.TurnPhase; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; import mage.watchers.Watcher; @@ -147,7 +146,7 @@ class UntapAttackingThisTurnEffect extends OneShotEffect { Set attackedThisTurn = ((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures(); for (MageObjectReference mor : attackedThisTurn) { Permanent permanent = mor.getPermanent(game); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { permanent.untap(game); } } diff --git a/Mage.Sets/src/mage/cards/w/WormsOfTheEarth.java b/Mage.Sets/src/mage/cards/w/WormsOfTheEarth.java index e59319f760..260085264f 100644 --- a/Mage.Sets/src/mage/cards/w/WormsOfTheEarth.java +++ b/Mage.Sets/src/mage/cards/w/WormsOfTheEarth.java @@ -107,7 +107,7 @@ class WormsOfTheEarthEnterEffect extends ContinuousRuleModifyingEffectImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { Card card = game.getCard(zEvent.getTargetId()); - return card != null && card.isLand(); + return card != null && card.isLand(game); } return false; } diff --git a/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java b/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java index fba8185af5..8abe976c0c 100644 --- a/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java +++ b/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java @@ -98,11 +98,11 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl { UUID permanentId = targetPointer.getFirst(game, source); Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId); if (permanent != null) { - if (!permanent.isArtifact()) { - permanent.addCardType(CardType.ARTIFACT); + if (!permanent.isArtifact(game)) { + permanent.addCardType(game, CardType.ARTIFACT); } - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); + if (!permanent.isCreature(game)) { + permanent.addCardType(game, CardType.CREATURE); } } } diff --git a/Mage.Sets/src/mage/cards/y/YedoraGraveGardener.java b/Mage.Sets/src/mage/cards/y/YedoraGraveGardener.java index b3b805650d..9644ca3c4f 100644 --- a/Mage.Sets/src/mage/cards/y/YedoraGraveGardener.java +++ b/Mage.Sets/src/mage/cards/y/YedoraGraveGardener.java @@ -118,9 +118,9 @@ class YedoraGraveGardenerContinuousEffect extends ContinuousEffectImpl { return false; } target.getSuperType().clear(); - target.getCardType().clear(); + target.removeAllCardTypes(game); target.removeAllSubTypes(game); - target.addCardType(CardType.LAND); + target.addCardType(game, CardType.LAND); target.addSubType(game, SubType.FOREST); target.removeAllAbilities(source.getSourceId(), game); target.addAbility(new GreenManaAbility(), source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/z/ZabazTheGlimmerwasp.java b/Mage.Sets/src/mage/cards/z/ZabazTheGlimmerwasp.java index 90caaec27d..192a50beba 100644 --- a/Mage.Sets/src/mage/cards/z/ZabazTheGlimmerwasp.java +++ b/Mage.Sets/src/mage/cards/z/ZabazTheGlimmerwasp.java @@ -101,7 +101,7 @@ class ZabazTheGlimmerwaspEffect extends ReplacementEffectImpl { } return permanent != null && permanent.isControlledBy(source.getControllerId()) - && permanent.isCreature(); + && permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java b/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java index 85bd7a3a4b..911f0e653b 100644 --- a/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java +++ b/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java @@ -81,7 +81,7 @@ class ZadaHedronGrinderTriggeredAbility extends TriggeredAbilityImpl { return false; } Spell spell = game.getSpell(event.getTargetId()); - if (spell == null || !spell.isInstantOrSorcery()) { + if (spell == null || !spell.isInstantOrSorcery(game)) { return false; } boolean noTargets = true; diff --git a/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java b/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java index f6ccdac878..e569ef82c1 100644 --- a/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java +++ b/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java @@ -98,12 +98,12 @@ class ZagrasThiefOfHeartbeatsTriggeredAbility extends TriggeredAbilityImpl { } Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (permanent == null - || !permanent.isCreature() + || !permanent.isCreature(game) || !permanent.isControlledBy(getControllerId())) { return false; } Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (damaged == null || !permanent.isPlaneswalker()) { + if (damaged == null || !permanent.isPlaneswalker(game)) { return false; } this.getEffects().clear(); diff --git a/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java b/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java index d0348c6bf0..b71e398c0a 100644 --- a/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java +++ b/Mage.Sets/src/mage/cards/z/ZameckGuildmage.java @@ -69,7 +69,7 @@ class ZameckGuildmageEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(); + return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(game); } @Override diff --git a/Mage.Sets/src/mage/cards/z/ZhalfirinDecoy.java b/Mage.Sets/src/mage/cards/z/ZhalfirinDecoy.java index 0087d44cc7..e4047b37cc 100644 --- a/Mage.Sets/src/mage/cards/z/ZhalfirinDecoy.java +++ b/Mage.Sets/src/mage/cards/z/ZhalfirinDecoy.java @@ -81,7 +81,7 @@ class ZhalfirinDecoyWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { players.add(zEvent.getTarget().getControllerId()); } } diff --git a/Mage.Sets/src/mage/cards/z/ZirdaTheDawnwaker.java b/Mage.Sets/src/mage/cards/z/ZirdaTheDawnwaker.java index 065c655da3..fbc568f2e2 100644 --- a/Mage.Sets/src/mage/cards/z/ZirdaTheDawnwaker.java +++ b/Mage.Sets/src/mage/cards/z/ZirdaTheDawnwaker.java @@ -76,7 +76,7 @@ enum ZirdaTheDawnwakerCompanionCondition implements CompanionCondition { public boolean isLegal(Set deck, int startingSize) { return deck .stream() - .filter(MageObject::isPermanent) + .filter(card -> card.isPermanent()) .map(MageObject::getAbilities) .flatMap(Collection::stream) .anyMatch(ActivatedAbility.class::isInstance); diff --git a/Mage.Sets/src/mage/cards/z/ZoZuThePunisher.java b/Mage.Sets/src/mage/cards/z/ZoZuThePunisher.java index ce76c28fa6..e95ace3173 100644 --- a/Mage.Sets/src/mage/cards/z/ZoZuThePunisher.java +++ b/Mage.Sets/src/mage/cards/z/ZoZuThePunisher.java @@ -14,7 +14,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -69,7 +68,7 @@ class ZoZuThePunisherAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { Player player = game.getPlayer(permanent.getControllerId()); if (player != null) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/cards/z/Zoologist.java b/Mage.Sets/src/mage/cards/z/Zoologist.java index a06940f815..9ce7242e02 100644 --- a/Mage.Sets/src/mage/cards/z/Zoologist.java +++ b/Mage.Sets/src/mage/cards/z/Zoologist.java @@ -77,7 +77,7 @@ class ZoologistEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); if (card != null) { - if (card.isCreature()) { + if (card.isCreature(game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { controller.moveCards(card, Zone.GRAVEYARD, source, game); diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index e0461cc4bc..14692386c3 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -153,6 +153,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Graceful Restoration", 201, Rarity.UNCOMMON, mage.cards.g.GracefulRestoration.class)); cards.add(new SetCardInfo("Greed", 274, Rarity.UNCOMMON, mage.cards.g.Greed.class)); cards.add(new SetCardInfo("Grief", 87, Rarity.MYTHIC, mage.cards.g.Grief.class)); + cards.add(new SetCardInfo("Grist, the Hunger Tide", 202, Rarity.MYTHIC, mage.cards.g.GristTheHungerTide.class)); cards.add(new SetCardInfo("Guardian Kirin", 15, Rarity.COMMON, mage.cards.g.GuardianKirin.class)); cards.add(new SetCardInfo("Hard Evidence", 46, Rarity.COMMON, mage.cards.h.HardEvidence.class)); cards.add(new SetCardInfo("Harmonic Prodigy", 132, Rarity.RARE, mage.cards.h.HarmonicProdigy.class)); diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TestFrameworkCanPlayAITest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TestFrameworkCanPlayAITest.java index 38b1c2286c..d5a9066a5a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TestFrameworkCanPlayAITest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TestFrameworkCanPlayAITest.java @@ -104,8 +104,8 @@ public class TestFrameworkCanPlayAITest extends CardTestPlayerBaseWithAIHelps { execute(); assertAllCommandsUsed(); - Assert.assertEquals(1, currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE).size()); - Permanent permanent = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE).get(0); + Assert.assertEquals(1, currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame).size()); + Permanent permanent = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame).get(0); Assert.assertEquals(1, permanent.getAttachments().size()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java index df0e07b717..b7ff451771 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java @@ -1,5 +1,6 @@ package org.mage.test.cards.abilities.keywords; +import mage.abilities.keyword.LifelinkAbility; import mage.abilities.mana.ManaOptions; import mage.constants.CardType; import mage.constants.PhaseStep; @@ -49,8 +50,10 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Gods Willing", "Silent Artisan"); setChoice(playerA, "White"); + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); execute(); + assertAllCommandsUsed(); // because of protection the Hopeful Eidolon should be a creature on the battlefield assertPermanentCount(playerA, "Silent Artisan", 1); @@ -59,6 +62,28 @@ public class BestowTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1); } + @Test + public void bestowStaysEnchantment() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan"); // 3/5 + addCard(Zone.HAND, playerA, "Hopeful Eidolon"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hopeful Eidolon using bestow", "Silent Artisan"); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertPermanentCount(playerA, "Silent Artisan", 1); + assertPowerToughness(playerA, "Silent Artisan", 4, 6); + assertAbility(playerA, "Silent Artisan", LifelinkAbility.getInstance(), true); + assertPermanentCount(playerA, "Hopeful Eidolon", 1); + assertSubtype("Hopeful Eidolon", SubType.AURA); + assertType("Hopeful Eidolon", CardType.ENCHANTMENT, true); + assertType("Hopeful Eidolon", CardType.CREATURE, false); + } + /** * Test that cast with bestow does not trigger evolve */ @@ -75,13 +100,15 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Experiment One"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan"); + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); execute(); + assertAllCommandsUsed(); // because Boon Satyr is no creature on the battlefield, evolve may not trigger assertPermanentCount(playerA, "Boon Satyr", 1); Permanent boonSatyr = getPermanent("Boon Satyr", playerA); - Assert.assertTrue("Boon Satyr may not be a creature", !boonSatyr.isCreature()); + Assert.assertTrue("Boon Satyr may not be a creature", !boonSatyr.isCreature(currentGame)); assertPermanentCount(playerA, "Silent Artisan", 1); assertPermanentCount(playerA, "Experiment One", 1); assertPowerToughness(playerA, "Experiment One", 1, 1); @@ -105,8 +132,10 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hopeful Eidolon using bestow", "Silvercoat Lion"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion"); + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); execute(); + assertAllCommandsUsed(); // because Boon Satyr is no creature on the battlefield, evolve may not trigger assertLife(playerA, 20); @@ -117,8 +146,8 @@ public class BestowTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1); Permanent hopefulEidolon = getPermanent("Hopeful Eidolon", playerA); - Assert.assertTrue("Hopeful Eidolon has to be a creature but is not", hopefulEidolon.isCreature()); - Assert.assertTrue("Hopeful Eidolon has to be an enchantment but is not", hopefulEidolon.isEnchantment()); + Assert.assertTrue("Hopeful Eidolon has to be a creature but is not", hopefulEidolon.isCreature(currentGame)); + Assert.assertTrue("Hopeful Eidolon has to be an enchantment but is not", hopefulEidolon.isEnchantment(currentGame)); } @@ -139,8 +168,10 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan"); + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); execute(); + assertAllCommandsUsed(); // because Boon Satyr is no creature on the battlefield, evolve may not trigger assertPermanentCount(playerA, "Silent Artisan", 1); @@ -228,11 +259,16 @@ public class BestowTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + // B can't cast counter spell due CMC castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hypnotic Siren using bestow", "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disdainful Stroke", "Hypnotic Siren"); + checkStackSize("after", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1); + checkPlayableAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cast Disdainful Stroke", false); + //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disdainful Stroke", "Hypnotic Siren"); + setStrictChooseMode(true); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); + assertAllCommandsUsed(); // assertHandCount(playerA, "Hypnotic Siren", 0); @@ -266,8 +302,11 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mogis's Warhound using bestow", "Silvercoat Lion"); castSpell(1, PhaseStep.END_TURN, playerB, "Chandra's Outrage", "Silvercoat Lion"); + + setStrictChooseMode(true); setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertAllCommandsUsed(); assertLife(playerA, 18); // -2 from Chandra's Outrage assertLife(playerB, 18); // -2 from attack of Mogis's Warhound @@ -316,12 +355,17 @@ public class BestowTest extends CardTestPlayerBase { castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Nighthowler using bestow", "Alesha, Who Smiles at Death"); + // attacks by Alesha and return card on trigger attack(2, playerB, "Alesha, Who Smiles at Death"); + setChoice(playerB, "Yes"); // use trigger + addTarget(playerB, "Pillarfield Ox"); // target card to return castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Chandra's Outrage", "Alesha, Who Smiles at Death"); + setStrictChooseMode(true); setStopAt(2, PhaseStep.END_TURN); execute(); + assertAllCommandsUsed(); assertLife(playerB, 18); // -2 from Chandra's Outrage assertLife(playerA, 16); // -3 from attack Alesha with bestowed Nighthowler @@ -332,7 +376,7 @@ public class BestowTest extends CardTestPlayerBase { assertPowerToughness(playerB, "Nighthowler", 2, 2); Permanent nighthowler = getPermanent("Nighthowler", playerB); - Assert.assertEquals("Nighthowler has to be a creature", true, nighthowler.isCreature()); + Assert.assertEquals("Nighthowler has to be a creature", true, nighthowler.isCreature(currentGame)); } @Test @@ -346,8 +390,11 @@ public class BestowTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Sightless Brawler"); attack(1, playerA, "Sightless Brawler"); + + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_COMBAT); execute(); + assertAllCommandsUsed(); assertLife(playerB, 20); assertTapped("Sightless Brawler", false); @@ -366,8 +413,11 @@ public class BestowTest extends CardTestPlayerBase { attack(1, playerA, "Sightless Brawler"); attack(1, playerA, "Elite Vanguard"); + + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_COMBAT); execute(); + assertAllCommandsUsed(); assertLife(playerB, 15); assertTapped("Sightless Brawler", true); @@ -386,8 +436,11 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sightless Brawler using bestow", "Elite Vanguard"); attack(1, playerA, "Elite Vanguard"); + + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_COMBAT); execute(); + assertAllCommandsUsed(); assertHandCount(playerA, "Sightless Brawler", 0); assertLife(playerB, 20); @@ -410,8 +463,11 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sightless Brawler using bestow", "Elite Vanguard"); attack(1, playerA, "Elite Vanguard"); attack(1, playerA, "Memnite"); + + setStrictChooseMode(true); setStopAt(1, PhaseStep.END_COMBAT); execute(); + assertAllCommandsUsed(); assertHandCount(playerA, "Sightless Brawler", 0); assertLife(playerB, 14); @@ -445,8 +501,11 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nighthowler using bestow", "Silvercoat Lion"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Song of the Dryads", "Silvercoat Lion"); + + setStrictChooseMode(true); setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); + assertAllCommandsUsed(); assertPermanentCount(playerB, "Song of the Dryads", 1); @@ -476,8 +535,10 @@ public class BestowTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nylea's Emissary using bestow", "Silvercoat Lion"); + setStrictChooseMode(true); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); + assertAllCommandsUsed(); assertPermanentCount(playerA, "Nylea's Emissary", 1); assertPowerToughness(playerA, "Silvercoat Lion", 5, 5); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java index fc5e76d11a..5329f99df1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java @@ -181,8 +181,8 @@ public class TransformTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Startled Awake", 0); assertPermanentCount(playerA, "Persistent Nightmare", 1); // Night-side card of Startled Awake Permanent nightmare = getPermanent("Persistent Nightmare", playerA); - Assert.assertTrue("Has to have creature card type", nightmare.isCreature()); - Assert.assertFalse("Has not to have sorcery card type", nightmare.isSorcery()); + Assert.assertTrue("Has to have creature card type", nightmare.isCreature(currentGame)); + Assert.assertFalse("Has not to have sorcery card type", nightmare.isSorcery(currentGame)); } /** diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffectsTest.java index a6626ac35f..eb4ca3ef0d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffectsTest.java @@ -235,7 +235,7 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase { if (permanent.hasSubtype(SubType.SWAMP, currentGame)) { swampTypes++; } - if (permanent.isCreature()) { + if (permanent.isCreature(currentGame)) { creatures++; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SubTypeChangingEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SubTypeChangingEffectsTest.java index c7529222c8..1e34eed275 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SubTypeChangingEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SubTypeChangingEffectsTest.java @@ -47,36 +47,36 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase { Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame)); for (Card card : playerA.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertFalse(card.getName() + " should not have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerB.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerB.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerA.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerB.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } @@ -122,21 +122,21 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase { Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame)); for (Card card : playerA.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } @@ -177,39 +177,39 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase { Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame)); for (Card card : playerA.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerB.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerB.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerB.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } @@ -277,21 +277,21 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase { Assert.assertFalse(wurm.hasSubtype(SubType.ORC, currentGame)); for (Card card : playerA.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame)); Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame)); } @@ -372,36 +372,36 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase { Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame)); for (Card card : playerA.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerB.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerB.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerA.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerB.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } @@ -438,36 +438,36 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase { Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame)); for (Card card : playerA.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerB.getLibrary().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame)); } } for (Card card : playerA.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerB.getHand().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerA.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } for (Card card : playerB.getGraveyard().getCards(currentGame)) { - if (card.isCreature()) { + if (card.isCreature(currentGame)) { Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame)); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java index 7544e1de02..b93c00f662 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/BattlefieldTriggeredAbilitiesTest.java @@ -46,7 +46,7 @@ public class BattlefieldTriggeredAbilitiesTest extends CardTestPlayerBase { int playerACount = 0; int playerBCount = 0; for (Permanent p : currentGame.getBattlefield().getAllActivePermanents()) { - if (p.isLand()) { + if (p.isLand(currentGame)) { if (p.getControllerId().equals(playerB.getId())) { playerBCount++; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java index a8e26e1cce..100fe2006e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java @@ -40,7 +40,7 @@ public class FelhideSpiritbinderTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); Permanent lion = getPermanent("Silvercoat Lion", playerB); assertAbility(playerB, "Silvercoat Lion", HasteAbility.getInstance(), true); - Assert.assertEquals("token has to have card type enchantment", true, lion.getCardType().contains(CardType.ENCHANTMENT)); + Assert.assertEquals("token has to have card type enchantment", true, lion.getCardType(currentGame).contains(CardType.ENCHANTMENT)); assertLife(playerA, 17); assertLife(playerB, 20); @@ -93,7 +93,7 @@ public class FelhideSpiritbinderTest extends CardTestPlayerBase { assertAbility(playerB, "Elephant", HasteAbility.getInstance(), true); Permanent copiedTokenElephant = getPermanent("Elephant", playerB); - Assert.assertEquals("Elephant has Enchantment card type", true, copiedTokenElephant.getCardType().contains(CardType.ENCHANTMENT)); + Assert.assertEquals("Elephant has Enchantment card type", true, copiedTokenElephant.getCardType(currentGame).contains(CardType.ENCHANTMENT)); assertLife(playerA, 17); assertLife(playerB, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java index 07afd1a14c..7ccde5232a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java @@ -629,15 +629,15 @@ public class PhantasmalImageTest extends CardTestPlayerBase { assertAllCommandsUsed(); Permanent staffA = getPermanent("Chimeric Staff", playerA); - assertTrue("Phantasmal Image should be an artifact", staffA.isArtifact()); - assertTrue("Phantasmal Image should not be a creature", !staffA.isCreature()); + assertTrue("Phantasmal Image should be an artifact", staffA.isArtifact(currentGame)); + assertTrue("Phantasmal Image should not be a creature", !staffA.isCreature(currentGame)); assertTrue("Phantasmal Image should not be an Illusion", !staffA.hasSubtype(SubType.ILLUSION, currentGame)); assertTrue("Phantasmal Image should not be a Construct", !staffA.hasSubtype(SubType.CONSTRUCT, currentGame)); assertTrue("Phantasmal Image should have the sacrifice trigger", staffA.getAbilities(currentGame).containsClass(BecomesTargetTriggeredAbility.class)); Permanent staffB = getPermanent("Chimeric Staff", playerB); - assertTrue("Chimeric Staff should be an artifact", staffB.isArtifact()); - assertTrue("Chimeric Staff should be a creature", staffB.isCreature()); + assertTrue("Chimeric Staff should be an artifact", staffB.isArtifact(currentGame)); + assertTrue("Chimeric Staff should be a creature", staffB.isCreature(currentGame)); assertTrue("Chimeric Staff should be a Construct", staffB.hasSubtype(SubType.CONSTRUCT, currentGame)); } @@ -659,18 +659,18 @@ public class PhantasmalImageTest extends CardTestPlayerBase { assertAllCommandsUsed(); Permanent cloakA = getPermanent("Cloak and Dagger", playerA); - assertTrue("Phantasmal Image should be an artifact", cloakA.isArtifact()); - assertTrue("Phantasmal Image should be tribal", cloakA.isTribal()); - assertTrue("Phantasmal Image should not be a creature", !cloakA.isCreature()); + assertTrue("Phantasmal Image should be an artifact", cloakA.isArtifact(currentGame)); + assertTrue("Phantasmal Image should be tribal", cloakA.isTribal(currentGame)); + assertTrue("Phantasmal Image should not be a creature", !cloakA.isCreature(currentGame)); assertTrue("Phantasmal Image should be a Rogue", cloakA.hasSubtype(SubType.ROGUE, currentGame)); assertTrue("Phantasmal Image should be an Illusion", cloakA.hasSubtype(SubType.ILLUSION, currentGame)); assertTrue("Phantasmal Image should be an Equipment", cloakA.hasSubtype(SubType.EQUIPMENT, currentGame)); assertTrue("Phantasmal Image should have the sacrifice trigger", cloakA.getAbilities(currentGame).containsClass(BecomesTargetTriggeredAbility.class)); Permanent cloakB = getPermanent("Cloak and Dagger", playerB); - assertTrue("Cloak and Dagger should be an artifact", cloakB.isArtifact()); - assertTrue("Cloak and Dagger should be a creature", cloakB.isCreature()); - assertTrue("Cloak and Dagger should be tribal", cloakB.isTribal()); + assertTrue("Cloak and Dagger should be an artifact", cloakB.isArtifact(currentGame)); + assertTrue("Cloak and Dagger should be a creature", cloakB.isCreature(currentGame)); + assertTrue("Cloak and Dagger should be tribal", cloakB.isTribal(currentGame)); assertTrue("Cloak and Dagger should be a Rogue", cloakB.hasSubtype(SubType.ROGUE, currentGame)); assertTrue("Cloak and Dagger should be an Equipment", cloakB.hasSubtype(SubType.EQUIPMENT, currentGame)); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/ProgenitorMimicTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/ProgenitorMimicTest.java index 099e844a8c..cf3b363810 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/ProgenitorMimicTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/ProgenitorMimicTest.java @@ -41,7 +41,7 @@ public class ProgenitorMimicTest extends CardTestPlayerBase { int nonTokens = 0; for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { if (permanent.getControllerId().equals(playerB.getId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(currentGame)) { if (permanent instanceof PermanentToken) { tokens++; } else { @@ -121,7 +121,7 @@ public class ProgenitorMimicTest extends CardTestPlayerBase { int nonTokens = 0; for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { if (permanent.getControllerId().equals(playerB.getId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(currentGame)) { if (permanent instanceof PermanentToken) { tokens++; } else { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaces/ModalDoubleFacesCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaces/ModalDoubleFacesCardsTest.java index 989d2d2ed8..f21c9ca82e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaces/ModalDoubleFacesCardsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modaldoublefaces/ModalDoubleFacesCardsTest.java @@ -256,8 +256,8 @@ public class ModalDoubleFacesCardsTest extends CardTestPlayerBase { // stats in hand - normal Card card = getHandCards(playerA).stream().filter(c -> CardUtil.haveSameNames(c, "Akoum Warrior", currentGame)).findFirst().get(); - Assert.assertFalse("must be non land", card.isLand()); - Assert.assertTrue("must be creature", card.isCreature()); + Assert.assertFalse("must be non land", card.isLand(currentGame)); + Assert.assertTrue("must be creature", card.isCreature(currentGame)); Assert.assertTrue("must be minotaur", card.hasSubtype(SubType.MINOTAUR, currentGame)); Assert.assertEquals("power", 4, card.getPower().getValue()); Assert.assertEquals("toughness", 5, card.getToughness().getValue()); @@ -265,7 +265,7 @@ public class ModalDoubleFacesCardsTest extends CardTestPlayerBase { // stats in hand - mdf card = getHandCards(playerA).stream().filter(c -> CardUtil.haveSameNames(c, "Halvar, God of Battle", currentGame)).findFirst().get(); Assert.assertTrue("must be legendary", card.isLegendary()); - Assert.assertTrue("must be creature", card.isCreature()); + Assert.assertTrue("must be creature", card.isCreature(currentGame)); Assert.assertTrue("must be god", card.hasSubtype(SubType.GOD, currentGame)); // stats in hand - mdf - color identity must be from both sides diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java index 507426dfbd..1455a23d5f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java @@ -25,7 +25,7 @@ public class DustOfMomentsTest extends CardTestPlayerBase { execute(); // Chronozoa should have duplicated - final List activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE); + final List activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame); Assert.assertEquals(2, activeCreatures.size()); for (final Permanent creature : activeCreatures) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/mh2/GristTheHungerTideTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/mh2/GristTheHungerTideTest.java new file mode 100644 index 0000000000..1e5594788b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/mh2/GristTheHungerTideTest.java @@ -0,0 +1,88 @@ +package org.mage.test.cards.single.mh2; + +import mage.cards.Card; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author TheElk801 + */ +public class GristTheHungerTideTest extends CardTestPlayerBase { + + private static final String grist = "Grist, the Hunger Tide"; + private static final String imp = "Putrid Imp"; + private static final String leyline = "Leyline of the Void"; + private static final String bounty = "Primeval Bounty"; + + @Test + public void testGristInHandBattlefieldGraveLibrary() { + addCard(Zone.HAND, playerA, grist); + addCard(Zone.BATTLEFIELD, playerA, grist); + addCard(Zone.GRAVEYARD, playerA, grist); + addCard(Zone.LIBRARY, playerA, grist); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + for (Card card : currentGame.getCards()) { + if (!card.getName().equals(grist)) { + continue; + } + Zone zone = currentGame.getState().getZone(card.getId()); + if (zone == Zone.BATTLEFIELD) { + Assert.assertFalse("Not a creature on the battlefield", card.isCreature(currentGame)); + } else { + Assert.assertTrue("Should be a creature when zone is " + zone, card.isCreature(currentGame)); + } + } + } + + @Test + public void testGristInExile() { + addCard(Zone.HAND, playerA, grist); + addCard(Zone.BATTLEFIELD, playerA, imp); + addCard(Zone.BATTLEFIELD, playerB, leyline); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Discard"); + setChoice(playerA, grist); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + for (Card card : currentGame.getCards()) { + if (!card.getName().equals(grist)) { + continue; + } + Assert.assertEquals("", Zone.EXILED, currentGame.getState().getZone(card.getId())); + Assert.assertTrue("Should be a creature in exile", card.isCreature(currentGame)); + } + } + + @Test + public void testGristFromStackToBattlefield() { + addCard(Zone.BATTLEFIELD, playerA, "Bayou", 3); + addCard(Zone.BATTLEFIELD, playerA, bounty); + addCard(Zone.HAND, playerA, grist); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, grist); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + // Grist is a creature spell when cast and triggers bounty + assertPermanentCount(playerA, "Beast", 1); + // But not a creature on the battlefield + assertPermanentCount(playerA, grist, 1); + assertType(grist, CardType.CREATURE, false); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/plc/ChronozoaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/plc/ChronozoaTest.java index 79dbc73c79..e8cce2d1a3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/plc/ChronozoaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/plc/ChronozoaTest.java @@ -56,7 +56,7 @@ public class ChronozoaTest extends CardTestPlayerBase { // The original Chronozoa card should be in graveyard assertGraveyardCount(playerA, 1); - final List creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE); + final List creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame); Assert.assertEquals(2, creatures.size()); for (final Permanent creature : creatures) { @@ -94,7 +94,7 @@ public class ChronozoaTest extends CardTestPlayerBase { assertGraveyardCount(playerB, 1); // Chronozoa shouldn't duplicate - final List creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE); + final List creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame); Assert.assertTrue(creatures.isEmpty()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/HeliodGodOfTheSun.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/HeliodGodOfTheSun.java index a6abc84f1c..7d51e303d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/HeliodGodOfTheSun.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/HeliodGodOfTheSun.java @@ -46,7 +46,7 @@ public class HeliodGodOfTheSun extends CardTestPlayerBase { assertPermanentCount(playerA, "Hold the Gates", 1); Permanent heliodGodOfTheSun = getPermanent("Heliod, God of the Sun", playerA); - Assert.assertTrue(heliodGodOfTheSun.isCreature()); + Assert.assertTrue(heliodGodOfTheSun.isCreature(currentGame)); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/PurphorosGodOfTheForgeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/PurphorosGodOfTheForgeTest.java index d124f0882a..109f0f58ce 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/PurphorosGodOfTheForgeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ths/PurphorosGodOfTheForgeTest.java @@ -51,7 +51,7 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase { assertPermanentCount(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 1); Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA); - Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE)); + Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.isCreature(currentGame)); } @Test @@ -86,7 +86,7 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase { assertLife(playerB, 18); // 2 damage from Purphoros for the morphed Phoenix Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA); - Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE)); + Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.isCreature(currentGame)); } @Test @@ -107,6 +107,6 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase { assertLife(playerB, 18); Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA); - Assert.assertTrue("Purphoros should be a creature now but is not", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE)); + Assert.assertTrue("Purphoros should be a creature now but is not", purphorosGodOfTheForge.isCreature(currentGame)); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java index c8a00ef36d..8803c3aba9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java @@ -57,8 +57,8 @@ public class CastCommanderTest extends CardTestCommanderDuelBase { assertPermanentCount(playerA, "Kestia, the Cultivator", 1); Permanent kestia = getPermanent("Kestia, the Cultivator", playerA); - Assert.assertNotEquals("Kestia may not be an creature", true, kestia.isCreature()); - Assert.assertEquals("Kestia has to be an enchantment", true, kestia.isEnchantment()); + Assert.assertNotEquals("Kestia may not be an creature", true, kestia.isCreature(currentGame)); + Assert.assertEquals("Kestia has to be an enchantment", true, kestia.isEnchantment(currentGame)); assertPowerToughness(playerA, "Silvercoat Lion", 6, 6); } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index 8cf09ff0ce..96e0636487 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -1161,7 +1161,7 @@ public class TestPlayer implements Player { + c.getIdName() + (c.isCopy() ? " [copy of " + c.getCopyFrom().getId().toString().substring(0, 3) + "]" : "") + " - " + c.getPower().getValue() + "/" + c.getToughness().getValue() - + (c.isPlaneswalker() ? " - L" + c.getCounters(game).getCount(CounterType.LOYALTY) : "") + + (c.isPlaneswalker(game) ? " - L" + c.getCounters(game).getCount(CounterType.LOYALTY) : "") + ", " + (c.isTapped() ? "Tapped" : "Untapped") + getPrintableAliases(", [", c.getId(), "]") + (c.getAttachedTo() == null ? "" : ", attached to " + game.getPermanent(c.getAttachedTo()).getIdName()))) @@ -1479,7 +1479,7 @@ public class TestPlayer implements Player { Permanent perm = findPermanentWithAssert(action, game, player, permanentName); boolean found = false; - for (CardType ct : perm.getCardType()) { + for (CardType ct : perm.getCardType(game)) { if (ct.equals(type)) { found = true; break; diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index 0cb3e7d05b..0e9e6a09ef 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -1114,7 +1114,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); Assert.assertTrue("(Battlefield) card type " + (mustHave ? "not " : "") - + "found (" + cardName + ':' + type + ')', (found.getCardType().contains(type) == mustHave)); + + "found (" + cardName + ':' + type + ')', (found.getCardType(currentGame).contains(type) == mustHave)); } @@ -1128,7 +1128,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public void assertType(String cardName, CardType type, SubType subType) throws AssertionError { //Assert.assertNotEquals("", cardName); Permanent found = getPermanent(cardName); - Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', found.getCardType().contains(type)); + Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', found.getCardType(currentGame).contains(type)); if (subType != null) { Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ':' + subType.getDescription() + ')', found.hasSubtype(subType, currentGame)); } @@ -1143,7 +1143,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public void assertNotType(String cardName, CardType type) throws AssertionError { //Assert.assertNotEquals("", cardName); Permanent found = getPermanent(cardName); - Assert.assertFalse("(Battlefield) card type found (" + cardName + ':' + type + ')', found.getCardType().contains(type)); + Assert.assertFalse("(Battlefield) card type found (" + cardName + ':' + type + ')', found.getCardType(currentGame).contains(type)); } /** @@ -1201,9 +1201,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } if (mustHave) { - Assert.assertEquals("must contain colors [" + searchColors.toString() + "] but found only [" + cardColor.toString() + "]", 0, colorsDontHave.size()); + Assert.assertEquals("must contain colors [" + searchColors + "] but found only [" + cardColor.toString() + "]", 0, colorsDontHave.size()); } else { - Assert.assertEquals("must not contain colors [" + searchColors.toString() + "] but found [" + cardColor.toString() + "]", 0, colorsHave.size()); + Assert.assertEquals("must not contain colors [" + searchColors + "] but found [" + cardColor.toString() + "]", 0, colorsHave.size()); } } @@ -1358,13 +1358,13 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * Assert card subtype in exile. * * @param cardName Name of the card. - * @param subType Expected subtype. + * @param subType Expected subtype. */ public void assertExiledCardSubtype(String cardName, SubType subType) throws AssertionError { boolean found = false; for (ExileZone exile : currentGame.getExile().getExileZones()) { for (Card card : exile.getCards(currentGame)) { - if(CardUtil.haveSameNames(card.getName(), cardName, true) && card.hasSubtype(subType, currentGame)){ + if (CardUtil.haveSameNames(card.getName(), cardName, true) && card.hasSubtype(subType, currentGame)) { found = true; } } @@ -1929,7 +1929,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement /** * Setup amount choices. - * + *

* Multi amount choices uses WUBRG order (so use 1,2,3,4,5 values list) * * @param player @@ -2096,22 +2096,22 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } - public void assertWonTheGame(Player player){ + public void assertWonTheGame(Player player) { Assert.assertTrue(player.getName() + " has not won the game.", player.hasWon()); } - public void assertHasNotWonTheGame(Player player){ + public void assertHasNotWonTheGame(Player player) { Assert.assertFalse(player.getName() + " has won the game.", player.hasWon()); } - public void assertLostTheGame(Player player){ + public void assertLostTheGame(Player player) { Assert.assertTrue(player.getName() + " has not lost the game.", player.hasLost()); } - public void assertHasNotLostTheGame(Player player){ + public void assertHasNotLostTheGame(Player player) { Assert.assertFalse(player.getName() + " has lost the game.", player.hasLost()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CompanionTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CompanionTest.java new file mode 100644 index 0000000000..44378bc50f --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CompanionTest.java @@ -0,0 +1,131 @@ +package org.mage.test.serverside.deck; + +import mage.deck.Commander; +import org.junit.Test; +import org.mage.test.serverside.base.MageTestBase; + +/** + * @author TheElk801 + */ +public class CompanionTest extends MageTestBase { + + @Test + public void testGyrudaTrue() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Island", 96); + deckTester.addMaindeck("Fact or Fiction", 1); + deckTester.addMaindeck("Counterspell", 1); + deckTester.addMaindeck("Pact of Negation", 1); + + deckTester.addSideboard("Ramirez DePietro", 1); + deckTester.addSideboard("Gyruda, Doom of Depths", 1); + + deckTester.validate("Deck must have all even mana value with Gyruda as a companion"); + } + + @Test + public void testGyrudaFalseMaindeck() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Island", 96); + deckTester.addMaindeck("Fact or Fiction", 1); + deckTester.addMaindeck("Counterspell", 1); + deckTester.addMaindeck("Merfolk of the Pearl Trident", 1); + + deckTester.addSideboard("Ramirez DePietro", 1); + deckTester.addSideboard("Gyruda, Doom of Depths", 1); + + deckTester.validate("Maindeck must have all even mana value with Gyruda as a companion", false); + } + + @Test + public void testGyrudaFalseCommander() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Island", 96); + deckTester.addMaindeck("Fact or Fiction", 1); + deckTester.addMaindeck("Counterspell", 1); + deckTester.addMaindeck("Pact of Negation", 1); + + deckTester.addSideboard("Sivitri Scarzam", 1); + deckTester.addSideboard("Gyruda, Doom of Depths", 1); + + deckTester.validate("Commander must have even mana value with Gyruda as a companion", false); + } + + @Test + public void testKaheeraFalseMaindeck() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 98); + deckTester.addMaindeck("Cylian Elf", 1); + + deckTester.addSideboard("Morophon, the Boundless", 1); + deckTester.addSideboard("Kaheera, the Orphanguard", 1); + + deckTester.validate("Maindeck must have all legal creature types with Kaheera as a companion", false); + } + + @Test + public void testKaheeraFalseCommander() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 98); + deckTester.addMaindeck("Silvercoat Lion", 1); + + deckTester.addSideboard("Jasmine Boreal", 1); + deckTester.addSideboard("Kaheera, the Orphanguard", 1); + + deckTester.validate("Commander must be valid with Kaheera as a companion", false); + } + + @Test + public void testKaheeraChangeling() { + // Changelings can be in a deck Kaheera as companion as their first abilities apply during deck construction. + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 98); + deckTester.addMaindeck("Woodland Changeling", 1); + + deckTester.addSideboard("Morophon, the Boundless", 1); + deckTester.addSideboard("Kaheera, the Orphanguard", 1); + + deckTester.validate("Changelings are legal with Kaheera as a companion"); + } + + @Test + public void testGristKaheera() { + // Grist, the Hunger Tide can't be in a deck with Kaheera as companion as its first ability applies during deck construction. + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 98); + deckTester.addMaindeck("Grist, the Hunger Tide", 1); + + deckTester.addSideboard("Doran, the Siege Tower", 1); + deckTester.addSideboard("Kaheera, the Orphanguard", 1); + + deckTester.validate("Grist is not legal with Kaheera as a companion", false); + } + + @Test + public void testGristUmoriCreature() { + // Grist, the Hunger Tide can be in a creature deck with Umori as companion as its first ability applies during deck construction. + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 97); + deckTester.addMaindeck("Grizzly Bears", 1); + deckTester.addMaindeck("Grist, the Hunger Tide", 1); + + deckTester.addSideboard("Nath of the Gilt-Leaf", 1); + deckTester.addSideboard("Umori, the Collector", 1); + + deckTester.validate("Grist is legal as a creature with Umori as a companion"); + } + + @Test + public void testGristUmoriPlaneswalker() { + // Grist, the Hunger Tide can be in a planeswalker deck with Umori as companion as it's still a planeswalker + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 97); + deckTester.addMaindeck("Garruk Wildspeaker", 1); + deckTester.addMaindeck("Grist, the Hunger Tide", 1); + + deckTester.addSideboard("Lord Windgrace", 1); + deckTester.addSideboard("Umori, the Collector", 1); + + deckTester.validate("Grist is legal as a planeswalker with Umori as a companion"); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidationUtil.java b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidationUtil.java new file mode 100644 index 0000000000..8f8eee99e6 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidationUtil.java @@ -0,0 +1,124 @@ +package org.mage.test.serverside.deck; + +import mage.cards.decks.Deck; +import mage.cards.decks.DeckValidator; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author TheElk801 + */ +public class DeckValidationUtil { + + static class CardNameAmount { + + String name; + String setCode; + String cardNumber; + int number; + + CardNameAmount(String setCode, int cardNumber, int number) { + this.name = ""; + this.setCode = setCode; + this.cardNumber = String.valueOf(cardNumber); + this.number = number; + } + + CardNameAmount(String name, int number) { + this.name = name; + this.number = number; + } + + public String getName() { + return name; + } + + public int getNumber() { + return number; + } + + String getSetCode() { + return setCode; + } + + String getCardNumber() { + return cardNumber; + } + } + + private DeckValidationUtil() { + } + + public static boolean testDeckValid(DeckValidator validator, List cards) { + return testDeckValid(validator, cards, null); + } + + public static boolean testDeckValid(DeckValidator validator, List cards, List cardsSideboard) { + Deck deckToTest = new Deck(); + if (cards != null) { + for (CardNameAmount cardNameAmount : cards) { + CardInfo cardinfo; + if (cardNameAmount.getName().isEmpty()) { + cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber()); + } else { + cardinfo = CardRepository.instance.findCard(cardNameAmount.getName()); + } + for (int i = 0; i < cardNameAmount.getNumber(); i++) { + assert cardinfo != null; + deckToTest.getCards().add(cardinfo.getCard()); + } + } + } + if (cardsSideboard != null) { + for (CardNameAmount cardNameAmount : cardsSideboard) { + CardInfo cardinfo; + if (cardNameAmount.getName().isEmpty()) { + cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber()); + } else { + cardinfo = CardRepository.instance.findCard(cardNameAmount.getName()); + } + for (int i = 0; i < cardNameAmount.getNumber(); i++) { + assert cardinfo != null; + deckToTest.getSideboard().add(cardinfo.getCard()); + } + } + } + return validator.validate(deckToTest); + } + +} + +class DeckTester { + private final DeckValidator deckValidator; + private final List maindeck = new ArrayList<>(); + private final List sideboard = new ArrayList<>(); + + DeckTester(DeckValidator deckValidator) { + this.deckValidator = deckValidator; + } + + void addMaindeck(String name, int amount) { + maindeck.add(new DeckValidationUtil.CardNameAmount(name, amount)); + } + + void addSideboard(String name, int amount) { + sideboard.add(new DeckValidationUtil.CardNameAmount(name, amount)); + } + + void validate() { + validate(null); + } + + void validate(String message) { + validate(message, true); + } + + void validate(String message, boolean expected) { + boolean valid = DeckValidationUtil.testDeckValid(deckValidator, maindeck, sideboard); + Assert.assertEquals(message != null ? message : deckValidator.getErrorsListInfo(), expected, valid); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java index 04c5c043a5..c7aea177cd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java @@ -1,9 +1,7 @@ package org.mage.test.serverside.deck; -import mage.cards.decks.Deck; import mage.cards.decks.DeckValidator; -import mage.cards.repository.CardInfo; -import mage.cards.repository.CardRepository; +import mage.deck.Commander; import mage.deck.Limited; import mage.deck.Modern; import mage.deck.Standard; @@ -12,68 +10,28 @@ import org.junit.Test; import org.mage.test.serverside.base.MageTestBase; import java.util.ArrayList; -import java.util.List; + +import static org.mage.test.serverside.deck.DeckValidationUtil.testDeckValid; /** * @author LevelX2 */ public class DeckValidatorTest extends MageTestBase { - static class CardNameAmount { - - String name; - String setCode; - String cardNumber; - - int number; - - CardNameAmount(String setCode, int cardNumber, int number) { - this.name = ""; - this.setCode = setCode; - this.cardNumber = String.valueOf(cardNumber); - this.number = number; - } - - CardNameAmount(String name, int number) { - this.name = name; - this.number = number; - } - - public String getName() { - return name; - } - - public int getNumber() { - return number; - } - - String getSetCode() { - return setCode; - } - - String getCardNumber() { - return cardNumber; - } - - } - @Test public void testStandardDeckCardsAmountValid() { - ArrayList deck = new ArrayList<>(); - deck.add(new CardNameAmount("Mountain", 60)); - - DeckValidator validator = new Standard(); - boolean validationSuccessful = testDeckValid(validator, deck); - Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful); + DeckTester deckTester = new DeckTester(new Standard()); + deckTester.addMaindeck("Mountain", 60); + deckTester.validate(); } @Test public void testStandardDeckCardsAmountNotValid() { - ArrayList deck = new ArrayList<>(); - deck.add(new CardNameAmount("Mountain", 59)); + ArrayList deck = new ArrayList<>(); + deck.add(new DeckValidationUtil.CardNameAmount("Mountain", 59)); - ArrayList sideboard = new ArrayList<>(); - sideboard.add(new CardNameAmount("Mountain", 16)); + ArrayList sideboard = new ArrayList<>(); + sideboard.add(new DeckValidationUtil.CardNameAmount("Mountain", 16)); DeckValidator validator = new Standard(); testDeckValid(validator, deck, sideboard); @@ -83,35 +41,46 @@ public class DeckValidatorTest extends MageTestBase { @Test public void testLimitedValid() { - ArrayList deck = new ArrayList<>(); + DeckTester deckTester = new DeckTester(new Limited()); + deckTester.addMaindeck("Counterspell", 4); + deckTester.addMaindeck("Mountain", 36); - deck.add(new CardNameAmount("Counterspell", 4)); - deck.add(new CardNameAmount("Mountain", 36)); - - Assert.assertTrue("Deck should be valid", testDeckValid(new Limited(), deck)); + deckTester.validate("Deck should be valid"); } @Test public void testLimitedNotValidToLessCards() { - ArrayList deckList = new ArrayList<>(); + DeckTester deckTester = new DeckTester(new Limited()); - deckList.add(new CardNameAmount("Counterspell", 4)); - deckList.add(new CardNameAmount("Mountain", 35)); + deckTester.addMaindeck("Counterspell", 4); + deckTester.addMaindeck("Mountain", 35); - Assert.assertFalse("Deck should not be valid", testDeckValid(new Limited(), deckList)); + deckTester.validate("Deck should not be valid", false); } @Test public void testModern1() { - ArrayList deckList = new ArrayList<>(); + DeckTester deckTester = new DeckTester(new Modern()); - deckList.add(new CardNameAmount("Counterspell", 5)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckTester.addMaindeck("Counterspell", 5); + deckTester.addMaindeck("Mountain", 56); - Assert.assertFalse("only 4 of a card are allowed", testDeckValid(new Modern(), deckList)); + deckTester.validate("only 4 of a card are allowed", false); } - private void assertCounterspellValid(ArrayList deckList) { + @Test + public void testGristCommander() { + // Grist, the Hunger Tide can be your commander as its first ability applies during deck construction. + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 49); + deckTester.addMaindeck("Swamp", 50); + + deckTester.addSideboard("Grist, the Hunger Tide", 1); + + deckTester.validate("Grist should be legal as a commander"); + } + + private void assertCounterspellValid(ArrayList deckList) { final boolean needValid = true; // card valid after Modern Horizons 2 boolean valid = testDeckValid(new Modern(), deckList); if (valid != needValid) { @@ -123,113 +92,113 @@ public class DeckValidatorTest extends MageTestBase { public void testModernCounterspell1() { // if card is legal in any set then it must be legal in all other sets too - ArrayList deckList = new ArrayList<>(); - deckList.add(new CardNameAmount("JVC", 24, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + ArrayList deckList = new ArrayList<>(); + deckList.add(new DeckValidationUtil.CardNameAmount("JVC", 24, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("6ED", 61, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("6ED", 61, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("5ED", 77, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("5ED", 77, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("4ED", 65, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("4ED", 65, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("G00", 1, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("G00", 1, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("DD2", 24, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("DD2", 24, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("ICE", 64, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("ICE", 64, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("F05", 11, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("F05", 11, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("LEA", 54, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("LEA", 54, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("LEB", 55, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("LEB", 55, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("ME4", 45, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("ME4", 45, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("ME2", 44, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("ME2", 44, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("S99", 34, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("S99", 34, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("7ED", 67, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("7ED", 67, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("3ED", 54, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("3ED", 54, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("MMQ", 69, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("MMQ", 69, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("VMA", 64, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("VMA", 64, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("2ED", 55, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("2ED", 55, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("TPR", 43, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("TPR", 43, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("TMP", 57, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("TMP", 57, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("MH2", 267, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("MH2", 267, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertCounterspellValid(deckList); } - private void assertPsychatogValid(ArrayList deckList) { + private void assertPsychatogValid(ArrayList deckList) { // if that card will be valid in modern then you must replace it with another non valid card // google for "Cards Wizards Should Reprint for Modern" final boolean needValid = false; @@ -242,174 +211,137 @@ public class DeckValidatorTest extends MageTestBase { @Test public void testModernPsychatog() { // test non valid card - ArrayList deckList = new ArrayList<>(); - deckList.add(new CardNameAmount("ODY", 292, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + ArrayList deckList = new ArrayList<>(); + deckList.add(new DeckValidationUtil.CardNameAmount("ODY", 292, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertPsychatogValid(deckList); deckList.clear(); - deckList.add(new CardNameAmount("VMA", 258, 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("VMA", 258, 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); assertPsychatogValid(deckList); } @Test public void testModernBanned() { - ArrayList deckList = new ArrayList<>(); + ArrayList deckList = new ArrayList<>(); DeckValidator validator = new Modern(); - deckList.add(new CardNameAmount("Ancestral Vision", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Ancestral Vision", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); boolean validationSuccessful = testDeckValid(validator, deckList); Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Ancient Den", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Ancient Den", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); - deckList.add(new CardNameAmount("Birthing Pod", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Birthing Pod", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Blazing Shoal", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Blazing Shoal", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Bloodbraid Elf", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Bloodbraid Elf", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Chrome Mox", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Chrome Mox", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Cloudpost", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Cloudpost", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Dark Depths", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Dark Depths", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Deathrite Shaman", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Deathrite Shaman", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Dig Through Time", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Dig Through Time", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Dread Return", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Dread Return", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Glimpse of Nature", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Glimpse of Nature", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Great Furnace", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Great Furnace", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Green Sun's Zenith", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Green Sun's Zenith", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Hypergenesis", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Hypergenesis", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Jace, the Mind Sculptor", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Jace, the Mind Sculptor", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); deckList.clear(); - deckList.add(new CardNameAmount("Mental Misstep", 4)); - deckList.add(new CardNameAmount("Mountain", 56)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mental Misstep", 4)); + deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56)); validationSuccessful = testDeckValid(validator, deckList); Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful); validator.getErrorsList().clear(); } - - private boolean testDeckValid(DeckValidator validator, List cards) { - return testDeckValid(validator, cards, null); - } - - private boolean testDeckValid(DeckValidator validator, List cards, List cardsSideboard) { - Deck deckToTest = new Deck(); - if (cards != null) { - for (CardNameAmount cardNameAmount : cards) { - CardInfo cardinfo; - if (cardNameAmount.getName().isEmpty()) { - cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber()); - } else { - cardinfo = CardRepository.instance.findCard(cardNameAmount.getName()); - } - for (int i = 0; i < cardNameAmount.getNumber(); i++) { - assert cardinfo != null; - deckToTest.getCards().add(cardinfo.getCard()); - } - } - } - if (cardsSideboard != null) { - for (CardNameAmount cardNameAmount : cardsSideboard) { - CardInfo cardinfo; - if (cardNameAmount.getName().isEmpty()) { - cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber()); - } else { - cardinfo = CardRepository.instance.findCard(cardNameAmount.getName()); - } - for (int i = 0; i < cardNameAmount.getNumber(); i++) { - assert cardinfo != null; - deckToTest.getSideboard().add(cardinfo.getCard()); - } - } - } - return validator.validate(deckToTest); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java index 3fc3217c60..c8f4088933 100644 --- a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java @@ -154,8 +154,8 @@ public class BoosterGenerationTest extends MageTestBase { Assert.assertTrue( "Slot 12 is colorless (" + booster.get(11).getName() + ')', booster.get(11).getColor(null).isColorless() - || booster.get(11).isLand() - || booster.get(11).isArtifact() + || booster.get(11).isLand(currentGame) + || booster.get(11).isArtifact(currentGame) ); Assert.assertEquals("Slot 15 is from FMB1 set", "FMB1", booster.get(14).getExpansionSetCode()); @@ -221,11 +221,11 @@ public class BoosterGenerationTest extends MageTestBase { for (int i = 0; i < 50; i++) { List booster = CoreSet2019.getInstance().createBooster(); // check that booster contains a land card - assertTrue(booster.stream().anyMatch(card -> card.getCardType().contains(CardType.LAND))); + assertTrue(booster.stream().anyMatch(card -> card.getCardType(currentGame).contains(CardType.LAND))); allCards.addAll(booster); } // check that some dual lands were generated - assertTrue(allCards.stream().anyMatch(card -> card.getCardType().contains(CardType.LAND) && Objects.equals(card.getRarity(), Rarity.COMMON))); + assertTrue(allCards.stream().anyMatch(card -> card.getCardType(currentGame).contains(CardType.LAND) && Objects.equals(card.getRarity(), Rarity.COMMON))); } @Test @@ -233,7 +233,7 @@ public class BoosterGenerationTest extends MageTestBase { for (int i = 0; i < 10; i++) { List booster = WarOfTheSpark.getInstance().createBooster(); // check that booster contains a planeswalker - assertTrue(booster.stream().anyMatch(MageObject::isPlaneswalker)); + assertTrue(booster.stream().anyMatch(card -> card.isPlaneswalker(currentGame))); } } @@ -242,7 +242,7 @@ public class BoosterGenerationTest extends MageTestBase { for (int i = 0; i < 10; i++) { List booster = Dominaria.getInstance().createBooster(); // check that booster contains legendary creature - assertTrue(booster.stream().anyMatch(card -> card.isCreature() && card.isLegendary())); + assertTrue(booster.stream().anyMatch(card -> card.isCreature(currentGame) && card.isLegendary())); } } @@ -274,7 +274,7 @@ public class BoosterGenerationTest extends MageTestBase { public void testBattlebond_BoosterMustHaveOneLand() { for (int i = 0; i < 10; i++) { List booster = Battlebond.getInstance().createBooster(); - assertTrue("battlebond's booster must contain 1 land", booster.stream().anyMatch(card -> card.isBasic() && card.isLand())); + assertTrue("battlebond's booster must contain 1 land", booster.stream().anyMatch(card -> card.isBasic() && card.isLand(currentGame))); } } @@ -290,7 +290,7 @@ public class BoosterGenerationTest extends MageTestBase { assertFalse(str(booster), contains(booster, basics, null)); // special lands in land slot (can have multiple special lands per booster: one from land slot, one from common slot) - List boosterLands = booster.stream().filter(card -> !card.isBasic() && card.isLand()).collect(Collectors.toList()); + List boosterLands = booster.stream().filter(card -> !card.isBasic() && card.isLand(currentGame)).collect(Collectors.toList()); Assert.assertTrue("Amonkhet Remastered's booster must contains minimum 1 special land", boosterLands.size() >= 1); // Regal Caracal is top-boxer card, not booster @@ -358,7 +358,7 @@ public class BoosterGenerationTest extends MageTestBase { booster.stream().map(Card::getRarity).filter(Rarity.UNCOMMON::equals).count() ); - List snowLands = booster.stream().filter(card -> card.isSnow() && card.isLand()).collect(Collectors.toList()); + List snowLands = booster.stream().filter(card -> card.isSnow() && card.isLand(currentGame)).collect(Collectors.toList()); switch (snowLands.size()) { case 0: fail("Booster must have snow lands"); diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index ebc9e54894..0edcd4fa92 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -915,7 +915,7 @@ public class VerifyCardDataTest { Assert.assertNotNull(card); // CHECK: all planeswalkers must be legendary - if (card.getCardType().contains(CardType.PLANESWALKER) && !card.getSuperType().contains(SuperType.LEGENDARY)) { + if (card.isPlaneswalker() && !card.getSuperType().contains(SuperType.LEGENDARY)) { errorsList.add("Error: planeswalker must have legendary type: " + set.getCode() + " - " + set.getName() + " - " + card.getName() + " - " + card.getCardNumber()); } @@ -1335,7 +1335,7 @@ public class VerifyCardDataTest { } // spells have only 1 ability - if (card.isSorcery() || card.isInstant()) { + if (card.isInstantOrSorcery()) { return; } diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index b95615cb15..9b9cced81a 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -33,7 +33,17 @@ public interface MageObject extends MageItem, Serializable { void setName(String name); - ArrayList getCardType(); + default List getCardType() { + return getCardType(null); + } + + /** + * Return dynamic card types (game isn't null) or static card types (game is null) + * + * @param game can be null + * @return + */ + List getCardType(Game game); /** * Return original object's subtypes @@ -141,52 +151,92 @@ public interface MageObject extends MageItem, Serializable { void setZoneChangeCounter(int value, Game game); - default boolean isHistoric() { - return getCardType().contains(CardType.ARTIFACT) + default boolean isHistoric(Game game) { + return getCardType(game).contains(CardType.ARTIFACT) || getSuperType().contains(SuperType.LEGENDARY) - || getSubtype().contains(SubType.SAGA); + || hasSubtype(SubType.SAGA, game); } default boolean isCreature() { - return getCardType().contains(CardType.CREATURE); + return isCreature(null); + } + + default boolean isCreature(Game game) { + return getCardType(game).contains(CardType.CREATURE); } default boolean isArtifact() { - return getCardType().contains(CardType.ARTIFACT); + return isArtifact(null); + } + + default boolean isArtifact(Game game) { + return getCardType(game).contains(CardType.ARTIFACT); } default boolean isLand() { - return getCardType().contains(CardType.LAND); + return isLand(null); + } + + default boolean isLand(Game game) { + return getCardType(game).contains(CardType.LAND); } default boolean isEnchantment() { - return getCardType().contains(CardType.ENCHANTMENT); + return isEnchantment(null); + } + + default boolean isEnchantment(Game game) { + return getCardType(game).contains(CardType.ENCHANTMENT); } default boolean isInstant() { - return getCardType().contains(CardType.INSTANT); + return isInstant(null); + } + + default boolean isInstant(Game game) { + return getCardType(game).contains(CardType.INSTANT); } default boolean isSorcery() { - return getCardType().contains(CardType.SORCERY); + return isSorcery(null); + } + + default boolean isSorcery(Game game) { + return getCardType(game).contains(CardType.SORCERY); } default boolean isInstantOrSorcery() { return this.isInstant() || this.isSorcery(); } + default boolean isInstantOrSorcery(Game game) { + return this.isInstant(game) || this.isSorcery(game); + } + default boolean isPlaneswalker() { - return getCardType().contains(CardType.PLANESWALKER); + return isPlaneswalker(null); + } + + default boolean isPlaneswalker(Game game) { + return getCardType(game).contains(CardType.PLANESWALKER); } default boolean isTribal() { - return getCardType().contains(CardType.TRIBAL); + return isTribal(null); + } + + default boolean isTribal(Game game) { + return getCardType(game).contains(CardType.TRIBAL); } default boolean isPermanent() { return isCreature() || isArtifact() || isPlaneswalker() || isEnchantment() || isLand(); } + default boolean isPermanent(Game game) { + return isCreature(game) || isArtifact(game) || isPlaneswalker(game) || isEnchantment(game) || isLand(game); + } + default boolean isLegendary() { return getSuperType().contains(SuperType.LEGENDARY); } @@ -210,11 +260,69 @@ public interface MageObject extends MageItem, Serializable { return getSuperType().contains(SuperType.WORLD); } - default void addCardType(CardType cardType) { - if (getCardType().contains(cardType)) { - return; + /** + * Add card type from static effects (permanently) + * + * @param cardTypes + */ + default void addCardType(CardType... cardTypes) { + addCardType(null, cardTypes); + } + + /** + * Add card type from dynamic effects (game isn't null) and from static effects (game is null) + * + * @param game + * @param cardTypes + */ + default void addCardType(Game game, CardType... cardTypes) { + List currentCardTypes; + if (game != null) { + // dynamic + currentCardTypes = game.getState().getCreateMageObjectAttribute(this, game).getCardType(); + } else { + // static + currentCardTypes = getCardType(); } - getCardType().add(cardType); + for (CardType cardType : cardTypes) { + if (!currentCardTypes.contains(cardType)) { + currentCardTypes.add(cardType); + } + } + } + + default void removeCardType(CardType... cardTypes) { + removeCardType(null, cardTypes); + } + + default void removeCardType(Game game, CardType... cardTypes) { + List currentCardTypes; + if (game != null) { + // dynamic + currentCardTypes = game.getState().getCreateMageObjectAttribute(this, game).getCardType(); + } else { + // static + currentCardTypes = getCardType(); + } + for (CardType cardType : cardTypes) { + currentCardTypes.remove(cardType); + } + } + + default void removeAllCardTypes() { + removeAllCardTypes(null); + } + + default void removeAllCardTypes(Game game) { + List currentCardTypes; + if (game != null) { + // dynamic + currentCardTypes = game.getState().getCreateMageObjectAttribute(this, game).getCardType(); + } else { + // static + currentCardTypes = getCardType(); + } + currentCardTypes.clear(); } /** @@ -251,7 +359,7 @@ public interface MageObject extends MageItem, Serializable { */ default void addSubType(Game game, SubType... subTypes) { for (SubType subType : subTypes) { - if (subType.canGain(this) + if (subType.canGain(game, this) && !hasSubtype(subType, game)) { game.getState().getCreateMageObjectAttribute(this, game).getSubtype().add(subType); } @@ -326,20 +434,21 @@ public interface MageObject extends MageItem, Serializable { * Checks whether two cards share card types. * * @param otherCard + * @param game * @return */ - default boolean shareTypes(Card otherCard) { - return this.shareTypes(otherCard, false); + default boolean shareTypes(Card otherCard, Game game) { + return this.shareTypes(otherCard, game, false); } - default boolean shareTypes(Card otherCard, boolean permanentOnly) { + default boolean shareTypes(Card otherCard, Game game, boolean permanentOnly) { if (otherCard == null) { throw new IllegalArgumentException("Params can't be null"); } - for (CardType type : getCardType()) { - if (otherCard.getCardType().contains(type) + for (CardType type : getCardType(game)) { + if (otherCard.getCardType(game).contains(type) && (!permanentOnly || type.isPermanentType())) { return true; } @@ -349,10 +458,10 @@ public interface MageObject extends MageItem, Serializable { } default boolean shareCreatureTypes(Game game, MageObject otherCard) { - if (!isCreature() && !isTribal()) { + if (!isCreature(game) && !isTribal(game)) { return false; } - if (!otherCard.isCreature() && !otherCard.isTribal()) { + if (!otherCard.isCreature(game) && !otherCard.isTribal(game)) { return false; } boolean isAllA = this.isAllCreatureTypes(game); @@ -392,10 +501,6 @@ public interface MageObject extends MageItem, Serializable { */ void setIsAllCreatureTypes(Game game, boolean value); - default void addCardTypes(ArrayList cardType) { - getCardType().addAll(cardType); - } - List getTextParts(); TextPart addTextPart(TextPart textPart); diff --git a/Mage/src/main/java/mage/MageObjectImpl.java b/Mage/src/main/java/mage/MageObjectImpl.java index ea5f0c9803..ffbcdcd9e9 100644 --- a/Mage/src/main/java/mage/MageObjectImpl.java +++ b/Mage/src/main/java/mage/MageObjectImpl.java @@ -36,7 +36,7 @@ public abstract class MageObjectImpl implements MageObject { protected ObjectColor color; protected ObjectColor frameColor; protected FrameStyle frameStyle; - protected ArrayList cardType = new ArrayList<>(); + protected List cardType = new ArrayList<>(); protected SubTypes subtype = new SubTypes(); protected Set supertype = EnumSet.noneOf(SuperType.class); protected Abilities abilities; @@ -114,7 +114,16 @@ public abstract class MageObjectImpl implements MageObject { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { + if (game != null) { + // dynamic + MageObjectAttribute mageObjectAttribute = game.getState().getMageObjectAttribute(getId()); + if (mageObjectAttribute != null) { + return mageObjectAttribute.getCardType(); + } + } + + // static return cardType; } @@ -202,7 +211,7 @@ public abstract class MageObjectImpl implements MageObject { public ObjectColor getFrameColor(Game game) { // For lands, add any colors of mana the land can produce to // its frame colors while game is active to represent ability changes during the game. - if (this.isLand() && !(this instanceof MockCard)) { + if (this.isLand(game) && !(this instanceof MockCard)) { ObjectColor cl = frameColor.copy(); Set manaTypes = EnumSet.noneOf(ManaType.class); for (Ability ab : getAbilities()) { @@ -294,9 +303,6 @@ public abstract class MageObjectImpl implements MageObject { @Override public boolean isAllCreatureTypes(Game game) { - if (game == null) { - return this.getAbilities().containsClass(ChangelingAbility.class); - } return this.getSubtype(game).isAllCreatureTypes(); } @@ -307,7 +313,7 @@ public abstract class MageObjectImpl implements MageObject { @Override public void setIsAllCreatureTypes(Game game, boolean value) { - this.getSubtype(game).setIsAllCreatureTypes(value && (this.isTribal() || this.isCreature())); + this.getSubtype(game).setIsAllCreatureTypes(value && (this.isTribal(game) || this.isCreature(game))); } @Override diff --git a/Mage/src/main/java/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/main/java/mage/abilities/TriggeredAbilityImpl.java index 3f81d96a84..5e9f3a3f6e 100644 --- a/Mage/src/main/java/mage/abilities/TriggeredAbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/TriggeredAbilityImpl.java @@ -281,7 +281,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge } if (sourceObject == null) { // source is no permanent sourceObject = game.getObject(source.getSourceId()); - if (sourceObject == null || sourceObject.isPermanent()) { + if (sourceObject == null || sourceObject.isPermanent(game)) { return false; // No source object found => ability is not valid } } diff --git a/Mage/src/main/java/mage/abilities/abilityword/ConstellationAbility.java b/Mage/src/main/java/mage/abilities/abilityword/ConstellationAbility.java index 1c5a4b23f5..65f346a0e6 100644 --- a/Mage/src/main/java/mage/abilities/abilityword/ConstellationAbility.java +++ b/Mage/src/main/java/mage/abilities/abilityword/ConstellationAbility.java @@ -53,7 +53,7 @@ public class ConstellationAbility extends TriggeredAbilityImpl { return false; } Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && ((thisOr && permanent.getId().equals(getSourceId())) || permanent.isEnchantment()); + return permanent != null && ((thisOr && permanent.getId().equals(getSourceId())) || permanent.isEnchantment(game)); } @Override diff --git a/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java index 70e397ab4a..9d5c0ba656 100644 --- a/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java @@ -44,7 +44,7 @@ public class ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility extends Triggere return false; } Permanent permanent = stackAbility.getSourcePermanentOrLKI(game); - if (permanent == null || !permanent.isPlaneswalker() + if (permanent == null || !permanent.isPlaneswalker(game) || !permanent.hasSubtype(planeswalkerSubType, game)) { return false; } diff --git a/Mage/src/main/java/mage/abilities/common/AttachedToCreatureSourceTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AttachedToCreatureSourceTriggeredAbility.java index b6d216230b..6e76ef3cef 100644 --- a/Mage/src/main/java/mage/abilities/common/AttachedToCreatureSourceTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AttachedToCreatureSourceTriggeredAbility.java @@ -30,7 +30,7 @@ public class AttachedToCreatureSourceTriggeredAbility extends TriggeredAbilityIm @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent attachedPermanent = game.getPermanent(event.getTargetId()); - return attachedPermanent != null && attachedPermanent.isCreature(); + return attachedPermanent != null && attachedPermanent.isCreature(game); } @Override diff --git a/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java index b5991cf2e4..9e543e4839 100644 --- a/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java @@ -66,7 +66,7 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl { check = true; } else { Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null && planeswalker.isPlaneswalker() && planeswalker.isControlledBy(getControllerId())) { + if (planeswalker != null && planeswalker.isPlaneswalker(game) && planeswalker.isControlledBy(getControllerId())) { check = true; } } diff --git a/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java index 221bee4e57..7c48f31d73 100644 --- a/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BecomesMonstrousTriggeredAbility.java @@ -35,7 +35,7 @@ public class BecomesMonstrousTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isCreature() + if (permanent != null && permanent.isCreature(game) && (permanent.isControlledBy(getControllerId()))) { this.getEffects().setTargetPointer(new FixedTarget(permanent, game)); return true; diff --git a/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java index a274a331ef..21f8db2402 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToACreatureTriggeredAbility.java @@ -46,7 +46,7 @@ public class DealsCombatDamageToACreatureTriggeredAbility extends TriggeredAbili public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent == null - || !permanent.isCreature() + || !permanent.isCreature(game) || !event.getSourceId().equals(this.sourceId) || !((DamagedEvent) event).isCombatDamage()) { return false; diff --git a/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java index dd9bb2a0b8..65b13cdb0b 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java @@ -78,7 +78,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility case DAMAGED_PERMANENT: Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent == null - || !permanent.isPlaneswalker() + || !permanent.isPlaneswalker(game) || !orPlaneswalker) { return false; } diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAllTriggeredAbility.java index 7d5e8dea3b..2605079f2a 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToACreatureAllTriggeredAbility.java @@ -62,7 +62,7 @@ public class DealsDamageToACreatureAllTriggeredAbility extends TriggeredAbilityI @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null || !permanent.isCreature()) { + if (permanent == null || !permanent.isCreature(game)) { return false; } if (combatDamageOnly && !((DamagedEvent) event).isCombatDamage()) { diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerTriggeredAbility.java index 775b7db563..8782e9677a 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerTriggeredAbility.java @@ -56,7 +56,7 @@ public class DealsDamageToAPlayerTriggeredAbility extends TriggeredAbilityImpl { if (event.getType() == GameEvent.EventType.DAMAGED_PERMANENT) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent == null - || !permanent.isPlaneswalker() + || !permanent.isPlaneswalker(game) || !orPlaneswalker) { return false; } diff --git a/Mage/src/main/java/mage/abilities/common/DestroyPlaneswalkerWhenDamagedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DestroyPlaneswalkerWhenDamagedTriggeredAbility.java index 4e31e7ec9a..39a1141745 100644 --- a/Mage/src/main/java/mage/abilities/common/DestroyPlaneswalkerWhenDamagedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DestroyPlaneswalkerWhenDamagedTriggeredAbility.java @@ -45,7 +45,7 @@ public class DestroyPlaneswalkerWhenDamagedTriggeredAbility extends TriggeredAbi return false; } boolean applies = filter != null ? - permanent.isPlaneswalker() && filter.match(permanent, game) : event.getSourceId().equals(getSourceId()); + permanent.isPlaneswalker(game) && filter.match(permanent, game) : event.getSourceId().equals(getSourceId()); if (applies) { Effect effect = new DestroyTargetEffect(); effect.setTargetPointer(new FixedTarget(event.getTargetId(), game)); diff --git a/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java index 8598ec694e..7cb042cdd3 100644 --- a/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ExertCreatureControllerTriggeredAbility.java @@ -29,7 +29,7 @@ public class ExertCreatureControllerTriggeredAbility extends TriggeredAbilityImp public boolean checkTrigger(GameEvent event, Game game) { boolean weAreExerting = isControlledBy(event.getPlayerId()); Permanent exerted = game.getPermanent(event.getTargetId()); - boolean exertedIsCreature = (exerted != null) && exerted.isCreature(); + boolean exertedIsCreature = (exerted != null) && exerted.isCreature(game); return weAreExerting && exertedIsCreature; } diff --git a/Mage/src/main/java/mage/abilities/common/LandfallAbility.java b/Mage/src/main/java/mage/abilities/common/LandfallAbility.java index 7a70ab640d..0a3ec3f518 100644 --- a/Mage/src/main/java/mage/abilities/common/LandfallAbility.java +++ b/Mage/src/main/java/mage/abilities/common/LandfallAbility.java @@ -49,7 +49,7 @@ public class LandfallAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isLand() + && permanent.isLand(game) && permanent.isControlledBy(this.controllerId)) { triggeringLand = permanent; if (setTargetPointer == SetTargetPointer.PERMANENT) { diff --git a/Mage/src/main/java/mage/abilities/common/LicidAbility.java b/Mage/src/main/java/mage/abilities/common/LicidAbility.java index 96fd32d097..18462b1ce5 100644 --- a/Mage/src/main/java/mage/abilities/common/LicidAbility.java +++ b/Mage/src/main/java/mage/abilities/common/LicidAbility.java @@ -107,8 +107,8 @@ class LicidContinuousEffect extends ContinuousEffectImpl { if (licid != null) { switch (layer) { case TypeChangingEffects_4: - licid.getCardType().clear(); - licid.addCardType(CardType.ENCHANTMENT); + licid.removeAllCardTypes(game); + licid.addCardType(game, CardType.ENCHANTMENT); licid.removeAllSubTypes(game); licid.addSubType(game, SubType.AURA); break; diff --git a/Mage/src/main/java/mage/abilities/common/MagecraftAbility.java b/Mage/src/main/java/mage/abilities/common/MagecraftAbility.java index f88fe3a48c..fb0b6d1aab 100644 --- a/Mage/src/main/java/mage/abilities/common/MagecraftAbility.java +++ b/Mage/src/main/java/mage/abilities/common/MagecraftAbility.java @@ -37,7 +37,7 @@ public class MagecraftAbility extends TriggeredAbilityImpl { Spell spell = game.getSpell(event.getTargetId()); if (spell == null || !spell.isControlledBy(getControllerId()) - || !spell.isInstantOrSorcery()) { + || !spell.isInstantOrSorcery(game)) { return false; } getEffects().setValue(SPELL_KEY, spell); diff --git a/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredAbility.java index 0711302f1e..cb7092cf1a 100644 --- a/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredAbility.java @@ -48,7 +48,7 @@ public class TapLandForManaAllTriggeredAbility extends TriggeredAbilityImpl { permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); } - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { if (setTargetPointer) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game)); } diff --git a/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredManaAbility.java b/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredManaAbility.java index 53526c7182..ed8f9677ae 100644 --- a/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredManaAbility.java +++ b/Mage/src/main/java/mage/abilities/common/TapLandForManaAllTriggeredManaAbility.java @@ -36,7 +36,7 @@ public class TapLandForManaAllTriggeredManaAbility extends TriggeredManaAbility @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && permanent.isLand()) { + if (permanent != null && permanent.isLand(game)) { if (setTargetPointer) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game)); } diff --git a/Mage/src/main/java/mage/abilities/condition/common/EnchantedSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EnchantedSourceCondition.java index c483023f88..bef982778c 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EnchantedSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EnchantedSourceCondition.java @@ -30,7 +30,7 @@ public class EnchantedSourceCondition implements Condition { if (permanent != null) { for (UUID uuid : permanent.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached != null && attached.isEnchantment()) { + if (attached != null && attached.isEnchantment(game)) { if (++numberOfFoundEnchantments >= numberOfEnchantments) { return true; } diff --git a/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java index 8eff5fb51d..194d50af4d 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java @@ -23,7 +23,7 @@ public enum EnchantedTargetCondition implements Condition { if (targetPermanent != null) { for (UUID uuid : targetPermanent.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached != null && attached.isEnchantment()) { + if (attached != null && attached.isEnchantment(game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java index af25b6b624..82ef4ea735 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java @@ -18,6 +18,6 @@ instance; @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - return object != null && !object.isLand(); + return object != null && !object.isLand(game); } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/TargetHasCardTypeCondition.java b/Mage/src/main/java/mage/abilities/condition/common/TargetHasCardTypeCondition.java index 67a02f25c0..c473fcc611 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/TargetHasCardTypeCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/TargetHasCardTypeCondition.java @@ -23,7 +23,7 @@ public class TargetHasCardTypeCondition implements Condition { if (!source.getTargets().isEmpty()) { MageObject mageObject = game.getObject(source.getFirstTarget()); if (mageObject != null) { - return mageObject.getCardType().contains(cardType); + return mageObject.getCardType(game).contains(cardType); } } return false; diff --git a/Mage/src/main/java/mage/abilities/condition/common/TopLibraryCardTypeCondition.java b/Mage/src/main/java/mage/abilities/condition/common/TopLibraryCardTypeCondition.java index 673abcee95..48ad13754c 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/TopLibraryCardTypeCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/TopLibraryCardTypeCondition.java @@ -27,13 +27,13 @@ public class TopLibraryCardTypeCondition implements Condition { if (card != null) { switch (this.type) { case CREATURE: - return card.isCreature(); + return card.isCreature(game); case LAND: - return card.isLand(); + return card.isLand(game); case SORCERY: - return card.isSorcery(); + return card.isSorcery(game); case INSTANT: - return card.isInstant(); + return card.isInstant(game); } } } diff --git a/Mage/src/main/java/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java b/Mage/src/main/java/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java index 62d12aeaad..94e1e91fd0 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java @@ -42,7 +42,7 @@ public class ExileTopCreatureCardOfGraveyardCost extends CostImpl { if(controller != null) { Card topCard = null; for (Card card :controller.getGraveyard().getCards(game)) { - if (card.isCreature()) { + if (card.isCreature(game)) { topCard = card; } } diff --git a/Mage/src/main/java/mage/abilities/costs/common/TapSourceCost.java b/Mage/src/main/java/mage/abilities/costs/common/TapSourceCost.java index 7966f7eb16..3538934072 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/TapSourceCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/TapSourceCost.java @@ -37,7 +37,7 @@ public class TapSourceCost extends CostImpl { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { return !permanent.isTapped() - && (permanent.canTap() || null != game.getContinuousEffects().asThough(source.getSourceId(), AsThoughEffectType.ACTIVATE_HASTE, ability, controllerId, game)); + && (permanent.canTap(game) || null != game.getContinuousEffects().asThough(source.getSourceId(), AsThoughEffectType.ACTIVATE_HASTE, ability, controllerId, game)); } return false; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/UntapSourceCost.java b/Mage/src/main/java/mage/abilities/costs/common/UntapSourceCost.java index 1eef97fb7f..03706c6a43 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/UntapSourceCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/UntapSourceCost.java @@ -36,7 +36,7 @@ public class UntapSourceCost extends CostImpl { public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - return permanent.isTapped() && (permanent.canTap() || null != game.getContinuousEffects().asThough(source.getSourceId(), AsThoughEffectType.ACTIVATE_HASTE, ability, controllerId, game)); + return permanent.isTapped() && (permanent.canTap(game) || null != game.getContinuousEffects().asThough(source.getSourceId(), AsThoughEffectType.ACTIVATE_HASTE, ability, controllerId, game)); } return false; } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypeAssignment.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypeAssignment.java index f1f66cd07e..0541f1db85 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypeAssignment.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypeAssignment.java @@ -18,7 +18,7 @@ public class CardTypeAssignment extends RoleAssignment { protected Set makeSet(Card card, Game game) { return attributes .stream() - .filter(subType -> card.getCardType().contains(subType)) + .filter(subType -> card.getCardType(game).contains(subType)) .collect(Collectors.toSet()); } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypesInGraveyardCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypesInGraveyardCount.java index b30958623a..2a72306dc7 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypesInGraveyardCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CardTypesInGraveyardCount.java @@ -1,6 +1,5 @@ package mage.abilities.dynamicvalue.common; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; @@ -31,7 +30,7 @@ public enum CardTypesInGraveyardCount implements DynamicValue { public int calculate(Game game, Ability sourceAbility, Effect effect) { return getStream(game, sourceAbility) .filter(card -> !card.isCopy() && !(card instanceof PermanentToken)) - .map(MageObject::getCardType) + .map(card -> card.getCardType(game)) .flatMap(Collection::stream) .distinct() .mapToInt(x -> 1) diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java index accaf56ad6..ee7c48b8b2 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/InstantSorceryExileGraveyardCount.java @@ -20,7 +20,7 @@ public enum InstantSorceryExileGraveyardCount implements DynamicValue { if (player != null) { int exileCount = 0; for (Card exiledCard : game.getExile().getAllCards(game)) { - if (exiledCard.getOwnerId().equals(player.getId()) && exiledCard.isInstantOrSorcery()) { + if (exiledCard.getOwnerId().equals(player.getId()) && exiledCard.isInstantOrSorcery(game)) { exileCount++; } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java index e9ee81f4ce..1092838b5e 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java @@ -41,7 +41,7 @@ public class ParleyCount implements DynamicValue, MageSingleton { if (player != null) { Card card = player.getLibrary().getFromTop(game); if (card != null) { - if (!card.isLand()) { + if (!card.isLand(game)) { parleyValue++; } player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', new CardsImpl(card), game); diff --git a/Mage/src/main/java/mage/abilities/effects/ApplyCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/ApplyCountersEffect.java index 3d287de846..087b591b5f 100644 --- a/Mage/src/main/java/mage/abilities/effects/ApplyCountersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/ApplyCountersEffect.java @@ -35,7 +35,7 @@ public class ApplyCountersEffect extends ContinuousEffectImpl { } } if (layer == Layer.PTChangingEffects_7 && sublayer == SubLayer.Counters_7d) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE, game)) { for (BoostCounter counter : permanent.getCounters(game).getBoostCounters()) { permanent.addPower(counter.getPower() * counter.getCount()); permanent.addToughness(counter.getToughness() * counter.getCount()); diff --git a/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java b/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java index 38db6d30f3..6f9cb6d834 100644 --- a/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java +++ b/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java @@ -85,7 +85,7 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements if (card == null || player == null) { return false; } - if (!card.isLand()) { + if (!card.isLand(game)) { if (card instanceof SplitCard) { Card leftCard = ((SplitCard) card).getLeftHalfCard(); player.setCastSourceIdWithAlternateMana(leftCard.getId(), null, leftCard.getSpellAbility().getCosts()); diff --git a/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java b/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java index 55a60146d5..0aaa523f80 100644 --- a/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java @@ -67,7 +67,7 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null) { firstCardFace = card; card = card.getSecondCardFace(); - if (!card.isEnchantment() || !card.hasSubtype(SubType.AURA, game)) { + if (!card.isEnchantment(game) || !card.hasSubtype(SubType.AURA, game)) { return false; } } @@ -205,11 +205,11 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { if (((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD && (((ZoneChangeEvent) event).getFromZone() != Zone.STACK)) { Card card = game.getCard(event.getTargetId()); - return card != null && (card.isEnchantment() && card.hasSubtype(SubType.AURA, game) + return card != null && (card.isEnchantment(game) && card.hasSubtype(SubType.AURA, game) || // in case of transformable enchantments (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null && card.getSecondCardFace() != null - && card.getSecondCardFace().isEnchantment() + && card.getSecondCardFace().isEnchantment(game) && card.getSecondCardFace().hasSubtype(SubType.AURA, game))); } return false; diff --git a/Mage/src/main/java/mage/abilities/effects/EquipEffect.java b/Mage/src/main/java/mage/abilities/effects/EquipEffect.java index 1a4b6ed17a..392713bbf7 100644 --- a/Mage/src/main/java/mage/abilities/effects/EquipEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/EquipEffect.java @@ -26,7 +26,7 @@ public class EquipEffect extends AttachEffect { // state-based action. See rule 704.) An Equipment can’t equip more than one creature. If a spell or ability // would cause an Equipment to equip more than one creature, the Equipment’s controller chooses which creature // it equips. - if (sourcePermanent != null && sourcePermanent.hasSubtype(SubType.EQUIPMENT, game) && !sourcePermanent.isCreature()) { + if (sourcePermanent != null && sourcePermanent.hasSubtype(SubType.EQUIPMENT, game) && !sourcePermanent.isCreature(game)) { return super.apply(game, source); } return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java index ca4b712d1b..d71a124649 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java @@ -99,9 +99,9 @@ public class CopyEffect extends ContinuousEffectImpl { permanent.getColor(game).setColor(copyFromObject.getColor(game)); permanent.getManaCost().clear(); permanent.getManaCost().add(copyFromObject.getManaCost()); - permanent.getCardType().clear(); - for (CardType type : copyFromObject.getCardType()) { - permanent.addCardType(type); + permanent.removeAllCardTypes(game); + for (CardType type : copyFromObject.getCardType(game)) { + permanent.addCardType(game, type); } permanent.removeAllSubTypes(game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopyTokenEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopyTokenEffect.java index f50173c6a9..cdb21f57a2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyTokenEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyTokenEffect.java @@ -27,9 +27,9 @@ public class CopyTokenEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(source.getSourceId()); permanent.setName(token.getName()); permanent.getColor(game).setColor(token.getColor(game)); - permanent.getCardType().clear(); - for (CardType type : token.getCardType()) { - permanent.addCardType(type); + permanent.removeAllCardTypes(game); + for (CardType type : token.getCardType(game)) { + permanent.addCardType(game, type); } permanent.removeAllSubTypes(game); permanent.copySubTypesFrom(game, token); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DamageEachOtherEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DamageEachOtherEffect.java index f0d5880472..0dfd43bab8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DamageEachOtherEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DamageEachOtherEffect.java @@ -39,8 +39,8 @@ public class DamageEachOtherEffect extends OneShotEffect { } if (sourceCreature != null && targetCreature != null - && sourceCreature.isCreature() - && targetCreature.isCreature()) { + && sourceCreature.isCreature(game) + && targetCreature.isCreature(game)) { targetCreature.damage(sourceCreature.getPower().getValue(), sourceCreature.getId(), source, game, false, true); if (sourceOnBattlefield) { sourceCreature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), source, game, false, true); diff --git a/Mage/src/main/java/mage/abilities/effects/common/FightTargetSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/FightTargetSourceEffect.java index 6922256e35..045dd07ce4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/FightTargetSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/FightTargetSourceEffect.java @@ -31,7 +31,7 @@ public class FightTargetSourceEffect extends OneShotEffect { Permanent creature1 = game.getPermanent(getTargetPointer().getFirst(game, source)); // 20110930 - 701.10 if (creature1 != null && sourcePermanent != null) { - if (creature1.isCreature() && sourcePermanent.isCreature()) { + if (creature1.isCreature(game) && sourcePermanent.isCreature(game)) { return sourcePermanent.fight(creature1, source, game); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java index 6661533d8e..deaccfb06b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/FightTargetsEffect.java @@ -55,7 +55,7 @@ public class FightTargetsEffect extends OneShotEffect { Permanent creature2 = game.getPermanent(target2Id); // 20110930 - 701.10 if (creature1 != null && creature2 != null) { - if (creature1.isCreature() && creature2.isCreature()) { + if (creature1.isCreature(game) && creature2.isCreature(game)) { return creature1.fight(creature2, source, game); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/FortifyEffect.java b/Mage/src/main/java/mage/abilities/effects/common/FortifyEffect.java index 192540d469..f62836ecc9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/FortifyEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/FortifyEffect.java @@ -24,8 +24,8 @@ public class FortifyEffect extends AttachEffect{ // fortify keyword ability. Rules 301.5a–e apply to Fortifications in relation to lands just as they apply to // Equipment in relation to creatures, with one clarification relating to rule 301.5c: a Fortification that’s // also a creature (not a land) can’t fortify a land. (See rule 702.66, “Fortify.”) - if (sourcePermanent != null && sourcePermanent.hasSubtype(SubType.FORTIFICATION, game) && !sourcePermanent.isCreature() - && !sourcePermanent.isLand()) { + if (sourcePermanent != null && sourcePermanent.hasSubtype(SubType.FORTIFICATION, game) && !sourcePermanent.isCreature(game) + && !sourcePermanent.isLand(game)) { return super.apply(game, source); } return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/HideawayPlayEffect.java b/Mage/src/main/java/mage/abilities/effects/common/HideawayPlayEffect.java index a5f3878dfd..63772bab37 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/HideawayPlayEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/HideawayPlayEffect.java @@ -60,7 +60,7 @@ public class HideawayPlayEffect extends OneShotEffect { * If the removed card is a land, you may play it as a result of the last ability only if it's your turn * and you haven't already played a land that turn. This counts as your land play for the turn. */ - if (card.isLand()) { + if (card.isLand(game)) { UUID playerId = controller.getId(); if (!game.isActivePlayer(playerId) || !game.getPlayer(playerId).canPlayLand()) { return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java index fed07057b6..4f597af1d0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java @@ -46,7 +46,7 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { if (!this.used && super.applies(event, source, game)) { MageObject mageObject = game.getObject(event.getSourceId()); if (mageObject != null - && mageObject.isInstantOrSorcery()) { + && mageObject.isInstantOrSorcery(game)) { for (Target target : source.getTargets()) { if (target instanceof TargetSpell) { if (((TargetSpell) target).getSourceIds().contains(event.getSourceId())) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/RevealTopLandToBattlefieldElseHandEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RevealTopLandToBattlefieldElseHandEffect.java index 8af9d57f51..345f811de8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/RevealTopLandToBattlefieldElseHandEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/RevealTopLandToBattlefieldElseHandEffect.java @@ -41,7 +41,7 @@ public class RevealTopLandToBattlefieldElseHandEffect extends OneShotEffect { } cards.add(card); controller.revealCards(sourceObject.getName(), cards, game); - if (card.isLand()) { + if (card.isLand(game)) { return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { controller.moveCards(card, Zone.HAND, source, game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java index a5987be595..b5d8656509 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/UntapAllThatAttackedEffect.java @@ -40,7 +40,7 @@ public class UntapAllThatAttackedEffect extends OneShotEffect { Set attackedThisTurn = watcher.getAttackedThisTurnCreatures(); for (MageObjectReference mor : attackedThisTurn) { Permanent permanent = mor.getPermanent(game); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { permanent.untap(game); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java index 8ea0b7a313..34d21a234e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackYouUnlessPayManaAllEffect.java @@ -62,7 +62,7 @@ public class CantAttackYouUnlessPayManaAllEffect extends PayCostToAttackBlockEff if (payAlsoForAttackingPlaneswalker) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null - && permanent.isPlaneswalker() + && permanent.isPlaneswalker(game) && permanent.isControlledBy(source.getControllerId())) { return true; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeAttachedEffect.java index edc0e7f5ef..ea0d3038ae 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeAttachedEffect.java @@ -34,7 +34,7 @@ public class AddCardTypeAttachedEffect extends ContinuousEffectImpl { if (equipment != null && equipment.getAttachedTo() != null) { Permanent target = game.getPermanent(equipment.getAttachedTo()); if (target != null) { - target.addCardType(addedCardType); + target.addCardType(game, addedCardType); } } return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java index 08ce421fea..0384c4b252 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java @@ -9,6 +9,7 @@ import mage.game.Game; import mage.game.permanent.Permanent; import java.util.ArrayList; +import java.util.List; import java.util.Locale; /** @@ -16,7 +17,7 @@ import java.util.Locale; */ public class AddCardTypeSourceEffect extends ContinuousEffectImpl { - private final ArrayList addedCardTypes = new ArrayList<>(); + private final List addedCardTypes = new ArrayList<>(); public AddCardTypeSourceEffect(Duration duration, CardType... addedCardType) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); @@ -46,7 +47,7 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && affectedObjectList.contains(new MageObjectReference(permanent, game))) { for (CardType cardType : addedCardTypes) { - permanent.addCardType(cardType); + permanent.addCardType(game, cardType); } return true; } else if (this.getDuration() == Duration.Custom) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java index f5fc9f611a..b4ce22e803 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java @@ -8,6 +8,7 @@ import mage.game.Game; import mage.game.permanent.Permanent; import java.util.ArrayList; +import java.util.List; import java.util.Locale; import java.util.UUID; @@ -16,7 +17,7 @@ import java.util.UUID; */ public class AddCardTypeTargetEffect extends ContinuousEffectImpl { - private final ArrayList addedCardTypes = new ArrayList<>(); + private final List addedCardTypes = new ArrayList<>(); public AddCardTypeTargetEffect(Duration duration, CardType... addedCardType) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); @@ -43,7 +44,7 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl { Permanent target = game.getPermanent(targetId); if (target != null) { for (CardType cardType : addedCardTypes) { - target.addCardType(cardType); + target.addCardType(game, cardType); } result = true; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 5b93694a16..2c4adcb1d6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -102,8 +102,8 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { if (land == null) { continue; } - if (!land.isLand()) { - land.addCardType(CardType.LAND); + if (!land.isLand(game)) { + land.addCardType(game, CardType.LAND); } if (loseOther) { // 305.7 Note that this doesn't remove any abilities diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java index df40a86c3f..57eabc7a82 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java @@ -98,8 +98,8 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { break; case TypeChangingEffects_4: - for (CardType t : token.getCardType()) { - permanent.addCardType(t); + for (CardType t : token.getCardType(game)) { + permanent.addCardType(game, t); } if (theyAreStillType != null || loseTypes) { permanent.removeAllCreatureTypes(game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java index 18e276333f..dc134720fd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java @@ -70,11 +70,11 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { switch (loseType) { case ALL: case ALL_BUT_COLOR: - permanent.getCardType().clear(); + permanent.removeAllCardTypes(game); break; } - for (CardType t : token.getCardType()) { - permanent.addCardType(t); + for (CardType t : token.getCardType(game)) { + permanent.addCardType(game, t); } // sub type diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java index 43915d9ac7..b90851be6d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureIfVehicleEffect.java @@ -28,7 +28,7 @@ public class BecomesCreatureIfVehicleEffect extends ContinuousEffectImpl { if (aura != null && aura.getAttachedTo() != null) { Permanent enchanted = game.getPermanent(aura.getAttachedTo()); if (enchanted != null && enchanted.hasSubtype(SubType.VEHICLE, game)) { - enchanted.addCardType(addedType); + enchanted.addCardType(game, addedType); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index 07962c4ec1..6b67d4d302 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -91,14 +91,14 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements switch (layer) { case TypeChangingEffects_4: if (losePreviousTypes) { - permanent.getCardType().clear(); + permanent.removeAllCardTypes(game); } - for (CardType cardType : token.getCardType()) { - permanent.addCardType(cardType); + for (CardType cardType : token.getCardType(game)) { + permanent.addCardType(game, cardType); } if (theyAreStillType != null && theyAreStillType.isEmpty() - || theyAreStillType == null && permanent.isLand()) { + || theyAreStillType == null && permanent.isLand(game)) { permanent.removeAllCreatureTypes(game); } permanent.copySubTypesFrom(game, token); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java index 3a786431d1..8a1eb66b16 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java @@ -81,8 +81,8 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { break; case TypeChangingEffects_4: - for (CardType t : token.getCardType()) { - permanent.addCardType(t); + for (CardType t : token.getCardType(game)) { + permanent.addCardType(game, t); } if (loseAllAbilities || removeSubtypes) { permanent.removeAllCreatureTypes(game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesEnchantmentSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesEnchantmentSourceEffect.java index 98e0cf83ba..943fc0e6dd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesEnchantmentSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesEnchantmentSourceEffect.java @@ -40,8 +40,8 @@ public class BecomesEnchantmentSourceEffect extends ContinuousEffectImpl impleme this.discard(); return false; } - permanent.getCardType().clear(); - permanent.getCardType().add(CardType.ENCHANTMENT); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.ENCHANTMENT); permanent.retainAllEnchantmentSubTypes(game); permanent.setIsAllCreatureTypes(game, false); return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureAllEffect.java index 4eb868f0de..35d9a79ad1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureAllEffect.java @@ -73,8 +73,8 @@ public class BecomesFaceDownCreatureAllEffect extends ContinuousEffectImpl imple case TypeChangingEffects_4: permanent.setName(""); permanent.getSuperType().clear(); - permanent.getCardType().clear(); - permanent.addCardType(CardType.CREATURE); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); permanent.getManaCost().clear(); break; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java index 3f5fd586d1..eee19575de 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java @@ -134,8 +134,8 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen case TypeChangingEffects_4: permanent.setName(""); permanent.getSuperType().clear(); - permanent.getCardType().clear(); - permanent.addCardType(CardType.CREATURE); + permanent.removeAllCardTypes(game); + permanent.addCardType(game, CardType.CREATURE); permanent.removeAllSubTypes(game); break; case ColorChangingEffects_5: diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java index 7db27d84c6..3f772aa552 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java @@ -78,7 +78,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl { int affectedTargets = 0; for (UUID permanentId : targetPointer.getTargets(game, source)) { Permanent target = game.getPermanent(permanentId); - if (target != null && target.isCreature()) { + if (target != null && target.isCreature(game)) { target.addPower(power.calculate(game, source, this)); target.addToughness(toughness.calculate(game, source, this)); affectedTargets++; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java index af135587bf..de21045bd1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java @@ -55,12 +55,12 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl { Card card = game.getCard(affectedSpellId); if (card != null) { //Allow lands with morph to be played at instant speed - if (card.isLand()) { + if (card.isLand(game)) { boolean morphAbility = card.getAbilities().stream().anyMatch(ability -> ability instanceof MorphAbility); if (morphAbility) { Card cardCopy = card.copy(); - cardCopy.getCardType().clear(); - cardCopy.addCardType(CardType.CREATURE); + cardCopy.removeAllCardTypes(game); + cardCopy.addCardType(game, CardType.CREATURE); return filter.match(cardCopy, source.getSourceId(), affectedControllerId, game); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/HasSubtypesSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/HasSubtypesSourceEffect.java index b708cd0513..35897da12f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/HasSubtypesSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/HasSubtypesSourceEffect.java @@ -2,25 +2,29 @@ package mage.abilities.effects.common.continuous; import mage.MageObject; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.*; import mage.game.Game; +import mage.util.CardUtil; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; /** + * Warning, do not copy it - hasSubTypeForDeckbuilding uses it to find additional subtypes in cards + * * @author TheElk801 */ -public class HasSubtypesSourceEffect extends ContinuousEffectImpl { +public final class HasSubtypesSourceEffect extends ContinuousEffectImpl { private final List subtypes = new ArrayList<>(); public HasSubtypesSourceEffect(SubType... subTypes) { super(Duration.EndOfGame, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); subtypes.addAll(Arrays.asList(subTypes)); - this.staticText = setText(); } public HasSubtypesSourceEffect(final HasSubtypesSourceEffect effect) { @@ -45,30 +49,16 @@ public class HasSubtypesSourceEffect extends ContinuousEffectImpl { return true; } - private String setText() { - String s = "{this} is also "; - switch (subtypes.size()) { - case 0: - throw new UnsupportedOperationException("Can't have zero subtypes"); - case 1: - s += subtypes.get(0).getIndefiniteArticle() + " " + subtypes.get(0); - break; - case 2: - s += subtypes.get(0).getIndefiniteArticle() + " " + subtypes.get(0); - s += " and "; - s += subtypes.get(1).getIndefiniteArticle() + " " + subtypes.get(1); - break; - default: - for (int i = 0; i < subtypes.size(); i++) { - if (i == 0) { - s += subtypes.get(i).getIndefiniteArticle() + " " + subtypes.get(i) + ", "; - } else if (i == subtypes.size() - 1) { - s += "and " + subtypes.get(i); - } else { - s += subtypes.get(i) + ", "; - } - } + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; } - return s; + return "{this} is also " + subtypes.get(0).getIndefiniteArticle() + ' ' + + CardUtil.concatWithAnd(subtypes.stream().map(SubType::getDescription).collect(Collectors.toList())); + } + + public boolean hasSubtype(SubType subType) { + return subtypes.contains(subType); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseArtifactTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseArtifactTypeTargetEffect.java index 9a3b33533e..d1a306db71 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseArtifactTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseArtifactTypeTargetEffect.java @@ -49,7 +49,7 @@ public class LoseArtifactTypeTargetEffect extends ContinuousEffectImpl { if (permanent == null) { continue; } - permanent.getCardType().remove(CardType.ARTIFACT); + permanent.removeCardType(game, CardType.ARTIFACT); permanent.removeAllSubTypes(game, SubTypeSet.ArtifactType); return true; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java index 27ce0e2b48..0f2c6122c6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java @@ -61,8 +61,8 @@ public class LoseCreatureTypeSourceEffect extends ContinuousEffectImpl implement if (permanent == null) { return false; } - permanent.getCardType().remove(CardType.CREATURE); - if (!permanent.isTribal()) { + permanent.removeCardType(game, CardType.CREATURE); + if (!permanent.isTribal(game)) { permanent.removeAllCreatureTypes(game); } if (permanent.isAttacking() || permanent.getBlocking() > 0) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java index 4e5827144c..a9719c54bb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java @@ -93,7 +93,7 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl { } // can't cast without mana cost - if (!cardToCheck.isLand() && cardToCheck.getManaCost().isEmpty()) { + if (!cardToCheck.isLand(game) && cardToCheck.getManaCost().isEmpty()) { return false; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenCardTypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenCardTypeEffect.java index 35d89abd51..5de1a8634e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenCardTypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllOfChosenCardTypeEffect.java @@ -32,7 +32,7 @@ public class SpellsCostReductionAllOfChosenCardTypeEffect extends SpellsCostRedu protected boolean selectedByRuntimeData(Card card, Ability source, Game game) { Object savedType = game.getState().getValue(source.getSourceId() + "_type"); if (savedType instanceof String) { - return card.getCardType().contains(CardType.fromString((String) savedType)); + return card.getCardType(game).contains(CardType.fromString((String) savedType)); } return false; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java b/Mage/src/main/java/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java index 9ae75d11a1..067520024c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java +++ b/Mage/src/main/java/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java @@ -9,10 +9,7 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.watchers.common.DamagedByWatcher; /** diff --git a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/PlayLandsFromGraveyardControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/PlayLandsFromGraveyardControllerEffect.java index cbe6d8d067..a4c227ae98 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/PlayLandsFromGraveyardControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/PlayLandsFromGraveyardControllerEffect.java @@ -72,7 +72,7 @@ public class PlayLandsFromGraveyardControllerEffect extends AsThoughEffectImpl { } // can't cast without mana cost - if (!cardToCheck.isLand() && cardToCheck.getManaCost().isEmpty()) { + if (!cardToCheck.isLand(game) && cardToCheck.getManaCost().isEmpty()) { return false; } diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java index 661c0071d3..87419eee6f 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java @@ -106,7 +106,7 @@ public class ExploreSourceEffect extends OneShotEffect { permanentController.revealCards("Explored card", cards, game); cardWasRevealed = true; if (card != null) { - if (card.isLand()) { + if (card.isLand(game)) { permanentController.moveCards(card, Zone.HAND, source, game); } else { if (game.getState().getZone(permanentId) == Zone.BATTLEFIELD) { // needed in case LKI object is used diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java index 9b3f932c94..1844b0d3bd 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java @@ -51,7 +51,7 @@ public class ManifestEffect extends OneShotEffect { Set cards = controller.getLibrary().getTopCards(game, amount); for (Card card : cards) { ManaCosts manaCosts = null; - if (card.isCreature()) { + if (card.isCreature(game)) { manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null; if (manaCosts == null) { manaCosts = new ManaCostsImpl("{0}"); diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java index 91899deb1f..2aa3c91af3 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java @@ -54,7 +54,7 @@ public class ManifestTargetPlayerEffect extends OneShotEffect { Set cards = targetPlayer.getLibrary().getTopCards(game, amount); for (Card card : cards) { ManaCosts manaCosts = null; - if (card.isCreature()) { + if (card.isCreature(game)) { manaCosts = card.getSpellAbility().getManaCosts(); if (manaCosts == null) { manaCosts = new ManaCostsImpl("{0}"); diff --git a/Mage/src/main/java/mage/abilities/hint/common/CardTypesInGraveyardHint.java b/Mage/src/main/java/mage/abilities/hint/common/CardTypesInGraveyardHint.java index 77de216274..95d87660ba 100644 --- a/Mage/src/main/java/mage/abilities/hint/common/CardTypesInGraveyardHint.java +++ b/Mage/src/main/java/mage/abilities/hint/common/CardTypesInGraveyardHint.java @@ -1,6 +1,5 @@ package mage.abilities.hint.common; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.hint.Hint; import mage.cards.Card; @@ -35,7 +34,7 @@ public enum CardTypesInGraveyardHint implements Hint { return null; } List types = stream - .map(MageObject::getCardType) + .map(card -> card.getCardType(game)) .flatMap(Collection::stream) .distinct() .map(CardType::toString) diff --git a/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java b/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java index ab10559bd4..0f832613a2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BestowAbility.java @@ -8,14 +8,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.AttachEffect; import mage.cards.Card; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SpellAbilityCastMode; -import mage.constants.SpellAbilityType; -import mage.constants.SubType; -import mage.constants.TimingRule; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -24,9 +17,8 @@ import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; /** - * * 702.102. Bestow - * + *

* 702.102a Bestow represents two static abilities, one that functions while the * card with bestow is on the stack and another that functions both while it's * on stack and while it's on the battlefield. "Bestow [cost]" means "You may @@ -36,61 +28,60 @@ import mage.target.common.TargetCreaturePermanent; * spell has an illegal target as it resolves and or the permanent this spell * becomes, becomes unattached." Paying a card's bestow cost follows the rules * for paying alternative costs in rules 601.2b and 601.2e-g. - * + *

* 702.102b If a spell's controller chooses to pay its bestow cost, that player * chooses a legal target for that Aura spell as defined by its enchant creature * ability and rule 601.2c. See also rule 303.4. - * + *

* 702.102c A spell's controller can't choose to pay its bestow cost unless that * player can choose a legal target for that spell after it becomes an Aura * spell. - * + *

* 702.102d As an Aura spell with bestow begins resolving, if its target is * illegal, the effect making it an Aura spell ends. It continues resolving as a * creature spell and will be put onto the battlefield under the control of the * spell's controller. This is an exception to rule 608.3a. - * + *

* 702.102e If an Aura with bestow is attached to an illegal object or player, * it becomes unattached. This is an exception to rule 704.5n. - * + *

* You don't choose whether the spell is going to be an Aura spell or not until * the spell is already on the stack. Abilities that affect when you can cast a * spell, such as flash, will apply to the creature card in whatever zone you're * casting it from. For example, an effect that said you can cast creature * spells as though they have flash will allow you to cast a creature card with * bestow as an Aura spell anytime you could cast an instant. - * + *

* On the stack, a spell with bestow is either a creature spell or an Aura * spell. It's never both. - * + *

* Unlike other Aura spells, an Aura spell with bestow isn't countered if its * target is illegal as it begins to resolve. Rather, the effect making it an * Aura spell ends, it loses enchant creature, it returns to being an * enchantment creature spell, and it resolves and enters the battlefield as an * enchantment creature. - * + *

* Unlike other Auras, an Aura with bestow isn't put into its owner's graveyard * if it becomes unattached. Rather, the effect making it an Aura ends, it loses * enchant creature, and it remains on the battlefield as an enchantment * creature. It can attack (and its {T} abilities can be activated, if it has * any) on the turn it becomes unattached if it's been under your control * continuously, even as an Aura, since your most recent turn began. - * + *

* If a permanent with bestow enters the battlefield by any method other than * being cast, it will be an enchantment creature. You can't choose to pay the * bestow cost and have it become an Aura. - * + *

* Auras attached to a creature don't become tapped when the creature becomes * tapped. Except in some rare cases, an Aura with bestow remains untapped when * it becomes unattached and becomes a creature. * - * * @author LevelX2 */ public class BestowAbility extends SpellAbility { public BestowAbility(Card card, String manaString) { - super(new ManaCostsImpl(manaString), card.getName() + " using bestow"); + super(new ManaCostsImpl<>(manaString), card.getName() + " using bestow"); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.spellAbilityCastMode = SpellAbilityCastMode.BESTOW; this.timing = TimingRule.SORCERY; @@ -127,15 +118,10 @@ public class BestowAbility extends SpellAbility { MageObject basicObject = permanent.getBasicMageObject(game); if (basicObject != null) { basicObject.getSubtype().remove(SubType.AURA); - if (!basicObject.isCreature()) { - basicObject.addCardType(CardType.CREATURE); - } + basicObject.addCardType(CardType.CREATURE); } permanent.getSubtype().remove(SubType.AURA); - if (!permanent.isCreature()) { - permanent.addCardType(CardType.CREATURE); - } - + permanent.addCardType(CardType.CREATURE); } } @@ -143,8 +129,8 @@ public class BestowAbility extends SpellAbility { // permanently changes to the object if (card != null) { card.addSubType(SubType.AURA); - card.getCardType().remove(CardType.CREATURE); - card.getCardType().add(CardType.ENCHANTMENT); + card.removeCardType(CardType.CREATURE); + card.addCardType(CardType.ENCHANTMENT); } } } @@ -172,14 +158,15 @@ class BestowEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent bestowPermanent = game.getPermanentEntering(source.getSourceId()); - if (bestowPermanent != null) { - if (bestowPermanent.hasSubtype(SubType.AURA, game)) { - MageObject basicObject = bestowPermanent.getBasicMageObject(game); - if (basicObject != null && !basicObject.getSubtype().contains(SubType.AURA)) { - basicObject.getSubtype(null).add(SubType.AURA); - basicObject.getCardType().remove(CardType.CREATURE); - } - } + if (bestowPermanent == null || !bestowPermanent.hasSubtype(SubType.AURA, game)) { + return false; + } + + // change types permanently + MageObject basicObject = bestowPermanent.getBasicMageObject(game); + if (basicObject != null && !basicObject.getSubtype().contains(SubType.AURA)) { + basicObject.addSubType(SubType.AURA); + basicObject.removeCardType(CardType.CREATURE); } return false; } diff --git a/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java b/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java index f6dfc680aa..6d6ccb4e5f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BoastAbility.java @@ -54,7 +54,7 @@ public class BoastAbility extends ActivatedAbilityImpl { return 1; } Permanent permanent = game.getPermanent(getSourceId()); - if (permanent != null && !permanent.isCreature()) { + if (permanent != null && !permanent.isCreature(game)) { return 1; } return game.getBattlefield() diff --git a/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java b/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java index 43fd54a88d..ae1c543c08 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java @@ -124,7 +124,7 @@ class CascadeEffect extends OneShotEffect { Card cardToCast = null; for (Card card : controller.getLibrary().getCards(game)) { cardsToExile.add(card); - if (!card.isLand() && card.getManaValue() < sourceCost) { + if (!card.isLand(game) && card.getManaValue() < sourceCost) { cardToCast = card; break; } diff --git a/Mage/src/main/java/mage/abilities/keyword/CompanionAbility.java b/Mage/src/main/java/mage/abilities/keyword/CompanionAbility.java index dff4f8dcfb..23d90378b9 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CompanionAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CompanionAbility.java @@ -9,7 +9,9 @@ import mage.constants.Zone; import java.util.Set; -/* +/** + * Allows card to be companion + * * @author emerald000 */ public class CompanionAbility extends SpecialAction { diff --git a/Mage/src/main/java/mage/abilities/keyword/CompanionCondition.java b/Mage/src/main/java/mage/abilities/keyword/CompanionCondition.java index 161bd2aad9..ad470d3b3c 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CompanionCondition.java +++ b/Mage/src/main/java/mage/abilities/keyword/CompanionCondition.java @@ -5,7 +5,9 @@ import mage.cards.Card; import java.io.Serializable; import java.util.Set; -/* +/** + * Checking deck for companion legality + * * @author emerald000 */ public interface CompanionCondition extends Serializable { @@ -16,7 +18,7 @@ public interface CompanionCondition extends Serializable { String getRule(); /** - * @param deck The set of cards to check. + * @param deck The set of cards to check. * @param startingSize * @return Whether the companion is valid for that deck. */ diff --git a/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java b/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java index 24efafed33..5b21034d34 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EvolveAbility.java @@ -8,26 +8,27 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; /** * FAQ 2013/01/11 - * + *

* 702.98. Evolve - * + *

* 702.98a Evolve is a triggered ability. "Evolve" means "Whenever a creature * enters the battlefield under your control, if that creature's power is * greater than this creature's power and/or that creature's toughness is * greater than this creature's toughness, put a +1/+1 counter on this * creature." - * + *

* 702.98b If a creature has multiple instances of evolve, each triggers * separately - * + *

* Rulings - * + *

* When comparing the stats of the two creatures, you always compare power to * power and toughness to toughness. Whenever a creature enters the battlefield * under your control, check its power and toughness against the power and @@ -81,9 +82,9 @@ public class EvolveAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (!event.getTargetId().equals(this.getSourceId())) { - Permanent triggeringCreature = game.getPermanent(event.getTargetId()); + Permanent triggeringCreature = ((EntersTheBattlefieldEvent) event).getTarget(); if (triggeringCreature != null - && triggeringCreature.isCreature() + && triggeringCreature.isCreature(game) && triggeringCreature.isControlledBy(this.controllerId)) { Permanent sourceCreature = game.getPermanent(sourceId); if (sourceCreature != null && isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) { diff --git a/Mage/src/main/java/mage/abilities/keyword/FearAbility.java b/Mage/src/main/java/mage/abilities/keyword/FearAbility.java index e380accd37..183e79d4f1 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FearAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FearAbility.java @@ -58,7 +58,7 @@ class FearEffect extends RestrictionEffect implements MageSingleton { @Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) { - return blocker.isArtifact() || blocker.getColor(game).isBlack(); + return blocker.isArtifact(game) || blocker.getColor(game).isBlack(); } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/HexproofFromArtifactsCreaturesAndEnchantments.java b/Mage/src/main/java/mage/abilities/keyword/HexproofFromArtifactsCreaturesAndEnchantments.java index 103ea3826c..2ce0b0eeb5 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HexproofFromArtifactsCreaturesAndEnchantments.java +++ b/Mage/src/main/java/mage/abilities/keyword/HexproofFromArtifactsCreaturesAndEnchantments.java @@ -32,7 +32,7 @@ public class HexproofFromArtifactsCreaturesAndEnchantments extends HexproofBaseA @Override public boolean checkObject(MageObject source, Game game) { - return source.isArtifact() || source.isCreature() || source.isEnchantment(); + return source.isArtifact(game) || source.isCreature(game) || source.isEnchantment(game); } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java b/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java index 1cbb997ed0..0e30e798d9 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HexproofFromPlaneswalkersAbility.java @@ -32,7 +32,7 @@ public class HexproofFromPlaneswalkersAbility extends HexproofBaseAbility { @Override public boolean checkObject(MageObject source, Game game) { - return source.isPlaneswalker(); + return source.isPlaneswalker(game); } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java b/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java index f48cc7327b..7b487f3a5d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java @@ -57,7 +57,7 @@ class IntimidateEffect extends RestrictionEffect implements MageSingleton { @Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) { boolean result = false; - if (blocker.isArtifact() && (blocker.isCreature())) { + if (blocker.isArtifact(game) && (blocker.isCreature(game))) { result = true; } if (attacker.getColor(game).shares(blocker.getColor(game))) { diff --git a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java index 39904a2d41..e853ad0ec3 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java @@ -281,15 +281,15 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost return alternateCosts; } - public static void setPermanentToFaceDownCreature(MageObject mageObject) { + public static void setPermanentToFaceDownCreature(MageObject mageObject, Game game) { mageObject.getPower().modifyBaseValue(2); mageObject.getToughness().modifyBaseValue(2); mageObject.getAbilities().clear(); - mageObject.getColor().setColor(new ObjectColor()); + mageObject.getColor(game).setColor(new ObjectColor()); mageObject.setName(""); - mageObject.getCardType().clear(); - mageObject.addCardType(CardType.CREATURE); - mageObject.getSubtype().clear(); + mageObject.removeAllCardTypes(game); + mageObject.addCardType(game, CardType.CREATURE); + mageObject.removeAllSubTypes(game); mageObject.getSuperType().clear(); mageObject.getManaCost().clear(); if (mageObject instanceof Permanent) { diff --git a/Mage/src/main/java/mage/abilities/keyword/OverloadAbility.java b/Mage/src/main/java/mage/abilities/keyword/OverloadAbility.java index 9fd88a0b84..f2a3c03a2b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/OverloadAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/OverloadAbility.java @@ -34,7 +34,7 @@ public class OverloadAbility extends SpellAbility { super(costs, card.getName() + " with overload"); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.addEffect(effect); - this.timing = (card.isSorcery() ? TimingRule.SORCERY : TimingRule.INSTANT); + this.timing = (card.isSorcery(null) ? TimingRule.SORCERY : TimingRule.INSTANT); } public OverloadAbility(final OverloadAbility ability) { diff --git a/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java b/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java index 8eea3db229..42bffda3b8 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java @@ -100,7 +100,7 @@ public class ProtectionAbility extends StaticAbility { // object is still a card and not a spell yet. So return only if the source object can't be a spell // otherwise the following FilterObject check will be applied if (source instanceof StackObject - || !source.isInstantOrSorcery()) { + || !source.isInstantOrSorcery(game)) { return true; } } @@ -108,7 +108,7 @@ public class ProtectionAbility extends StaticAbility { // Emrakul, the Aeons Torn if (filter instanceof FilterStackObject) { if (filter.match(source, game)) { - return !source.isInstantOrSorcery(); + return !source.isInstantOrSorcery(game); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java b/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java index 101879c834..511cd5f258 100644 --- a/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java @@ -50,7 +50,7 @@ public class RecoverAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent()) { if (zEvent.getTarget().isOwnedBy(getControllerId()) - && zEvent.getTarget().isCreature() + && zEvent.getTarget().isCreature(game) && !zEvent.getTarget().getId().equals(getSourceId())) { return true; } diff --git a/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java b/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java index d09693c89e..4cc6e7f4bf 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SoulbondAbility.java @@ -75,7 +75,7 @@ public class SoulbondAbility extends EntersBattlefieldTriggeredAbility { boolean self = false; boolean other = false; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(getControllerId())) { - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { if (permanent.getId().equals(getSourceId())) { if (permanent.isControlledBy(getControllerId())) { self = true; @@ -131,7 +131,7 @@ class SoulboundEntersSelfEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && permanent.isCreature()) { + if (permanent != null && permanent.isCreature(game)) { Player controller = game.getPlayer(permanent.getControllerId()); if (controller != null) { TargetControlledPermanent target = new TargetControlledPermanent(filter); @@ -234,11 +234,11 @@ class SoulboundEntersOtherEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.getPairedCard() == null - && permanent.isCreature()) { + && permanent.isCreature(game)) { Player controller = game.getPlayer(permanent.getControllerId()); if (controller != null) { Permanent enteringPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (enteringPermanent != null && enteringPermanent.isCreature() && enteringPermanent.getPairedCard() == null) { + if (enteringPermanent != null && enteringPermanent.isCreature(game) && enteringPermanent.getPairedCard() == null) { enteringPermanent.setPairedCard(new MageObjectReference(permanent, game)); permanent.setPairedCard(new MageObjectReference(enteringPermanent, game)); if (!game.isSimulation()) { diff --git a/Mage/src/main/java/mage/abilities/keyword/SpliceOntoInstantOrSorceryAbility.java b/Mage/src/main/java/mage/abilities/keyword/SpliceOntoInstantOrSorceryAbility.java index 52136ebe7f..ce87c33251 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SpliceOntoInstantOrSorceryAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SpliceOntoInstantOrSorceryAbility.java @@ -161,7 +161,7 @@ class SpliceOntoInstantOrSorceryEffect extends SpliceCardEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { MageObject object = game.getObject(abilityToModify.getSourceId()); - if (object != null && object.isInstantOrSorcery()) { + if (object != null && object.isInstantOrSorcery(game)) { return spliceSpellCanBeActivated(source, game); } return false; diff --git a/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java b/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java index def9e8d714..58726302db 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java @@ -24,7 +24,7 @@ public class SunburstAbility extends EntersBattlefieldAbility { private static final String ruleCreature = "Sunburst (This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.)"; private static final String ruleNonCreature = "Sunburst (This enters the battlefield with a charge counter on it for each color of mana spent to cast it.)"; - private boolean isCreature; + private final boolean isCreature; public SunburstAbility(Card card) { super(new SunburstEffect(), ""); @@ -68,7 +68,7 @@ class SunburstEffect extends OneShotEffect { int countersAmount = amount.calculate(game, source, this); if (countersAmount > 0) { Counter counter; - if (permanent.isCreature()) { + if (permanent.isCreature(game)) { counter = CounterType.P1P1.createInstance(countersAmount); } else { counter = CounterType.CHARGE.createInstance(countersAmount); diff --git a/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java b/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java index 9e1ff595cd..e1f7f643e2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java @@ -209,7 +209,7 @@ public class SuspendAbility extends SpecialAction { return ActivationStatus.getFalse(); } MageObject object = game.getObject(sourceId); - return new ActivationStatus(object.isInstant() + return new ActivationStatus(object.isInstant(game) || object.hasAbility(FlashAbility.getInstance(), game) || null != game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.CAST_AS_INSTANT, this, playerId, game) @@ -370,7 +370,7 @@ class SuspendPlayCardEffect extends OneShotEffect { game, true, new ApprovingObject(source, game)); game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null); if (cardWasCast) { - if (card.isCreature()) { + if (card.isCreature(game)) { ContinuousEffect effect = new GainHasteEffect(); effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1)); game.addEffect(effect, source); diff --git a/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java b/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java index 5d598234ec..7017d0cd06 100644 --- a/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java @@ -45,9 +45,9 @@ public class TransformAbility extends SimpleStaticAbility { permanent.getColor(game).setColor(sourceCard.getColor(game)); permanent.getManaCost().clear(); permanent.getManaCost().add(sourceCard.getManaCost()); - permanent.getCardType().clear(); - for (CardType type : sourceCard.getCardType()) { - permanent.addCardType(type); + permanent.removeAllCardTypes(game); + for (CardType type : sourceCard.getCardType(game)) { + permanent.addCardType(game, type); } permanent.removeAllSubTypes(game); permanent.copySubTypesFrom(game, sourceCard); diff --git a/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java b/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java index a544ab73af..d2018fe974 100644 --- a/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java +++ b/Mage/src/main/java/mage/abilities/mana/builder/common/InstantOrSorcerySpellManaBuilder.java @@ -44,7 +44,7 @@ class InstantOrSorceryCastManaCondition extends ManaCondition implements Conditi public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - return object != null && object.isInstantOrSorcery(); + return object != null && object.isInstantOrSorcery(game); } return false; } diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java b/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java index c13f3033d0..f41f9f1fc9 100644 --- a/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java +++ b/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java @@ -19,7 +19,7 @@ public class ArtifactCastManaCondition extends ManaCondition implements Conditio public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.isArtifact()) { + if (object != null && object.isArtifact(game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/CreatureCastManaCondition.java b/Mage/src/main/java/mage/abilities/mana/conditional/CreatureCastManaCondition.java index a6a822bd9d..82bcc479d4 100644 --- a/Mage/src/main/java/mage/abilities/mana/conditional/CreatureCastManaCondition.java +++ b/Mage/src/main/java/mage/abilities/mana/conditional/CreatureCastManaCondition.java @@ -18,7 +18,7 @@ public class CreatureCastManaCondition extends ManaCondition implements Conditio public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.isCreature()) { + if (object != null && object.isCreature(game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/PlaneswalkerCastManaCondition.java b/Mage/src/main/java/mage/abilities/mana/conditional/PlaneswalkerCastManaCondition.java index 25509560e5..7448b92ad9 100644 --- a/Mage/src/main/java/mage/abilities/mana/conditional/PlaneswalkerCastManaCondition.java +++ b/Mage/src/main/java/mage/abilities/mana/conditional/PlaneswalkerCastManaCondition.java @@ -19,7 +19,7 @@ public class PlaneswalkerCastManaCondition extends ManaCondition implements Cond public boolean apply(Game game, Ability source) { if (source instanceof SpellAbility) { MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.isPlaneswalker()) { + if (object != null && object.isPlaneswalker(game)) { return true; } } diff --git a/Mage/src/main/java/mage/cards/Card.java b/Mage/src/main/java/mage/cards/Card.java index c4686e25a6..5b99d66e85 100644 --- a/Mage/src/main/java/mage/cards/Card.java +++ b/Mage/src/main/java/mage/cards/Card.java @@ -5,7 +5,9 @@ import mage.Mana; import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.SpellAbility; +import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.SubType; import mage.constants.Zone; import mage.counters.Counter; import mage.counters.Counters; @@ -197,4 +199,16 @@ public interface Card extends MageObject { } return true; } + + List getCardTypeForDeckbuilding(); + + boolean hasCardTypeForDeckbuilding(CardType cardType); + + /** + * Checking subtype in cards for deck and companion validation + * + * @param subType + * @return + */ + boolean hasSubTypeForDeckbuilding(SubType subType); } diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index f332151912..b7c491f4dd 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -3,8 +3,10 @@ package mage.cards; import mage.MageObject; import mage.MageObjectImpl; import mage.Mana; -import mage.ObjectColor; import mage.abilities.*; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.HasSubtypesSourceEffect; +import mage.abilities.keyword.ChangelingAbility; import mage.abilities.keyword.FlashbackAbility; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.repository.PluginClassloaderRegistery; @@ -269,7 +271,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { && mainCardState != null && !mainCardState.hasLostAllAbilities() && mainCardState.getAbilities().containsClass(FlashbackAbility.class)) { - FlashbackAbility flash = new FlashbackAbility(this.getManaCost(), this.isInstant() ? TimingRule.INSTANT : TimingRule.SORCERY); + FlashbackAbility flash = new FlashbackAbility(this.getManaCost(), this.isInstant(game) ? TimingRule.INSTANT : TimingRule.SORCERY); flash.setSourceId(this.getId()); flash.setControllerId(this.getOwnerId()); flash.setSpellAbilityType(this.getSpellAbility().getSpellAbilityType()); @@ -830,4 +832,38 @@ public abstract class CardImpl extends MageObjectImpl implements Card { } return false; } + + @Override + public List getCardTypeForDeckbuilding() { + return getCardType(); + } + + @Override + public boolean hasCardTypeForDeckbuilding(CardType cardType) { + return getCardTypeForDeckbuilding().contains(cardType); + } + + @Override + public boolean hasSubTypeForDeckbuilding(SubType subType) { + // own subtype + if (this.hasSubtype(subType, null)) { + return true; + } + + // gained subtypes from source ability + if (this.getAbilities() + .stream() + .filter(SimpleStaticAbility.class::isInstance) + .map(Ability::getAllEffects) + .flatMap(Collection::stream) + .filter(HasSubtypesSourceEffect.class::isInstance) + .map(HasSubtypesSourceEffect.class::cast) + .anyMatch(effect -> effect.hasSubtype(subType))) { + return true; + } + + // changeling (any subtype) + return subType.getSubTypeSet() == SubTypeSet.CreatureType + && this.getAbilities().containsClass(ChangelingAbility.class); + } } diff --git a/Mage/src/main/java/mage/cards/ExpansionSet.java b/Mage/src/main/java/mage/cards/ExpansionSet.java index 2803abf7b8..edfa6e8e5d 100644 --- a/Mage/src/main/java/mage/cards/ExpansionSet.java +++ b/Mage/src/main/java/mage/cards/ExpansionSet.java @@ -1,5 +1,6 @@ package mage.cards; +import mage.MageObject; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.keyword.PartnerWithAbility; @@ -313,7 +314,7 @@ public abstract class ExpansionSet implements Serializable { return booster.stream().anyMatch(card -> card.isLegendary() && card.isCreature()); } if (needsPlaneswalker) { - return booster.stream().filter(card -> card.isPlaneswalker()).count() == 1; + return booster.stream().filter(MageObject::isPlaneswalker).count() == 1; } // TODO: add partner check diff --git a/Mage/src/main/java/mage/cards/ModalDoubleFacesCard.java b/Mage/src/main/java/mage/cards/ModalDoubleFacesCard.java index 9aca8948c6..1680c05f06 100644 --- a/Mage/src/main/java/mage/cards/ModalDoubleFacesCard.java +++ b/Mage/src/main/java/mage/cards/ModalDoubleFacesCard.java @@ -15,7 +15,6 @@ import mage.game.events.ZoneChangeEvent; import mage.util.CardUtil; import mage.util.SubTypes; -import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.UUID; @@ -166,10 +165,10 @@ public abstract class ModalDoubleFacesCard extends CardImpl { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { // CardImpl's constructor can call some code on init, so you must check left/right before // it's a bad workaround - return leftHalfCard != null ? leftHalfCard.getCardType() : cardType; + return leftHalfCard != null ? leftHalfCard.getCardType(game) : cardType; } @Override diff --git a/Mage/src/main/java/mage/cards/repository/CardInfo.java b/Mage/src/main/java/mage/cards/repository/CardInfo.java index fd750f9443..6259ecde16 100644 --- a/Mage/src/main/java/mage/cards/repository/CardInfo.java +++ b/Mage/src/main/java/mage/cards/repository/CardInfo.java @@ -316,8 +316,8 @@ public class CardInfo { return res; } - public final ArrayList getTypes() { - ArrayList list = new ArrayList<>(); + public final List getTypes() { + List list = new ArrayList<>(); for (String type : this.types.split(SEPARATOR)) { try { list.add(CardType.valueOf(type)); @@ -327,7 +327,7 @@ public class CardInfo { return list; } - public final void setTypes(ArrayList types) { + public final void setTypes(List types) { StringBuilder sb = new StringBuilder(); for (CardType item : types) { sb.append(item.name()).append(SEPARATOR); diff --git a/Mage/src/main/java/mage/constants/CardType.java b/Mage/src/main/java/mage/constants/CardType.java index 62b8cd986c..900e9e17cc 100644 --- a/Mage/src/main/java/mage/constants/CardType.java +++ b/Mage/src/main/java/mage/constants/CardType.java @@ -6,6 +6,7 @@ import mage.game.Game; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; /** * @author North @@ -70,7 +71,7 @@ public enum CardType { * @return */ public static CardType[] mergeTypes(CardType[] a, CardType[] b) { - ArrayList cardTypes = new ArrayList<>(); + List cardTypes = new ArrayList<>(); cardTypes.addAll(Arrays.asList(a)); cardTypes.addAll(Arrays.asList(b)); return cardTypes.toArray(new CardType[0]); @@ -90,7 +91,7 @@ public enum CardType { @Override public boolean apply(MageObject input, Game game) { - return input.getCardType().contains(cardType); + return input.getCardType(game).contains(cardType); } @Override diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index 8e90af1188..3e68e39bcb 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -420,6 +420,7 @@ public enum SubType { FREYALISE("Freyalise", SubTypeSet.PlaneswalkerType), GARRUK("Garruk", SubTypeSet.PlaneswalkerType), GIDEON("Gideon", SubTypeSet.PlaneswalkerType), + GRIST("Grist", SubTypeSet.PlaneswalkerType), HUATLI("Huatli", SubTypeSet.PlaneswalkerType), JACE("Jace", SubTypeSet.PlaneswalkerType), JESKA("Jeska", SubTypeSet.PlaneswalkerType), @@ -573,20 +574,24 @@ public enum SubType { } public boolean canGain(MageObject mageObject) { + return canGain(null); + } + + public boolean canGain(Game game, MageObject mageObject) { switch (subTypeSet) { case CreatureType: - return mageObject.isCreature() || mageObject.isTribal(); + return mageObject.isCreature(game) || mageObject.isTribal(game); case BasicLandType: case NonBasicLandType: - return mageObject.isLand(); + return mageObject.isLand(game); case EnchantmentType: - return mageObject.isEnchantment(); + return mageObject.isEnchantment(game); case ArtifactType: - return mageObject.isArtifact(); + return mageObject.isArtifact(game); case PlaneswalkerType: - return mageObject.isPlaneswalker(); + return mageObject.isPlaneswalker(game); case SpellType: - return mageObject.isInstantOrSorcery(); + return mageObject.isInstantOrSorcery(game); } return false; } diff --git a/Mage/src/main/java/mage/designations/Designation.java b/Mage/src/main/java/mage/designations/Designation.java index a89cf4e6fe..f2608d4817 100644 --- a/Mage/src/main/java/mage/designations/Designation.java +++ b/Mage/src/main/java/mage/designations/Designation.java @@ -30,6 +30,7 @@ import java.util.UUID; */ public abstract class Designation implements MageObject, Copyable { + private static final List emptySet = new ArrayList<>(); private static final ObjectColor emptyColor = new ObjectColor(); private static final ManaCostsImpl emptyCost = new ManaCostsImpl(); @@ -151,8 +152,8 @@ public abstract class Designation implements MageObject, Copyable { } @Override - public ArrayList getCardType() { - return new ArrayList<>(); + public List getCardType(Game game) { + return emptySet; } @Override diff --git a/Mage/src/main/java/mage/designations/Monarch.java b/Mage/src/main/java/mage/designations/Monarch.java index d178838970..0bc8e9b61d 100644 --- a/Mage/src/main/java/mage/designations/Monarch.java +++ b/Mage/src/main/java/mage/designations/Monarch.java @@ -92,7 +92,7 @@ class MonarchDealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility if (((DamagedPlayerEvent) event).isCombatDamage()) { MageObject damagingObject = game.getObject(event.getSourceId()); if (damagingObject instanceof Permanent - && damagingObject.isCreature() + && damagingObject.isCreature(game) && event.getTargetId().equals(game.getMonarchId())) { setControllerId(event.getPlayerId()); getEffects().get(0).setTargetPointer(new FixedTarget(((Permanent) damagingObject).getControllerId())); diff --git a/Mage/src/main/java/mage/filter/common/FilterCreatureForAttack.java b/Mage/src/main/java/mage/filter/common/FilterCreatureForAttack.java index 8b390a9344..c59a3a11ce 100644 --- a/Mage/src/main/java/mage/filter/common/FilterCreatureForAttack.java +++ b/Mage/src/main/java/mage/filter/common/FilterCreatureForAttack.java @@ -46,7 +46,7 @@ class CanTapPredicate implements Predicate { @Override public boolean apply(Permanent input, Game game) { - return input.canTap(); + return input.canTap(game); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/card/AuraCardCanAttachToPermanentId.java b/Mage/src/main/java/mage/filter/predicate/card/AuraCardCanAttachToPermanentId.java index f8d5b2e490..d6aaea905d 100644 --- a/Mage/src/main/java/mage/filter/predicate/card/AuraCardCanAttachToPermanentId.java +++ b/Mage/src/main/java/mage/filter/predicate/card/AuraCardCanAttachToPermanentId.java @@ -27,7 +27,7 @@ public class AuraCardCanAttachToPermanentId implements Predicate { Filter filter; if (permanent != null && input != null - && input.isEnchantment()) { + && input.isEnchantment(game)) { for (Target target : input.getSpellAbility().getTargets()) { filter = target.getFilter(); if (filter.match(permanent, game)) { diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/HistoricPredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/HistoricPredicate.java index 9a274ae54a..91eae7d050 100644 --- a/Mage/src/main/java/mage/filter/predicate/mageobject/HistoricPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/HistoricPredicate.java @@ -12,7 +12,7 @@ public enum HistoricPredicate implements Predicate { @Override public boolean apply(MageObject input, Game game) { - return input.isHistoric(); + return input.isHistoric(game); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/other/ArtifactSourcePredicate.java b/Mage/src/main/java/mage/filter/predicate/other/ArtifactSourcePredicate.java index f9b91af203..26ffd73233 100644 --- a/Mage/src/main/java/mage/filter/predicate/other/ArtifactSourcePredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/other/ArtifactSourcePredicate.java @@ -19,7 +19,7 @@ public class ArtifactSourcePredicate implements Predicate { public boolean apply(StackObject input, Game game) { if (input instanceof StackAbility) { StackAbility ability = (StackAbility) input; - return ability.getSourceObject(game).isArtifact(); + return ability.getSourceObject(game).isArtifact(game); } return false; } diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/AttachmentAttachedToCardTypePredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/AttachmentAttachedToCardTypePredicate.java index fdafeffdaf..4b4db63e72 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/AttachmentAttachedToCardTypePredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/AttachmentAttachedToCardTypePredicate.java @@ -17,7 +17,7 @@ public class AttachmentAttachedToCardTypePredicate implements Predicate { .stream() .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(MageObject::isEnchantment); + .anyMatch(permanent -> permanent.isEnchantment(game)); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/EnchantmentOrEnchantedPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/EnchantmentOrEnchantedPredicate.java index a37ee68d4d..8e0cbdd604 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/EnchantmentOrEnchantedPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/EnchantmentOrEnchantedPredicate.java @@ -15,10 +15,10 @@ public enum EnchantmentOrEnchantedPredicate implements Predicate { @Override public boolean apply(Permanent input, Game game) { - if (!input.isCreature()) { + if (!input.isCreature(game)) { return false; } - if (input.isEnchantment()) { + if (input.isEnchantment(game)) { return true; } return input diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 9c414c05fe..57031170bd 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -1759,7 +1759,7 @@ public abstract class GameImpl implements Game, Serializable { //getState().addCard(permanent); if (copyFromPermanent.isMorphed() || copyFromPermanent.isManifested() || copyFromPermanent.isFaceDown(this)) { - MorphAbility.setPermanentToFaceDownCreature(newBluePrint); + MorphAbility.setPermanentToFaceDownCreature(newBluePrint, this); } newBluePrint.assignNewId(); if (copyFromPermanent.isTransformed()) { @@ -2101,7 +2101,7 @@ public abstract class GameImpl implements Game, Serializable { List worldEnchantment = new ArrayList<>(); List usePowerInsteadOfToughnessForDamageLethalityFilters = getState().getActivePowerInsteadOfToughnessForDamageLethalityFilters(); for (Permanent perm : getBattlefield().getAllActivePermanents()) { - if (perm.isCreature()) { + if (perm.isCreature(this)) { //20091005 - 704.5f if (perm.getToughness().getValue() <= 0) { if (movePermanentToGraveyardWithInfo(perm)) { @@ -2168,7 +2168,7 @@ public abstract class GameImpl implements Game, Serializable { somethingHappened = true; } } - if (perm.isPlaneswalker()) { + if (perm.isPlaneswalker(this)) { //20091005 - 704.5i if (perm.getCounters(this).getCount(CounterType.LOYALTY) == 0) { if (movePermanentToGraveyardWithInfo(perm)) { @@ -2183,7 +2183,7 @@ public abstract class GameImpl implements Game, Serializable { if (perm.hasSubtype(SubType.AURA, this)) { //20091005 - 704.5n, 702.14c if (perm.getAttachedTo() == null) { - if (!perm.isCreature() && !perm.getAbilities(this).containsClass(BestowAbility.class)) { + if (!perm.isCreature(this) && !perm.getAbilities(this).containsClass(BestowAbility.class)) { if (movePermanentToGraveyardWithInfo(perm)) { somethingHappened = true; } @@ -2215,7 +2215,7 @@ public abstract class GameImpl implements Game, Serializable { if (attachedTo == null || !attachedTo.getAttachments().contains(perm.getId())) { // handle bestow unattachment Card card = this.getCard(perm.getId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(this)) { UUID wasAttachedTo = perm.getAttachedTo(); perm.attachTo(null, null, this); fireEvent(new UnattachedEvent(wasAttachedTo, perm.getId(), perm, null)); @@ -2234,7 +2234,7 @@ public abstract class GameImpl implements Game, Serializable { } else if (!auraFilter.match(attachedTo, this) || attachedTo.cantBeAttachedBy(perm, null, this, true)) { // handle bestow unattachment Card card = this.getCard(perm.getId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(this)) { UUID wasAttachedTo = perm.getAttachedTo(); perm.attachTo(null, null, this); BestowAbility.becomeCreature(perm, this); @@ -2327,7 +2327,7 @@ public abstract class GameImpl implements Game, Serializable { UUID wasAttachedTo = perm.getAttachedTo(); perm.attachTo(null, null, this); fireEvent(new UnattachedEvent(wasAttachedTo, perm.getId(), perm, null)); - } else if (!attachedTo.isCreature() || attachedTo.hasProtectionFrom(perm, this)) { + } else if (!attachedTo.isCreature(this) || attachedTo.hasProtectionFrom(perm, this)) { if (attachedTo.removeAttachment(perm.getId(), null, this)) { somethingHappened = true; } @@ -2339,7 +2339,7 @@ public abstract class GameImpl implements Game, Serializable { Permanent land = getPermanent(perm.getAttachedTo()); if (land == null || !land.getAttachments().contains(perm.getId())) { perm.attachTo(null, null, this); - } else if (!land.isLand() || land.hasProtectionFrom(perm, this)) { + } else if (!land.isLand(this) || land.hasProtectionFrom(perm, this)) { if (land.removeAttachment(perm.getId(), null, this)) { somethingHappened = true; } @@ -2353,7 +2353,7 @@ public abstract class GameImpl implements Game, Serializable { for (UUID attachmentId : perm.getAttachments()) { Permanent attachment = getPermanent(attachmentId); if (attachment != null - && (attachment.isCreature() + && (attachment.isCreature(this) || !(attachment.hasSubtype(SubType.AURA, this) || attachment.hasSubtype(SubType.EQUIPMENT, this) || attachment.hasSubtype(SubType.FORTIFICATION, this)))) { @@ -2784,7 +2784,7 @@ public abstract class GameImpl implements Game, Serializable { } } // check if it's a creature and must be removed from combat - if (perm.isCreature() && this.getCombat() != null) { + if (perm.isCreature(this) && this.getCombat() != null) { perm.removeFromCombat(this, true); } toOutside.add(perm); diff --git a/Mage/src/main/java/mage/game/MageObjectAttribute.java b/Mage/src/main/java/mage/game/MageObjectAttribute.java index 7ad09f2d1b..47f1b70e6c 100644 --- a/Mage/src/main/java/mage/game/MageObjectAttribute.java +++ b/Mage/src/main/java/mage/game/MageObjectAttribute.java @@ -2,9 +2,12 @@ package mage.game; import mage.MageObject; import mage.ObjectColor; +import mage.constants.CardType; import mage.util.SubTypes; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * This class saves changed attributes of mage objects (e.g. in command zone, graveyard, exile or @@ -16,15 +19,18 @@ public class MageObjectAttribute implements Serializable { protected ObjectColor color; protected SubTypes subtype; + protected List cardType; public MageObjectAttribute(MageObject mageObject, Game game) { color = mageObject.getColor().copy(); subtype = new SubTypes(mageObject.getSubtype(game)); + cardType = new ArrayList<>(mageObject.getCardType(game)); } public MageObjectAttribute(MageObjectAttribute mageObjectAttribute) { this.color = mageObjectAttribute.color; this.subtype = mageObjectAttribute.subtype; + this.cardType = mageObjectAttribute.cardType; } public MageObjectAttribute copy() { @@ -39,4 +45,7 @@ public class MageObjectAttribute implements Serializable { return subtype; } + public List getCardType() { + return cardType; + } } diff --git a/Mage/src/main/java/mage/game/ZonesHandler.java b/Mage/src/main/java/mage/game/ZonesHandler.java index dc9927b02e..8bc54fb6cb 100644 --- a/Mage/src/main/java/mage/game/ZonesHandler.java +++ b/Mage/src/main/java/mage/game/ZonesHandler.java @@ -322,7 +322,7 @@ public final class ZonesHandler { if (info.faceDown) { card.setFaceDown(true, game); } else if (event.getToZone().equals(Zone.BATTLEFIELD)) { - if (!card.isPermanent() + if (!card.isPermanent(game) && (!card.isTransformable() || Boolean.FALSE.equals(game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId())))) { // Non permanents (Instants, Sorceries, ... stay in the zone they are if an abilty/effect tries to move it to the battlefield return false; diff --git a/Mage/src/main/java/mage/game/combat/Combat.java b/Mage/src/main/java/mage/game/combat/Combat.java index dc0abd48e7..871387e5f8 100644 --- a/Mage/src/main/java/mage/game/combat/Combat.java +++ b/Mage/src/main/java/mage/game/combat/Combat.java @@ -157,13 +157,13 @@ public class Combat implements Serializable, Copyable { public void checkForRemoveFromCombat(Game game) { for (UUID creatureId : getAttackers()) { Permanent creature = game.getPermanent(creatureId); - if (creature != null && !creature.isCreature()) { + if (creature != null && !creature.isCreature(game)) { removeFromCombat(creatureId, game, true); } } for (UUID creatureId : getBlockers()) { Permanent creature = game.getPermanent(creatureId); - if (creature != null && !creature.isCreature()) { + if (creature != null && !creature.isCreature(game)) { removeFromCombat(creatureId, game, true); } } diff --git a/Mage/src/main/java/mage/game/command/Commander.java b/Mage/src/main/java/mage/game/command/Commander.java index 0593fa83ec..08449a16bb 100644 --- a/Mage/src/main/java/mage/game/command/Commander.java +++ b/Mage/src/main/java/mage/game/command/Commander.java @@ -170,8 +170,8 @@ public class Commander implements CommandObject { } @Override - public ArrayList getCardType() { - return sourceObject.getCardType(); + public List getCardType(Game game) { + return sourceObject.getCardType(game); } @Override diff --git a/Mage/src/main/java/mage/game/command/Dungeon.java b/Mage/src/main/java/mage/game/command/Dungeon.java index fd32eca9a2..2e6e89e44e 100644 --- a/Mage/src/main/java/mage/game/command/Dungeon.java +++ b/Mage/src/main/java/mage/game/command/Dungeon.java @@ -44,7 +44,7 @@ public class Dungeon implements CommandObject { dungeonNames.add("Dungeon of the Mad Mage"); } - private static final ArrayList emptySet = new ArrayList<>(Arrays.asList(CardType.DUNGEON)); + private static final List emptySet = Arrays.asList(CardType.DUNGEON); private static final ObjectColor emptyColor = new ObjectColor(); private static final ManaCosts emptyCost = new ManaCostsImpl<>(); @@ -217,7 +217,7 @@ public class Dungeon implements CommandObject { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { return emptySet; } diff --git a/Mage/src/main/java/mage/game/command/Emblem.java b/Mage/src/main/java/mage/game/command/Emblem.java index 2d1532a0b3..2e4fef0558 100644 --- a/Mage/src/main/java/mage/game/command/Emblem.java +++ b/Mage/src/main/java/mage/game/command/Emblem.java @@ -32,7 +32,7 @@ import java.util.UUID; */ public class Emblem implements CommandObject { - private static ArrayList emptySet = new ArrayList<>(); + private static List emptySet = new ArrayList<>(); private static ObjectColor emptyColor = new ObjectColor(); private static ManaCosts emptyCost = new ManaCostsImpl(); @@ -149,7 +149,7 @@ public class Emblem implements CommandObject { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { return emptySet; } diff --git a/Mage/src/main/java/mage/game/command/Plane.java b/Mage/src/main/java/mage/game/command/Plane.java index cd2e4bf816..ca483d8419 100644 --- a/Mage/src/main/java/mage/game/command/Plane.java +++ b/Mage/src/main/java/mage/game/command/Plane.java @@ -35,7 +35,7 @@ import java.util.UUID; */ public class Plane implements CommandObject { - private static ArrayList emptySet = new ArrayList<>(); + private static List emptySet = new ArrayList<>(); private static ObjectColor emptyColor = new ObjectColor(); private static ManaCosts emptyCost = new ManaCostsImpl(); @@ -158,7 +158,7 @@ public class Plane implements CommandObject { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { return emptySet; } diff --git a/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java b/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java index fe662cca7b..68923d697f 100644 --- a/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/AjaniSteadfastEmblem.java @@ -60,7 +60,7 @@ class AjaniSteadfastPreventEffect extends PreventionEffectImpl { if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.isPlaneswalker() && permanent.isControlledBy(source.getControllerId())) { + if (permanent != null && permanent.isPlaneswalker(game) && permanent.isControlledBy(source.getControllerId())) { return super.applies(event, source, game); } } diff --git a/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java b/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java index 8e558b2e02..17374f4865 100644 --- a/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/DarettiScrapSavantEmblem.java @@ -14,7 +14,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.target.targetpointer.FixedTarget; @@ -57,7 +56,7 @@ class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() - && zEvent.getTarget().isArtifact() + && zEvent.getTarget().isArtifact(game) && zEvent.getTarget().isOwnedBy(this.controllerId)) { this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId())); return true; diff --git a/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java b/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java index d9a5e66a07..1000b02765 100644 --- a/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/JayaBallardEmblem.java @@ -14,7 +14,6 @@ import mage.filter.StaticFilters; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.players.Player; import mage.watchers.common.CastFromGraveyardWatcher; @@ -114,8 +113,8 @@ class JayaBallardReplacementEffect extends ReplacementEffectImpl { if (Zone.GRAVEYARD == ((ZoneChangeEvent) event).getToZone()) { Card card = game.getCard(event.getSourceId()); if (card != null - && (card.isInstant() - || card.isSorcery())) { + && (card.isInstant(game) + || card.isSorcery(game))) { CastFromGraveyardWatcher watcher = game.getState().getWatcher(CastFromGraveyardWatcher.class); return watcher != null && watcher.spellWasCastFromGraveyard(event.getTargetId(), diff --git a/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java b/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java index 41bf5b2db7..f841a2437f 100644 --- a/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/KioraMasterOfTheDepthsEmblem.java @@ -49,8 +49,8 @@ class KioraFightEffect extends OneShotEffect { Permanent target = game.getPermanent(source.getFirstTarget()); if (triggeredCreature != null && target != null - && triggeredCreature.isCreature() - && target.isCreature()) { + && triggeredCreature.isCreature(game) + && target.isCreature(game)) { triggeredCreature.fight(target, source, game); return true; } diff --git a/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java b/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java index e21d2d8141..80af9b6b1a 100644 --- a/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/NarsetTranscendentEmblem.java @@ -69,7 +69,7 @@ class NarsetTranscendentCantCastEffect extends ContinuousRuleModifyingEffectImpl Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) { Card card = game.getCard(event.getSourceId()); - if (card != null && !card.isCreature()) { + if (card != null && !card.isCreature(game)) { return true; } } diff --git a/Mage/src/main/java/mage/game/command/emblems/WrennAndSixEmblem.java b/Mage/src/main/java/mage/game/command/emblems/WrennAndSixEmblem.java index cda33d8faa..be51a060e3 100644 --- a/Mage/src/main/java/mage/game/command/emblems/WrennAndSixEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/WrennAndSixEmblem.java @@ -50,7 +50,7 @@ class WrennAndSixEmblemEffect extends ContinuousEffectImpl { // Adventure cards are castable per https://twitter.com/elishffrn/status/1179047911729946624 card = ((AdventureCard) card).getSpellCard(); } - if (!card.isInstantOrSorcery()) { + if (!card.isInstantOrSorcery(game)) { continue; } Ability ability = new RetraceAbility(card); diff --git a/Mage/src/main/java/mage/game/command/planes/AgyremPlane.java b/Mage/src/main/java/mage/game/command/planes/AgyremPlane.java index 09812ac170..b8618ecf7a 100644 --- a/Mage/src/main/java/mage/game/command/planes/AgyremPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/AgyremPlane.java @@ -145,7 +145,7 @@ class AgyremRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.isCreature(); + return permanent.isCreature(game); } @Override diff --git a/Mage/src/main/java/mage/game/permanent/Battlefield.java b/Mage/src/main/java/mage/game/permanent/Battlefield.java index a472258683..b98857d682 100644 --- a/Mage/src/main/java/mage/game/permanent/Battlefield.java +++ b/Mage/src/main/java/mage/game/permanent/Battlefield.java @@ -223,13 +223,14 @@ public class Battlefield implements Serializable { * {@link CardType}. This method ignores the range of influence. * * @param type + * @param game * @return a list of {@link Permanent} * @see Permanent */ - public List getAllActivePermanents(CardType type) { + public List getAllActivePermanents(CardType type, Game game) { return field.values() .stream() - .filter(perm -> perm.isPhasedIn() && perm.getCardType().contains(type)) + .filter(perm -> perm.isPhasedIn() && perm.getCardType(game).contains(type)) .collect(Collectors.toList()); } diff --git a/Mage/src/main/java/mage/game/permanent/Permanent.java b/Mage/src/main/java/mage/game/permanent/Permanent.java index f1f195758c..5e941a7571 100644 --- a/Mage/src/main/java/mage/game/permanent/Permanent.java +++ b/Mage/src/main/java/mage/game/permanent/Permanent.java @@ -39,7 +39,7 @@ public interface Permanent extends Card, Controllable { */ void setTapped(boolean tapped); - boolean canTap(); + boolean canTap(Game game); boolean isFlipped(); diff --git a/Mage/src/main/java/mage/game/permanent/PermanentCard.java b/Mage/src/main/java/mage/game/permanent/PermanentCard.java index 50d286c5df..6ce8e1062b 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentCard.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentCard.java @@ -124,7 +124,7 @@ public class PermanentCard extends PermanentImpl { if (card instanceof PermanentCard) { this.maxLevelCounters = ((PermanentCard) card).maxLevelCounters; } - this.subtype.copyFrom(card.getSubtype(game)); + this.subtype.copyFrom(card.getSubtype()); this.supertype.clear(); supertype.addAll(card.getSuperType()); this.expansionSetCode = card.getExpansionSetCode(); diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 61c3aa51ec..efab7e0d09 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -484,8 +484,8 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } @Override - public boolean canTap() { - return !isCreature() || !hasSummoningSickness(); + public boolean canTap(Game game) { + return !isCreature(game) || !hasSummoningSickness(); } @Override @@ -880,7 +880,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } int lethal = getLethalDamage(attackerId, game); MageObject attacker = game.getObject(attackerId); - if (this.isCreature()) { + if (this.isCreature(game)) { if (checkWither(event, attacker, game)) { if (markDamage) { // mark damage only @@ -897,7 +897,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { this.damage = CardUtil.overflowInc(this.damage, actualDamage); } } - if (this.isPlaneswalker()) { + if (this.isPlaneswalker(game)) { int loyalty = getCounters(game).getCount(CounterType.LOYALTY); int countersToRemove = Math.min(actualDamage, loyalty); if (attacker != null && markDamage) { @@ -1031,7 +1031,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public int getLethalDamage(UUID attackerId, Game game) { int lethal = Integer.MAX_VALUE; - if (this.isCreature()) { + if (this.isCreature(game)) { if (game.getState().getActivePowerInsteadOfToughnessForDamageLethalityFilters().stream().anyMatch(f -> f.match(this, game))) { lethal = Math.min(lethal, power.getValue()); } else { @@ -1046,7 +1046,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { lethal = Math.min(1, lethal); } } - if (this.isPlaneswalker()) { + if (this.isPlaneswalker(game)) { lethal = Math.min(lethal, this.getCounters(game).getCount(CounterType.LOYALTY)); } return lethal; @@ -1084,7 +1084,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { controlledFromStartOfControllerTurn = false; if (this.isFaceDown(game)) { // remove some attributes here, because first apply effects comes later otherwise abilities (e.g. color related) will unintended trigger - MorphAbility.setPermanentToFaceDownCreature(this); + MorphAbility.setPermanentToFaceDownCreature(this, game); } EntersTheBattlefieldEvent event = new EntersTheBattlefieldEvent(this, source, getControllerId(), fromZone, EnterEventType.SELF); @@ -1186,7 +1186,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } else { logName = this.getLogName(); } - if (this.isCreature()) { + if (this.isCreature(game)) { game.informPlayers(logName + " died" + CardUtil.getSourceLogName(game, " by ", source, "", "")); } else { game.informPlayers(logName + " was destroyed" + CardUtil.getSourceLogName(game, " by ", source, "", "")); @@ -1436,7 +1436,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { public boolean removeFromCombat(Game game, boolean withInfo) { if (this.isAttacking() || this.blocking > 0) { return game.getCombat().removeFromCombat(objectId, game, withInfo); - } else if (this.isPlaneswalker()) { + } else if (this.isPlaneswalker(game)) { if (game.getCombat().getDefenders().contains(getId())) { game.getCombat().removePlaneswalkerFromCombat(objectId, game, withInfo); } @@ -1678,7 +1678,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { //make bestow cards and licids into creatures //aura test to stop bludgeon brawl shenanigans from using this code //consider adding code to handle that case? - if (attachment.hasSubtype(SubType.AURA, game) && attachmentCard.isCreature()) { + if (attachment.hasSubtype(SubType.AURA, game) && attachmentCard.isCreature(game)) { BestowAbility.becomeCreature(attachment, game); } } diff --git a/Mage/src/main/java/mage/game/permanent/PermanentToken.java b/Mage/src/main/java/mage/game/permanent/PermanentToken.java index 49c6294e9c..b6407ac0b1 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentToken.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentToken.java @@ -78,7 +78,7 @@ public class PermanentToken extends PermanentImpl { this.getManaCost().add(cost.copy()); } this.cardType.clear(); - this.cardType.addAll(token.getCardType()); + this.cardType.addAll(token.getCardType(game)); this.color = token.getColor(game).copy(); this.frameColor = token.getFrameColor(game); this.frameStyle = token.getFrameStyle(); diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index 1dc9de3119..4a25f489c8 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -201,7 +201,7 @@ public class Spell extends StackObjectImpl implements Card { turnController.controlPlayersTurn(game, controller.getId()); } } - if (this.isInstantOrSorcery()) { + if (this.isInstantOrSorcery(game)) { int index = 0; result = false; boolean legalParts = false; @@ -245,17 +245,15 @@ public class Spell extends StackObjectImpl implements Card { } counter(null, /*this.getSpellAbility()*/ game); return false; - } else if (this.isEnchantment() && this.hasSubtype(SubType.AURA, game)) { + } else if (this.isEnchantment(game) && this.hasSubtype(SubType.AURA, game)) { if (ability.getTargets().stillLegal(ability, game)) { boolean bestow = SpellAbilityCastMode.BESTOW.equals(ability.getSpellAbilityCastMode()); if (bestow) { // before put to play: // Must be removed first time, after that will be removed by continous effect // Otherwise effects like evolve trigger from creature comes into play event - card.getCardType().remove(CardType.CREATURE); - if (!card.hasSubtype(SubType.AURA, game)) { - card.addSubType(game, SubType.AURA); - } + card.removeCardType(CardType.CREATURE); + card.addSubType(game, SubType.AURA); } UUID permId; boolean flag; @@ -284,7 +282,7 @@ public class Spell extends StackObjectImpl implements Card { // restore removed stats (see "before put to play" above) permanent.setSpellAbility(ability); // otherwise spell ability without bestow will be set card.addCardType(CardType.CREATURE); - card.removeSubType(game, SubType.AURA); + card.getSubtype().remove(SubType.AURA); } } if (isCopy()) { @@ -304,7 +302,7 @@ public class Spell extends StackObjectImpl implements Card { return ability.resolve(game); } if (bestow) { - card.addCardType(CardType.CREATURE); + card.addCardType(game, CardType.CREATURE); } return false; } @@ -313,7 +311,7 @@ public class Spell extends StackObjectImpl implements Card { if (controller.moveCards(card, Zone.BATTLEFIELD, ability, game, false, faceDown, false, null)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent instanceof PermanentCard) { - ((PermanentCard) permanent).getCard().addCardType(CardType.CREATURE); + ((PermanentCard) permanent).getCard().addCardType(game, CardType.CREATURE); ((PermanentCard) permanent).getCard().removeSubType(game, SubType.AURA); return true; } @@ -486,11 +484,7 @@ public class Spell extends StackObjectImpl implements Card { @Override public String getLogName() { if (faceDown) { - if (this.isCreature()) { - return "face down creature spell"; - } else { - return "face down spell"; - } + return "face down spell"; } return GameLog.getColoredObjectIdName(card); } @@ -510,19 +504,19 @@ public class Spell extends StackObjectImpl implements Card { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { if (faceDown) { - ArrayList cardTypes = new ArrayList<>(); + List cardTypes = new ArrayList<>(); cardTypes.add(CardType.CREATURE); return cardTypes; } if (SpellAbilityCastMode.BESTOW.equals(this.getSpellAbility().getSpellAbilityCastMode())) { - ArrayList cardTypes = new ArrayList<>(); - cardTypes.addAll(card.getCardType()); + List cardTypes = new ArrayList<>(); + cardTypes.addAll(card.getCardType(game)); cardTypes.remove(CardType.CREATURE); return cardTypes; } - return card.getCardType(); + return card.getCardType(game); } @Override @@ -1130,4 +1124,19 @@ public class Spell extends StackObjectImpl implements Card { public String toString() { return ability.toString(); } + + @Override + public List getCardTypeForDeckbuilding() { + throw new UnsupportedOperationException("Must call for cards only."); + } + + @Override + public boolean hasCardTypeForDeckbuilding(CardType cardType) { + return false; + } + + @Override + public boolean hasSubTypeForDeckbuilding(SubType subType) { + return false; + } } diff --git a/Mage/src/main/java/mage/game/stack/StackAbility.java b/Mage/src/main/java/mage/game/stack/StackAbility.java index 5cc7332f06..61a3969b13 100644 --- a/Mage/src/main/java/mage/game/stack/StackAbility.java +++ b/Mage/src/main/java/mage/game/stack/StackAbility.java @@ -45,7 +45,7 @@ import java.util.UUID; */ public class StackAbility extends StackObjectImpl implements Ability { - private static final ArrayList emptyCardType = new ArrayList<>(); + private static final List emptyCardType = new ArrayList<>(); private static final List emptyString = new ArrayList<>(); private static final ObjectColor emptyColor = new ObjectColor(); private static final ManaCosts emptyCost = new ManaCostsImpl<>(); @@ -158,7 +158,7 @@ public class StackAbility extends StackObjectImpl implements Ability { } @Override - public ArrayList getCardType() { + public List getCardType(Game game) { return emptyCardType; } diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 9ac7974a24..6a83c8c31b 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -1130,7 +1130,7 @@ public abstract class PlayerImpl implements Player, Serializable { return false; } boolean result; - if (card.isLand()) { + if (card.isLand(game)) { result = playLand(card, game, ignoreTiming); } else { result = cast(card.getSpellAbility(), game, noMana, approvingObject); @@ -3406,7 +3406,7 @@ public abstract class PlayerImpl implements Player, Serializable { // return play ability that can activate AlternativeSourceCosts if (ability instanceof AlternativeSourceCosts && object != null && !(object instanceof Permanent)) { ActivatedAbility playAbility = null; - if (object.isLand()) { + if (object.isLand(game)) { playAbility = (PlayLandAbility) CardUtil.getAbilities(object, game).stream().filter(a -> a instanceof PlayLandAbility).findFirst().orElse(null); } else if (object instanceof Card) { playAbility = ((Card) object).getSpellAbility(); diff --git a/Mage/src/main/java/mage/util/functions/CardTypeCopyApplier.java b/Mage/src/main/java/mage/util/functions/CardTypeCopyApplier.java index 3d80a4c020..266087a4ef 100644 --- a/Mage/src/main/java/mage/util/functions/CardTypeCopyApplier.java +++ b/Mage/src/main/java/mage/util/functions/CardTypeCopyApplier.java @@ -6,7 +6,6 @@ import mage.MageObject; import mage.abilities.Ability; import mage.constants.CardType; import mage.game.Game; -import mage.game.permanent.Permanent; /** * diff --git a/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java b/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java index 5275fd6924..452c0cca07 100644 --- a/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java @@ -5,7 +5,6 @@ import mage.abilities.Ability; import mage.abilities.keyword.MorphAbility; import mage.cards.Card; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.SuperType; import mage.game.Game; import mage.game.permanent.PermanentCard; @@ -44,7 +43,7 @@ public class CopyTokenFunction implements Function { target.setCopySourceCard(((PermanentToken) source).getToken().getCopySourceCard()); } else if (source instanceof PermanentCard) { if (((PermanentCard) source).isMorphed() || ((PermanentCard) source).isManifested()) { - MorphAbility.setPermanentToFaceDownCreature(target); + MorphAbility.setPermanentToFaceDownCreature(target, game); return target; } else { if (((PermanentCard) source).isTransformed() && source.getSecondCardFace() != null) { @@ -68,7 +67,7 @@ public class CopyTokenFunction implements Function { target.getColor().setColor(sourceObj.getColor()); target.getManaCost().clear(); target.getManaCost().add(sourceObj.getManaCost()); - target.getCardType().clear(); + target.removeAllCardTypes(); for (CardType type : sourceObj.getCardType()) { target.addCardType(type); } diff --git a/Mage/src/main/java/mage/util/trace/TraceUtil.java b/Mage/src/main/java/mage/util/trace/TraceUtil.java index d9360a11ae..c5865f635f 100644 --- a/Mage/src/main/java/mage/util/trace/TraceUtil.java +++ b/Mage/src/main/java/mage/util/trace/TraceUtil.java @@ -55,7 +55,7 @@ public final class TraceUtil { if (hasIntimidate(attacker)) { for (UUID blockerId : group.getBlockers()) { Permanent blocker = game.getPermanent(blockerId); - if (blocker != null && !blocker.isArtifact() + if (blocker != null && !blocker.isArtifact(game) && !attacker.getColor(game).shares(blocker.getColor(game))) { log.warn("Found creature with intimidate blocked by non artifact not sharing color creature"); traceCombat(game, attacker, blocker); diff --git a/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java b/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java index 79da22b221..61ffaf2359 100644 --- a/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java @@ -31,7 +31,7 @@ public class CreatureWasCastWatcher extends Watcher { Spell spell = (Spell) game.getObject(event.getTargetId()); if (spell != null) { Card card = game.getCard(spell.getSourceId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { creaturesCasted.add(card.getId()); } } @@ -39,7 +39,7 @@ public class CreatureWasCastWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.isCreature()) { + if (card != null && card.isCreature(game)) { creaturesCasted.remove(card.getId()); } } diff --git a/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java b/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java index f97b7af069..a23aa62a44 100644 --- a/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java @@ -28,7 +28,7 @@ public class CreaturesDiedWatcher extends Watcher { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.isDiesEvent() && zEvent.getTarget() != null - && zEvent.getTarget().isCreature()) { + && zEvent.getTarget().isCreature(game)) { int amount = getAmountOfCreaturesDiedThisTurnByController(zEvent.getTarget().getControllerId()); amountOfCreaturesThatDiedByController.put(zEvent.getTarget().getControllerId(), amount + 1); amount = getAmountOfCreaturesDiedThisTurnByOwner(zEvent.getTarget().getOwnerId()); diff --git a/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java b/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java index 5c5882e491..28c280b3c1 100644 --- a/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java @@ -33,7 +33,7 @@ public class DamagedByWatcher extends Watcher { return; } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && !watchPlaneswalkers && !permanent.isCreature()) { + if (permanent != null && !watchPlaneswalkers && !permanent.isCreature(game)) { return; } if (sourceId.equals(event.getSourceId())) { diff --git a/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java b/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java index 2b4afc98bd..71edf28319 100644 --- a/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java @@ -28,7 +28,7 @@ public class LandfallWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); if (permanent != null - && permanent.isLand() + && permanent.isLand(game) && !playerPlayedLand.contains(event.getPlayerId())) { playerPlayedLand.add(event.getPlayerId()); landEnteredBattlefield.add(event.getTargetId()); diff --git a/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java b/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java index 0b7fb9ac7a..7f500cbb59 100644 --- a/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java @@ -24,7 +24,7 @@ public class MorbidWatcher extends Watcher { } if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent() - && ((ZoneChangeEvent) event).getTarget().isCreature()) { + && ((ZoneChangeEvent) event).getTarget().isCreature(game)) { condition = true; } } diff --git a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java index 0466fef7c8..0ea9bbc320 100644 --- a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java @@ -58,7 +58,7 @@ public class PermanentsEnteredBattlefieldWatcher extends Watcher { for (Permanent permanent : enteringBattlefieldLastTurn.get(sourcePermanent.getControllerId())) { if (!permanent.getId().equals(sourcePermanent.getId()) //|| permanent.getZoneChangeCounter(game) == sourcePermanent.getZoneChangeCounter(game) why is this needed? - && permanent.isCreature()) { + && permanent.isCreature(game)) { return true; } } diff --git a/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java index 8da3d39d6d..6023f5234e 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java @@ -27,7 +27,7 @@ public class PlayLandWatcher extends Watcher { if (event.getType() == GameEvent.EventType.LAND_PLAYED) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); if (permanent != null - && permanent.isLand() + && permanent.isLand(game) && !playerPlayedLand.contains(event.getPlayerId())) { playerPlayedLand.add(event.getPlayerId()); landPlayed.add(event.getTargetId()); diff --git a/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java index 591731ca84..e13617ef00 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java @@ -26,7 +26,7 @@ public class PlayerCastCreatureWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell.isCreature()) { + if (spell.isCreature(game)) { playerIds.add(spell.getControllerId()); } }