diff --git a/.gitattributes b/.gitattributes index 2e5883fd671..e40ca1a5dce 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16947,6 +16947,7 @@ forge-gui/res/cardsfolder/upcoming/behold_my_grandeur.txt -text forge-gui/res/cardsfolder/upcoming/bontus_last_reckoning.txt -text forge-gui/res/cardsfolder/upcoming/nicol_bolas_god_pharaoh.txt -text forge-gui/res/cardsfolder/upcoming/samut_the_tested.txt -text +forge-gui/res/cardsfolder/upcoming/when_will_you_learn.txt -text forge-gui/res/cardsfolder/v/vacuumelt.txt svneol=native#text/plain forge-gui/res/cardsfolder/v/vaevictis_asmadi.txt svneol=native#text/plain forge-gui/res/cardsfolder/v/vagrant_plowbeasts.txt svneol=native#text/plain diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 8b4df61f829..0a73bc26bd2 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -663,6 +663,10 @@ public class AbilityUtils { list = null; } } + else if (calcX[0].startsWith("TriggerObjects")) { + final SpellAbility root = sa.getRootAbility(); + list = (CardCollection) root.getTriggeringObject(calcX[0].substring(14)); + } else if (calcX[0].startsWith("Triggered")) { final SpellAbility root = sa.getRootAbility(); list = new CardCollection((Card) root.getTriggeringObject(calcX[0].substring(9))); diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index f5862867583..e6714bd07f1 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -1071,13 +1071,15 @@ public class CardFactoryUtil { } if (sq[0].contains("ColorsCtrl")) { - final CardCollectionView list = cc.getCardsIn(ZoneType.Battlefield); - int n = 0; - for (final byte col : MagicColor.WUBRG) { - if (!CardLists.getColor(list, col).isEmpty()) { - n++; - } + final String restriction = l[0].substring(11); + final String[] rest = restriction.split(","); + final CardCollection list = CardLists.getValidCards(cc.getGame().getCardsInGame(), rest, cc, c, null); + int n = 0; + for (final byte col : MagicColor.WUBRG) { + if (!CardLists.getColor(list, col).isEmpty()) { + n++; } + } return doXMath(n, m, c); } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerAttackersDeclared.java b/forge-game/src/main/java/forge/game/trigger/TriggerAttackersDeclared.java index 7cc73b9bf4b..8f8abcb9734 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerAttackersDeclared.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerAttackersDeclared.java @@ -23,6 +23,7 @@ import forge.game.spellability.SpellAbility; import java.util.List; import java.util.Map; +import java.util.Set; /** * TODO Write javadoc for this type. @@ -45,6 +46,7 @@ public class TriggerAttackersDeclared extends Trigger { } /** {@inheritDoc} */ + @SuppressWarnings("unchecked") @Override public final boolean performTest(final Map runParams2) { if (this.mapParams.containsKey("AttackingPlayer")) { @@ -55,7 +57,6 @@ public class TriggerAttackersDeclared extends Trigger { } if (this.mapParams.containsKey("AttackedTarget")) { boolean valid = false; - @SuppressWarnings("unchecked") List list = (List) runParams2.get("AttackedTarget"); for (GameEntity b : list) { if (matchesValid(b, this.mapParams.get("AttackedTarget").split(","), this.getHostCard())) { @@ -67,6 +68,19 @@ public class TriggerAttackersDeclared extends Trigger { return false; } } + if (this.mapParams.containsKey("ValidAttackers")) { + boolean valid = false; + + final Set srcs = (Set) runParams2.get("Attackers"); + for (Card c : srcs) { + if (c.isValid(this.mapParams.get("ValidAttackers").split(","), this.getHostCard().getController(), this.getHostCard(), null)) { + valid = true; + } + } + if (!valid) { + return false; + } + } return true; } diff --git a/forge-gui/res/cardsfolder/c/conquerors_flail.txt b/forge-gui/res/cardsfolder/c/conquerors_flail.txt index 85c2ff0b05a..16f304cbcb3 100644 --- a/forge-gui/res/cardsfolder/c/conquerors_flail.txt +++ b/forge-gui/res/cardsfolder/c/conquerors_flail.txt @@ -3,7 +3,7 @@ ManaCost:2 Types:Artifact Equipment S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ X | AddToughness$ X | References$ X | Description$ Equipped creature gets +1/+1 for each color among permanents you control. S:Mode$ CantBeCast | ValidCard$ Card | Condition$ PlayerTurn | Caster$ Opponent | IsPresent$ Card.Self+AttachedTo Creature | Description$ As long as Conqueror's Flail is attached to a creature, your opponents can't cast spells during your turn. -SVar:X:Count$ColorsCtrl +SVar:X:Count$ColorsCtrl Permanent.YouCtrl+inZoneBattlefield K:Equip 2 SVar:Picture:http://www.wizards.com/global/images/magic/general/conquerors_flail.jpg Oracle:Equipped creature gets +1/+1 for each color among permanents you control.\nAs long as Conqueror's Flail is attached to a creature, your opponents can't cast spells during your turn.\nEquip {2} diff --git a/forge-gui/res/cardsfolder/h/hellcarver_demon.txt b/forge-gui/res/cardsfolder/h/hellcarver_demon.txt index 779c4d93c8f..7185abd9ad5 100644 --- a/forge-gui/res/cardsfolder/h/hellcarver_demon.txt +++ b/forge-gui/res/cardsfolder/h/hellcarver_demon.txt @@ -7,7 +7,7 @@ T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage SVar:TrigSacrifice:AB$ SacrificeAll | Cost$ 0 | ValidCards$ Permanent.YouCtrl+Other | SubAbility$ DBDiscardHand SVar:DBDiscardHand:DB$ Discard | Mode$ Hand | Defined$ You | SubAbility$ DBExileSix SVar:DBExileSix:DB$ Mill | Destination$ Exile | RememberMilled$ True | NumCards$ 6 | SubAbility$ DBPlayThem -SVar:DBPlayThem:DB$ Play | Valid$ Card.IsRemembered+nonLand | ValidZone$ Exile | Controller$ You | WithoutManaCost$ True | Amount$ 6 | Optional$ True | SubAbility$ DBHellCleanup +SVar:DBPlayThem:DB$ Play | Valid$ Card.IsRemembered+nonLand | ValidZone$ Exile | Controller$ You | WithoutManaCost$ True | Amount$ All | Optional$ True | SubAbility$ DBHellCleanup SVar:DBHellCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Picture:http://www.wizards.com/global/images/magic/general/hellcarver_demon.jpg Oracle:Flying\nWhenever Hellcarver Demon deals combat damage to a player, sacrifice all other permanents you control and discard your hand. Exile the top six cards of your library. You may cast any number of nonland cards exiled this way without paying their mana costs. diff --git a/forge-gui/res/cardsfolder/o/only_blood_ends_your_nightmares.txt b/forge-gui/res/cardsfolder/o/only_blood_ends_your_nightmares.txt index 39a67330ca8..0a649f5124d 100644 --- a/forge-gui/res/cardsfolder/o/only_blood_ends_your_nightmares.txt +++ b/forge-gui/res/cardsfolder/o/only_blood_ends_your_nightmares.txt @@ -1,7 +1,7 @@ Name:Only Blood Ends Your Nightmares ManaCost:no cost Types:Scheme -T:Mode$ SetInMotion | ValidCard$ Card.Self | Execute$ TrigSacEach | TriggerZones$ Command | OptionalDecider$ You | TriggerDescription$ When you set this scheme in motion, each opponent sacrifices a creature. Then each opponent who didn't sacrifice a creature discards two cards. +T:Mode$ SetInMotion | ValidCard$ Card.Self | Execute$ TrigSacEach | TriggerZones$ Command | TriggerDescription$ When you set this scheme in motion, each opponent sacrifices a creature. Then each opponent who didn't sacrifice a creature discards two cards. SVar:TrigSacEach:AB$ Sacrifice | Cost$ 0 | Defined$ Player.Opponent | SacValid$ Creature | RememberSacrificed$ True | SubAbility$ DBRepeat SVar:DBRepeat:DB$ RepeatEach | RepeatPlayers$ Player.Opponent | RepeatSubAbility$ DBDiscard | SubAbility$ DBCleanup SVar:DBDiscard:DB$ Discard | Defined$ Player.IsRemembered | Mode$ TgtChoose | NumCards$ 2 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | References$ X diff --git a/forge-gui/res/cardsfolder/s/soul_of_ravnica.txt b/forge-gui/res/cardsfolder/s/soul_of_ravnica.txt index e20aa1a7fe1..8175bcba7fe 100644 --- a/forge-gui/res/cardsfolder/s/soul_of_ravnica.txt +++ b/forge-gui/res/cardsfolder/s/soul_of_ravnica.txt @@ -5,7 +5,7 @@ PT:6/6 K:Flying A:AB$ Draw | Cost$ 5 U U | NumCards$ X | References$ X | SpellDescription$ Draw a card for each color among permanents you control. A:AB$ Draw | Cost$ 5 U U ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | NumCards$ X | References$ X | SpellDescription$ Draw a card for each color among permanents you control. -SVar:X:Count$ColorsCtrl +SVar:X:Count$ColorsCtrl Permanent.YouCtrl+inZoneBattlefield DeckNeeds:Color$White|Red|Green|Black SVar:Picture:http://www.wizards.com/global/images/magic/general/soul_of_ravnica.jpg Oracle:Flying\n{5}{U}{U}: Draw a card for each color among permanents you control.\n{5}{U}{U}, Exile Soul of Ravnica from your graveyard: Draw a card for each color among permanents you control. diff --git a/forge-gui/res/cardsfolder/upcoming/when_will_you_learn.txt b/forge-gui/res/cardsfolder/upcoming/when_will_you_learn.txt new file mode 100644 index 00000000000..8539044c759 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/when_will_you_learn.txt @@ -0,0 +1,9 @@ +Name:When Will You Learn? +ManaCost:no cost +Types:Scheme +T:Mode$ SetInMotion | ValidCard$ Card.Self | Execute$ DBExile | TriggerZones$ Command | TriggerDescription$ When you set this scheme in motion, each opponent exiles the top card of his or her library. You may cast any number of nonland cards exiled this way without paying their mana costs. +SVar:DBExile:DB$ Mill | Defined$ Player.Opponent | Destination$ Exile | NumCards$ 1 | RememberMilled$ True | SubAbility$ DBPlay +SVar:DBPlay:DB$ Play | Valid$ Card.IsRemembered+nonLand | ValidZone$ Exile | Controller$ You | WithoutManaCost$ True | Amount$ All | Optional$ True | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Picture:https://downloads.cardforge.org/images/cards/ARC/When Will You Learn.full.jpg +Oracle:When you set this scheme in motion, each opponent exiles the top card of his or her library. You may cast any number of nonland cards exiled this way without paying their mana costs. \ No newline at end of file