diff --git a/forge-game/src/main/java/forge/game/ability/effects/BranchEffect.java b/forge-game/src/main/java/forge/game/ability/effects/BranchEffect.java index da738e1fc7b..a8f5cb2dedc 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/BranchEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/BranchEffect.java @@ -13,18 +13,23 @@ public class BranchEffect extends SpellAbilityEffect { // TODO Reuse SpellAbilityCondition and areMet() here instead of repeating each - // For now branch conditions will only be an Svar Compare - String branchSVar = sa.getParam("BranchConditionSVar"); + int value = 0; + if (sa.hasParam("BranchCondition")) { + if (sa.getParam("BranchCondition").equals("ChosenCard")) { + value = host.getChosenCards().size(); + } + } else { + value = AbilityUtils.calculateAmount(host, sa.getParam("BranchConditionSVar"), sa); + } String branchCompare = sa.getParamOrDefault("BranchConditionSVarCompare", "GE1"); String operator = branchCompare.substring(0, 2); String operand = branchCompare.substring(2); - final int svarValue = AbilityUtils.calculateAmount(host, branchSVar, sa); final int operandValue = AbilityUtils.calculateAmount(host, operand, sa); SpellAbility sub = null; - if (Expressions.compare(svarValue, operator, operandValue)) { + if (Expressions.compare(value, operator, operandValue)) { sub = sa.getAdditionalAbility("TrueSubAbility"); } else { sub = sa.getAdditionalAbility("FalseSubAbility"); diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java index dd4397f1663..1b708fb097c 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java @@ -32,11 +32,22 @@ public class ChooseCardEffect extends SpellAbilityEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); + final int numCards = sa.hasParam("Amount") ? + AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("Amount"), sa) : 1; - for (final Player p : getTargetPlayers(sa)) { - sb.append(p).append(" "); + sb.append(Lang.joinHomogenous(getTargetPlayers(sa))).append(" "); + if (sa.hasParam("Mandatory")) { + sb.append(getTargetPlayers(sa).size() == 1 ? "chooses " : "choose "); + } else { + sb.append("may choose "); } - sb.append("chooses a card."); + String desc = sa.getParamOrDefault("ChoiceDesc", ""); + desc = desc.isEmpty() ? "card" : desc + " card"; + sb.append(Lang.nounWithNumeralExceptOne(numCards, desc)); + if (sa.hasParam("FromDesc")) { + sb.append(" ").append(sa.getParam("FromDesc")); + } + sb.append("."); return sb.toString(); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java b/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java index d1cca2c1262..d9c2ff553fa 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java @@ -97,6 +97,7 @@ public class MillEffect extends SpellAbilityEffect { sb.append("antes "); } + sb.append(Lang.nounWithNumeralExceptOne(numCards, "card")).append("."); sb.append(numCards == 1 ? "a card" : (Lang.getNumeral(numCards) + " cards")).append("."); return sb.toString(); diff --git a/forge-gui/res/cardsfolder/n/nightsnare.txt b/forge-gui/res/cardsfolder/n/nightsnare.txt index aad334cff65..bae5b954d81 100644 --- a/forge-gui/res/cardsfolder/n/nightsnare.txt +++ b/forge-gui/res/cardsfolder/n/nightsnare.txt @@ -1,10 +1,11 @@ Name:Nightsnare ManaCost:3 B Types:Sorcery -A:SP$ RevealHand | Cost$ 3 B | ValidTgts$ Opponent | RememberRevealed$ True | SubAbility$ DBChoose | StackDescription$ SpellDescription | SpellDescription$ Target opponent reveals their hand. You may choose a nonland card from it. If you do, that player discards that card. If you don't, that player discards two cards. -SVar:DBChoose:DB$ ChooseCard | ChoiceZone$ Hand | Amount$ 1 | Choices$ Card.nonLand+IsRemembered | SubAbility$ DBDiscard | ChoiceTitle$ You may choose a nonland card | StackDescription$ None -SVar:DBDiscard:DB$ Discard | DefinedCards$ ChosenCard | Defined$ Targeted | Mode$ Defined | SubAbility$ DBCleanup | StackDescription$ None | ConditionDefined$ ChosenCard | ConditionPresent$ Card | ConditionCompare$ EQ1 | SubAbility$ DBDiscard2 -SVar:DBDiscard2:DB$ Discard | Defined$ Targeted | NumCards$ 2 | Mode$ TgtChoose | SubAbility$ DBCleanup | ConditionDefined$ ChosenCard | ConditionPresent$ Card | ConditionCompare$ EQ0 | StackDescription$ None +A:SP$ RevealHand | ValidTgts$ Opponent | RememberRevealed$ True | SubAbility$ DBChoose | SpellDescription$ Target opponent reveals their hand. +SVar:DBChoose:DB$ ChooseCard | ChoiceZone$ Hand | Amount$ 1 | Choices$ Card.nonLand+IsRemembered | ChoiceDesc$ nonland | FromDesc$ from it | SubAbility$ DBBranch | ChoiceTitle$ You may choose a nonland card | SpellDescription$ You may choose a nonland card from it. +SVar:DBBranch:DB$ Branch | BranchCondition$ ChosenCard | TrueSubAbility$ DBDiscard | FalseSubAbility$ DBDiscard2 | StackDescription$ If they do, {p:Targeted} discards that card. If they don't, {p:Targeted} discards two cards. | SpellDescription$ If you do, that player discards that card. If you don't, that player discards two cards. +SVar:DBDiscard:DB$ Discard | DefinedCards$ ChosenCard | Defined$ Targeted | Mode$ Defined | SubAbility$ DBCleanup +SVar:DBDiscard2:DB$ Discard | Defined$ Targeted | NumCards$ 2 | Mode$ TgtChoose | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearChosenCard$ True -AI:RemoveDeck:All +DeckHas:Ability$Discard Oracle:Target opponent reveals their hand. You may choose a nonland card from it. If you do, that player discards that card. If you don't, that player discards two cards. diff --git a/forge-gui/res/cardsfolder/upcoming/reckoner_shakedown.txt b/forge-gui/res/cardsfolder/upcoming/reckoner_shakedown.txt new file mode 100644 index 00000000000..af849b2eb72 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/reckoner_shakedown.txt @@ -0,0 +1,12 @@ +Name:Reckoner Shakedown +ManaCost:2 B +Types:Sorcery +A:SP$ RevealHand | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | RememberRevealed$ True | SubAbility$ DBChoose | SpellDescription$ Target opponent reveals their hand. +SVar:DBChoose:DB$ ChooseCard | ChoiceZone$ Hand | Amount$ 1 | Choices$ Card.nonLand+IsRemembered | ChoiceDesc$ nonland | FromDesc$ from it | SubAbility$ DBBranch | ChoiceTitle$ You may choose a nonland card | SpellDescription$ You may choose a nonland card from it. +SVar:DBBranch:DB$ Branch | BranchCondition$ ChosenCard | TrueSubAbility$ DBDiscard | FalseSubAbility$ DBPutCounter | StackDescription$ If they do, {p:Targeted} discards that card. If they don't, they put two +1/+1 counters on a creature or Vehicle they control. | SpellDescription$ If you do, that player discards that card. If you don't, put two +1/+1 counters on a creature or Vehicle you control. +SVar:DBDiscard:DB$ Discard | DefinedCards$ ChosenCard | Defined$ Targeted | Mode$ Defined | SubAbility$ DBCleanup +SVar:DBPutCounter:DB$ PutCounter | Choices$ Creature.YouCtrl,Vehicle.YouCtrl | ChoiceTitle$ Choose a creature or Vehicle you control | CounterType$ P1P1 | CounterNum$ 2 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearChosenCard$ True +DeckHas:Ability$Discard|Counters +DeckHints:Type$Creature|Vehicle +Oracle:Target opponent reveals their hand. You may choose a nonland card from it. If you do, that player discards that card. If you don't, put two +1/+1 counters on a creature or Vehicle you control.