@Override public AttacksFirstTimeTriggeredAbility copy() { return new AttacksFirstTimeTriggeredAbility(this); } }
public AttacksFirstTimeTriggeredAbility(Effect effect, boolean optional) { super(Zone.BATTLEFIELD, effect, optional); this.addWatcher(new AttackedThisTurnWatcher()); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (!event.getSourceId().equals(this.getSourceId())) { return false; } AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class); if (watcher == null) { return false; } Permanent sourcePerm = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (sourcePerm == null) { return false; } for (MageObjectReference mor : watcher.getAttackedThisTurnCreaturesCounts().keySet()) { if (mor.refersTo(sourcePerm, game) && watcher.getAttackedThisTurnCreaturesCounts().get(mor) > 1) { return false; } } return true; }
public ScourgeOfTheThrone(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); this.subtype.add(SubType.DRAGON); this.power = new MageInt(5); this.toughness = new MageInt(5); // Flying this.addAbility(FlyingAbility.getInstance()); // Dethrone (Whenever this creature attacks the player with the most life or tied for most life, put a +1/+1 counter on it.) this.addAbility(new DethroneAbility()); // Whenever Scourge of the Throne attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, untap all attacking creatures. After this phase, there is an additional combat phase. TriggeredAbility ability = new AttacksFirstTimeTriggeredAbility( new UntapAllControllerEffect( StaticFilters.FILTER_ATTACKING_CREATURES, "untap all attacking creatures" ), false ); ability.addEffect(new AdditionalCombatPhaseEffect()); this.addAbility(new ConditionalInterveningIfTriggeredAbility( ability, ScourgeOfTheThroneCondition.instance, "Whenever {this} attacks for the first time each turn, " + "if it's attacking the player with the most life or tied for most life, " + "untap all attacking creatures. After this phase, " + "there is an additional combat phase." )); }
public AureliaTheWarleader(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{W}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ANGEL); this.power = new MageInt(3); this.toughness = new MageInt(4); // Flying, vigilance, haste this.addAbility(FlyingAbility.getInstance()); this.addAbility(VigilanceAbility.getInstance()); this.addAbility(HasteAbility.getInstance()); // Whenever Aurelia, the Warleader attacks for the first time each turn, untap all creatures you control. After this phase, there is an additional combat phase. Ability ability = new AttacksFirstTimeTriggeredAbility( new UntapAllControllerEffect( StaticFilters.FILTER_CONTROLLED_CREATURES, "untap all creatures you control" ), false); ability.addEffect(new AdditionalCombatPhaseEffect()); this.addAbility(ability); }
public GodoBanditWarlord(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.BARBARIAN); this.power = new MageInt(3); this.toughness = new MageInt(3); // When Godo, Bandit Warlord enters the battlefield, you may search your library for an Equipment card and put it onto the battlefield. If you do, shuffle your library. this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true), true)); // Whenever Godo attacks for the first time each turn, untap it and all Samurai you control. After this phase, there is an additional combat phase. Ability ability = new AttacksFirstTimeTriggeredAbility(new UntapSourceEffect().setText("untap it"), false); ability.addEffect(new UntapAllControllerEffect(filter2, "and all Samurai you control")); ability.addEffect(new AdditionalCombatPhaseEffect()); this.addAbility(ability); }