@Override public AttacksAllTriggeredAbility copy() { return new AttacksAllTriggeredAbility(this); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getSourceId()); if (filter.match(permanent, getSourceId(), getControllerId(), game)) { if (attacksYouOrYourPlaneswalker) { boolean check = false; if (event.getTargetId().equals(getControllerId())) { check = true; } else { Permanent planeswalker = game.getPermanent(event.getTargetId()); if (planeswalker != null && planeswalker.isPlaneswalker() && planeswalker.isControlledBy(getControllerId())) { check = true; for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(permanent.getId())); UUID playerId = controller ? permanent.getControllerId() : game.getCombat().getDefendingPlayerId(permanent.getId(), game); if (playerId != null) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(playerId));
@Override public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null) { Player player = game.getPlayer(permanent.getControllerId()); if (player != null && player.hasOpponent(getControllerId(), game)) { getEffects().setTargetPointer(new FixedTarget(permanent, game)); return true; } } } return false; }
public RighteousCause(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}{W}"); // Whenever a creature attacks, you gain 1 life. this.addAbility(new AttacksAllTriggeredAbility(new GainLifeEffect(1), false)); }
public CavalcadeOfCalamity(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); // Whenever a creature you control with power 1 or less attacks, Cavalcade of Calamity deals 1 damage to the player or planeswalker that creature is attacking. this.addAbility(new AttacksAllTriggeredAbility( new CavalcadeOfCalamityEffect(), false, filter, SetTargetPointer.PERMANENT, false, false )); }
public Caltrops(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Whenever a creature attacks, Caltrops deals 1 damage to it. Effect effect = new DamageTargetEffect(1); effect.setText("{this} deals 1 damage to it"); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, false)); }
public LostInTheWoods(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); // Whenever a creature attacks you or a planeswalker you control, reveal the top card of your library. If it's a Forest card, remove that creature from combat. Then put the revealed card on the bottom of your library. this.addAbility(new AttacksAllTriggeredAbility(new LostInTheWoodsEffect(), false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true)); }
public BloodReckoning(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); // Whenever a creature attacks you or a planeswalker you control, that creature's controller loses 1 life. Effect effect = new LoseLifeTargetEffect(1); effect.setText("that creature's controller loses 1 life"); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true)); }
public ImpulsiveManeuvers(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{R}"); // Whenever a creature attacks, flip a coin. If you win the flip, the next time that creature would deal combat damage this turn, it deals double that damage instead. If you lose the flip, the next time that creature would deal combat damage this turn, prevent that damage. this.addAbility(new AttacksAllTriggeredAbility(new ImpulsiveManeuversEffect(), false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, false)); }
public LeechingSliver(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); this.subtype.add(SubType.SLIVER); this.power = new MageInt(1); this.toughness = new MageInt(1); // Whenever a Sliver you control attacks, defending player loses 1 life. this.addAbility(new AttacksAllTriggeredAbility(new LoseLifeDefendingPlayerEffect(1, false), false, filter, SetTargetPointer.PLAYER, false)); }
public Riddlekeeper(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.subtype.add(SubType.HOMUNCULUS); this.power = new MageInt(1); this.toughness = new MageInt(4); // Whenever a creature attacks you or a planeswalker you control, that creature's controller puts the top two cards of their library into their graveyard. Effect effect = new PutTopCardOfLibraryIntoGraveTargetEffect(2); effect.setText("that creature's controller puts the top two cards of their library into their graveyard"); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true)); }
public WarsToll(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); // Whenever an opponent taps a land for mana, tap all lands that player controls. this.addAbility(new TapForManaAllTriggeredAbility(new WarsTollTapEffect(), filterOpponentLand, SetTargetPointer.PLAYER)); // If a creature an opponent controls attacks, all creatures that opponent controls attack if able. this.addAbility(new AttacksAllTriggeredAbility(new WarsTollEffect(), false, filterOpponentCreature, SetTargetPointer.PERMANENT, true)); }
public MarchesasDecree(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); // When Marchesa's Decree enters the battlefield, you become the monarch. this.addAbility(new EntersBattlefieldTriggeredAbility(new BecomesMonarchSourceEffect(), false)); // Whenever a creature attacks you or a planeswalker you control, the controller of that creature loses 1 life. Effect effect = new LoseLifeTargetEffect(1); effect.setText("that creature's controller loses 1 life"); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true)); }
public IsperiaSupremeJudge(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}{U}{U}"); this.subtype.add(SubType.SPHINX); addSuperType(SuperType.LEGENDARY); this.power = new MageInt(6); this.toughness = new MageInt(4); // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever a creature attacks you or a planeswalker you control, you may draw a card. this.addAbility(new AttacksAllTriggeredAbility(new DrawCardSourceControllerEffect(1), true, true)); }
public PatronOfTheKitsune(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(5); this.toughness = new MageInt(6); // Fox offering (You may cast this card any time you could cast an instant by sacrificing a Fox and paying the difference in mana costs between this and the sacrificed Fox. Mana cost includes color.) this.addAbility(new OfferingAbility(SubType.FOX)); // Whenever a creature attacks, you may gain 1 life. this.addAbility(new AttacksAllTriggeredAbility(new GainLifeEffect(1), true)); }
public CrownOfDoom(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Whenever a creature attacks you or a planeswalker you control, it gets +2/+0 until end of turn. Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn); effect.setText("it gets +2/+0 until end of turn"); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true)); //TODO: Make ability properly copiable // {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.instance); ability.addTarget(new TargetPlayer(1, 1, false, filter)); this.addAbility(ability); }
public SilumgarTheDriftingDeath(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DRAGON); this.power = new MageInt(3); this.toughness = new MageInt(7); // Flying this.addAbility(FlyingAbility.getInstance()); // Hexproof this.addAbility(HexproofAbility.getInstance()); // Whenever a Dragon you control attacks, creatures defending player controls get -1/-1 until end of turn. this.addAbility( new AttacksAllTriggeredAbility( new UnboostCreaturesTargetPlayerEffect(-1, -1), false, filter, SetTargetPointer.PLAYER, false)); }
public KolaghanTheStormsFury(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DRAGON); this.power = new MageInt(4); this.toughness = new MageInt(5); // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever a Dragon you control attacks, creatures you control get +1/+0 until end of turn. this.addAbility(new AttacksAllTriggeredAbility( new BoostControlledEffect(1, 0, Duration.EndOfTurn, FILTER_PERMANENT_CREATURES, false), false, filter, SetTargetPointer.NONE, false)); // Dash {3}{B}{R} this.addAbility(new DashAbility(this, "{3}{B}{R}")); }
public SlumberingDragon(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); this.subtype.add(SubType.DRAGON); this.power = new MageInt(3); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // Slumbering Dragon can't attack or block unless it has five or more +1/+1 counters on it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SlumberingDragonEffect())); // Whenever a creature attacks you or a planeswalker you control, put a +1/+1 counter on Slumbering Dragon. this.addAbility(new AttacksAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true)); }
public KestiaTheCultivator(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{G}{W}{U}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NYMPH); this.power = new MageInt(4); this.toughness = new MageInt(4); // Bestow {3}{G}{W}{U} this.addAbility(new BestowAbility(this, "{3}{G}{W}{U}")); // Enchanted creature gets +4/+4. this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, new BoostEnchantedEffect(4, 4, Duration.WhileOnBattlefield) )); // Whenever an enchanted creature or enchantment creature you control attacks, draw a card. this.addAbility(new AttacksAllTriggeredAbility( new DrawCardSourceControllerEffect(1), false, filter, SetTargetPointer.NONE, false )); }