@Override public EvokeAbility copy() { return new EvokeAbility(this); }
@Override public boolean askToActivateAlternativeCosts(Ability ability, Game game) { if (ability instanceof SpellAbility) { Player player = game.getPlayer(controllerId); if (player != null) { this.resetEvoke(); for (AlternativeCost2 evokeCost : evokeCosts) { if (evokeCost.canPay(ability, sourceId, controllerId, game) && player.chooseUse(Outcome.Benefit, new StringBuilder(EVOKE_KEYWORD).append(" the creature for ").append(evokeCost.getText(true)).append(" ?").toString(), ability, game)) { activateEvoke(evokeCost, game); ability.getManaCostsToPay().clear(); ability.getCosts().clear(); for (Iterator it = ((Costs) evokeCost).iterator(); it.hasNext();) { Cost cost = (Cost) it.next(); if (cost instanceof ManaCostsImpl) { ability.getManaCostsToPay().add((ManaCostsImpl) cost.copy()); } else { ability.getCosts().add(cost.copy()); } } } } } } return isActivated(ability, game); }
public EvokeAbility(Card card, String manaString) { super(Zone.ALL, null); name = EVOKE_KEYWORD; this.addEvokeCost(manaString); Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceEffect()), EvokedCondition.instance, "Sacrifice {this} when it enters the battlefield and was evoked."); ability.setRuleVisible(false); addSubAbility(ability); }
private void activateEvoke(AlternativeCost2 cost, Game game) { cost.activate(); // remember zone change counter if (zoneChangeCounter == 0) { Card card = game.getCard(getSourceId()); if (card != null) { zoneChangeCounter = card.getZoneChangeCounter(game); } else { throw new IllegalArgumentException("Evoke source card not found"); } } }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { return card.getAbilities().stream() .filter(ab -> ab instanceof EvokeAbility) .anyMatch(evoke -> ((EvokeAbility) evoke).isActivated(source, game)); } return false; } }
public Slithermuse(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(3); this.toughness = new MageInt(3); // When Slithermuse leaves the battlefield, choose an opponent. If that player has more cards in hand than you, draw cards equal to the difference. this.addAbility(new LeavesBattlefieldTriggeredAbility(new SlithermuseEffect(), false)); // Evoke {3}{U} this.addAbility(new EvokeAbility(this, "{3}{U}")); }
public Mournwhelk(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{B}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(3); this.toughness = new MageInt(3); // When Mournwhelk enters the battlefield, target player discards two cards. Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(2)); ability.addTarget(new TargetPlayer()); this.addAbility(ability); // Evoke {3}{B} this.addAbility(new EvokeAbility(this, "{3}{B}")); }
public Mulldrifter(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // When Mulldrifter enters the battlefield, draw two cards. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(2))); // Evoke {2}{U} this.addAbility(new EvokeAbility(this, "{2}{U}")); }
public Spitebellows(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(6); this.toughness = new MageInt(1); // When Spitebellows leaves the battlefield, it deals 6 damage to target creature. Ability ability = new LeavesBattlefieldTriggeredAbility(new DamageTargetEffect(6, "it"), false); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // Evoke {1}{R}{R} this.addAbility(new EvokeAbility(this, "{1}{R}{R}")); }
public Meadowboon(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(3); this.toughness = new MageInt(3); // When Meadowboon leaves the battlefield, put a +1/+1 counter on each creature target player controls. Ability ability = new LeavesBattlefieldTriggeredAbility(new MeadowboonEffect(), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); // Evoke {3}{W} this.addAbility(new EvokeAbility(this, "{3}{W}")); }
public Aethersnipe(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(4); this.toughness = new MageInt(4); // When Aethersnipe enters the battlefield, return target nonland permanent to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); Target target = new TargetNonlandPermanent(); ability.addTarget(target); this.addAbility(ability); // Evoke {1}{U}{U} this.addAbility(new EvokeAbility(this, "{1}{U}{U}")); }
public IngotChewer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(3); this.toughness = new MageInt(3); // When Ingot Chewer enters the battlefield, destroy target artifact. Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); Target target = new TargetArtifactPermanent(); ability.addTarget(target); this.addAbility(ability); // Evoke {R} this.addAbility(new EvokeAbility(this, "{R}")); }
public NightIncarnate(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(3); this.toughness = new MageInt(4); // Deathtouch this.addAbility(DeathtouchAbility.getInstance()); // When Night Incarnate leaves the battlefield, all creatures get -3/-3 until end of turn. this.addAbility(new LeavesBattlefieldTriggeredAbility( new BoostAllEffect(-3, -3, Duration.EndOfTurn), false )); // Evoke {3}{B} this.addAbility(new EvokeAbility(this, "{3}{B}")); }
public WalkerOfTheGrove(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(7); this.toughness = new MageInt(7); // When Walker of the Grove leaves the battlefield, create a 4/4 green Elemental creature token. this.addAbility(new LeavesBattlefieldTriggeredAbility(new CreateTokenEffect(new WalkerOfTheGroveToken(), 1), false)); // Evoke {4}{G} this.addAbility(new EvokeAbility(this, "{4}{G}")); }
public Briarhorn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(3); this.toughness = new MageInt(3); // Flash this.addAbility(FlashAbility.getInstance()); // When Briarhorn enters the battlefield, target creature gets +3/+3 until end of turn. Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(3,3, Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // Evoke {1}{G} this.addAbility(new EvokeAbility(this, "{1}{G}")); }
public Reveillark(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(4); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // When Reveillark leaves the battlefield, return up to two target creature cards with power 2 or less from your graveyard to the battlefield. Ability ability = new LeavesBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false); ability.addTarget(new TargetCardInYourGraveyard(0,2,filter)); this.addAbility(ability); // Evoke {5}{W} this.addAbility(new EvokeAbility(this, "{5}{W}")); }
public Wispmare(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(1); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // When Wispmare enters the battlefield, destroy target enchantment. Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); ability.addTarget(new TargetEnchantmentPermanent()); this.addAbility(ability); // Evoke {W} this.addAbility(new EvokeAbility(this, "{W}")); }
public Dawnfluke(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(0); this.toughness = new MageInt(3); // Flash this.addAbility(FlashAbility.getInstance()); // When Dawnfluke enters the battlefield, prevent the next 3 damage that would be dealt to any target this turn. Ability ability = new EntersBattlefieldTriggeredAbility(new PreventDamageToTargetEffect(Duration.EndOfTurn, 3)); Target target = new TargetAnyTarget(); ability.addTarget(target); this.addAbility(ability); // Evoke {W} this.addAbility(new EvokeAbility(this, "{W}")); }
public Nevermaker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(2); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // When Nevermaker leaves the battlefield, put target nonland permanent on top of its owner's library. Ability ability = new LeavesBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), false); Target target = new TargetNonlandPermanent(); ability.addTarget(target); this.addAbility(ability); // Evoke {3}{U} this.addAbility(new EvokeAbility(this, "{3}{U}")); }
public Offalsnout(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flash this.addAbility(FlashAbility.getInstance()); // When Offalsnout leaves the battlefield, exile target card from a graveyard. Ability ability = new LeavesBattlefieldTriggeredAbility(new ExileTargetEffect(), false); Target target = new TargetCardInGraveyard(); ability.addTarget(target); this.addAbility(ability); // Evoke {B} this.addAbility(new EvokeAbility(this, "{B}")); }