@Override public AttacksWithCreaturesTriggeredAbility copy() { return new AttacksWithCreaturesTriggeredAbility(this); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getCombat().getAttackingPlayerId().equals(getControllerId())) { int attackerCount = 0; for (UUID attackerId : game.getCombat().getAttackers()) { Permanent permanent = game.getPermanent(attackerId); if (permanent != null && filter.match(game.getPermanent(attackerId), game)) { attackerCount++; } } return attackerCount >= minAttackers; } return false; }
public MilitaryIntelligence(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); // Whenever you attack with two or more creatures, draw a card. this.addAbility(new AttacksWithCreaturesTriggeredAbility(new DrawCardSourceControllerEffect(1), 2)); }
public RagingRiver(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}{R}"); // Whenever one or more creatures you control attack, each defending player divides all creatures without flying he or she controls into a "left" pile and a "right" pile. Then, for each attacking creature you control, choose "left" or "right." That creature can't be blocked this combat except by creatures with flying and creatures in a pile with the chosen label. this.addAbility(new AttacksWithCreaturesTriggeredAbility(new RagingRiverEffect(), 1)); }
public OverwhelmingInstinct(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); // Whenever you attack with three or more creatures, draw a card. this.addAbility(new AttacksWithCreaturesTriggeredAbility(new DrawCardSourceControllerEffect(1), 3)); }
public AncestorDragon(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); this.subtype.add(SubType.DRAGON); this.power = new MageInt(5); this.toughness = new MageInt(6); // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever one or more creatures you control attack, you gain 1 life for each attacking creature. this.addAbility(new AttacksWithCreaturesTriggeredAbility(new AncestorDragonEffect(), 1)); }
public PathOfBravery(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); // As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true), LifeCondition.instance, rule))); // Whenever one or more creatures you control attack, you gain life equal to the number of attacking creatures. this.addAbility(new AttacksWithCreaturesTriggeredAbility(new PathOfBraveryEffect(), 1)); }
public AdmiralAckbar(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CALAMARI); this.subtype.add(SubType.REBEL); this.power = new MageInt(2); this.toughness = new MageInt(3); // When you cast Admiral Ackbar, create two 2/3 blue Rebel Starship artifact creature tokens with spaceflight name B-Wing. this.addAbility(new CastSourceTriggeredAbility(new CreateTokenEffect(new RebelStarshipToken(), 2), false)); // At the beggining of each upkeep, untap all starships you control. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new UntapAllControllerEffect(filter), TargetController.ANY, false)); // Whenever two or more Starship creatures you control attack, draw a card. this.addAbility(new AttacksWithCreaturesTriggeredAbility(new DrawCardSourceControllerEffect(1), 2, filter)); }
public WarcryPhoenix(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.subtype.add(SubType.PHOENIX); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // Haste this.addAbility(HasteAbility.getInstance()); // Whenever you attack with three or more creatures, you may pay {2}{R}. If you do, return Warcry Phoenix from your graveyard to the battlefield tapped and attacking. this.addAbility(new AttacksWithCreaturesTriggeredAbility(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnToBattlefieldUnderOwnerControlSourceEffect(true, true, -1), new ManaCostsImpl("{2}{R}")) .setText("you may pay {2}{R}. If you do, return {this} from your graveyard to the battlefield tapped and attacking"), 3, StaticFilters.FILTER_PERMANENT_CREATURES)); }