@Override public DashAbility copy() { return new DashAbility(this); }
public DashAbility(Card card, String manaString) { super(Zone.ALL, null); name = KEYWORD; this.addDashCost(manaString); Ability ability = new EntersBattlefieldAbility( new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.Custom, false), DashedCondition.instance, "", ""); ability.addEffect(new DashAddDelayedTriggeredAbilityEffect()); ability.setRuleVisible(false); addSubAbility(ability); }
private void activateDash(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("Dash source card not found"); } } }
@Override public boolean askToActivateAlternativeCosts(Ability ability, Game game) { if (ability instanceof SpellAbility) { Player player = game.getPlayer(controllerId); if (player != null) { this.resetDash(); for (AlternativeCost2 dashCost : alternativeSourceCosts) { if (dashCost.canPay(ability, sourceId, controllerId, game) && player.chooseUse(Outcome.Benefit, KEYWORD + " the creature for " + dashCost.getText(true) + " ?", ability, game)) { activateDash(dashCost, game); ability.getManaCostsToPay().clear(); ability.getCosts().clear(); for (Iterator it = ((Costs) dashCost).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); }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { return card.getAbilities().stream() .filter(a -> a instanceof DashAbility) .anyMatch(d -> ((DashAbility)d).isActivated(source, game)); } return false; } }
public AleshasVanguard(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); this.subtype.add(SubType.ORC); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(3); this.toughness = new MageInt(3); // Dash {2}{B} this.addAbility(new DashAbility(this, "{2}{B}")); }
public ScreamreachBrawler(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.ORC); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(2); this.toughness = new MageInt(3); // Dash {1}{R} this.addAbility(new DashAbility(this, "{1}{R}")); }
public MarduScout(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{R}"); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.SCOUT); this.power = new MageInt(3); this.toughness = new MageInt(1); // Dash {1}{R} this.addAbility(new DashAbility(this, "{1}{R}")); }
public KolaghanSkirmisher(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(2); this.toughness = new MageInt(2); // Dash {2}{B} this.addAbility(new DashAbility(this, "{2}{B}")); }
public SprintingWarbrute(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); this.subtype.add(SubType.OGRE); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(5); this.toughness = new MageInt(4); // Sprinting Warbrute attacks each turn if able. this.addAbility(new AttacksEachCombatStaticAbility()); // Dash {3}{R} this.addAbility(new DashAbility(this, "{3}{R}")); }
public RecklessImp(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); this.subtype.add(SubType.IMP); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // Reckless Imp can't block. this.addAbility(new CantBlockAbility()); // Dash {1}{B} this.addAbility(new DashAbility(this, "{1}{B}")); }
public MarduShadowspear(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(1); this.toughness = new MageInt(1); // Whenever Mardu Shadowspear attacks, each opponent loses 1 life. this.addAbility(new AttacksTriggeredAbility(new LoseLifeOpponentsEffect(1),false)); // Dash {1}{B} this.addAbility(new DashAbility(this, "{1}{B}")); }
public Warbringer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); this.subtype.add(SubType.ORC); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(3); this.toughness = new MageInt(3); // Dash costs you pay cost {2} less (as long as this creature is on the battlefield). this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WarbringerSpellsCostReductionEffect())); // Dash {2}{R} this.addAbility(new DashAbility(this, "{2}{R}")); }
public PitilessHorde(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); this.subtype.add(SubType.ORC); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(5); this.toughness = new MageInt(3); // At the beginning of your upkeep, lose 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(2), TargetController.YOU, false)); // Dash {2}{B}{B} this.addAbility(new DashAbility(this, "{2}{B}{B}")); }
public ZurgoBellstriker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ORC, SubType.WARRIOR); this.power = new MageInt(2); this.toughness = new MageInt(2); // Zurgo Bellstriker can't block creatures with power 2 or greater. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockCreaturesSourceEffect(filter))); // Dash {1}{R} this.addAbility(new DashAbility(this, "{1}{R}")); }
public AmbuscadeShaman(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.ORC); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(2); this.toughness = new MageInt(2); // Whenever Ambuscade Shaman or another creature enters the battlefield under your control, that creature gets +2/+2 until end of turn. Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); effect.setText("that creature gets +2/+2 until end of turn"); this.addAbility(new AmbuscadeShamanTriggeredAbility(effect)); // Dash {3}{B} <i>(You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)</i>); this.addAbility(new DashAbility(this, "{3}{B}")); }
public LightningBerserker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(1); this.toughness = new MageInt(1); // {R}: Lightning Berserker gets +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); // Dash {R} this.addAbility(new DashAbility(this, "{R}")); }
public FlamerushRider(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(3); this.toughness = new MageInt(3); // Whenever Flamerush Rider attacks, create a token tapped and attacking that's a copy of another target attacking creature. Exile the token at end of combat. Ability ability = new AttacksTriggeredAbility(new FlamerushRiderEffect(), false); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); // Dash {2}{R}{R} this.addAbility(new DashAbility(this, "{2}{R}{R}")); }
public GoblinHeelcutter(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(3); this.toughness = new MageInt(2); // Whenever Goblin Heelcutter attacks, target creature can't block this turn. Ability ability = new AttacksTriggeredAbility(new CantBlockTargetEffect(Duration.EndOfTurn), false); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // Dash {2}{R} (You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.) this.addAbility(new DashAbility(this, "{2}{R}")); }
public MarduStrikeLeader(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(3); this.toughness = new MageInt(2); // Whenever Mardu Strike Leader attacks, create a 2/1 black Warrior creature token. this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new MarduStrikeLeaderWarriorToken()), false)); // Dash {3}{B} this.addAbility(new DashAbility(this, "{3}{B}")); }