@Override public AtTheBeginOfMainPhaseDelayedTriggeredAbility copy() { return new AtTheBeginOfMainPhaseDelayedTriggeredAbility(this); }
@Override public boolean checkEventType(GameEvent event, Game game) { return checkPhase(event.getType()); }
@Override public String getRule() { StringBuilder sb = new StringBuilder(); switch (targetController) { case YOU: sb.append("At the beginning of your ").append(phaseSelection.toString()).append(", "); break; case OPPONENT: sb.append("At the beginning of an opponent's ").append(phaseSelection.toString()).append(", "); break; case ANY: sb.append("At the beginning of the ").append(phaseSelection.toString()).append(", "); break; case CONTROLLER_ATTACHED_TO: sb.append("At the beginning of the ").append(phaseSelection.toString()).append(" of enchanted creature's controller, "); break; } sb.append(getEffects().getText(modes.getMode())); return sb.toString(); } }
@Override public boolean checkTrigger(GameEvent event, Game game) { switch (targetController) { case ANY: return true; case YOU: return event.getPlayerId().equals(this.controllerId); case OPPONENT: if (game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) { return true; } break; case CONTROLLER_ATTACHED_TO: Permanent attachment = game.getPermanent(sourceId); if (attachment != null && attachment.getAttachedTo() != null) { Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) { return true; } } } return false; }
public ConduitOfEmrakul(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},""); this.subtype.add(SubType.ELDRAZI); this.subtype.add(SubType.WEREWOLF); this.power = new MageInt(5); this.toughness = new MageInt(4); // this card is the second face of double-faced card this.nightCard = true; // Whenever Conduit of Emrakul attacks, add {C}{C} at the beginning of your next main phase this turn. Effect effect = new CreateDelayedTriggeredAbilityEffect( new AtTheBeginOfMainPhaseDelayedTriggeredAbility( new AddManaToManaPoolSourceControllerEffect(Mana.GenericMana(2)), false, TargetController.YOU, AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN_THIS_TURN)); effect.setText("add {C}{C} at the beginning of your next main phase this turn"); this.addAbility(new AttacksTriggeredAbility(effect, false)); }
public ConduitOfStorms(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.WEREWOLF); this.subtype.add(SubType.HORROR); this.power = new MageInt(2); this.toughness = new MageInt(3); this.transformable = true; this.secondSideCardClazz = ConduitOfEmrakul.class; // Whenever Conduit of Storms attacks, add {R} at the beginning of your next main phase this turn. Effect effect = new CreateDelayedTriggeredAbilityEffect( new AtTheBeginOfMainPhaseDelayedTriggeredAbility( new AddManaToManaPoolSourceControllerEffect(Mana.RedMana(1)), false, TargetController.YOU, AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN_THIS_TURN)); effect.setText("add {R} at the beginning of your next main phase this turn"); this.addAbility(new AttacksTriggeredAbility(effect, false)); // {3}{R}{R}: Transform Conduit of Storms. this.addAbility(new TransformAbility()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), new ManaCostsImpl("{3}{R}{R}"))); }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); if (spell != null) { game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game); // mana gets added also if counter is not successful int mana = spell.getConvertedManaCost(); AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(new PlasmCaptureManaEffect(mana), false, TargetController.YOU, PhaseSelection.NEXT_PRECOMBAT_MAIN); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); if (spell != null) { game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game); // mana gets added also if counter is not successful int cmc = spell.getConvertedManaCost(); Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.ColorlessMana(cmc), "your"); effect.setTargetPointer(new FixedTarget(source.getControllerId())); AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); if (ClashEffect.getInstance().apply(game, source)) { Effect effect = new AddManaToManaPoolSourceControllerEffect(new Mana(0, 0, 0, 0, 0, 0, 0, spell.getConvertedManaCost())); AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; } return false; } }