diff --git a/forge-game/src/main/java/forge/game/ability/AbilityFactory.java b/forge-game/src/main/java/forge/game/ability/AbilityFactory.java index ac065e3cf74..4e637aeb11c 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityFactory.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityFactory.java @@ -398,6 +398,9 @@ public final class AbilityFactory { if (mapParams.containsKey("TargetsWithDifferentCMC")) { abTgt.setDifferentCMC(true); } + if (mapParams.containsKey("TargetsWithEqualToughness")) { + abTgt.setEqualToughness(true); + } if (mapParams.containsKey("TargetsAtRandom")) { abTgt.setRandomTarget(true); } diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java index 4dc99e4349a..05dfba94be3 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java @@ -1399,6 +1399,14 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit } } + if (tr.isEqualToughness() && entity instanceof Card) { + for (final Card c : targetChosen.getTargetCards()) { + if (entity != c && c.getNetToughness() != (((Card) entity).getNetToughness())) { + return false; + } + } + } + if (tr.isSameController() && entity instanceof Card) { Player newController; newController = ((Card) entity).getController(); diff --git a/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java b/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java index 35f41cfa158..5efcbd90657 100644 --- a/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java +++ b/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java @@ -58,6 +58,7 @@ public class TargetRestrictions { private boolean singleZone = false; private boolean differentControllers = false; private boolean differentCMC = false; + private boolean equalToughness = false; private boolean sameController = false; private boolean withoutSameCreatureType = false; private boolean withSameCreatureType = false; @@ -100,6 +101,7 @@ public class TargetRestrictions { this.singleZone = target.isSingleZone(); this.differentControllers = target.isDifferentControllers(); this.differentCMC = target.isDifferentCMC(); + this.equalToughness = target.isEqualToughness(); this.sameController = target.isSameController(); this.withoutSameCreatureType = target.isWithoutSameCreatureType(); this.withSameCreatureType = target.isWithSameCreatureType(); @@ -616,6 +618,21 @@ public class TargetRestrictions { public void setDifferentCMC(boolean different) { this.differentCMC = different; } + + /** + * @return the equalToughness + */ + public boolean isEqualToughness() { + return equalToughness; + } + + /** + * @param b the equalToughness to set + */ + public void setEqualToughness(boolean b) { + this.equalToughness = b; + } + /** * @return the differentControllers */ diff --git a/forge-gui/res/cardsfolder/a/atomwheel_acrobats.txt b/forge-gui/res/cardsfolder/a/atomwheel_acrobats.txt index 2c82976cec0..d72fe1a7409 100644 --- a/forge-gui/res/cardsfolder/a/atomwheel_acrobats.txt +++ b/forge-gui/res/cardsfolder/a/atomwheel_acrobats.txt @@ -2,7 +2,7 @@ Name:Atomwheel Acrobats ManaCost:3 G Types:Creature Elf Performer PT:3/2 -T:Mode$ RolledDie | TriggerZones$ Battlefield | Execute$ TrigPutCounter | ValidResult$ 1,2 | TriggerDescription$ Whenever you roll a 1 or 2, put that many +1/+1 counters on CARDNAME. +T:Mode$ RolledDie | TriggerZones$ Battlefield | Execute$ TrigPutCounter | ValidResult$ 1,2 | ValidPlayer$ You | TriggerDescription$ Whenever you roll a 1 or 2, put that many +1/+1 counters on CARDNAME. SVar:TrigPutCounter:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ X SVar:X:TriggerCount$Result A:AB$ RollDice | Cost$ 2 G | AILogic$ AtOppEOT | SpellDescription$ Roll a six-sided die. diff --git a/forge-gui/res/cardsfolder/upcoming/mr_house_president_and_ceo.txt b/forge-gui/res/cardsfolder/upcoming/mr_house_president_and_ceo.txt new file mode 100644 index 00000000000..d8a66748da4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/mr_house_president_and_ceo.txt @@ -0,0 +1,11 @@ +Name:Mr. House, President and CEO +ManaCost:R W B +Types:Legendary Artifact Creature Human +PT:0/4 +T:Mode$ RolledDie | TriggerZones$ Battlefield | Execute$ TrigBranch | ValidPlayer$ You | ValidResult$ GE4 | TriggerDescription$ Whenever you roll a 4 or higher, create a 3/3 colorless Robot artifact creature token. If you rolled 6 or higher, instead create that token and a Treasure token. +SVar:TrigBranch:DB$ Branch | BranchConditionSVar$ TriggerCount$Result | BranchConditionSVarCompare$ GE6 | TrueSubAbility$ Tokens | FalseSubAbility$ Token +SVar:Token:DB$ Token | TokenScript$ c_3_3_a_robot +SVar:Tokens:DB$ Token | TokenScript$ c_3_3_a_robot,c_a_treasure_sac +A:AB$ RollDice | Cost$ 4 T | Amount$ Count$TotalManaSpent Treasure/Plus.1 | StackDescription$ SpellDescription | SpellDescription$ Roll a six-sided die plus an additional six-sided die for each mana from Treasures spent to activate this ability. +DeckHas:Ability$Token|Sacrifice & Type$Artifact|Robot|Treasure +Oracle:Whenever you roll a 4 or higher, create a 3/3 colorless Robot artifact creature token. If you rolled 6 or higher, instead create that token and a Treasure token.\n{4}, {T}: Roll a six-sided die plus an additional six-sided die for each mana from Treasures spent to activate this ability. diff --git a/forge-gui/res/cardsfolder/upcoming/vats.txt b/forge-gui/res/cardsfolder/upcoming/vats.txt new file mode 100644 index 00000000000..b179477266b --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/vats.txt @@ -0,0 +1,6 @@ +Name:V.A.T.S. +ManaCost:2 B B +Types:Instant +K:Split second +A:SP$ Destroy | TargetMin$ 0 | TargetMax$ Count$Valid Creature | ValidTgts$ Creature | TgtPrompt$ Choose any number of target creatures with equal toughness | TargetsWithEqualToughness$ True | SpellDescription$ Choose any number of target creatures with equal toughness. Destroy the chosen creatures. +Oracle:Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)\nChoose any number of target creatures with equal toughness. Destroy the chosen creatures. diff --git a/forge-gui/res/tokenscripts/c_3_3_a_robot.txt b/forge-gui/res/tokenscripts/c_3_3_a_robot.txt new file mode 100644 index 00000000000..0387683dad1 --- /dev/null +++ b/forge-gui/res/tokenscripts/c_3_3_a_robot.txt @@ -0,0 +1,5 @@ +Name:Robot Token +ManaCost:no cost +PT:3/3 +Types:Artifact Creature Robot +Oracle: diff --git a/forge-gui/src/main/java/forge/gamemodes/match/input/InputSelectTargets.java b/forge-gui/src/main/java/forge/gamemodes/match/input/InputSelectTargets.java index 5baca0aaa59..473e23fbf12 100644 --- a/forge-gui/src/main/java/forge/gamemodes/match/input/InputSelectTargets.java +++ b/forge-gui/src/main/java/forge/gamemodes/match/input/InputSelectTargets.java @@ -256,6 +256,22 @@ public final class InputSelectTargets extends InputSyncronizedBase { } } + // If all cards must have equal toughness + if (tgt.isEqualToughness()) { + final List tgtTs = new ArrayList<>(); + for (final GameObject o : targets) { + if (o instanceof Card) { + final Integer cmc = ((Card) o).getCurrentToughness(); + tgtTs.add(cmc); + } + } + if (!tgtTs.isEmpty() && !tgtTs.contains(card.getCurrentToughness())) { + showMessage(sa.getHostCard() + " - Cannot target this card (must have equal toughness)"); + return false; + } + + } + // If all cards must have different mana values if (tgt.isDifferentCMC()) { final List targetedCMCs = new ArrayList<>();