From 07a142c9e8ef39784d1259635187e2a4c8417a16 Mon Sep 17 00:00:00 2001 From: Alex Vasile <48962821+Alex-Vasile@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:57:30 -0400 Subject: [PATCH] Refactor: Add proper support for modifying and querying base P/T (#9409) --- .../client/dialog/NewTournamentDialog.java | 2 +- .../client/dialog/TestCardRenderDialog.java | 6 +- .../mage/card/arcane/CardRendererUtils.java | 2 +- .../src/mage/cards/a/AbominableTreefolk.java | 4 +- .../mage/cards/a/AbominationOfLlanowar.java | 4 +- .../mage/cards/a/AdamaroFirstToDesire.java | 4 +- .../cards/a/AdelineResplendentCathar.java | 4 +- .../src/mage/cards/a/AeonChronicler.java | 5 +- .../src/mage/cards/a/AllosaurusRider.java | 4 +- .../src/mage/cards/a/AllosaurusShepherd.java | 4 +- Mage.Sets/src/mage/cards/a/AltarGolem.java | 4 +- Mage.Sets/src/mage/cards/a/Amplifire.java | 19 +- .../src/mage/cards/a/AnHavvaConstable.java | 2 +- .../mage/cards/a/AnaxHardenedInTheForge.java | 4 +- Mage.Sets/src/mage/cards/a/AncientOoze.java | 4 +- .../src/mage/cards/a/AngelicEnforcer.java | 4 +- .../src/mage/cards/a/AnimateArtifact.java | 24 +- .../src/mage/cards/a/AnimatingFaerie.java | 4 +- .../src/mage/cards/a/ApocalypseDemon.java | 4 +- .../src/mage/cards/a/AquamorphEntity.java | 4 +- .../src/mage/cards/a/ArchpriestOfIona.java | 4 +- .../src/mage/cards/a/ArlinnTheMoonsFury.java | 4 +- .../src/mage/cards/a/ArniBrokenbrow.java | 4 +- .../src/mage/cards/a/AscendantSpirit.java | 14 +- .../src/mage/cards/a/AshayaSoulOfTheWild.java | 4 +- .../src/mage/cards/a/AvenMimeomancer.java | 18 +- .../src/mage/cards/a/AvenTrailblazer.java | 4 +- .../src/mage/cards/a/AwakenedAmalgam.java | 4 +- .../src/mage/cards/a/AwakenedAwareness.java | 19 +- Mage.Sets/src/mage/cards/a/AysenCrusader.java | 4 +- .../src/mage/cards/b/BattleSquadron.java | 4 +- .../src/mage/cards/b/BattlegateMimic.java | 5 +- .../src/mage/cards/b/BeanstalkGiant.java | 4 +- Mage.Sets/src/mage/cards/b/BeastOfBurden.java | 4 +- .../cards/b/BellBorcaSpectralSergeant.java | 4 +- .../src/mage/cards/b/BeltOfGiantStrength.java | 4 +- .../src/mage/cards/b/BenalishCommander.java | 5 +- .../src/mage/cards/b/BiomassMutation.java | 4 +- Mage.Sets/src/mage/cards/b/BladeOfTheOni.java | 4 +- .../src/mage/cards/b/BloodswornKnight.java | 5 +- .../src/mage/cards/b/BodyOfKnowledge.java | 4 +- .../src/mage/cards/b/BoneyardMycodrax.java | 4 +- Mage.Sets/src/mage/cards/b/BoneyardWurm.java | 4 +- .../src/mage/cards/b/BramblefortFink.java | 12 +- Mage.Sets/src/mage/cards/b/BrineHag.java | 16 +- .../src/mage/cards/b/BrokersInitiate.java | 9 +- .../src/mage/cards/b/BronzeGuardian.java | 4 +- Mage.Sets/src/mage/cards/b/Broodstar.java | 4 +- .../mage/cards/c/CallapheBelovedOfTheSea.java | 4 +- .../src/mage/cards/c/CallerOfTheHunt.java | 4 +- .../mage/cards/c/CandlekeepInspiration.java | 4 +- Mage.Sets/src/mage/cards/c/Cantivore.java | 4 +- .../src/mage/cards/c/CephalidFacetaker.java | 4 +- .../src/mage/cards/c/ChameleonSpirit.java | 10 +- .../src/mage/cards/c/ChariotOfTheSun.java | 2 +- Mage.Sets/src/mage/cards/c/ChimericCoils.java | 4 +- Mage.Sets/src/mage/cards/c/ChimericMass.java | 4 +- Mage.Sets/src/mage/cards/c/ChimericStaff.java | 4 +- .../mage/cards/c/CircleOfTheMoonDruid.java | 16 +- Mage.Sets/src/mage/cards/c/Cognivore.java | 4 +- .../src/mage/cards/c/CoilingWoodworm.java | 4 +- .../src/mage/cards/c/ConsumingAberration.java | 4 +- Mage.Sets/src/mage/cards/c/ConsumingBlob.java | 43 +- .../src/mage/cards/c/CracklingDrake.java | 4 +- .../src/mage/cards/c/CraterElemental.java | 4 +- Mage.Sets/src/mage/cards/c/Creeperhulk.java | 5 +- .../src/mage/cards/c/CreepyPuppeteer.java | 4 +- .../src/mage/cards/c/CrowdOfCinders.java | 4 +- .../src/mage/cards/c/CrusaderOfOdric.java | 4 +- .../src/mage/cards/c/CultivatorColossus.java | 4 +- .../src/mage/cards/c/CurseOfConformity.java | 4 +- .../src/mage/cards/c/CyberdriveAwakener.java | 4 +- .../src/mage/cards/d/DakkonBlackblade.java | 4 +- .../src/mage/cards/d/DakmorSorceress.java | 4 +- .../src/mage/cards/d/DanceOfTheManse.java | 4 +- Mage.Sets/src/mage/cards/d/DancingSword.java | 4 +- .../src/mage/cards/d/DarksteelJuggernaut.java | 8 +- .../src/mage/cards/d/DauntlessDourbark.java | 4 +- Mage.Sets/src/mage/cards/d/DauthiWarlord.java | 4 +- .../mage/cards/d/DaxosBlessedByTheSun.java | 4 +- Mage.Sets/src/mage/cards/d/Detritivore.java | 4 +- .../src/mage/cards/d/DevastatingSummons.java | 4 +- Mage.Sets/src/mage/cards/d/Diminish.java | 4 +- Mage.Sets/src/mage/cards/d/DodgyJalopy.java | 4 +- .../src/mage/cards/d/DonalHeraldOfWings.java | 4 +- Mage.Sets/src/mage/cards/d/DoubtlessOne.java | 4 +- Mage.Sets/src/mage/cards/d/Dracoplasm.java | 45 ++- .../src/mage/cards/d/DriftOfTheDead.java | 4 +- Mage.Sets/src/mage/cards/d/DroveOfElves.java | 4 +- Mage.Sets/src/mage/cards/d/DruidClass.java | 4 +- Mage.Sets/src/mage/cards/d/DungroveElder.java | 4 +- Mage.Sets/src/mage/cards/d/Duplicant.java | 4 +- .../src/mage/cards/e/EccentricApprentice.java | 4 +- Mage.Sets/src/mage/cards/e/EldraziMimic.java | 19 +- .../src/mage/cards/e/ElvishHouseParty.java | 4 +- .../src/mage/cards/e/ElvishImpersonators.java | 16 +- Mage.Sets/src/mage/cards/e/EnigmaDrake.java | 4 +- .../src/mage/cards/e/EntropicSpecter.java | 4 +- .../src/mage/cards/e/EssenceSymbiote.java | 2 +- .../src/mage/cards/e/EverythingamajigC.java | 4 +- .../src/mage/cards/e/EvolvedSleeper.java | 10 +- .../src/mage/cards/e/EvraHalcyonWitness.java | 10 +- .../src/mage/cards/e/ExuberantWolfbear.java | 4 +- Mage.Sets/src/mage/cards/f/FaerieSwarm.java | 4 +- .../src/mage/cards/f/FigureOfDestiny.java | 14 +- .../src/mage/cards/f/FiligreeAttendant.java | 4 +- Mage.Sets/src/mage/cards/f/Frogify.java | 1 - .../src/mage/cards/f/FungalBehemoth.java | 5 +- .../src/mage/cards/f/FuturistOperative.java | 4 +- Mage.Sets/src/mage/cards/g/GaeasAvenger.java | 4 +- Mage.Sets/src/mage/cards/g/GaeasLiege.java | 11 +- .../src/mage/cards/g/GeistHonoredMonk.java | 4 +- .../src/mage/cards/g/GelatinousGenesis.java | 4 +- Mage.Sets/src/mage/cards/g/Gigantiform.java | 7 +- Mage.Sets/src/mage/cards/g/Gigantomancer.java | 4 +- Mage.Sets/src/mage/cards/g/Gigantoplasm.java | 4 +- .../src/mage/cards/g/GodPharaohsGift.java | 4 +- Mage.Sets/src/mage/cards/g/GodheadOfAwe.java | 4 +- .../mage/cards/g/GrandMasterOfFlowers.java | 4 +- .../src/mage/cards/g/GravenDominator.java | 5 +- .../src/mage/cards/g/GristTheHungerTide.java | 7 +- Mage.Sets/src/mage/cards/h/Halfdane.java | 29 +- .../mage/cards/h/HalsinEmeraldArchdruid.java | 4 +- .../src/mage/cards/h/HarmoniousArchon.java | 4 +- Mage.Sets/src/mage/cards/h/HaughtyDjinn.java | 4 +- Mage.Sets/src/mage/cards/h/HeedlessOne.java | 4 +- .../src/mage/cards/h/HordeOfBoggarts.java | 4 +- .../src/mage/cards/h/HostileTakeover.java | 6 +- .../src/mage/cards/h/HourOfEternity.java | 4 +- Mage.Sets/src/mage/cards/h/Humble.java | 4 +- Mage.Sets/src/mage/cards/h/Humility.java | 34 +- .../src/mage/cards/i/IllusoryWrappings.java | 4 +- .../src/mage/cards/i/InkfathomWitch.java | 4 +- .../src/mage/cards/i/IronrootWarlord.java | 4 +- .../src/mage/cards/i/IslandOfWakWak.java | 7 +- Mage.Sets/src/mage/cards/i/Ixidron.java | 5 +- .../src/mage/cards/j/JaggedScarArchers.java | 4 +- .../mage/cards/j/JolraelMwonvuliRecluse.java | 4 +- .../mage/cards/k/KagemaroFirstToSuffer.java | 4 +- .../src/mage/cards/k/KalonianTwingrove.java | 4 +- .../src/mage/cards/k/KarnSilverGolem.java | 4 +- .../src/mage/cards/k/KarnTheGreatCreator.java | 4 +- Mage.Sets/src/mage/cards/k/KarnsTouch.java | 4 +- .../mage/cards/k/KatildaDawnhartMartyr.java | 5 +- .../mage/cards/k/KatsumasaTheAnimator.java | 4 +- Mage.Sets/src/mage/cards/k/KeldonWarlord.java | 4 +- Mage.Sets/src/mage/cards/k/KineticAugur.java | 4 +- Mage.Sets/src/mage/cards/k/KithkinRabble.java | 4 +- .../mage/cards/k/KiyomaroFirstToStand.java | 5 +- .../mage/cards/k/KodamaOfTheCenterTree.java | 4 +- .../src/mage/cards/k/KolaghanForerunners.java | 4 +- .../mage/cards/k/KorlashHeirToBlackblade.java | 4 +- Mage.Sets/src/mage/cards/k/KrovikanMist.java | 4 +- Mage.Sets/src/mage/cards/l/Lhurgoyf.java | 63 +-- .../src/mage/cards/l/LiegeOfTheTangle.java | 4 +- Mage.Sets/src/mage/cards/l/LifeAndLimb.java | 52 +-- Mage.Sets/src/mage/cards/l/LivingLore.java | 4 +- .../src/mage/cards/l/LordOfExtinction.java | 4 +- .../src/mage/cards/l/LostOrderOfJarkeld.java | 4 +- Mage.Sets/src/mage/cards/m/Magnivore.java | 4 +- .../mage/cards/m/MajesticMetamorphosis.java | 4 +- .../src/mage/cards/m/MajesticMyriarch.java | 4 +- Mage.Sets/src/mage/cards/m/Malignus.java | 4 +- .../src/mage/cards/m/MarathWillOfTheWild.java | 4 +- Mage.Sets/src/mage/cards/m/MaraxusOfKeld.java | 4 +- .../src/mage/cards/m/MarchOfTheMachines.java | 4 +- Mage.Sets/src/mage/cards/m/Maro.java | 4 +- Mage.Sets/src/mage/cards/m/MarshFlitter.java | 5 +- Mage.Sets/src/mage/cards/m/MassDiminish.java | 5 +- .../src/mage/cards/m/MasterOfEtherium.java | 4 +- Mage.Sets/src/mage/cards/m/MasterOfWinds.java | 6 +- .../src/mage/cards/m/MasumaroFirstToLive.java | 4 +- Mage.Sets/src/mage/cards/m/MatcaRioters.java | 4 +- .../mage/cards/m/MetamorphicAlteration.java | 4 +- Mage.Sets/src/mage/cards/m/MimingSlime.java | 4 +- Mage.Sets/src/mage/cards/m/MindlinkMech.java | 4 +- .../src/mage/cards/m/MinionOfTheWastes.java | 4 +- .../src/mage/cards/m/MinscBelovedRanger.java | 4 +- Mage.Sets/src/mage/cards/m/MirrorEntity.java | 4 +- .../src/mage/cards/m/MolimoMaroSorcerer.java | 4 +- Mage.Sets/src/mage/cards/m/MoltenSentry.java | 36 +- .../src/mage/cards/m/MonstrousWarLeech.java | 4 +- .../mage/cards/m/MordenkainensPolymorph.java | 4 +- Mage.Sets/src/mage/cards/m/Mortivore.java | 4 +- .../src/mage/cards/m/MultaniMaroSorcerer.java | 4 +- Mage.Sets/src/mage/cards/m/MwonvuliOoze.java | 4 +- Mage.Sets/src/mage/cards/m/MythRealized.java | 62 +-- Mage.Sets/src/mage/cards/n/NamelessOne.java | 4 +- Mage.Sets/src/mage/cards/n/NamelessRace.java | 4 +- Mage.Sets/src/mage/cards/n/Necrogoyf.java | 4 +- .../src/mage/cards/n/NighthawkScavenger.java | 4 +- Mage.Sets/src/mage/cards/n/Nightmare.java | 4 +- Mage.Sets/src/mage/cards/n/NightskyMimic.java | 8 +- .../src/mage/cards/n/NightstalkerEngine.java | 4 +- .../src/mage/cards/n/NishobaBrawler.java | 4 +- .../src/mage/cards/o/ObscuraConfluence.java | 4 +- .../src/mage/cards/o/OctaviaLivingThesis.java | 4 +- Mage.Sets/src/mage/cards/o/OctopusUmbra.java | 4 +- .../src/mage/cards/o/OkoTheTrickster.java | 4 +- .../src/mage/cards/o/OkoThiefOfCrowns.java | 4 +- .../src/mage/cards/o/OkosHospitality.java | 4 +- .../src/mage/cards/o/OlagLudevicsHubris.java | 4 +- .../src/mage/cards/o/OldStickfingers.java | 4 +- Mage.Sets/src/mage/cards/o/OozeFlux.java | 4 +- Mage.Sets/src/mage/cards/o/OpalTitan.java | 4 +- Mage.Sets/src/mage/cards/o/Opalescence.java | 4 +- .../src/mage/cards/o/OverbeingOfMyth.java | 4 +- .../mage/cards/o/OverwhelmingSplendor.java | 60 +-- Mage.Sets/src/mage/cards/o/Ovinize.java | 4 +- Mage.Sets/src/mage/cards/p/PackRat.java | 4 +- Mage.Sets/src/mage/cards/p/Pallimud.java | 4 +- .../src/mage/cards/p/PeopleOfTheWoods.java | 4 +- .../src/mage/cards/p/PestilenceRats.java | 4 +- .../src/mage/cards/p/PhyrexianProcessor.java | 4 +- Mage.Sets/src/mage/cards/p/PlagueRats.java | 4 +- .../src/mage/cards/p/PolymorphistsJest.java | 4 +- Mage.Sets/src/mage/cards/p/PoppetFactory.java | 4 +- Mage.Sets/src/mage/cards/p/PrimalClay.java | 74 ++-- Mage.Sets/src/mage/cards/p/PrimalPlasma.java | 5 +- Mage.Sets/src/mage/cards/p/Primalcrux.java | 4 +- .../src/mage/cards/p/PsychosisCrawler.java | 4 +- .../mage/cards/q/QueenAllenalOfRuadach.java | 4 +- .../mage/cards/q/QuicksilverGargantuan.java | 5 +- .../src/mage/cards/r/RaisedByGiants.java | 4 +- Mage.Sets/src/mage/cards/r/RecklessOne.java | 4 +- .../src/mage/cards/r/ReduceInStature.java | 4 +- .../mage/cards/r/RenataCalledToTheHunt.java | 4 +- Mage.Sets/src/mage/cards/r/Revenant.java | 4 +- .../src/mage/cards/r/RimefeatherOwl.java | 4 +- .../src/mage/cards/r/RiptideMangler.java | 6 +- Mage.Sets/src/mage/cards/r/RiseAndShine.java | 6 +- Mage.Sets/src/mage/cards/r/RisenRiptide.java | 11 +- .../src/mage/cards/r/RiverfallMimic.java | 4 +- Mage.Sets/src/mage/cards/r/RoilingHorror.java | 5 +- .../mage/cards/r/RowanScholarOfSparks.java | 4 +- Mage.Sets/src/mage/cards/r/Rubblehulk.java | 4 +- Mage.Sets/src/mage/cards/r/RustingGolem.java | 4 +- .../src/mage/cards/s/SageOfAncientLore.java | 4 +- .../mage/cards/s/SarkhanTheDragonspeaker.java | 4 +- .../mage/cards/s/SarkhanTheMasterless.java | 4 +- .../src/mage/cards/s/ScionOfTheWild.java | 4 +- .../mage/cards/s/ScourgeOfTheSkyclaves.java | 4 +- Mage.Sets/src/mage/cards/s/Sentinel.java | 4 +- .../src/mage/cards/s/SeraphOfTheMasses.java | 4 +- .../src/mage/cards/s/SerendibSorcerer.java | 4 +- Mage.Sets/src/mage/cards/s/SereneMaster.java | 6 +- .../mage/cards/s/SerpentOfTheEndlessSea.java | 4 +- .../src/mage/cards/s/SerpentineAmbush.java | 4 +- Mage.Sets/src/mage/cards/s/SerraAvatar.java | 4 +- Mage.Sets/src/mage/cards/s/SewerNemesis.java | 5 +- Mage.Sets/src/mage/cards/s/ShamblingSuit.java | 4 +- Mage.Sets/src/mage/cards/s/ShapeStealer.java | 17 +- Mage.Sets/src/mage/cards/s/Shapeshifter.java | 4 +- .../src/mage/cards/s/SharpshooterElf.java | 4 +- .../src/mage/cards/s/ShorecrasherMimic.java | 8 +- .../src/mage/cards/s/SigardasSummons.java | 4 +- .../src/mage/cards/s/SilverwingSquadron.java | 4 +- .../mage/cards/s/SimaYiWeiFieldMarshal.java | 4 +- Mage.Sets/src/mage/cards/s/SingingTree.java | 7 +- .../src/mage/cards/s/SkyshroudWarBeast.java | 24 +- Mage.Sets/src/mage/cards/s/SlagFiend.java | 4 +- Mage.Sets/src/mage/cards/s/SlimeMolding.java | 4 +- Mage.Sets/src/mage/cards/s/SludgeMonster.java | 4 +- .../src/mage/cards/s/SlumberingTora.java | 113 +++--- .../mage/cards/s/SoramaroFirstToDream.java | 4 +- .../src/mage/cards/s/SorceressQueen.java | 4 +- .../src/mage/cards/s/SoulOfEternity.java | 4 +- Mage.Sets/src/mage/cards/s/SoullessOne.java | 4 +- .../src/mage/cards/s/SoulsurgeElemental.java | 4 +- .../src/mage/cards/s/SpellheartChimera.java | 4 +- .../src/mage/cards/s/Splinterfright.java | 4 +- Mage.Sets/src/mage/cards/s/SquareUp.java | 4 +- .../src/mage/cards/s/SquelchingLeeches.java | 4 +- .../src/mage/cards/s/StarfieldOfNyx.java | 4 +- Mage.Sets/src/mage/cards/s/StormOfSouls.java | 4 +- .../mage/cards/s/StorvaldFrostGiantJarl.java | 6 +- Mage.Sets/src/mage/cards/s/Sturmgeist.java | 4 +- .../src/mage/cards/s/SuddenSpoiling.java | 39 +- Mage.Sets/src/mage/cards/s/SuitUp.java | 4 +- .../mage/cards/s/SvogthosTheRestlessTomb.java | 4 +- Mage.Sets/src/mage/cards/s/SwarmOfRats.java | 4 +- Mage.Sets/src/mage/cards/s/SwornDefender.java | 4 +- .../src/mage/cards/s/SydriGalvanicGenius.java | 4 +- Mage.Sets/src/mage/cards/s/SylvanYeti.java | 4 +- Mage.Sets/src/mage/cards/s/SymmetrySage.java | 4 +- .../mage/cards/s/SyrElenoraTheDiscerning.java | 4 +- .../src/mage/cards/t/TanazirQuandrix.java | 4 +- .../mage/cards/t/TaranikaAkroanVeteran.java | 4 +- Mage.Sets/src/mage/cards/t/Tarmogoyf.java | 44 +-- Mage.Sets/src/mage/cards/t/Terravore.java | 4 +- .../src/mage/cards/t/TerritorialKavu.java | 4 +- .../src/mage/cards/t/TerritorialMaro.java | 4 +- .../src/mage/cards/t/TestamentOfFaith.java | 6 +- .../mage/cards/t/TezzeretAgentOfBolas.java | 4 +- .../mage/cards/t/TezzeretBetrayerOfFlesh.java | 4 +- .../mage/cards/t/TezzeretCruelMachinist.java | 8 +- .../src/mage/cards/t/TezzeretTheSeeker.java | 4 +- .../src/mage/cards/t/TheAntiquitiesWar.java | 4 +- .../src/mage/cards/t/TheBearsOfLittjara.java | 4 +- .../cards/t/TheBlackstaffOfWaterdeep.java | 4 +- Mage.Sets/src/mage/cards/t/Tidewalker.java | 4 +- .../mage/cards/t/TishanaVoiceOfThunder.java | 4 +- Mage.Sets/src/mage/cards/t/TitaniasSong.java | 4 +- .../src/mage/cards/t/ToxrillTheCorrosive.java | 4 +- Mage.Sets/src/mage/cards/t/Toymaker.java | 4 +- Mage.Sets/src/mage/cards/t/TraprootKami.java | 4 +- .../src/mage/cards/t/TreeOfPerdition.java | 55 +-- .../src/mage/cards/t/TreeOfRedemption.java | 44 +-- .../src/mage/cards/t/TreefolkSeedlings.java | 4 +- Mage.Sets/src/mage/cards/t/TrenchGorger.java | 40 +- .../mage/cards/t/TymaretChosenFromDeath.java | 4 +- Mage.Sets/src/mage/cards/u/Uchuulon.java | 4 +- .../src/mage/cards/u/UktabiWildcats.java | 4 +- .../src/mage/cards/u/UlvenwaldHydra.java | 4 +- Mage.Sets/src/mage/cards/u/UmbraStalker.java | 6 +- .../src/mage/cards/u/UnlicensedHearse.java | 4 +- .../src/mage/cards/u/UrborgLhurgoyf.java | 44 +-- .../src/mage/cards/u/UurgSpawnOfTurg.java | 4 +- .../src/mage/cards/v/VedalkenHumiliator.java | 4 +- .../src/mage/cards/v/VeteranWarleader.java | 4 +- Mage.Sets/src/mage/cards/v/VhatiIlDal.java | 4 +- Mage.Sets/src/mage/cards/v/VileAggregate.java | 4 +- .../src/mage/cards/v/VoiceOfTheVermin.java | 4 +- .../mage/cards/v/VolrathTheShapestealer.java | 4 +- .../mage/cards/v/VolrathsShapeshifter.java | 4 +- .../src/mage/cards/w/WallOfTombstones.java | 4 +- .../mage/cards/w/WardenOfTheFirstTree.java | 6 +- .../src/mage/cards/w/WarkiteMarauder.java | 4 +- .../src/mage/cards/w/WayfaringTemple.java | 4 +- .../mage/cards/w/WerewolfOfAncientHunger.java | 4 +- .../src/mage/cards/w/WerewolfPackLeader.java | 4 +- .../src/mage/cards/w/WestvaleCultLeader.java | 4 +- Mage.Sets/src/mage/cards/w/WildShape.java | 4 +- .../src/mage/cards/w/WildernessElemental.java | 4 +- Mage.Sets/src/mage/cards/w/WillKenrith.java | 4 +- .../src/mage/cards/w/WingsOfVelisVel.java | 4 +- .../src/mage/cards/w/WintermoorCommander.java | 4 +- Mage.Sets/src/mage/cards/w/Withercrown.java | 4 +- .../src/mage/cards/w/WitnessProtection.java | 4 +- Mage.Sets/src/mage/cards/w/WoodElemental.java | 4 +- .../src/mage/cards/w/WoodlurkerMimic.java | 4 +- .../src/mage/cards/w/WorkshopElders.java | 4 +- Mage.Sets/src/mage/cards/w/Wurmcalling.java | 4 +- .../src/mage/cards/x/XenicPoltergeist.java | 4 +- Mage.Sets/src/mage/cards/y/YavimayaKavu.java | 8 +- .../src/mage/cards/y/YotiaDeclaresWar.java | 4 +- .../src/mage/cards/z/ZendikarIncarnate.java | 4 +- .../continuous/SetPowerToughnessTest.java | 180 +++++++++ .../test/cards/copy/IdentityThiefTest.java | 19 +- .../cards/single/emn/SoulSeparatorTest.java | 5 +- .../cards/single/emn/TreeOfPerditionTest.java | 12 +- .../test/serverside/base/CardTestAPI.java | 30 +- .../serverside/base/impl/CardTestAPIImpl.java | 372 ------------------ .../base/impl/CardTestPlayerAPIImpl.java | 80 ++-- Mage/src/main/java/mage/MageInt.java | 45 ++- .../abilities/effects/common/CopyEffect.java | 4 +- .../effects/common/CopyTokenEffect.java | 6 +- .../common/CreateTokenCopyTargetEffect.java | 4 +- .../continuous/BecomesCreatureAllEffect.java | 4 +- .../BecomesCreatureAttachedEffect.java | 4 +- .../BecomesCreatureSourceEffect.java | 8 +- .../BecomesCreatureTargetEffect.java | 4 +- .../BecomesFaceDownCreatureAllEffect.java | 4 +- .../BecomesFaceDownCreatureEffect.java | 4 +- ....java => SetBasePowerEnchantedEffect.java} | 31 +- ...ect.java => SetBasePowerSourceEffect.java} | 23 +- ...va => SetBasePowerToughnessAllEffect.java} | 22 +- ...SetBasePowerToughnessEnchantedEffect.java} | 31 +- .../SetBasePowerToughnessSourceEffect.java | 107 +++++ ...=> SetBasePowerToughnessTargetEffect.java} | 31 +- ...java => SetBaseToughnessSourceEffect.java} | 15 +- .../SetPowerToughnessSourceEffect.java | 87 ---- .../SwitchPowerToughnessAllEffect.java | 57 +-- .../SwitchPowerToughnessSourceEffect.java | 15 +- .../SwitchPowerToughnessTargetEffect.java | 13 +- .../abilities/keyword/EternalizeAbility.java | 4 +- .../abilities/keyword/LevelerCardBuilder.java | 5 +- .../mage/abilities/keyword/MorphAbility.java | 4 +- .../abilities/keyword/TransformAbility.java | 8 +- .../emblems/TezzeretTheSchemerEmblem.java | 4 +- .../java/mage/game/permanent/Permanent.java | 7 + .../mage/game/permanent/PermanentCard.java | 4 +- .../mage/game/permanent/PermanentImpl.java | 8 +- .../mage/game/permanent/PermanentToken.java | 5 +- .../mage/game/permanent/token/ATATToken.java | 5 +- .../game/permanent/token/AvatarToken.java | 4 +- .../game/permanent/token/CamaridToken.java | 5 +- .../game/permanent/token/CatWarriorToken.java | 6 +- .../token/ConsumingBlobOozeToken.java | 44 +-- .../permanent/token/DaxosSpiritToken.java | 23 +- .../permanent/token/DogIllusionToken.java | 4 +- .../permanent/token/DoomedArtisanToken.java | 4 +- .../token/ElephantResurgenceToken.java | 4 +- .../mage/game/permanent/token/EwokToken.java | 6 +- .../permanent/token/GutterGrimeToken.java | 4 +- .../game/permanent/token/HunterToken.java | 5 +- ...KalonianTwingroveTreefolkWarriorToken.java | 4 +- .../token/KaroxBladewingDragonToken.java | 6 +- .../token/NissaSageAnimistToken.java | 5 +- .../permanent/token/PharikaSnakeToken.java | 5 +- .../game/permanent/token/RagavanToken.java | 5 +- .../permanent/token/RebelStarshipToken.java | 5 +- .../mage/game/permanent/token/RebelToken.java | 5 +- .../game/permanent/token/RoyalGuardToken.java | 5 +- .../permanent/token/SaprolingBurstToken.java | 4 +- .../token/SeizeTheStormElementalToken.java | 4 +- .../permanent/token/SpiritClericToken.java | 4 +- .../game/permanent/token/TIEFighterToken.java | 5 +- .../java/mage/game/permanent/token/Token.java | 4 +- .../mage/game/permanent/token/TokenImpl.java | 11 +- .../permanent/token/TuskenRaiderToken.java | 5 +- .../token/VoiceOfResurgenceToken.java | 4 +- .../game/permanent/token/WireflyToken.java | 5 +- .../token/WrennAndSevenTreefolkToken.java | 4 +- .../util/functions/CopyTokenFunction.java | 4 +- 415 files changed, 1844 insertions(+), 2095 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/continuous/SetPowerToughnessTest.java delete mode 100644 Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java rename Mage/src/main/java/mage/abilities/effects/common/continuous/{SetPowerEnchantedEffect.java => SetBasePowerEnchantedEffect.java} (52%) rename Mage/src/main/java/mage/abilities/effects/common/continuous/{SetPowerSourceEffect.java => SetBasePowerSourceEffect.java} (57%) rename Mage/src/main/java/mage/abilities/effects/common/continuous/{SetPowerToughnessAllEffect.java => SetBasePowerToughnessAllEffect.java} (78%) rename Mage/src/main/java/mage/abilities/effects/common/continuous/{SetPowerToughnessEnchantedEffect.java => SetBasePowerToughnessEnchantedEffect.java} (55%) create mode 100644 Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java rename Mage/src/main/java/mage/abilities/effects/common/continuous/{SetPowerToughnessTargetEffect.java => SetBasePowerToughnessTargetEffect.java} (75%) rename Mage/src/main/java/mage/abilities/effects/common/continuous/{SetToughnessSourceEffect.java => SetBaseToughnessSourceEffect.java} (69%) delete mode 100644 Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index 4a68f92597..cb186e4886 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -882,7 +882,7 @@ public class NewTournamentDialog extends MageDialog { // this.spnNumPlayers.setModel(new SpinnerNumberModel(gameType.getMinPlayers(), gameType.getMinPlayers(), gameType.getMaxPlayers(), 1)); // this.spnNumPlayers.setEnabled(gameType.getMinPlayers() != gameType.getMaxPlayers()); // if (oldValue >= gameType.getMinPlayers() && oldValue <= gameType.getMaxPlayers()){ -// this.spnNumPlayers.setValue(oldValue); +// this.spnNumPlayers.setBoostedValue(oldValue); // } // this.cbAttackOption.setEnabled(gameType.isUseAttackOption()); // this.cbRange.setEnabled(gameType.isUseRange()); diff --git a/Mage.Client/src/main/java/mage/client/dialog/TestCardRenderDialog.java b/Mage.Client/src/main/java/mage/client/dialog/TestCardRenderDialog.java index 327285a359..15c34e7c46 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/TestCardRenderDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/TestCardRenderDialog.java @@ -110,7 +110,7 @@ public class TestCardRenderDialog extends MageDialog { this.removeDialog(); } - private PermanentView createPermanentCard(Game game, UUID controllerId, String code, String cardNumber, int power, int toughness, int damage, boolean tapped, boolean transform, List extraAbilities) { + private PermanentView createPermanentCard(Game game, UUID controllerId, String code, String cardNumber, int powerBoosted, int toughnessBoosted, int damage, boolean tapped, boolean transform, List extraAbilities) { CardInfo cardInfo = CardRepository.instance.findCard(code, cardNumber); ExpansionInfo setInfo = ExpansionRepository.instance.getSetByCode(code); CardSetInfo testSet = new CardSetInfo(cardInfo.getName(), setInfo.getCode(), cardNumber, cardInfo.getRarity(), @@ -133,8 +133,8 @@ public class TestCardRenderDialog extends MageDialog { } if (damage > 0) perm.damage(damage, controllerId, null, game); - if (power > 0) perm.getPower().setValue(power); - if (toughness > 0) perm.getToughness().setValue(toughness); + if (powerBoosted > 0) perm.getPower().setBoostedValue(powerBoosted); + if (toughnessBoosted > 0) perm.getToughness().setBoostedValue(toughnessBoosted); perm.removeSummoningSickness(); perm.setTapped(tapped); PermanentView cardView = new PermanentView(perm, permCard, controllerId, game); diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java index 16a0549acf..413d3d04a6 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java @@ -244,7 +244,7 @@ public final class CardRendererUtils { // boost colorizing if (value != null) { int current = value.getValue(); - int origin = value.getBaseValueModified(); + int origin = value.getModifiedBaseValue(); if (origin != 0) { if (current < origin) { return textLight ? CARD_TEXT_COLOR_BAD_LIGHT : CARD_TEXT_COLOR_BAD_DARK; diff --git a/Mage.Sets/src/mage/cards/a/AbominableTreefolk.java b/Mage.Sets/src/mage/cards/a/AbominableTreefolk.java index 6e6ffbca3b..76856dba75 100644 --- a/Mage.Sets/src/mage/cards/a/AbominableTreefolk.java +++ b/Mage.Sets/src/mage/cards/a/AbominableTreefolk.java @@ -8,7 +8,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; import mage.abilities.effects.common.TapTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -45,7 +45,7 @@ public final class AbominableTreefolk extends CardImpl { // Abominable Treefolk's power and toughness are each equal to the number of snow permanents you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame) )); // When Abominable Treefolk enters the battlefield, tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step. diff --git a/Mage.Sets/src/mage/cards/a/AbominationOfLlanowar.java b/Mage.Sets/src/mage/cards/a/AbominationOfLlanowar.java index 502c44f8a0..bb441771b9 100644 --- a/Mage.Sets/src/mage/cards/a/AbominationOfLlanowar.java +++ b/Mage.Sets/src/mage/cards/a/AbominationOfLlanowar.java @@ -6,7 +6,7 @@ import mage.abilities.dynamicvalue.AdditiveDynamicValue; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.MenaceAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; @@ -54,7 +54,7 @@ public final class AbominationOfLlanowar extends CardImpl { // Abomination of Llanowar's power and toughness are each equal to the number of Elves you control plus the number of Elf cards in your graveyard. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame) )); } diff --git a/Mage.Sets/src/mage/cards/a/AdamaroFirstToDesire.java b/Mage.Sets/src/mage/cards/a/AdamaroFirstToDesire.java index 4a4bfa13e2..a8ea2ff386 100644 --- a/Mage.Sets/src/mage/cards/a/AdamaroFirstToDesire.java +++ b/Mage.Sets/src/mage/cards/a/AdamaroFirstToDesire.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -29,7 +29,7 @@ public final class AdamaroFirstToDesire extends CardImpl { this.toughness = new MageInt(0); // Adamaro, First to Desire's power and toughness are each equal to the number of cards in the hand of the opponent with the most cards in hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new MostCardsInOpponentsHandCount(), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new MostCardsInOpponentsHandCount(), Duration.EndOfGame))); } private AdamaroFirstToDesire(final AdamaroFirstToDesire card) { diff --git a/Mage.Sets/src/mage/cards/a/AdelineResplendentCathar.java b/Mage.Sets/src/mage/cards/a/AdelineResplendentCathar.java index 7af6c79609..157f5d7459 100644 --- a/Mage.Sets/src/mage/cards/a/AdelineResplendentCathar.java +++ b/Mage.Sets/src/mage/cards/a/AdelineResplendentCathar.java @@ -7,7 +7,7 @@ import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.constants.*; import mage.abilities.keyword.VigilanceAbility; @@ -35,7 +35,7 @@ public final class AdelineResplendentCathar extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Adeline, Resplendent Cathar's power is equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect( CreaturesYouControlCount.instance, Duration.EndOfGame)).addHint(CreaturesYouControlHint.instance) ); diff --git a/Mage.Sets/src/mage/cards/a/AeonChronicler.java b/Mage.Sets/src/mage/cards/a/AeonChronicler.java index 3e493fed3c..cd8531a49f 100644 --- a/Mage.Sets/src/mage/cards/a/AeonChronicler.java +++ b/Mage.Sets/src/mage/cards/a/AeonChronicler.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.SuspendAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -20,7 +20,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; /** * @@ -36,7 +35,7 @@ public final class AeonChronicler extends CardImpl { this.toughness = new MageInt(0); // Aeon Chronicler's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); // Suspend X-{X}{3}{U}. X can't be 0. this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{3}{U}"), this, true)); diff --git a/Mage.Sets/src/mage/cards/a/AllosaurusRider.java b/Mage.Sets/src/mage/cards/a/AllosaurusRider.java index 05d5719e1f..7b14ab8030 100644 --- a/Mage.Sets/src/mage/cards/a/AllosaurusRider.java +++ b/Mage.Sets/src/mage/cards/a/AllosaurusRider.java @@ -10,7 +10,7 @@ import mage.abilities.costs.common.ExileFromHandCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.IntPlusDynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -47,7 +47,7 @@ public final class AllosaurusRider extends CardImpl { // Allosaurus Rider's power and toughness are each equal to 1 plus the number of lands you control. DynamicValue onePlusControlledLands = new IntPlusDynamicValue(1, new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent("lands you control"))); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(onePlusControlledLands, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(onePlusControlledLands, Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/a/AllosaurusShepherd.java b/Mage.Sets/src/mage/cards/a/AllosaurusShepherd.java index f239034686..d8f1e01940 100644 --- a/Mage.Sets/src/mage/cards/a/AllosaurusShepherd.java +++ b/Mage.Sets/src/mage/cards/a/AllosaurusShepherd.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CantBeCounteredControlledEffect; import mage.abilities.effects.common.continuous.CreaturesBecomeOtherTypeEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -48,7 +48,7 @@ public class AllosaurusShepherd extends CardImpl { //4GG: Until end of turn, each Elf creature you control has base power and toughness 5/5 // and becomes a Dinosaur in addition to its other creature types. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SetPowerToughnessAllEffect(5, 5, Duration.EndOfTurn, elvesFilter, true) + new SetBasePowerToughnessAllEffect(5, 5, Duration.EndOfTurn, elvesFilter, true) .setText("Until end of turn, each Elf creature you control has base power and toughness 5/5"), new ManaCostsImpl<>("{4}{G}{G}")); ability.addEffect(new CreaturesBecomeOtherTypeEffect(elvesFilter, SubType.DINOSAUR, Duration.EndOfTurn) diff --git a/Mage.Sets/src/mage/cards/a/AltarGolem.java b/Mage.Sets/src/mage/cards/a/AltarGolem.java index 19c2551868..236dffcdea 100644 --- a/Mage.Sets/src/mage/cards/a/AltarGolem.java +++ b/Mage.Sets/src/mage/cards/a/AltarGolem.java @@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; import mage.abilities.effects.common.UntapSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -48,7 +48,7 @@ public final class AltarGolem extends CardImpl { // Altar Golem's power and toughness are each equal to the number of creatures on the battlefield. DynamicValue amount = new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("creatures on the battlefield")); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(amount, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(amount, Duration.EndOfGame))); // Altar Golem doesn't untap during your untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); diff --git a/Mage.Sets/src/mage/cards/a/Amplifire.java b/Mage.Sets/src/mage/cards/a/Amplifire.java index b8a7cc9354..0a1bdcd8ad 100644 --- a/Mage.Sets/src/mage/cards/a/Amplifire.java +++ b/Mage.Sets/src/mage/cards/a/Amplifire.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.*; import mage.constants.*; import mage.game.Game; @@ -24,7 +24,9 @@ public final class Amplifire extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - // At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. Until your next turn, Amplifire's base power becomes twice that card's power and its base toughness becomes twice that card's toughness. Put the revealed cards on the bottom of your library in a random order. + // At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. + // Until your next turn, Amplifire's base power becomes twice that card's power and its base toughness becomes twice that card's toughness. + // Put the revealed cards on the bottom of your library in a random order. this.addAbility(new BeginningOfUpkeepTriggeredAbility( new AmplifireEffect(), TargetController.YOU, false )); @@ -78,11 +80,14 @@ class AmplifireEffect extends OneShotEffect { } player.revealCards(source, cards, game); if (lastCard != null) { - game.addEffect(new SetPowerToughnessSourceEffect( - 2 * lastCard.getPower().getValue(), - 2 * lastCard.getToughness().getValue(), - Duration.UntilYourNextTurn, SubLayer.SetPT_7b - ), source); + SetBasePowerToughnessSourceEffect setBasePowerToughnessSourceEffect = new SetBasePowerToughnessSourceEffect( + 2*lastCard.getPower().getValue(), + 2*lastCard.getToughness().getValue(), + Duration.UntilYourNextTurn, + SubLayer.SetPT_7b, + true + ); + game.addEffect(setBasePowerToughnessSourceEffect, source); } player.putCardsOnBottomOfLibrary(cards, game, source, false); return true; diff --git a/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java b/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java index 98d3da2f8a..3fbd130899 100644 --- a/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java +++ b/Mage.Sets/src/mage/cards/a/AnHavvaConstable.java @@ -70,7 +70,7 @@ class AnHavvaConstableEffect extends ContinuousEffectImpl { filter.add(new ColorPredicate(ObjectColor.GREEN)); int numberOfGreenCreatures = game.getBattlefield().count(filter, source.getSourceId(), source, game); - mageObject.getToughness().setValue(1 + numberOfGreenCreatures); + mageObject.getToughness().setModifiedBaseValue(1 + numberOfGreenCreatures); return true; } diff --git a/Mage.Sets/src/mage/cards/a/AnaxHardenedInTheForge.java b/Mage.Sets/src/mage/cards/a/AnaxHardenedInTheForge.java index ee4c1b1686..5e64af2763 100644 --- a/Mage.Sets/src/mage/cards/a/AnaxHardenedInTheForge.java +++ b/Mage.Sets/src/mage/cards/a/AnaxHardenedInTheForge.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -42,7 +42,7 @@ public final class AnaxHardenedInTheForge extends CardImpl { // Anax's power is equal to your devotion to red. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerSourceEffect(DevotionCount.R, Duration.EndOfGame) + new SetBasePowerSourceEffect(DevotionCount.R, Duration.EndOfGame) .setText("{this}'s power is equal to your devotion to red") ).addHint(DevotionCount.R.getHint())); diff --git a/Mage.Sets/src/mage/cards/a/AncientOoze.java b/Mage.Sets/src/mage/cards/a/AncientOoze.java index d10c2a7b4b..5088025743 100644 --- a/Mage.Sets/src/mage/cards/a/AncientOoze.java +++ b/Mage.Sets/src/mage/cards/a/AncientOoze.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -32,7 +32,7 @@ public final class AncientOoze extends CardImpl { this.toughness = new MageInt(0); // Ancient Ooze's power and toughness are each equal to the total converted mana cost of other creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new AncientOozePowerToughnessValue(), Duration.EndOfGame) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new AncientOozePowerToughnessValue(), Duration.EndOfGame) .setText("{this}'s power and toughness are each equal to the total mana value of other creatures you control.") )); } diff --git a/Mage.Sets/src/mage/cards/a/AngelicEnforcer.java b/Mage.Sets/src/mage/cards/a/AngelicEnforcer.java index a1b545ee4c..4d999768d8 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicEnforcer.java +++ b/Mage.Sets/src/mage/cards/a/AngelicEnforcer.java @@ -6,7 +6,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.GainAbilityControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; @@ -39,7 +39,7 @@ public final class AngelicEnforcer extends CardImpl { this.addAbility(new SimpleStaticAbility(new GainAbilityControllerEffect(HexproofAbility.getInstance()))); // Angelic Enforcer's power and toughness are each equal to your life total. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect( ControllerLifeCount.instance, Duration.EndOfGame ).setText("{this}'s power and toughness are each equal to your life total"))); diff --git a/Mage.Sets/src/mage/cards/a/AnimateArtifact.java b/Mage.Sets/src/mage/cards/a/AnimateArtifact.java index 573bafd48c..d4dd493587 100644 --- a/Mage.Sets/src/mage/cards/a/AnimateArtifact.java +++ b/Mage.Sets/src/mage/cards/a/AnimateArtifact.java @@ -75,19 +75,21 @@ class AnimateArtifactContinuousEffect extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { // Not sure, if this is layerwise handled absolutely correctly Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null) { - Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); - if (permanent != null && !permanent.isCreature(game)) { - if (sublayer == SubLayer.NA) { - permanent.addCardType(game, CardType.CREATURE); - permanent.getPower().setValue(permanent.getManaValue()); - permanent.getToughness().setValue(permanent.getManaValue()); - } - } - return true; + if (enchantment == null) { + return false; + } + Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); + if (permanent == null || permanent.isCreature(game)) { + return false; + } + if (sublayer != SubLayer.NA) { + return false; } - return false; + permanent.addCardType(game, CardType.CREATURE); + permanent.getPower().setModifiedBaseValue(permanent.getManaValue()); + permanent.getToughness().setModifiedBaseValue(permanent.getManaValue()); + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java b/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java index 3929eb3c92..26818be72f 100644 --- a/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java +++ b/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java @@ -2,7 +2,7 @@ package mage.cards.a; import mage.MageInt; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.AdventureCard; @@ -45,7 +45,7 @@ public final class AnimatingFaerie extends AdventureCard { this.getSpellCard().getSpellAbility().addEffect(new AddCardTypeTargetEffect( Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE ).setText("Target noncreature artifact you control becomes a 0/0 artifact creature")); - this.getSpellCard().getSpellAbility().addEffect(new SetPowerToughnessTargetEffect( + this.getSpellCard().getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect( 0, 0, Duration.EndOfGame ).setText("Put four +1/+1 counters on it.")); this.getSpellCard().getSpellAbility().addEffect(new AddCountersTargetEffect( diff --git a/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java b/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java index 9d63be36d5..cee725b9e7 100644 --- a/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java +++ b/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.TapSourceUnlessPaysEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,7 +36,7 @@ public final class ApocalypseDemon extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Apocalypse Demon's power and toughness are each equal to the number of cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerGraveyardCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInControllerGraveyardCount(), Duration.EndOfGame))); // At the beginning of your upkeep, tap Apocalypse Demon unless you sacrifice another creature. TapSourceUnlessPaysEffect tapEffect = new TapSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))); diff --git a/Mage.Sets/src/mage/cards/a/AquamorphEntity.java b/Mage.Sets/src/mage/cards/a/AquamorphEntity.java index 3d3668de60..8342545ca5 100644 --- a/Mage.Sets/src/mage/cards/a/AquamorphEntity.java +++ b/Mage.Sets/src/mage/cards/a/AquamorphEntity.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.MorphAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -126,7 +126,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { toughness = 5; break; } - game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, true), source); return false; } diff --git a/Mage.Sets/src/mage/cards/a/ArchpriestOfIona.java b/Mage.Sets/src/mage/cards/a/ArchpriestOfIona.java index 6ad17a936c..ba263fbabc 100644 --- a/Mage.Sets/src/mage/cards/a/ArchpriestOfIona.java +++ b/Mage.Sets/src/mage/cards/a/ArchpriestOfIona.java @@ -9,7 +9,7 @@ import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.dynamicvalue.common.PartyCount; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.common.PartyCountHint; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -35,7 +35,7 @@ public final class ArchpriestOfIona extends CardImpl { // Archpriest of Iona's power is equal to the number of creatures in your party. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerSourceEffect( + new SetBasePowerSourceEffect( PartyCount.instance, Duration.EndOfGame ).setText("{this}'s power is equal to the number of creatures in your party. " + PartyCount.getReminder()) ).addHint(PartyCountHint.instance)); diff --git a/Mage.Sets/src/mage/cards/a/ArlinnTheMoonsFury.java b/Mage.Sets/src/mage/cards/a/ArlinnTheMoonsFury.java index 3488bbb9a9..f0eca695f9 100644 --- a/Mage.Sets/src/mage/cards/a/ArlinnTheMoonsFury.java +++ b/Mage.Sets/src/mage/cards/a/ArlinnTheMoonsFury.java @@ -91,8 +91,8 @@ class ArlinnTheMoonsFuryEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(5); - permanent.getToughness().setValue(5); + permanent.getPower().setModifiedBaseValue(5); + permanent.getToughness().setModifiedBaseValue(5); return true; } } diff --git a/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java b/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java index c930da96a0..3a2249faf0 100644 --- a/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java +++ b/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.BoastAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; @@ -88,7 +88,7 @@ class ArniBrokenbrowEffect extends OneShotEffect { if (controller.chooseUse(outcome, "Change base power of " + mageObject.getLogName() + " to " + power + " until end of turn?", source, game )) { - game.addEffect(new SetPowerSourceEffect(StaticValue.get(power), Duration.EndOfTurn), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(StaticValue.get(power), null, Duration.EndOfTurn, SubLayer.SetPT_7b, true), source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/a/AscendantSpirit.java b/Mage.Sets/src/mage/cards/a/AscendantSpirit.java index 57ce64a599..19a561a600 100644 --- a/Mage.Sets/src/mage/cards/a/AscendantSpirit.java +++ b/Mage.Sets/src/mage/cards/a/AscendantSpirit.java @@ -9,7 +9,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -36,8 +36,12 @@ public final class AscendantSpirit extends CardImpl { Ability ability = new SimpleActivatedAbility(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.SPIRIT, SubType.WARRIOR ).setText("{this} becomes a Spirit Warrior"), new ManaCostsImpl<>("{S}{S}")); - ability.addEffect(new SetPowerToughnessSourceEffect( - 2, 3, Duration.Custom, SubLayer.SetPT_7b + ability.addEffect(new SetBasePowerToughnessSourceEffect( + 2, + 3, + Duration.WhileOnBattlefield, + SubLayer.SetPT_7b, + true ).setText("with base power and toughness 2/3")); this.addAbility(ability); @@ -89,8 +93,8 @@ class AscendantSpiritWarriorEffect extends OneShotEffect { game.addEffect(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.SPIRIT, SubType.WARRIOR, SubType.ANGEL ), source); - game.addEffect(new SetPowerToughnessSourceEffect( - 4, 4, Duration.Custom, SubLayer.SetPT_7b + game.addEffect(new SetBasePowerToughnessSourceEffect( + 4, 4, Duration.Custom, SubLayer.SetPT_7b, true ), source); return true; } diff --git a/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java b/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java index 64bf0edd60..675904f004 100644 --- a/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java +++ b/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.LandsYouControlCount; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class AshayaSoulOfTheWild extends CardImpl { // Ashaya, Soul of the Wild’s power and toughness are each equal to the number of lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame) )); // Nontoken creatures you control are Forest lands in addition to their other types. (They’re still affected by summoning sickness.) diff --git a/Mage.Sets/src/mage/cards/a/AvenMimeomancer.java b/Mage.Sets/src/mage/cards/a/AvenMimeomancer.java index 5a6681c247..7d8c5cc7be 100644 --- a/Mage.Sets/src/mage/cards/a/AvenMimeomancer.java +++ b/Mage.Sets/src/mage/cards/a/AvenMimeomancer.java @@ -28,8 +28,6 @@ public final class AvenMimeomancer extends CardImpl { this.subtype.add(SubType.BIRD); this.subtype.add(SubType.WIZARD); - - this.power = new MageInt(3); this.toughness = new MageInt(1); @@ -58,6 +56,7 @@ class AvenEffect extends ContinuousEffectImpl { public AvenEffect() { super(Duration.Custom, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + this.staticText = "If you do, that creature has base power and toughness 3/1 and has flying for as long as it has a feather counter on it"; } public AvenEffect(final AvenEffect effect) { @@ -72,12 +71,12 @@ class AvenEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (target != null) { - target.getPower().setValue(3); - target.getToughness().setValue(1); - return true; + if (target == null) { + return false; } - return false; + target.getPower().setModifiedBaseValue(3); + target.getToughness().setModifiedBaseValue(1); + return true; } @Override @@ -88,11 +87,6 @@ class AvenEffect extends ContinuousEffectImpl { } return false; } - - @Override - public String getText(Mode mode) { - return "If you do, that creature has base power and toughness 3/1 and has flying for as long as it has a feather counter on it"; - } } class AvenEffect2 extends ContinuousEffectImpl { diff --git a/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java b/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java index 9954e2607b..69fd86f099 100644 --- a/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java +++ b/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java @@ -3,7 +3,7 @@ package mage.cards.a; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -30,7 +30,7 @@ public final class AvenTrailblazer extends CardImpl { // Domain - Aven Trailblazer's toughness is equal to the number of basic land types among lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame) + Zone.ALL, new SetBaseToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame) .setText("{this}'s toughness is equal to the number of basic land types among lands you control") ).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); } diff --git a/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java b/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java index 8d905c9666..4ce68e2a61 100644 --- a/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java +++ b/Mage.Sets/src/mage/cards/a/AwakenedAmalgam.java @@ -9,7 +9,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class AwakenedAmalgam extends CardImpl { // Awakened Amalgam's power and toughness are each equal to the number of differently named lands you control. DynamicValue value = (new AwakenedAmalgamLandNamesCount()); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame))); } private AwakenedAmalgam(final AwakenedAmalgam card) { diff --git a/Mage.Sets/src/mage/cards/a/AwakenedAwareness.java b/Mage.Sets/src/mage/cards/a/AwakenedAwareness.java index ed28639948..3c52486f61 100644 --- a/Mage.Sets/src/mage/cards/a/AwakenedAwareness.java +++ b/Mage.Sets/src/mage/cards/a/AwakenedAwareness.java @@ -74,14 +74,17 @@ class AwakenedAwarenessEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Permanent enchantment = source.getSourcePermanentIfItStillExists(game); - if (enchantment != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null && creature.isCreature(game)) { - creature.getPower().setValue(1); - creature.getToughness().setValue(1); - return true; - } + if (enchantment == null) { + return false; } - return false; + + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature == null || !creature.isCreature(game)) { + return false; + } + + creature.getPower().setModifiedBaseValue(1); + creature.getToughness().setModifiedBaseValue(1); + return true; } } diff --git a/Mage.Sets/src/mage/cards/a/AysenCrusader.java b/Mage.Sets/src/mage/cards/a/AysenCrusader.java index 0b9a18cbc9..5b541b9105 100644 --- a/Mage.Sets/src/mage/cards/a/AysenCrusader.java +++ b/Mage.Sets/src/mage/cards/a/AysenCrusader.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.IntPlusDynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,7 +44,7 @@ public final class AysenCrusader extends CardImpl { // Aysen Crusader's power and toughness are each equal to 2 plus the number of Soldiers and Warriors you control. DynamicValue value = new IntPlusDynamicValue(2, new PermanentsOnBattlefieldCount(filter)); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame))); } private AysenCrusader(final AysenCrusader card) { diff --git a/Mage.Sets/src/mage/cards/b/BattleSquadron.java b/Mage.Sets/src/mage/cards/b/BattleSquadron.java index 88d3fb5ce7..d9060db85d 100644 --- a/Mage.Sets/src/mage/cards/b/BattleSquadron.java +++ b/Mage.Sets/src/mage/cards/b/BattleSquadron.java @@ -3,7 +3,7 @@ package mage.cards.b; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -30,7 +30,7 @@ public final class BattleSquadron extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Battle Squadron's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/b/BattlegateMimic.java b/Mage.Sets/src/mage/cards/b/BattlegateMimic.java index 86ae874cce..5e08f749b8 100644 --- a/Mage.Sets/src/mage/cards/b/BattlegateMimic.java +++ b/Mage.Sets/src/mage/cards/b/BattlegateMimic.java @@ -7,7 +7,7 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -41,7 +41,8 @@ public final class BattlegateMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both red and white, Battlegate Mimic has base power and toughness 4/2 and gains first strike until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 2, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); + SetBasePowerToughnessSourceEffect baseToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(4, 2, Duration.EndOfTurn, SubLayer.SetPT_7b, true); + Ability ability = new SpellCastControllerTriggeredAbility(baseToughnessSourceEffect, filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java b/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java index 533ba12590..496d2a7b93 100644 --- a/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java +++ b/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.AdventureCard; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class BeanstalkGiant extends AdventureCard { this.toughness = new MageInt(0); // Beanstalk Giant's power and toughness are each equal to the number of lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // Fertile Footsteps // Search your library for a basic land card, put it onto the battlefield, then shuffle your library. diff --git a/Mage.Sets/src/mage/cards/b/BeastOfBurden.java b/Mage.Sets/src/mage/cards/b/BeastOfBurden.java index e1babaa426..f0fdbf83ce 100644 --- a/Mage.Sets/src/mage/cards/b/BeastOfBurden.java +++ b/Mage.Sets/src/mage/cards/b/BeastOfBurden.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -28,7 +28,7 @@ public final class BeastOfBurden extends CardImpl { this.toughness = new MageInt(0); // Beast of Burden's power and toughness are each equal to the number of creatures on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("creatures on the battlefield")), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("creatures on the battlefield")), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/b/BellBorcaSpectralSergeant.java b/Mage.Sets/src/mage/cards/b/BellBorcaSpectralSergeant.java index 8fb3f13aa2..5dae1f7568 100644 --- a/Mage.Sets/src/mage/cards/b/BellBorcaSpectralSergeant.java +++ b/Mage.Sets/src/mage/cards/b/BellBorcaSpectralSergeant.java @@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect; import mage.abilities.effects.common.InfoEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -46,7 +46,7 @@ public final class BellBorcaSpectralSergeant extends CardImpl { this.addAbility(BellBorcaSpectralSergeantAbility.getInstance()); // Bell Borca, Spectral Sergeant's power is equal to the greatest number noted for it this turn. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect( BellBorcaSpectralSergeantValue.instance, Duration.EndOfGame ).setText("{this}'s power is equal to the greatest number noted for it this turn"))); diff --git a/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java b/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java index f845413283..cd9693c66f 100644 --- a/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java +++ b/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java @@ -3,7 +3,7 @@ package mage.cards.b; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.CostAdjuster; -import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessEnchantedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -29,7 +29,7 @@ public final class BeltOfGiantStrength extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // Equipped creature has base power and toughness 10/10. - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessEnchantedEffect(10, 10) + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessEnchantedEffect(10, 10) .setText("equipped creature has base power and toughness 10/10"))); // Equip {10}. This ability costs {X} less to activate where X is the power of the creature it targets. diff --git a/Mage.Sets/src/mage/cards/b/BenalishCommander.java b/Mage.Sets/src/mage/cards/b/BenalishCommander.java index 6130e0334c..0a00e2fa86 100644 --- a/Mage.Sets/src/mage/cards/b/BenalishCommander.java +++ b/Mage.Sets/src/mage/cards/b/BenalishCommander.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.SuspendAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -20,7 +20,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.game.permanent.token.SoldierToken; /** @@ -43,7 +42,7 @@ public final class BenalishCommander extends CardImpl { this.toughness = new MageInt(0); // Benalish Commander's power and toughness are each equal to the number of Soldiers you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // Suspend X-{X}{W}{W}. X can't be 0. this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{W}{W}"), this, true)); diff --git a/Mage.Sets/src/mage/cards/b/BiomassMutation.java b/Mage.Sets/src/mage/cards/b/BiomassMutation.java index 0ad4d1fc7d..fbe879d4f6 100644 --- a/Mage.Sets/src/mage/cards/b/BiomassMutation.java +++ b/Mage.Sets/src/mage/cards/b/BiomassMutation.java @@ -4,7 +4,7 @@ package mage.cards.b; import java.util.UUID; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.ManacostVariableValue; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -23,7 +23,7 @@ public final class BiomassMutation extends CardImpl { // Creatures you control have base power and toughness X/X until end of turn. DynamicValue variableMana = ManacostVariableValue.REGULAR; - this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true)); + this.getSpellAbility().addEffect(new SetBasePowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true)); } private BiomassMutation(final BiomassMutation card) { diff --git a/Mage.Sets/src/mage/cards/b/BladeOfTheOni.java b/Mage.Sets/src/mage/cards/b/BladeOfTheOni.java index ed6a5b035e..50565152d7 100644 --- a/Mage.Sets/src/mage/cards/b/BladeOfTheOni.java +++ b/Mage.Sets/src/mage/cards/b/BladeOfTheOni.java @@ -88,8 +88,8 @@ class BladeOfTheOniEffect extends ContinuousEffectImpl { if (sublayer != SubLayer.SetPT_7b) { return false; } - permanent.getPower().setValue(5); - permanent.getToughness().setValue(5); + permanent.getPower().setModifiedBaseValue(5); + permanent.getToughness().setModifiedBaseValue(5); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/b/BloodswornKnight.java b/Mage.Sets/src/mage/cards/b/BloodswornKnight.java index 941c1fce0f..9d5dc70958 100644 --- a/Mage.Sets/src/mage/cards/b/BloodswornKnight.java +++ b/Mage.Sets/src/mage/cards/b/BloodswornKnight.java @@ -10,13 +10,14 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; +import mage.constants.Zone; import mage.filter.StaticFilters; import java.util.UUID; @@ -41,7 +42,7 @@ public final class BloodswornKnight extends CardImpl { this.nightCard = true; // Bloodsworn Knight's power and toughness are each equal to the number of creature cards in your graveyard. - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // {1}{B}, Discard a card: Bloodsworn Knight gains indestructible until end of turn. Tap it. Ability ability = new SimpleActivatedAbility( diff --git a/Mage.Sets/src/mage/cards/b/BodyOfKnowledge.java b/Mage.Sets/src/mage/cards/b/BodyOfKnowledge.java index 1f82d8433a..13819a67b6 100644 --- a/Mage.Sets/src/mage/cards/b/BodyOfKnowledge.java +++ b/Mage.Sets/src/mage/cards/b/BodyOfKnowledge.java @@ -7,7 +7,7 @@ import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.dynamicvalue.common.SavedDamageValue; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -32,7 +32,7 @@ public final class BodyOfKnowledge extends CardImpl { // Body of Knowledge's power and toughness are each equal to the number of cards in your hand. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerToughnessSourceEffect( + new SetBasePowerToughnessSourceEffect( CardsInControllerHandCount.instance, Duration.EndOfGame ) )); diff --git a/Mage.Sets/src/mage/cards/b/BoneyardMycodrax.java b/Mage.Sets/src/mage/cards/b/BoneyardMycodrax.java index abebcaf168..cbedd3542c 100644 --- a/Mage.Sets/src/mage/cards/b/BoneyardMycodrax.java +++ b/Mage.Sets/src/mage/cards/b/BoneyardMycodrax.java @@ -5,7 +5,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.ScavengeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -40,7 +40,7 @@ public final class BoneyardMycodrax extends CardImpl { this.toughness = new MageInt(0); // Boneyard Mycodrax's power and toughness are each equal to the number of other creature cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // Scavenge {4}{B} this.addAbility(new ScavengeAbility(new ManaCostsImpl<>("{4}{B}"))); diff --git a/Mage.Sets/src/mage/cards/b/BoneyardWurm.java b/Mage.Sets/src/mage/cards/b/BoneyardWurm.java index e398155cd7..ed5ffed75c 100644 --- a/Mage.Sets/src/mage/cards/b/BoneyardWurm.java +++ b/Mage.Sets/src/mage/cards/b/BoneyardWurm.java @@ -4,7 +4,7 @@ import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -24,7 +24,7 @@ public final class BoneyardWurm extends CardImpl { // Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard. DynamicValue value = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame))); } private BoneyardWurm(final BoneyardWurm card) { diff --git a/Mage.Sets/src/mage/cards/b/BramblefortFink.java b/Mage.Sets/src/mage/cards/b/BramblefortFink.java index 8356669ee0..33d9428949 100644 --- a/Mage.Sets/src/mage/cards/b/BramblefortFink.java +++ b/Mage.Sets/src/mage/cards/b/BramblefortFink.java @@ -5,7 +5,7 @@ import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -31,9 +31,13 @@ public final class BramblefortFink extends CardImpl { this.toughness = new MageInt(2); // {8}: Bramblefort Fink has base power and toughness 10/10 until end of turn. Activate this ability only if you control an Oko planeswalker. - this.addAbility(new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect( - 10, 10, Duration.EndOfTurn, SubLayer.SetPT_7b - ).setText("{this} has base power and toughness 10/10 until end of turn"), new GenericManaCost(8), condition)); + this.addAbility(new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, + new SetBasePowerToughnessSourceEffect( + 10, 10, Duration.EndOfTurn, SubLayer.SetPT_7b, true + ).setText("{this} has base power and toughness 10/10 until end of turn"), + new GenericManaCost(8), + condition)); } private BramblefortFink(final BramblefortFink card) { diff --git a/Mage.Sets/src/mage/cards/b/BrineHag.java b/Mage.Sets/src/mage/cards/b/BrineHag.java index af7b561d76..c2d395285e 100644 --- a/Mage.Sets/src/mage/cards/b/BrineHag.java +++ b/Mage.Sets/src/mage/cards/b/BrineHag.java @@ -9,7 +9,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.DiesSourceTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -68,15 +68,21 @@ class BrineHagEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { return false; } + if (controller == null) { + return false; + } Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (sourcePermanent == null) { return false; } + if (sourcePermanent == null) { + return false; + } List list = new ArrayList<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); - if (player == null) { continue; } + if (player == null) { + continue; + } for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game)) { if (sourcePermanent.getDealtDamageByThisTurn().contains(new MageObjectReference(creature.getId(), game))) { @@ -87,7 +93,7 @@ class BrineHagEffect extends OneShotEffect { if (!list.isEmpty()) { FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new PermanentInListPredicate(list)); - game.addEffect(new SetPowerToughnessAllEffect(0, 2, Duration.Custom, filter, true), source); + game.addEffect(new SetBasePowerToughnessAllEffect(0, 2, Duration.Custom, filter, true), source); } return true; } diff --git a/Mage.Sets/src/mage/cards/b/BrokersInitiate.java b/Mage.Sets/src/mage/cards/b/BrokersInitiate.java index a3f3114401..2470eb62cc 100644 --- a/Mage.Sets/src/mage/cards/b/BrokersInitiate.java +++ b/Mage.Sets/src/mage/cards/b/BrokersInitiate.java @@ -3,7 +3,7 @@ package mage.cards.b; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -27,9 +27,10 @@ public final class BrokersInitiate extends CardImpl { this.toughness = new MageInt(4); // {4}{G/U}: Brokers Initiate has base power and toughness 5/5 until end of turn. - this.addAbility(new SimpleActivatedAbility(new SetPowerToughnessSourceEffect( - 5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b - ), new ManaCostsImpl<>("{4}{G/U}"))); + this.addAbility(new SimpleActivatedAbility( + new SetBasePowerToughnessSourceEffect(5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b, true), + new ManaCostsImpl<>("{4}{G/U}") + )); } private BrokersInitiate(final BrokersInitiate card) { diff --git a/Mage.Sets/src/mage/cards/b/BronzeGuardian.java b/Mage.Sets/src/mage/cards/b/BronzeGuardian.java index 2700390504..31c6d6246e 100644 --- a/Mage.Sets/src/mage/cards/b/BronzeGuardian.java +++ b/Mage.Sets/src/mage/cards/b/BronzeGuardian.java @@ -6,7 +6,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.ArtifactYouControlCount; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.WardAbility; import mage.cards.CardImpl; @@ -44,7 +44,7 @@ public final class BronzeGuardian extends CardImpl { ))); // Bronze Guardian's power is equal to the number of artifacts you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect( ArtifactYouControlCount.instance, Duration.EndOfGame ))); } diff --git a/Mage.Sets/src/mage/cards/b/Broodstar.java b/Mage.Sets/src/mage/cards/b/Broodstar.java index db1897cf4c..65ba63bacd 100644 --- a/Mage.Sets/src/mage/cards/b/Broodstar.java +++ b/Mage.Sets/src/mage/cards/b/Broodstar.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.AffinityForArtifactsAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -38,7 +38,7 @@ public final class Broodstar extends CardImpl { this.addAbility(new AffinityForArtifactsAbility()); this.addAbility(FlyingAbility.getInstance()); // Broodstar's power and toughness are each equal to the number of artifacts you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private Broodstar(final Broodstar card) { diff --git a/Mage.Sets/src/mage/cards/c/CallapheBelovedOfTheSea.java b/Mage.Sets/src/mage/cards/c/CallapheBelovedOfTheSea.java index 1baa9de971..f89c648257 100644 --- a/Mage.Sets/src/mage/cards/c/CallapheBelovedOfTheSea.java +++ b/Mage.Sets/src/mage/cards/c/CallapheBelovedOfTheSea.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.effects.common.cost.SpellsCostModificationThatTargetSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -41,7 +41,7 @@ public final class CallapheBelovedOfTheSea extends CardImpl { // Callaphe's power is equal to your to devotion to blue. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(DevotionCount.U, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(DevotionCount.U, Duration.EndOfGame) .setText("{this}'s power is equal to your devotion to blue") ).addHint(DevotionCount.U.getHint())); diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java index 4787e7c7c9..d1aba02ec7 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java @@ -10,7 +10,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; @@ -114,7 +114,7 @@ enum CallerOfTheHuntAdjuster implements CostAdjuster { // apply boost FilterCreaturePermanent filter = new FilterCreaturePermanent("chosen creature type"); filter.add(typeChoice.getPredicate()); - ContinuousEffect effectPowerToughness = new SetPowerToughnessSourceEffect( + ContinuousEffect effectPowerToughness = new SetBasePowerToughnessSourceEffect( new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); effectPowerToughness.setText(""); SimpleStaticAbility setPT = new SimpleStaticAbility(Zone.ALL, effectPowerToughness); diff --git a/Mage.Sets/src/mage/cards/c/CandlekeepInspiration.java b/Mage.Sets/src/mage/cards/c/CandlekeepInspiration.java index 62684c19f7..1422a2f974 100644 --- a/Mage.Sets/src/mage/cards/c/CandlekeepInspiration.java +++ b/Mage.Sets/src/mage/cards/c/CandlekeepInspiration.java @@ -3,7 +3,7 @@ package mage.cards.c; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; import mage.cards.AdventureCard; @@ -32,7 +32,7 @@ public final class CandlekeepInspiration extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}"); // Until end of turn, creatures you control have base power and toughness X/X, where X is the number of cards you own in exile and in your graveyard that are instant cards, are sorcery cards, and/or have an Adventure. - this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect( + this.getSpellAbility().addEffect(new SetBasePowerToughnessAllEffect( CandlekeepInspirationValue.instance, CandlekeepInspirationValue.instance, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURE, true ).setText("until end of turn, creatures you control have base power and toughness X/X, " + diff --git a/Mage.Sets/src/mage/cards/c/Cantivore.java b/Mage.Sets/src/mage/cards/c/Cantivore.java index 1122e1dd83..0a9dffd1f7 100644 --- a/Mage.Sets/src/mage/cards/c/Cantivore.java +++ b/Mage.Sets/src/mage/cards/c/Cantivore.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -40,7 +40,7 @@ public final class Cantivore extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Cantivore's power and toughness are each equal to the number of enchantment cards in all graveyards. DynamicValue value = (new CardsInAllGraveyardsCount(filter)); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value , Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value , Duration.EndOfGame))); } private Cantivore(final Cantivore card) { diff --git a/Mage.Sets/src/mage/cards/c/CephalidFacetaker.java b/Mage.Sets/src/mage/cards/c/CephalidFacetaker.java index 5929e246f0..5b720ede03 100644 --- a/Mage.Sets/src/mage/cards/c/CephalidFacetaker.java +++ b/Mage.Sets/src/mage/cards/c/CephalidFacetaker.java @@ -58,8 +58,8 @@ class CephalidFacetakerEffect extends OneShotEffect { private static final CopyApplier copyApplier = new CopyApplier() { @Override public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) { - blueprint.getPower().modifyBaseValue(1); - blueprint.getToughness().modifyBaseValue(4); + blueprint.getPower().setModifiedBaseValue(1); + blueprint.getToughness().setModifiedBaseValue(4); blueprint.getAbilities().add(new SimpleStaticAbility( new CantBeBlockedSourceEffect().setText("this creature can't be blocked") )); diff --git a/Mage.Sets/src/mage/cards/c/ChameleonSpirit.java b/Mage.Sets/src/mage/cards/c/ChameleonSpirit.java index abbbe1310e..4a76868a4d 100644 --- a/Mage.Sets/src/mage/cards/c/ChameleonSpirit.java +++ b/Mage.Sets/src/mage/cards/c/ChameleonSpirit.java @@ -9,13 +9,10 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ChooseColorEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; -import mage.constants.SubType; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; +import mage.constants.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; @@ -41,7 +38,8 @@ public final class ChameleonSpirit extends CardImpl { // Chameleon Spirit's power and toughness are each equal to the number // of permanents of the chosen color your opponents control. this.addAbility(new SimpleStaticAbility( - new SetPowerToughnessSourceEffect( + Zone.ALL, + new SetBasePowerToughnessSourceEffect( PermanentsOfTheChosenColorOpponentsControlCount.instance, Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/c/ChariotOfTheSun.java b/Mage.Sets/src/mage/cards/c/ChariotOfTheSun.java index 91911a287c..07f256a81a 100644 --- a/Mage.Sets/src/mage/cards/c/ChariotOfTheSun.java +++ b/Mage.Sets/src/mage/cards/c/ChariotOfTheSun.java @@ -76,7 +76,7 @@ class ChariotOfTheSunEffect extends ContinuousEffectImpl { this.discard(); return false; } - permanent.getToughness().setValue(1); + permanent.getToughness().setModifiedBaseValue(1); return true; } } diff --git a/Mage.Sets/src/mage/cards/c/ChimericCoils.java b/Mage.Sets/src/mage/cards/c/ChimericCoils.java index f50faf15ce..bd808766af 100644 --- a/Mage.Sets/src/mage/cards/c/ChimericCoils.java +++ b/Mage.Sets/src/mage/cards/c/ChimericCoils.java @@ -75,8 +75,8 @@ class ChimericCoilsEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int xValue = source.getManaCostsToPay().getX(); - permanent.getPower().setValue(xValue); - permanent.getToughness().setValue(xValue); + permanent.getPower().setModifiedBaseValue(xValue); + permanent.getToughness().setModifiedBaseValue(xValue); } } return true; diff --git a/Mage.Sets/src/mage/cards/c/ChimericMass.java b/Mage.Sets/src/mage/cards/c/ChimericMass.java index 1a26caaf7c..b2e4472b60 100644 --- a/Mage.Sets/src/mage/cards/c/ChimericMass.java +++ b/Mage.Sets/src/mage/cards/c/ChimericMass.java @@ -10,7 +10,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -37,7 +37,7 @@ public final class ChimericMass extends CardImpl { new CreatureToken(0, 0, "Construct artifact creature with \"This creature's power and toughness are each equal to the number of charge counters on it.\"") .withType(CardType.ARTIFACT) .withSubType(SubType.CONSTRUCT) - .withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield))), + .withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield))), "", Duration.EndOfTurn, false, true), new GenericManaCost(1))); } diff --git a/Mage.Sets/src/mage/cards/c/ChimericStaff.java b/Mage.Sets/src/mage/cards/c/ChimericStaff.java index 16c7d1cec6..5edeeff117 100644 --- a/Mage.Sets/src/mage/cards/c/ChimericStaff.java +++ b/Mage.Sets/src/mage/cards/c/ChimericStaff.java @@ -70,8 +70,8 @@ class ChimericStaffEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int xValue = source.getManaCostsToPay().getX(); - permanent.getPower().setValue(xValue); - permanent.getToughness().setValue(xValue); + permanent.getPower().setModifiedBaseValue(xValue); + permanent.getToughness().setModifiedBaseValue(xValue); } } return true; diff --git a/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java b/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java index 0ace4b1d23..7b2792ab07 100644 --- a/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java +++ b/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java @@ -27,7 +27,7 @@ public final class CircleOfTheMoonDruid extends CardImpl { this.toughness = new MageInt(4); // Bear Form — As long as its your turn, Circle of the Moon Druid is a Bear with base power and toughness 4/2. - this.addAbility(new SimpleStaticAbility(new WerewolfPackLeaderEffect()).withFlavorWord("Bear Form")); + this.addAbility(new SimpleStaticAbility(new CircleOfTheMoonDruidBearEffect()).withFlavorWord("Bear Form")); } private CircleOfTheMoonDruid(final CircleOfTheMoonDruid card) { @@ -40,20 +40,20 @@ public final class CircleOfTheMoonDruid extends CardImpl { } } -class WerewolfPackLeaderEffect extends ContinuousEffectImpl { +class CircleOfTheMoonDruidBearEffect extends ContinuousEffectImpl { - WerewolfPackLeaderEffect() { + CircleOfTheMoonDruidBearEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "as long as it's your turn, {this} is a Bear with base power and toughness 4/2"; } - private WerewolfPackLeaderEffect(final WerewolfPackLeaderEffect effect) { + private CircleOfTheMoonDruidBearEffect(final CircleOfTheMoonDruidBearEffect effect) { super(effect); } @Override - public WerewolfPackLeaderEffect copy() { - return new WerewolfPackLeaderEffect(this); + public CircleOfTheMoonDruidBearEffect copy() { + return new CircleOfTheMoonDruidBearEffect(this); } @Override @@ -69,8 +69,8 @@ class WerewolfPackLeaderEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(2); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(2); return true; } } diff --git a/Mage.Sets/src/mage/cards/c/Cognivore.java b/Mage.Sets/src/mage/cards/c/Cognivore.java index c83cde79c0..10e9e13136 100644 --- a/Mage.Sets/src/mage/cards/c/Cognivore.java +++ b/Mage.Sets/src/mage/cards/c/Cognivore.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class Cognivore extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Cognivore's power and toughness are each equal to the number of instant cards in all graveyards. DynamicValue value = (new CardsInAllGraveyardsCount(filter)); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame))); } private Cognivore(final Cognivore card) { diff --git a/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java b/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java index b56c057680..eff2bdafb4 100644 --- a/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java +++ b/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java @@ -5,7 +5,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class CoilingWoodworm extends CardImpl { this.toughness = new MageInt(1); // Coiling Woodworm's power is equal to the number of Forests on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(count, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(count, Duration.EndOfGame))); } private CoilingWoodworm(final CoilingWoodworm card) { diff --git a/Mage.Sets/src/mage/cards/c/ConsumingAberration.java b/Mage.Sets/src/mage/cards/c/ConsumingAberration.java index ffa1d5439d..9e014478c1 100644 --- a/Mage.Sets/src/mage/cards/c/ConsumingAberration.java +++ b/Mage.Sets/src/mage/cards/c/ConsumingAberration.java @@ -9,7 +9,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.*; import mage.constants.CardType; import mage.constants.Duration; @@ -34,7 +34,7 @@ public final class ConsumingAberration extends CardImpl { this.toughness = new MageInt(0); //Consuming Aberration's power and toughness are each equal to the number of cards in your opponents' graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInOpponentsGraveyardsCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInOpponentsGraveyardsCount(), Duration.EndOfGame))); //Whenever you cast a spell, each opponent reveals cards from the top of their library until they reveal a land card, then puts those cards into their graveyard. this.addAbility(new SpellCastControllerTriggeredAbility(new ConsumingAberrationEffect(), false)); } diff --git a/Mage.Sets/src/mage/cards/c/ConsumingBlob.java b/Mage.Sets/src/mage/cards/c/ConsumingBlob.java index 0ac5a90b82..873b483875 100644 --- a/Mage.Sets/src/mage/cards/c/ConsumingBlob.java +++ b/Mage.Sets/src/mage/cards/c/ConsumingBlob.java @@ -5,13 +5,18 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CardTypesInGraveyardHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.ConsumingBlobOozeToken; @@ -22,6 +27,9 @@ import java.util.UUID; */ public final class ConsumingBlob extends CardImpl { + private static final DynamicValue powerValue = CardTypesInGraveyardCount.YOU; + private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1)); + public ConsumingBlob(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); @@ -30,7 +38,11 @@ public final class ConsumingBlob extends CardImpl { this.toughness = new MageInt(1); // Consuming Blob's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConsumingBlobEffect()).addHint(CardTypesInGraveyardHint.YOU)); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a, false) + .setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1") + )); // At the beginning of your end step, create a green Ooze creature token with "This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1". this.addAbility(new BeginningOfEndStepTriggeredAbility( @@ -47,32 +59,3 @@ public final class ConsumingBlob extends CardImpl { return new ConsumingBlob(this); } } - -class ConsumingBlobEffect extends ContinuousEffectImpl { - - public ConsumingBlobEffect() { - super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); - staticText = "{this}'s power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1"; - } - - public ConsumingBlobEffect(final ConsumingBlobEffect effect) { - super(effect); - } - - @Override - public ConsumingBlobEffect copy() { - return new ConsumingBlobEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject target = source.getSourceObject(game); - if (target == null) { - return false; - } - int number = CardTypesInGraveyardCount.YOU.calculate(game, source, this); - target.getPower().setValue(number); - target.getToughness().setValue(number + 1); - return true; - } -} diff --git a/Mage.Sets/src/mage/cards/c/CracklingDrake.java b/Mage.Sets/src/mage/cards/c/CracklingDrake.java index 80268a3cf7..22379bfc84 100644 --- a/Mage.Sets/src/mage/cards/c/CracklingDrake.java +++ b/Mage.Sets/src/mage/cards/c/CracklingDrake.java @@ -5,7 +5,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; import mage.abilities.keyword.FlyingAbility; @@ -40,7 +40,7 @@ public final class CracklingDrake extends CardImpl { // Crackling Drake's power is equal to the total number of instant and sorcery cards you own in exile and in your graveyard. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerSourceEffect( + new SetBasePowerSourceEffect( InstantSorceryExileGraveyardCount.instance, Duration.EndOfGame ).setText("{this}'s power is equal to the total number " + "of instant and sorcery cards you own " diff --git a/Mage.Sets/src/mage/cards/c/CraterElemental.java b/Mage.Sets/src/mage/cards/c/CraterElemental.java index 5263bc538f..118a319c14 100644 --- a/Mage.Sets/src/mage/cards/c/CraterElemental.java +++ b/Mage.Sets/src/mage/cards/c/CraterElemental.java @@ -10,7 +10,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -41,7 +41,7 @@ public final class CraterElemental extends CardImpl { // Formidable — {2}{R}: Crater Elemental has base power 8 until end of turn. Activate this ability only if creatures you control have total power 8 or greater. ability = new ActivateIfConditionActivatedAbility( Zone.BATTLEFIELD, - new SetPowerSourceEffect(StaticValue.get(8), Duration.EndOfTurn, SubLayer.SetPT_7b) + new SetBasePowerToughnessSourceEffect(StaticValue.get(8), null, Duration.EndOfTurn, SubLayer.SetPT_7b,true) .setText("{this} has base power 8 until end of turn"), new ManaCostsImpl<>("{2}{R}"), FormidableCondition.instance diff --git a/Mage.Sets/src/mage/cards/c/Creeperhulk.java b/Mage.Sets/src/mage/cards/c/Creeperhulk.java index 0a1cf2c8bb..2bd3b201b7 100644 --- a/Mage.Sets/src/mage/cards/c/Creeperhulk.java +++ b/Mage.Sets/src/mage/cards/c/Creeperhulk.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,13 +35,12 @@ public final class Creeperhulk extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // {1}{G}: Until end of turn, target creature you control has base power and toughness 5/5 and gains trample. - Effect effect = new SetPowerToughnessTargetEffect(5,5, Duration.EndOfTurn); + Effect effect = new SetBasePowerToughnessTargetEffect(5,5, Duration.EndOfTurn); effect.setText("Until end of turn, target creature you control has base power and toughness 5/5"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{G}")); ability.addTarget(new TargetControlledCreaturePermanent()); ability.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, "and gains Trample")); this.addAbility(ability); - } private Creeperhulk(final Creeperhulk card) { diff --git a/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java b/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java index 4e3abebfd7..b54eab63ae 100644 --- a/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java +++ b/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java @@ -2,7 +2,7 @@ package mage.cards.c; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -49,7 +49,7 @@ public final class CreepyPuppeteer extends CardImpl { class CreepyPuppeteerTriggeredAbility extends TriggeredAbilityImpl { CreepyPuppeteerTriggeredAbility() { - super(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(4, 3, Duration.EndOfTurn), true); + super(Zone.BATTLEFIELD, new SetBasePowerToughnessTargetEffect(4, 3, Duration.EndOfTurn), true); } private CreepyPuppeteerTriggeredAbility(final CreepyPuppeteerTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/cards/c/CrowdOfCinders.java b/Mage.Sets/src/mage/cards/c/CrowdOfCinders.java index f2c4cea9c2..adb2f22573 100644 --- a/Mage.Sets/src/mage/cards/c/CrowdOfCinders.java +++ b/Mage.Sets/src/mage/cards/c/CrowdOfCinders.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class CrowdOfCinders extends CardImpl { this.addAbility(FearAbility.getInstance()); // Crowd of Cinders's power and toughness are each equal to the number of black permanents you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private CrowdOfCinders(final CrowdOfCinders card) { diff --git a/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java b/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java index 27130ba1f9..d21bcdf9a7 100644 --- a/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java +++ b/Mage.Sets/src/mage/cards/c/CrusaderOfOdric.java @@ -3,7 +3,7 @@ package mage.cards.c; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -28,7 +28,7 @@ public final class CrusaderOfOdric extends CardImpl { this.toughness = new MageInt(0); // Crusader of Odric's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/c/CultivatorColossus.java b/Mage.Sets/src/mage/cards/c/CultivatorColossus.java index 8689cf4afc..b40dbc0a93 100644 --- a/Mage.Sets/src/mage/cards/c/CultivatorColossus.java +++ b/Mage.Sets/src/mage/cards/c/CultivatorColossus.java @@ -6,7 +6,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.LandsYouControlCount; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -38,7 +38,7 @@ public final class CultivatorColossus extends CardImpl { // Cultivator Colossus's power and toughness are each equal to the number of lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame) )); // When Cultivator Colossus enters the battlefield, you may put a land card from your hand onto the battlefield tapped. If you do, draw a card and repeat this process. diff --git a/Mage.Sets/src/mage/cards/c/CurseOfConformity.java b/Mage.Sets/src/mage/cards/c/CurseOfConformity.java index 08121eda26..d1bccd51ba 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfConformity.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfConformity.java @@ -83,8 +83,8 @@ class CurseOfConformityEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(3); - permanent.getToughness().setValue(3); + permanent.getPower().setModifiedBaseValue(3); + permanent.getToughness().setModifiedBaseValue(3); } } } diff --git a/Mage.Sets/src/mage/cards/c/CyberdriveAwakener.java b/Mage.Sets/src/mage/cards/c/CyberdriveAwakener.java index 4418ffff38..76632b7468 100644 --- a/Mage.Sets/src/mage/cards/c/CyberdriveAwakener.java +++ b/Mage.Sets/src/mage/cards/c/CyberdriveAwakener.java @@ -105,8 +105,8 @@ class CyberdriveAwakenerEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); } } } diff --git a/Mage.Sets/src/mage/cards/d/DakkonBlackblade.java b/Mage.Sets/src/mage/cards/d/DakkonBlackblade.java index 4dac00c3fc..8c6ee0b93b 100644 --- a/Mage.Sets/src/mage/cards/d/DakkonBlackblade.java +++ b/Mage.Sets/src/mage/cards/d/DakkonBlackblade.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class DakkonBlackblade extends CardImpl { // Dakkon Blackblade's power and toughness are each equal to the number of lands you control. DynamicValue controlledLands = new PermanentsOnBattlefieldCount(filter); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); } private DakkonBlackblade(final DakkonBlackblade card) { diff --git a/Mage.Sets/src/mage/cards/d/DakmorSorceress.java b/Mage.Sets/src/mage/cards/d/DakmorSorceress.java index c4124110ee..7711ecf494 100644 --- a/Mage.Sets/src/mage/cards/d/DakmorSorceress.java +++ b/Mage.Sets/src/mage/cards/d/DakmorSorceress.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class DakmorSorceress extends CardImpl { this.toughness = new MageInt(4); // Dakmor Sorceress's power is equal to the number of Swamps you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private DakmorSorceress(final DakmorSorceress card) { diff --git a/Mage.Sets/src/mage/cards/d/DanceOfTheManse.java b/Mage.Sets/src/mage/cards/d/DanceOfTheManse.java index 4d0b4fcaed..b37b798811 100644 --- a/Mage.Sets/src/mage/cards/d/DanceOfTheManse.java +++ b/Mage.Sets/src/mage/cards/d/DanceOfTheManse.java @@ -4,7 +4,7 @@ import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.Cards; @@ -112,7 +112,7 @@ class DanceOfTheManseEffect extends OneShotEffect { ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.CREATURE); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); - effect = new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfGame); + effect = new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfGame); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); }); diff --git a/Mage.Sets/src/mage/cards/d/DancingSword.java b/Mage.Sets/src/mage/cards/d/DancingSword.java index 3e2dea4446..2889d0621c 100644 --- a/Mage.Sets/src/mage/cards/d/DancingSword.java +++ b/Mage.Sets/src/mage/cards/d/DancingSword.java @@ -88,8 +88,8 @@ class DancingSwordEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(2); - permanent.getToughness().setValue(1); + permanent.getPower().setModifiedBaseValue(2); + permanent.getToughness().setModifiedBaseValue(1); return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java b/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java index b5f62ec7c0..b2fc4f292d 100644 --- a/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java +++ b/Mage.Sets/src/mage/cards/d/DarksteelJuggernaut.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.AttacksEachCombatStaticAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,8 +32,10 @@ public final class DarksteelJuggernaut extends CardImpl { this.addAbility(IndestructibleAbility.getInstance()); // Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, - new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")), Duration.EndOfGame) + )); // Darksteel Juggernaut attacks each turn if able. this.addAbility(new AttacksEachCombatStaticAbility()); diff --git a/Mage.Sets/src/mage/cards/d/DauntlessDourbark.java b/Mage.Sets/src/mage/cards/d/DauntlessDourbark.java index 1ca398929b..494de210e6 100644 --- a/Mage.Sets/src/mage/cards/d/DauntlessDourbark.java +++ b/Mage.Sets/src/mage/cards/d/DauntlessDourbark.java @@ -9,7 +9,7 @@ import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -51,7 +51,7 @@ public final class DauntlessDourbark extends CardImpl { // Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control. DynamicValue amount = new PermanentsOnBattlefieldCount(filter); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(amount, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(amount, Duration.EndOfGame))); // Dauntless Dourbark has trample as long as you control another Treefolk. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter2), rule))); diff --git a/Mage.Sets/src/mage/cards/d/DauthiWarlord.java b/Mage.Sets/src/mage/cards/d/DauthiWarlord.java index d27c61c47e..b9eb8fdd7b 100644 --- a/Mage.Sets/src/mage/cards/d/DauthiWarlord.java +++ b/Mage.Sets/src/mage/cards/d/DauthiWarlord.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.ShadowAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -41,7 +41,7 @@ public final class DauthiWarlord extends CardImpl { this.addAbility(ShadowAbility.getInstance()); // Dauthi Warlord's power is equal to the number of creatures with shadow on the battlefield. - Effect effect = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); + Effect effect = new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); } diff --git a/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java b/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java index f860f780cf..4865fb9a0e 100644 --- a/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java +++ b/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java @@ -5,7 +5,7 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -32,7 +32,7 @@ public final class DaxosBlessedByTheSun extends CardImpl { // Daxos's toughness is equal to your devotion to white. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetToughnessSourceEffect(DevotionCount.W, Duration.EndOfGame) + new SetBaseToughnessSourceEffect(DevotionCount.W, Duration.EndOfGame) .setText("{this}'s toughness is equal to your devotion to white") ).addHint(DevotionCount.W.getHint())); diff --git a/Mage.Sets/src/mage/cards/d/Detritivore.java b/Mage.Sets/src/mage/cards/d/Detritivore.java index 709258b08c..ff40887c64 100644 --- a/Mage.Sets/src/mage/cards/d/Detritivore.java +++ b/Mage.Sets/src/mage/cards/d/Detritivore.java @@ -10,7 +10,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.SuspendAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -41,7 +41,7 @@ public final class Detritivore extends CardImpl { this.toughness = new MageInt(0); // Detritivore's power and toughness are each equal to the number of nonbasic land cards in your opponents' graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new NonBasicLandsInOpponentsGraveyards(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new NonBasicLandsInOpponentsGraveyards(), Duration.EndOfGame))); // Suspend X-{X}{3}{R}. X can't be 0. this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{3}{R}"), this, true)); diff --git a/Mage.Sets/src/mage/cards/d/DevastatingSummons.java b/Mage.Sets/src/mage/cards/d/DevastatingSummons.java index abd034f65b..60ebd91209 100644 --- a/Mage.Sets/src/mage/cards/d/DevastatingSummons.java +++ b/Mage.Sets/src/mage/cards/d/DevastatingSummons.java @@ -55,8 +55,8 @@ class DevastatingSummonsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { DevastatingSummonsElementalToken token = new DevastatingSummonsElementalToken(); - token.getPower().modifyBaseValue(GetXValue.instance.calculate(game, source, this)); - token.getToughness().modifyBaseValue(GetXValue.instance.calculate(game, source, this)); + token.setPower(GetXValue.instance.calculate(game, source, this)); + token.setToughness(GetXValue.instance.calculate(game, source, this)); token.putOntoBattlefield(2, game, source, source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/d/Diminish.java b/Mage.Sets/src/mage/cards/d/Diminish.java index b8294ce643..e661728bcf 100644 --- a/Mage.Sets/src/mage/cards/d/Diminish.java +++ b/Mage.Sets/src/mage/cards/d/Diminish.java @@ -3,7 +3,7 @@ package mage.cards.d; import java.util.UUID; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -20,7 +20,7 @@ public final class Diminish extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); } private Diminish(final Diminish card) { diff --git a/Mage.Sets/src/mage/cards/d/DodgyJalopy.java b/Mage.Sets/src/mage/cards/d/DodgyJalopy.java index f7e4d7292f..4bbca4d3fe 100644 --- a/Mage.Sets/src/mage/cards/d/DodgyJalopy.java +++ b/Mage.Sets/src/mage/cards/d/DodgyJalopy.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.CrewAbility; import mage.abilities.keyword.ScavengeAbility; import mage.abilities.keyword.TrampleAbility; @@ -39,7 +39,7 @@ public final class DodgyJalopy extends CardImpl { // Dodgy Jalopy's power is equal to the highest mana value among creatures you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(DodgyJalopyValue.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(DodgyJalopyValue.instance, Duration.EndOfGame) )); // Crew 3 diff --git a/Mage.Sets/src/mage/cards/d/DonalHeraldOfWings.java b/Mage.Sets/src/mage/cards/d/DonalHeraldOfWings.java index f015995e44..c4aac13c92 100644 --- a/Mage.Sets/src/mage/cards/d/DonalHeraldOfWings.java +++ b/Mage.Sets/src/mage/cards/d/DonalHeraldOfWings.java @@ -108,8 +108,8 @@ enum DonalHeraldOfWingsApplier implements StackObjectCopyApplier { @Override public void modifySpell(StackObject copiedSpell, Game game) { copiedSpell.addSubType(SubType.SPIRIT); - copiedSpell.getPower().modifyBaseValue(1); - copiedSpell.getToughness().modifyBaseValue(1); + copiedSpell.getPower().setModifiedBaseValue(1); + copiedSpell.getToughness().setModifiedBaseValue(1); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DoubtlessOne.java b/Mage.Sets/src/mage/cards/d/DoubtlessOne.java index ebe8983a47..995413fccc 100644 --- a/Mage.Sets/src/mage/cards/d/DoubtlessOne.java +++ b/Mage.Sets/src/mage/cards/d/DoubtlessOne.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.DealsDamageGainLifeSourceTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class DoubtlessOne extends CardImpl { this.toughness = new MageInt(0); // Doubtless One's power and toughness are each equal to the number of Clerics on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // Whenever Doubtless One deals damage, you gain that much life. this.addAbility(new DealsDamageGainLifeSourceTriggeredAbility()); diff --git a/Mage.Sets/src/mage/cards/d/Dracoplasm.java b/Mage.Sets/src/mage/cards/d/Dracoplasm.java index 03dd066c61..2b8cc084fb 100644 --- a/Mage.Sets/src/mage/cards/d/Dracoplasm.java +++ b/Mage.Sets/src/mage/cards/d/Dracoplasm.java @@ -10,7 +10,7 @@ import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -94,26 +94,31 @@ class DracoplasmEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); - if (creature != null && controller != null) { - Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, filter, true); - if (!target.canChoose(source.getControllerId(), source, game)) { - return false; - } - controller.chooseTarget(Outcome.Detriment, target, source, game); - if (!target.getTargets().isEmpty()) { - int power = 0; - int toughness = 0; - for (UUID targetId : target.getTargets()) { - Permanent targetCreature = game.getPermanent(targetId); - if (targetCreature != null && targetCreature.sacrifice(source, game)) { - power = CardUtil.overflowInc(power, targetCreature.getPower().getValue()); - toughness = CardUtil.overflowInc(toughness, targetCreature.getToughness().getValue()); - } - } - ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b); - game.addEffect(effect, source); + if (creature == null || controller == null) { + return false; + } + + Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, filter, true); + if (!target.canChoose(source.getControllerId(), source, game)) { + return false; + } + + controller.chooseTarget(Outcome.Detriment, target, source, game); + if (target.getTargets().isEmpty()) { + return false; + } + + int power = 0; + int toughness = 0; + for (UUID targetId : target.getTargets()) { + Permanent targetCreature = game.getPermanent(targetId); + if (targetCreature != null && targetCreature.sacrifice(source, game)) { + power = CardUtil.overflowInc(power, targetCreature.getPower().getValue()); + toughness = CardUtil.overflowInc(toughness, targetCreature.getToughness().getValue()); } } - return false; + ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b); + game.addEffect(effect, source); + return true; } } diff --git a/Mage.Sets/src/mage/cards/d/DriftOfTheDead.java b/Mage.Sets/src/mage/cards/d/DriftOfTheDead.java index 269a571f7a..2b4e393f71 100644 --- a/Mage.Sets/src/mage/cards/d/DriftOfTheDead.java +++ b/Mage.Sets/src/mage/cards/d/DriftOfTheDead.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.SubType; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; @@ -42,7 +42,7 @@ public final class DriftOfTheDead extends CardImpl { this.addAbility(DefenderAbility.getInstance()); // Drift of the Dead's power and toughness are each equal to the number of snow lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private DriftOfTheDead(final DriftOfTheDead card) { diff --git a/Mage.Sets/src/mage/cards/d/DroveOfElves.java b/Mage.Sets/src/mage/cards/d/DroveOfElves.java index f77ff26f29..09fe2a9fde 100644 --- a/Mage.Sets/src/mage/cards/d/DroveOfElves.java +++ b/Mage.Sets/src/mage/cards/d/DroveOfElves.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class DroveOfElves extends CardImpl { this.addAbility(HexproofAbility.getInstance()); // Drove of Elves's power and toughness are each equal to the number of green permanents you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private DroveOfElves(final DroveOfElves card) { diff --git a/Mage.Sets/src/mage/cards/d/DruidClass.java b/Mage.Sets/src/mage/cards/d/DruidClass.java index 49b806e0e1..bcb28bdd68 100644 --- a/Mage.Sets/src/mage/cards/d/DruidClass.java +++ b/Mage.Sets/src/mage/cards/d/DruidClass.java @@ -10,7 +10,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect; import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.ClassLevelAbility; import mage.abilities.keyword.ClassReminderAbility; import mage.abilities.keyword.HasteAbility; @@ -82,7 +82,7 @@ class DruidClassToken extends TokenImpl { this.toughness = new MageInt(0); this.addAbility(HasteAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect( LandsYouControlCount.instance, Duration.EndOfGame, SubLayer.SetPT_7b ).setText("this creature's power and toughness are each equal to the number of lands you control"))); } diff --git a/Mage.Sets/src/mage/cards/d/DungroveElder.java b/Mage.Sets/src/mage/cards/d/DungroveElder.java index c54b9e5780..b61059a0db 100644 --- a/Mage.Sets/src/mage/cards/d/DungroveElder.java +++ b/Mage.Sets/src/mage/cards/d/DungroveElder.java @@ -6,7 +6,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,7 +39,7 @@ public final class DungroveElder extends CardImpl { this.addAbility(HexproofAbility.getInstance()); // Dungrove Elder's power and toughness are each equal to the number of Forests you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); } public DungroveElder (final DungroveElder card) { diff --git a/Mage.Sets/src/mage/cards/d/Duplicant.java b/Mage.Sets/src/mage/cards/d/Duplicant.java index 5bc27b3012..71d063e545 100644 --- a/Mage.Sets/src/mage/cards/d/Duplicant.java +++ b/Mage.Sets/src/mage/cards/d/Duplicant.java @@ -133,8 +133,8 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(card.getPower().getValue()); - permanent.getToughness().setValue(card.getToughness().getValue()); + permanent.getPower().setModifiedBaseValue(card.getPower().getValue()); + permanent.getToughness().setModifiedBaseValue(card.getToughness().getValue()); } } return true; diff --git a/Mage.Sets/src/mage/cards/e/EccentricApprentice.java b/Mage.Sets/src/mage/cards/e/EccentricApprentice.java index 46bffe0397..0e8155a41a 100644 --- a/Mage.Sets/src/mage/cards/e/EccentricApprentice.java +++ b/Mage.Sets/src/mage/cards/e/EccentricApprentice.java @@ -92,8 +92,8 @@ class EccentricApprenticeEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); return true; } } diff --git a/Mage.Sets/src/mage/cards/e/EldraziMimic.java b/Mage.Sets/src/mage/cards/e/EldraziMimic.java index e195622869..6635507308 100644 --- a/Mage.Sets/src/mage/cards/e/EldraziMimic.java +++ b/Mage.Sets/src/mage/cards/e/EldraziMimic.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -71,15 +71,14 @@ class EldraziMimicEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); - if (permanent != null) { - ContinuousEffect effect = new SetPowerToughnessTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(source.getSourceId(), game)); - game.addEffect(effect, source); - return true; - } + Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); + if (controller == null || permanent == null) { + return false; } - return false; + + ContinuousEffect effect = new SetBasePowerToughnessTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(source.getSourceId(), game)); + game.addEffect(effect, source); + return true; } } diff --git a/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java b/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java index 95d6f79e7d..67ca9d7848 100644 --- a/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java +++ b/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java @@ -8,7 +8,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -33,7 +33,7 @@ public final class ElvishHouseParty extends CardImpl { // Elvish House Party's power and toughness are each equal to the current hour, // using the twelve-hour system. this.addAbility(new SimpleStaticAbility(Zone.ALL, - new SetPowerToughnessSourceEffect(new CurrentHourCount(), Duration.WhileOnBattlefield))); + new SetBasePowerToughnessSourceEffect(new CurrentHourCount(), Duration.WhileOnBattlefield))); } private ElvishHouseParty(final ElvishHouseParty card) { diff --git a/Mage.Sets/src/mage/cards/e/ElvishImpersonators.java b/Mage.Sets/src/mage/cards/e/ElvishImpersonators.java index 71929b7d95..07f07828d0 100644 --- a/Mage.Sets/src/mage/cards/e/ElvishImpersonators.java +++ b/Mage.Sets/src/mage/cards/e/ElvishImpersonators.java @@ -5,7 +5,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -59,13 +59,13 @@ class ElvishImpersonatorsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - List results = controller.rollDice(outcome, source, game, 6, 2, 0); - int firstRoll = results.get(0); - int secondRoll = results.get(1); - game.addEffect(new SetPowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source); - return true; + if (controller == null) { + return false; } - return false; + List results = controller.rollDice(outcome, source, game, 6, 2, 0); + int firstRoll = results.get(0); + int secondRoll = results.get(1); + game.addEffect(new SetBasePowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source); + return true; } } diff --git a/Mage.Sets/src/mage/cards/e/EnigmaDrake.java b/Mage.Sets/src/mage/cards/e/EnigmaDrake.java index 4ed50aaaa5..963728bdec 100644 --- a/Mage.Sets/src/mage/cards/e/EnigmaDrake.java +++ b/Mage.Sets/src/mage/cards/e/EnigmaDrake.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +32,7 @@ public final class EnigmaDrake extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Enigma Drakes's power is equal to the number of instant and sorcery cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect( new CardsInControllerGraveyardCount(new FilterInstantOrSorceryCard("instant and sorcery cards")), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/e/EntropicSpecter.java b/Mage.Sets/src/mage/cards/e/EntropicSpecter.java index 4d3fb3738c..a4677b8213 100644 --- a/Mage.Sets/src/mage/cards/e/EntropicSpecter.java +++ b/Mage.Sets/src/mage/cards/e/EntropicSpecter.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ChooseOpponentEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -42,7 +42,7 @@ public final class EntropicSpecter extends CardImpl { // Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. this.addAbility(new SimpleStaticAbility(Zone.ALL, // back to the graveyard or if the chosen player left the gane it's again a 0/0 - new SetPowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a))); + new SetBasePowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a))); // Whenever Entropic Specter deals damage to a player, that player discards a card. this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true)); diff --git a/Mage.Sets/src/mage/cards/e/EssenceSymbiote.java b/Mage.Sets/src/mage/cards/e/EssenceSymbiote.java index c33d292e47..48223c26a6 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceSymbiote.java +++ b/Mage.Sets/src/mage/cards/e/EssenceSymbiote.java @@ -95,7 +95,7 @@ class EssenceSymbioteTriggeredAbility extends TriggeredAbilityImpl { && controller.getId().equals(sourcePermanent.getControllerId()) && this.isControlledBy(controller.getId())) { for (Effect effect : this.getEffects()) { - effect.setValue("targetId", targetPermanent.getId()); + effect.setBoostedValue("targetId", targetPermanent.getId()); effect.setTargetPointer(new FixedTarget(targetPermanent.getId(), targetPermanent.getZoneChangeCounter(game))); } return true; diff --git a/Mage.Sets/src/mage/cards/e/EverythingamajigC.java b/Mage.Sets/src/mage/cards/e/EverythingamajigC.java index 1e739b37e7..0e55c31488 100644 --- a/Mage.Sets/src/mage/cards/e/EverythingamajigC.java +++ b/Mage.Sets/src/mage/cards/e/EverythingamajigC.java @@ -160,8 +160,8 @@ class ChimericStaffEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int xValue = source.getManaCostsToPay().getX(); - permanent.getPower().setValue(xValue); - permanent.getToughness().setValue(xValue); + permanent.getPower().setModifiedBaseValue(xValue); + permanent.getToughness().setModifiedBaseValue(xValue); } } return true; diff --git a/Mage.Sets/src/mage/cards/e/EvolvedSleeper.java b/Mage.Sets/src/mage/cards/e/EvolvedSleeper.java index 638e34339f..2d4ae6ac43 100644 --- a/Mage.Sets/src/mage/cards/e/EvolvedSleeper.java +++ b/Mage.Sets/src/mage/cards/e/EvolvedSleeper.java @@ -6,7 +6,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -33,8 +33,8 @@ public final class EvolvedSleeper extends CardImpl { Ability ability = new SimpleActivatedAbility(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.HUMAN, SubType.CLERIC ).setText("{this} becomes a Human Cleric"), new ManaCostsImpl<>("{B}")); - ability.addEffect(new SetPowerToughnessSourceEffect( - 2, 2, Duration.Custom, SubLayer.SetPT_7b + ability.addEffect(new SetBasePowerToughnessSourceEffect( + 2, 2, Duration.Custom, SubLayer.SetPT_7b, true ).setText("with base power and toughness 2/2")); this.addAbility(ability); @@ -86,8 +86,8 @@ class EvolvedSleeperClericEffect extends OneShotEffect { game.addEffect(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.PHYREXIAN, SubType.HUMAN, SubType.CLERIC ), source); - game.addEffect(new SetPowerToughnessSourceEffect( - 3, 3, Duration.Custom, SubLayer.SetPT_7b + game.addEffect(new SetBasePowerToughnessSourceEffect( + 3, 3, Duration.Custom, SubLayer.SetPT_7b, true ), source); return true; } diff --git a/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java b/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java index af3aa1334b..434e1bba2f 100644 --- a/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java +++ b/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java @@ -6,8 +6,9 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.SubType; import mage.constants.SuperType; import mage.abilities.keyword.LifelinkAbility; @@ -82,7 +83,12 @@ class EvraHalcyonWitnessEffect extends OneShotEffect { return false; } player.setLife(amount, game, source); - game.addEffect(new SetPowerToughnessSourceEffect(life, Integer.MIN_VALUE, Duration.Custom, SubLayer.SetPT_7b), source); + // Must set base values, see relevant ruling: + // Any power-modifying effects, counters, Auras, or Equipment will apply after Evra’s power is set to your former life total. + // For example, say Evra is enchanted with Dub (which makes it 6/6) and your life total is 7. + // After the exchange, Evra would be a 9/6 creature (its power became 7, which was then modified by Dub) and your life total would be 6. + // (2018-04-27) + game.addEffect(new SetBasePowerToughnessSourceEffect(StaticValue.get(life), null, Duration.Custom, SubLayer.SetPT_7b, true), source); return true; } } diff --git a/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java b/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java index c676b9cc54..75b5c8d69e 100644 --- a/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java +++ b/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -74,7 +74,7 @@ class ExuberantWolfbearEffect extends OneShotEffect { if (permanent == null) { return false; } - game.addEffect(new SetPowerToughnessTargetEffect( + game.addEffect(new SetBasePowerToughnessTargetEffect( permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn diff --git a/Mage.Sets/src/mage/cards/f/FaerieSwarm.java b/Mage.Sets/src/mage/cards/f/FaerieSwarm.java index 424f5a2727..2726527730 100644 --- a/Mage.Sets/src/mage/cards/f/FaerieSwarm.java +++ b/Mage.Sets/src/mage/cards/f/FaerieSwarm.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class FaerieSwarm extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Faerie Swarm's power and toughness are each equal to the number of blue permanents you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private FaerieSwarm(final FaerieSwarm card) { diff --git a/Mage.Sets/src/mage/cards/f/FigureOfDestiny.java b/Mage.Sets/src/mage/cards/f/FigureOfDestiny.java index 0ce9ea9d0b..d30ae6690d 100644 --- a/Mage.Sets/src/mage/cards/f/FigureOfDestiny.java +++ b/Mage.Sets/src/mage/cards/f/FigureOfDestiny.java @@ -7,7 +7,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -34,8 +34,8 @@ public final class FigureOfDestiny extends CardImpl { Ability ability = new SimpleActivatedAbility(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.KITHKIN, SubType.SPIRIT ).setText("{this} becomes a Kithkin Spirit"), new ManaCostsImpl<>("{R/W}")); - ability.addEffect(new SetPowerToughnessSourceEffect( - 2, 2, Duration.Custom, SubLayer.SetPT_7b + ability.addEffect(new SetBasePowerToughnessSourceEffect( + 2, 2, Duration.Custom, SubLayer.SetPT_7b, true ).setText("with base power and toughness 2/2")); this.addAbility(ability); @@ -85,8 +85,8 @@ class FigureOfDestinySpiritEffect extends OneShotEffect { game.addEffect(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR ), source); - game.addEffect(new SetPowerToughnessSourceEffect( - 4, 4, Duration.Custom, SubLayer.SetPT_7b + game.addEffect(new SetBasePowerToughnessSourceEffect( + 4, 4, Duration.Custom, SubLayer.SetPT_7b, true ), source); return true; } @@ -118,8 +118,8 @@ class FigureOfDestinyWarriorEffect extends OneShotEffect { game.addEffect(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR, SubType.AVATAR ), source); - game.addEffect(new SetPowerToughnessSourceEffect( - 8, 8, Duration.Custom, SubLayer.SetPT_7b + game.addEffect(new SetBasePowerToughnessSourceEffect( + 8, 8, Duration.Custom, SubLayer.SetPT_7b, true ), source); game.addEffect(new GainAbilitySourceEffect( FlyingAbility.getInstance(), Duration.Custom diff --git a/Mage.Sets/src/mage/cards/f/FiligreeAttendant.java b/Mage.Sets/src/mage/cards/f/FiligreeAttendant.java index 112bbd339e..9ee107d984 100644 --- a/Mage.Sets/src/mage/cards/f/FiligreeAttendant.java +++ b/Mage.Sets/src/mage/cards/f/FiligreeAttendant.java @@ -3,7 +3,7 @@ package mage.cards.f; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.ArtifactYouControlCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -27,7 +27,7 @@ public final class FiligreeAttendant extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Filigree Attendant's power is equal to the number of artifacts you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect( ArtifactYouControlCount.instance, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a ).setText("{this}'s power is equal to the number of artifacts you control"))); } diff --git a/Mage.Sets/src/mage/cards/f/Frogify.java b/Mage.Sets/src/mage/cards/f/Frogify.java index f56a580e7a..f6e138d93f 100644 --- a/Mage.Sets/src/mage/cards/f/Frogify.java +++ b/Mage.Sets/src/mage/cards/f/Frogify.java @@ -41,7 +41,6 @@ public final class Frogify extends CardImpl { Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.ALL, Outcome.Detriment ); this.addAbility(new SimpleStaticAbility(effect)); - } private Frogify(final Frogify card) { diff --git a/Mage.Sets/src/mage/cards/f/FungalBehemoth.java b/Mage.Sets/src/mage/cards/f/FungalBehemoth.java index b2c7ab3825..da69c05ad8 100644 --- a/Mage.Sets/src/mage/cards/f/FungalBehemoth.java +++ b/Mage.Sets/src/mage/cards/f/FungalBehemoth.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.SuspendAbility; import mage.cards.CardImpl; @@ -22,7 +22,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.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -40,7 +39,7 @@ public final class FungalBehemoth extends CardImpl { this.toughness = new MageInt(0); // Fungal Behemoth's power and toughness are each equal to the number of +1/+1 counters on creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new P1P1CountersOnControlledCreaturesCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new P1P1CountersOnControlledCreaturesCount(), Duration.EndOfGame))); // Suspend X-{X}{G}{G}. X can't be 0. this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{G}{G}"), this, true)); diff --git a/Mage.Sets/src/mage/cards/f/FuturistOperative.java b/Mage.Sets/src/mage/cards/f/FuturistOperative.java index b8c26f9a16..9508847ab6 100644 --- a/Mage.Sets/src/mage/cards/f/FuturistOperative.java +++ b/Mage.Sets/src/mage/cards/f/FuturistOperative.java @@ -81,8 +81,8 @@ class FuturistOperativeEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GaeasAvenger.java b/Mage.Sets/src/mage/cards/g/GaeasAvenger.java index 9d5dbbde0a..11e7d87e07 100644 --- a/Mage.Sets/src/mage/cards/g/GaeasAvenger.java +++ b/Mage.Sets/src/mage/cards/g/GaeasAvenger.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.IntPlusDynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -37,7 +37,7 @@ public final class GaeasAvenger extends CardImpl { // Gaea's Avenger's power and toughness are each equal to 1 plus the number of artifacts your opponents control. - SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new IntPlusDynamicValue(1, new PermanentsOnBattlefieldCount(filter)), Duration.EndOfGame); + SetBasePowerToughnessSourceEffect effect = new SetBasePowerToughnessSourceEffect(new IntPlusDynamicValue(1, new PermanentsOnBattlefieldCount(filter)), Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); } diff --git a/Mage.Sets/src/mage/cards/g/GaeasLiege.java b/Mage.Sets/src/mage/cards/g/GaeasLiege.java index b65f68de5d..d3cbf08466 100644 --- a/Mage.Sets/src/mage/cards/g/GaeasLiege.java +++ b/Mage.Sets/src/mage/cards/g/GaeasLiege.java @@ -13,13 +13,10 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.SubType; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandPermanent; import mage.game.Game; @@ -48,8 +45,8 @@ public final class GaeasLiege extends CardImpl { // As long as Gaea's Liege isn't attacking, its power and toughness are each equal to the number of Forests you control. As long as Gaea's Liege is attacking, its power and toughness are each equal to the number of Forests defending player controls. this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConditionalContinuousEffect( - new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame), - new SetPowerToughnessSourceEffect(new DefendersForestCount(), Duration.EndOfCombat), + new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame, SubLayer.SetPT_7b), + new SetBasePowerToughnessSourceEffect(new DefendersForestCount(), Duration.EndOfCombat, SubLayer.SetPT_7b), new InvertCondition(SourceAttackingCondition.instance), "As long as {this} isn't attacking, its power and toughness are each equal to the number of Forests you control. As long as {this} is attacking, its power and toughness are each equal to the number of Forests defending player controls."))); // {T}: Target land becomes a Forest until Gaea's Liege leaves the battlefield. diff --git a/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java b/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java index c0122d1f4f..09a728ce9a 100644 --- a/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java +++ b/Mage.Sets/src/mage/cards/g/GeistHonoredMonk.java @@ -5,7 +5,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; @@ -34,7 +34,7 @@ public final class GeistHonoredMonk extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Geist-Honored Monk's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); // When Geist-Honored Monk enters the battlefield, create two 1/1 white Spirit creature tokens with flying. diff --git a/Mage.Sets/src/mage/cards/g/GelatinousGenesis.java b/Mage.Sets/src/mage/cards/g/GelatinousGenesis.java index 7e40aa2c2d..bfc99669d3 100644 --- a/Mage.Sets/src/mage/cards/g/GelatinousGenesis.java +++ b/Mage.Sets/src/mage/cards/g/GelatinousGenesis.java @@ -51,8 +51,8 @@ class GelatinousGenesisEffect extends OneShotEffect { int count = source.getManaCostsToPay().getX(); OozeToken oozeToken = new OozeToken(); - oozeToken.getPower().modifyBaseValue(count); - oozeToken.getToughness().modifyBaseValue(count); + oozeToken.setPower(count); + oozeToken.setToughness(count); oozeToken.putOntoBattlefield(count, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/g/Gigantiform.java b/Mage.Sets/src/mage/cards/g/Gigantiform.java index 16804c033a..bcadb78073 100644 --- a/Mage.Sets/src/mage/cards/g/Gigantiform.java +++ b/Mage.Sets/src/mage/cards/g/Gigantiform.java @@ -11,7 +11,7 @@ import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.KickerAbility; import mage.abilities.keyword.TrampleAbility; @@ -69,7 +69,10 @@ class GigantiformAbility extends StaticAbility { public GigantiformAbility() { super(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA)); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(8, 8, Duration.WhileOnBattlefield, SubLayer.SetPT_7b)); + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new SetBasePowerToughnessSourceEffect(8, 8, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true) + ); this.addEffect(new GainAbilityAttachedEffect(ability, AttachmentType.AURA)); } diff --git a/Mage.Sets/src/mage/cards/g/Gigantomancer.java b/Mage.Sets/src/mage/cards/g/Gigantomancer.java index 0b807ea7dc..5b99529242 100644 --- a/Mage.Sets/src/mage/cards/g/Gigantomancer.java +++ b/Mage.Sets/src/mage/cards/g/Gigantomancer.java @@ -7,7 +7,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -31,7 +31,7 @@ public final class Gigantomancer extends CardImpl { this.toughness = new MageInt(1); //{1}: Target creature you control has base power and toughness 7/7 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(7, 7, Duration.EndOfTurn), new GenericManaCost(1)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessTargetEffect(7, 7, Duration.EndOfTurn), new GenericManaCost(1)); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/Gigantoplasm.java b/Mage.Sets/src/mage/cards/g/Gigantoplasm.java index 6f410e2d0a..88c8d39b0c 100644 --- a/Mage.Sets/src/mage/cards/g/Gigantoplasm.java +++ b/Mage.Sets/src/mage/cards/g/Gigantoplasm.java @@ -12,7 +12,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -57,7 +57,7 @@ class GigantoplasmCopyApplier extends CopyApplier { @Override public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) { DynamicValue variableMana = ManacostVariableValue.REGULAR; - Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); + Effect effect = new SetBasePowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true); effect.setText("This creature has base power and toughness X/X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{X}")); blueprint.getAbilities().add(ability); diff --git a/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java b/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java index efecd2d6ba..486c80aa1f 100644 --- a/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java +++ b/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java @@ -86,8 +86,8 @@ class GodPharaohsGiftEffect extends OneShotEffect { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(cardChosen, game); token.removePTCDA(); - token.getPower().modifyBaseValue(4); - token.getToughness().modifyBaseValue(4); + token.setPower(4); + token.setToughness(4); token.getColor().setColor(ObjectColor.BLACK); token.removeAllCreatureTypes(); token.addSubType(SubType.ZOMBIE); diff --git a/Mage.Sets/src/mage/cards/g/GodheadOfAwe.java b/Mage.Sets/src/mage/cards/g/GodheadOfAwe.java index 6ee4263f9f..f79828197f 100644 --- a/Mage.Sets/src/mage/cards/g/GodheadOfAwe.java +++ b/Mage.Sets/src/mage/cards/g/GodheadOfAwe.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -41,7 +41,7 @@ public final class GodheadOfAwe extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Other creatures have base power and toughness 1/1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); } private GodheadOfAwe(final GodheadOfAwe card) { diff --git a/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java b/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java index 623682eb1a..e2d157d980 100644 --- a/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java +++ b/Mage.Sets/src/mage/cards/g/GrandMasterOfFlowers.java @@ -112,8 +112,8 @@ class GrandMasterOfFlowersEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(7); - permanent.getToughness().setValue(7); + permanent.getPower().setModifiedBaseValue(7); + permanent.getToughness().setModifiedBaseValue(7); return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GravenDominator.java b/Mage.Sets/src/mage/cards/g/GravenDominator.java index 3dc20009ac..e4df5bb82b 100644 --- a/Mage.Sets/src/mage/cards/g/GravenDominator.java +++ b/Mage.Sets/src/mage/cards/g/GravenDominator.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HauntAbility; import mage.cards.CardImpl; @@ -37,9 +37,8 @@ public final class GravenDominator extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Haunt // When Graven Dominator enters the battlefield or the creature it haunts dies, each other creature has base power and toughness 1/1 until end of turn. - Ability ability = new HauntAbility(this, new SetPowerToughnessAllEffect(1,1, Duration.EndOfTurn, filter, true)); + Ability ability = new HauntAbility(this, new SetBasePowerToughnessAllEffect(1,1, Duration.EndOfTurn, filter, true)); this.addAbility(ability); - } private GravenDominator(final GravenDominator card) { diff --git a/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java b/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java index c97b6fc2d0..11d36a30e6 100644 --- a/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java +++ b/Mage.Sets/src/mage/cards/g/GristTheHungerTide.java @@ -124,11 +124,10 @@ class GristTheHungerTideTypeEffect extends ContinuousEffectImpl { sourceObject.addSubType(game, SubType.INSECT); break; case PTChangingEffects_7: - if (sublayer != SubLayer.SetPT_7b) { - break; + if (sublayer == SubLayer.SetPT_7b) { + sourceObject.getPower().setModifiedBaseValue(1); + sourceObject.getToughness().setModifiedBaseValue(1); } - sourceObject.getPower().setValue(1); - sourceObject.getToughness().setValue(1); break; } return true; diff --git a/Mage.Sets/src/mage/cards/h/Halfdane.java b/Mage.Sets/src/mage/cards/h/Halfdane.java index 723b55fc08..8c44950e81 100644 --- a/Mage.Sets/src/mage/cards/h/Halfdane.java +++ b/Mage.Sets/src/mage/cards/h/Halfdane.java @@ -7,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -72,25 +72,24 @@ class HalfdaneUpkeepEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (permanent != null) { - ContinuousEffect effect = new HalfdaneSetPowerToughnessEffect(permanent.getPower().getValue(), permanent.getToughness().getValue()); - game.addEffect(effect, source); - return true; - } + Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (controller == null || permanent == null) { + return false; } - return false; + + ContinuousEffect effect = new HalfdaneSetBasePowerToughnessEffect(permanent.getPower().getValue(), permanent.getToughness().getValue()); + game.addEffect(effect, source); + return true; } } -class HalfdaneSetPowerToughnessEffect extends SetPowerToughnessSourceEffect { +class HalfdaneSetBasePowerToughnessEffect extends SetBasePowerToughnessSourceEffect { - public HalfdaneSetPowerToughnessEffect(int power, int toughness) { - super(power, toughness, Duration.UntilYourNextTurn, SubLayer.SetPT_7b); + public HalfdaneSetBasePowerToughnessEffect(int power, int toughness) { + super(power, toughness, Duration.UntilYourNextTurn, SubLayer.SetPT_7b, true); } - public HalfdaneSetPowerToughnessEffect(final HalfdaneSetPowerToughnessEffect effect) { + public HalfdaneSetBasePowerToughnessEffect(final HalfdaneSetBasePowerToughnessEffect effect) { super(effect); } @@ -103,8 +102,8 @@ class HalfdaneSetPowerToughnessEffect extends SetPowerToughnessSourceEffect { } @Override - public HalfdaneSetPowerToughnessEffect copy() { - return new HalfdaneSetPowerToughnessEffect(this); + public HalfdaneSetBasePowerToughnessEffect copy() { + return new HalfdaneSetBasePowerToughnessEffect(this); } } diff --git a/Mage.Sets/src/mage/cards/h/HalsinEmeraldArchdruid.java b/Mage.Sets/src/mage/cards/h/HalsinEmeraldArchdruid.java index 60d3c41378..1f58d28f48 100644 --- a/Mage.Sets/src/mage/cards/h/HalsinEmeraldArchdruid.java +++ b/Mage.Sets/src/mage/cards/h/HalsinEmeraldArchdruid.java @@ -91,8 +91,8 @@ class HalsinEmeraldArchdruidEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); return true; } } diff --git a/Mage.Sets/src/mage/cards/h/HarmoniousArchon.java b/Mage.Sets/src/mage/cards/h/HarmoniousArchon.java index 94e7c6baf1..4a92f962b1 100644 --- a/Mage.Sets/src/mage/cards/h/HarmoniousArchon.java +++ b/Mage.Sets/src/mage/cards/h/HarmoniousArchon.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,7 +39,7 @@ public final class HarmoniousArchon extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Non-Archon creatures have base power and toughness 3/3. - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessAllEffect( + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessAllEffect( 3, 3, Duration.WhileOnBattlefield, filter, true ))); diff --git a/Mage.Sets/src/mage/cards/h/HaughtyDjinn.java b/Mage.Sets/src/mage/cards/h/HaughtyDjinn.java index fa5ed34c07..e8d51a7ab4 100644 --- a/Mage.Sets/src/mage/cards/h/HaughtyDjinn.java +++ b/Mage.Sets/src/mage/cards/h/HaughtyDjinn.java @@ -4,7 +4,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; import mage.constants.Duration; import mage.constants.SubType; @@ -37,7 +37,7 @@ public final class HaughtyDjinn extends CardImpl { // Haughty Djinn's power is equal to the number of instant and sorcery cards in your graveyard. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerSourceEffect(new CardsInControllerGraveyardCount(filter), Duration.EndOfGame) + new SetBasePowerSourceEffect(new CardsInControllerGraveyardCount(filter), Duration.EndOfGame) )); // Instant and sorcery spells you cast cost {1} less to cast. diff --git a/Mage.Sets/src/mage/cards/h/HeedlessOne.java b/Mage.Sets/src/mage/cards/h/HeedlessOne.java index c65abb46ac..b8f809d892 100644 --- a/Mage.Sets/src/mage/cards/h/HeedlessOne.java +++ b/Mage.Sets/src/mage/cards/h/HeedlessOne.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class HeedlessOne extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Heedless One's power and toughness are each equal to the number of Elves on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private HeedlessOne(final HeedlessOne card) { diff --git a/Mage.Sets/src/mage/cards/h/HordeOfBoggarts.java b/Mage.Sets/src/mage/cards/h/HordeOfBoggarts.java index 2b04ba77d2..613f711764 100644 --- a/Mage.Sets/src/mage/cards/h/HordeOfBoggarts.java +++ b/Mage.Sets/src/mage/cards/h/HordeOfBoggarts.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.MenaceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -37,7 +37,7 @@ public final class HordeOfBoggarts extends CardImpl { this.toughness = new MageInt(0); // Horde of Boggarts's power and toughness are each equal to the number of red permanents you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // Menace (This creature can't be blocked except by two or more creatures.) this.addAbility(new MenaceAbility()); diff --git a/Mage.Sets/src/mage/cards/h/HostileTakeover.java b/Mage.Sets/src/mage/cards/h/HostileTakeover.java index 961813d690..1f46d00b90 100644 --- a/Mage.Sets/src/mage/cards/h/HostileTakeover.java +++ b/Mage.Sets/src/mage/cards/h/HostileTakeover.java @@ -3,7 +3,7 @@ package mage.cards.h; import java.util.UUID; import mage.abilities.effects.common.DamageAllEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -30,12 +30,12 @@ public final class HostileTakeover extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{B}{R}"); // Up to one target creature has base power and toughness 1/1 until end of turn. Up to one other target creature has base power and toughness 4/4 until end of turn. Then Hostile Takeover deals 3 damage to each creature. - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); TargetCreaturePermanent target1 = new TargetCreaturePermanent(0, 1); target1.setTargetTag(1); this.getSpellAbility().addTarget(target1.withChooseHint("1/1")); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) .setTargetPointer(new SecondTargetPointer()) .setText("up to one other target creature has base power and toughness 4/4 until end of turn")); TargetCreaturePermanent target2 = new TargetCreaturePermanent(0, 1, filter, false); diff --git a/Mage.Sets/src/mage/cards/h/HourOfEternity.java b/Mage.Sets/src/mage/cards/h/HourOfEternity.java index b29a1dc529..5e26a57b15 100644 --- a/Mage.Sets/src/mage/cards/h/HourOfEternity.java +++ b/Mage.Sets/src/mage/cards/h/HourOfEternity.java @@ -94,8 +94,8 @@ class HourOfEternityEffect extends OneShotEffect { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(card, game); token.removePTCDA(); - token.getPower().modifyBaseValue(4); - token.getToughness().modifyBaseValue(4); + token.setPower(4); + token.setToughness(4); token.getColor().setColor(ObjectColor.BLACK); token.removeAllCreatureTypes(); token.addSubType(SubType.ZOMBIE); diff --git a/Mage.Sets/src/mage/cards/h/Humble.java b/Mage.Sets/src/mage/cards/h/Humble.java index 0efe6aa13e..3f79ced8ea 100644 --- a/Mage.Sets/src/mage/cards/h/Humble.java +++ b/Mage.Sets/src/mage/cards/h/Humble.java @@ -3,7 +3,7 @@ package mage.cards.h; import java.util.UUID; import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -24,7 +24,7 @@ public final class Humble extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn) .setText("Target creature loses all abilities")); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn) + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(0, 1, Duration.EndOfTurn) .setText("and becomes 0/1 until end of turn")); } diff --git a/Mage.Sets/src/mage/cards/h/Humility.java b/Mage.Sets/src/mage/cards/h/Humility.java index 5018b6122f..ac01a51797 100644 --- a/Mage.Sets/src/mage/cards/h/Humility.java +++ b/Mage.Sets/src/mage/cards/h/Humility.java @@ -12,6 +12,7 @@ import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -60,23 +61,23 @@ public final class Humility extends CardImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (Permanent permanent : game.getBattlefield().getActivePermanents( - new FilterCreaturePermanent(), source.getControllerId(), source, game)) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - permanent.removeAllAbilities(source.getSourceId(), game); - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); - } - } - } - return true; + if (player == null) { + return false; } - return false; + for (Permanent permanent : game.getBattlefield().getActivePermanents( + StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + permanent.removeAllAbilities(source.getSourceId(), game); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); + } + } + } + return true; } @Override @@ -89,6 +90,5 @@ public final class Humility extends CardImpl { return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; } - } } diff --git a/Mage.Sets/src/mage/cards/i/IllusoryWrappings.java b/Mage.Sets/src/mage/cards/i/IllusoryWrappings.java index 153d7cd788..6aa2de513c 100644 --- a/Mage.Sets/src/mage/cards/i/IllusoryWrappings.java +++ b/Mage.Sets/src/mage/cards/i/IllusoryWrappings.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,7 +35,7 @@ public final class IllusoryWrappings extends CardImpl { this.addAbility(ability); // Enchanted creature has base power and toughness 0/2. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessEnchantedEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessEnchantedEffect())); } diff --git a/Mage.Sets/src/mage/cards/i/InkfathomWitch.java b/Mage.Sets/src/mage/cards/i/InkfathomWitch.java index 01bd628b8f..8d349f1a8a 100644 --- a/Mage.Sets/src/mage/cards/i/InkfathomWitch.java +++ b/Mage.Sets/src/mage/cards/i/InkfathomWitch.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class InkfathomWitch extends CardImpl { // Fear this.addAbility(FearAbility.getInstance()); // {2}{U}{B}: Each unblocked creature has base power and toughness 4/1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessAllEffect(4, 1, Duration.EndOfTurn, filter, true), new ManaCostsImpl<>("{2}{U}{B}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessAllEffect(4, 1, Duration.EndOfTurn, filter, true), new ManaCostsImpl<>("{2}{U}{B}"))); } private InkfathomWitch(final InkfathomWitch card) { diff --git a/Mage.Sets/src/mage/cards/i/IronrootWarlord.java b/Mage.Sets/src/mage/cards/i/IronrootWarlord.java index 4060bea981..14c61ccb28 100644 --- a/Mage.Sets/src/mage/cards/i/IronrootWarlord.java +++ b/Mage.Sets/src/mage/cards/i/IronrootWarlord.java @@ -7,7 +7,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -37,7 +37,7 @@ public final class IronrootWarlord extends CardImpl { // Ironroot Warlord's power is equal to the number of creatures you control. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerSourceEffect(xValue, Duration.EndOfGame) + new SetBasePowerSourceEffect(xValue, Duration.EndOfGame) .setText("{this}'s power is equal to the number of creatures you control") )); diff --git a/Mage.Sets/src/mage/cards/i/IslandOfWakWak.java b/Mage.Sets/src/mage/cards/i/IslandOfWakWak.java index 49ed6f3a5f..52001006c0 100644 --- a/Mage.Sets/src/mage/cards/i/IslandOfWakWak.java +++ b/Mage.Sets/src/mage/cards/i/IslandOfWakWak.java @@ -5,9 +5,10 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -67,8 +68,8 @@ class IslandOfWakWakEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { - int toughness = targetCreature.getToughness().getBaseValueModified(); - game.addEffect(new SetPowerToughnessTargetEffect(0, toughness, Duration.EndOfTurn), source); + int toughness = targetCreature.getToughness().getModifiedBaseValue(); + game.addEffect(new SetBasePowerToughnessTargetEffect(null, StaticValue.get(toughness), Duration.EndOfTurn), source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/i/Ixidron.java b/Mage.Sets/src/mage/cards/i/Ixidron.java index 276024aaff..696f27ecff 100644 --- a/Mage.Sets/src/mage/cards/i/Ixidron.java +++ b/Mage.Sets/src/mage/cards/i/Ixidron.java @@ -4,11 +4,10 @@ package mage.cards.i; import java.util.UUID; import mage.MageInt; import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -47,7 +46,7 @@ public final class Ixidron extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new BecomesFaceDownCreatureAllEffect(filterTurnFaceDown))); // Ixidron's power and toughness are each equal to the number of face-down creatures on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private Ixidron(final Ixidron card) { diff --git a/Mage.Sets/src/mage/cards/j/JaggedScarArchers.java b/Mage.Sets/src/mage/cards/j/JaggedScarArchers.java index 8c71bdc4b7..95ac37b64c 100644 --- a/Mage.Sets/src/mage/cards/j/JaggedScarArchers.java +++ b/Mage.Sets/src/mage/cards/j/JaggedScarArchers.java @@ -10,7 +10,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -45,7 +45,7 @@ public final class JaggedScarArchers extends CardImpl { this.toughness = new MageInt(0); // Jagged-Scar Archers's power and toughness are each equal to the number of Elves you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(controlledElvesFilter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(controlledElvesFilter), Duration.EndOfGame))); // {tap}: Jagged-Scar Archers deals damage equal to its power to target creature with flying. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SourcePermanentPowerCount()).setText("{this} deals damage equal to its power to target creature with flying"), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(flyingCreatureFilter)); diff --git a/Mage.Sets/src/mage/cards/j/JolraelMwonvuliRecluse.java b/Mage.Sets/src/mage/cards/j/JolraelMwonvuliRecluse.java index c4b120765b..f1bf524192 100644 --- a/Mage.Sets/src/mage/cards/j/JolraelMwonvuliRecluse.java +++ b/Mage.Sets/src/mage/cards/j/JolraelMwonvuliRecluse.java @@ -6,7 +6,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -36,7 +36,7 @@ public final class JolraelMwonvuliRecluse extends CardImpl { this.addAbility(new DrawSecondCardTriggeredAbility(new CreateTokenEffect(new GreenCat2Token()), false)); // {4}{G}{G}: Until end of turn, creatures you control have base power and toughness X/X, where X is the number of cards in your hand. - this.addAbility(new SimpleActivatedAbility(new SetPowerToughnessAllEffect( + this.addAbility(new SimpleActivatedAbility(new SetBasePowerToughnessAllEffect( CardsInControllerHandCount.instance, CardsInControllerHandCount.instance, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true ).setText("until end of turn, creatures you control have base power and toughness X/X, " + diff --git a/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java b/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java index a7c523a733..76b851ee93 100644 --- a/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java +++ b/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java @@ -12,7 +12,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.common.continuous.BoostAllEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -39,7 +39,7 @@ public final class KagemaroFirstToSuffer extends CardImpl { DynamicValue xValue = CardsInControllerHandCount.instance; // Kagemaro, First to Suffer's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // {B}, Sacrifice Kagemaro: All creatures get -X/-X until end of turn, where X is the number of cards in your hand. DynamicValue xMinusValue = new SignInversionDynamicValue(xValue); diff --git a/Mage.Sets/src/mage/cards/k/KalonianTwingrove.java b/Mage.Sets/src/mage/cards/k/KalonianTwingrove.java index 0563680c9f..a77cd4b07f 100644 --- a/Mage.Sets/src/mage/cards/k/KalonianTwingrove.java +++ b/Mage.Sets/src/mage/cards/k/KalonianTwingrove.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -39,7 +39,7 @@ public final class KalonianTwingrove extends CardImpl { this.toughness = new MageInt(0); // Kalonian Twingrove's power and toughness are each equal to the number of Forests you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); // When Kalonian Twingrove enters the battlefield, create a green Treefolk Warrior creature token with "This creature's power and toughness are each equal to the number of Forests you control." Effect effect = new CreateTokenEffect(new KalonianTwingroveTreefolkWarriorToken()); effect.setText("create a green Treefolk Warrior creature token with \"This creature's power and toughness are each equal to the number of Forests you control.\""); diff --git a/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java b/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java index f2fcff6dc4..3a15dc78ee 100644 --- a/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java +++ b/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java @@ -90,8 +90,8 @@ class KarnSilverGolemEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int cmc = artifact.getManaValue(); - artifact.getPower().setValue(cmc); - artifact.getToughness().setValue(cmc); + artifact.getPower().setModifiedBaseValue(cmc); + artifact.getToughness().setModifiedBaseValue(cmc); } } return true; diff --git a/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java b/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java index 0c28284bed..53ba219c9c 100644 --- a/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java +++ b/Mage.Sets/src/mage/cards/k/KarnTheGreatCreator.java @@ -125,8 +125,8 @@ class KarnTheGreatCreatorAnimateEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int cmc = artifact.getManaValue(); - artifact.getPower().setValue(cmc); - artifact.getToughness().setValue(cmc); + artifact.getPower().setModifiedBaseValue(cmc); + artifact.getToughness().setModifiedBaseValue(cmc); } } return true; diff --git a/Mage.Sets/src/mage/cards/k/KarnsTouch.java b/Mage.Sets/src/mage/cards/k/KarnsTouch.java index f619af90fb..30138737e2 100644 --- a/Mage.Sets/src/mage/cards/k/KarnsTouch.java +++ b/Mage.Sets/src/mage/cards/k/KarnsTouch.java @@ -84,8 +84,8 @@ class KarnsTouchEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int cmc = artifact.getManaValue(); - artifact.getPower().setValue(cmc); - artifact.getToughness().setValue(cmc); + artifact.getPower().setModifiedBaseValue(cmc); + artifact.getToughness().setModifiedBaseValue(cmc); } } return true; diff --git a/Mage.Sets/src/mage/cards/k/KatildaDawnhartMartyr.java b/Mage.Sets/src/mage/cards/k/KatildaDawnhartMartyr.java index 57b7680039..5fba222080 100644 --- a/Mage.Sets/src/mage/cards/k/KatildaDawnhartMartyr.java +++ b/Mage.Sets/src/mage/cards/k/KatildaDawnhartMartyr.java @@ -2,10 +2,9 @@ package mage.cards.k; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; import mage.abilities.keyword.DisturbAbility; @@ -62,7 +61,7 @@ public final class KatildaDawnhartMartyr extends CardImpl { // Katilda, Dawnhart Martyr's power and toughness are each equal to the number of permanents you control that are Spirits and/or enchantments. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame) ).addHint(hint)); // Disturb {3}{W}{W} diff --git a/Mage.Sets/src/mage/cards/k/KatsumasaTheAnimator.java b/Mage.Sets/src/mage/cards/k/KatsumasaTheAnimator.java index ecedfaf219..730af23447 100644 --- a/Mage.Sets/src/mage/cards/k/KatsumasaTheAnimator.java +++ b/Mage.Sets/src/mage/cards/k/KatsumasaTheAnimator.java @@ -8,7 +8,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -105,7 +105,7 @@ class KatsumasaTheAnimatorEffect extends OneShotEffect { FlyingAbility.getInstance(), Duration.EndOfTurn ), source); if (!permanent.hasSubtype(SubType.VEHICLE, game)) { - game.addEffect(new SetPowerToughnessTargetEffect( + game.addEffect(new SetBasePowerToughnessTargetEffect( 1, 1, Duration.EndOfTurn ), source); } diff --git a/Mage.Sets/src/mage/cards/k/KeldonWarlord.java b/Mage.Sets/src/mage/cards/k/KeldonWarlord.java index 1ce22f4c11..3ebf8b8af9 100644 --- a/Mage.Sets/src/mage/cards/k/KeldonWarlord.java +++ b/Mage.Sets/src/mage/cards/k/KeldonWarlord.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class KeldonWarlord extends CardImpl { this.toughness = new MageInt(0); // Keldon Warlord's power and toughness are each equal to the number of non-Wall creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private KeldonWarlord(final KeldonWarlord card) { diff --git a/Mage.Sets/src/mage/cards/k/KineticAugur.java b/Mage.Sets/src/mage/cards/k/KineticAugur.java index ded12e23c6..efb3a88377 100644 --- a/Mage.Sets/src/mage/cards/k/KineticAugur.java +++ b/Mage.Sets/src/mage/cards/k/KineticAugur.java @@ -5,7 +5,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.effects.common.discard.DiscardAndDrawThatManyEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -39,7 +39,7 @@ public final class KineticAugur extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Kinetic Augur's power is equal to the number of instant and sorcery cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(xValue, Duration.EndOfGame))); // When Kinetic Augur enters the battlefield, discard up to two cards, then draw that many cards. this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardAndDrawThatManyEffect(2))); diff --git a/Mage.Sets/src/mage/cards/k/KithkinRabble.java b/Mage.Sets/src/mage/cards/k/KithkinRabble.java index f477470e1c..9869633a11 100644 --- a/Mage.Sets/src/mage/cards/k/KithkinRabble.java +++ b/Mage.Sets/src/mage/cards/k/KithkinRabble.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class KithkinRabble extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Kithkin Rabble's power and toughness are each equal to the number of white permanents you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private KithkinRabble(final KithkinRabble card) { diff --git a/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java b/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java index cf00b5ed59..52456b7fce 100644 --- a/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java +++ b/Mage.Sets/src/mage/cards/k/KiyomaroFirstToStand.java @@ -15,7 +15,7 @@ import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -27,7 +27,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; /** * @@ -44,7 +43,7 @@ public final class KiyomaroFirstToStand extends CardImpl { // Kiyomaro, First to Stand's power and toughness are each equal to the number of cards in your hand. DynamicValue xValue= CardsInControllerHandCount.instance; - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // As long as you have four or more cards in hand, Kiyomaro has vigilance. Condition condition = new CardsInHandCondition(ComparisonType.MORE_THAN,3); diff --git a/Mage.Sets/src/mage/cards/k/KodamaOfTheCenterTree.java b/Mage.Sets/src/mage/cards/k/KodamaOfTheCenterTree.java index df0bbc2e70..bea21b5a3e 100644 --- a/Mage.Sets/src/mage/cards/k/KodamaOfTheCenterTree.java +++ b/Mage.Sets/src/mage/cards/k/KodamaOfTheCenterTree.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.SoulshiftAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class KodamaOfTheCenterTree extends CardImpl { this.toughness = new MageInt(0); // Kodama of the Center Tree's power and toughness are each equal to the number of Spirits you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // Kodama of the Center Tree has soulshift X, where X is the number of Spirits you control. this.addAbility(new SoulshiftAbility(new PermanentsOnBattlefieldCount(filter))); diff --git a/Mage.Sets/src/mage/cards/k/KolaghanForerunners.java b/Mage.Sets/src/mage/cards/k/KolaghanForerunners.java index 010c61480f..634feaff63 100644 --- a/Mage.Sets/src/mage/cards/k/KolaghanForerunners.java +++ b/Mage.Sets/src/mage/cards/k/KolaghanForerunners.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.DashAbility; import mage.abilities.keyword.TrampleAbility; @@ -34,7 +34,7 @@ public final class KolaghanForerunners extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Kolaghan Forerunners' power is equal to the number of creatures you control. - Effect effect = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURES), Duration.EndOfGame); + Effect effect = new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURES), Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect).addHint(CreaturesYouControlHint.instance)); // Dash {2}{R} diff --git a/Mage.Sets/src/mage/cards/k/KorlashHeirToBlackblade.java b/Mage.Sets/src/mage/cards/k/KorlashHeirToBlackblade.java index e2ead6e160..7d076c6020 100644 --- a/Mage.Sets/src/mage/cards/k/KorlashHeirToBlackblade.java +++ b/Mage.Sets/src/mage/cards/k/KorlashHeirToBlackblade.java @@ -10,7 +10,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RegenerateSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -43,7 +43,7 @@ public final class KorlashHeirToBlackblade extends CardImpl { this.toughness = new MageInt(0); // Korlash, Heir to Blackblade's power and toughness are each equal to the number of Swamps you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterPermanent), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterPermanent), Duration.EndOfGame))); // {1}{B}: Regenerate Korlash. Effect effect = new RegenerateSourceEffect(); diff --git a/Mage.Sets/src/mage/cards/k/KrovikanMist.java b/Mage.Sets/src/mage/cards/k/KrovikanMist.java index 0f550890ee..72e96db1d4 100644 --- a/Mage.Sets/src/mage/cards/k/KrovikanMist.java +++ b/Mage.Sets/src/mage/cards/k/KrovikanMist.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class KrovikanMist extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Krovikan Mist's power and toughness are each equal to the number of Illusions on the battlefield. this.addAbility(new SimpleStaticAbility(Zone.ALL, - new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(illusionsFilter), Duration.EndOfGame))); + new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(illusionsFilter), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/l/Lhurgoyf.java b/Mage.Sets/src/mage/cards/l/Lhurgoyf.java index 846738bfb2..c7261aae1d 100644 --- a/Mage.Sets/src/mage/cards/l/Lhurgoyf.java +++ b/Mage.Sets/src/mage/cards/l/Lhurgoyf.java @@ -2,22 +2,20 @@ package mage.cards.l; import java.util.UUID; import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; import mage.constants.SubLayer; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.game.Game; -import mage.players.Player; /** * @@ -25,6 +23,9 @@ import mage.players.Player; */ public final class Lhurgoyf extends CardImpl { + private static final DynamicValue powerValue = new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE); + private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1)); + public Lhurgoyf(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.subtype.add(SubType.LHURGOYF); @@ -33,7 +34,11 @@ public final class Lhurgoyf extends CardImpl { this.toughness = new MageInt(0); // Lhurgoyf's power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LhurgoyfEffect())); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a, false) + .setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1") + )); } private Lhurgoyf(final Lhurgoyf card) { @@ -45,45 +50,3 @@ public final class Lhurgoyf extends CardImpl { return new Lhurgoyf(this); } } - -class LhurgoyfEffect extends ContinuousEffectImpl { - - public LhurgoyfEffect() { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); - staticText = "{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1"; - } - - public LhurgoyfEffect(final LhurgoyfEffect effect) { - super(effect); - } - - @Override - public LhurgoyfEffect copy() { - return new LhurgoyfEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - MageObject mageObject = game.getObject(source); - if (mageObject != null) { - int number = 0; - for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { - Player player = game.getPlayer(playerId); - if (player != null) { - number += player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); - } - } - - mageObject.getPower().setValue(number); - mageObject.getToughness().setValue(number + 1); - return true; - - } - } - - return false; - } - -} diff --git a/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java b/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java index ae0fc19dd8..032861de21 100644 --- a/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java +++ b/Mage.Sets/src/mage/cards/l/LiegeOfTheTangle.java @@ -89,8 +89,8 @@ class LiegeOfTheTangleEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - perm.getPower().setValue(8); - perm.getToughness().setValue(8); + perm.getPower().setModifiedBaseValue(8); + perm.getToughness().setModifiedBaseValue(8); } break; } diff --git a/Mage.Sets/src/mage/cards/l/LifeAndLimb.java b/Mage.Sets/src/mage/cards/l/LifeAndLimb.java index 27fa809f16..8780eca234 100644 --- a/Mage.Sets/src/mage/cards/l/LifeAndLimb.java +++ b/Mage.Sets/src/mage/cards/l/LifeAndLimb.java @@ -66,33 +66,33 @@ class LifeAndLimbEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { - switch (layer) { - case TypeChangingEffects_4: - permanent.addCardType(game, CardType.CREATURE); - permanent.addCardType(game, CardType.LAND); - permanent.addSubType(game, SubType.SAPROLING); - // land abilities are intrinsic, so add them here, not in layer 6 - permanent.addSubType(game, SubType.FOREST); - if (!permanent.getAbilities(game).containsClass(GreenManaAbility.class)) { - permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game); - } - break; - case ColorChangingEffects_5: - permanent.getColor(game).setColor(ObjectColor.GREEN); - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); - } - break; - } - } - return true; + if (player == null) { + return false; } - return false; + for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + switch (layer) { + case TypeChangingEffects_4: + permanent.addCardType(game, CardType.CREATURE); + permanent.addCardType(game, CardType.LAND); + permanent.addSubType(game, SubType.SAPROLING); + // land abilities are intrinsic, so add them here, not in layer 6 + permanent.addSubType(game, SubType.FOREST); + if (!permanent.getAbilities(game).containsClass(GreenManaAbility.class)) { + permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game); + } + break; + case ColorChangingEffects_5: + permanent.getColor(game).setColor(ObjectColor.GREEN); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); + } + break; + } + } + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/l/LivingLore.java b/Mage.Sets/src/mage/cards/l/LivingLore.java index 9b75b7c7bc..7856013733 100644 --- a/Mage.Sets/src/mage/cards/l/LivingLore.java +++ b/Mage.Sets/src/mage/cards/l/LivingLore.java @@ -11,7 +11,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DoIfCostPaid; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -45,7 +45,7 @@ public final class LivingLore extends CardImpl { // Living Lore's power and toughness are each equal to the exiled card's converted mana cost. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(LivingLoreValue.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(LivingLoreValue.instance, Duration.EndOfGame) .setText("{this}'s power and toughness are each equal to the exiled card's mana value") )); diff --git a/Mage.Sets/src/mage/cards/l/LordOfExtinction.java b/Mage.Sets/src/mage/cards/l/LordOfExtinction.java index bfdf4ffc37..e498030df8 100644 --- a/Mage.Sets/src/mage/cards/l/LordOfExtinction.java +++ b/Mage.Sets/src/mage/cards/l/LordOfExtinction.java @@ -7,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -31,7 +31,7 @@ public final class LordOfExtinction extends CardImpl { this.toughness = new MageInt(0); // Lord of Extinction's power and toughness are each equal to the number of cards in all graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new LordOfExtinctionDynamicCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new LordOfExtinctionDynamicCount(), Duration.EndOfGame))); } private LordOfExtinction(final LordOfExtinction card) { diff --git a/Mage.Sets/src/mage/cards/l/LostOrderOfJarkeld.java b/Mage.Sets/src/mage/cards/l/LostOrderOfJarkeld.java index 237a561940..62b178a47a 100644 --- a/Mage.Sets/src/mage/cards/l/LostOrderOfJarkeld.java +++ b/Mage.Sets/src/mage/cards/l/LostOrderOfJarkeld.java @@ -9,7 +9,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ChooseOpponentEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -38,7 +38,7 @@ public final class LostOrderOfJarkeld extends CardImpl { // Lost Order of Jarkeld's power and toughness are each equal to 1 plus the number of creatures the chosen player controls. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerToughnessSourceEffect(new AdditiveDynamicValue( + new SetBasePowerToughnessSourceEffect(new AdditiveDynamicValue( CreaturesControlledByChosenPlayer.instance, StaticValue.get(1) ), Duration.EndOfGame) )); diff --git a/Mage.Sets/src/mage/cards/m/Magnivore.java b/Mage.Sets/src/mage/cards/m/Magnivore.java index c7aa195645..3536df11d2 100644 --- a/Mage.Sets/src/mage/cards/m/Magnivore.java +++ b/Mage.Sets/src/mage/cards/m/Magnivore.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,7 +36,7 @@ public final class Magnivore extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // Magnivore's power and toughness are each equal to the number of sorcery cards in all graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInAllGraveyardsCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInAllGraveyardsCount(filter), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/m/MajesticMetamorphosis.java b/Mage.Sets/src/mage/cards/m/MajesticMetamorphosis.java index f55ea7479e..bc03754a22 100644 --- a/Mage.Sets/src/mage/cards/m/MajesticMetamorphosis.java +++ b/Mage.Sets/src/mage/cards/m/MajesticMetamorphosis.java @@ -76,8 +76,8 @@ class MajesticMetamorphosisEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java b/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java index 9e269f2a0b..3cee688ead 100644 --- a/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java +++ b/Mage.Sets/src/mage/cards/m/MajesticMyriarch.java @@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,7 +35,7 @@ public final class MajesticMyriarch extends CardImpl { // Majestic Myriarch's power and toughness are each equal to twice the number of creatures you control. DynamicValue xValue = new MultipliedValue(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), 2); - Effect effect = new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame); + Effect effect = new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame); effect.setText("{this}'s power and toughness are each equal to twice the number of creatures you control"); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); diff --git a/Mage.Sets/src/mage/cards/m/Malignus.java b/Mage.Sets/src/mage/cards/m/Malignus.java index c77646fff4..cf063380c8 100644 --- a/Mage.Sets/src/mage/cards/m/Malignus.java +++ b/Mage.Sets/src/mage/cards/m/Malignus.java @@ -9,7 +9,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class Malignus extends CardImpl { this.toughness = new MageInt(0); // Malignus's power and toughness are each equal to half the highest life total among your opponents, rounded up. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new HighestLifeTotalAmongOpponentsCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new HighestLifeTotalAmongOpponentsCount(), Duration.EndOfGame))); // Damage that would be dealt by Malignus can't be prevented. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MalignusEffect())); diff --git a/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java b/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java index 5ef17bfdb2..28dcdfde31 100644 --- a/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java +++ b/Mage.Sets/src/mage/cards/m/MarathWillOfTheWild.java @@ -112,8 +112,8 @@ class MarathWillOfTheWildCreateTokenEffect extends OneShotEffect { if (player != null) { int amount = ManacostVariableValue.REGULAR.calculate(game, source, this); Token token = new MarathWillOfTheWildElementalToken(); - token.getPower().modifyBaseValue(amount); - token.getToughness().modifyBaseValue(amount); + token.setPower(amount); + token.setToughness(amount); token.putOntoBattlefield(1, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/m/MaraxusOfKeld.java b/Mage.Sets/src/mage/cards/m/MaraxusOfKeld.java index 79d7be25a6..c8ae08e457 100644 --- a/Mage.Sets/src/mage/cards/m/MaraxusOfKeld.java +++ b/Mage.Sets/src/mage/cards/m/MaraxusOfKeld.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -43,7 +43,7 @@ public final class MaraxusOfKeld extends CardImpl { this.toughness = new MageInt(0); // Maraxus of Keld's power and toughness are each equal to the number of untapped artifacts, creatures, and lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private MaraxusOfKeld(final MaraxusOfKeld card) { diff --git a/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java b/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java index 8c1f382159..d6d34bedee 100644 --- a/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java +++ b/Mage.Sets/src/mage/cards/m/MarchOfTheMachines.java @@ -82,8 +82,8 @@ class MarchOfTheMachinesEffect extends ContinuousEffectImpl { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { int manaCost = permanent.getManaValue(); - permanent.getPower().setValue(manaCost); - permanent.getToughness().setValue(manaCost); + permanent.getPower().setModifiedBaseValue(manaCost); + permanent.getToughness().setModifiedBaseValue(manaCost); } } } diff --git a/Mage.Sets/src/mage/cards/m/Maro.java b/Mage.Sets/src/mage/cards/m/Maro.java index cf7764be0f..895b63c53d 100644 --- a/Mage.Sets/src/mage/cards/m/Maro.java +++ b/Mage.Sets/src/mage/cards/m/Maro.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -27,7 +27,7 @@ public final class Maro extends CardImpl { this.toughness = new MageInt(0); // Maro's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); } private Maro(final Maro card) { diff --git a/Mage.Sets/src/mage/cards/m/MarshFlitter.java b/Mage.Sets/src/mage/cards/m/MarshFlitter.java index 3130d19321..41e36f8ed2 100644 --- a/Mage.Sets/src/mage/cards/m/MarshFlitter.java +++ b/Mage.Sets/src/mage/cards/m/MarshFlitter.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,11 +44,10 @@ public final class MarshFlitter extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinRogueToken(), 2), false)); // Sacrifice a Goblin: Marsh Flitter has base power and toughness 3/3 until end of turn. - Effect effect = new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn, SubLayer.SetPT_7b); + Effect effect = new SetBasePowerToughnessSourceEffect(3, 3, Duration.EndOfTurn, SubLayer.SetPT_7b, true); effect.setText("{this} has base power and toughness 3/3 until end of turn"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); - } private MarshFlitter(final MarshFlitter card) { diff --git a/Mage.Sets/src/mage/cards/m/MassDiminish.java b/Mage.Sets/src/mage/cards/m/MassDiminish.java index a040e79260..3da083c66a 100644 --- a/Mage.Sets/src/mage/cards/m/MassDiminish.java +++ b/Mage.Sets/src/mage/cards/m/MassDiminish.java @@ -3,14 +3,13 @@ package mage.cards.m; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.TimingRule; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; @@ -64,7 +63,7 @@ class MassDiminishEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new ControllerIdPredicate(source.getFirstTarget())); - game.addEffect(new SetPowerToughnessAllEffect( + game.addEffect(new SetBasePowerToughnessAllEffect( 1, 1, Duration.UntilYourNextTurn, filter, true ), source); return true; diff --git a/Mage.Sets/src/mage/cards/m/MasterOfEtherium.java b/Mage.Sets/src/mage/cards/m/MasterOfEtherium.java index 3108ce2d7e..2f5acbdbb0 100644 --- a/Mage.Sets/src/mage/cards/m/MasterOfEtherium.java +++ b/Mage.Sets/src/mage/cards/m/MasterOfEtherium.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.BoostControlledEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -37,7 +37,7 @@ public final class MasterOfEtherium extends CardImpl { this.toughness = new MageInt(0); // Master of Etherium's power and toughness are each equal to the number of artifacts you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterCounted), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterCounted), Duration.EndOfGame))); // Other artifact creatures you control get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterBoosted, true))); diff --git a/Mage.Sets/src/mage/cards/m/MasterOfWinds.java b/Mage.Sets/src/mage/cards/m/MasterOfWinds.java index 804259ae0f..aa83c37f1b 100644 --- a/Mage.Sets/src/mage/cards/m/MasterOfWinds.java +++ b/Mage.Sets/src/mage/cards/m/MasterOfWinds.java @@ -6,7 +6,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawDiscardControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -78,8 +78,8 @@ class MasterOfWindsEffect extends OneShotEffect { Outcome.Neutral, "Have this creature become a 4/1 or a 1/4?", null, "4/1", "1/4", source, game ) ? 4 : 1; - game.addEffect(new SetPowerToughnessSourceEffect( - power, 5 - power, Duration.EndOfTurn, SubLayer.SetPT_7b + game.addEffect(new SetBasePowerToughnessSourceEffect( + power, 5 - power, Duration.EndOfTurn, SubLayer.SetPT_7b, true ), source); return true; } diff --git a/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java b/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java index df08614afa..08e559e41f 100644 --- a/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java +++ b/Mage.Sets/src/mage/cards/m/MasumaroFirstToLive.java @@ -8,7 +8,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.MultipliedValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -33,7 +33,7 @@ public final class MasumaroFirstToLive extends CardImpl { // Masumaro, First to Live's power and toughness are each equal to twice the number of cards in your hand. DynamicValue xValue= new MultipliedValue(CardsInControllerHandCount.instance, 2); - Effect effect = new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame); + Effect effect = new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame); effect.setText("{this}'s power and toughness are each equal to twice the number of cards in your hand"); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); diff --git a/Mage.Sets/src/mage/cards/m/MatcaRioters.java b/Mage.Sets/src/mage/cards/m/MatcaRioters.java index 7476b3398d..13d8a899a9 100644 --- a/Mage.Sets/src/mage/cards/m/MatcaRioters.java +++ b/Mage.Sets/src/mage/cards/m/MatcaRioters.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -30,7 +30,7 @@ public final class MatcaRioters extends CardImpl { this.toughness = new MageInt(0); // Domain - Matca Rioters's power and toughness are each equal to the number of basic land types among lands you control. - Effect effect = new SetPowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame); + Effect effect = new SetBasePowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame); effect.setText("Domain — {this}'s power and toughness are each equal to the number of basic land types among lands you control."); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect).addHint(DomainHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java b/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java index a03bce8582..72cca61d6f 100644 --- a/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java +++ b/Mage.Sets/src/mage/cards/m/MetamorphicAlteration.java @@ -139,8 +139,8 @@ class MetamorphicAlterationEffect extends ContinuousEffectImpl { for (Ability ability : copied.getAbilities()) { permanent.addAbility(ability, source.getSourceId(), game); } - permanent.getPower().setValue(copied.getPower().getBaseValueModified()); - permanent.getToughness().setValue(copied.getToughness().getBaseValueModified()); + permanent.getPower().setModifiedBaseValue(copied.getPower().getBaseValue()); + permanent.getToughness().setModifiedBaseValue(copied.getToughness().getBaseValue()); return true; } diff --git a/Mage.Sets/src/mage/cards/m/MimingSlime.java b/Mage.Sets/src/mage/cards/m/MimingSlime.java index 9fe19d9c1a..d0a668551b 100644 --- a/Mage.Sets/src/mage/cards/m/MimingSlime.java +++ b/Mage.Sets/src/mage/cards/m/MimingSlime.java @@ -67,8 +67,8 @@ class MimingSlimeEffect extends OneShotEffect { } } OozeToken oozeToken = new OozeToken(); - oozeToken.getPower().modifyBaseValue(amount); - oozeToken.getToughness().modifyBaseValue(amount); + oozeToken.setPower(amount); + oozeToken.setToughness(amount); oozeToken.putOntoBattlefield(1, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/m/MindlinkMech.java b/Mage.Sets/src/mage/cards/m/MindlinkMech.java index 38bd095507..e6310efc92 100644 --- a/Mage.Sets/src/mage/cards/m/MindlinkMech.java +++ b/Mage.Sets/src/mage/cards/m/MindlinkMech.java @@ -205,8 +205,8 @@ class MindlinkMechEffect extends OneShotEffect { class MindlinkMechApplier extends CopyApplier { @Override public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) { - blueprint.getPower().modifyBaseValue(4); - blueprint.getToughness().modifyBaseValue(3); + blueprint.getPower().setModifiedBaseValue(4); + blueprint.getToughness().setModifiedBaseValue(3); blueprint.addCardType(game, CardType.ARTIFACT); blueprint.addSubType(game, SubType.VEHICLE); blueprint.getAbilities().add(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/cards/m/MinionOfTheWastes.java b/Mage.Sets/src/mage/cards/m/MinionOfTheWastes.java index 62580bbdbf..4fa6df8ea6 100644 --- a/Mage.Sets/src/mage/cards/m/MinionOfTheWastes.java +++ b/Mage.Sets/src/mage/cards/m/MinionOfTheWastes.java @@ -8,7 +8,7 @@ import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -83,7 +83,7 @@ class MinionOfTheWastesEffect extends OneShotEffect { Card sourceCard = game.getCard(source.getSourceId()); game.informPlayers((sourceCard != null ? sourceCard.getLogName() : "") + ": " + controller.getLogName() + " pays " + payAmount + " life"); - game.addEffect(new SetPowerToughnessSourceEffect( + game.addEffect(new SetBasePowerToughnessSourceEffect( payAmount, payAmount, Duration.Custom, SubLayer.CharacteristicDefining_7a ), source); permanent.addInfo("life paid", CardUtil.addToolTipMarkTags("Life paid: " + payAmount), game); diff --git a/Mage.Sets/src/mage/cards/m/MinscBelovedRanger.java b/Mage.Sets/src/mage/cards/m/MinscBelovedRanger.java index c42a8f9eed..aaa0fcb683 100644 --- a/Mage.Sets/src/mage/cards/m/MinscBelovedRanger.java +++ b/Mage.Sets/src/mage/cards/m/MinscBelovedRanger.java @@ -8,7 +8,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -73,7 +73,7 @@ class MinscBelovedRangerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int xValue = source.getManaCostsToPay().getX(); - game.addEffect(new SetPowerToughnessTargetEffect(xValue, xValue, Duration.EndOfTurn), source); + game.addEffect(new SetBasePowerToughnessTargetEffect(xValue, xValue, Duration.EndOfTurn), source); game.addEffect(new AddCardSubTypeTargetEffect(SubType.GIANT, Duration.EndOfTurn), source); return true; } diff --git a/Mage.Sets/src/mage/cards/m/MirrorEntity.java b/Mage.Sets/src/mage/cards/m/MirrorEntity.java index 1fbc00356a..db1592e645 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorEntity.java +++ b/Mage.Sets/src/mage/cards/m/MirrorEntity.java @@ -8,7 +8,7 @@ import mage.abilities.costs.VariableCostType; import mage.abilities.costs.mana.VariableManaCost; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.ChangelingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,7 +36,7 @@ public final class MirrorEntity extends CardImpl { this.addAbility(new ChangelingAbility()); // {X}: Until end of turn, creatures you control have base power and toughness X/X and gain all creature types. - Ability ability = new SimpleActivatedAbility(new SetPowerToughnessAllEffect( + Ability ability = new SimpleActivatedAbility(new SetBasePowerToughnessAllEffect( ManacostVariableValue.REGULAR, ManacostVariableValue.REGULAR, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true ).setText("Until end of turn, creatures you control have base power and toughness X/X"), new VariableManaCost(VariableCostType.NORMAL)); diff --git a/Mage.Sets/src/mage/cards/m/MolimoMaroSorcerer.java b/Mage.Sets/src/mage/cards/m/MolimoMaroSorcerer.java index 21fd1bf5c6..1ea93453ce 100644 --- a/Mage.Sets/src/mage/cards/m/MolimoMaroSorcerer.java +++ b/Mage.Sets/src/mage/cards/m/MolimoMaroSorcerer.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,7 +36,7 @@ public final class MolimoMaroSorcerer extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Molimo, Maro-Sorcerer's power and toughness are each equal to the number of lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private MolimoMaroSorcerer(final MolimoMaroSorcerer card) { diff --git a/Mage.Sets/src/mage/cards/m/MoltenSentry.java b/Mage.Sets/src/mage/cards/m/MoltenSentry.java index a4f5410539..d381a7cb77 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenSentry.java +++ b/Mage.Sets/src/mage/cards/m/MoltenSentry.java @@ -7,6 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; @@ -63,22 +64,27 @@ class MoltenSentryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentEntering(source.getSourceId()); - if (controller != null && permanent != null) { - if (controller.flipCoin(source, game, false)) { - game.informPlayers("Heads: " + permanent.getLogName() + " enters the battlefield as a 5/2 creature with haste"); - permanent.getPower().modifyBaseValue(5); - permanent.getToughness().modifyBaseValue(2); - game.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield), source); - return true; - } else { - game.informPlayers("Tails: " + permanent.getLogName() + " enters the battlefield as a 2/5 creature with defender"); - permanent.getPower().modifyBaseValue(2); - permanent.getToughness().modifyBaseValue(5); - game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.WhileOnBattlefield), source); - return true; - } + if (controller == null || permanent == null) { + return false; } - return false; + + int power; + int toughness; + Ability gainedAbility; + if (controller.flipCoin(source, game, false)) { + game.informPlayers("Heads: " + permanent.getLogName() + " enters the battlefield as a 5/2 creature with haste"); + power = 5; + toughness = 2; + gainedAbility = HasteAbility.getInstance(); + } else { + game.informPlayers("Tails: " + permanent.getLogName() + " enters the battlefield as a 2/5 creature with defender"); + power = 2; + toughness = 5; + gainedAbility = DefenderAbility.getInstance(); + } + game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, true), source); + game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield), source); + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MonstrousWarLeech.java b/Mage.Sets/src/mage/cards/m/MonstrousWarLeech.java index 97daa07649..a61a772e21 100644 --- a/Mage.Sets/src/mage/cards/m/MonstrousWarLeech.java +++ b/Mage.Sets/src/mage/cards/m/MonstrousWarLeech.java @@ -9,7 +9,7 @@ import mage.abilities.condition.common.KickedCondition; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.MillCardsControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; import mage.abilities.keyword.KickerAbility; @@ -57,7 +57,7 @@ public final class MonstrousWarLeech extends CardImpl { // Monstrous War-Leech's power and toughness are each equal to the highest mana value among cards in your graveyard. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerToughnessSourceEffect( + new SetBasePowerToughnessSourceEffect( MonstrousWarLeechValue.instance, Duration.EndOfGame ) )); diff --git a/Mage.Sets/src/mage/cards/m/MordenkainensPolymorph.java b/Mage.Sets/src/mage/cards/m/MordenkainensPolymorph.java index 308a1b1d79..b09443705e 100644 --- a/Mage.Sets/src/mage/cards/m/MordenkainensPolymorph.java +++ b/Mage.Sets/src/mage/cards/m/MordenkainensPolymorph.java @@ -69,8 +69,8 @@ class MordenkainensPolymorphEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); return true; } } diff --git a/Mage.Sets/src/mage/cards/m/Mortivore.java b/Mage.Sets/src/mage/cards/m/Mortivore.java index fe17be0f42..024925c5f4 100644 --- a/Mage.Sets/src/mage/cards/m/Mortivore.java +++ b/Mage.Sets/src/mage/cards/m/Mortivore.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; import mage.abilities.effects.common.RegenerateSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -30,7 +30,7 @@ public final class Mortivore extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInAllGraveyardsCount(new FilterCreatureCard("creature cards")), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInAllGraveyardsCount(new FilterCreatureCard("creature cards")), Duration.EndOfGame))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ColoredManaCost(ColoredManaSymbol.B))); } diff --git a/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java b/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java index 328e9e8d0c..448b353d02 100644 --- a/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java +++ b/Mage.Sets/src/mage/cards/m/MultaniMaroSorcerer.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInAllHandsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class MultaniMaroSorcerer extends CardImpl { this.addAbility(ShroudAbility.getInstance()); // Multani, Maro-Sorcerer's power and toughness are each equal to the total number of cards in all players' hands. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInAllHandsCount.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CardsInAllHandsCount.instance, Duration.EndOfGame))); } private MultaniMaroSorcerer(final MultaniMaroSorcerer card) { diff --git a/Mage.Sets/src/mage/cards/m/MwonvuliOoze.java b/Mage.Sets/src/mage/cards/m/MwonvuliOoze.java index 959c124bae..60ede17e4a 100644 --- a/Mage.Sets/src/mage/cards/m/MwonvuliOoze.java +++ b/Mage.Sets/src/mage/cards/m/MwonvuliOoze.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.CumulativeUpkeepAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -34,7 +34,7 @@ public final class MwonvuliOoze extends CardImpl { // Cumulative upkeep {2} this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl<>("{2}"))); // Mwonvuli Ooze's power and toughness are each equal to 1 plus twice the number of age counters on it. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new MwonvuliOozePTValue(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new MwonvuliOozePTValue(), Duration.EndOfGame))); } private MwonvuliOoze(final MwonvuliOoze card) { diff --git a/Mage.Sets/src/mage/cards/m/MythRealized.java b/Mage.Sets/src/mage/cards/m/MythRealized.java index 9450d013f0..8255863b08 100644 --- a/Mage.Sets/src/mage/cards/m/MythRealized.java +++ b/Mage.Sets/src/mage/cards/m/MythRealized.java @@ -3,38 +3,31 @@ package mage.cards.m; import java.util.UUID; import mage.MageInt; -import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.counters.CounterType; import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.TokenImpl; -import mage.players.Player; /** * * @author LevelX2 */ public final class MythRealized extends CardImpl { - + + private static final DynamicValue loreCounterCount = new CountersSourceCount(CounterType.LORE); private static final FilterSpell filterNonCreature = new FilterSpell("a noncreature spell"); static { @@ -52,11 +45,11 @@ public final class MythRealized extends CardImpl { // {W}: Until end of turn, Myth Realized becomes a Monk Avatar creature in addition to its other types and gains "This creature's power and toughness are each equal to the number of lore counters on it." Effect effect = new BecomesCreatureSourceEffect(new MythRealizedToken(), null, Duration.EndOfTurn); - effect.setText("Until end of turn, {this} becomes a Monk Avatar creature in addition to its other types"); + effect.setText("Until end of turn, {this} becomes a Monk Avatar creature in addition to its other types "); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")); - ability.addEffect(new MythRealizedSetPTEffect(Duration.EndOfTurn)); - this.addAbility(ability); - + ability.addEffect(new SetBasePowerToughnessSourceEffect(loreCounterCount, loreCounterCount, Duration.EndOfTurn, SubLayer.SetPT_7b, false).setText("and gains \"This creature's power and toughness are each equal to the number of lore counters on it.\"")); + + this.addAbility(ability); } private MythRealized(final MythRealized card) { @@ -88,38 +81,3 @@ class MythRealizedToken extends TokenImpl { return new MythRealizedToken(this); } } - -class MythRealizedSetPTEffect extends ContinuousEffectImpl { - - public MythRealizedSetPTEffect(Duration duration) { - super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); - staticText = "and gains \"This creature's power and toughness are each equal to the number of lore counters on it.\""; - } - - public MythRealizedSetPTEffect(final MythRealizedSetPTEffect effect) { - super(effect); - } - - @Override - public MythRealizedSetPTEffect copy() { - return new MythRealizedSetPTEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && new MageObjectReference(source.getSourceObject(game), game).refersTo(permanent, game)) { - int amount = permanent.getCounters(game).getCount(CounterType.LORE); - permanent.getPower().setValue(amount); - permanent.getToughness().setValue(amount); - return true; - } else { - discard(); - } - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/cards/n/NamelessOne.java b/Mage.Sets/src/mage/cards/n/NamelessOne.java index 79646b98eb..b5cf7fe74b 100644 --- a/Mage.Sets/src/mage/cards/n/NamelessOne.java +++ b/Mage.Sets/src/mage/cards/n/NamelessOne.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.MorphAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,7 +36,7 @@ public final class NamelessOne extends CardImpl { this.toughness = new MageInt(0); // Nameless One's power and toughness are each equal to the number of Wizards on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // Morph {2}{U} this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{U}"))); } diff --git a/Mage.Sets/src/mage/cards/n/NamelessRace.java b/Mage.Sets/src/mage/cards/n/NamelessRace.java index def2a34fd1..eeebb2285c 100644 --- a/Mage.Sets/src/mage/cards/n/NamelessRace.java +++ b/Mage.Sets/src/mage/cards/n/NamelessRace.java @@ -11,7 +11,7 @@ import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -107,7 +107,7 @@ class NamelessRaceEffect extends OneShotEffect { Card sourceCard = game.getCard(source.getSourceId()); game.informPlayers((sourceCard != null ? sourceCard.getLogName() : "") + ": " + controller.getLogName() + " pays " + payAmount + " life"); - game.addEffect(new SetPowerToughnessSourceEffect( + game.addEffect(new SetBasePowerToughnessSourceEffect( payAmount, payAmount, Duration.Custom, SubLayer.CharacteristicDefining_7a ), source); permanent.addInfo("life paid", CardUtil.addToolTipMarkTags("Life paid: " + payAmount), game); diff --git a/Mage.Sets/src/mage/cards/n/Necrogoyf.java b/Mage.Sets/src/mage/cards/n/Necrogoyf.java index 84e59fb821..5b863b04ca 100644 --- a/Mage.Sets/src/mage/cards/n/Necrogoyf.java +++ b/Mage.Sets/src/mage/cards/n/Necrogoyf.java @@ -6,7 +6,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.keyword.MadnessAbility; import mage.cards.CardImpl; @@ -32,7 +32,7 @@ public final class Necrogoyf extends CardImpl { // Necrogoyf's power is equal to the number of creature cards in all graveyards. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(xValue, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(xValue, Duration.EndOfGame) )); // At the beginning of each player's upkeep, that player discards a card. diff --git a/Mage.Sets/src/mage/cards/n/NighthawkScavenger.java b/Mage.Sets/src/mage/cards/n/NighthawkScavenger.java index cdc12df2eb..f0ec870eb9 100644 --- a/Mage.Sets/src/mage/cards/n/NighthawkScavenger.java +++ b/Mage.Sets/src/mage/cards/n/NighthawkScavenger.java @@ -6,7 +6,7 @@ import mage.abilities.dynamicvalue.AdditiveDynamicValue; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.common.CardTypesInGraveyardHint; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.FlyingAbility; @@ -48,7 +48,7 @@ public final class NighthawkScavenger extends CardImpl { // Nighthawk Scavenger's power is equal to 1 plus the number of card types among cards in your opponents' graveyards. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(xValue, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(xValue, Duration.EndOfGame) .setText("{this}'s power is equal to 1 plus the number of " + "card types among cards in your opponents' graveyards. " + "(Cards in graveyards have only the characteristics of their front face.)") diff --git a/Mage.Sets/src/mage/cards/n/Nightmare.java b/Mage.Sets/src/mage/cards/n/Nightmare.java index ef8e513cb7..71d8aaeb8c 100644 --- a/Mage.Sets/src/mage/cards/n/Nightmare.java +++ b/Mage.Sets/src/mage/cards/n/Nightmare.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,7 +39,7 @@ public final class Nightmare extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Nightmare's power and toughness are each equal to the number of Swamps you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private Nightmare(final Nightmare card) { diff --git a/Mage.Sets/src/mage/cards/n/NightskyMimic.java b/Mage.Sets/src/mage/cards/n/NightskyMimic.java index d2491c5328..09f37b8785 100644 --- a/Mage.Sets/src/mage/cards/n/NightskyMimic.java +++ b/Mage.Sets/src/mage/cards/n/NightskyMimic.java @@ -7,7 +7,7 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,7 +44,11 @@ public final class NightskyMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both white and black, Nightsky Mimic has base power and toughness 4/4 until end of turn and gains flying until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 4, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility( + new SetBasePowerToughnessSourceEffect(4, 4, Duration.EndOfTurn, SubLayer.SetPT_7b, true), + filter, + false, + rule); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/n/NightstalkerEngine.java b/Mage.Sets/src/mage/cards/n/NightstalkerEngine.java index db67adf2e5..2409d3a61e 100644 --- a/Mage.Sets/src/mage/cards/n/NightstalkerEngine.java +++ b/Mage.Sets/src/mage/cards/n/NightstalkerEngine.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -28,7 +28,7 @@ public final class NightstalkerEngine extends CardImpl { // Nightstalker Engine's power is equal to the number of creature cards in your graveyard. CardsInControllerGraveyardCount count = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards")); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(count, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(count, Duration.EndOfGame))); } private NightstalkerEngine(final NightstalkerEngine card) { diff --git a/Mage.Sets/src/mage/cards/n/NishobaBrawler.java b/Mage.Sets/src/mage/cards/n/NishobaBrawler.java index 51ea9ca3fc..0f015a523a 100644 --- a/Mage.Sets/src/mage/cards/n/NishobaBrawler.java +++ b/Mage.Sets/src/mage/cards/n/NishobaBrawler.java @@ -3,7 +3,7 @@ package mage.cards.n; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -30,7 +30,7 @@ public final class NishobaBrawler extends CardImpl { // Domain — Nishoba Brawler's power is equal to the number of basic land types among lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(DomainValue.REGULAR, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(DomainValue.REGULAR, Duration.EndOfGame) ).setAbilityWord(AbilityWord.DOMAIN).addHint(DomainHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/o/ObscuraConfluence.java b/Mage.Sets/src/mage/cards/o/ObscuraConfluence.java index dcd33e0d97..36f4ea1f5c 100644 --- a/Mage.Sets/src/mage/cards/o/ObscuraConfluence.java +++ b/Mage.Sets/src/mage/cards/o/ObscuraConfluence.java @@ -4,7 +4,7 @@ import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.keyword.ConniveSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,7 +39,7 @@ public final class ObscuraConfluence extends CardImpl { // • Until end of turn, target creature loses all abilities and has base power and toughness 1/1. this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn) .setText("until end of turn, target creature loses all abilities")); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn) + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(1, 1, Duration.EndOfTurn) .setText("and has base power and toughness 1/1")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/o/OctaviaLivingThesis.java b/Mage.Sets/src/mage/cards/o/OctaviaLivingThesis.java index c6de4ca6f1..1266b89fee 100644 --- a/Mage.Sets/src/mage/cards/o/OctaviaLivingThesis.java +++ b/Mage.Sets/src/mage/cards/o/OctaviaLivingThesis.java @@ -8,7 +8,7 @@ import mage.abilities.condition.Condition; import mage.abilities.condition.common.CardsInControllerGraveyardCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; @@ -52,7 +52,7 @@ public final class OctaviaLivingThesis extends CardImpl { // Magecraft — Whenever you cast an instant or sorcery spell, target creature has base power and toughness 8/8 until end of turn. Ability ability = new MagecraftAbility( - new SetPowerToughnessTargetEffect(8, 8, Duration.EndOfTurn) + new SetBasePowerToughnessTargetEffect(8, 8, Duration.EndOfTurn) ); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/o/OctopusUmbra.java b/Mage.Sets/src/mage/cards/o/OctopusUmbra.java index 33dce1e134..f183b9e45d 100644 --- a/Mage.Sets/src/mage/cards/o/OctopusUmbra.java +++ b/Mage.Sets/src/mage/cards/o/OctopusUmbra.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessEnchantedEffect; import mage.constants.Outcome; import mage.target.TargetPermanent; import mage.abilities.keyword.EnchantAbility; @@ -52,7 +52,7 @@ public final class OctopusUmbra extends CardImpl { abilityToAdd.addTarget(new TargetCreaturePermanent(filter)); ability = new SimpleStaticAbility( Zone.BATTLEFIELD, - new SetPowerToughnessEnchantedEffect(8, 8) + new SetBasePowerToughnessEnchantedEffect(8, 8) ); ability.addEffect(new GainAbilityAttachedEffect( abilityToAdd, AttachmentType.AURA diff --git a/Mage.Sets/src/mage/cards/o/OkoTheTrickster.java b/Mage.Sets/src/mage/cards/o/OkoTheTrickster.java index cb98c9ec02..7084b1fae1 100644 --- a/Mage.Sets/src/mage/cards/o/OkoTheTrickster.java +++ b/Mage.Sets/src/mage/cards/o/OkoTheTrickster.java @@ -5,7 +5,7 @@ import mage.abilities.LoyaltyAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -47,7 +47,7 @@ public final class OkoTheTrickster extends CardImpl { this.addAbility(ability); // −7: Until end of turn, each creature you control has base power and toughness 10/10 and gains trample. - ability = new LoyaltyAbility(new SetPowerToughnessAllEffect( + ability = new LoyaltyAbility(new SetBasePowerToughnessAllEffect( 10, 10, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURE, true ).setText("Until end of turn, each creature you control has base power and toughness 10/10"), -7); ability.addEffect(new GainAbilityAllEffect( diff --git a/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java b/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java index 57804a6465..15680f6192 100644 --- a/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java +++ b/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java @@ -109,8 +109,8 @@ class OkoThiefOfCrownsEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(3); - permanent.getToughness().setValue(3); + permanent.getPower().setModifiedBaseValue(3); + permanent.getToughness().setModifiedBaseValue(3); return true; } } diff --git a/Mage.Sets/src/mage/cards/o/OkosHospitality.java b/Mage.Sets/src/mage/cards/o/OkosHospitality.java index 02cb47d377..f964dd5a0e 100644 --- a/Mage.Sets/src/mage/cards/o/OkosHospitality.java +++ b/Mage.Sets/src/mage/cards/o/OkosHospitality.java @@ -1,6 +1,6 @@ package mage.cards.o; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -27,7 +27,7 @@ public final class OkosHospitality extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{U}"); // Creatures you control have base power and toughness 3/3 until end of turn. You may search your library and/or graveyard for a card named Oko, the Trickster, reveal it, and put it into your hand. If you search your library this way, shuffle it. - this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect( + this.getSpellAbility().addEffect(new SetBasePowerToughnessAllEffect( 3, 3, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true )); this.getSpellAbility().addEffect( diff --git a/Mage.Sets/src/mage/cards/o/OlagLudevicsHubris.java b/Mage.Sets/src/mage/cards/o/OlagLudevicsHubris.java index dc76a1e359..fda1d84b23 100644 --- a/Mage.Sets/src/mage/cards/o/OlagLudevicsHubris.java +++ b/Mage.Sets/src/mage/cards/o/OlagLudevicsHubris.java @@ -128,8 +128,8 @@ class OlagLudevicsHubrisCopyApplier extends CopyApplier { blueprint.addSubType(SubType.ZOMBIE); blueprint.getColor().setBlue(true); blueprint.getColor().setBlack(true); - blueprint.getPower().modifyBaseValue(4); - blueprint.getToughness().modifyBaseValue(4); + blueprint.getPower().setModifiedBaseValue(4); + blueprint.getToughness().setModifiedBaseValue(4); return true; } } diff --git a/Mage.Sets/src/mage/cards/o/OldStickfingers.java b/Mage.Sets/src/mage/cards/o/OldStickfingers.java index 136f8f94fa..c7a0b3ed65 100644 --- a/Mage.Sets/src/mage/cards/o/OldStickfingers.java +++ b/Mage.Sets/src/mage/cards/o/OldStickfingers.java @@ -7,7 +7,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CastSourceTriggeredAbility; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.*; import mage.constants.*; import mage.filter.StaticFilters; @@ -34,7 +34,7 @@ public final class OldStickfingers extends CardImpl { // Old Stickfingers' power and toughness are equal to the number of creature cards in your graveyard. DynamicValue value = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame))); } private OldStickfingers(final OldStickfingers card) { diff --git a/Mage.Sets/src/mage/cards/o/OozeFlux.java b/Mage.Sets/src/mage/cards/o/OozeFlux.java index a11b746c10..2685222495 100644 --- a/Mage.Sets/src/mage/cards/o/OozeFlux.java +++ b/Mage.Sets/src/mage/cards/o/OozeFlux.java @@ -75,8 +75,8 @@ class OozeFluxCreateTokenEffect extends OneShotEffect { } Token tokenCopy = token.copy(); tokenCopy.getAbilities().newId(); - tokenCopy.getPower().modifyBaseValue(xValue); - tokenCopy.getToughness().modifyBaseValue(xValue); + tokenCopy.getPower().setModifiedBaseValue(xValue); + tokenCopy.getToughness().setModifiedBaseValue(xValue); tokenCopy.putOntoBattlefield(1, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/o/OpalTitan.java b/Mage.Sets/src/mage/cards/o/OpalTitan.java index acafa7b50e..9cf65facdb 100644 --- a/Mage.Sets/src/mage/cards/o/OpalTitan.java +++ b/Mage.Sets/src/mage/cards/o/OpalTitan.java @@ -96,8 +96,8 @@ class OpalTitanBecomesCreatureEffect extends ContinuousEffectImpl implements Sou break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); } break; } diff --git a/Mage.Sets/src/mage/cards/o/Opalescence.java b/Mage.Sets/src/mage/cards/o/Opalescence.java index 8c8cf57b5c..e8d3813679 100644 --- a/Mage.Sets/src/mage/cards/o/Opalescence.java +++ b/Mage.Sets/src/mage/cards/o/Opalescence.java @@ -84,8 +84,8 @@ public final class Opalescence extends CardImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int manaCost = permanent.getManaValue(); - permanent.getPower().setValue(manaCost); - permanent.getToughness().setValue(manaCost); + permanent.getPower().setModifiedBaseValue(manaCost); + permanent.getToughness().setModifiedBaseValue(manaCost); } } diff --git a/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java b/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java index 4f4a10b7e5..04999c6cb9 100644 --- a/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java +++ b/Mage.Sets/src/mage/cards/o/OverbeingOfMyth.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class OverbeingOfMyth extends CardImpl { // Overbeing of Myth's power and toughness are each equal to the number of cards in your hand. DynamicValue number = CardsInControllerHandCount.instance; - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(number, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(number, Duration.EndOfGame))); // At the beginning of your draw step, draw an additional card. this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardSourceControllerEffect(1).setText("draw an additional card"), TargetController.YOU, false)); diff --git a/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java b/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java index 75303eba78..ed0cc4230a 100644 --- a/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java +++ b/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java @@ -81,27 +81,29 @@ class OverwhelmingSplendorLoseAbilitiesEffect extends ContinuousEffectImpl { if (enchantment == null) { // It was not blinked, use the standard method enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (enchantment == null) { + return false; + } } - if (enchantment == null) { + + Player player = game.getPlayer(enchantment.getAttachedTo()); + if (player == null) { return false; } - Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - permanent.removeAllAbilities(source.getSourceId(), game); - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); - } - } + + for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + permanent.removeAllAbilities(source.getSourceId(), game); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); + } } - return true; } - return false; + return true; } @Override @@ -148,20 +150,18 @@ class OverwhelmingSplendorCantActivateEffect extends ContinuousRuleModifyingEffe @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { - Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (enchantment == null) { - return false; - } - if (event.getPlayerId().equals(enchantment.getAttachedTo())) { - Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); - if (ability.isPresent() - && !(ability.get() instanceof ActivatedManaAbilityImpl) - && !(ability.get() instanceof LoyaltyAbility)) { - return true; - } - } + if (event.getType() != GameEvent.EventType.ACTIVATE_ABILITY) { + return false; } - return false; + + Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (enchantment == null || !event.getPlayerId().equals(enchantment.getAttachedTo())) { + return false; + } + + Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); + return ability.isPresent() + && !(ability.get() instanceof ActivatedManaAbilityImpl) + && !(ability.get() instanceof LoyaltyAbility); } } diff --git a/Mage.Sets/src/mage/cards/o/Ovinize.java b/Mage.Sets/src/mage/cards/o/Ovinize.java index 180dfb8ce2..50e19ab117 100644 --- a/Mage.Sets/src/mage/cards/o/Ovinize.java +++ b/Mage.Sets/src/mage/cards/o/Ovinize.java @@ -4,7 +4,7 @@ package mage.cards.o; import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -27,7 +27,7 @@ public final class Ovinize extends CardImpl { new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn) .setText("Until end of turn, target creature loses all abilities") ); - Effect effect = new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn); + Effect effect = new SetBasePowerToughnessTargetEffect(0, 1, Duration.EndOfTurn); effect.setText("and has base power and toughness 0/1"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/p/PackRat.java b/Mage.Sets/src/mage/cards/p/PackRat.java index 80ca844a56..429963d767 100644 --- a/Mage.Sets/src/mage/cards/p/PackRat.java +++ b/Mage.Sets/src/mage/cards/p/PackRat.java @@ -10,7 +10,7 @@ import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.CreateTokenCopySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -54,7 +54,7 @@ public final class PackRat extends CardImpl { this.toughness = new MageInt(0); // Pack Rat's power and toughness are each equal to the number of Rats you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // {2}{B}, Discard a card: Create a token that's a copy of Pack Rat. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenCopySourceEffect(), new ManaCostsImpl<>("{2}{B}")); ability.addCost(new DiscardCardCost()); diff --git a/Mage.Sets/src/mage/cards/p/Pallimud.java b/Mage.Sets/src/mage/cards/p/Pallimud.java index 9b75b84921..5adb15c795 100644 --- a/Mage.Sets/src/mage/cards/p/Pallimud.java +++ b/Mage.Sets/src/mage/cards/p/Pallimud.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ChooseOpponentEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -39,7 +39,7 @@ public final class Pallimud extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); // Pallimud's power is equal to the number of tapped lands the chosen player controls. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new AnathemancerCount(), Duration.Custom))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new AnathemancerCount(), Duration.Custom))); } private Pallimud(final Pallimud card) { diff --git a/Mage.Sets/src/mage/cards/p/PeopleOfTheWoods.java b/Mage.Sets/src/mage/cards/p/PeopleOfTheWoods.java index 5a7925f261..99a4b3192e 100644 --- a/Mage.Sets/src/mage/cards/p/PeopleOfTheWoods.java +++ b/Mage.Sets/src/mage/cards/p/PeopleOfTheWoods.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -33,7 +33,7 @@ public final class PeopleOfTheWoods extends CardImpl { this.toughness = new MageInt(0); // People of the Woods's toughness is equal to the number of Forests you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBaseToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); } private PeopleOfTheWoods(final PeopleOfTheWoods card) { diff --git a/Mage.Sets/src/mage/cards/p/PestilenceRats.java b/Mage.Sets/src/mage/cards/p/PestilenceRats.java index 8cc8f42399..c7153ac954 100644 --- a/Mage.Sets/src/mage/cards/p/PestilenceRats.java +++ b/Mage.Sets/src/mage/cards/p/PestilenceRats.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class PestilenceRats extends CardImpl { this.toughness = new MageInt(3); // Pestilence Rats's power is equal to the number of other Rats on the battlefield. (For example, as long as there are two other Rats on the battlefield, Pestilence Rats's power and toughness are 2/3.) - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private PestilenceRats(final PestilenceRats card) { diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java b/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java index 2333d2abfb..7c0e40ff0f 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianProcessor.java @@ -112,8 +112,8 @@ class PhyrexianProcessorCreateTokenEffect extends OneShotEffect { if (object instanceof Integer) { int lifePaid = (int) object; MinionToken token = new MinionToken(); - token.getPower().modifyBaseValue(lifePaid); - token.getToughness().modifyBaseValue(lifePaid); + token.setPower(lifePaid); + token.setToughness(lifePaid); token.putOntoBattlefield(1, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/p/PlagueRats.java b/Mage.Sets/src/mage/cards/p/PlagueRats.java index 0e41dcf019..8f06a33fae 100644 --- a/Mage.Sets/src/mage/cards/p/PlagueRats.java +++ b/Mage.Sets/src/mage/cards/p/PlagueRats.java @@ -5,7 +5,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -36,7 +36,7 @@ public final class PlagueRats extends CardImpl { // Plague Rats's power and toughness are each equal to the number of creatures named Plague Rats on the battlefield. DynamicValue amount = new PermanentsOnBattlefieldCount(plagueRatsFilter); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(amount, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(amount, Duration.EndOfGame))); } private PlagueRats(final PlagueRats card) { diff --git a/Mage.Sets/src/mage/cards/p/PolymorphistsJest.java b/Mage.Sets/src/mage/cards/p/PolymorphistsJest.java index 721d81b047..ca384be5d8 100644 --- a/Mage.Sets/src/mage/cards/p/PolymorphistsJest.java +++ b/Mage.Sets/src/mage/cards/p/PolymorphistsJest.java @@ -90,8 +90,8 @@ class PolymorphistsJestEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); } } } diff --git a/Mage.Sets/src/mage/cards/p/PoppetFactory.java b/Mage.Sets/src/mage/cards/p/PoppetFactory.java index 862f5e6ec0..3d7864b335 100644 --- a/Mage.Sets/src/mage/cards/p/PoppetFactory.java +++ b/Mage.Sets/src/mage/cards/p/PoppetFactory.java @@ -84,8 +84,8 @@ class PoppetFactoryEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(3); - permanent.getToughness().setValue(3); + permanent.getPower().setModifiedBaseValue(3); + permanent.getToughness().setModifiedBaseValue(3); } break; } diff --git a/Mage.Sets/src/mage/cards/p/PrimalClay.java b/Mage.Sets/src/mage/cards/p/PrimalClay.java index 973be23552..91a6d99540 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalClay.java +++ b/Mage.Sets/src/mage/cards/p/PrimalClay.java @@ -7,6 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -21,7 +22,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; @@ -73,13 +73,11 @@ public final class PrimalClay extends CardImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getTargetId().equals(source.getSourceId())) { - Permanent sourcePermanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (sourcePermanent != null && !sourcePermanent.isFaceDown(game)) { - return true; - } + if (!event.getTargetId().equals(source.getSourceId())) { + return false; } - return false; + Permanent sourcePermanent = ((EntersTheBattlefieldEvent) event).getTarget(); + return sourcePermanent != null && !sourcePermanent.isFaceDown(game); } @Override @@ -90,40 +88,38 @@ public final class PrimalClay extends CardImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - if (permanent != null) { - Choice choice = new ChoiceImpl(true); - choice.setMessage("Choose what " + permanent.getIdName() + " becomes to"); - choice.getChoices().add(choice33); - choice.getChoices().add(choice22); - choice.getChoices().add(choice16); - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null && !controller.choose(Outcome.Neutral, choice, game)) { - return false; - } - int power = 0; - int toughness = 0; - switch (choice.getChoice()) { - case choice33: - power = 3; - toughness = 3; - break; - case choice22: - power = 2; - toughness = 2; - game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.Custom), source); - break; - case choice16: - power = 1; - toughness = 6; - game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), source); - break; - } - permanent.getPower().modifyBaseValue(power); - permanent.getToughness().modifyBaseValue(toughness); - // game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b), source); + if (permanent == null) { + return false; } + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose what " + permanent.getIdName() + " becomes to"); + choice.getChoices().add(choice33); + choice.getChoices().add(choice22); + choice.getChoices().add(choice16); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && !controller.choose(Outcome.Neutral, choice, game)) { + return false; + } + int power = 0; + int toughness = 0; + switch (choice.getChoice()) { + case choice33: + power = 3; + toughness = 3; + break; + case choice22: + power = 2; + toughness = 2; + game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.Custom), source); + break; + case choice16: + power = 1; + toughness = 6; + game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), source); + break; + } + game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, true), source); return false; - } @Override diff --git a/Mage.Sets/src/mage/cards/p/PrimalPlasma.java b/Mage.Sets/src/mage/cards/p/PrimalPlasma.java index 3022fe56fa..0e76b7796c 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalPlasma.java +++ b/Mage.Sets/src/mage/cards/p/PrimalPlasma.java @@ -7,6 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -21,7 +22,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; @@ -119,8 +119,7 @@ public final class PrimalPlasma extends CardImpl { game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), source); break; } - permanent.getPower().modifyBaseValue(power); - permanent.getToughness().modifyBaseValue(toughness); + game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, true), source); } return false; diff --git a/Mage.Sets/src/mage/cards/p/Primalcrux.java b/Mage.Sets/src/mage/cards/p/Primalcrux.java index 9f43f16962..f3a5efaa6a 100644 --- a/Mage.Sets/src/mage/cards/p/Primalcrux.java +++ b/Mage.Sets/src/mage/cards/p/Primalcrux.java @@ -5,7 +5,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.ChromaCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.ValueHint; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -31,7 +31,7 @@ public final class Primalcrux extends CardImpl { // Chroma - Primalcrux's power and toughness are each equal to the number of green mana symbols in the mana costs of permanents you control. DynamicValue xValue = new ChromaCount(ManaType.GREEN); - Effect effect = new SetPowerToughnessSourceEffect(xValue, Duration.WhileOnBattlefield); + Effect effect = new SetBasePowerToughnessSourceEffect(xValue, Duration.WhileOnBattlefield); effect.setText("Chroma — Primalcrux's power and toughness are each equal to the number of green mana symbols in the mana costs of permanents you control."); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect) .addHint(new ValueHint("Green mana symbols in your permanents", xValue)) diff --git a/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java b/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java index 63e23e9087..c9e5ed0891 100644 --- a/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java +++ b/Mage.Sets/src/mage/cards/p/PsychosisCrawler.java @@ -7,7 +7,7 @@ import mage.abilities.common.DrawCardControllerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.LoseLifeOpponentsEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -29,7 +29,7 @@ public final class PsychosisCrawler extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); this.addAbility(new DrawCardControllerTriggeredAbility(new LoseLifeOpponentsEffect(1), false)); } diff --git a/Mage.Sets/src/mage/cards/q/QueenAllenalOfRuadach.java b/Mage.Sets/src/mage/cards/q/QueenAllenalOfRuadach.java index 8c667cfc5d..f8866dcc3a 100644 --- a/Mage.Sets/src/mage/cards/q/QueenAllenalOfRuadach.java +++ b/Mage.Sets/src/mage/cards/q/QueenAllenalOfRuadach.java @@ -7,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,7 +39,7 @@ public final class QueenAllenalOfRuadach extends CardImpl { // Queen Allenal of Ruadach's power and toughness are each equal to the number of creatures you control. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerToughnessSourceEffect(count, Duration.EndOfGame) + new SetBasePowerToughnessSourceEffect(count, Duration.EndOfGame) )); // If one or more creature tokens would be created under your control, those tokens plus a 1/1 white Soldier creature token are created instead. diff --git a/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java b/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java index 0d2e163d77..54fa2c08a2 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java +++ b/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java @@ -12,7 +12,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.util.functions.CopyApplier; /** @@ -47,8 +46,8 @@ class QuicksilverGargantuanCopyApplier extends CopyApplier { @Override public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) { blueprint.removePTCDA(); - blueprint.getPower().modifyBaseValue(7); - blueprint.getToughness().modifyBaseValue(7); + blueprint.getPower().setModifiedBaseValue(7); + blueprint.getToughness().setModifiedBaseValue(7); return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RaisedByGiants.java b/Mage.Sets/src/mage/cards/r/RaisedByGiants.java index 446f9fbc34..a0bc08f2f3 100644 --- a/Mage.Sets/src/mage/cards/r/RaisedByGiants.java +++ b/Mage.Sets/src/mage/cards/r/RaisedByGiants.java @@ -3,7 +3,7 @@ package mage.cards.r; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.AddCardSubtypeAllEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -26,7 +26,7 @@ public final class RaisedByGiants extends CardImpl { this.subtype.add(SubType.BACKGROUND); // Commander creatures you own have base power and toughness 10/10 and are Giants in addition to their other types. - Ability ability = new SimpleStaticAbility(new SetPowerToughnessAllEffect( + Ability ability = new SimpleStaticAbility(new SetBasePowerToughnessAllEffect( 10, 10, Duration.WhileOnBattlefield, StaticFilters.FILTER_CREATURES_OWNED_COMMANDER, true )); diff --git a/Mage.Sets/src/mage/cards/r/RecklessOne.java b/Mage.Sets/src/mage/cards/r/RecklessOne.java index 66e794e829..68b804eaaf 100644 --- a/Mage.Sets/src/mage/cards/r/RecklessOne.java +++ b/Mage.Sets/src/mage/cards/r/RecklessOne.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class RecklessOne extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // Reckless One's power and toughness are each equal to the number of Goblins on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private RecklessOne(final RecklessOne card) { diff --git a/Mage.Sets/src/mage/cards/r/ReduceInStature.java b/Mage.Sets/src/mage/cards/r/ReduceInStature.java index b0014e4e35..f101801452 100644 --- a/Mage.Sets/src/mage/cards/r/ReduceInStature.java +++ b/Mage.Sets/src/mage/cards/r/ReduceInStature.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -34,7 +34,7 @@ public final class ReduceInStature extends CardImpl { this.addAbility(ability); // Enchanted creature has base power and toughness 0/2. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessEnchantedEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessEnchantedEffect())); } diff --git a/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java b/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java index 0f0a9f9083..2e58da28a8 100644 --- a/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java +++ b/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -33,7 +33,7 @@ public final class RenataCalledToTheHunt extends CardImpl { // Renata's power is equal to your devotion to green. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerSourceEffect(DevotionCount.G, Duration.EndOfGame) + new SetBasePowerSourceEffect(DevotionCount.G, Duration.EndOfGame) .setText("{this}'s power is equal to your devotion to green") ).addHint(DevotionCount.G.getHint())); diff --git a/Mage.Sets/src/mage/cards/r/Revenant.java b/Mage.Sets/src/mage/cards/r/Revenant.java index 63d109fca9..24fdf8addf 100644 --- a/Mage.Sets/src/mage/cards/r/Revenant.java +++ b/Mage.Sets/src/mage/cards/r/Revenant.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +32,7 @@ public final class Revenant extends CardImpl { // Revenant's power and toughness are each equal to the number of creature cards in your graveyard. CardsInControllerGraveyardCount count = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards")); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(count, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(count, Duration.EndOfGame))); } private Revenant(final Revenant card) { diff --git a/Mage.Sets/src/mage/cards/r/RimefeatherOwl.java b/Mage.Sets/src/mage/cards/r/RimefeatherOwl.java index 2ed6b74ee0..3a68df6cd2 100644 --- a/Mage.Sets/src/mage/cards/r/RimefeatherOwl.java +++ b/Mage.Sets/src/mage/cards/r/RimefeatherOwl.java @@ -10,7 +10,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.constants.SubType; import mage.constants.SuperType; @@ -55,7 +55,7 @@ public final class RimefeatherOwl extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Rimefeather Owl's power and toughness are each equal to the number of snow permanents on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter2), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter2), Duration.EndOfGame))); // {1}{snow}: Put an ice counter on target permanent. Ability ability = new SimpleActivatedAbility( diff --git a/Mage.Sets/src/mage/cards/r/RiptideMangler.java b/Mage.Sets/src/mage/cards/r/RiptideMangler.java index 9729016aa9..22bf11acc7 100644 --- a/Mage.Sets/src/mage/cards/r/RiptideMangler.java +++ b/Mage.Sets/src/mage/cards/r/RiptideMangler.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.SubType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class RiptideMangler extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(3); - // {1}{U}: Change Riptide Mangler's base power to target creature's power. + // {1}{U}: Change Riptide Mangler’s base power to target creature’s power. Ability ability = new SimpleActivatedAbility(new RiptideManglerEffect(), new ManaCostsImpl<>("{1}{U}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -71,7 +71,7 @@ class RiptideManglerEffect extends OneShotEffect { if (permanent == null) { return false; } - game.addEffect(new SetPowerSourceEffect(StaticValue.get(permanent.getPower().getValue()), Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(StaticValue.get(permanent.getPower().getValue()), null, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source); return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RiseAndShine.java b/Mage.Sets/src/mage/cards/r/RiseAndShine.java index 8b34210af9..d2b782b5a9 100644 --- a/Mage.Sets/src/mage/cards/r/RiseAndShine.java +++ b/Mage.Sets/src/mage/cards/r/RiseAndShine.java @@ -4,7 +4,7 @@ import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; @@ -43,7 +43,7 @@ public final class RiseAndShine extends CardImpl { this.getSpellAbility().addEffect(new AddCardTypeTargetEffect( Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE ).setText("Target noncreature artifact you control becomes")); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect( + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect( 0, 0, Duration.EndOfGame ).setText(" a 0/0 artifact creature")); this.getSpellAbility().addEffect(new AddCountersTargetEffect( @@ -91,7 +91,7 @@ class RiseAndShineEffect extends OneShotEffect { game.addEffect(new AddCardTypeTargetEffect( Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE ).setTargetPointer(new FixedTargets(permanents, game)), source); - game.addEffect(new SetPowerToughnessTargetEffect( + game.addEffect(new SetBasePowerToughnessTargetEffect( 0, 0, Duration.EndOfGame ).setTargetPointer(new FixedTargets(permanents, game)), source); for (Permanent permanent : permanents) { diff --git a/Mage.Sets/src/mage/cards/r/RisenRiptide.java b/Mage.Sets/src/mage/cards/r/RisenRiptide.java index 06cd3539cf..37884becdb 100644 --- a/Mage.Sets/src/mage/cards/r/RisenRiptide.java +++ b/Mage.Sets/src/mage/cards/r/RisenRiptide.java @@ -2,7 +2,7 @@ package mage.cards.r; import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -26,9 +26,12 @@ public final class RisenRiptide extends CardImpl { this.toughness = new MageInt(5); // Whenever you cast a kicked spell, Risen Riptide has base power and toughness 5/5 until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect( - 5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b - ).setText("{this} has base power and toughness 5/5 until end of turn"), StaticFilters.FILTER_SPELL_KICKED_A, false)); + this.addAbility(new SpellCastControllerTriggeredAbility( + new SetBasePowerToughnessSourceEffect(5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b, true) + .setText("{this} has base power and toughness 5/5 until end of turn"), + StaticFilters.FILTER_SPELL_KICKED_A, + false) + ); } private RisenRiptide(final RisenRiptide card) { diff --git a/Mage.Sets/src/mage/cards/r/RiverfallMimic.java b/Mage.Sets/src/mage/cards/r/RiverfallMimic.java index 3f4891678a..11704c66bd 100644 --- a/Mage.Sets/src/mage/cards/r/RiverfallMimic.java +++ b/Mage.Sets/src/mage/cards/r/RiverfallMimic.java @@ -7,7 +7,7 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.CantBeBlockedSourceAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,7 +44,7 @@ public final class RiverfallMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both blue and red, Riverfall Mimic has base power and toughness 3/3 until end of turn and can't be blocked this turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetBasePowerToughnessSourceEffect(3, 3, Duration.EndOfTurn, SubLayer.SetPT_7b, true), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(new CantBeBlockedSourceAbility(), Duration.EndOfTurn, false, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/r/RoilingHorror.java b/Mage.Sets/src/mage/cards/r/RoilingHorror.java index e56ce1eab2..49dc5fd0e2 100644 --- a/Mage.Sets/src/mage/cards/r/RoilingHorror.java +++ b/Mage.Sets/src/mage/cards/r/RoilingHorror.java @@ -11,7 +11,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.SuspendAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -22,7 +22,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.players.Player; import mage.target.TargetPlayer; @@ -40,7 +39,7 @@ public final class RoilingHorror extends CardImpl { this.toughness = new MageInt(0); // Roiling Horror's power and toughness are each equal to your life total minus the life total of an opponent with the most life. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new RoilingHorrorDynamicValue(), Duration.EndOfGame) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new RoilingHorrorDynamicValue(), Duration.EndOfGame) .setText("{this}'s power and toughness are each equal to your life total minus the life total of an opponent with the most life.") )); diff --git a/Mage.Sets/src/mage/cards/r/RowanScholarOfSparks.java b/Mage.Sets/src/mage/cards/r/RowanScholarOfSparks.java index 31fbc9caa2..b9f4c847e3 100644 --- a/Mage.Sets/src/mage/cards/r/RowanScholarOfSparks.java +++ b/Mage.Sets/src/mage/cards/r/RowanScholarOfSparks.java @@ -10,7 +10,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GetEmblemEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; import mage.abilities.hint.Hint; import mage.cards.CardSetInfo; @@ -86,7 +86,7 @@ public final class RowanScholarOfSparks extends ModalDoubleFacesCard { )); // +1: Up to one target creature has base power and toughness 0/2 until your next turn. - ability = new LoyaltyAbility(new SetPowerToughnessTargetEffect( + ability = new LoyaltyAbility(new SetBasePowerToughnessTargetEffect( 0, 2, Duration.UntilYourNextTurn ), 1); ability.addTarget(new TargetCreaturePermanent(0, 1)); diff --git a/Mage.Sets/src/mage/cards/r/Rubblehulk.java b/Mage.Sets/src/mage/cards/r/Rubblehulk.java index 354b3c0566..bf6fcfaaea 100644 --- a/Mage.Sets/src/mage/cards/r/Rubblehulk.java +++ b/Mage.Sets/src/mage/cards/r/Rubblehulk.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.BoostTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.BloodrushAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class Rubblehulk extends CardImpl { DynamicValue controlledLands = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS); // Rubblehulk's power and toughness are each equal to the number of lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); // Bloodrush - 1{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control. this.addAbility(new BloodrushAbility("{1}{R}{G}", new BoostTargetEffect(controlledLands, controlledLands, Duration.EndOfTurn))); diff --git a/Mage.Sets/src/mage/cards/r/RustingGolem.java b/Mage.Sets/src/mage/cards/r/RustingGolem.java index 6cecd7605e..f855308128 100644 --- a/Mage.Sets/src/mage/cards/r/RustingGolem.java +++ b/Mage.Sets/src/mage/cards/r/RustingGolem.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CountersSourceCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FadingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -30,7 +30,7 @@ public final class RustingGolem extends CardImpl { // Fading 5 this.addAbility(new FadingAbility(5, this)); // Rusting Golem's power and toughness are each equal to the number of fade counters on it. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect( new CountersSourceCount(CounterType.FADE), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java b/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java index 0d28e9a5cf..e16a98daba 100644 --- a/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java +++ b/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java @@ -9,7 +9,7 @@ import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class SageOfAncientLore extends CardImpl { // Sage of Ancient Lore's power and toughness are each equal to the number of cards in your hand. DynamicValue xValue = CardsInControllerHandCount.instance; this.addAbility(new SimpleStaticAbility(Zone.ALL, - new ConditionalContinuousEffect(new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame), + new ConditionalContinuousEffect(new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame), new TransformedCondition(true), "{this}'s power and toughness are each equal to the total number of cards in your hand"))); // When Sage of Ancient Lore enters the battlefield, draw a card. diff --git a/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java b/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java index 3bc34e6da7..bde9f26a19 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanTheDragonspeaker.java @@ -108,8 +108,8 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); } } return true; diff --git a/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java b/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java index 0a3a0bb222..cd8a9d1905 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanTheMasterless.java @@ -140,8 +140,8 @@ class SarkhanTheMasterlessBecomeDragonEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); } } } diff --git a/Mage.Sets/src/mage/cards/s/ScionOfTheWild.java b/Mage.Sets/src/mage/cards/s/ScionOfTheWild.java index 3d136fe50f..8da3f31e32 100644 --- a/Mage.Sets/src/mage/cards/s/ScionOfTheWild.java +++ b/Mage.Sets/src/mage/cards/s/ScionOfTheWild.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -25,7 +25,7 @@ public final class ScionOfTheWild extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURES), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURES), Duration.EndOfGame))); } private ScionOfTheWild(final ScionOfTheWild card) { diff --git a/Mage.Sets/src/mage/cards/s/ScourgeOfTheSkyclaves.java b/Mage.Sets/src/mage/cards/s/ScourgeOfTheSkyclaves.java index 7fec7c857a..484cd846ab 100644 --- a/Mage.Sets/src/mage/cards/s/ScourgeOfTheSkyclaves.java +++ b/Mage.Sets/src/mage/cards/s/ScourgeOfTheSkyclaves.java @@ -9,7 +9,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CastSourceTriggeredAbility; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -43,7 +43,7 @@ public final class ScourgeOfTheSkyclaves extends CardImpl { // Scourge of the Skyclaves's power and toughness are each equal to 20 minus the highest life total among players. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect( + Zone.ALL, new SetBasePowerToughnessSourceEffect( ScourgeOfTheSkyclavesValue.instance, Duration.EndOfGame ).setText("{this}'s power and toughness are each equal to 20 minus the highest life total among players."))); } diff --git a/Mage.Sets/src/mage/cards/s/Sentinel.java b/Mage.Sets/src/mage/cards/s/Sentinel.java index d0204672a2..b3c21bf87b 100644 --- a/Mage.Sets/src/mage/cards/s/Sentinel.java +++ b/Mage.Sets/src/mage/cards/s/Sentinel.java @@ -6,7 +6,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -77,7 +77,7 @@ class SentinelEffect extends OneShotEffect { Permanent targetPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); if (controller != null && targetPermanent != null) { int newToughness = CardUtil.overflowInc(targetPermanent.getPower().getValue(), 1); - game.addEffect(new SetToughnessSourceEffect(StaticValue.get(newToughness), Duration.Custom, SubLayer.SetPT_7b), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(null, StaticValue.get(newToughness), Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/SeraphOfTheMasses.java b/Mage.Sets/src/mage/cards/s/SeraphOfTheMasses.java index ea2de9d0d1..de38795ea8 100644 --- a/Mage.Sets/src/mage/cards/s/SeraphOfTheMasses.java +++ b/Mage.Sets/src/mage/cards/s/SeraphOfTheMasses.java @@ -3,7 +3,7 @@ package mage.cards.s; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.ConvokeAbility; import mage.abilities.keyword.FlyingAbility; @@ -33,7 +33,7 @@ public final class SeraphOfTheMasses extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Seraph of the Masses's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/s/SerendibSorcerer.java b/Mage.Sets/src/mage/cards/s/SerendibSorcerer.java index 74dcc964b4..2243db64a3 100644 --- a/Mage.Sets/src/mage/cards/s/SerendibSorcerer.java +++ b/Mage.Sets/src/mage/cards/s/SerendibSorcerer.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -37,7 +37,7 @@ public final class SerendibSorcerer extends CardImpl { this.toughness = new MageInt(1); // {tap}: Target creature other than Serendib Sorcerer becomes 0/2 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SereneMaster.java b/Mage.Sets/src/mage/cards/s/SereneMaster.java index b52985a781..e178df6eb1 100644 --- a/Mage.Sets/src/mage/cards/s/SereneMaster.java +++ b/Mage.Sets/src/mage/cards/s/SereneMaster.java @@ -7,7 +7,7 @@ import mage.abilities.common.BlocksSourceTriggeredAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -81,10 +81,10 @@ class SereneMasterEffect extends OneShotEffect { if (sourceCreature != null && attackingCreature != null) { StaticValue newSourcePower = StaticValue.get(attackingCreature.getPower().getValue()); StaticValue newAttackerPower = StaticValue.get(sourceCreature.getPower().getValue()); - ContinuousEffect effect = new SetPowerToughnessTargetEffect(newSourcePower, null, Duration.EndOfCombat); + ContinuousEffect effect = new SetBasePowerToughnessTargetEffect(newSourcePower, null, Duration.EndOfCombat); effect.setTargetPointer(new FixedTarget(source.getSourceId(), game)); game.addEffect(effect, source); - effect = new SetPowerToughnessTargetEffect(newAttackerPower, null, Duration.EndOfCombat); + effect = new SetBasePowerToughnessTargetEffect(newAttackerPower, null, Duration.EndOfCombat); effect.setTargetPointer(new FixedTarget(attackingCreature.getId(), game)); game.addEffect(effect, source); return true; diff --git a/Mage.Sets/src/mage/cards/s/SerpentOfTheEndlessSea.java b/Mage.Sets/src/mage/cards/s/SerpentOfTheEndlessSea.java index 3c354e9c48..a3fa728e60 100644 --- a/Mage.Sets/src/mage/cards/s/SerpentOfTheEndlessSea.java +++ b/Mage.Sets/src/mage/cards/s/SerpentOfTheEndlessSea.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.combat.CantAttackUnlessDefenderControllsPermanent; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -36,7 +36,7 @@ public final class SerpentOfTheEndlessSea extends CardImpl { this.toughness = new MageInt(0); // Serpent of the Endless Sea's power and toughness are each equal to the number of Islands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // Serpent of the Endless Sea can't attack unless defending player controls an Island. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(new FilterLandPermanent(SubType.ISLAND,"an Island")))); } diff --git a/Mage.Sets/src/mage/cards/s/SerpentineAmbush.java b/Mage.Sets/src/mage/cards/s/SerpentineAmbush.java index 77c4d9c2a8..b6e5ff499b 100644 --- a/Mage.Sets/src/mage/cards/s/SerpentineAmbush.java +++ b/Mage.Sets/src/mage/cards/s/SerpentineAmbush.java @@ -69,8 +69,8 @@ class SerpentineAmbushEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(5); - permanent.getToughness().setValue(5); + permanent.getPower().setModifiedBaseValue(5); + permanent.getToughness().setModifiedBaseValue(5); return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SerraAvatar.java b/Mage.Sets/src/mage/cards/s/SerraAvatar.java index a10fa22ff6..582557b1ba 100644 --- a/Mage.Sets/src/mage/cards/s/SerraAvatar.java +++ b/Mage.Sets/src/mage/cards/s/SerraAvatar.java @@ -7,7 +7,7 @@ import mage.abilities.common.PutIntoGraveFromAnywhereSourceTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -29,7 +29,7 @@ public final class SerraAvatar extends CardImpl { this.toughness = new MageInt(0); // Serra Avatar's power and toughness are each equal to your life total. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(ControllerLifeCount.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(ControllerLifeCount.instance, Duration.EndOfGame))); // When Serra Avatar is put into a graveyard from anywhere, shuffle it into its owner's library. this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibrarySourceEffect())); diff --git a/Mage.Sets/src/mage/cards/s/SewerNemesis.java b/Mage.Sets/src/mage/cards/s/SewerNemesis.java index 13d8931470..deae227eac 100644 --- a/Mage.Sets/src/mage/cards/s/SewerNemesis.java +++ b/Mage.Sets/src/mage/cards/s/SewerNemesis.java @@ -11,7 +11,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ChoosePlayerEffect; import mage.abilities.effects.common.MillCardsTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -21,7 +21,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; @@ -41,7 +40,7 @@ public final class SewerNemesis extends CardImpl { // As Sewer Nemesis enters the battlefield, choose a player. this.addAbility(new AsEntersBattlefieldAbility(new ChoosePlayerEffect(Outcome.Detriment))); // Sewer Nemesis's power and toughness are each equal to the number of cards in the chosen player's graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInTargetOpponentsGraveyardCount(), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInTargetOpponentsGraveyardCount(), Duration.EndOfGame))); // Whenever the chosen player casts a spell, that player puts the top card of their library into their graveyard. this.addAbility(new SewerNemesisTriggeredAbility()); diff --git a/Mage.Sets/src/mage/cards/s/ShamblingSuit.java b/Mage.Sets/src/mage/cards/s/ShamblingSuit.java index 995c03a48e..60662b8121 100644 --- a/Mage.Sets/src/mage/cards/s/ShamblingSuit.java +++ b/Mage.Sets/src/mage/cards/s/ShamblingSuit.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -35,7 +35,7 @@ public final class ShamblingSuit extends CardImpl { this.toughness = new MageInt(3); // Shambling Suit's power is equal to the number of artifacts and/or enchantments you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(xValue, Duration.EndOfGame))); } private ShamblingSuit(final ShamblingSuit card) { diff --git a/Mage.Sets/src/mage/cards/s/ShapeStealer.java b/Mage.Sets/src/mage/cards/s/ShapeStealer.java index 0f3f985cbc..29edfa696f 100644 --- a/Mage.Sets/src/mage/cards/s/ShapeStealer.java +++ b/Mage.Sets/src/mage/cards/s/ShapeStealer.java @@ -7,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -69,14 +69,13 @@ class ShapeStealerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); - if (permanent != null) { - ContinuousEffect effect = new SetPowerToughnessSourceEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn, SubLayer.SetPT_7b); - game.addEffect(effect, source); - return true; - } + Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); + if (controller == null || permanent == null) { + return false; } - return false; + + ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn, SubLayer.SetPT_7b, true); + game.addEffect(effect, source); + return true; } } diff --git a/Mage.Sets/src/mage/cards/s/Shapeshifter.java b/Mage.Sets/src/mage/cards/s/Shapeshifter.java index 7134553de2..6d967fbbe7 100644 --- a/Mage.Sets/src/mage/cards/s/Shapeshifter.java +++ b/Mage.Sets/src/mage/cards/s/Shapeshifter.java @@ -118,8 +118,8 @@ class ShapeshifterContinuousEffect extends ContinuousEffectImpl { String lastChosen = (String) game.getState().getValue(source.getSourceId().toString() + "_Shapeshifter"); if (permanent != null && lastChosen != null) { int lastChosenNumber = Integer.parseInt(lastChosen); - permanent.getPower().modifyBaseValue(lastChosenNumber); - permanent.getToughness().modifyBaseValue(7 - lastChosenNumber); + permanent.getPower().setModifiedBaseValue(lastChosenNumber); + permanent.getToughness().setModifiedBaseValue(7 - lastChosenNumber); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/SharpshooterElf.java b/Mage.Sets/src/mage/cards/s/SharpshooterElf.java index 67f5e88b82..1b11b0e407 100644 --- a/Mage.Sets/src/mage/cards/s/SharpshooterElf.java +++ b/Mage.Sets/src/mage/cards/s/SharpshooterElf.java @@ -8,7 +8,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; @@ -51,7 +51,7 @@ public final class SharpshooterElf extends CardImpl { // Sharpshooter Elf's power is equal to the number of creatures you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame) )); // When Sharpshooter Elf enters the battlefield, it deals damage equal to its power to target creature with flying an opponent controls. diff --git a/Mage.Sets/src/mage/cards/s/ShorecrasherMimic.java b/Mage.Sets/src/mage/cards/s/ShorecrasherMimic.java index 59c2e84623..41dc2feedb 100644 --- a/Mage.Sets/src/mage/cards/s/ShorecrasherMimic.java +++ b/Mage.Sets/src/mage/cards/s/ShorecrasherMimic.java @@ -7,7 +7,7 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,7 +44,11 @@ public final class ShorecrasherMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both green and blue, Shorecrasher Mimic has base power and toughness 5/3 until end of turn and gains trample until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(5, 3, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility( + new SetBasePowerToughnessSourceEffect(5, 3, Duration.EndOfTurn, SubLayer.SetPT_7b, true), + filter, + false, + rule); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SigardasSummons.java b/Mage.Sets/src/mage/cards/s/SigardasSummons.java index b142aa72d2..1a125d753f 100644 --- a/Mage.Sets/src/mage/cards/s/SigardasSummons.java +++ b/Mage.Sets/src/mage/cards/s/SigardasSummons.java @@ -66,8 +66,8 @@ class SigardasSummonsEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SilverwingSquadron.java b/Mage.Sets/src/mage/cards/s/SilverwingSquadron.java index b240da7e81..0b5e228375 100644 --- a/Mage.Sets/src/mage/cards/s/SilverwingSquadron.java +++ b/Mage.Sets/src/mage/cards/s/SilverwingSquadron.java @@ -6,7 +6,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.dynamicvalue.common.OpponentsCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.VigilanceAbility; @@ -41,7 +41,7 @@ public final class SilverwingSquadron extends CardImpl { // Silverwing Squadron's power and toughness are each equal to the number of creatures you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame) ).addHint(CreaturesYouControlHint.instance)); // Whenever Silverwing Squadron attacks, create a number of 2/2 white Knight creature tokens with vigilance equal to the number of opponents you have. diff --git a/Mage.Sets/src/mage/cards/s/SimaYiWeiFieldMarshal.java b/Mage.Sets/src/mage/cards/s/SimaYiWeiFieldMarshal.java index 8724322780..68036fa278 100644 --- a/Mage.Sets/src/mage/cards/s/SimaYiWeiFieldMarshal.java +++ b/Mage.Sets/src/mage/cards/s/SimaYiWeiFieldMarshal.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -32,7 +32,7 @@ public final class SimaYiWeiFieldMarshal extends CardImpl { this.toughness = new MageInt(4); // Sima Yi, Wei Field Marshal's power is equal to the number of Swamps you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private SimaYiWeiFieldMarshal(final SimaYiWeiFieldMarshal card) { super(card); diff --git a/Mage.Sets/src/mage/cards/s/SingingTree.java b/Mage.Sets/src/mage/cards/s/SingingTree.java index 3d6b049ac2..2c39909001 100644 --- a/Mage.Sets/src/mage/cards/s/SingingTree.java +++ b/Mage.Sets/src/mage/cards/s/SingingTree.java @@ -6,9 +6,10 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -63,8 +64,8 @@ class SingingTreeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { - int toughness = targetCreature.getToughness().getBaseValueModified(); - game.addEffect(new SetPowerToughnessTargetEffect(0, toughness, Duration.EndOfTurn), source); + int toughness = targetCreature.getToughness().getModifiedBaseValue(); + game.addEffect(new SetBasePowerToughnessTargetEffect(StaticValue.get(0), null, Duration.EndOfTurn), source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/SkyshroudWarBeast.java b/Mage.Sets/src/mage/cards/s/SkyshroudWarBeast.java index c3c4440b51..87ed88fc65 100644 --- a/Mage.Sets/src/mage/cards/s/SkyshroudWarBeast.java +++ b/Mage.Sets/src/mage/cards/s/SkyshroudWarBeast.java @@ -77,18 +77,18 @@ class SkyshroudWarBeastEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - MageObject target = game.getObject(source); - if (target != null) { - UUID playerId = (UUID) game.getState().getValue(source.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY); - FilterLandPermanent filter = FilterLandPermanent.nonbasicLand(); - filter.add(new ControllerIdPredicate(playerId)); - int number = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this); - target.getPower().setValue(number); - target.getToughness().setValue(number); - return true; - } + MageObject target = game.getObject(source); + if (controller == null || target == null) { + return false; } - return false; + + UUID playerId = (UUID) game.getState().getValue(source.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY); + FilterLandPermanent filter = FilterLandPermanent.nonbasicLand(); + filter.add(new ControllerIdPredicate(playerId)); + + int number = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this); + target.getPower().setModifiedBaseValue(number); + target.getToughness().setModifiedBaseValue(number); + return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SlagFiend.java b/Mage.Sets/src/mage/cards/s/SlagFiend.java index d90c39afa6..04a0c8a354 100644 --- a/Mage.Sets/src/mage/cards/s/SlagFiend.java +++ b/Mage.Sets/src/mage/cards/s/SlagFiend.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -28,7 +28,7 @@ public final class SlagFiend extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInAllGraveyardsCount(new FilterArtifactCard("artifacts")), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInAllGraveyardsCount(new FilterArtifactCard("artifacts")), Duration.EndOfGame))); } private SlagFiend(final SlagFiend card) { diff --git a/Mage.Sets/src/mage/cards/s/SlimeMolding.java b/Mage.Sets/src/mage/cards/s/SlimeMolding.java index 9d901b4aab..80b95e6bf2 100644 --- a/Mage.Sets/src/mage/cards/s/SlimeMolding.java +++ b/Mage.Sets/src/mage/cards/s/SlimeMolding.java @@ -51,8 +51,8 @@ class SlimeMoldingEffect extends OneShotEffect { int count = source.getManaCostsToPay().getX(); OozeToken oozeToken = new OozeToken(); - oozeToken.getPower().modifyBaseValue(count); - oozeToken.getToughness().modifyBaseValue(count); + oozeToken.setPower(count); + oozeToken.setToughness(count); oozeToken.putOntoBattlefield(1, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SludgeMonster.java b/Mage.Sets/src/mage/cards/s/SludgeMonster.java index eb3ebe87dc..f6009bb80f 100644 --- a/Mage.Sets/src/mage/cards/s/SludgeMonster.java +++ b/Mage.Sets/src/mage/cards/s/SludgeMonster.java @@ -95,8 +95,8 @@ class SludgeMonsterEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(2); - permanent.getToughness().setValue(2); + permanent.getPower().setModifiedBaseValue(2); + permanent.getToughness().setModifiedBaseValue(2); } } } diff --git a/Mage.Sets/src/mage/cards/s/SlumberingTora.java b/Mage.Sets/src/mage/cards/s/SlumberingTora.java index e90ac5d24d..42aac02ba0 100644 --- a/Mage.Sets/src/mage/cards/s/SlumberingTora.java +++ b/Mage.Sets/src/mage/cards/s/SlumberingTora.java @@ -31,8 +31,9 @@ public final class SlumberingTora extends CardImpl { public SlumberingTora(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + // {2}, Discard a Spirit or Arcane card: Slumbering Tora becomes an X/X Cat artifact creature until end of turn, - // where X is the discarded card's converted mana cost. + // where X is the discarded card's converted mana cost. Ability ability = new SimpleActivatedAbility(new SlumberingToraEffect(), new ManaCostsImpl<>("{2}")); ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter))); this.addAbility(ability); @@ -46,66 +47,68 @@ public final class SlumberingTora extends CardImpl { public SlumberingTora copy() { return new SlumberingTora(this); } +} - private static class SlumberingToraEffect extends ContinuousEffectImpl { +class SlumberingToraEffect extends ContinuousEffectImpl { - private int convManaCosts = 0; + private int convManaCosts = 0; - private SlumberingToraEffect() { - super(Duration.EndOfTurn, Outcome.BecomeCreature); - staticText = "{this} becomes an X/X Cat artifact creature until end of turn, " + - "where X is the discarded card's mana value"; - } + SlumberingToraEffect() { + super(Duration.EndOfTurn, Outcome.BecomeCreature); + staticText = "{this} becomes an X/X Cat artifact creature until end of turn, " + + "where X is the discarded card's mana value"; + } - private SlumberingToraEffect(final SlumberingToraEffect effect) { - super(effect); - } + private SlumberingToraEffect(final SlumberingToraEffect effect) { + super(effect); + this.convManaCosts = effect.convManaCosts; + } - @Override - public SlumberingToraEffect copy() { - return new SlumberingToraEffect(this); - } + @Override + public SlumberingToraEffect copy() { + return new SlumberingToraEffect(this); + } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - for (Cost cost : source.getCosts()) { - if (cost instanceof DiscardTargetCost && !((DiscardTargetCost) cost).getCards().isEmpty()) { - convManaCosts = ((DiscardTargetCost) cost).getCards().get(0).getManaValue(); - return; - } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + for (Cost cost : source.getCosts()) { + if (cost instanceof DiscardTargetCost && !((DiscardTargetCost) cost).getCards().isEmpty()) { + convManaCosts = ((DiscardTargetCost) cost).getCards().get(0).getManaValue(); + return; } } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) { - return false; - } - switch (layer) { - case TypeChangingEffects_4: - permanent.addCardType(game, CardType.ARTIFACT); - permanent.addCardType(game, CardType.CREATURE); - permanent.addSubType(game, SubType.CAT); - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(convManaCosts); - permanent.getToughness().setValue(convManaCosts); - } - } - return true; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; - } } -} + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) { + discard(); + return false; + } + switch (layer) { + case TypeChangingEffects_4: + permanent.addCardType(game, CardType.ARTIFACT); + permanent.addCardType(game, CardType.CREATURE); + permanent.addSubType(game, SubType.CAT); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setModifiedBaseValue(convManaCosts); + permanent.getToughness().setModifiedBaseValue(convManaCosts); + } + } + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java b/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java index 2489e61542..34f5d8f1f0 100644 --- a/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java +++ b/Mage.Sets/src/mage/cards/s/SoramaroFirstToDream.java @@ -11,7 +11,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -40,7 +40,7 @@ public final class SoramaroFirstToDream extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Soramaro, First to Dream's power and toughness are each equal to the number of cards in your hand. DynamicValue xValue= CardsInControllerHandCount.instance; - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // {4}, Return a land you control to its owner's hand: Draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/cards/s/SorceressQueen.java b/Mage.Sets/src/mage/cards/s/SorceressQueen.java index c47d4fc81f..7a03b9669c 100644 --- a/Mage.Sets/src/mage/cards/s/SorceressQueen.java +++ b/Mage.Sets/src/mage/cards/s/SorceressQueen.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -37,7 +37,7 @@ public final class SorceressQueen extends CardImpl { this.toughness = new MageInt(1); // {tap}: Target creature other than Sorceress Queen becomes 0/2 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SoulOfEternity.java b/Mage.Sets/src/mage/cards/s/SoulOfEternity.java index af74bc4297..34e63a6a84 100644 --- a/Mage.Sets/src/mage/cards/s/SoulOfEternity.java +++ b/Mage.Sets/src/mage/cards/s/SoulOfEternity.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.ControllerLifeCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.EncoreAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -30,7 +30,7 @@ public final class SoulOfEternity extends CardImpl { // Soul of Eternity's power and toughness are each equal to your life total. this.addAbility(new SimpleStaticAbility( Zone.ALL, - new SetPowerToughnessSourceEffect( + new SetBasePowerToughnessSourceEffect( ControllerLifeCount.instance, Duration.EndOfGame ).setText("{this}'s power and toughness are each equal to your life total") )); diff --git a/Mage.Sets/src/mage/cards/s/SoullessOne.java b/Mage.Sets/src/mage/cards/s/SoullessOne.java index cca6e6920d..fde8f5a0ca 100644 --- a/Mage.Sets/src/mage/cards/s/SoullessOne.java +++ b/Mage.Sets/src/mage/cards/s/SoullessOne.java @@ -7,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class SoullessOne extends CardImpl { this.toughness = new MageInt(0); // Soulless One's power and toughness are each equal to the number of Zombies on the battlefield plus the number of Zombie cards in all graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new SoullessOneDynamicCount(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new SoullessOneDynamicCount(), Duration.EndOfGame))); } private SoullessOne(final SoullessOne card) { diff --git a/Mage.Sets/src/mage/cards/s/SoulsurgeElemental.java b/Mage.Sets/src/mage/cards/s/SoulsurgeElemental.java index 663452a29f..fd777af3a4 100644 --- a/Mage.Sets/src/mage/cards/s/SoulsurgeElemental.java +++ b/Mage.Sets/src/mage/cards/s/SoulsurgeElemental.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; @@ -32,7 +32,7 @@ public final class SoulsurgeElemental extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // Soulsurge Elemental's power is equal to the number of creatures you control. - Effect effect = new SetPowerSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame); + Effect effect = new SetBasePowerSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect) .addHint(CreaturesYouControlHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/s/SpellheartChimera.java b/Mage.Sets/src/mage/cards/s/SpellheartChimera.java index 7273b0c554..d190f76658 100644 --- a/Mage.Sets/src/mage/cards/s/SpellheartChimera.java +++ b/Mage.Sets/src/mage/cards/s/SpellheartChimera.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -34,7 +34,7 @@ public final class SpellheartChimera extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Spellheart Chimera's power is equal to the number of instant and sorcery cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect( new CardsInControllerGraveyardCount(new FilterInstantOrSorceryCard("instant and sorcery cards in your graveyard")), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/s/Splinterfright.java b/Mage.Sets/src/mage/cards/s/Splinterfright.java index 04011fa5f5..bca133e123 100644 --- a/Mage.Sets/src/mage/cards/s/Splinterfright.java +++ b/Mage.Sets/src/mage/cards/s/Splinterfright.java @@ -7,7 +7,7 @@ import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.MillCardsControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -34,7 +34,7 @@ public final class Splinterfright extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Splinterfright's power and toughness are each equal to the number of creature cards in your graveyard. CardsInControllerGraveyardCount count = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards")); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(count, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(count, Duration.EndOfGame))); // At the beginning of your upkeep, put the top two cards of your library into your graveyard. this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new MillCardsControllerEffect(2), false)); } diff --git a/Mage.Sets/src/mage/cards/s/SquareUp.java b/Mage.Sets/src/mage/cards/s/SquareUp.java index 5d83a05ee8..af518df6d3 100644 --- a/Mage.Sets/src/mage/cards/s/SquareUp.java +++ b/Mage.Sets/src/mage/cards/s/SquareUp.java @@ -1,6 +1,6 @@ package mage.cards.s; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -18,7 +18,7 @@ public final class SquareUp extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G/U}"); // Target creature has base power and toughness 4/4 until end of turn. - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/s/SquelchingLeeches.java b/Mage.Sets/src/mage/cards/s/SquelchingLeeches.java index 9afe9d8140..afa0ef5c78 100644 --- a/Mage.Sets/src/mage/cards/s/SquelchingLeeches.java +++ b/Mage.Sets/src/mage/cards/s/SquelchingLeeches.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class SquelchingLeeches extends CardImpl { this.toughness = new MageInt(0); // Squelching Leeches's power and toughness are each equal to the number of Swamps you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private SquelchingLeeches(final SquelchingLeeches card) { diff --git a/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java b/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java index c8338a5374..623884cdf7 100644 --- a/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java +++ b/Mage.Sets/src/mage/cards/s/StarfieldOfNyx.java @@ -128,8 +128,8 @@ public final class StarfieldOfNyx extends CardImpl { && permanent.isCreature(game) && !permanent.hasSubtype(SubType.AURA, game)) { int manaCost = permanent.getManaValue(); - permanent.getPower().setValue(manaCost); - permanent.getToughness().setValue(manaCost); + permanent.getPower().setModifiedBaseValue(manaCost); + permanent.getToughness().setModifiedBaseValue(manaCost); } break; } diff --git a/Mage.Sets/src/mage/cards/s/StormOfSouls.java b/Mage.Sets/src/mage/cards/s/StormOfSouls.java index d73bc1d2df..a721eb3fd8 100644 --- a/Mage.Sets/src/mage/cards/s/StormOfSouls.java +++ b/Mage.Sets/src/mage/cards/s/StormOfSouls.java @@ -115,8 +115,8 @@ class StormOfSoulsChangeCreatureEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); } break; } diff --git a/Mage.Sets/src/mage/cards/s/StorvaldFrostGiantJarl.java b/Mage.Sets/src/mage/cards/s/StorvaldFrostGiantJarl.java index 9269679c2a..8e7afc09d3 100644 --- a/Mage.Sets/src/mage/cards/s/StorvaldFrostGiantJarl.java +++ b/Mage.Sets/src/mage/cards/s/StorvaldFrostGiantJarl.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.WardAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -46,12 +46,12 @@ public final class StorvaldFrostGiantJarl extends CardImpl { // Whenever Storvald, Frost Giant Jarl enters the battlefield or attacks, choose one or both — // • Target creature has base power and toughness 7/7 until end of turn. Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility( - new SetPowerToughnessTargetEffect(7, 7, Duration.EndOfTurn) + new SetBasePowerToughnessTargetEffect(7, 7, Duration.EndOfTurn) ); ability.addTarget(new TargetCreaturePermanent()); // • Target creature has base power and toughness 1/1 until end of turn. - Mode mode = new Mode(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); + Mode mode = new Mode(new SetBasePowerToughnessTargetEffect(1, 1, Duration.EndOfTurn)); mode.addTarget(new TargetCreaturePermanent()); ability.addMode(mode); ability.getModes().setMinModes(1); diff --git a/Mage.Sets/src/mage/cards/s/Sturmgeist.java b/Mage.Sets/src/mage/cards/s/Sturmgeist.java index fe16cdc5b6..f06195a846 100644 --- a/Mage.Sets/src/mage/cards/s/Sturmgeist.java +++ b/Mage.Sets/src/mage/cards/s/Sturmgeist.java @@ -7,7 +7,7 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -31,7 +31,7 @@ public final class Sturmgeist extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Sturmgeist's power and toughness are each equal to the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame))); // Whenever Sturmgeist deals combat damage to a player, draw a card. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); } diff --git a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java index 6558d7beda..f1de5897db 100644 --- a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java +++ b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java @@ -66,34 +66,35 @@ class SuddenSpoilingEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); - if (player != null) { - for (Permanent perm : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { - affectedObjectList.add(new MageObjectReference(perm, game)); - } + if (player == null) { + return; + } + for (Permanent perm : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + affectedObjectList.add(new MageObjectReference(perm, game)); } } @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); - if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { - if (affectedObjectList.contains(new MageObjectReference(permanent, game))) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - permanent.removeAllAbilities(source.getSourceId(), game); - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(0); - permanent.getToughness().setValue(2); - } - } + if (player == null) { + return false; + } + for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + if (affectedObjectList.contains(new MageObjectReference(permanent, game))) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + permanent.removeAllAbilities(source.getSourceId(), game); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setModifiedBaseValue(0); + permanent.getToughness().setModifiedBaseValue(2); + } } } - return true; } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/s/SuitUp.java b/Mage.Sets/src/mage/cards/s/SuitUp.java index d2f3b31bd4..f9a805969b 100644 --- a/Mage.Sets/src/mage/cards/s/SuitUp.java +++ b/Mage.Sets/src/mage/cards/s/SuitUp.java @@ -2,7 +2,7 @@ package mage.cards.s; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class SuitUp extends CardImpl { this.getSpellAbility().addEffect(new AddCardTypeTargetEffect( Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE ).setText("until end of turn, target creature or Vehicle becomes an artifact creature")); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect( + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect( 4, 5, Duration.EndOfTurn ).setText("with base power and toughness 4/5")); this.getSpellAbility().addTarget(new TargetPermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java b/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java index b0b1be6b4d..cddaf946c9 100644 --- a/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java +++ b/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -59,7 +59,7 @@ class SvogthosToken extends TokenImpl { power = new MageInt(0); toughness = new MageInt(0); CardsInControllerGraveyardCount count = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards")); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(count, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(count, Duration.EndOfGame))); } public SvogthosToken(final SvogthosToken token) { super(token); diff --git a/Mage.Sets/src/mage/cards/s/SwarmOfRats.java b/Mage.Sets/src/mage/cards/s/SwarmOfRats.java index b433b17061..f6557a22ca 100644 --- a/Mage.Sets/src/mage/cards/s/SwarmOfRats.java +++ b/Mage.Sets/src/mage/cards/s/SwarmOfRats.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class SwarmOfRats extends CardImpl { this.toughness = new MageInt(1); // Swarm of Rats's power is equal to the number of Rats you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private SwarmOfRats(final SwarmOfRats card) { diff --git a/Mage.Sets/src/mage/cards/s/SwornDefender.java b/Mage.Sets/src/mage/cards/s/SwornDefender.java index c54524244c..02a3aa63e9 100644 --- a/Mage.Sets/src/mage/cards/s/SwornDefender.java +++ b/Mage.Sets/src/mage/cards/s/SwornDefender.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -78,7 +78,7 @@ class SwornDefenderEffect extends OneShotEffect { if (controller != null && targetPermanent != null) { int newPower = CardUtil.overflowDec(targetPermanent.getToughness().getValue(), 1); int newToughness = CardUtil.overflowInc(targetPermanent.getPower().getValue(), 1); - game.addEffect(new SetPowerToughnessSourceEffect(newPower, newToughness, Duration.EndOfTurn, SubLayer.SetPT_7b), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(newPower, newToughness, Duration.EndOfTurn, SubLayer.SetPT_7b), source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java b/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java index 2197d820a4..095dfb0214 100644 --- a/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java +++ b/Mage.Sets/src/mage/cards/s/SydriGalvanicGenius.java @@ -105,8 +105,8 @@ class SydriGalvanicGeniusEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int cmc = artifact.getManaValue(); - artifact.getPower().setValue(cmc); - artifact.getToughness().setValue(cmc); + artifact.getPower().setModifiedBaseValue(cmc); + artifact.getToughness().setModifiedBaseValue(cmc); } } return true; diff --git a/Mage.Sets/src/mage/cards/s/SylvanYeti.java b/Mage.Sets/src/mage/cards/s/SylvanYeti.java index d877a0844e..2adccbee89 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanYeti.java +++ b/Mage.Sets/src/mage/cards/s/SylvanYeti.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -27,7 +27,7 @@ public final class SylvanYeti extends CardImpl { this.toughness = new MageInt(4); // Sylvan Yeti's power is equal to the number of cards in your hand. - Effect effect = new SetPowerSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame); + Effect effect = new SetBasePowerSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); } diff --git a/Mage.Sets/src/mage/cards/s/SymmetrySage.java b/Mage.Sets/src/mage/cards/s/SymmetrySage.java index 79b50b51f1..58f5561e3c 100644 --- a/Mage.Sets/src/mage/cards/s/SymmetrySage.java +++ b/Mage.Sets/src/mage/cards/s/SymmetrySage.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.MagecraftAbility; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +32,7 @@ public final class SymmetrySage extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Magecraft — Whenever you cast or copy an instant or sorcery spell, target creature you control has base power 2 until end of turn. - Ability ability = new MagecraftAbility(new SetPowerToughnessTargetEffect( + Ability ability = new MagecraftAbility(new SetBasePowerToughnessTargetEffect( StaticValue.get(2), null, Duration.EndOfTurn ).setText("target creature you control has base power 2 until end of turn")); ability.addTarget(new TargetControlledCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/s/SyrElenoraTheDiscerning.java b/Mage.Sets/src/mage/cards/s/SyrElenoraTheDiscerning.java index 558ccfb909..787d69448c 100644 --- a/Mage.Sets/src/mage/cards/s/SyrElenoraTheDiscerning.java +++ b/Mage.Sets/src/mage/cards/s/SyrElenoraTheDiscerning.java @@ -5,7 +5,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.effects.common.cost.SpellsCostModificationThatTargetSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -30,7 +30,7 @@ public final class SyrElenoraTheDiscerning extends CardImpl { // Syr Elenora the Discerning's power is equal to the number of cards in your hand. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame) + Zone.ALL, new SetBasePowerSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame) )); // When Syr Elenora enters the battlefield, draw a card. diff --git a/Mage.Sets/src/mage/cards/t/TanazirQuandrix.java b/Mage.Sets/src/mage/cards/t/TanazirQuandrix.java index 88058f09ad..cf823e3b2a 100644 --- a/Mage.Sets/src/mage/cards/t/TanazirQuandrix.java +++ b/Mage.Sets/src/mage/cards/t/TanazirQuandrix.java @@ -8,7 +8,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; import mage.abilities.dynamicvalue.common.SourcePermanentToughnessValue; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -50,7 +50,7 @@ public final class TanazirQuandrix extends CardImpl { this.addAbility(ability); // Whenever Tanazir Quandrix attacks, you may have the base power and toughness of other creatures you control become equal to Tanazir Quandrix's power and toughness until end of turn. - this.addAbility(new AttacksTriggeredAbility(new SetPowerToughnessAllEffect( + this.addAbility(new AttacksTriggeredAbility(new SetBasePowerToughnessAllEffect( xValue, SourcePermanentToughnessValue.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURE, true ).setText("have the base power and toughness of other creatures you control " + diff --git a/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java b/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java index f1f4e9ee4b..8d16f3fba5 100644 --- a/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java +++ b/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; @@ -46,7 +46,7 @@ public final class TaranikaAkroanVeteran extends CardImpl { // Whenever Taranika, Akroan Veteran attacks, untap another target creature you control. Until end of turn, that creature has base power and toughness 4/4 and gains indestructible. Ability ability = new AttacksTriggeredAbility(new UntapTargetEffect(), false); - ability.addEffect(new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) + ability.addEffect(new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) .setText("Until end of turn, that creature has base power and toughness 4/4")); ability.addEffect(new GainAbilityTargetEffect( IndestructibleAbility.getInstance(), Duration.EndOfTurn diff --git a/Mage.Sets/src/mage/cards/t/Tarmogoyf.java b/Mage.Sets/src/mage/cards/t/Tarmogoyf.java index 546ec948bc..f7ec00fe23 100644 --- a/Mage.Sets/src/mage/cards/t/Tarmogoyf.java +++ b/Mage.Sets/src/mage/cards/t/Tarmogoyf.java @@ -4,12 +4,18 @@ import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CardTypesInGraveyardHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import mage.filter.StaticFilters; import mage.game.Game; import java.util.UUID; @@ -19,6 +25,9 @@ import java.util.UUID; */ public final class Tarmogoyf extends CardImpl { + private static final DynamicValue powerValue = CardTypesInGraveyardCount.ALL; + private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1)); + public Tarmogoyf(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add(SubType.LHURGOYF); @@ -27,7 +36,11 @@ public final class Tarmogoyf extends CardImpl { this.toughness = new MageInt(1); // Tarmogoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new TarmogoyfEffect()).addHint(CardTypesInGraveyardHint.ALL)); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a, false) + .setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1") + )); } private Tarmogoyf(final Tarmogoyf card) { @@ -39,32 +52,3 @@ public final class Tarmogoyf extends CardImpl { return new Tarmogoyf(this); } } - -class TarmogoyfEffect extends ContinuousEffectImpl { - - public TarmogoyfEffect() { - super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); - staticText = "{this}'s power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1"; - } - - public TarmogoyfEffect(final TarmogoyfEffect effect) { - super(effect); - } - - @Override - public TarmogoyfEffect copy() { - return new TarmogoyfEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject target = source.getSourceObject(game); - if (target == null) { - return false; - } - int number = CardTypesInGraveyardCount.ALL.calculate(game, source, this); - target.getPower().setValue(number); - target.getToughness().setValue(number + 1); - return true; - } -} diff --git a/Mage.Sets/src/mage/cards/t/Terravore.java b/Mage.Sets/src/mage/cards/t/Terravore.java index 3c06a28215..f0def99e15 100644 --- a/Mage.Sets/src/mage/cards/t/Terravore.java +++ b/Mage.Sets/src/mage/cards/t/Terravore.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -31,7 +31,7 @@ public final class Terravore extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Terravore's power and toughness are each equal to the number of land cards in all graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect( new CardsInAllGraveyardsCount(new FilterLandCard("land cards")), Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/t/TerritorialKavu.java b/Mage.Sets/src/mage/cards/t/TerritorialKavu.java index d8972a7d88..dfbdb59dc8 100644 --- a/Mage.Sets/src/mage/cards/t/TerritorialKavu.java +++ b/Mage.Sets/src/mage/cards/t/TerritorialKavu.java @@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class TerritorialKavu extends CardImpl { // Domain — Territorial Kavu's power and toughness are each equal to the number of basic land types among lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame) ).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); // Whenever Territorial Kavu attacks, choose one — diff --git a/Mage.Sets/src/mage/cards/t/TerritorialMaro.java b/Mage.Sets/src/mage/cards/t/TerritorialMaro.java index 45956bef22..253a94d2af 100644 --- a/Mage.Sets/src/mage/cards/t/TerritorialMaro.java +++ b/Mage.Sets/src/mage/cards/t/TerritorialMaro.java @@ -5,7 +5,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.MultipliedValue; import mage.abilities.dynamicvalue.common.DomainValue; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -29,7 +29,7 @@ public final class TerritorialMaro extends CardImpl { // Domain — Territorial Maro's power and toughness are each equal to twice the number of basic land types among lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame) + Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame) .setText("{this}'s power and toughness are each equal to twice the number of basic land types among lands you control") ).setAbilityWord(AbilityWord.DOMAIN).addHint(DomainHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java index 4c451ad512..20da7ca60b 100644 --- a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java +++ b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java @@ -7,7 +7,7 @@ import mage.abilities.costs.mana.VariableManaCost; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -26,8 +26,8 @@ public final class TestamentOfFaith extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); // {X}: Testament of Faith becomes an X/X Wall creature with defender in addition to its other types until end of turn. - Ability ability = new SimpleActivatedAbility(new SetPowerToughnessSourceEffect( - ManacostVariableValue.REGULAR, Duration.EndOfTurn, SubLayer.SetPT_7b + Ability ability = new SimpleActivatedAbility(new SetBasePowerToughnessSourceEffect( + ManacostVariableValue.REGULAR, Duration.EndOfTurn, SubLayer.SetPT_7b, true ).setText("{this} becomes an X/X"), new VariableManaCost(VariableCostType.NORMAL)); ability.addEffect(new TestamentOfFaithEffect()); ability.addEffect(new GainAbilitySourceEffect( diff --git a/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java b/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java index 4a5b9295ce..f1e9fa9c91 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java @@ -10,7 +10,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -46,7 +46,7 @@ public final class TezzeretAgentOfBolas extends CardImpl { Effect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE); effect.setText("Target artifact becomes an artifact creature"); LoyaltyAbility ability1 = new LoyaltyAbility(effect, -1); - effect = new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfGame); + effect = new SetBasePowerToughnessTargetEffect(5, 5, Duration.EndOfGame); effect.setText("with base power and toughness 5/5"); ability1.addEffect(effect); ability1.addTarget(new TargetArtifactPermanent()); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretBetrayerOfFlesh.java b/Mage.Sets/src/mage/cards/t/TezzeretBetrayerOfFlesh.java index 6279e949f5..bc6922cd5c 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretBetrayerOfFlesh.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretBetrayerOfFlesh.java @@ -172,8 +172,8 @@ class TezzeretBetrayerOfFleshTypeEffect extends ContinuousEffectImpl { || permanent.hasSubtype(SubType.VEHICLE, game)) { return false; } - permanent.getPower().setValue(4); - permanent.getToughness().setValue(4); + permanent.getPower().setModifiedBaseValue(4); + permanent.getToughness().setModifiedBaseValue(4); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java index e8a4d8b653..d2a92bf303 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java @@ -7,7 +7,7 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.Cards; @@ -44,7 +44,7 @@ public final class TezzeretCruelMachinist extends CardImpl { Ability ability = new LoyaltyAbility(new AddCardTypeTargetEffect( Duration.UntilYourNextTurn, CardType.ARTIFACT, CardType.CREATURE ).setText("Until your next turn, target artifact you control becomes an artifact creature"), 0); - ability.addEffect(new SetPowerToughnessTargetEffect( + ability.addEffect(new SetBasePowerToughnessTargetEffect( 5, 5, Duration.UntilYourNextTurn ).setText("with base power and toughness 5/5")); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT)); @@ -136,8 +136,8 @@ class TezzeretCruelMachinistCardTypeEffect extends ContinuousEffectImpl { target.removeAllSubTypes(game); target.addCardType(game, CardType.ARTIFACT); target.addCardType(game, CardType.CREATURE); - target.getPower().setValue(5); - target.getToughness().setValue(5); + target.getPower().setModifiedBaseValue(5); + target.getToughness().setModifiedBaseValue(5); } if (!flag) { discard(); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java b/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java index 852cc6630a..1e4efc2adf 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretTheSeeker.java @@ -137,8 +137,8 @@ class TezzeretTheSeekerEffect3 extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(5); - permanent.getToughness().setValue(5); + permanent.getPower().setModifiedBaseValue(5); + permanent.getToughness().setModifiedBaseValue(5); } } } diff --git a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java index f5b79931e3..1c6cab3ae0 100644 --- a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java +++ b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java @@ -98,8 +98,8 @@ class TheAntiquitiesWarEffect extends ContinuousEffectImpl { break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(5); - permanent.getToughness().setValue(5); + permanent.getPower().setModifiedBaseValue(5); + permanent.getToughness().setModifiedBaseValue(5); } } } diff --git a/Mage.Sets/src/mage/cards/t/TheBearsOfLittjara.java b/Mage.Sets/src/mage/cards/t/TheBearsOfLittjara.java index abe2a13086..fd94bc7310 100644 --- a/Mage.Sets/src/mage/cards/t/TheBearsOfLittjara.java +++ b/Mage.Sets/src/mage/cards/t/TheBearsOfLittjara.java @@ -4,7 +4,7 @@ import mage.abilities.Ability; import mage.abilities.common.SagaAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -45,7 +45,7 @@ public final class TheBearsOfLittjara extends CardImpl { // II — Any number of target Shapeshifter creatures you control have base power and toughness 4/4. sagaAbility.addChapterEffect( this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II, - new SetPowerToughnessTargetEffect(4, 4, Duration.Custom), + new SetBasePowerToughnessTargetEffect(4, 4, Duration.Custom), new TargetPermanent(0, Integer.MAX_VALUE, filter, false) ); diff --git a/Mage.Sets/src/mage/cards/t/TheBlackstaffOfWaterdeep.java b/Mage.Sets/src/mage/cards/t/TheBlackstaffOfWaterdeep.java index f4da6955cc..6e3d12d37a 100644 --- a/Mage.Sets/src/mage/cards/t/TheBlackstaffOfWaterdeep.java +++ b/Mage.Sets/src/mage/cards/t/TheBlackstaffOfWaterdeep.java @@ -91,8 +91,8 @@ class TheBlackstaffOfWaterdeepEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - artifact.getPower().setValue(4); - artifact.getToughness().setValue(4); + artifact.getPower().setModifiedBaseValue(4); + artifact.getToughness().setModifiedBaseValue(4); return true; } } diff --git a/Mage.Sets/src/mage/cards/t/Tidewalker.java b/Mage.Sets/src/mage/cards/t/Tidewalker.java index 2945251b4d..a153908143 100644 --- a/Mage.Sets/src/mage/cards/t/Tidewalker.java +++ b/Mage.Sets/src/mage/cards/t/Tidewalker.java @@ -7,7 +7,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.VanishingSacrificeAbility; import mage.abilities.keyword.VanishingUpkeepAbility; @@ -44,7 +44,7 @@ public final class Tidewalker extends CardImpl { this.addAbility(new VanishingUpkeepAbility(0)); this.addAbility(new VanishingSacrificeAbility()); // Tidewalker's power and toughness are each equal to the number of time counters on it. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.TIME), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CountersSourceCount(CounterType.TIME), Duration.EndOfGame))); } private Tidewalker(final Tidewalker card) { diff --git a/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java b/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java index f5da84e4f3..8a03122bf7 100644 --- a/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java +++ b/Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java @@ -9,7 +9,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -33,7 +33,7 @@ public final class TishanaVoiceOfThunder extends CardImpl { // Tishana, Voice of Thunder's power and toughness are each equal to the number of cards in your hand. DynamicValue xValue = CardsInControllerHandCount.instance; - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); // You have no maximum hand size. Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield, MaximumHandSizeControllerEffect.HandSizeModification.SET); diff --git a/Mage.Sets/src/mage/cards/t/TitaniasSong.java b/Mage.Sets/src/mage/cards/t/TitaniasSong.java index d236882851..f55d4d1752 100644 --- a/Mage.Sets/src/mage/cards/t/TitaniasSong.java +++ b/Mage.Sets/src/mage/cards/t/TitaniasSong.java @@ -95,8 +95,8 @@ class TitaniasSongEffect extends ContinuousEffectImpl { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { int manaCost = permanent.getManaValue(); - permanent.getPower().setValue(manaCost); - permanent.getToughness().setValue(manaCost); + permanent.getPower().setModifiedBaseValue(manaCost); + permanent.getToughness().setModifiedBaseValue(manaCost); } } } diff --git a/Mage.Sets/src/mage/cards/t/ToxrillTheCorrosive.java b/Mage.Sets/src/mage/cards/t/ToxrillTheCorrosive.java index cb6ad9ee7b..8c4c302358 100644 --- a/Mage.Sets/src/mage/cards/t/ToxrillTheCorrosive.java +++ b/Mage.Sets/src/mage/cards/t/ToxrillTheCorrosive.java @@ -105,8 +105,8 @@ class ToxrillTheCorrosiveEffect extends ContinuousEffectImpl { source.getControllerId(), source, game )) { int counter = permanent.getCounters(game).getCount(CounterType.SLIME); - permanent.getPower().boostValue(-counter); - permanent.getToughness().boostValue(-counter); + permanent.getPower().increaseBoostedValue(-counter); + permanent.getToughness().increaseBoostedValue(-counter); } return true; } diff --git a/Mage.Sets/src/mage/cards/t/Toymaker.java b/Mage.Sets/src/mage/cards/t/Toymaker.java index b3e7f6b3b9..41fa04b6cb 100644 --- a/Mage.Sets/src/mage/cards/t/Toymaker.java +++ b/Mage.Sets/src/mage/cards/t/Toymaker.java @@ -98,8 +98,8 @@ class ToymakerEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { int cmc = artifact.getManaValue(); - artifact.getPower().setValue(cmc); - artifact.getToughness().setValue(cmc); + artifact.getPower().setModifiedBaseValue(cmc); + artifact.getToughness().setModifiedBaseValue(cmc); } } return true; diff --git a/Mage.Sets/src/mage/cards/t/TraprootKami.java b/Mage.Sets/src/mage/cards/t/TraprootKami.java index 94ed572ca8..cb5f32dd12 100644 --- a/Mage.Sets/src/mage/cards/t/TraprootKami.java +++ b/Mage.Sets/src/mage/cards/t/TraprootKami.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; @@ -38,7 +38,7 @@ public final class TraprootKami extends CardImpl { this.addAbility(DefenderAbility.getInstance()); this.addAbility(ReachAbility.getInstance()); // Traproot Kami's toughness is equal to the number of Forests on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBaseToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private TraprootKami(final TraprootKami card) { diff --git a/Mage.Sets/src/mage/cards/t/TreeOfPerdition.java b/Mage.Sets/src/mage/cards/t/TreeOfPerdition.java index 15d8fd9fb4..be473c5011 100644 --- a/Mage.Sets/src/mage/cards/t/TreeOfPerdition.java +++ b/Mage.Sets/src/mage/cards/t/TreeOfPerdition.java @@ -6,18 +6,20 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; /** * @@ -64,27 +66,32 @@ class TreeOfPerditionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player opponent = game.getPlayer(source.getFirstTarget()); - if (opponent != null && opponent.isLifeTotalCanChange()) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - int amount = perm.getToughness().getValue(); - int life = opponent.getLife(); - if (life == amount) { - return false; - } - if (life < amount && !opponent.isCanGainLife()) { - return false; - } - if (life > amount && !opponent.isCanLoseLife()) { - return false; - } - opponent.setLife(amount, game, source); - perm.getToughness().modifyBaseValue(life); - // game.addEffect(new SetPowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.Custom, SubLayer.SetPT_7b), source); - return true; - } + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm == null || opponent == null || !opponent.isLifeTotalCanChange()) { + return false; } - return false; + + int amount = perm.getToughness().getValue(); // Must get total value + int life = opponent.getLife(); + if (life == amount) { + return false; + } + if (life < amount && !opponent.isCanGainLife()) { + return false; + } + if (life > amount && !opponent.isCanLoseLife()) { + return false; + } + opponent.setLife(amount, game, source); + + // Any toughness-modifying effects, counters, Auras, or Equipment will apply after its toughness is set to the player’s former life total. + // For example, say Tree of Perdition is equipped with Cultist’s Staff (which makes it 2/15) and the player’s life total is 7. + // After the exchange, Tree of Perdition would be a 2/9 creature (its toughness became 7, which was then modified by Cultist’s Staff) and the player’s life total would be 15. + // (2016-07-13) + ContinuousEffect powerToughnessEffect = new SetBasePowerToughnessTargetEffect(null, StaticValue.get(life), Duration.Custom); + powerToughnessEffect.setTargetPointer(new FixedTarget(perm.getId())); + game.addEffect(powerToughnessEffect, source); + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/t/TreeOfRedemption.java b/Mage.Sets/src/mage/cards/t/TreeOfRedemption.java index e57a1f1152..24b1bc784b 100644 --- a/Mage.Sets/src/mage/cards/t/TreeOfRedemption.java +++ b/Mage.Sets/src/mage/cards/t/TreeOfRedemption.java @@ -2,12 +2,13 @@ package mage.cards.t; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -22,13 +23,12 @@ import mage.game.permanent.Permanent; import mage.players.Player; /** - * * @author BetaSteward */ public final class TreeOfRedemption extends CardImpl { public TreeOfRedemption(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.subtype.add(SubType.PLANT); this.power = new MageInt(0); @@ -64,26 +64,26 @@ class TreeOfRedemptionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.isLifeTotalCanChange()) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - int amount = perm.getToughness().getValue(); - int life = player.getLife(); - if (life == amount) { - return false; - } - if (life < amount && !player.isCanGainLife()) { - return false; - } - if (life > amount && !player.isCanLoseLife()) { - return false; - } - player.setLife(amount, game, source); - game.addEffect(new SetPowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.Custom, SubLayer.SetPT_7b), source); - return true; - } + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm == null || player == null || !player.isLifeTotalCanChange()) { + return false; } - return false; + + + int amount = perm.getToughness().getValue(); + int life = player.getLife(); + if (life == amount) { + return false; + } + if (life < amount && !player.isCanGainLife()) { + return false; + } + if (life > amount && !player.isCanLoseLife()) { + return false; + } + player.setLife(amount, game, source); + game.addEffect(new SetBasePowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source); + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/t/TreefolkSeedlings.java b/Mage.Sets/src/mage/cards/t/TreefolkSeedlings.java index 8eb3adba2a..8a9337f518 100644 --- a/Mage.Sets/src/mage/cards/t/TreefolkSeedlings.java +++ b/Mage.Sets/src/mage/cards/t/TreefolkSeedlings.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -34,7 +34,7 @@ public final class TreefolkSeedlings extends CardImpl { this.toughness = new MageInt(0); // Treefolk Seedlings's toughness is equal to the number of Forests you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBaseToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); } private TreefolkSeedlings(final TreefolkSeedlings card) { diff --git a/Mage.Sets/src/mage/cards/t/TrenchGorger.java b/Mage.Sets/src/mage/cards/t/TrenchGorger.java index cfc1a6f09a..eea16c0b47 100644 --- a/Mage.Sets/src/mage/cards/t/TrenchGorger.java +++ b/Mage.Sets/src/mage/cards/t/TrenchGorger.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -31,7 +31,8 @@ public final class TrenchGorger extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - // When Trench Gorger enters the battlefield, you may search your library for any number of land cards, exile them, then shuffle your library. If you do, Trench Gorger's power and toughness each become equal to the number of cards exiled this way. + // When Trench Gorger enters the battlefield, you may search your library for any number of land cards, exile them, then shuffle your library. + // If you do, Trench Gorger's power and toughness each become equal to the number of cards exiled this way. this.addAbility(new EntersBattlefieldTriggeredAbility(new TrenchGorgerEffect(), true)); } @@ -66,21 +67,26 @@ class TrenchGorgerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterLandCard("any number of land cards")); - target.choose(outcome, controller.getId(), controller.getId(), source, game); - int count = 0; - for (UUID cardId : target.getTargets()) { - Card card = game.getCard(cardId); - if (card != null) { - controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.LIBRARY, true); - count++; - } - } - controller.shuffleLibrary(source, game); - game.addEffect(new SetPowerToughnessSourceEffect(count, count, Duration.EndOfGame, SubLayer.SetPT_7b), source); - return true; + if (controller == null) { + return false; } - return false; + + TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterLandCard("any number of land cards")); + boolean searched = target.choose(outcome, controller.getId(), controller.getId(), source, game); + if (!searched) { + return false; + } + + int count = 0; + for (UUID cardId : target.getTargets()) { + Card card = game.getCard(cardId); + if (card != null) { + controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.LIBRARY, true); + count++; + } + } + controller.shuffleLibrary(source, game); + game.addEffect(new SetBasePowerToughnessSourceEffect(count, count, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source); + return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java b/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java index c1011e08fd..783f613005 100644 --- a/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java +++ b/Mage.Sets/src/mage/cards/t/TymaretChosenFromDeath.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.cards.*; import mage.constants.*; import mage.filter.StaticFilters; @@ -35,7 +35,7 @@ public final class TymaretChosenFromDeath extends CardImpl { // Tymaret's toughness is equal to your devotion to black. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetToughnessSourceEffect(DevotionCount.B, Duration.EndOfGame) + Zone.ALL, new SetBaseToughnessSourceEffect(DevotionCount.B, Duration.EndOfGame) .setText("{this}'s toughness is equal to your devotion to black") ).addHint(DevotionCount.B.getHint()) ); diff --git a/Mage.Sets/src/mage/cards/u/Uchuulon.java b/Mage.Sets/src/mage/cards/u/Uchuulon.java index 48459904cb..aef31761f6 100644 --- a/Mage.Sets/src/mage/cards/u/Uchuulon.java +++ b/Mage.Sets/src/mage/cards/u/Uchuulon.java @@ -8,7 +8,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.CreateTokenCopySourceEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -51,7 +51,7 @@ public final class Uchuulon extends CardImpl { this.toughness = new MageInt(4); // Uchuulon's power is equal to the number of Crabs, Oozes, and/or Horrors you control. - this.addAbility(new SimpleStaticAbility(new SetPowerSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(new SetBasePowerSourceEffect(xValue, Duration.EndOfGame))); // Horrific Symbiosis — At the beginning of your end step, exile up to one target creature card from an opponent's graveyard. If you, create a token that's a copy of Uchuulon. Ability ability = new BeginningOfEndStepTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/u/UktabiWildcats.java b/Mage.Sets/src/mage/cards/u/UktabiWildcats.java index 763ed3b71f..088684f692 100644 --- a/Mage.Sets/src/mage/cards/u/UktabiWildcats.java +++ b/Mage.Sets/src/mage/cards/u/UktabiWildcats.java @@ -10,7 +10,7 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.RegenerateSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -42,7 +42,7 @@ public final class UktabiWildcats extends CardImpl { this.toughness = new MageInt(0); // Uktabi Wildcats's power and toughness are each equal to the number of Forests you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // {G}, Sacrifice a Forest: Regenerate Uktabi Wildcats. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl<>("{G}")); diff --git a/Mage.Sets/src/mage/cards/u/UlvenwaldHydra.java b/Mage.Sets/src/mage/cards/u/UlvenwaldHydra.java index 791ac8be55..2b20b094e1 100644 --- a/Mage.Sets/src/mage/cards/u/UlvenwaldHydra.java +++ b/Mage.Sets/src/mage/cards/u/UlvenwaldHydra.java @@ -7,7 +7,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; @@ -42,7 +42,7 @@ public final class UlvenwaldHydra extends CardImpl { this.addAbility(ReachAbility.getInstance()); // Ulvenwald Hydra's power and toughness are each equal to the number of lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(controlledLands, Duration.EndOfGame))); // When Ulvenwald Hydra enters the battlefield, you may search your library for a land card, put it onto the battlefield tapped, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard()); diff --git a/Mage.Sets/src/mage/cards/u/UmbraStalker.java b/Mage.Sets/src/mage/cards/u/UmbraStalker.java index c17f710659..4c58dfc706 100644 --- a/Mage.Sets/src/mage/cards/u/UmbraStalker.java +++ b/Mage.Sets/src/mage/cards/u/UmbraStalker.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.ValueHint; import mage.cards.Card; import mage.cards.CardImpl; @@ -33,9 +33,9 @@ public final class UmbraStalker extends CardImpl { // Chroma - Umbra Stalker's power and toughness are each equal to the number of black mana symbols in the mana costs of cards in your graveyard. DynamicValue xValue = new ChromaUmbraStalkerCount(); - Effect effect = new SetPowerToughnessSourceEffect(xValue, Duration.WhileOnBattlefield); + Effect effect = new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame); effect.setText("Chroma — Umbra Stalker's power and toughness are each equal to the number of black mana symbols in the mana costs of cards in your graveyard."); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect) + this.addAbility(new SimpleStaticAbility(Zone.ALL, effect) .addHint(new ValueHint("Black mana symbols in your graveyard's permanents", xValue)) ); } diff --git a/Mage.Sets/src/mage/cards/u/UnlicensedHearse.java b/Mage.Sets/src/mage/cards/u/UnlicensedHearse.java index 00b837ff48..ff92613b25 100644 --- a/Mage.Sets/src/mage/cards/u/UnlicensedHearse.java +++ b/Mage.Sets/src/mage/cards/u/UnlicensedHearse.java @@ -8,7 +8,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetForSourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; import mage.abilities.keyword.CrewAbility; @@ -82,7 +82,7 @@ public final class UnlicensedHearse extends CardImpl { this.addAbility( new SimpleStaticAbility( Zone.ALL, - new SetPowerToughnessSourceEffect(UnlicensedHearseValue.instance, Duration.EndOfGame) + new SetBasePowerToughnessSourceEffect(UnlicensedHearseValue.instance, Duration.EndOfGame) ).addHint(hint) ); diff --git a/Mage.Sets/src/mage/cards/u/UrborgLhurgoyf.java b/Mage.Sets/src/mage/cards/u/UrborgLhurgoyf.java index 3e01b75269..7ef5a3b11f 100644 --- a/Mage.Sets/src/mage/cards/u/UrborgLhurgoyf.java +++ b/Mage.Sets/src/mage/cards/u/UrborgLhurgoyf.java @@ -5,9 +5,14 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; import mage.abilities.dynamicvalue.common.MultikickerCount; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.MillCardsControllerEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -23,6 +28,9 @@ import java.util.UUID; */ public final class UrborgLhurgoyf extends CardImpl { + private static final DynamicValue powerValue = new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE); + private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1)); + public UrborgLhurgoyf(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); @@ -43,7 +51,11 @@ public final class UrborgLhurgoyf extends CardImpl { )); // Urborg Lhurgoyf's power is equal to the number of creature cards in your graveyard and its toughness is equal to that number plus 1. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new UrborgLhurgoyfEffect())); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a, false) + .setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1") + )); } private UrborgLhurgoyf(final UrborgLhurgoyf card) { @@ -55,33 +67,3 @@ public final class UrborgLhurgoyf extends CardImpl { return new UrborgLhurgoyf(this); } } - -class UrborgLhurgoyfEffect extends ContinuousEffectImpl { - - public UrborgLhurgoyfEffect() { - super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); - staticText = "{this}'s power is equal to the number of creature cards in your graveyard and its toughness is equal to that number plus 1"; - } - - public UrborgLhurgoyfEffect(final UrborgLhurgoyfEffect effect) { - super(effect); - } - - @Override - public UrborgLhurgoyfEffect copy() { - return new UrborgLhurgoyfEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); - if (player == null || sourceObject == null) { - return false; - } - int number = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); - sourceObject.getPower().setValue(number); - sourceObject.getToughness().setValue(number + 1); - return true; - } -} diff --git a/Mage.Sets/src/mage/cards/u/UurgSpawnOfTurg.java b/Mage.Sets/src/mage/cards/u/UurgSpawnOfTurg.java index 46609797f3..800f6ddf29 100644 --- a/Mage.Sets/src/mage/cards/u/UurgSpawnOfTurg.java +++ b/Mage.Sets/src/mage/cards/u/UurgSpawnOfTurg.java @@ -11,7 +11,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,7 +39,7 @@ public final class UurgSpawnOfTurg extends CardImpl { this.toughness = new MageInt(5); // Uurg, Spawn of Turg's power is equal to the number of land cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(xValue, Duration.EndOfGame))); // At the beginning of your upkeep, look at the top card of your library. You may put that card into your graveyard. this.addAbility(new BeginningOfUpkeepTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/v/VedalkenHumiliator.java b/Mage.Sets/src/mage/cards/v/VedalkenHumiliator.java index 117bc3fadd..c2761d67e7 100644 --- a/Mage.Sets/src/mage/cards/v/VedalkenHumiliator.java +++ b/Mage.Sets/src/mage/cards/v/VedalkenHumiliator.java @@ -6,7 +6,7 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.condition.common.MetalcraftCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.continuous.LoseAllAbilitiesAllEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect; import mage.abilities.hint.common.MetalcraftHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -33,7 +33,7 @@ public final class VedalkenHumiliator extends CardImpl { // Metalcraft — Whenever Vedalken Humiliator attacks, if you control three or more artifacts, creatures your opponents control lose all abilities and have base power and toughness 1/1 until end of turn. TriggeredAbility ability = new AttacksTriggeredAbility( - new SetPowerToughnessAllEffect( + new SetBasePowerToughnessAllEffect( 1, 1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, true diff --git a/Mage.Sets/src/mage/cards/v/VeteranWarleader.java b/Mage.Sets/src/mage/cards/v/VeteranWarleader.java index 6f7a380f6f..5c61d3990f 100644 --- a/Mage.Sets/src/mage/cards/v/VeteranWarleader.java +++ b/Mage.Sets/src/mage/cards/v/VeteranWarleader.java @@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.TrampleAbility; @@ -53,7 +53,7 @@ public final class VeteranWarleader extends CardImpl { this.toughness = new MageInt(0); // Veteran Warleader's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect( CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); diff --git a/Mage.Sets/src/mage/cards/v/VhatiIlDal.java b/Mage.Sets/src/mage/cards/v/VhatiIlDal.java index 6dbe9271d1..818b5b7de4 100644 --- a/Mage.Sets/src/mage/cards/v/VhatiIlDal.java +++ b/Mage.Sets/src/mage/cards/v/VhatiIlDal.java @@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -75,7 +75,7 @@ class VhatiIlDalEffect extends OneShotEffect { } else { toughness = StaticValue.get(1); } - ContinuousEffect effect = new SetPowerToughnessTargetEffect(power, toughness, Duration.EndOfTurn); + ContinuousEffect effect = new SetBasePowerToughnessTargetEffect(power, toughness, Duration.EndOfTurn); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/v/VileAggregate.java b/Mage.Sets/src/mage/cards/v/VileAggregate.java index 7e09d009b9..6180cd4ac4 100644 --- a/Mage.Sets/src/mage/cards/v/VileAggregate.java +++ b/Mage.Sets/src/mage/cards/v/VileAggregate.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.DevoidAbility; import mage.abilities.keyword.IngestAbility; import mage.abilities.keyword.TrampleAbility; @@ -41,7 +41,7 @@ public final class VileAggregate extends CardImpl { // Devoid this.addAbility(new DevoidAbility(this.color)); // Vile Aggregate's power is equal to the number of colorless creatures you control. - Effect effect = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); + Effect effect = new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); // Trample diff --git a/Mage.Sets/src/mage/cards/v/VoiceOfTheVermin.java b/Mage.Sets/src/mage/cards/v/VoiceOfTheVermin.java index 96f1aae033..71bfe5e413 100644 --- a/Mage.Sets/src/mage/cards/v/VoiceOfTheVermin.java +++ b/Mage.Sets/src/mage/cards/v/VoiceOfTheVermin.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class VoiceOfTheVermin extends CardImpl { // Whenever Voice of the Vermin attacks, target creature you control has base power and toughness 4/4 until end of turn. Ability ability = new AttacksTriggeredAbility( - new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) + new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) ); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/v/VolrathTheShapestealer.java b/Mage.Sets/src/mage/cards/v/VolrathTheShapestealer.java index fb45ecb6ce..8d0b32815d 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathTheShapestealer.java +++ b/Mage.Sets/src/mage/cards/v/VolrathTheShapestealer.java @@ -122,8 +122,8 @@ class VolrathTheShapestealerCopyApplier extends CopyApplier { ability.addTarget(new TargetPermanent(VolrathTheShapestealer.filter)); blueprint.getAbilities().add(ability); blueprint.removePTCDA(); - blueprint.getPower().modifyBaseValue(7); - blueprint.getToughness().modifyBaseValue(5); + blueprint.getPower().setModifiedBaseValue(7); + blueprint.getToughness().setModifiedBaseValue(5); return true; } } diff --git a/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java b/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java index e9fbc8c3c6..199d1f9f51 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VolrathsShapeshifter.java @@ -74,8 +74,8 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl { return false; } - permanent.getPower().setValue(card.getPower().getValue()); - permanent.getToughness().setValue(card.getToughness().getValue()); + permanent.getPower().setModifiedBaseValue(card.getPower().getModifiedBaseValue()); + permanent.getToughness().setModifiedBaseValue(card.getToughness().getModifiedBaseValue()); permanent.getColor(game).setColor(card.getColor(game)); permanent.getManaCost().clear(); permanent.getManaCost().add(card.getManaCost().copy()); diff --git a/Mage.Sets/src/mage/cards/w/WallOfTombstones.java b/Mage.Sets/src/mage/cards/w/WallOfTombstones.java index 0839753818..31ff7ed79a 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfTombstones.java +++ b/Mage.Sets/src/mage/cards/w/WallOfTombstones.java @@ -6,7 +6,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -65,7 +65,7 @@ class WallOfTombstonesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int newToughness = CardUtil.overflowInc(1, new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE).calculate(game, source, this)); - game.addEffect(new SetToughnessSourceEffect(StaticValue.get(newToughness), Duration.Custom, SubLayer.SetPT_7b), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(null, StaticValue.get(newToughness), Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source); return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WardenOfTheFirstTree.java b/Mage.Sets/src/mage/cards/w/WardenOfTheFirstTree.java index d15e605d28..b5e1c765d3 100644 --- a/Mage.Sets/src/mage/cards/w/WardenOfTheFirstTree.java +++ b/Mage.Sets/src/mage/cards/w/WardenOfTheFirstTree.java @@ -10,7 +10,7 @@ import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.TrampleAbility; @@ -42,8 +42,8 @@ public final class WardenOfTheFirstTree extends CardImpl { Ability ability = new SimpleActivatedAbility(new AddCardSubTypeSourceEffect( Duration.Custom, SubType.HUMAN, SubType.WARRIOR ).setText("{this} becomes a Human Warrior"), new ManaCostsImpl<>("{1}{W/B}")); - ability.addEffect(new SetPowerToughnessSourceEffect( - 3, 3, Duration.Custom, SubLayer.SetPT_7b + ability.addEffect(new SetBasePowerToughnessSourceEffect( + 3, 3, Duration.Custom, SubLayer.SetPT_7b, true ).setText("with base power and toughness 3/3")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/w/WarkiteMarauder.java b/Mage.Sets/src/mage/cards/w/WarkiteMarauder.java index eeea89fde6..d23f1a5bbf 100644 --- a/Mage.Sets/src/mage/cards/w/WarkiteMarauder.java +++ b/Mage.Sets/src/mage/cards/w/WarkiteMarauder.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -43,7 +43,7 @@ public final class WarkiteMarauder extends CardImpl { // Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn. Ability ability = new AttacksTriggeredAbility(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn) .setText("target creature defending player controls loses all abilities"), false); - ability.addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn) + ability.addEffect(new SetBasePowerToughnessTargetEffect(0, 1, Duration.EndOfTurn) .setText("and has base power and toughness 0/1 until end of turn")); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/w/WayfaringTemple.java b/Mage.Sets/src/mage/cards/w/WayfaringTemple.java index 5da5e20276..40a4916550 100644 --- a/Mage.Sets/src/mage/cards/w/WayfaringTemple.java +++ b/Mage.Sets/src/mage/cards/w/WayfaringTemple.java @@ -5,7 +5,7 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.PopulateEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -29,7 +29,7 @@ public final class WayfaringTemple extends CardImpl { this.toughness = new MageInt(0); // Wayfaring Temple's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); // Whenever Wayfaring Temple deals combat damage to a player, populate. (Create a token that's a copy of a creature token you control.) diff --git a/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java b/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java index 9a834b909b..0825fa803a 100644 --- a/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java +++ b/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java @@ -6,7 +6,7 @@ import mage.abilities.common.WerewolfBackTriggeredAbility; import mage.abilities.condition.common.TransformedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.dynamicvalue.common.CardsInAllHandsCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; @@ -40,7 +40,7 @@ public final class WerewolfOfAncientHunger extends CardImpl { // Werewolf of Ancient Hunger's power and toughness are each equal to the total number of cards in all players' hands. this.addAbility(new SimpleStaticAbility(Zone.ALL, - new ConditionalContinuousEffect(new SetPowerToughnessSourceEffect(CardsInAllHandsCount.instance, Duration.EndOfGame), + new ConditionalContinuousEffect(new SetBasePowerToughnessSourceEffect(CardsInAllHandsCount.instance, Duration.EndOfGame), new TransformedCondition(false), "{this}'s power and toughness are each equal to the total number of cards in all players' hands"))); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Werewolf of Ancient Hunger. diff --git a/Mage.Sets/src/mage/cards/w/WerewolfPackLeader.java b/Mage.Sets/src/mage/cards/w/WerewolfPackLeader.java index 569b75c37e..616f5a741a 100644 --- a/Mage.Sets/src/mage/cards/w/WerewolfPackLeader.java +++ b/Mage.Sets/src/mage/cards/w/WerewolfPackLeader.java @@ -78,8 +78,8 @@ class WerewolfPackLeaderEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(5); - permanent.getToughness().setValue(3); + permanent.getPower().setModifiedBaseValue(5); + permanent.getToughness().setModifiedBaseValue(3); return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WestvaleCultLeader.java b/Mage.Sets/src/mage/cards/w/WestvaleCultLeader.java index c85df4ac89..491c524dba 100644 --- a/Mage.Sets/src/mage/cards/w/WestvaleCultLeader.java +++ b/Mage.Sets/src/mage/cards/w/WestvaleCultLeader.java @@ -5,7 +5,7 @@ import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CreaturesYouControlHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -31,7 +31,7 @@ public final class WestvaleCultLeader extends CardImpl { this.nightCard = true; // Westvale Cult Leader's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.WhileOnBattlefield)) + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)) .addHint(CreaturesYouControlHint.instance)); // At the beginning of your end step, create a 1/1 white and black Human Cleric creature token. diff --git a/Mage.Sets/src/mage/cards/w/WildShape.java b/Mage.Sets/src/mage/cards/w/WildShape.java index cf62caaa07..6923c1a1fd 100644 --- a/Mage.Sets/src/mage/cards/w/WildShape.java +++ b/Mage.Sets/src/mage/cards/w/WildShape.java @@ -106,8 +106,8 @@ class WildShapeEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(power); - permanent.getToughness().setValue(toughness); + permanent.getPower().setModifiedBaseValue(power); + permanent.getToughness().setModifiedBaseValue(toughness); return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WildernessElemental.java b/Mage.Sets/src/mage/cards/w/WildernessElemental.java index 8d691c2089..c2ba2b732d 100644 --- a/Mage.Sets/src/mage/cards/w/WildernessElemental.java +++ b/Mage.Sets/src/mage/cards/w/WildernessElemental.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,7 +35,7 @@ public final class WildernessElemental extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Wilderness Elemental's power is equal to the number of nonbasic lands your opponents control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } private WildernessElemental(final WildernessElemental card) { diff --git a/Mage.Sets/src/mage/cards/w/WillKenrith.java b/Mage.Sets/src/mage/cards/w/WillKenrith.java index acf8238397..1bcff3cdbe 100644 --- a/Mage.Sets/src/mage/cards/w/WillKenrith.java +++ b/Mage.Sets/src/mage/cards/w/WillKenrith.java @@ -8,7 +8,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.GetEmblemTargetPlayerEffect; import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect; import mage.abilities.keyword.PartnerWithAbility; import mage.cards.CardImpl; @@ -37,7 +37,7 @@ public final class WillKenrith extends CardImpl { // +2: Until your next turn, up to two target creatures each have base power and toughness 0/3 and lose all abilities. Ability ability = new LoyaltyAbility( - new SetPowerToughnessTargetEffect(0, 3, Duration.UntilYourNextTurn) + new SetBasePowerToughnessTargetEffect(0, 3, Duration.UntilYourNextTurn) .setText("until your next turn, up to two target creatures each have base power and toughness 0/3"), 2); ability.addEffect(new LoseAllAbilitiesTargetEffect(Duration.UntilYourNextTurn) .setText("and lose all abilities") diff --git a/Mage.Sets/src/mage/cards/w/WingsOfVelisVel.java b/Mage.Sets/src/mage/cards/w/WingsOfVelisVel.java index 573c1477dc..48da2f53c7 100644 --- a/Mage.Sets/src/mage/cards/w/WingsOfVelisVel.java +++ b/Mage.Sets/src/mage/cards/w/WingsOfVelisVel.java @@ -2,7 +2,7 @@ package mage.cards.w; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.GainAllCreatureTypesTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.keyword.ChangelingAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -27,7 +27,7 @@ public final class WingsOfVelisVel extends CardImpl { this.addAbility(new ChangelingAbility()); // Target creature becomes 4/4, gains all creature types, and gains flying until end of turn. - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) + this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) .setText("Until end of turn, target creature has base power and toughness 4/4")); this.getSpellAbility().addEffect(new GainAllCreatureTypesTargetEffect(Duration.EndOfTurn) .setText(", gains all creature types")); diff --git a/Mage.Sets/src/mage/cards/w/WintermoorCommander.java b/Mage.Sets/src/mage/cards/w/WintermoorCommander.java index 389a4b4c7b..8d9fcf7abf 100644 --- a/Mage.Sets/src/mage/cards/w/WintermoorCommander.java +++ b/Mage.Sets/src/mage/cards/w/WintermoorCommander.java @@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; @@ -51,7 +51,7 @@ public final class WintermoorCommander extends CardImpl { this.addAbility(DeathtouchAbility.getInstance()); // Wintermoor Commander's toughness is equal to the number of Knights you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBaseToughnessSourceEffect(xValue, Duration.EndOfGame))); // Whenever Wintermoor Commander attacks, another target Knight you control gains indestructible until end of turn. Ability ability = new AttacksTriggeredAbility(new GainAbilityTargetEffect( diff --git a/Mage.Sets/src/mage/cards/w/Withercrown.java b/Mage.Sets/src/mage/cards/w/Withercrown.java index a9f2b533e6..acc11f560d 100644 --- a/Mage.Sets/src/mage/cards/w/Withercrown.java +++ b/Mage.Sets/src/mage/cards/w/Withercrown.java @@ -10,7 +10,7 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DoUnlessControllerPaysEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.continuous.SetPowerEnchantedEffect; +import mage.abilities.effects.common.continuous.SetBasePowerEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,7 +44,7 @@ public final class Withercrown extends CardImpl { this.addAbility(ability); // Enchanted creature has base power 0 and has “At the beginning of your upkeep, you lose 1 life unless you sacrifice this creature." - Ability abilityTest = new SimpleStaticAbility(new SetPowerEnchantedEffect(0)); + Ability abilityTest = new SimpleStaticAbility(new SetBasePowerEnchantedEffect(0)); Effect effect2 = new DoUnlessControllerPaysEffect(new LoseLifeSourceControllerEffect(1), new SacrificeSourceCost(), rule); effect2.setText("you lose 1 life unless you sacrifice this creature."); diff --git a/Mage.Sets/src/mage/cards/w/WitnessProtection.java b/Mage.Sets/src/mage/cards/w/WitnessProtection.java index 397067180a..12e200c99d 100644 --- a/Mage.Sets/src/mage/cards/w/WitnessProtection.java +++ b/Mage.Sets/src/mage/cards/w/WitnessProtection.java @@ -92,8 +92,8 @@ class WitnessProtectionEffect extends ContinuousEffectImpl { return true; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); + permanent.getPower().setModifiedBaseValue(1); + permanent.getToughness().setModifiedBaseValue(1); } } return true; diff --git a/Mage.Sets/src/mage/cards/w/WoodElemental.java b/Mage.Sets/src/mage/cards/w/WoodElemental.java index 3fa2db3542..abfa7bf1e9 100644 --- a/Mage.Sets/src/mage/cards/w/WoodElemental.java +++ b/Mage.Sets/src/mage/cards/w/WoodElemental.java @@ -8,7 +8,7 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -95,7 +95,7 @@ class WoodElementalEffect extends OneShotEffect { targetPermanent.sacrifice(source, game); } } - game.addEffect(new SetPowerToughnessSourceEffect(sacrificedForests, sacrificedForests, Duration.Custom, SubLayer.SetPT_7b), source); + game.addEffect(new SetBasePowerToughnessSourceEffect(sacrificedForests, sacrificedForests, Duration.Custom, SubLayer.SetPT_7b), source); return true; } } diff --git a/Mage.Sets/src/mage/cards/w/WoodlurkerMimic.java b/Mage.Sets/src/mage/cards/w/WoodlurkerMimic.java index 93d15f85cb..3018bd9089 100644 --- a/Mage.Sets/src/mage/cards/w/WoodlurkerMimic.java +++ b/Mage.Sets/src/mage/cards/w/WoodlurkerMimic.java @@ -7,7 +7,7 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -44,7 +44,7 @@ public final class WoodlurkerMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both black and green, Woodlurker Mimic has base power and toughness 4/5 until end of turn and gains wither until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 5, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetBasePowerToughnessSourceEffect(4, 5, Duration.EndOfTurn, SubLayer.SetPT_7b, true), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(WitherAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/w/WorkshopElders.java b/Mage.Sets/src/mage/cards/w/WorkshopElders.java index db4284c9a6..c71f45f2eb 100644 --- a/Mage.Sets/src/mage/cards/w/WorkshopElders.java +++ b/Mage.Sets/src/mage/cards/w/WorkshopElders.java @@ -6,7 +6,7 @@ import mage.abilities.common.BeginningOfCombatTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -54,7 +54,7 @@ public final class WorkshopElders extends CardImpl { Ability ability = new BeginningOfCombatTriggeredAbility(new AddCardTypeTargetEffect( Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE ).setText("target noncreature artifact you control become a 0/0 artifact creature"), TargetController.YOU, true); - ability.addEffect(new SetPowerToughnessTargetEffect( + ability.addEffect(new SetBasePowerToughnessTargetEffect( 0, 0, Duration.EndOfGame ).setText("If you do")); ability.addEffect(new AddCountersTargetEffect( diff --git a/Mage.Sets/src/mage/cards/w/Wurmcalling.java b/Mage.Sets/src/mage/cards/w/Wurmcalling.java index e07654d52f..6a492aa729 100644 --- a/Mage.Sets/src/mage/cards/w/Wurmcalling.java +++ b/Mage.Sets/src/mage/cards/w/Wurmcalling.java @@ -52,8 +52,8 @@ class WurmcallingEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { int count = source.getManaCostsToPay().getX(); WurmCallingWurmToken token = new WurmCallingWurmToken(); - token.getPower().modifyBaseValue(count); - token.getToughness().modifyBaseValue(count); + token.setPower(count); + token.setToughness(count); token.putOntoBattlefield(1, game, source, source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java b/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java index 8abe976c0c..ffd570effa 100644 --- a/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java +++ b/Mage.Sets/src/mage/cards/x/XenicPoltergeist.java @@ -114,8 +114,8 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId); if (permanent != null) { int manaCost = permanent.getManaValue(); - permanent.getPower().setValue(manaCost); - permanent.getToughness().setValue(manaCost); + permanent.getPower().setModifiedBaseValue(manaCost); + permanent.getToughness().setModifiedBaseValue(manaCost); } } } diff --git a/Mage.Sets/src/mage/cards/y/YavimayaKavu.java b/Mage.Sets/src/mage/cards/y/YavimayaKavu.java index b8eea53944..31b461b946 100644 --- a/Mage.Sets/src/mage/cards/y/YavimayaKavu.java +++ b/Mage.Sets/src/mage/cards/y/YavimayaKavu.java @@ -6,8 +6,8 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; -import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -39,9 +39,9 @@ public final class YavimayaKavu extends CardImpl { // Yavimaya Kavu's power is equal to the number of red creatures on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filterRedCreature), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filterRedCreature), Duration.EndOfGame))); // Yavimaya Kavu's toughness is equal to the number of green creatures on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterGreenCreature), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBaseToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterGreenCreature), Duration.EndOfGame))); } private YavimayaKavu(final YavimayaKavu card) { diff --git a/Mage.Sets/src/mage/cards/y/YotiaDeclaresWar.java b/Mage.Sets/src/mage/cards/y/YotiaDeclaresWar.java index ad36b3a804..7ef24fb411 100644 --- a/Mage.Sets/src/mage/cards/y/YotiaDeclaresWar.java +++ b/Mage.Sets/src/mage/cards/y/YotiaDeclaresWar.java @@ -8,7 +8,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -53,7 +53,7 @@ public final class YotiaDeclaresWar extends CardImpl { new Effects( new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE) .setText("p to one target artifact you control becomes an artifact creature"), - new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfTurn) + new SetBasePowerToughnessTargetEffect(5, 5, Duration.EndOfTurn) .setText("with base power and toughness 4/4 until end of turn") ), new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT) ); diff --git a/Mage.Sets/src/mage/cards/z/ZendikarIncarnate.java b/Mage.Sets/src/mage/cards/z/ZendikarIncarnate.java index 19f9c36b70..d501f6a227 100644 --- a/Mage.Sets/src/mage/cards/z/ZendikarIncarnate.java +++ b/Mage.Sets/src/mage/cards/z/ZendikarIncarnate.java @@ -6,7 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -33,7 +33,7 @@ public final class ZendikarIncarnate extends CardImpl { DynamicValue controlledLands = new PermanentsOnBattlefieldCount(filter); // Zendikar Incarnate's power is equal to the amount of lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(controlledLands, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(controlledLands, Duration.EndOfGame))); } private ZendikarIncarnate(final ZendikarIncarnate card) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SetPowerToughnessTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SetPowerToughnessTest.java new file mode 100644 index 0000000000..057d84d47b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SetPowerToughnessTest.java @@ -0,0 +1,180 @@ +package org.mage.test.cards.continuous; + +import mage.abilities.keyword.FlyingAbility; +import mage.cards.h.HalimarTidecaller; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * Check that effects which increase the base PT interact correctly with effects which boost PT. + * And check that the test functions created to read both base and boosted values work correctly. + * + * @author Alex-Vasile + */ +public class SetPowerToughnessTest extends CardTestPlayerBase { + // {U} + // Enchanted creature gets +1/+1 and has flying. + private static final String arcaneFlight = "Arcane Flight"; + // {X}{G/U}{G/U} + // Creatures you control have base power and toughness X/X until end of turn. + private static final String biomassMutation = "Biomass Mutation"; + private static final String lion = "Silvercoat Lion"; + + /** + * Test that for a boosted creature, both base and the boosted power and toughness are correctly measured + */ + @Test + public void testBoostedVsBasePT() { + addCard(Zone.BATTLEFIELD, playerA, lion); + addCard(Zone.BATTLEFIELD, playerA, "Island"); + addCard(Zone.HAND, playerA, arcaneFlight); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, arcaneFlight); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + assertBasePowerToughness(playerA, lion, 2, 2); + assertPowerToughness(playerA, lion, 3, 3); + } + + /** + * Test that base power effects work properly with +1/+1 and -1/-1 counters + */ + @Test + public void testBaseChangeAndCounter() { + // {B}{B} + // When Ancestral Vengeance enters the battlefield, put a +1/+1 counter on target creature you control. + // Enchanted creature gets -1/-1. + String ancestralVengeance = "Ancestral Vengeance"; + // 4/4 + String airElemental = "Air Elemental"; + + addCard(Zone.HAND, playerA, ancestralVengeance); + addCard(Zone.HAND, playerA, biomassMutation); + addCard(Zone.BATTLEFIELD, playerA, lion); // 2/2 + addCard(Zone.BATTLEFIELD, playerA, airElemental); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Zone.BATTLEFIELD, playerA, "Island", 7); + + setStrictChooseMode(true); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ancestralVengeance); + addTarget(playerA, airElemental); // decrease from 4/4 to a 3/3 + addTarget(playerA, lion); // Boost from 2/2 to a 3/3 + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + assertBasePowerToughness(playerA, lion, 2, 2); + assertPowerToughness(playerA, lion, 3, 3); // 2/2 + +1/+1 + assertBasePowerToughness(playerA, airElemental, 4, 4); + assertPowerToughness(playerA, airElemental, 3, 3); // 3/3 + -1/-1 + + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, biomassMutation); + setChoice(playerA, "X=5"); // Everyone should have base P/T of 5/5 + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertBasePowerToughness(playerA, lion, 5, 5); + assertPowerToughness(playerA, lion, 6, 6); + assertBasePowerToughness(playerA, airElemental, 5, 5); + assertPowerToughness(playerA, airElemental, 4, 4); + } + + /** + * Test that base PT change effects lasts between turns if they're supposed to. + */ + @Test + public void testBaseChangeLasts() { + // {1}{U} + // Enchanted artifact is a creature with base power and toughness 5/5 in addition to its other types. + String ensoulArtifact = "Ensoul Artifact"; + String solRing = "Sol Ring"; + // Destroy target artifact, enchantment, or creature with flying. + String brokenWing = "Broken Wings"; + + addCard(Zone.HAND, playerA, ensoulArtifact); + addCard(Zone.HAND, playerA, arcaneFlight); + addCard(Zone.HAND, playerA, brokenWing); + addCard(Zone.BATTLEFIELD, playerA, solRing); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ensoulArtifact); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, arcaneFlight); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + assertPowerToughness(playerA, solRing, 6, 6); + assertBasePowerToughness(playerA, solRing, 5, 5); + assertAbility(playerA, solRing, FlyingAbility.getInstance(), true); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); // wait two turns and make sure it keeps working + execute(); + assertPowerToughness(playerA, solRing, 6, 6); + assertBasePowerToughness(playerA, solRing, 5, 5); + assertAbility(playerA, solRing, FlyingAbility.getInstance(), true); + + castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, brokenWing, ensoulArtifact); + setStopAt(5, PhaseStep.PRECOMBAT_MAIN); + execute(); + + // Remove Ensoul Artifact, and have Arcane Flight fall off, and check that the Sol Ring goes back to 0/0 + assertPowerToughness(playerA, solRing, 0, 0); + assertBasePowerToughness(playerA, solRing, 0, 0); + assertAbility(playerA, solRing, FlyingAbility.getInstance(), false); + } + + /** + * Test that base PT change effects are properly reset between turns. + */ + @Test + public void testBaseChangePTResets() { + addCard(Zone.HAND, playerA, biomassMutation); + addCard(Zone.HAND, playerA, arcaneFlight); + + addCard(Zone.BATTLEFIELD, playerA, lion); + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, arcaneFlight); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, biomassMutation); + setChoice(playerA, "X=1"); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + assertBasePowerToughness(playerA, lion, 1, 1); + assertPowerToughness(playerA, lion, 2, 2); + + setStopAt(2, PhaseStep.PRECOMBAT_MAIN); + execute(); + assertBasePowerToughness(playerA, lion, 2, 2); + assertPowerToughness(playerA, lion, 3, 3); + } + + /** + * Test that BecomesCreatureAttachedEffect works properly + */ + @Test + public void becomesTokenWorks() { + // {2}{W} + // Enchant creature + // Enchanted creature loses all abilities and is a blue Fish with base power and toughness 0/1. + String ichthyomorphosis = "Ichthyomorphosis"; + + addCard(Zone.HAND, playerA, ichthyomorphosis); + addCard(Zone.BATTLEFIELD, playerA, lion); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ichthyomorphosis, lion); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertBasePowerToughness(playerA, lion, 0, 1); + assertPowerToughness(playerA, lion, 0, 1); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/IdentityThiefTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/IdentityThiefTest.java index d9e902987a..6d0be33427 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/IdentityThiefTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/IdentityThiefTest.java @@ -28,14 +28,15 @@ public class IdentityThiefTest extends CardTestPlayerBase { // Return the exiled card to the battlefield under its owner's control at the beginning of the next end step. addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U} + setStrictChooseMode(true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Molten Sentry"); setFlipCoinResult(playerA, true); attack(2, playerB, "Identity Thief"); - setChoice(playerB, true); addTarget(playerB, "Molten Sentry"); + setChoice(playerB, true); - setStrictChooseMode(true); setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); @@ -57,21 +58,29 @@ public class IdentityThiefTest extends CardTestPlayerBase { // Return the exiled card to the battlefield under its owner's control at the beginning of the next end step. addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U} + setStrictChooseMode(true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Primal Clay"); + setChoice(playerA, "a 3/3 artifact creature"); attack(2, playerB, "Identity Thief"); + setChoice(playerB, "Yes"); addTarget(playerB, "Primal Clay"); setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); - assertExileCount(playerA, 1); - assertExileCount("Primal Clay", 1); + assertExileCount(playerA, "Primal Clay", 1); assertPermanentCount(playerB, "Identity Thief", 0); assertPermanentCount(playerB, "Primal Clay", 1); + assertPowerToughness(playerB, "Primal Clay", 3, 3); } + /** + * Reported bug: https://github.com/magefree/mage/issues/2131 + * If I copy a creature with a +1/+1 counter on it, it copies the counter as well as the other stats. This should not be the case. + */ @Test public void testShouldNotCopyP1P1Counters() { addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // {1}{G} 2/3 vigilance @@ -99,6 +108,6 @@ public class IdentityThiefTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Identity Thief", 0); assertPermanentCount(playerB, "Sylvan Advocate", 1); assertCounterCount(playerB, "Sylvan Advocate", CounterType.P1P1, 0); - assertPowerToughness(playerB, "Sylvan Advocate", 2, 3); // finds it with 3 power 4 toughness + assertPowerToughness(playerB, "Sylvan Advocate", 2, 3); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/SoulSeparatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/SoulSeparatorTest.java index e41f8d74ad..5cc4ec24b9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/SoulSeparatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/SoulSeparatorTest.java @@ -48,8 +48,9 @@ public class SoulSeparatorTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Sylvan Advocate", 1, 1); } - // Reported bug: Exiled Tree of Perdition with Soul Separator - // The token copy when activated reduced the opponent's life total to 13 (tree toughness) instead of 1 (1/1 token) + // Reported bug: https://github.com/magefree/mage/issues/2174 + // Exiled Tree of Perdition with Soul Separator + // The token copy when activated reduced the opponent's life total to 13 (tree toughness) instead of 1 (1/1 token) @Test public void testExileTreeOfPerdition() { // Soul Separator {3} Artifact diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/TreeOfPerditionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/TreeOfPerditionTest.java index e4ce159c71..ca6bd284e5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/TreeOfPerditionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/TreeOfPerditionTest.java @@ -18,9 +18,10 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class TreeOfPerditionTest extends CardTestPlayerBase { /** - * Reported bug: Tree of Perdition retains toughness change after being bounced and replayed - * Exchanged toughness with opponent's life to become an 0/20, got bounced, - * and when replayed it was still 0/20. It should be a new object and enter as an 0/13. + * Reported bug: https://github.com/magefree/mage/issues/2101 + * Tree of Perdition retains toughness change after being bounced and replayed + * Exchanged toughness with opponent's life to become an 0/20, got bounced, + * and when replayed it was still 0/20. It should be a new object and enter as an 0/13. */ @Test public void testTreeOfPerditionBouncedAndReplayed() { @@ -45,8 +46,9 @@ public class TreeOfPerditionTest extends CardTestPlayerBase { } /** - * Reported bug: Tree of Perdition is gaining both power and toughness equal to opponent's life total - * instead of just toughness equal to it. + * Reported bug: + * Tree of Perdition is gaining both power and toughness equal to opponent's life total + * instead of just toughness equal to it. */ @Test public void testTreeOfPerditionOnlyGainsToughnessEqualToLife() { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java index 23b4746827..8dde02167a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java @@ -117,24 +117,28 @@ public interface CardTestAPI { void assertLife(Player player, int life) throws AssertionError; /** + * * Assert creature's power and toughness by card name. *

- * Throws {@link AssertionError} in the following cases: 1. no such player - * 2. no such creature under player's control 3. depending on comparison - * scope: 3a. any: no creature under player's control with the specified p\t - * params 3b. all: there is at least one creature with the cardName with the - * different p\t params + * Throws {@link AssertionError} in the following cases: + * 1. no such player + * 2. no such creature under player's control + * 3. depending on comparison scope: + * 3a. any: no creature under player's control with the specified p\t params + * 3b. all: there is at least one creature with the cardName with the different p\t params * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. + * @param power Expected power to compare with. * @param toughness Expected toughness to compare with. - * @param scope {@link Filter.ComparisonScope} Use ANY, if you want "at - * least one creature with given name should have specified p\t" Use ALL, if - * you want "all creature with gived name should have specified p\t" + * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if + * you want "at least one creature with given name should + * have specified p\t" Use ALL, if you want "all creature + * with given name should have specified p\t" + * @param base If true, the comparison looks that base power and toughness of the creature. + * If false, the comparison looks at the final values. */ - void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) - throws AssertionError; + public void assertPowerToughness(Player player, String cardName, int powerNeeded, int toughnessNeeded, Filter.ComparisonScope scope, boolean checkBaseValues) throws AssertionError; /** * Assert creature's abilities. diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java deleted file mode 100644 index 4874dca392..0000000000 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java +++ /dev/null @@ -1,372 +0,0 @@ -package org.mage.test.serverside.base.impl; - -import mage.abilities.Ability; -import mage.cards.Card; -import mage.cards.repository.CardInfo; -import mage.cards.repository.CardRepository; -import mage.constants.PhaseStep; -import mage.constants.Zone; -import mage.filter.Filter; -import mage.game.permanent.Permanent; -import mage.game.permanent.PermanentCard; -import mage.players.Player; -import org.junit.Assert; -import org.mage.test.player.TestPlayer; -import org.mage.test.serverside.base.CardTestAPI; -import org.mage.test.serverside.base.MageTestBase; - -import java.util.List; -import java.util.UUID; - -/** - * API for test initialization and asserting the test results. - * - * @author ayratn - */ -public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAPI { - /** - * Removes all cards from player's library from the game. - * Usually this should be used once before initialization to form the library in certain order. - * - * @param player {@link Player} to remove all library cards from. - */ - public void removeAllCardsFromLibrary(Player player) { - if (player.equals(playerA)) { - commandsA.put(Zone.LIBRARY, "clear"); - } else if (player.equals(playerB)) { - commandsB.put(Zone.LIBRARY, "clear"); - } - } - - /** - * Add a card to specified zone of specified player. - * - * @param gameZone {@link mage.constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - */ - @Override - public void addCard(Zone gameZone, TestPlayer player, String cardName) { - addCard(gameZone, player, cardName, 1, false); - } - - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link mage.constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - */ - @Override - public void addCard(Zone gameZone, TestPlayer player, String cardName, int count) { - addCard(gameZone, player, cardName, count, false); - } - - /** - * Add any amount of cards to specified zone of specified player. - * - * @param gameZone {@link mage.constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. - * @param cardName Card name in string format. - * @param count Amount of cards to be added. - * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. - * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown - */ - @Override - public void addCard(Zone gameZone, TestPlayer player, String cardName, int count, boolean tapped) { - - - if (gameZone == Zone.BATTLEFIELD) { - for (int i = 0; i < count; i++) { - CardInfo cardInfo = CardRepository.instance.findCard(cardName); - Card card = cardInfo != null ? cardInfo.getCard() : null; - if (card == null) { - throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName); - } - PermanentCard p = new PermanentCard(card, null, currentGame); - p.setTapped(tapped); - if (player.equals(playerA)) { - battlefieldCardsA.add(p); - } else if (player.equals(playerB)) { - battlefieldCardsB.add(p); - } - } - } else { - if (tapped) { - throw new IllegalArgumentException("Parameter tapped=true can be used only for Zone.BATTLEFIELD."); - } - List cards = getCardList(gameZone, player); - for (int i = 0; i < count; i++) { - CardInfo cardInfo = CardRepository.instance.findCard(cardName); - Card card = cardInfo != null ? cardInfo.getCard() : null; - cards.add(card); - } - } - } - - /** - * Returns card list containter for specified game zone and player. - * - * @param gameZone - * @param player - * @return - */ - private List getCardList(Zone gameZone, Player player) { - if (player.equals(playerA)) { - if (gameZone == Zone.HAND) { - return handCardsA; - } else if (gameZone == Zone.GRAVEYARD) { - return graveyardCardsA; - } else if (gameZone == Zone.LIBRARY) { - return libraryCardsA; - } - } else if (player.equals(playerB)) { - if (gameZone == Zone.HAND) { - return handCardsB; - } else if (gameZone == Zone.GRAVEYARD) { - return graveyardCardsB; - } else if (gameZone == Zone.LIBRARY) { - return libraryCardsB; - } - } - return null; - } - - /** - * Set player's initial life count. - * - * @param player {@link Player} to set life count for. - * @param life Life count to set. - */ - @Override - public void setLife(TestPlayer player, int life) { - if (player.equals(playerA)) { - commandsA.put(Zone.OUTSIDE, "life:" + life); - } else if (player.equals(playerB)) { - commandsB.put(Zone.OUTSIDE, "life:" + life); - } - } - - /** - * Define turn number to stop the game on. - */ - @Override - public void setStopOnTurn(int turn) { - stopOnTurn = turn == -1 ? null : turn; - stopAtStep = PhaseStep.UNTAP; - } - - /** - * Define turn number and step to stop the game on. - */ - @Override - public void setStopAt(int turn, PhaseStep step) { - stopOnTurn = turn == -1 ? null : turn; - stopAtStep = step; - } - - /** - * Assert turn number after test execution. - * - * @param turn Expected turn number to compare with. 1-based. - */ - @Override - public void assertTurn(int turn) throws AssertionError { - Assert.assertEquals("Turn numbers are not equal", turn, currentGame.getTurnNum()); - } - - /** - * Assert game result after test execution. - * - * @param result Expected {@link GameResult} to compare with. - */ - @Override - public void assertResult(Player player, GameResult result) throws AssertionError { - if (player.equals(playerA)) { - GameResult actual = CardTestAPI.GameResult.DRAW; - switch (currentGame.getWinner()) { - case "Player PlayerA is the winner": - actual = CardTestAPI.GameResult.WON; - break; - case "Player PlayerB is the winner": - actual = CardTestAPI.GameResult.LOST; - break; - } - Assert.assertEquals("Game results are not equal", result, actual); - } else if (player.equals(playerB)) { - GameResult actual = CardTestAPI.GameResult.DRAW; - switch (currentGame.getWinner()) { - case "Player PlayerB is the winner": - actual = CardTestAPI.GameResult.WON; - break; - case "Player PlayerA is the winner": - actual = CardTestAPI.GameResult.LOST; - break; - } - Assert.assertEquals("Game results are not equal", result, actual); - } - } - - /** - * Assert player's life count after test execution. - * - * @param player {@link Player} to get life for comparison. - * @param life Expected player's life to compare with. - */ - @Override - public void assertLife(Player player, int life) throws AssertionError { - int actual = currentGame.getPlayer(player.getId()).getLife(); - Assert.assertEquals("Life amounts are not equal", life, actual); - } - - /** - * Assert creature's power and toughness by card name. - *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. depending on comparison scope: - * 3a. any: no creature under player's control with the specified p\t params - * 3b. all: there is at least one creature with the cardName with the different p\t params - * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. - * @param toughness Expected toughness to compare with. - * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" - * Use ALL, if you want "all creature with gived name should have specified p\t" - */ - @Override - public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) - throws AssertionError { - int count = 0; - int fit = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - count++; - if (scope == Filter.ComparisonScope.All) { - Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ')', - power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ')', - toughness, permanent.getToughness().getValue()); - } else if (scope == Filter.ComparisonScope.Any) { - if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { - fit++; - break; - } - } - } - } - - Assert.assertTrue("There is no such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, count > 0); - - if (scope == Filter.ComparisonScope.Any) { - Assert.assertTrue("There is no such creature under player's control with specified power&toughness, player=" + player.getName() + - ", cardName=" + cardName, fit > 0); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void assertAbilities(Player player, String cardName, List abilities) - throws AssertionError { - int count = 0; - Permanent found = null; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { - if (permanent.getName().equals(cardName)) { - found = permanent; - } - } - - Assert.assertNotNull("There is no such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, found); - - Assert.assertTrue("There is more than one such permanent under player's control, player=" + player.getName() + - ", cardName=" + cardName, count == 1); - - for (Ability ability : abilities) { - Assert.assertTrue("No such ability=" + ability.toString() + ", player=" + player.getName() + - ", cardName=" + cardName, found.getAbilities().contains(ability)); - } - } - - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param count Expected count. - */ - @Override - public void assertPermanentCount(Player player, int count) throws AssertionError { - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - actualCount++; - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal ", count, actualCount); - } - - /** - * Assert permanent count under player's control. - * - * @param player {@link Player} which permanents should be counted. - * @param cardName Name of the cards that should be counted. - * @param count Expected count. - */ - @Override - public void assertPermanentCount(Player player, String cardName, int count) throws AssertionError { - int actualCount = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(player.getId())) { - if (permanent.getName().equals(cardName)) { - actualCount++; - } - } - } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ')', count, actualCount); - } - - public Permanent getPermanent(String cardName, UUID controller) { - Permanent permanent0 = null; - int count = 0; - for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (permanent.getControllerId().equals(controller)) { - if (permanent.getName().equals(cardName)) { - permanent0 = permanent; - count++; - } - } - } - Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); - Assert.assertEquals("More than one permanent was found: " + cardName + '(' + count + ')', 1, count); - return permanent0; - } - - public void playLand(Player player, String cardName) { - player.addAction("play:" + cardName); - } - - public void castSpell(Player player, String cardName) { - player.addAction("cast:" + cardName); - } - - public void addFixedTarget(Player player, String cardName, Player target) { - player.addAction("cast:" + cardName + ";name=" + target.getName()); - } - - public void addFixedTarget(Player player, String cardName, String targetName) { - player.addAction("cast:" + cardName + ";name=" + targetName); - } - - public void useAbility(Player player, String cardName) { - } - - public void attack(Player player, String cardName) { - player.addAction("attack:" + cardName); - } -} 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 7a96b12af7..c8aeb94461 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 @@ -776,27 +776,8 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertEquals("Life amounts are not equal for player " + player.getName(), life, actual); } - /** - * Assert creature's power and toughness by card name. - *

- * Throws {@link AssertionError} in the following cases: 1. no such player - * 2. no such creature under player's control 3. depending on comparison - * scope: 3a. any: no creature under player's control with the specified p\t - * params 3b. all: there is at least one creature with the cardName with the - * different p\t params - * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. - * @param toughness Expected toughness to compare with. - * @param scope {@link mage.filter.Filter.ComparisonScope} Use ANY, if - * you want "at least one creature with given name should - * have specified p\t" Use ALL, if you want "all creature - * with given name should have specified p\t" - */ @Override - public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) - throws AssertionError { + public void assertPowerToughness(Player player, String cardName, int powerNeeded, int toughnessNeeded, Filter.ComparisonScope scope, boolean checkBaseValues) throws AssertionError { //Assert.assertNotEquals("", cardName); int count = 0; int fit = 0; @@ -804,22 +785,26 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement int foundToughness = 0; int found = 0; for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { - if (isObjectHaveTargetNameOrAlias(player, permanent, cardName) && permanent.getControllerId().equals(player.getId())) { - count++; - if (scope == Filter.ComparisonScope.All) { - Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ')', - power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ')', - toughness, permanent.getToughness().getValue()); - } else if (scope == Filter.ComparisonScope.Any) { - if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { - fit++; - break; - } - found++; - foundPower = permanent.getPower().getValue(); - foundToughness = permanent.getToughness().getValue(); + if (!isObjectHaveTargetNameOrAlias(player, permanent, cardName) || !permanent.getControllerId().equals(player.getId())) { + continue; + } + int powerFound = checkBaseValues ? permanent.getPower().getModifiedBaseValue() : permanent.getPower().getValue(); + int toughnessFound = checkBaseValues ? permanent.getToughness().getModifiedBaseValue() : permanent.getToughness().getValue(); + + count++; + if (scope == Filter.ComparisonScope.All) { + Assert.assertEquals((checkBaseValues ? "Base power" : "Power") + " is not the same (" + powerNeeded + " vs. " + powerFound + ')', + powerNeeded, powerFound); + Assert.assertEquals((checkBaseValues ? "Base toughness" : "Toughness") + " is not the same (" + toughnessNeeded + " vs. " + toughnessFound + ')', + toughnessNeeded, toughnessFound); + } else if (scope == Filter.ComparisonScope.Any) { + if (powerNeeded == powerFound && toughnessNeeded == toughnessFound) { + fit++; + break; } + found++; + foundPower = powerFound; + foundToughness = toughnessFound; } } @@ -827,24 +812,25 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement + ", cardName=" + cardName, count > 0); if (scope == Filter.ComparisonScope.Any) { - assertTrue("There is no such creature under player's control with specified p/t of " + power + '/' + toughness + ", player=" + player.getName() + assertTrue("There is no such creature under player's control with specified" + (checkBaseValues ? " base " : ' ') + "p/t of " + powerNeeded + '/' + toughnessNeeded + ", player=" + player.getName() + ", cardName=" + cardName + " (found similar: " + found + ", one of them: power=" + foundPower + " toughness=" + foundToughness + ')', fit > 0); } } - /** - * See - * {@link #assertPowerToughness(mage.players.Player, String, int, int, mage.filter.Filter.ComparisonScope)} - * - * @param player - * @param cardName - * @param power - * @param toughness - */ - public void assertPowerToughness(Player player, String cardName, int power, int toughness) { - assertPowerToughness(player, cardName, power, toughness, Filter.ComparisonScope.Any); + public void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) { + assertPowerToughness(player, cardName, power, toughness, scope, false); } + public void assertPowerToughness(Player player, String cardName, int powerNeeded, int toughnessNeeded) { + assertPowerToughness(player, cardName, powerNeeded, toughnessNeeded, Filter.ComparisonScope.Any, false); + } + + public void assertBasePowerToughness(Player player, String cardName, int powerNeeded, int toughnessNeeded) { + assertPowerToughness(player, cardName, powerNeeded, toughnessNeeded, Filter.ComparisonScope.Any, true); + } + + + /** * {@inheritDoc} */ diff --git a/Mage/src/main/java/mage/MageInt.java b/Mage/src/main/java/mage/MageInt.java index 1faf335299..49ff7136f8 100644 --- a/Mage/src/main/java/mage/MageInt.java +++ b/Mage/src/main/java/mage/MageInt.java @@ -6,6 +6,9 @@ import mage.util.Copyable; import java.io.Serializable; import java.util.Objects; +/** + * Wrapper class for the Integer used to represent power and toughness. + */ public class MageInt implements Serializable, Copyable { public static final MageInt EmptyMageInt = new MageInt(Integer.MIN_VALUE, "") { @@ -13,38 +16,39 @@ public class MageInt implements Serializable, Copyable { private static final String exceptionMessage = "MageInt.EmptyMageInt can't be modified."; @Override - public void boostValue(int amount) { + public void increaseBoostedValue(int amount) { throw new RuntimeException(exceptionMessage); } @Override - public void setValue(int value) { + public void setBoostedValue(int value) { throw new RuntimeException(exceptionMessage); } }; - protected int baseValue; - protected int baseValueModified; + // The original P/T value, can never change + protected final int baseValue; + // The current base value. Can be changed by effects such as Biomass Mutation + protected int modifiedBaseValue; + // The curent final value: current base + any modifications (e.g. +1/+1 counters or "creature gets +1/+1") protected int boostedValue; - protected String cardValue = ""; + // String representation of the current base value, update automatically + protected String cardValue; public MageInt(int value) { - this.baseValue = value; - this.baseValueModified = baseValue; - this.boostedValue = baseValue; - this.cardValue = Integer.toString(value); + this(value, Integer.toString(value)); } public MageInt(int baseValue, String cardValue) { this.baseValue = baseValue; - this.baseValueModified = baseValue; - this.boostedValue = baseValue; + this.modifiedBaseValue = this.baseValue; + this.boostedValue = this.baseValue; this.cardValue = cardValue; } public MageInt(int baseValue, int baseValueModified, int boostedValue, String cardValue) { this.baseValue = baseValue; - this.baseValueModified = baseValueModified; + this.modifiedBaseValue = baseValueModified; this.boostedValue = boostedValue; this.cardValue = cardValue; } @@ -54,42 +58,41 @@ public class MageInt implements Serializable, Copyable { if (Objects.equals(this, EmptyMageInt)) { return this; } - return new MageInt(baseValue, baseValueModified, boostedValue, cardValue); + return new MageInt(baseValue, modifiedBaseValue, boostedValue, cardValue); } public int getBaseValue() { return baseValue; } - public int getBaseValueModified() { - return baseValueModified; + public int getModifiedBaseValue() { + return modifiedBaseValue; } public int getValue() { return boostedValue; } - public void modifyBaseValue(int value) { - this.baseValueModified = value; + public void setModifiedBaseValue(int value) { + this.modifiedBaseValue = value; this.boostedValue = value; this.cardValue = Integer.toString(value); } - public void setValue(int value) { + public void setBoostedValue(int value) { this.boostedValue = value; } - public void boostValue(int amount) { + public void increaseBoostedValue(int amount) { this.boostedValue = CardUtil.overflowInc(this.boostedValue, amount); } public void resetToBaseValue() { - this.boostedValue = this.baseValueModified; + setModifiedBaseValue(this.baseValue); } @Override public String toString() { return cardValue; } - } 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 f4a585a761..dfc1334244 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyEffect.java @@ -130,8 +130,8 @@ public class CopyEffect extends ContinuousEffectImpl { // Primal Clay example: // If a creature that’s already on the battlefield becomes a copy of this creature, it copies the power, toughness, // and abilities that were chosen for this creature as it entered the battlefield. (2018-03-16) - permanent.getPower().setValue(copyFromObject.getPower().getBaseValueModified()); - permanent.getToughness().setValue(copyFromObject.getToughness().getBaseValueModified()); + permanent.getPower().setModifiedBaseValue(copyFromObject.getPower().getModifiedBaseValue()); + permanent.getToughness().setModifiedBaseValue(copyFromObject.getToughness().getModifiedBaseValue()); permanent.setStartingLoyalty(copyFromObject.getStartingLoyalty()); if (copyFromObject instanceof Permanent) { Permanent targetPermanent = (Permanent) copyFromObject; 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 cdb21f57a2..ba69764696 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyTokenEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyTokenEffect.java @@ -41,9 +41,9 @@ public class CopyTokenEffect extends ContinuousEffectImpl { for (Ability ability : token.getAbilities()) { permanent.addAbility(ability, source.getSourceId(), game); } - permanent.getPower().setValue(token.getPower().getValue()); - permanent.getToughness().setValue(token.getToughness().getValue()); - //permanent.getLoyalty().setValue(card.getLoyalty().getValue()); + permanent.getPower().setModifiedBaseValue(token.getPower().getModifiedBaseValue()); + permanent.getToughness().setModifiedBaseValue(token.getToughness().getModifiedBaseValue()); + //permanent.getLoyalty().setBoostedValue(card.getLoyalty().getValue()); return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java index a115c75b64..87b77585c1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java @@ -224,11 +224,11 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect { } if (tokenPower != Integer.MIN_VALUE) { token.removePTCDA(); - token.getPower().modifyBaseValue(tokenPower); + token.setPower(tokenPower); } if (tokenToughness != Integer.MIN_VALUE) { token.removePTCDA(); - token.getToughness().modifyBaseValue(tokenToughness); + token.setToughness(tokenToughness); } if (onlySubType != null) { token.removeAllCreatureTypes(); 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 065485cef8..1c044e1285 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 @@ -140,8 +140,8 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { int power = token.getPower().getValue(); int toughness = token.getToughness().getValue(); if (power != 0 && toughness != 0) { - permanent.getPower().setValue(power); - permanent.getToughness().setValue(toughness); + permanent.getPower().setModifiedBaseValue(power); + permanent.getToughness().setModifiedBaseValue(toughness); } } break; 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 dc134720fd..6a0728fb7d 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 @@ -119,8 +119,8 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(token.getPower().getValue()); - permanent.getToughness().setValue(token.getToughness().getValue()); + permanent.getPower().setModifiedBaseValue(token.getPower().getValue()); + permanent.getToughness().setModifiedBaseValue(token.getToughness().getValue()); } break; } 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 6b67d4d302..5dd4f10f94 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 @@ -123,14 +123,14 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements if ((sublayer == SubLayer.CharacteristicDefining_7a && isCharacterDefining()) || (sublayer == SubLayer.SetPT_7b && !isCharacterDefining())) { if (power != null) { - permanent.getPower().setValue(power.calculate(game, source, this)); // check all other becomes to use calculate? + permanent.getPower().setModifiedBaseValue(power.calculate(game, source, this)); // check all other becomes to use calculate? } else if (token.getPower() != null) { - permanent.getPower().setValue(token.getPower().getValue()); + permanent.getPower().setModifiedBaseValue(token.getPower().getValue()); } if (toughness != null) { - permanent.getToughness().setValue(toughness.calculate(game, source, this)); + permanent.getToughness().setModifiedBaseValue(toughness.calculate(game, source, this)); } else if (token.getToughness() != null) { - permanent.getToughness().setValue(token.getToughness().getValue()); + permanent.getToughness().setModifiedBaseValue(token.getToughness().getValue()); } } break; 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 cce973b0c4..7f19901fc7 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 @@ -127,8 +127,8 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { // CDA can only define a characteristic of either the card or token it comes from. - permanent.getToughness().setValue(token.getToughness().getValue()); - permanent.getPower().setValue(token.getPower().getValue()); + permanent.getToughness().setModifiedBaseValue(token.getToughness().getValue()); + permanent.getPower().setModifiedBaseValue(token.getPower().getValue()); } } result = 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 4fca7dd916..ffa9cb8d47 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 @@ -116,8 +116,8 @@ public class BecomesFaceDownCreatureAllEffect extends ContinuousEffectImpl imple break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(2); - permanent.getToughness().setValue(2); + permanent.getPower().setModifiedBaseValue(2); + permanent.getToughness().setModifiedBaseValue(2); } } 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 eee19575de..4ad6b47ed0 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 @@ -176,8 +176,8 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen break; case PTChangingEffects_7: if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(2); - permanent.getToughness().setValue(2); + permanent.getPower().setModifiedBaseValue(2); + permanent.getToughness().setModifiedBaseValue(2); } } } else if (duration == Duration.Custom && foundPermanent == true) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerEnchantedEffect.java similarity index 52% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerEnchantedEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerEnchantedEffect.java index 3f74d4cf84..3db47b03f5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerEnchantedEffect.java @@ -13,38 +13,39 @@ import mage.game.permanent.Permanent; * * @author jeffwadsworth */ -public class SetPowerEnchantedEffect extends ContinuousEffectImpl { +public class SetBasePowerEnchantedEffect extends ContinuousEffectImpl { private final int power; - public SetPowerEnchantedEffect(int power) { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.Neutral); + public SetBasePowerEnchantedEffect(int power) { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, (power > 0 ? Outcome.BoostCreature : Outcome.Neutral)); staticText = "Enchanted creature has base power " + power; this.power = power; } - public SetPowerEnchantedEffect(final SetPowerEnchantedEffect effect) { + public SetBasePowerEnchantedEffect(final SetBasePowerEnchantedEffect effect) { super(effect); this.power = effect.power; } @Override - public SetPowerEnchantedEffect copy() { - return new SetPowerEnchantedEffect(this); + public SetBasePowerEnchantedEffect copy() { + return new SetBasePowerEnchantedEffect(this); } @Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null - && enchantment.getAttachedTo() != null) { - Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); - if (enchanted != null) { - enchanted.getPower().setValue(power); - } - return true; + if (enchantment == null || enchantment.getAttachedTo() == null) { + return false; } - return false; - } + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if (enchanted == null) { + return false; + } + + enchanted.getPower().setModifiedBaseValue(power); + return true; + } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerSourceEffect.java similarity index 57% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerSourceEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerSourceEffect.java index e90d77c8dd..e254b7408c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerSourceEffect.java @@ -15,39 +15,40 @@ import mage.game.Game; * * @author LevelX2 */ -public class SetPowerSourceEffect extends ContinuousEffectImpl { +public class SetBasePowerSourceEffect extends ContinuousEffectImpl { private final DynamicValue amount; - public SetPowerSourceEffect(DynamicValue amount, Duration duration) { + public SetBasePowerSourceEffect(DynamicValue amount, Duration duration) { this(amount, duration, SubLayer.CharacteristicDefining_7a); } - public SetPowerSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { + public SetBasePowerSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); + setCharacterDefining(subLayer == SubLayer.CharacteristicDefining_7a); this.amount = amount; staticText = "{this}'s power is equal to the number of " + amount.getMessage(); } - public SetPowerSourceEffect(final SetPowerSourceEffect effect) { + public SetBasePowerSourceEffect(final SetBasePowerSourceEffect effect) { super(effect); this.amount = effect.amount; } @Override - public SetPowerSourceEffect copy() { - return new SetPowerSourceEffect(this); + public SetBasePowerSourceEffect copy() { + return new SetBasePowerSourceEffect(this); } @Override public boolean apply(Game game, Ability source) { MageObject mageObject = game.getObject(source); - if (mageObject != null) { - int value = amount.calculate(game, source, this); - mageObject.getPower().setValue(value); - return true; + if (mageObject == null) { + return false; } - return false; + int value = amount.calculate(game, source, this); + mageObject.getPower().setModifiedBaseValue(value); + return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessAllEffect.java similarity index 78% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessAllEffect.java index 6450a0cb3e..2d09a5320c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessAllEffect.java @@ -21,22 +21,22 @@ import java.util.Locale; /** * @author LevelX2 */ -public class SetPowerToughnessAllEffect extends ContinuousEffectImpl { +public class SetBasePowerToughnessAllEffect extends ContinuousEffectImpl { private final FilterPermanent filter; private DynamicValue power; private DynamicValue toughness; private final boolean lockedInPT; - public SetPowerToughnessAllEffect(int power, int toughness, Duration duration) { + public SetBasePowerToughnessAllEffect(int power, int toughness, Duration duration) { this(StaticValue.get(power), StaticValue.get(toughness), duration, new FilterCreaturePermanent("Creatures"), true); } - public SetPowerToughnessAllEffect(int power, int toughness, Duration duration, FilterPermanent filter, boolean lockedInPT) { + public SetBasePowerToughnessAllEffect(int power, int toughness, Duration duration, FilterPermanent filter, boolean lockedInPT) { this(StaticValue.get(power), StaticValue.get(toughness), duration, filter, lockedInPT); } - public SetPowerToughnessAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterPermanent filter, boolean lockedInPT) { + public SetBasePowerToughnessAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterPermanent filter, boolean lockedInPT) { super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); this.power = power; this.toughness = toughness; @@ -44,7 +44,7 @@ public class SetPowerToughnessAllEffect extends ContinuousEffectImpl { this.lockedInPT = lockedInPT; } - public SetPowerToughnessAllEffect(final SetPowerToughnessAllEffect effect) { + public SetBasePowerToughnessAllEffect(final SetBasePowerToughnessAllEffect effect) { super(effect); this.power = effect.power; this.toughness = effect.toughness; @@ -53,8 +53,8 @@ public class SetPowerToughnessAllEffect extends ContinuousEffectImpl { } @Override - public SetPowerToughnessAllEffect copy() { - return new SetPowerToughnessAllEffect(this); + public SetBasePowerToughnessAllEffect copy() { + return new SetBasePowerToughnessAllEffect(this); } @Override @@ -79,16 +79,16 @@ public class SetPowerToughnessAllEffect extends ContinuousEffectImpl { for (Iterator it = affectedObjectList.iterator(); it.hasNext(); ) { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { - permanent.getPower().setValue(newPower); - permanent.getToughness().setValue(newToughness); + permanent.getPower().setModifiedBaseValue(newPower); + permanent.getToughness().setModifiedBaseValue(newToughness); } else { it.remove(); // no longer on the battlefield, remove reference to object } } } else { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { - permanent.getPower().setValue(newPower); - permanent.getToughness().setValue(newToughness); + permanent.getPower().setModifiedBaseValue(newPower); + permanent.getToughness().setModifiedBaseValue(newToughness); } } return true; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessEnchantedEffect.java similarity index 55% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessEnchantedEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessEnchantedEffect.java index cabb1b5de3..b4a84992b7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessEnchantedEffect.java @@ -13,45 +13,48 @@ import mage.game.permanent.Permanent; * * @author LevelX2 */ -public class SetPowerToughnessEnchantedEffect extends ContinuousEffectImpl { +public class SetBasePowerToughnessEnchantedEffect extends ContinuousEffectImpl { private final int power; private final int toughness; - public SetPowerToughnessEnchantedEffect() { + public SetBasePowerToughnessEnchantedEffect() { this(0, 2); } - public SetPowerToughnessEnchantedEffect(int power, int toughness) { + public SetBasePowerToughnessEnchantedEffect(int power, int toughness) { super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); staticText = "Enchanted creature has base power and toughness " + power + "/" + toughness; this.power = power; this.toughness = toughness; } - public SetPowerToughnessEnchantedEffect(final SetPowerToughnessEnchantedEffect effect) { + public SetBasePowerToughnessEnchantedEffect(final SetBasePowerToughnessEnchantedEffect effect) { super(effect); this.power = effect.power; this.toughness = effect.toughness; } @Override - public SetPowerToughnessEnchantedEffect copy() { - return new SetPowerToughnessEnchantedEffect(this); + public SetBasePowerToughnessEnchantedEffect copy() { + return new SetBasePowerToughnessEnchantedEffect(this); } @Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); - if (enchanted != null) { - enchanted.getPower().setValue(power); - enchanted.getToughness().setValue(toughness); - } - return true; + if (enchantment == null || enchantment.getAttachedTo() == null) { + return false; } - return false; + + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if (enchanted == null) { + return false; + } + + enchanted.getPower().setModifiedBaseValue(power); + enchanted.getToughness().setModifiedBaseValue(toughness); + return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java new file mode 100644 index 0000000000..012b76a152 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java @@ -0,0 +1,107 @@ + +package mage.abilities.effects.common.continuous; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.game.Game; + +/** + * RENAME + * @author BetaSteward_at_googlemail.com, North, Alex-Vasile + */ +public class SetBasePowerToughnessSourceEffect extends ContinuousEffectImpl { + + private DynamicValue power; + private DynamicValue toughness; + + /** + * + * @param power + * @param toughness + * @param duration + * @param subLayer + * @param baseInText Whether or not the rules text should refer to "base power and toughness" or "power and toughness" + * Either way, it is always the based power and toughness that are set. + */ + public SetBasePowerToughnessSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration, SubLayer subLayer, boolean baseInText) { + super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); + setCharacterDefining(subLayer == SubLayer.CharacteristicDefining_7a); + this.power = power; + this.toughness = toughness; + if (power == toughness) { // When power and toughness are equal, a previous constructor passes the same object for both power nad toughness, so use == instead of .equals + this.staticText = "{this}'s " + (baseInText ? "base " : "") + "power and toughness are each equal to the number of " + power.getMessage(); + } else { // The only other constructor creates the power and toughenss dynamic values as static values from passed-in ints. + String value = (power != null ? power.toString() : toughness.toString()); + this.staticText = "{this}'s " + (baseInText ? "base " : "") + "power and toughness is " + value + '/' + toughness + ' ' + duration.toString(); + } + } + + public SetBasePowerToughnessSourceEffect(DynamicValue amount, Duration duration) { + this(amount, duration, SubLayer.CharacteristicDefining_7a, false); + } + + public SetBasePowerToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { + this(amount, duration, subLayer, true); + } + + public SetBasePowerToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer, boolean changeBaseValue) { + this(amount, amount, duration, subLayer, changeBaseValue); + } + + public SetBasePowerToughnessSourceEffect(int power, int toughness, Duration duration, boolean changeBaseValue) { + this(power, toughness, duration, SubLayer.CharacteristicDefining_7a, changeBaseValue); + } + + public SetBasePowerToughnessSourceEffect(int power, int toughness, Duration duration, SubLayer subLayer) { + this(power, toughness, duration, subLayer, false); + } + + public SetBasePowerToughnessSourceEffect(int power, int toughness, Duration duration, SubLayer subLayer, boolean changeBaseValue) { + this(StaticValue.get(power), StaticValue.get(toughness), duration, subLayer, changeBaseValue); + } + + public SetBasePowerToughnessSourceEffect(final SetBasePowerToughnessSourceEffect effect) { + super(effect); + this.power = effect.power; + this.toughness = effect.toughness; + } + + @Override + public SetBasePowerToughnessSourceEffect copy() { + return new SetBasePowerToughnessSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + if (duration == Duration.Custom || isTemporary()) { + mageObject = game.getPermanent(source.getSourceId()); + } else { + mageObject = game.getObject(source); + } + } + if (mageObject == null || (power == null && toughness == null)) { + discard(); + return false; + } + + if (this.power != null) { + int power = this.power.calculate(game, source, this); + mageObject.getPower().setModifiedBaseValue(power); + } + + if (this.toughness != null) { + int toughness = this.toughness.calculate(game, source, this); + mageObject.getToughness().setModifiedBaseValue(toughness); + } + return true; + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessTargetEffect.java similarity index 75% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessTargetEffect.java index a888c15697..b13eda005b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessTargetEffect.java @@ -19,30 +19,30 @@ import java.util.UUID; /** * @author BetaSteward_at_googlemail.com */ -public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { +public class SetBasePowerToughnessTargetEffect extends ContinuousEffectImpl { private DynamicValue power; private DynamicValue toughness; - public SetPowerToughnessTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration) { + public SetBasePowerToughnessTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration) { super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); this.power = power; this.toughness = toughness; } - public SetPowerToughnessTargetEffect(int power, int toughness, Duration duration) { + public SetBasePowerToughnessTargetEffect(int power, int toughness, Duration duration) { this(StaticValue.get(power), StaticValue.get(toughness), duration); } - public SetPowerToughnessTargetEffect(final SetPowerToughnessTargetEffect effect) { + public SetBasePowerToughnessTargetEffect(final SetBasePowerToughnessTargetEffect effect) { super(effect); this.power = effect.power; this.toughness = effect.toughness; } @Override - public SetPowerToughnessTargetEffect copy() { - return new SetPowerToughnessTargetEffect(this); + public SetBasePowerToughnessTargetEffect copy() { + return new SetBasePowerToughnessTargetEffect(this); } @Override @@ -50,15 +50,16 @@ public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { boolean result = false; for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { Permanent target = game.getPermanent(targetId); - if (target != null) { - if (power != null) { - target.getPower().setValue(power.calculate(game, source, this)); - } - if (toughness != null) { - target.getToughness().setValue(toughness.calculate(game, source, this)); - } - result = true; + if (target == null) { + continue; } + if (power != null) { + target.getPower().setModifiedBaseValue(power.calculate(game, source, this)); + } + if (toughness != null) { + target.getToughness().setModifiedBaseValue(toughness.calculate(game, source, this)); + } + result = true; } return result; } @@ -92,6 +93,4 @@ public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { } return sb.toString(); } - - } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBaseToughnessSourceEffect.java similarity index 69% rename from Mage/src/main/java/mage/abilities/effects/common/continuous/SetToughnessSourceEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/continuous/SetBaseToughnessSourceEffect.java index 9dcbc345dd..e476da2b60 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetToughnessSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBaseToughnessSourceEffect.java @@ -12,30 +12,31 @@ import mage.constants.SubLayer; import mage.game.Game; /** + * RENAME * @author Backfir3, noxx */ -public class SetToughnessSourceEffect extends ContinuousEffectImpl { +public class SetBaseToughnessSourceEffect extends ContinuousEffectImpl { private final DynamicValue amount; - public SetToughnessSourceEffect(DynamicValue amount, Duration duration) { + public SetBaseToughnessSourceEffect(DynamicValue amount, Duration duration) { this(amount, duration, SubLayer.CharacteristicDefining_7a); } - public SetToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { + public SetBaseToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); this.amount = amount; staticText = "{this}'s toughness is equal to the number of " + amount.getMessage(); } - public SetToughnessSourceEffect(final SetToughnessSourceEffect effect) { + public SetBaseToughnessSourceEffect(final SetBaseToughnessSourceEffect effect) { super(effect); this.amount = effect.amount; } @Override - public SetToughnessSourceEffect copy() { - return new SetToughnessSourceEffect(this); + public SetBaseToughnessSourceEffect copy() { + return new SetBaseToughnessSourceEffect(this); } @Override @@ -43,7 +44,7 @@ public class SetToughnessSourceEffect extends ContinuousEffectImpl { MageObject mageObject = game.getObject(source); if (mageObject != null) { int value = amount.calculate(game, source, this); - mageObject.getToughness().setValue(value); + mageObject.getToughness().setModifiedBaseValue(value); return true; } else { if (duration == Duration.Custom) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java deleted file mode 100644 index 5220b2010f..0000000000 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java +++ /dev/null @@ -1,87 +0,0 @@ - -package mage.abilities.effects.common.continuous; - -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.game.Game; - -/** - * - * @author BetaSteward_at_googlemail.com, North - */ -public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { - - private DynamicValue amount; - private int power; - private int toughness; - - public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration) { - this(amount, duration, SubLayer.CharacteristicDefining_7a); - } - - public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { - super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); - setCharacterDefining(subLayer == SubLayer.CharacteristicDefining_7a); - this.amount = amount; - staticText = "{this}'s power and toughness are each equal to the number of " + amount.getMessage(); - } - - public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration) { - this(power, toughness, duration, SubLayer.CharacteristicDefining_7a); - } - - public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration, SubLayer subLayer) { - super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; - staticText = "{this}'s power and toughness is " + power + '/' + toughness + ' ' + duration.toString(); - } - - public SetPowerToughnessSourceEffect(final SetPowerToughnessSourceEffect effect) { - super(effect); - this.amount = effect.amount; - this.power = effect.power; - this.toughness = effect.toughness; - } - - @Override - public SetPowerToughnessSourceEffect copy() { - return new SetPowerToughnessSourceEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject mageObject = game.getPermanentEntering(source.getSourceId()); - if (mageObject == null) { - if (duration == Duration.Custom || isTemporary()) { - mageObject = game.getPermanent(source.getSourceId()); - } else { - mageObject = game.getObject(source); - } - } - if (mageObject == null) { - discard(); - return true; - } - if (amount != null) { - int value = amount.calculate(game, source, this); - mageObject.getPower().setValue(value); - mageObject.getToughness().setValue(value); - return true; - } else { - if (power != Integer.MIN_VALUE) { - mageObject.getPower().setValue(power); - } - if (toughness != Integer.MIN_VALUE) { - mageObject.getToughness().setValue(toughness); - } - } - return true; - } -} diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java index 0ee31ed0f9..b27513dd6b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java @@ -27,6 +27,7 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl { public SwitchPowerToughnessAllEffect(Duration duration) { super(duration, Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, Outcome.BoostCreature); + this.staticText = "Switch each creature's power and toughness" + (duration.toString().isEmpty() ? "" : " " + duration.toString()); } public SwitchPowerToughnessAllEffect(final SwitchPowerToughnessAllEffect effect) { @@ -41,52 +42,32 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); - if (this.affectedObjectsSet) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - for (Permanent perm :game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { - affectedObjectList.add(new MageObjectReference(perm, game)); - } - } + if (this.affectedObjectsSet && game.getPlayer(source.getControllerId()) != null) { + for (Permanent perm :game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + affectedObjectList.add(new MageObjectReference(perm, game)); + } } } @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - if (this.affectedObjectsSet) { - for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { // filter may not be used again, because object can have changed filter relevant attributes but still geets boost - Permanent creature = it.next().getPermanent(game); - if (creature != null) { - int power = creature.getPower().getValue(); - creature.getPower().setValue(creature.getToughness().getValue()); - creature.getToughness().setValue(power); - } else { - it.remove(); - } - } - } else { - for (Permanent creature :game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { - int power = creature.getPower().getValue(); - creature.getPower().setValue(creature.getToughness().getValue()); - creature.getToughness().setValue(power); + if (controller == null) { + return false; + } + + if (!this.affectedObjectsSet) { + game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).forEach(Permanent::switchPowerToughness); + } else { + for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { // filter may not be used again, because object can have changed filter relevant attributes but still gets boost + Permanent creature = it.next().getPermanent(game); + if (creature == null) { + it.remove(); + continue; } + creature.switchPowerToughness(); } - return true; } - return false; + return true; } - - @Override - public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("Switch each creature's power and toughness"); - if (!duration.toString().isEmpty()) { - sb.append(' '); - sb.append(duration.toString()); - } - return sb.toString(); - } - } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessSourceEffect.java index 5abbbc2b2b..3061f968af 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessSourceEffect.java @@ -31,7 +31,7 @@ public class SwitchPowerToughnessSourceEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { - super.init(source, game); //To change body of generated methods, choose Tools | Templates. + super.init(source, game); // To change body of generated methods, choose Tools | Templates. if (duration.isOnlyValidIfNoZoneChange()) { // If source permanent is no longer onto battlefield discard the effect if (source.getSourcePermanentIfItStillExists(game) == null) { @@ -43,17 +43,14 @@ public class SwitchPowerToughnessSourceEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game); - if (sourcePermanent != null) { - int power = sourcePermanent.getPower().getValue(); - sourcePermanent.getPower().setValue(sourcePermanent.getToughness().getValue()); - sourcePermanent.getToughness().setValue(power); - return true; - } else { + if (sourcePermanent == null) { if (duration.isOnlyValidIfNoZoneChange()) { discard(); } + return false; } - return false; - } + sourcePermanent.switchPowerToughness(); + return true; + } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java index c3f4b31fa8..bcf42c5b92 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java @@ -33,13 +33,12 @@ public class SwitchPowerToughnessTargetEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (target != null) { - int power = target.getPower().getValue(); - target.getPower().setValue(target.getToughness().getValue()); - target.getToughness().setValue(power); - return true; + if (target == null) { + return false; } - return false; + + target.switchPowerToughness(); + return true; } @Override @@ -49,6 +48,4 @@ public class SwitchPowerToughnessTargetEffect extends ContinuousEffectImpl { .append(' ').append(duration.toString()); return sb.toString(); } - - } \ No newline at end of file diff --git a/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java b/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java index 5e51bf619e..df95e97a8c 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java @@ -97,8 +97,8 @@ class EternalizeEffect extends OneShotEffect { token.addSubType(SubType.ZOMBIE); token.getManaCost().clear(); token.removePTCDA(); - token.getPower().modifyBaseValue(4); - token.getToughness().modifyBaseValue(4); + token.setPower(4); + token.setToughness(4); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ETERNALIZED_CREATURE, token.getId(), source, controller.getId())); token.putOntoBattlefield(1, game, source, controller.getId(), false, false, null); // Probably it makes sense to remove also the Eternalize ability (it's not shown on the token cards). diff --git a/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java b/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java index 697718d6d4..16d473cf12 100644 --- a/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java +++ b/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java @@ -9,7 +9,7 @@ import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.Duration; import mage.constants.SubLayer; import mage.constants.Zone; @@ -55,8 +55,7 @@ public class LevelerCardBuilder { staticAbility.setRuleVisible(false); constructed.add(staticAbility); } - - ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); + ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true); ConditionalContinuousEffect ptEffect = new ConditionalContinuousEffect(effect, condition, rule); constructed.add(new SimpleStaticAbility(Zone.BATTLEFIELD, ptEffect)); diff --git a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java index 3ce967fba1..4feb4e3342 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java @@ -134,8 +134,8 @@ public class MorphAbility extends AlternativeSourceCostsImpl { } public static void setPermanentToFaceDownCreature(MageObject mageObject, Game game) { - mageObject.getPower().modifyBaseValue(2); - mageObject.getToughness().modifyBaseValue(2); + mageObject.getPower().setModifiedBaseValue(2); + mageObject.getToughness().setModifiedBaseValue(2); mageObject.getAbilities().clear(); mageObject.getColor(game).setColor(new ObjectColor()); mageObject.setName(""); diff --git a/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java b/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java index 2990baa62e..09ed03902d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/TransformAbility.java @@ -64,8 +64,8 @@ public class TransformAbility extends SimpleStaticAbility { // source != null -- from apply effect permanent.addAbility(ability, source == null ? permanent.getId() : source.getSourceId(), game); } - permanent.getPower().modifyBaseValue(sourceCard.getPower().getValue()); - permanent.getToughness().modifyBaseValue(sourceCard.getToughness().getValue()); + permanent.getPower().setModifiedBaseValue(sourceCard.getPower().getValue()); + permanent.getToughness().setModifiedBaseValue(sourceCard.getToughness().getValue()); permanent.setStartingLoyalty(sourceCard.getStartingLoyalty()); } @@ -88,8 +88,8 @@ public class TransformAbility extends SimpleStaticAbility { for (Ability ability : otherSide.getAbilities()) { game.getState().addOtherAbility(newCard, ability); } - newCard.getPower().modifyBaseValue(otherSide.getPower().getValue()); - newCard.getToughness().modifyBaseValue(otherSide.getToughness().getValue()); + newCard.getPower().setModifiedBaseValue(otherSide.getPower().getValue()); + newCard.getToughness().setModifiedBaseValue(otherSide.getToughness().getValue()); return newCard; } diff --git a/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java index 40c95ac58e..281f41ee61 100644 --- a/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/TezzeretTheSchemerEmblem.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfCombatTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.TargetController; @@ -26,7 +26,7 @@ public final class TezzeretTheSchemerEmblem extends Emblem { Effect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE); effect.setText("target artifact you control becomes an artifact creature"); Ability ability = new BeginningOfCombatTriggeredAbility(Zone.COMMAND, effect, TargetController.YOU, false, true); - effect = new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfGame); + effect = new SetBasePowerToughnessTargetEffect(5, 5, Duration.EndOfGame); effect.setText("with base power and toughness 5/5"); ability.addEffect(effect); ability.addTarget(new TargetPermanent(FILTER_CONTROLLED_PERMANENT_ARTIFACT)); diff --git a/Mage/src/main/java/mage/game/permanent/Permanent.java b/Mage/src/main/java/mage/game/permanent/Permanent.java index 32573f8c06..db6e336e45 100644 --- a/Mage/src/main/java/mage/game/permanent/Permanent.java +++ b/Mage/src/main/java/mage/game/permanent/Permanent.java @@ -412,4 +412,11 @@ public interface Permanent extends Card, Controllable { } return getAttachedTo().equals(otherId); } + + default void switchPowerToughness() { + // This is supposed to use boosted value since its switching the final values + int power = this.getPower().getValue(); + this.getPower().setBoostedValue(this.getToughness().getValue()); + this.getToughness().setBoostedValue(power); + } } diff --git a/Mage/src/main/java/mage/game/permanent/PermanentCard.java b/Mage/src/main/java/mage/game/permanent/PermanentCard.java index 460edc15d1..83318491c3 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentCard.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentCard.java @@ -163,8 +163,8 @@ public class PermanentCard extends PermanentImpl { @Override public boolean turnFaceUp(Ability source, Game game, UUID playerId) { if (super.turnFaceUp(source, game, playerId)) { - power.modifyBaseValue(power.getBaseValue()); - toughness.modifyBaseValue(toughness.getBaseValue()); + power.setModifiedBaseValue(power.getBaseValue()); + toughness.setModifiedBaseValue(toughness.getBaseValue()); setManifested(false); setMorphed(false); return true; diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 59d68cc74f..0517530525 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -587,8 +587,8 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } if (this.transformed) { Card orgCard = this.getMainCard(); - this.getPower().modifyBaseValue(orgCard.getPower().getValue()); - this.getToughness().modifyBaseValue(orgCard.getToughness().getValue()); + this.getPower().setModifiedBaseValue(orgCard.getPower().getValue()); + this.getToughness().setModifiedBaseValue(orgCard.getToughness().getValue()); } game.informPlayers(this.getLogName() + " transforms into " + this.getOtherFace().getLogName() + CardUtil.getSourceLogName(game, source, this.getId())); @@ -1298,12 +1298,12 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public void addPower(int power) { - this.power.boostValue(power); + this.power.increaseBoostedValue(power); } @Override public void addToughness(int toughness) { - this.toughness.boostValue(toughness); + this.toughness.increaseBoostedValue(toughness); } /** diff --git a/Mage/src/main/java/mage/game/permanent/PermanentToken.java b/Mage/src/main/java/mage/game/permanent/PermanentToken.java index ae37d07208..416e8ef439 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentToken.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentToken.java @@ -1,5 +1,6 @@ package mage.game.permanent; +import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; @@ -25,8 +26,8 @@ public class PermanentToken extends PermanentImpl { this.token = token.copy(); this.token.getAbilities().newOriginalId(); // neccessary if token has ability like DevourAbility() this.token.getAbilities().setSourceId(objectId); - this.power.modifyBaseValue(token.getPower().getBaseValueModified()); - this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified()); + this.power = new MageInt(token.getPower().getModifiedBaseValue()); + this.toughness = new MageInt(token.getToughness().getModifiedBaseValue()); this.copyFromToken(this.token, game, false); // needed to have at this time (e.g. for subtypes for entersTheBattlefield replacement effects) // token's ZCC must be synced with original token to keep abilities settings diff --git a/Mage/src/main/java/mage/game/permanent/token/ATATToken.java b/Mage/src/main/java/mage/game/permanent/token/ATATToken.java index 83de8f16a3..2be49e52ce 100644 --- a/Mage/src/main/java/mage/game/permanent/token/ATATToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/ATATToken.java @@ -2,6 +2,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; import mage.abilities.common.DiesSourceTriggeredAbility; @@ -14,8 +15,10 @@ import mage.abilities.effects.common.CreateTokenEffect; public final class ATATToken extends TokenImpl { public ATATToken() { - super("AT-AT Token", "5/5 white artifact AT-AT creature tokens with \"When this creature dies, create two 1/1 white Trooper creature tokens.\"", 5, 5); + super("AT-AT Token", "5/5 white artifact AT-AT creature tokens with \"When this creature dies, create two 1/1 white Trooper creature tokens.\""); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); cardType.add(CardType.CREATURE); cardType.add(CardType.ARTIFACT); color.setWhite(true); diff --git a/Mage/src/main/java/mage/game/permanent/token/AvatarToken.java b/Mage/src/main/java/mage/game/permanent/token/AvatarToken.java index 96aff833d0..1e81ad3fd7 100644 --- a/Mage/src/main/java/mage/game/permanent/token/AvatarToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/AvatarToken.java @@ -2,7 +2,7 @@ package mage.game.permanent.token; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubLayer; @@ -20,7 +20,7 @@ public final class AvatarToken extends TokenImpl { cardType.add(CardType.CREATURE); subtype.add(SubType.AVATAR); color.setWhite(true); - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect( ControllerLifeCount.instance, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a ).setText("this creature's power and toughness are each equal to your life total"))); diff --git a/Mage/src/main/java/mage/game/permanent/token/CamaridToken.java b/Mage/src/main/java/mage/game/permanent/token/CamaridToken.java index e013c6e3cd..2d55394076 100644 --- a/Mage/src/main/java/mage/game/permanent/token/CamaridToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/CamaridToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; @@ -13,8 +14,8 @@ public final class CamaridToken extends TokenImpl { public CamaridToken() { super("Camarid Token", "1/1 blue Camarid creature tokens"); this.setOriginalExpansionSetCode("FEM"); - this.getPower().modifyBaseValue(1); - this.getToughness().modifyBaseValue(1); + this.power = new MageInt(1); + this.toughness = new MageInt(1); this.color.setBlue(true); this.subtype.add(SubType.CAMARID); this.cardType.add(CardType.CREATURE); diff --git a/Mage/src/main/java/mage/game/permanent/token/CatWarriorToken.java b/Mage/src/main/java/mage/game/permanent/token/CatWarriorToken.java index 10320472a2..dc41d3116f 100644 --- a/Mage/src/main/java/mage/game/permanent/token/CatWarriorToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/CatWarriorToken.java @@ -4,6 +4,8 @@ package mage.game.permanent.token; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + +import mage.MageInt; import mage.constants.CardType; import mage.abilities.keyword.ForestwalkAbility; import mage.constants.SubType; @@ -24,8 +26,8 @@ public final class CatWarriorToken extends TokenImpl { super("Cat Warrior Token", "2/2 green Cat Warrior creature token with forestwalk"); availableImageSetCodes = tokenImageSets; this.setOriginalExpansionSetCode("PLC"); - this.getPower().modifyBaseValue(2); - this.getToughness().modifyBaseValue(2); + this.power = new MageInt(2); + this.toughness = new MageInt(2); this.color.setGreen(true); this.subtype.add(SubType.CAT); this.subtype.add(SubType.WARRIOR); diff --git a/Mage/src/main/java/mage/game/permanent/token/ConsumingBlobOozeToken.java b/Mage/src/main/java/mage/game/permanent/token/ConsumingBlobOozeToken.java index c6683b7de1..d3c0292764 100644 --- a/Mage/src/main/java/mage/game/permanent/token/ConsumingBlobOozeToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/ConsumingBlobOozeToken.java @@ -4,10 +4,15 @@ import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.common.CardTypesInGraveyardHint; import mage.constants.*; +import mage.filter.StaticFilters; import mage.game.Game; import java.util.Arrays; @@ -17,6 +22,9 @@ import java.util.Arrays; */ public final class ConsumingBlobOozeToken extends TokenImpl { + private static final DynamicValue powerValue = CardTypesInGraveyardCount.YOU; + private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1)); + public ConsumingBlobOozeToken() { super("Ooze Token", "green Ooze creature token with \"This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1.\""); cardType.add(CardType.CREATURE); @@ -27,7 +35,11 @@ public final class ConsumingBlobOozeToken extends TokenImpl { toughness = new MageInt(1); // This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConsumingBlobTokenEffect()).addHint(CardTypesInGraveyardHint.YOU)); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a, false) + .setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1") + )); availableImageSetCodes.addAll(Arrays.asList("MID")); } @@ -41,33 +53,3 @@ public final class ConsumingBlobOozeToken extends TokenImpl { return new ConsumingBlobOozeToken(this); } } - - -class ConsumingBlobTokenEffect extends ContinuousEffectImpl { - - public ConsumingBlobTokenEffect() { - super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); - staticText = "{this}'s power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1"; - } - - public ConsumingBlobTokenEffect(final ConsumingBlobTokenEffect effect) { - super(effect); - } - - @Override - public ConsumingBlobTokenEffect copy() { - return new ConsumingBlobTokenEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject target = source.getSourceObject(game); - if (target == null) { - return false; - } - int number = CardTypesInGraveyardCount.YOU.calculate(game, source, this); - target.getPower().setValue(number); - target.getToughness().setValue(number + 1); - return true; - } -} diff --git a/Mage/src/main/java/mage/game/permanent/token/DaxosSpiritToken.java b/Mage/src/main/java/mage/game/permanent/token/DaxosSpiritToken.java index ea7fdb5c26..e97fb3fe65 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DaxosSpiritToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DaxosSpiritToken.java @@ -75,17 +75,18 @@ class DaxosSpiritSetPTEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && new MageObjectReference(source.getSourceObject(game), game).refersTo(permanent, game)) { - int amount = controller.getCounters().getCount(CounterType.EXPERIENCE); - permanent.getPower().setValue(amount); - permanent.getToughness().setValue(amount); - return true; - } else { - discard(); - } + if (controller == null) { + return false; } - return false; + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null || !new MageObjectReference(source.getSourceObject(game), game).refersTo(permanent, game)) { + discard(); + return false; + } + + int amount = controller.getCounters().getCount(CounterType.EXPERIENCE); + permanent.getPower().setModifiedBaseValue(amount); + permanent.getToughness().setModifiedBaseValue(amount); + return true; } } diff --git a/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java b/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java index 4ad66147f1..793c29e735 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; @@ -31,7 +31,7 @@ public final class DogIllusionToken extends TokenImpl { toughness = new MageInt(0); // This creature's power and toughness are each equal to twice the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect( DogIllusionValue.instance, Duration.EndOfGame) .setText("this creature's power and toughness are each equal to twice the number of cards in your hand") )); diff --git a/Mage/src/main/java/mage/game/permanent/token/DoomedArtisanToken.java b/Mage/src/main/java/mage/game/permanent/token/DoomedArtisanToken.java index 0691f8281f..46d3477dce 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DoomedArtisanToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DoomedArtisanToken.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; @@ -36,7 +36,7 @@ public final class DoomedArtisanToken extends TokenImpl { toughness = new MageInt(0); // This creature's power and toughness are each equal to the number of Sculpturess you control. - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame))); } private DoomedArtisanToken(final DoomedArtisanToken token) { diff --git a/Mage/src/main/java/mage/game/permanent/token/ElephantResurgenceToken.java b/Mage/src/main/java/mage/game/permanent/token/ElephantResurgenceToken.java index 6de7fd8f31..796312ff3b 100644 --- a/Mage/src/main/java/mage/game/permanent/token/ElephantResurgenceToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/ElephantResurgenceToken.java @@ -6,7 +6,7 @@ import mage.constants.SubType; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.Duration; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; @@ -28,7 +28,7 @@ public final class ElephantResurgenceToken extends TokenImpl { this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, - new SetPowerToughnessSourceEffect(new CardsInControllerGraveyardCount(new FilterCreatureCard()), Duration.EndOfGame) + new SetBasePowerToughnessSourceEffect(new CardsInControllerGraveyardCount(new FilterCreatureCard()), Duration.EndOfGame) .setText("This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard.") )); } diff --git a/Mage/src/main/java/mage/game/permanent/token/EwokToken.java b/Mage/src/main/java/mage/game/permanent/token/EwokToken.java index a71d688e02..77c55565fd 100644 --- a/Mage/src/main/java/mage/game/permanent/token/EwokToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/EwokToken.java @@ -3,6 +3,7 @@ package mage.game.permanent.token; import java.util.Collections; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; @@ -13,9 +14,10 @@ import mage.constants.SubType; public final class EwokToken extends TokenImpl { public EwokToken() { - super("Ewok Token", "1/1 green Ewok creature tokens", 1, 1); + super("Ewok Token", "1/1 green Ewok creature tokens"); availableImageSetCodes.addAll(Collections.singletonList("SWS")); - + this.power = new MageInt(1); + this.toughness = new MageInt(1); cardType.add(CardType.CREATURE); subtype.add(SubType.EWOK); color.setGreen(true); diff --git a/Mage/src/main/java/mage/game/permanent/token/GutterGrimeToken.java b/Mage/src/main/java/mage/game/permanent/token/GutterGrimeToken.java index 21e300c316..6b6ffb3b1e 100644 --- a/Mage/src/main/java/mage/game/permanent/token/GutterGrimeToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/GutterGrimeToken.java @@ -9,7 +9,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.Duration; import mage.constants.Zone; import mage.counters.CounterType; @@ -35,7 +35,7 @@ public final class GutterGrimeToken extends TokenImpl { color.setGreen(true); power = new MageInt(0); toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new GutterGrimeCounters(sourceId), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(new GutterGrimeCounters(sourceId), Duration.WhileOnBattlefield))); } public GutterGrimeToken(final GutterGrimeToken token) { diff --git a/Mage/src/main/java/mage/game/permanent/token/HunterToken.java b/Mage/src/main/java/mage/game/permanent/token/HunterToken.java index ccdbaf1dc1..d85f56f508 100644 --- a/Mage/src/main/java/mage/game/permanent/token/HunterToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/HunterToken.java @@ -2,6 +2,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; @@ -12,8 +13,10 @@ import mage.constants.SubType; public final class HunterToken extends TokenImpl { public HunterToken() { - super("Hunter Token", "4/4 red Hunter creature token", 4, 4); + super("Hunter Token", "4/4 red Hunter creature token"); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); cardType.add(CardType.CREATURE); color.setRed(true); subtype.add(SubType.HUNTER); diff --git a/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java b/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java index eef22ad7f0..a5ed624060 100644 --- a/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/KalonianTwingroveTreefolkWarriorToken.java @@ -5,7 +5,7 @@ import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; @@ -33,7 +33,7 @@ public final class KalonianTwingroveTreefolkWarriorToken extends TokenImpl { power = new MageInt(0); toughness = new MageInt(0); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.WhileOnBattlefield))); } public KalonianTwingroveTreefolkWarriorToken(final KalonianTwingroveTreefolkWarriorToken token) { diff --git a/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java b/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java index 6c25cc69a3..cc7fb975b7 100644 --- a/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/KaroxBladewingDragonToken.java @@ -4,6 +4,8 @@ package mage.game.permanent.token; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + +import mage.MageInt; import mage.abilities.keyword.FlyingAbility; import mage.constants.CardType; import mage.constants.SubType; @@ -21,11 +23,13 @@ public final class KaroxBladewingDragonToken extends TokenImpl { } public KaroxBladewingDragonToken() { - super("Karox Bladewing Token", "legendary 4/4 red Dragon creature token with flying", 4, 4); + super("Karox Bladewing Token", "legendary 4/4 red Dragon creature token with flying"); availableImageSetCodes = tokenImageSets; this.setOriginalExpansionSetCode("DOM"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); this.addSuperType(SuperType.LEGENDARY); this.cardType.add(CardType.CREATURE); this.subtype.add(SubType.DRAGON); diff --git a/Mage/src/main/java/mage/game/permanent/token/NissaSageAnimistToken.java b/Mage/src/main/java/mage/game/permanent/token/NissaSageAnimistToken.java index b4ff501d92..40510a889a 100644 --- a/Mage/src/main/java/mage/game/permanent/token/NissaSageAnimistToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/NissaSageAnimistToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; @@ -15,8 +16,8 @@ public final class NissaSageAnimistToken extends TokenImpl { super("Ashaya, the Awoken World", "Ashaya, the Awoken World, a legendary 4/4 green Elemental creature token"); this.setOriginalExpansionSetCode("ORI"); this.supertype.add(SuperType.LEGENDARY); - this.getPower().modifyBaseValue(4); - this.getToughness().modifyBaseValue(4); + this.power = new MageInt(4); + this.toughness = new MageInt(4); this.color.setGreen(true); this.subtype.add(SubType.ELEMENTAL); this.cardType.add(CardType.CREATURE); diff --git a/Mage/src/main/java/mage/game/permanent/token/PharikaSnakeToken.java b/Mage/src/main/java/mage/game/permanent/token/PharikaSnakeToken.java index d70d27e1a7..ce613e05a9 100644 --- a/Mage/src/main/java/mage/game/permanent/token/PharikaSnakeToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/PharikaSnakeToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; import mage.abilities.keyword.DeathtouchAbility; @@ -12,8 +13,10 @@ import mage.abilities.keyword.DeathtouchAbility; public final class PharikaSnakeToken extends TokenImpl { public PharikaSnakeToken() { - super("Snake Token", "1/1 black and green Snake enchantment creature token with deathtouch", 1, 1); + super("Snake Token", "1/1 black and green Snake enchantment creature token with deathtouch"); this.setOriginalExpansionSetCode("JOU"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); cardType.add(CardType.ENCHANTMENT); cardType.add(CardType.CREATURE); subtype.add(SubType.SNAKE); diff --git a/Mage/src/main/java/mage/game/permanent/token/RagavanToken.java b/Mage/src/main/java/mage/game/permanent/token/RagavanToken.java index e8f214bb69..37ae5a96ad 100644 --- a/Mage/src/main/java/mage/game/permanent/token/RagavanToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/RagavanToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; @@ -15,8 +16,8 @@ public final class RagavanToken extends TokenImpl { super("Ragavan", "Ragavan, a legendary 2/1 red Monkey creature token"); this.setOriginalExpansionSetCode("AER"); this.supertype.add(SuperType.LEGENDARY); - this.getPower().modifyBaseValue(2); - this.getToughness().modifyBaseValue(1); + this.power = new MageInt(2); + this.toughness = new MageInt(1); this.color.setRed(true); this.subtype.add(SubType.MONKEY); this.cardType.add(CardType.CREATURE); diff --git a/Mage/src/main/java/mage/game/permanent/token/RebelStarshipToken.java b/Mage/src/main/java/mage/game/permanent/token/RebelStarshipToken.java index ccd0ccb085..43a82b1e82 100644 --- a/Mage/src/main/java/mage/game/permanent/token/RebelStarshipToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/RebelStarshipToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; import mage.abilities.keyword.SpaceflightAbility; @@ -12,8 +13,10 @@ import mage.abilities.keyword.SpaceflightAbility; public final class RebelStarshipToken extends TokenImpl { public RebelStarshipToken() { - super("B-Wing Token", "2/3 blue Rebel Starship artifact creature tokens with spaceflight name B-Wing", 2, 3); + super("B-Wing Token", "2/3 blue Rebel Starship artifact creature tokens with spaceflight name B-Wing"); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); cardType.add(CardType.CREATURE); cardType.add(CardType.ARTIFACT); abilities.add(SpaceflightAbility.getInstance()); diff --git a/Mage/src/main/java/mage/game/permanent/token/RebelToken.java b/Mage/src/main/java/mage/game/permanent/token/RebelToken.java index 9507b6d80c..aac08ee372 100644 --- a/Mage/src/main/java/mage/game/permanent/token/RebelToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/RebelToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; @@ -11,8 +12,10 @@ import mage.constants.SubType; public final class RebelToken extends TokenImpl { public RebelToken() { - super("Rebel Token", "1/1 white Rebel creature token", 1, 1); + super("Rebel Token", "1/1 white Rebel creature token"); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); cardType.add(CardType.CREATURE); color.setWhite(true); subtype.add(SubType.REBEL); diff --git a/Mage/src/main/java/mage/game/permanent/token/RoyalGuardToken.java b/Mage/src/main/java/mage/game/permanent/token/RoyalGuardToken.java index d26a118b30..139d3d705f 100644 --- a/Mage/src/main/java/mage/game/permanent/token/RoyalGuardToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/RoyalGuardToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; import mage.abilities.keyword.FirstStrikeAbility; @@ -12,8 +13,10 @@ import mage.abilities.keyword.FirstStrikeAbility; public final class RoyalGuardToken extends TokenImpl { public RoyalGuardToken() { - super("Royal Guard", "2/2 red Soldier creature token with first strike named Royal Guard", 2, 2); + super("Royal Guard", "2/2 red Soldier creature token with first strike named Royal Guard"); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); cardType.add(CardType.CREATURE); color.setRed(true); addAbility(FirstStrikeAbility.getInstance()); diff --git a/Mage/src/main/java/mage/game/permanent/token/SaprolingBurstToken.java b/Mage/src/main/java/mage/game/permanent/token/SaprolingBurstToken.java index c6484e1eb8..ef426df083 100644 --- a/Mage/src/main/java/mage/game/permanent/token/SaprolingBurstToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/SaprolingBurstToken.java @@ -9,7 +9,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.Duration; import mage.constants.Zone; import mage.counters.CounterType; @@ -33,7 +33,7 @@ public final class SaprolingBurstToken extends TokenImpl { this.color.setGreen(true); this.subtype.add(SubType.SAPROLING); this.cardType.add(CardType.CREATURE); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new SaprolingBurstTokenDynamicValue(saprolingBurstMOR), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(new SaprolingBurstTokenDynamicValue(saprolingBurstMOR), Duration.WhileOnBattlefield))); } public SaprolingBurstToken(final SaprolingBurstToken token) { diff --git a/Mage/src/main/java/mage/game/permanent/token/SeizeTheStormElementalToken.java b/Mage/src/main/java/mage/game/permanent/token/SeizeTheStormElementalToken.java index 4110653985..3024d7653c 100644 --- a/Mage/src/main/java/mage/game/permanent/token/SeizeTheStormElementalToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/SeizeTheStormElementalToken.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.StaticHint; import mage.abilities.keyword.TrampleAbility; @@ -33,7 +33,7 @@ public final class SeizeTheStormElementalToken extends TokenImpl { power = new MageInt(0); toughness = new MageInt(0); this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect( xValue, Duration.WhileOnBattlefield ).setText("this creature's power and toughness are each equal to the number of " + "instant and sorcery cards in your graveyard, plus the number of cards with flashback you own in exile") diff --git a/Mage/src/main/java/mage/game/permanent/token/SpiritClericToken.java b/Mage/src/main/java/mage/game/permanent/token/SpiritClericToken.java index f514b78e3e..4acc95405a 100644 --- a/Mage/src/main/java/mage/game/permanent/token/SpiritClericToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/SpiritClericToken.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; @@ -31,7 +31,7 @@ public class SpiritClericToken extends TokenImpl { toughness = new MageInt(0); // This creature’s power and toughness are each equal to the number of Spirits you control. - this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect(SpiritClericTokenValue.instance, Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect(SpiritClericTokenValue.instance, Duration.EndOfGame))); availableImageSetCodes = Arrays.asList("VOW"); } diff --git a/Mage/src/main/java/mage/game/permanent/token/TIEFighterToken.java b/Mage/src/main/java/mage/game/permanent/token/TIEFighterToken.java index 3caaebb589..1302bd828a 100644 --- a/Mage/src/main/java/mage/game/permanent/token/TIEFighterToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/TIEFighterToken.java @@ -1,5 +1,6 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.abilities.keyword.SpaceflightAbility; import mage.constants.CardType; import mage.constants.SubType; @@ -11,8 +12,10 @@ import mage.constants.SubType; public final class TIEFighterToken extends TokenImpl { public TIEFighterToken() { - super("TIE Fighter", "1/1 black Starship artifact creature tokens with Spaceflight named TIE Fighter", 1, 1); + super("TIE Fighter", "1/1 black Starship artifact creature tokens with Spaceflight named TIE Fighter"); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); cardType.add(CardType.CREATURE); cardType.add(CardType.ARTIFACT); color.setBlack(true); diff --git a/Mage/src/main/java/mage/game/permanent/token/Token.java b/Mage/src/main/java/mage/game/permanent/token/Token.java index d13b52d887..c93f0c6223 100644 --- a/Mage/src/main/java/mage/game/permanent/token/Token.java +++ b/Mage/src/main/java/mage/game/permanent/token/Token.java @@ -39,12 +39,12 @@ public interface Token extends MageObject { boolean putOntoBattlefield(int amount, Game game, Ability source, UUID controllerId, boolean tapped, boolean attacking, UUID attackedPlayer, boolean created); + int getTokenType(); + void setPower(int power); void setToughness(int toughness); - int getTokenType(); - void setTokenType(int tokenType); String getOriginalCardNumber(); diff --git a/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java b/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java index ca2655b9cc..7370c0a0eb 100644 --- a/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java +++ b/Mage/src/main/java/mage/game/permanent/token/TokenImpl.java @@ -1,5 +1,6 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.MageObject; import mage.MageObjectImpl; import mage.abilities.Ability; @@ -65,12 +66,6 @@ public abstract class TokenImpl extends MageObjectImpl implements Token { this.description = description; } - public TokenImpl(String name, String description, int power, int toughness) { - this(name, description); - this.power.modifyBaseValue(power); - this.toughness.modifyBaseValue(toughness); - } - public TokenImpl(final TokenImpl token) { super(token); this.description = token.description; @@ -381,12 +376,12 @@ public abstract class TokenImpl extends MageObjectImpl implements Token { @Override public void setPower(int power) { - this.power.setValue(power); + this.power = new MageInt(power); } @Override public void setToughness(int toughness) { - this.toughness.setValue(toughness); + this.toughness = new MageInt(toughness); } @Override diff --git a/Mage/src/main/java/mage/game/permanent/token/TuskenRaiderToken.java b/Mage/src/main/java/mage/game/permanent/token/TuskenRaiderToken.java index 2fe476f053..4d1516ec99 100644 --- a/Mage/src/main/java/mage/game/permanent/token/TuskenRaiderToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/TuskenRaiderToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; @@ -11,8 +12,10 @@ import mage.constants.SubType; public final class TuskenRaiderToken extends TokenImpl { public TuskenRaiderToken() { - super("Tusken Raider Token", "white Tusken Raider creature token", 1, 1); + super("Tusken Raider Token", "white Tusken Raider creature token"); this.setOriginalExpansionSetCode("SWS"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); cardType.add(CardType.CREATURE); color.setWhite(true); subtype.add(SubType.TUSKEN); diff --git a/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java b/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java index 68cef9b2c8..0a8a092e13 100644 --- a/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/VoiceOfResurgenceToken.java @@ -3,7 +3,7 @@ package mage.game.permanent.token; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; @@ -28,7 +28,7 @@ public final class VoiceOfResurgenceToken extends TokenImpl { toughness = new MageInt(0); // This creature's power and toughness are each equal to the number of creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect( CreaturesYouControlCount.instance, Duration.EndOfGame))); availableImageSetCodes = Arrays.asList("DGM", "MM3", "2XM"); diff --git a/Mage/src/main/java/mage/game/permanent/token/WireflyToken.java b/Mage/src/main/java/mage/game/permanent/token/WireflyToken.java index 83dabe7332..6f39347e8a 100644 --- a/Mage/src/main/java/mage/game/permanent/token/WireflyToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/WireflyToken.java @@ -1,6 +1,7 @@ package mage.game.permanent.token; +import mage.MageInt; import mage.constants.CardType; import mage.abilities.keyword.FlyingAbility; import mage.constants.SubType; @@ -14,8 +15,8 @@ public final class WireflyToken extends TokenImpl { public WireflyToken() { super("Wirefly", "2/2 colorless Insect artifact creature token with flying named Wirefly"); this.setOriginalExpansionSetCode("DST"); - this.getPower().modifyBaseValue(2); - this.getToughness().modifyBaseValue(2); + this.power = new MageInt(2); + this.toughness = new MageInt(2); this.subtype.add(SubType.INSECT); this.cardType.add(CardType.ARTIFACT); this.cardType.add(CardType.CREATURE); diff --git a/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenTreefolkToken.java b/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenTreefolkToken.java index 46b6e300ab..15f4846a8c 100644 --- a/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenTreefolkToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenTreefolkToken.java @@ -3,7 +3,7 @@ package mage.game.permanent.token; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.LandsYouControlCount; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.ReachAbility; import mage.constants.CardType; import mage.constants.Duration; @@ -25,7 +25,7 @@ public final class WrennAndSevenTreefolkToken extends TokenImpl { power = new MageInt(0); toughness = new MageInt(0); this.addAbility(ReachAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect( LandsYouControlCount.instance, Duration.EndOfGame ).setText("this creature's power and toughness are each equal to the number of lands you control"))); diff --git a/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java b/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java index 2ac2cd6521..c2a06fb9ac 100644 --- a/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/main/java/mage/util/functions/CopyTokenFunction.java @@ -90,8 +90,8 @@ public class CopyTokenFunction implements Function { target.addAbility(ability); } - target.getPower().modifyBaseValue(sourceObj.getPower().getBaseValueModified()); - target.getToughness().modifyBaseValue(sourceObj.getToughness().getBaseValueModified()); + target.setPower(sourceObj.getPower().getBaseValue()); + target.setToughness(sourceObj.getToughness().getBaseValue()); target.setStartingLoyalty(sourceObj.getStartingLoyalty()); return target;