forked from External/mage
rework allowing additional modes conditionally
This commit is contained in:
parent
05e738efb5
commit
c79ed1ea72
15 changed files with 18 additions and 22 deletions
|
|
@ -33,7 +33,7 @@ public final class AkromasWill extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both instead."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Creatures you control gain flying, vigilance, and double strike until end of turn.
|
||||
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class DiscipleOfPerdition extends CardImpl {
|
|||
// * You draw a card and you lose 1 life.
|
||||
Ability ability = new DiesSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, true), false);
|
||||
ability.getModes().setChooseText("choose one. If you have exactly 13 life, you may choose both.");
|
||||
ability.getModes().setMoreCondition(new LifeCompareCondition(TargetController.YOU, ComparisonType.EQUAL_TO, 13));
|
||||
ability.getModes().setMoreCondition(2, new LifeCompareCondition(TargetController.YOU, ComparisonType.EQUAL_TO, 13));
|
||||
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
|
||||
|
||||
// * Exile target opponent's graveyard. That player loses 1 life.
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class DrownInDreams extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Target player draws X cards.
|
||||
this.getSpellAbility().addEffect(new DrawCardTargetEffect(GetXValue.instance));
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ public final class FlameOfAnor extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{R}");
|
||||
|
||||
// Choose one. If you control a Wizard as you cast this spell, you may choose two instead.
|
||||
this.getSpellAbility().getModes().setMoreCondition(condition);
|
||||
this.getSpellAbility().getModes().setMoreLimit(2);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, condition);
|
||||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a Wizard as you cast this spell, you may choose two instead."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public final class JeskasWill extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both instead."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Add {R} for each card in target opponent's hand.
|
||||
this.getSpellAbility().addEffect(new JeskasWillEffect());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class KamahlsWill extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Until end of turn, any number of target lands you control become 1/1 Elemental creatures with vigilance, indestructible, and haste. They're still lands.
|
||||
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public final class KlauthsWill extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Breathe Flame — Klauth's Will deals X damage to each creature without flying.
|
||||
this.getSpellAbility().addEffect(new DamageAllEffect(GetXValue.instance, filter));
|
||||
|
|
@ -76,4 +76,4 @@ enum KlauthsWillAdjuster implements TargetAdjuster {
|
|||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class LetsPlayAGame extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"choose one. If there are four or more card types among cards in your graveyard, choose one or more instead."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(DeliriumCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(3, DeliriumCondition.instance);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DELIRIUM);
|
||||
this.getSpellAbility().addHint(CardTypesInGraveyardHint.YOU);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class MoltenCollapse extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{R}");
|
||||
|
||||
// Choose one. If you descended this turn, you may choose both instead.
|
||||
this.getSpellAbility().getModes().setMoreCondition(DescendedThisTurnCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, DescendedThisTurnCondition.instance);
|
||||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you descended this turn, you may choose both instead."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class SakashimasWill extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Target opponent chooses a creature they control. You gain control of it.
|
||||
this.getSpellAbility().addEffect(new SakashimasWillStealEffect());
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class SeeDouble extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If an opponent has eight or more cards in their graveyard, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(CardsInOpponentGraveyardCondition.EIGHT);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, CardsInOpponentGraveyardCondition.EIGHT);
|
||||
this.getSpellAbility().addHint(CardsInOpponentGraveyardCondition.EIGHT.getHint());
|
||||
|
||||
// * Copy target spell. You may choose new targets for the copy.
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class SoulTransfer extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control an artifact and an enchantment as you cast this spell, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(SoulTransferCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, SoulTransferCondition.instance);
|
||||
|
||||
// • Exile target creature or planeswalker.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public final class SzatsWill extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"Choose one. If you control a commander as you cast this spell, you may choose both."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
|
||||
this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
|
||||
|
||||
// • Each opponent sacrifices a creature they control with the greatest power.
|
||||
this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(filter));
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class WailOfTheForgotten extends CardImpl {
|
|||
this.getSpellAbility().getModes().setChooseText(
|
||||
"choose one. If there are eight or more permanent cards in your graveyard as you cast this spell, choose one or more instead."
|
||||
);
|
||||
this.getSpellAbility().getModes().setMoreCondition(DescendCondition.EIGHT);
|
||||
this.getSpellAbility().getModes().setMoreCondition(3, DescendCondition.EIGHT);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DESCEND_8);
|
||||
|
||||
// * Return target nonland permanent to its owner's hand.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> implements Copyable<Modes>
|
|||
private int maxPawPrints;
|
||||
private Filter maxModesFilter; // calculates the max number of available modes
|
||||
private Condition moreCondition; // allows multiple modes choose (example: choose one... if condition, you may choose both)
|
||||
private int moreLimit = Integer.MAX_VALUE; // if multiple modes are allowed, this limits how many additional modes may be chosen (usually doesn't need to change)
|
||||
private int moreLimit; // if multiple modes are allowed, this limits how many additional modes may be chosen
|
||||
|
||||
private boolean limitUsageByOnce = false; // limit mode selection to once per game
|
||||
private boolean limitUsageResetOnNewTurn = false; // reset once per game limit on new turn, example: Galadriel, Light of Valinor
|
||||
|
|
@ -303,12 +303,9 @@ public class Modes extends LinkedHashMap<UUID, Mode> implements Copyable<Modes>
|
|||
this.put(mode.getId(), mode);
|
||||
}
|
||||
|
||||
public void setMoreCondition(Condition moreCondition) {
|
||||
this.moreCondition = moreCondition;
|
||||
}
|
||||
|
||||
public void setMoreLimit(int moreLimit) {
|
||||
public void setMoreCondition(int moreLimit, Condition moreCondition) {
|
||||
this.moreLimit = moreLimit;
|
||||
this.moreCondition = moreCondition;
|
||||
}
|
||||
|
||||
private boolean isAlreadySelectedModesOutdated(Game game, Ability source) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue