public FrontierSiege(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}"); // As Frontier Siege enters the battlefield, choose Khans or Dragons. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of each of your main phases, add {G}{G}. this.addAbility(new ConditionalTriggeredAbility( new FrontierSiegeKhansTriggeredAbility(), new ModeChoiceSourceCondition("Khans"), ruleTrigger1)); // * Dragons - Whenever a creature with flying enters the battlefield under your control, you may have it fight target creature you don't control. Ability ability2 = new ConditionalTriggeredAbility( new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new FrontierSiegeFightEffect(), filter, true, SetTargetPointer.PERMANENT, ""), new ModeChoiceSourceCondition("Dragons"), ruleTrigger2); ability2.addTarget(new TargetCreaturePermanent(filter2)); this.addAbility(ability2); }
public RootsOfLife(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); // As Roots of Life enters the battlefield, choose Island or Swamp. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Island or Swamp?", "Island", "Swamp"), null, "As {this} enters the battlefield, choose Island or Swamp.", "")); // Whenever a land of the chosen type an opponent controls becomes tapped, you gain 1 life. // * Island chosen this.addAbility(new ConditionalTriggeredAbility( new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, islandFilter), new ModeChoiceSourceCondition("Island"), ruleTrigger1)); // * Swamp chosen this.addAbility(new ConditionalTriggeredAbility( new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, swampFilter), new ModeChoiceSourceCondition("Swamp"), ruleTrigger2)); }
public OutpostSiege(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}"); // As Outpost Siege enters the battlefield, choose Khans or Dragons. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of your upkeep, exile the top card of your library. Until end of turn, you may play that card. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new OutpostSiegeExileEffect(), TargetController.YOU, false), new ModeChoiceSourceCondition("Khans"), ruleTrigger1)); // * Dragons - Whenever a creature you control leaves the battlefield, Outpost Siege deals 1 damage to any target. Ability ability2 = new ConditionalTriggeredAbility( new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, null, new DamageTargetEffect(1), new FilterControlledCreaturePermanent(), "", false), new ModeChoiceSourceCondition("Dragons"), ruleTrigger2); ability2.addTarget(new TargetAnyTarget()); this.addAbility(ability2); }
public CitadelSiege(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); // As Citadel Siege enters the battlefield, choose Khans or Dragons. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of combat on your turn, put two +1/+1 counters on target creature you control. Ability ability = new ConditionalTriggeredAbility( new BeginningOfCombatTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), TargetController.YOU, false), new ModeChoiceSourceCondition("Khans"), ruleTrigger1); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); // * Dragons - At the beginning of combat on each opponent's turn, tap target creature that player controls. ability = new ConditionalTriggeredAbility( new BeginningOfCombatTriggeredAbility(new TapTargetEffect(), TargetController.OPPONENT, false), new ModeChoiceSourceCondition("Dragons"), ruleTrigger2); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); }
public PalaceSiege(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}{B}"); // As Palace Siege enters the battlefield, choose Khans or Dragons. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, "As {this} enters the battlefield, choose Khans or Dragons.","")); // * Khans - At the beginning of your upkeep, return target creature card from your graveyard to your hand. Ability ability1 = new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), TargetController.YOU, false), new ModeChoiceSourceCondition("Khans"), ruleTrigger1); ability1.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); this.addAbility(ability1); // * Dragons - At the beginning of your upkeep, each opponent loses 2 life and you gain 2 life. Ability ability2 = new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new LoseLifeOpponentsEffect(2), TargetController.YOU, false), new ModeChoiceSourceCondition("Dragons"), ruleTrigger2); Effect effect = new GainLifeEffect(2); effect.setText("and you gain 2 life"); ability2.addEffect(effect); this.addAbility(ability2); }
public MonasterySiege(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); // As Monastery Siege enters the battlefield, choose Khans or Dragons. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of your draw step, draw an additional card, then discard a card. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfDrawTriggeredAbility(new DrawDiscardControllerEffect(1, 1), TargetController.YOU, false), new ModeChoiceSourceCondition("Khans"), "• Khans — At the beginning of your draw step, draw an additional card, then discard a card.")); // * Dragons - Spells your opponents cast that target you or a permanent you control cost {2} more to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MonasterySiegeCostIncreaseEffect())); }
@Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (new ModeChoiceSourceCondition("Dragons").apply(game, source)) { if (abilityToModify instanceof SpellAbility) { if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { for (UUID modeId : abilityToModify.getModes().getSelectedModes()) { Mode mode = abilityToModify.getModes().get(modeId); for (Target target : mode.getTargets()) { for (UUID targetUUID : target.getTargets()) { if (targetUUID.equals(source.getControllerId())) { return true; } Permanent permanent = game.getPermanent(targetUUID); if (permanent != null && permanent.isControlledBy(source.getControllerId())) { return true; } } } } } } } return false; }