* Thassa, Deep-Dwelling - fixed text;

This commit is contained in:
Oleg Agafonov 2020-01-14 18:53:47 +04:00
parent 4c55fe701e
commit 748d14e55e
3 changed files with 28 additions and 17 deletions

View file

@ -1,6 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
@ -20,20 +19,24 @@ import mage.constants.SubType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import java.util.UUID;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
public final class ThassaDeepDwelling extends CardImpl { public final class ThassaDeepDwelling extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("another target creature"); private static final FilterPermanent filterAnother = new FilterCreaturePermanent("another target creature");
private static final FilterPermanent filterOther = new FilterControlledCreaturePermanent("other target creature you control");
static { static {
filter.add(AnotherPredicate.instance); filterAnother.add(AnotherPredicate.instance);
filterOther.add(AnotherPredicate.instance);
} }
public ThassaDeepDwelling(UUID ownerId, CardSetInfo setInfo) { public ThassaDeepDwelling(UUID ownerId, CardSetInfo setInfo) {
@ -53,12 +56,12 @@ public final class ThassaDeepDwelling extends CardImpl {
// At the beginning of your end step, exile up to one other target creature you control, then return that card to the battlefield under your control. // At the beginning of your end step, exile up to one other target creature you control, then return that card to the battlefield under your control.
Ability ability = new BeginningOfEndStepTriggeredAbility( Ability ability = new BeginningOfEndStepTriggeredAbility(
new ExileTargetForSourceEffect().setText("exile up to one other target creature you control, then "), new ExileTargetForSourceEffect()/*.setText("exile up to one other target creature you control")*/,
TargetController.YOU, false TargetController.YOU, false
); );
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true)); ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true).concatBy(", then"));
ability.addTarget(new TargetPermanent( ability.addTarget(new TargetPermanent(
0, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, false 0, 1, filterOther, false
)); ));
this.addAbility(ability); this.addAbility(ability);
@ -66,7 +69,7 @@ public final class ThassaDeepDwelling extends CardImpl {
ability = new SimpleActivatedAbility( ability = new SimpleActivatedAbility(
new TapTargetEffect("another target creature"), new ManaCostsImpl("{3}{U}") new TapTargetEffect("another target creature"), new ManaCostsImpl("{3}{U}")
); );
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filterAnother));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -38,7 +38,7 @@ public class YorvoLordOfGarenbrigOnCommandersTest extends CardTestCommanderDuelB
} }
@Test @Test
public void test_TriggerOnUroTitalOfNaturesWrath() { public void test_TriggerOnUroTitanOfNaturesWrath() {
// Yorvo, Lord of Garenbrig enters the battlefield with four +1/+1 counters on it. // Yorvo, Lord of Garenbrig enters the battlefield with four +1/+1 counters on it.
// Whenever another green creature enters the battlefield under your control, put a +1/+1 counter on Yorvo. Then if that creatures power is greater than Yorvos power, put another +1/+1 counter on Yorvo. // Whenever another green creature enters the battlefield under your control, put a +1/+1 counter on Yorvo. Then if that creatures power is greater than Yorvos power, put another +1/+1 counter on Yorvo.
addCard(Zone.HAND, playerA, "Yorvo, Lord of Garenbrig", 5); // {G}{G}{G} addCard(Zone.HAND, playerA, "Yorvo, Lord of Garenbrig", 5); // {G}{G}{G}

View file

@ -1,9 +1,5 @@
package mage.abilities.effects.common; package mage.abilities.effects.common;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
@ -16,8 +12,11 @@ import mage.target.Target;
import mage.target.targetpointer.FirstTargetPointer; import mage.target.targetpointer.FirstTargetPointer;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class ExileTargetForSourceEffect extends OneShotEffect { public class ExileTargetForSourceEffect extends OneShotEffect {
@ -70,12 +69,21 @@ public class ExileTargetForSourceEffect extends OneShotEffect {
return staticText; return staticText;
} }
String upToText = "";
if (mode.getTargets().get(0).getMinNumberOfTargets() < mode.getTargets().get(0).getMaxNumberOfTargets()) {
upToText = "up to " + CardUtil.numberToText(mode.getTargets().get(0).getMaxNumberOfTargets()) + " ";
}
String targetText = "";
if (mode.getTargets().get(0).getTargetName().contains("target ")) {
targetText = "";
} else {
targetText = "target ";
}
if (mode.getTargets().isEmpty()) { if (mode.getTargets().isEmpty()) {
return "exile it"; return "exile it";
} else if (mode.getTargets().get(0).getTargetName().startsWith("another")) {
return "exile " + mode.getTargets().get(0).getTargetName();
} else { } else {
return "exile target " + mode.getTargets().get(0).getTargetName(); return "exile " + upToText + targetText + mode.getTargets().get(0).getTargetName();
} }
} }
} }