From 3fdaf043a16620fbf4dbd7e48ffcf20f27163d2b Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 14 Jan 2020 20:52:13 +0400 Subject: [PATCH] fixed Taranika, Akroan Veteran (wrong text); --- Mage.Sets/src/mage/cards/n/N1Starfighter.java | 1 - .../src/mage/cards/t/TaranikaAkroanVeteran.java | 6 ++---- .../effects/common/UntapTargetEffect.java | 16 ++++++++-------- .../SetPowerToughnessTargetEffect.java | 13 +++++++------ 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/N1Starfighter.java b/Mage.Sets/src/mage/cards/n/N1Starfighter.java index 8455074bbe..c760ea5172 100644 --- a/Mage.Sets/src/mage/cards/n/N1Starfighter.java +++ b/Mage.Sets/src/mage/cards/n/N1Starfighter.java @@ -45,7 +45,6 @@ public final class N1Starfighter extends CardImpl { new ExileTargetForSourceEffect(), new ManaCostsImpl("{1}{W/U}")), false); ability.addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, true).concatBy(", then")); ability.addTarget(new TargetControlledCreaturePermanent(filter)); - ability.getRule(); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java b/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java index 8340932360..0dcd4d2fb6 100644 --- a/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java +++ b/Mage.Sets/src/mage/cards/t/TaranikaAkroanVeteran.java @@ -26,7 +26,7 @@ import java.util.UUID; */ public final class TaranikaAkroanVeteran extends CardImpl { - private static final FilterPermanent filter = new FilterControlledCreaturePermanent("another creature you control"); + private static final FilterPermanent filter = new FilterControlledCreaturePermanent("another target creature you control"); static { filter.add(AnotherPredicate.instance); @@ -45,9 +45,7 @@ public final class TaranikaAkroanVeteran extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // 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().setText("untap another target creature you control."), false - ); + Ability ability = new AttacksTriggeredAbility(new UntapTargetEffect(), false); ability.addEffect(new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfTurn) .setText("Until end of turn, that creature has base power and toughness 4/4")); ability.addEffect(new GainAbilityTargetEffect( diff --git a/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java index d474f15cc8..2c7d060144 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java @@ -1,7 +1,5 @@ - package mage.abilities.effects.common; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; @@ -11,8 +9,9 @@ import mage.game.permanent.Permanent; import mage.target.Target; import mage.util.CardUtil; +import java.util.UUID; + /** - * * @author BetaSteward_at_googlemail.com */ public class UntapTargetEffect extends OneShotEffect { @@ -67,7 +66,7 @@ public class UntapTargetEffect extends OneShotEffect { } if (mode.getTargets().isEmpty()) { - return "untap target permanent"; + return "untap target permanent"; // TODO: add exeption about missing targets setup? } Target target = mode.getTargets().get(0); @@ -77,12 +76,13 @@ public class UntapTargetEffect extends OneShotEffect { sb.append("up to "); } + boolean haveTargetWord = target.getTargetName().contains("target"); if (target.getMaxNumberOfTargets() > 1 || target.getNumberOfTargets() == 0) { - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append('s'); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())); + sb.append(haveTargetWord ? " " : " target "); + sb.append(target.getTargetName()).append('s'); } else { - if (!target.getTargetName().startsWith("another")) { - sb.append("target "); - } + sb.append(haveTargetWord ? "" : "target "); sb.append(target.getTargetName()); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java index 0649128a62..fd1f1310a9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java @@ -1,8 +1,5 @@ - - package mage.abilities.effects.common.continuous; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; @@ -15,8 +12,9 @@ import mage.constants.SubLayer; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** - * * @author BetaSteward_at_googlemail.com */ public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { @@ -48,7 +46,7 @@ public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { boolean result = false; - for (UUID targetId: this.getTargetPointer().getTargets(game, source)) { + for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { Permanent target = game.getPermanent(targetId); if (target != null) { if (power != null) { @@ -69,7 +67,10 @@ public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { return staticText; } StringBuilder sb = new StringBuilder(); - sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" has base power and toughness "); + if (!mode.getTargets().get(0).getTargetName().contains("target")) { + sb.append("target "); + } + sb.append(mode.getTargets().get(0).getTargetName()).append(" has base power and toughness "); sb.append(power).append('/').append(toughness).append(' ').append(duration.toString()); return sb.toString(); }