From 45a2532a895edaa872734668fb8aa7065cf8ffa1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 21 Sep 2020 17:01:55 -0400 Subject: [PATCH] [ZNR] fixed issues with Thieving Skydiver cost limitations and text (#7046) --- .../src/mage/cards/t/ThievingSkydiver.java | 19 +++++++------------ .../costs/OptionalAdditionalCost.java | 4 ++++ .../costs/OptionalAdditionalCostImpl.java | 16 ++++++++++++++++ .../mage/abilities/keyword/KickerAbility.java | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java b/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java index bdb972db53..2088eb91c5 100644 --- a/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java +++ b/Mage.Sets/src/mage/cards/t/ThievingSkydiver.java @@ -4,9 +4,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.costs.VariableCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.costs.mana.VariableManaCost; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.dynamicvalue.common.GetKickerXValue; import mage.abilities.effects.OneShotEffect; @@ -40,20 +37,18 @@ public final class ThievingSkydiver extends CardImpl { this.toughness = new MageInt(1); // Kicker {X}. X can't be 0. - Ability ability = new KickerAbility(new ManaCostsImpl<>("{X}")); - for (VariableCost cost : ability.getManaCosts().getVariableCosts()) { - if (cost instanceof VariableManaCost) { - ((VariableManaCost) cost).setMinX(1); - break; - } - } - this.addAbility(ability); + KickerAbility kickerAbility = new KickerAbility("{X}"); + kickerAbility.getKickerCosts().stream().forEach(cost -> { + cost.setMinimumCost(1); + cost.setReminderText(". X can't be 0."); + }); + this.addAbility(kickerAbility); // Flying this.addAbility(FlyingAbility.getInstance()); // When Thieving Skydiver enters the battlefield, if it was kicked, gain control of target artifact with converted mana cost X or less. If that artifact is an Equipment, attach it to Thieving Skydiver. - ability = new ConditionalInterveningIfTriggeredAbility( + Ability ability = new ConditionalInterveningIfTriggeredAbility( new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.Custom), false), KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, " + "gain control of target artifact with converted mana cost X or less. " + diff --git a/Mage/src/main/java/mage/abilities/costs/OptionalAdditionalCost.java b/Mage/src/main/java/mage/abilities/costs/OptionalAdditionalCost.java index ae43332a02..50e0f835f8 100644 --- a/Mage/src/main/java/mage/abilities/costs/OptionalAdditionalCost.java +++ b/Mage/src/main/java/mage/abilities/costs/OptionalAdditionalCost.java @@ -25,6 +25,10 @@ public interface OptionalAdditionalCost extends Cost, Copyable implements Optio return replace; } + @Override + public void setReminderText(String reminderText) { + this.reminderText = reminderText; + } + + @Override + public void setMinimumCost(int minimumCost) { + for (VariableCost cost : this.getVariableCosts()) { + if (cost instanceof VariableManaCost) { + ((VariableManaCost) cost).setMinX(minimumCost); + } + } + } + /** * Returns a text suffix for the game log, that can be added to the cast * message. diff --git a/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java b/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java index 6728e0e6af..5750c33033 100644 --- a/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java @@ -247,7 +247,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo sb.append(' ').append(remarkText); } - return sb.toString(); + return sb.toString().replace(" .","."); } @Override