From 027bd439b44184910a5a65cfc0389e7f433de307 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 31 May 2022 07:34:32 -0400 Subject: [PATCH] [CLB] fixed Moonshae Pixie text generation --- Mage.Sets/src/mage/cards/m/MoonshaePixie.java | 2 +- .../common/DrawCardSourceControllerEffect.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/cards/m/MoonshaePixie.java b/Mage.Sets/src/mage/cards/m/MoonshaePixie.java index c85bf6fb27e..5f2cc9b0556 100644 --- a/Mage.Sets/src/mage/cards/m/MoonshaePixie.java +++ b/Mage.Sets/src/mage/cards/m/MoonshaePixie.java @@ -46,7 +46,7 @@ public final class MoonshaePixie extends AdventureCard { this.addAbility(new EntersBattlefieldTriggeredAbility( new DrawCardSourceControllerEffect(MoonshaePixieValue.instance) .setText("draw cards equal to the number of opponents who were dealt combat damage this turn") - ), new MoonshaePixieWatcher()); + ).addHint(hint), new MoonshaePixieWatcher()); // Pixie Dust // Up to three target creatures gain flying until end of turn. diff --git a/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java index be85fa96d60..70b29435808 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java @@ -1,6 +1,7 @@ package mage.abilities.effects.common; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.StaticValue; @@ -34,7 +35,6 @@ public class DrawCardSourceControllerEffect extends OneShotEffect { super(Outcome.DrawCard); this.amount = amount.copy(); this.whoDrawCard = whoDrawCard; - setText(); } public DrawCardSourceControllerEffect(final DrawCardSourceControllerEffect effect) { @@ -59,7 +59,11 @@ public class DrawCardSourceControllerEffect extends OneShotEffect { return false; } - private void setText() { + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } StringBuilder sb = new StringBuilder(); boolean oneCard = (amount instanceof StaticValue && amount.calculate(null, null, this) == 1) @@ -77,7 +81,6 @@ public class DrawCardSourceControllerEffect extends OneShotEffect { sb.append(" for each "); } sb.append(message); - staticText = sb.toString(); + return sb.toString(); } - }