mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
[ZNR] Implemented Zareth San, the Trickster
This commit is contained in:
parent
649ff35359
commit
96b0e5f1f3
2 changed files with 156 additions and 0 deletions
155
Mage.Sets/src/mage/cards/z/ZarethSanTheTrickster.java
Normal file
155
Mage.Sets/src/mage/cards/z/ZarethSanTheTrickster.java
Normal file
|
@ -0,0 +1,155 @@
|
|||
package mage.cards.z;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.common.FilterPermanentCard;
|
||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||
import mage.filter.predicate.permanent.UnblockedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ZarethSanTheTrickster extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.ROGUE, "unblocked attacking Rogue you control");
|
||||
|
||||
static {
|
||||
filter.add(UnblockedPredicate.instance);
|
||||
}
|
||||
|
||||
public ZarethSanTheTrickster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.MERFOLK);
|
||||
this.subtype.add(SubType.ROGUE);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
|
||||
// {2}{U}{B}, Return an unblocked attacking Rogue you control to its owner's hand: Put Zareth San, the Trickster from your hand onto the battlefield tapped and attacking.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.HAND, new ZarethSanTheTricksterEffect(), new ManaCostsImpl<>("{2}{U}{B}")
|
||||
);
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Whenever Zareth San deals combat damage to a player, you may put target permanent card from that player's graveyard onto the battlefield under your control.
|
||||
this.addAbility(new ZarethSanTheTricksterTriggeredAbility());
|
||||
}
|
||||
|
||||
private ZarethSanTheTrickster(final ZarethSanTheTrickster card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZarethSanTheTrickster copy() {
|
||||
return new ZarethSanTheTrickster(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ZarethSanTheTricksterEffect extends OneShotEffect {
|
||||
|
||||
ZarethSanTheTricksterEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Put {this} from your hand onto the battlefield tapped and attacking.";
|
||||
}
|
||||
|
||||
private ZarethSanTheTricksterEffect(final ZarethSanTheTricksterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZarethSanTheTricksterEffect copy() {
|
||||
return new ZarethSanTheTricksterEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = controller.getHand().get(source.getSourceId(), game);
|
||||
if (card == null) {
|
||||
return true;
|
||||
}
|
||||
controller.moveCards(
|
||||
card, Zone.BATTLEFIELD, source, game, true,
|
||||
false, true, null
|
||||
);
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
game.getCombat().addAttackingCreature(permanent.getId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ZarethSanTheTricksterTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
ZarethSanTheTricksterTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), true);
|
||||
}
|
||||
|
||||
private ZarethSanTheTricksterTriggeredAbility(final ZarethSanTheTricksterTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZarethSanTheTricksterTriggeredAbility copy() {
|
||||
return new ZarethSanTheTricksterTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Player opponent = game.getPlayer(event.getPlayerId());
|
||||
if (opponent == null
|
||||
|| !event.getSourceId().equals(this.sourceId)
|
||||
|| !((DamagedEvent) event).isCombatDamage()) {
|
||||
return false;
|
||||
}
|
||||
FilterCard filter = new FilterPermanentCard(
|
||||
"nonland permanent in " + opponent.getLogName() + "'s graveyard"
|
||||
);
|
||||
filter.add(new OwnerIdPredicate(opponent.getId()));
|
||||
this.getTargets().clear();
|
||||
this.addTarget(new TargetCardInGraveyard(filter));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever {this} deals combat damage to a player, you may put target permanent card " +
|
||||
"from that player's graveyard onto the battlefield under your control.";
|
||||
}
|
||||
}
|
|
@ -366,6 +366,7 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Wayward Guide-Beast", 176, Rarity.RARE, mage.cards.w.WaywardGuideBeast.class));
|
||||
cards.add(new SetCardInfo("Windrider Wizard", 87, Rarity.UNCOMMON, mage.cards.w.WindriderWizard.class));
|
||||
cards.add(new SetCardInfo("Yasharn, Implacable Earth", 240, Rarity.RARE, mage.cards.y.YasharnImplacableEarth.class));
|
||||
cards.add(new SetCardInfo("Zareth San, the Trickster", 242, Rarity.RARE, mage.cards.z.ZarethSanTheTrickster.class));
|
||||
cards.add(new SetCardInfo("Zof Bloodbog", 132, Rarity.UNCOMMON, mage.cards.z.ZofBloodbog.class));
|
||||
cards.add(new SetCardInfo("Zof Consumption", 132, Rarity.UNCOMMON, mage.cards.z.ZofConsumption.class));
|
||||
cards.add(new SetCardInfo("Zulaport Duelist", 88, Rarity.COMMON, mage.cards.z.ZulaportDuelist.class));
|
||||
|
|
Loading…
Reference in a new issue