@Override public boolean apply(Game game, Ability source) { FilterCard protectionFilter = (FilterCard) ((ProtectionAbility) ability).getFilter(); protectionFilter.add(new ColorPredicate(choice.getColor())); protectionFilter.setMessage(choice.getChoice()); ((ProtectionAbility) ability).setFilter(protectionFilter); return super.apply(game, source); }
public WindreaperFalcon(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{1}{R}{G}"); this.subtype.add("Bird"); this.power = new MageInt(1); this.toughness = new MageInt(1); // Flying this.addAbility(FlyingAbility.getInstance()); // protection from blue this.addAbility(ProtectionAbility.from(ObjectColor.BLUE)); }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (creature != null) { FilterCard protectionFilter = (FilterCard) ((ProtectionAbility) ability).getFilter(); protectionFilter.add(new ColorPredicate(choice.getColor())); protectionFilter.setMessage(choice.getChoice()); ((ProtectionAbility) ability).setFilter(protectionFilter); creature.addAbility(ability, source.getSourceId(), game); return true; } return false; }
public DrossHarvester(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add("Horror"); this.power = new MageInt(4); this.toughness = new MageInt(4); // Protection from white this.addAbility(ProtectionAbility.from(ObjectColor.WHITE)); // At the beginning of your end step, you lose 4 life. this.addAbility( new BeginningOfEndStepTriggeredAbility( new LoseLifeSourceControllerEffect(4), TargetController.YOU, false)); // Whenever a creature dies, you gain 2 life. this.addAbility(new DiesCreatureTriggeredAbility(new GainLifeEffect(2), false)); }
public AkromaAngelOfWrath(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{5}{W}{W}{W}"); this.supertype.add("Legendary"); this.subtype.add("Angel"); this.power = new MageInt(6); this.toughness = new MageInt(6); this.addAbility(FlyingAbility.getInstance()); this.addAbility(FirstStrikeAbility.getInstance()); this.addAbility(VigilanceAbility.getInstance()); this.addAbility(TrampleAbility.getInstance()); this.addAbility(HasteAbility.getInstance()); // protection from black and from red this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED)); }
public SwordOfBodyAndMind(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[] {CardType.ARTIFACT}, "{3}"); this.subtype.add("Equipment"); // Equipped creature gets +2/+2 and has protection from green and from blue. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)); Effect effect = new GainAbilityAttachedEffect( ProtectionAbility.from(ObjectColor.GREEN, ObjectColor.BLUE), AttachmentType.EQUIPMENT); effect.setText("and has protection from green and from blue"); ability.addEffect(effect); this.addAbility(ability); // Whenever equipped creature deals combat damage to a player, you create a 2/2 green Wolf // creature token and that player puts the top ten cards of his or her library into his or her // graveyard. this.addAbility(new SwordOfBodyAndMindAbility()); // Equip {2} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); }