public BalduvianHorde(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); this.subtype.add(SubType.HUMAN, SubType.BARBARIAN); this.power = new MageInt(5); this.toughness = new MageInt(5); // When Balduvian Horde enters the battlefield, sacrifice it unless you discard a card at random. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(true)))); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { DiscardCardCost cost = new DiscardCardCost(); if (controller.chooseUse(Outcome.Benefit, "Do you wish to discard a card to prevent the 3 damage to you?", source, game) && cost.canPay(source, source.getSourceId(), source.getControllerId(), game) && cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { return true; } if (controller.damage(3, sourcePermanent.getId(), game, false, true) > 0) { sourcePermanent.tap(game); return true; } } return false; }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { for (Effect sourceEffect : sourceAbility.getEffects()) { if (sourceEffect instanceof DoIfCostPaid) { Cost doCosts = ((DoIfCostPaid) sourceEffect).getCost(); if (doCosts instanceof Costs) { Costs costs = (Costs) doCosts; for (Object cost : costs) { if (cost instanceof DiscardCardCost) { DiscardCardCost discardCost = (DiscardCardCost) cost; int cmc = 0; for (Card card : discardCost.getCards()) { cmc += card.getConvertedManaCost(); } return cmc; } } } } } return 0; }
public PillagingHorde(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.BARBARIAN); this.power = new MageInt(5); this.toughness = new MageInt(5); // When Pillaging Horde enters the battlefield, sacrifice it unless you discard a card at random. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(true)))); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { DiscardCardCost cost = (DiscardCardCost) source.getCosts().get(0); if (cost != null) { List<Card> cards = cost.getCards(); if (cards.size() == 1 && cards.get(0).isLand()) { Effect effect = new DamageTargetEffect(2); effect.setTargetPointer(getTargetPointer()); effect.apply(game, source); } } return true; } return false; }
public MinotaurExplorer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); this.subtype.add(SubType.MINOTAUR); this.subtype.add(SubType.SCOUT); this.power = new MageInt(3); this.toughness = new MageInt(3); // When Minotaur Explorer enters the battlefield, sacrifice it unless you discard a card at random. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(true)))); }
@Override public boolean apply(Game game, Ability source) { int damageToDeal = 2; outerloop: for (Cost cost : source.getCosts()) { if (cost instanceof DiscardCardCost) { for (Card card : ((DiscardCardCost) cost).getCards()) { if (card.getColor(game).isMulticolored()) { damageToDeal = 4; break outerloop; } } } } return new DamageTargetEffect(damageToDeal).apply(game, source); } }
public MindOverMatter(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}{U}{U}{U}"); // Discard a card: You may tap or untap target artifact, creature, or land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new DiscardCardCost()); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { DiscardCardCost cost = (DiscardCardCost) source.getCosts().get(0); if (cost != null) { List<Card> cards = cost.getCards(); if (cards.size() == 1 && cards.get(0).isLand()) { Effect effect = new AddCountersTargetEffect(CounterType.BOUNTY.createInstance()); effect.setTargetPointer(getTargetPointer()); effect.apply(game, source); } else { player.drawCards(2, game); } } return true; } return false; }
public TunnelerWurm(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{G}{G}"); this.subtype.add(SubType.WURM); this.power = new MageInt(6); this.toughness = new MageInt(6); // Discard a card: Regenerate Tunneler Wurm. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new DiscardCardCost())); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent == null && source.getAbilityType() == AbilityType.STATIC) { permanent = game.getPermanentEntering(source.getSourceId()); } if (controller != null && permanent != null) { SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); if (spellAbility != null && spellAbility.getSourceId().equals(source.getSourceId()) && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { int cmc = 0; for (Cost cost : spellAbility.getCosts()) { if (cost instanceof DiscardCardCost && !((DiscardCardCost) cost).getCards().isEmpty()) { cmc = ((DiscardCardCost) cost).getCards().get(0).getConvertedManaCost(); } if (cmc > 0) { return new AddCountersSourceEffect(CounterType.P1P1.createInstance(cmc), true).apply(game, source); } } } return true; } return false; } }
public MurderersAxe(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +2/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); // Equip — Discard a card. this.addAbility(new EquipAbility(Outcome.AddAbility, new DiscardCardCost())); }
public PutridRaptor(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.DINOSAUR); this.subtype.add(SubType.BEAST); this.power = new MageInt(4); this.toughness = new MageInt(4); // Morph-Discard a Zombie card. this.addAbility(new MorphAbility(this, new DiscardCardCost(filter))); }
public FallowWurm(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); this.subtype.add(SubType.WURM); this.power = new MageInt(4); this.toughness = new MageInt(4); // When Fallow Wurm enters the battlefield, sacrifice it unless you discard a land card. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(new FilterLandCard("a land card"))))); }
public ViashinoRacketeer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.VIASHINO); this.subtype.add(SubType.ROGUE); this.power = new MageInt(2); this.toughness = new MageInt(1); // When Viashino Racketeer enters the battlefield, you may discard a card. If you do, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new DiscardCardCost()))); }
public KeldonRaider(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(4); this.toughness = new MageInt(3); // When Keldon Raider enters the battlefield, you may discard a card. If you do, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new DiscardCardCost()))); }
public ThalakosDrifters(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}"); this.subtype.add(SubType.THALAKOS); this.power = new MageInt(3); this.toughness = new MageInt(3); // Discard a card: Thalakos Drifters gains shadow until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(ShadowAbility.getInstance(), Duration.EndOfTurn), new DiscardCardCost())); }
public StromkirkCondemned(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}"); this.subtype.add(SubType.VAMPIRE); this.subtype.add(SubType.HORROR); this.power = new MageInt(2); this.toughness = new MageInt(2); // Discard a card: Vampires you control get +1/+1 until end of turn. Activate this ability only once each turn. this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false), new DiscardCardCost())); }
public RavenousBloodseeker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); this.subtype.add(SubType.VAMPIRE); this.subtype.add(SubType.BERSERKER); this.power = new MageInt(1); this.toughness = new MageInt(3); // Discard a card: Ravenous Bloodseeker gets +2/-2 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, -2, Duration.EndOfTurn), new DiscardCardCost())); }
public SkirgeFamiliar(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); this.subtype.add(SubType.IMP); this.power = new MageInt(3); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // Discard a card: Add {B}. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana(1), new DiscardCardCost(false))); }