@Override public Effects getEffects() { return getModes().getMode().getEffects(); }
@Override public String getText(Mode mode) { return "turn target " + mode.getTargets().toString() + " face-up"; } }
/** * Adds a mode as selected. If the mode is already selected, it copies the * mode and adds it to the duplicate modes * * @param modeId */ private void addSelectedMode(UUID modeId) { if (selectedModes.contains(modeId) && eachModeMoreThanOnce) { Mode duplicateMode = get(modeId).copy(); duplicateMode.setRandomId(); modeId = duplicateMode.getId(); duplicateModes.put(modeId, duplicateMode); } this.selectedModes.add(modeId); }
public Recuperate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{W}"); // Choose one - You gain 6 life; this.getSpellAbility().addEffect(new GainLifeEffect(6)); // or prevent the next 6 damage that would be dealt to target creature this turn. Mode mode = new Mode(); mode.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, 6)); mode.addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addMode(mode); }
public MobRule(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{R}{R}"); // Choose one // Gain control of all creatures with power 4 or greater until end of turn. Untap those creatures. They gain haste until end of turn. this.getSpellAbility().addEffect(new MobRuleEffect(ComparisonType.MORE_THAN, 3)); // Gain control of all creatures with power 3 or less until end of turn. Untap those creatures. They gain haste until end of turn. Mode mode = new Mode(); mode.addEffect(new MobRuleEffect(ComparisonType.FEWER_THAN, 4)); this.getSpellAbility().addMode(mode); }
public Deface(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}"); // Choose one — // • Destroy target artifact. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); // • Destroy target creature with defender. Mode mode = new Mode(new DestroyTargetEffect()); mode.addTarget(new TargetPermanent(filter)); this.getSpellAbility().addMode(mode); }
public void setActiveMode(Mode mode) { if (selectedModes.contains(mode.getId())) { this.currentMode = mode; } }
public InvokeTheFiremind(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}{R}"); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ManacostVariableValue.instance)); Mode mode = new Mode(); mode.addEffect(new DamageTargetEffect(ManacostVariableValue.instance)); mode.addTarget(new TargetAnyTarget()); this.getSpellAbility().addMode(mode); }
public Fascination(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}"); // Choose one - // * Each player draws X cards. this.getSpellAbility().addEffect(new DrawCardAllEffect(ManacostVariableValue.instance)); // * Each player puts the top X cards of their library into their graveyard. Mode mode = new Mode(); mode.addEffect(new PutTopCardOfLibraryIntoGraveEachPlayerEffect(ManacostVariableValue.instance, TargetController.ANY)); this.getSpellAbility().addMode(mode); }
public void addMode(Mode mode) { this.put(mode.getId(), mode); }
@Override public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); sb.append("Copy target ").append(mode.getTargets().get(0).getTargetName()).append(", except that the copy is red. You may choose new targets for the copy"); return sb.toString(); } }
public FeastOrFamine(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{B}"); // Choose one - Create a 2/2 black Zombie creature token; this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken())); // or destroy target nonartifact, nonblack creature and it can't be regenerated. Mode mode = new Mode(); mode.addEffect(new DestroyTargetEffect(true)); mode.addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addMode(mode); }
public void addTarget(Target target, Boolean addChooseHintFromEffect) { targets.add(target); if (addChooseHintFromEffect) { target.withChooseHint(this.getEffects().getText(this)); } }
public Triskaidekaphobia(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}"); // At the beginning of your upkeep, choose one - Each player with exactly 13 life loses the game, then each player gains 1 life. // Each player with exactly 13 life loses the game, then each player loses 1 life. Ability ability = new BeginningOfUpkeepTriggeredAbility(new TriskaidekaphobiaGainLifeEffect(), TargetController.YOU, false); Mode mode = new Mode(); mode.addEffect(new TriskaidekaphobiaLoseLifeEffect()); ability.addMode(mode); this.addAbility(ability); }
@Override public String getText(Mode mode) { if (staticText != null && !staticText.isEmpty()) { return staticText; } StringBuilder sb = new StringBuilder(); sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" has base power and toughness "); sb.append(power).append('/').append(toughness).append(' ').append(duration.toString()); return sb.toString(); }
public RetreatToValakut(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}"); // <i>Landfall</i>- Whenever a land enters the battlefield under your control, choose one - Target creature gets +2/+0 until end of turn; LandfallAbility ability = new LandfallAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), false); ability.addTarget(new TargetCreaturePermanent()); // or Target creature can't block this turn. Mode mode = new Mode(); mode.addEffect(new CantBlockTargetEffect(Duration.EndOfTurn)); mode.addTarget(new TargetCreaturePermanent()); ability.addMode(mode); this.addAbility(ability); }
@Override public Effects getAllEffects() { Effects allEffects = new Effects(); for (Mode mode : getModes().values()) { allEffects.addAll(mode.getEffects()); } return allEffects; }
public Fortify(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}"); // Choose one - Creatures you control get +2/+0 until end of turn; or creatures you control get +0/+2 until end of turn. this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn)); Mode mode = new Mode(); mode.addEffect(new BoostControlledEffect(0, 2, Duration.EndOfTurn)); this.getSpellAbility().addMode(mode); }
@Override public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); if (!mode.getTargets().isEmpty()) { sb.append("Target ").append(mode.getTargets().get(0).getTargetName()); } else { sb.append("It "); } sb.append(" becomes ").append(addedSubType).append(" in addition to its other types ").append(duration.toString()); return sb.toString(); } }