From 22961162ad4a365c49fdd7abf599cebff3601c32 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Wed, 30 Aug 2023 20:54:27 -0400 Subject: [PATCH] text fixes related to recent updates --- Mage.Sets/src/mage/cards/a/AgathaOfTheVileCauldron.java | 4 ++-- Mage.Sets/src/mage/cards/b/BrenardGingerSculptor.java | 4 ++-- Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java | 8 +++----- Mage.Sets/src/mage/cards/f/FeywildVisitor.java | 5 +++-- Mage.Sets/src/mage/cards/g/GumdropPoisoner.java | 4 ++-- Mage.Sets/src/mage/cards/k/KnickknackOuphe.java | 5 +++-- Mage.Sets/src/mage/cards/m/MosswoodDreadknight.java | 2 +- Mage.Sets/src/mage/cards/s/StreetwiseNegotiator.java | 5 +++-- Mage.Sets/src/mage/cards/t/TheEleventhHour.java | 2 +- Mage.Sets/src/mage/cards/t/TrainingGrounds.java | 2 +- Mage.Sets/src/mage/cards/v/VirtueOfCourage.java | 2 +- Mage.Sets/src/mage/cards/w/WalkingBulwark.java | 8 ++++---- .../common/DiesThisOrAnotherCreatureTriggeredAbility.java | 6 +++++- .../effects/common/counter/DistributeCountersEffect.java | 7 ++++--- .../CombatDamageByToughnessTargetEffect.java | 8 ++++++-- 15 files changed, 41 insertions(+), 31 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AgathaOfTheVileCauldron.java b/Mage.Sets/src/mage/cards/a/AgathaOfTheVileCauldron.java index e4063077098..fac5b91befc 100644 --- a/Mage.Sets/src/mage/cards/a/AgathaOfTheVileCauldron.java +++ b/Mage.Sets/src/mage/cards/a/AgathaOfTheVileCauldron.java @@ -68,11 +68,11 @@ public final class AgathaOfTheVileCauldron extends CardImpl { class AgathaOfTheVileCauldronEffect extends CostModificationEffectImpl { - private final static DynamicValue xValue = new SourcePermanentPowerCount(false); + private static final DynamicValue xValue = new SourcePermanentPowerCount(false); AgathaOfTheVileCauldronEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); - staticText = "Activated abilities of creatures you control cost X less to activate, " + staticText = "Activated abilities of creatures you control cost {X} less to activate, " + "where X is {this}'s power. " + "This effect can't reduce the mana in that cost to less than one mana."; } diff --git a/Mage.Sets/src/mage/cards/b/BrenardGingerSculptor.java b/Mage.Sets/src/mage/cards/b/BrenardGingerSculptor.java index 97e0f5fd115..e84690f3bc5 100644 --- a/Mage.Sets/src/mage/cards/b/BrenardGingerSculptor.java +++ b/Mage.Sets/src/mage/cards/b/BrenardGingerSculptor.java @@ -82,7 +82,7 @@ class BrenardGingerSculptorEffect extends OneShotEffect { BrenardGingerSculptorEffect() { super(Outcome.Copy); this.staticText = "you may exile it. If you do, create a token that's a copy of that creature, except it's a 1/1 Food Golem artifact creature in "+ - "addition to its other types and it has \"2, {T}, Sacrifice this artifact: You gain 3 life.\""; + "addition to its other types and it has \"{2}, {T}, Sacrifice this artifact: You gain 3 life.\""; } private BrenardGingerSculptorEffect(final BrenardGingerSculptorEffect effect) { @@ -116,4 +116,4 @@ class BrenardGingerSculptorEffect extends OneShotEffect { } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java b/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java index 83f97714ac5..452ca0f985c 100644 --- a/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java +++ b/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java @@ -19,8 +19,6 @@ import mage.game.ExileZone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.ZoneChangeEvent; -import mage.game.events.ZoneChangeGroupEvent; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -108,7 +106,7 @@ class ExtraordinaryJourneyEffect extends OneShotEffect { Set cards = permanents .stream() - .map(p -> p.getMainCard()) + .map(Card::getMainCard) .filter(Objects::nonNull) .filter(card -> game.getState().getZone(card.getId()) == Zone.EXILED) .collect(Collectors.toSet()); @@ -148,7 +146,7 @@ class ExtraordinaryJourneyEffect extends OneShotEffect { class ExtraordinaryJourneyTriggeredAbility extends TriggeredAbilityImpl { ExtraordinaryJourneyTriggeredAbility() { - super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false); + super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, "you"), false); setTriggerPhrase("Whenever one or more nontoken creatures enter the battlefield, " + "if one or more of them entered from exile or was cast from exile, "); setTriggersOnceEachTurn(true); @@ -197,4 +195,4 @@ class ExtraordinaryJourneyTriggeredAbility extends TriggeredAbilityImpl { return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/f/FeywildVisitor.java b/Mage.Sets/src/mage/cards/f/FeywildVisitor.java index ca3742eb141..2ae8b0c1b1b 100644 --- a/Mage.Sets/src/mage/cards/f/FeywildVisitor.java +++ b/Mage.Sets/src/mage/cards/f/FeywildVisitor.java @@ -25,7 +25,8 @@ public final class FeywildVisitor extends CardImpl { // Commander creatures you own have "Whenever one or more nontoken creatures you control deal combat damage to a player, you create a 1/1 blue Faerie Dragon creature token with flying." this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect( - new DealCombatDamageControlledTriggeredAbility(new CreateTokenEffect(new FaerieDragonToken()), StaticFilters.FILTER_CREATURE_NON_TOKEN), + new DealCombatDamageControlledTriggeredAbility(new CreateTokenEffect(new FaerieDragonToken()), StaticFilters.FILTER_CREATURE_NON_TOKEN) + .setTriggerPhrase("Whenever one or more nontoken creatures you control deal combat damage to a player, you "), Duration.WhileOnBattlefield, StaticFilters.FILTER_CREATURES_OWNED_COMMANDER ))); @@ -39,4 +40,4 @@ public final class FeywildVisitor extends CardImpl { public FeywildVisitor copy() { return new FeywildVisitor(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/g/GumdropPoisoner.java b/Mage.Sets/src/mage/cards/g/GumdropPoisoner.java index 8fb5f9e9e32..7c49ba9d679 100644 --- a/Mage.Sets/src/mage/cards/g/GumdropPoisoner.java +++ b/Mage.Sets/src/mage/cards/g/GumdropPoisoner.java @@ -37,10 +37,10 @@ public final class GumdropPoisoner extends AdventureCard { // Lifelink this.addAbility(LifelinkAbility.getInstance()); - // When Gumdrop Poisoner enters the battlefield, target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn. + // When Gumdrop Poisoner enters the battlefield, up to one target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn. Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(xValue, xValue) .setText("target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn")); - ability.addTarget(new TargetCreaturePermanent()); + ability.addTarget(new TargetCreaturePermanent(0, 1)); this.addAbility(ability.addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher()); // Tempt with Treats diff --git a/Mage.Sets/src/mage/cards/k/KnickknackOuphe.java b/Mage.Sets/src/mage/cards/k/KnickknackOuphe.java index d954836c697..def4afe8f2f 100644 --- a/Mage.Sets/src/mage/cards/k/KnickknackOuphe.java +++ b/Mage.Sets/src/mage/cards/k/KnickknackOuphe.java @@ -5,6 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; @@ -44,7 +45,7 @@ public final class KnickknackOuphe extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Knickknack Ouphe enters the battlefield, reveal the top X cards of your library. You may put any number of Aura cards with mana value X or less from among them onto the battlefield. Then put all cards revealed this way that weren't put onto the battlefield on the bottom of your library in a random order. - this.addAbility(new EntersBattlefieldAbility(new KnickknackOuphePutOntoBattlefieldEffect())); + this.addAbility(new EntersBattlefieldTriggeredAbility(new KnickknackOuphePutOntoBattlefieldEffect())); } @@ -119,4 +120,4 @@ class KnickknackOuphePutOntoBattlefieldEffect extends OneShotEffect { return new KnickknackOuphePutOntoBattlefieldEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/m/MosswoodDreadknight.java b/Mage.Sets/src/mage/cards/m/MosswoodDreadknight.java index af7a162b883..79c894c699b 100644 --- a/Mage.Sets/src/mage/cards/m/MosswoodDreadknight.java +++ b/Mage.Sets/src/mage/cards/m/MosswoodDreadknight.java @@ -37,7 +37,7 @@ public final class MosswoodDreadknight extends AdventureCard { // Dread Whispers // You draw a card and you lose 1 life. - this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1, "you")); this.getSpellCard().getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and")); this.finalizeAdventure(); diff --git a/Mage.Sets/src/mage/cards/s/StreetwiseNegotiator.java b/Mage.Sets/src/mage/cards/s/StreetwiseNegotiator.java index b5efb00f82a..22c12baa315 100644 --- a/Mage.Sets/src/mage/cards/s/StreetwiseNegotiator.java +++ b/Mage.Sets/src/mage/cards/s/StreetwiseNegotiator.java @@ -28,7 +28,8 @@ public final class StreetwiseNegotiator extends CardImpl { BackupAbility backupAbility = new BackupAbility(this, 1); // This creature assigns combat damage equal to its toughness rather than its power. - backupAbility.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessSourceEffect(Duration.EndOfTurn))); + backupAbility.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessSourceEffect(Duration.EndOfTurn) + .setText("this creature assigns combat damage equal to its toughness rather than its power"))); this.addAbility(backupAbility); } @@ -41,4 +42,4 @@ public final class StreetwiseNegotiator extends CardImpl { public StreetwiseNegotiator copy() { return new StreetwiseNegotiator(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/t/TheEleventhHour.java b/Mage.Sets/src/mage/cards/t/TheEleventhHour.java index 26c15c51c9a..27fecb4274f 100644 --- a/Mage.Sets/src/mage/cards/t/TheEleventhHour.java +++ b/Mage.Sets/src/mage/cards/t/TheEleventhHour.java @@ -49,7 +49,7 @@ public final class TheEleventhHour extends CardImpl { new CreateTokenEffect(new FoodToken()), new CreateTokenEffect(new TheEleventhHourToken()) .setText("and a 1/1 white Human creature token with " + - "\"Doctor spells you cast cost 1 less to cast.\"") + "\"Doctor spells you cast cost {1} less to cast.\"") ); // III -- Create a token that's a copy of target creature, except it's a legendary Alien named Prisoner Zero. diff --git a/Mage.Sets/src/mage/cards/t/TrainingGrounds.java b/Mage.Sets/src/mage/cards/t/TrainingGrounds.java index 9494bc98641..7abe0542577 100644 --- a/Mage.Sets/src/mage/cards/t/TrainingGrounds.java +++ b/Mage.Sets/src/mage/cards/t/TrainingGrounds.java @@ -42,7 +42,7 @@ public final class TrainingGrounds extends CardImpl { class TrainingGroundsEffect extends CostModificationEffectImpl { private static final String effectText = "Activated abilities of creatures you control " - + "cost up to {2} less to activate. " + + "cost {2} less to activate. " + "This effect can't reduce the mana in that cost to less than one mana"; TrainingGroundsEffect() { diff --git a/Mage.Sets/src/mage/cards/v/VirtueOfCourage.java b/Mage.Sets/src/mage/cards/v/VirtueOfCourage.java index 250cf653aaa..bc9d9eec075 100644 --- a/Mage.Sets/src/mage/cards/v/VirtueOfCourage.java +++ b/Mage.Sets/src/mage/cards/v/VirtueOfCourage.java @@ -80,6 +80,6 @@ class VirtueOfCourageTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "whenever a source you control deals noncombat damage to an opponent, " + "you may exile that many cards from the top of your library. " - + "You may play those cards this turn"; + + "You may play those cards this turn."; } } diff --git a/Mage.Sets/src/mage/cards/w/WalkingBulwark.java b/Mage.Sets/src/mage/cards/w/WalkingBulwark.java index b386e0d6105..1cf85c5057f 100644 --- a/Mage.Sets/src/mage/cards/w/WalkingBulwark.java +++ b/Mage.Sets/src/mage/cards/w/WalkingBulwark.java @@ -43,9 +43,9 @@ public final class WalkingBulwark extends CardImpl { this.addAbility(DefenderAbility.getInstance()); // {2}: Until end of turn, target creature with defender gains haste, can attack as though it didn't have defender, and assigns combat damage equal to its toughness rather than its power. Activate only as a sorcery. - Ability ability = new ActivateAsSorceryActivatedAbility(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2).setText("until end of turn, target creature with defender gains haste,")); - ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn).setText("can attack as though it didn't have defender,")); - ability.addEffect(new CombatDamageByToughnessTargetEffect(Duration.EndOfTurn).setText("and assigns combat damage equal to its toughness rather than its power.")); + Ability ability = new ActivateAsSorceryActivatedAbility(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("until end of turn, target creature with defender gains haste"), new GenericManaCost(2)); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn).setText(", can attack as though it didn't have defender")); + ability.addEffect(new CombatDamageByToughnessTargetEffect(Duration.EndOfTurn).setText(", and assigns combat damage equal to its toughness rather than its power")); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); } @@ -58,4 +58,4 @@ public final class WalkingBulwark extends CardImpl { public WalkingBulwark copy() { return new WalkingBulwark(this); } -} \ No newline at end of file +} diff --git a/Mage/src/main/java/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java index eb33922e871..06b8645aac6 100644 --- a/Mage/src/main/java/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java @@ -25,7 +25,11 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI public DiesThisOrAnotherCreatureTriggeredAbility(Effect effect, boolean optional, FilterPermanent filter) { super(Zone.ALL, effect, optional); // Needs "ALL" if the source itself should trigger or multiple (incl. source go to grave) this.filter = filter; - setTriggerPhrase("Whenever {this} or another " + filter.getMessage() + " dies, "); + String filterMessage = filter.getMessage(); + if (filterMessage.startsWith("a ")) { + filterMessage = filterMessage.substring(2); + } + setTriggerPhrase("Whenever {this} or another " + filterMessage + " dies, "); } protected DiesThisOrAnotherCreatureTriggeredAbility(final DiesThisOrAnotherCreatureTriggeredAbility ability) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java index adeaf5e7f2f..01c88dab08f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java @@ -13,6 +13,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; +import mage.util.CardUtil; import java.util.UUID; @@ -80,12 +81,12 @@ public class DistributeCountersEffect extends OneShotEffect { @Override public String getText(Mode mode) { - if (!staticText.isEmpty()) { + if (staticText != null && !staticText.isEmpty()) { return staticText; } - String name = counterType.getName(); - String text = "distribute " + amount + ' ' + name + " counters among " + targetDescription; + String number = (amount instanceof StaticValue) ? CardUtil.numberToText(((StaticValue) amount).getValue()) : amount.toString(); + String text = "distribute " + number + ' ' + name + " counters among " + targetDescription; if (removeAtEndOfTurn) { text += " For each " + name + " counter you put on a creature this way, remove a " + name + " counter from that creature at the beginning of the next cleanup step."; diff --git a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessTargetEffect.java index 6930daf61b5..7d7bc8de8cb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessTargetEffect.java @@ -48,8 +48,12 @@ public class CombatDamageByToughnessTargetEffect extends ContinuousEffectImpl { @Override public String getText(Mode mode) { - return getTargetPointer().describeTargets(mode.getTargets(), "that creature") + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + return (duration.toString().isEmpty() ? "" : duration.toString() + ", ") + + getTargetPointer().describeTargets(mode.getTargets(), "that creature") + " assigns combat damage equal to its toughness rather than its power"; } -} \ No newline at end of file +}