forked from External/mage
[TLA] Implement Toph, Earthbending Master
This commit is contained in:
parent
55cc7dc36d
commit
0b796ea276
4 changed files with 85 additions and 8 deletions
58
Mage.Sets/src/mage/cards/t/TophEarthbendingMaster.java
Normal file
58
Mage.Sets/src/mage/cards/t/TophEarthbendingMaster.java
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CountersControllerCount;
|
||||
import mage.abilities.effects.common.counter.AddCountersPlayersEffect;
|
||||
import mage.abilities.effects.keyword.EarthbendTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.common.TargetControlledLandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TophEarthbendingMaster extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new CountersControllerCount(CounterType.EXPERIENCE);
|
||||
|
||||
public TophEarthbendingMaster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.subtype.add(SubType.ALLY);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Landfall -- Whenever a land you control enters, you get an experience counter.
|
||||
this.addAbility(new LandfallAbility(new AddCountersPlayersEffect(
|
||||
CounterType.EXPERIENCE.createInstance(), TargetController.YOU
|
||||
)));
|
||||
|
||||
// Whenever you attack, earthbend X, where X is the number of experience counters you have.
|
||||
Ability ability = new AttacksWithCreaturesTriggeredAbility(new EarthbendTargetEffect(xValue), 1);
|
||||
ability.addTarget(new TargetControlledLandPermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private TophEarthbendingMaster(final TophEarthbendingMaster card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TophEarthbendingMaster copy() {
|
||||
return new TophEarthbendingMaster(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -130,6 +130,7 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Thriving Heath", 262, Rarity.COMMON, mage.cards.t.ThrivingHeath.class));
|
||||
cards.add(new SetCardInfo("Thriving Isle", 263, Rarity.COMMON, mage.cards.t.ThrivingIsle.class));
|
||||
cards.add(new SetCardInfo("Thriving Moor", 264, Rarity.COMMON, mage.cards.t.ThrivingMoor.class));
|
||||
cards.add(new SetCardInfo("Toph, Earthbending Master", 145, Rarity.MYTHIC, mage.cards.t.TophEarthbendingMaster.class));
|
||||
cards.add(new SetCardInfo("Tundra Wall", 220, Rarity.COMMON, mage.cards.t.TundraWall.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Tundra Wall", 275, Rarity.COMMON, mage.cards.t.TundraWall.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Turtle-Seals", 226, Rarity.COMMON, mage.cards.t.TurtleSeals.class));
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ public class CountersControllerCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return (counterType != null ? counterType.toString() + ' ' : "") + "counter on {this}'s controller";
|
||||
return "the number of " + counterType.getName() + " counters you have";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import mage.MageObjectReference;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
|
||||
|
|
@ -25,9 +27,13 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class EarthbendTargetEffect extends OneShotEffect {
|
||||
|
||||
private final int amount;
|
||||
private final DynamicValue amount;
|
||||
|
||||
public EarthbendTargetEffect(int amount) {
|
||||
this(StaticValue.get(amount));
|
||||
}
|
||||
|
||||
public EarthbendTargetEffect(DynamicValue amount) {
|
||||
super(Outcome.Benefit);
|
||||
this.amount = amount;
|
||||
}
|
||||
|
|
@ -53,11 +59,12 @@ public class EarthbendTargetEffect extends OneShotEffect {
|
|||
.withAbility(HasteAbility.getInstance()),
|
||||
false, true, Duration.Custom
|
||||
), source);
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
|
||||
int value = amount.calculate(game, source, this);
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(value), source, game);
|
||||
game.addDelayedTriggeredAbility(new EarthbendingDelayedTriggeredAbility(permanent, game), source);
|
||||
game.fireEvent(GameEvent.getEvent(
|
||||
GameEvent.EventType.EARTHBENDED, permanent.getId(),
|
||||
source, source.getControllerId(), amount
|
||||
source, source.getControllerId(), value
|
||||
));
|
||||
return true;
|
||||
}
|
||||
|
|
@ -67,10 +74,21 @@ public class EarthbendTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "earthbend " + amount + ". <i>(Target land you control becomes a 0/0 creature " +
|
||||
"with haste that's still a land. Put " + CardUtil.numberToText(amount, "a") +
|
||||
" +1/+1 counter" + (amount > 1 ? "s" : "") + " on it. " +
|
||||
"When it dies or is exiled, return it to the battlefield tapped.)</i>";
|
||||
StringBuilder sb = new StringBuilder("earthbend ");
|
||||
sb.append(amount);
|
||||
if (!(amount instanceof StaticValue)) {
|
||||
sb.append(", where X is ");
|
||||
sb.append(amount.getMessage());
|
||||
}
|
||||
sb.append(". <i>(Target land you control becomes a 0/0 creature with haste that's still a land. Put ");
|
||||
String value = amount instanceof StaticValue
|
||||
? CardUtil.numberToText(((StaticValue) amount).getValue(), "a")
|
||||
: amount.toString();
|
||||
sb.append(value);
|
||||
sb.append(" +1/+1 counter");
|
||||
sb.append(("a".equals(value) ? "" : "s"));
|
||||
sb.append(" on it. When it dies or is exiled, return it to the battlefield tapped.)</i>");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue