public DoUnlessAnyPlayerPaysEffect(Effect effect, Cost cost, String chooseUseText) { super(Outcome.Neutral); this.executingEffects.add(effect); this.cost = cost; this.chooseUseText = chooseUseText; }
public DoUnlessTargetPlayerOrTargetsControllerPaysEffect(Effect effect, Effect otherwiseEffect, Cost cost, String chooseUseText) { super(Outcome.Detriment); this.executingEffects.add(effect); this.otherwiseEffect = otherwiseEffect; this.cost = cost; this.chooseUseText = chooseUseText; }
public DoUnlessAnyPlayerPaysEffect(Effect effect, DynamicValue genericMana) { super(Outcome.Detriment); this.genericMana = genericMana; this.executingEffects.add(effect); }
public void addEffectWon(Effect effect) { if (effect != null) { executingEffectsWon.add(effect); } }
public void addEffect(Effect effect) { if (effect != null) { executingEffects.add(effect); } }
public DoUnlessControllerPaysEffect(Effect effect, Cost cost, String chooseUseText) { super(Outcome.Benefit); this.executingEffects.add(effect); this.cost = cost; this.chooseUseText = chooseUseText; }
public EntersBattlefieldEffect(Effect baseEffect, Condition condition, String text, boolean selfScope, boolean optional, EnterEventType enterEventType) { super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), selfScope); this.baseEffects.add(baseEffect); this.enterEventType = enterEventType; this.text = text; this.condition = condition; this.optional = optional; }
public KinshipBaseEffect(Effect kinshipEffect) { super(kinshipEffect.getOutcome()); this.kinshipEffects.add(kinshipEffect); this.staticText = "you may look at the top card of your library. If it shares a creature type with {this}, you may reveal it. If you do, "; }
public Effects(final Effects effects) { for (Effect effect : effects) { this.add(effect.copy()); } }
public AsTurnedFaceUpEffect(Effect baseEffect, boolean optional) { super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), true); this.baseEffects.add(baseEffect); this.optional = optional; }
public PutIntoGraveFromAnywhereEffect(Effect baseEffect, Condition condition, String text, boolean selfScope, boolean optional) { super(Duration.EndOfGame, baseEffect.getOutcome(), selfScope); this.baseEffects.add(baseEffect); this.text = text; this.condition = condition; this.optional = optional; }
public Mode(Effect effect) { this.id = UUID.randomUUID(); this.targets = new Targets(); this.effects = new Effects(); if (effect != null) { this.effects.add(effect); } }
@Override public Effects getEffects(Game game, EffectType effectType) { Effects typedEffects = new Effects(); for (Effect effect : getEffects()) { if (effect.getEffectType() == effectType) { typedEffects.add(effect); } } return typedEffects; }
@Override public boolean checkTrigger(GameEvent event, Game game) { DamagedEvent damageEvent = (DamagedEvent) event; if (damageEvent.isCombatDamage()) { if (event.getSourceId().equals(this.sourceId)) { this.getEffects().clear(); this.getEffects().add(new GainLifeEffect(damageEvent.getAmount())); return true; } } return false; }
public OrbitalBombardment(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{W}{W}"); // Destroy all non-Starship creatuers. getSpellAbility().getEffects().add(new DestroyAllEffect(new FilterCreaturePermanent(filter))); }
public SabaccGame(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}"); /* * Choose target permanent an opponent controls. That opponent chooses a permanent you control. * Flip a coin. If you win the flip, gain control of the permanent you chose. * If you lose the flip, your opponent gains control of the permanent they chose. */ this.getSpellAbility().getEffects().add(new SabaccGameEffect()); this.getSpellAbility().getTargets().add(new TargetPermanent(filter)); }
public SpectralSearchlight(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // {T}: Choose a player. That player adds one mana of any color they chooses. ManaEffect effect = new SpectralSearchlightManaEffect("chosen player"); effect.setText("That player adds one mana of any color they choose"); Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); // choosing player as first effect, before adding mana effect ability.getEffects().add(0, new ChoosePlayerEffect(Outcome.PutManaInPool)); this.addAbility(ability); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (isControlledBy(event.getTargetId())) { getEffects().clear(); getEffects().add(new AddCountersSourceEffect(CounterType.P1P1.createInstance(event.getAmount()))); return true; } return false; }
public SurgingDementia(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Ripple 4 this.addAbility(new RippleAbility(4).setRuleAtTheTop(true)); // Target player discards a card. this.getSpellAbility().getEffects().add(new DiscardTargetEffect(1)); this.getSpellAbility().getTargets().add(new TargetPlayer()); }
public PartWater(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); // X target creatures gain islandwalk until end of turn. Effect effect = new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn); effect.setText("X target creatures gain islandwalk until end of turn"); this.getSpellAbility().getEffects().add(effect); this.getSpellAbility().getTargets().add(new TargetCreaturePermanent()); this.getSpellAbility().setTargetAdjuster(PartWaterAdjuster.instance); }