mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[MOM] Implement Deeproot Wayfinder
This commit is contained in:
parent
1727ec1fb5
commit
94d1178a5a
3 changed files with 92 additions and 2 deletions
81
Mage.Sets/src/mage/cards/d/DeeprootWayfinder.java
Normal file
81
Mage.Sets/src/mage/cards/d/DeeprootWayfinder.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DeeprootWayfinder extends CardImpl {
|
||||
|
||||
public DeeprootWayfinder(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
|
||||
|
||||
this.subtype.add(SubType.MERFOLK);
|
||||
this.subtype.add(SubType.SCOUT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever Deeproot Wayfinder deals combat damage to a player or battle, surveil 1, then you may return a land card from your graveyard to the battlefield tapped.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DeeprootWayfinderEffect(), false).setOrBattle(true));
|
||||
}
|
||||
|
||||
private DeeprootWayfinder(final DeeprootWayfinder card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeeprootWayfinder copy() {
|
||||
return new DeeprootWayfinder(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DeeprootWayfinderEffect extends OneShotEffect {
|
||||
|
||||
DeeprootWayfinderEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "surveil 1, then you may return a land card from your graveyard to the battlefield tapped";
|
||||
}
|
||||
|
||||
private DeeprootWayfinderEffect(final DeeprootWayfinderEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeeprootWayfinderEffect copy() {
|
||||
return new DeeprootWayfinderEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
player.surveil(1, source, game);
|
||||
TargetCard target = new TargetCardInYourGraveyard(0, 1, StaticFilters.FILTER_CARD_LAND_A);
|
||||
target.setNotTarget(true);
|
||||
player.choose(outcome, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
return player.moveCards(
|
||||
card, Zone.BATTLEFIELD, source, game, true,
|
||||
false, false, null
|
||||
);
|
||||
}
|
||||
}
|
|
@ -35,6 +35,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Copper Host Crusher", 181, Rarity.UNCOMMON, mage.cards.c.CopperHostCrusher.class));
|
||||
cards.add(new SetCardInfo("Cragsmasher Yeti", 333, Rarity.COMMON, mage.cards.c.CragsmasherYeti.class));
|
||||
cards.add(new SetCardInfo("Deadly Derision", 99, Rarity.COMMON, mage.cards.d.DeadlyDerision.class));
|
||||
cards.add(new SetCardInfo("Deeproot Wayfinder", 184, Rarity.RARE, mage.cards.d.DeeprootWayfinder.class));
|
||||
cards.add(new SetCardInfo("Dismal Backwater", 269, Rarity.COMMON, mage.cards.d.DismalBackwater.class));
|
||||
cards.add(new SetCardInfo("Dusk Legion Duelist", 11, Rarity.RARE, mage.cards.d.DuskLegionDuelist.class));
|
||||
cards.add(new SetCardInfo("Elspeth's Smite", 13, Rarity.UNCOMMON, mage.cards.e.ElspethsSmite.class));
|
||||
|
|
|
@ -18,6 +18,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
protected String text;
|
||||
protected boolean onlyOpponents;
|
||||
private boolean orPlaneswalker = false;
|
||||
private boolean orBattle = false;
|
||||
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, false);
|
||||
|
@ -45,6 +46,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
this.setTargetPointer = ability.setTargetPointer;
|
||||
this.onlyOpponents = ability.onlyOpponents;
|
||||
this.orPlaneswalker = ability.orPlaneswalker;
|
||||
this.orBattle = ability.orBattle;
|
||||
}
|
||||
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility setOrPlaneswalker(boolean orPlaneswalker) {
|
||||
|
@ -52,6 +54,11 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
return this;
|
||||
}
|
||||
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility setOrBattle(boolean orBattle) {
|
||||
this.orBattle = orBattle;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility copy() {
|
||||
return new DealsCombatDamageToAPlayerTriggeredAbility(this);
|
||||
|
@ -78,8 +85,8 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
case DAMAGED_PERMANENT:
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent == null
|
||||
|| !permanent.isPlaneswalker(game)
|
||||
|| !orPlaneswalker) {
|
||||
|| (!orPlaneswalker || !permanent.isPlaneswalker(game))
|
||||
&& (!orBattle || !permanent.isBattle(game))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +111,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
return "Whenever {this} deals combat damage to "
|
||||
+ (onlyOpponents ? "an opponent" : "a player")
|
||||
+ (orPlaneswalker ? " or planeswalker" : "")
|
||||
+ (orBattle ? " or battle" : "")
|
||||
+ ", ";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue