[STX] Implemented Waterfall Aerialist

This commit is contained in:
Evan Kranzler 2021-03-26 07:01:14 -04:00
parent 2a4b157ab6
commit 7dc8133eec
4 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,42 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.WardAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class WaterfallAerialist extends CardImpl {
public WaterfallAerialist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add(SubType.DJINN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Ward {2}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}")));
}
private WaterfallAerialist(final WaterfallAerialist card) {
super(card);
}
@Override
public WaterfallAerialist copy() {
return new WaterfallAerialist(this);
}
}

View file

@ -46,6 +46,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Silverquill Command", 232, Rarity.RARE, mage.cards.s.SilverquillCommand.class));
cards.add(new SetCardInfo("Storm-Kiln Artist", 115, Rarity.UNCOMMON, mage.cards.s.StormKilnArtist.class));
cards.add(new SetCardInfo("Vineglimmer Snarl", 274, Rarity.RARE, mage.cards.v.VineglimmerSnarl.class));
cards.add(new SetCardInfo("Waterfall Aerialist", 61, Rarity.COMMON, mage.cards.w.WaterfallAerialist.class));
cards.add(new SetCardInfo("Witherbloom Command", 248, Rarity.RARE, mage.cards.w.WitherbloomCommand.class));
}
}

View file

@ -0,0 +1,54 @@
package mage.abilities.keyword;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.Cost;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.StackObject;
import mage.target.targetpointer.FixedTarget;
/**
* @author TheElk801
*/
public class WardAbility extends TriggeredAbilityImpl {
public WardAbility(Cost cost) {
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(cost), false);
}
private WardAbility(final WardAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.TARGETED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!getSourceId().equals(event.getTargetId())) {
return false;
}
StackObject stackObject = game.getStack().getStackObject(event.getSourceId());
if (stackObject == null || !game.getOpponents(getControllerId()).contains(stackObject.getControllerId())) {
return false;
}
getEffects().setTargetPointer(new FixedTarget(event.getSourceId(), game));
return true;
}
@Override
public WardAbility copy() {
return new WardAbility(this);
}
@Override
public String getRule() {
return "Ward " + this.getCosts().getText()
+ " <i>(Whenever {this} becomes the target of a spell or ability an opponent controls, " +
"counter that spell or ability unless its controller pays " + this.getCosts().getText() + ")</i>";
}
}

View file

@ -104,4 +104,5 @@ Undying|new|
Unearth|cost|
Unleash|new|
Vigilance|instance|
Ward|cost|
Wither|instance|