From c2ec6978c45b2565fd585faca771762915fde7d2 Mon Sep 17 00:00:00 2001 From: swordshine Date: Wed, 10 Jan 2018 14:21:41 +0800 Subject: [PATCH 1/4] - Added a planeswalker subtype: Angrath --- forge-gui/res/lists/TypeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/forge-gui/res/lists/TypeLists.txt b/forge-gui/res/lists/TypeLists.txt index 520c36fc267..162461d7500 100644 --- a/forge-gui/res/lists/TypeLists.txt +++ b/forge-gui/res/lists/TypeLists.txt @@ -269,6 +269,7 @@ Treasure Vehicle [WalkerTypes] Ajani +Angrath Arlinn Ashiok Bolas From d80d2c5cda6268f3613ba905cfdc731cefbe43a0 Mon Sep 17 00:00:00 2001 From: swordshine Date: Wed, 10 Jan 2018 20:12:17 +0800 Subject: [PATCH 2/4] - Fixed Touch of Vitae --- forge-gui/res/cardsfolder/t/touch_of_vitae.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-gui/res/cardsfolder/t/touch_of_vitae.txt b/forge-gui/res/cardsfolder/t/touch_of_vitae.txt index 71d47a66d4f..3e54226c715 100644 --- a/forge-gui/res/cardsfolder/t/touch_of_vitae.txt +++ b/forge-gui/res/cardsfolder/t/touch_of_vitae.txt @@ -3,7 +3,7 @@ ManaCost:2 G Types:Instant A:SP$ Pump | Cost$ 2 G | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ Haste | SubAbility$ DBAnimate | SpellDescription$ Until end of turn, target creature gains haste and "{0}: Untap this creature. Activate this ability only once." Draw a card at the beginning of the next turn's upkeep. SVar:DBAnimate:DB$ Animate | Defined$ Targeted | Abilities$ ABUntap | SubAbility$ DelTrigSlowtrip -SVar:ABUntap:DB$ Untap | Defined$ Self | ActivationLimit$ 1 | SpellDescription$ Untap this creature. Activate this ability only once. +SVar:ABUntap:AB$ Untap | Cost$ 0 | Defined$ Self | GameActivationLimit$ 1 | SpellDescription$ Untap this creature. Activate this ability only once. SVar:DelTrigSlowtrip:DB$ DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | Execute$ DrawSlowtrip | TriggerDescription$ Draw a card. SVar:DrawSlowtrip:DB$Draw | NumCards$ 1 | Defined$ You SVar:RemAIDeck:True From 7ba64ce136dbd2771f1e5e0f45fe6159a519edc5 Mon Sep 17 00:00:00 2001 From: swordshine Date: Wed, 10 Jan 2018 22:06:57 +0800 Subject: [PATCH 3/4] - Added Peack Talks --- .../java/forge/game/ability/effects/EffectEffect.java | 10 ++++++++++ forge-game/src/main/java/forge/game/player/Player.java | 4 +++- .../game/staticability/StaticAbilityCantTarget.java | 3 ++- forge-gui/res/cardsfolder/a/anti_magic_aura.txt | 2 +- forge-gui/res/cardsfolder/a/autumns_veil.txt | 2 +- forge-gui/res/cardsfolder/d/dense_foliage.txt | 2 +- forge-gui/res/cardsfolder/d/display_of_dominance.txt | 2 +- forge-gui/res/cardsfolder/f/fiendslayer_paladin.txt | 2 +- forge-gui/res/cardsfolder/f/fight_or_flight.txt | 2 +- forge-gui/res/cardsfolder/k/karplusan_strider.txt | 2 +- forge-gui/res/cardsfolder/l/lurker.txt | 2 +- forge-gui/res/cardsfolder/p/peace_talks.txt | 9 +++++++++ 12 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 forge-gui/res/cardsfolder/p/peace_talks.txt diff --git a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java index 89860fc4f66..437a640bfe0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java @@ -260,6 +260,16 @@ public class EffectEffect extends SpellAbilityEffect { else if (duration.equals("UntilEndOfCombat")) { game.getEndOfCombat().addUntil(endEffect); } + else if (duration.equals("ThisTurnAndNextTurn")) { + game.getUntap().addAt(new GameCommand() { + private static final long serialVersionUID = -5054153666503075717L; + + @Override + public void run() { + game.getEndOfTurn().addUntil(endEffect); + } + }); + } } if (imprintOnHost) { diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index dbacd267b9e..03f2f260f8f 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -39,6 +39,7 @@ import forge.game.phase.PhaseHandler; import forge.game.phase.PhaseType; import forge.game.replacement.ReplacementHandler; import forge.game.replacement.ReplacementResult; +import forge.game.spellability.AbilityActivated; import forge.game.spellability.SpellAbility; import forge.game.staticability.StaticAbility; import forge.game.trigger.Trigger; @@ -1121,7 +1122,8 @@ public class Player extends GameEntity implements Comparable { @Override public final boolean canBeTargetedBy(final SpellAbility sa) { if (hasKeyword("Shroud") || (!equals(sa.getActivatingPlayer()) && hasKeyword("Hexproof")) - || hasProtectionFrom(sa.getHostCard())) { + || hasProtectionFrom(sa.getHostCard()) + || (hasKeyword("You can't be the targets of spells or activated abilities") && (sa.isSpell() || (sa instanceof AbilityActivated)))) { return false; } return true; diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java index ba579e6d6c8..0ce6e0150a2 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java @@ -57,7 +57,8 @@ public class StaticAbilityCantTarget { } } - if (params.containsKey("Spell") && !spellAbility.isSpell()) { + if (params.containsKey("ValidSA") + && !spellAbility.isValid(params.get("ValidSA").split(","), hostCard.getController(), hostCard, spellAbility)) { return false; } diff --git a/forge-gui/res/cardsfolder/a/anti_magic_aura.txt b/forge-gui/res/cardsfolder/a/anti_magic_aura.txt index 04348cdf077..3ca05c7ab63 100644 --- a/forge-gui/res/cardsfolder/a/anti_magic_aura.txt +++ b/forge-gui/res/cardsfolder/a/anti_magic_aura.txt @@ -3,7 +3,7 @@ ManaCost:2 U Types:Enchantment Aura K:Enchant creature A:SP$ Attach | Cost$ 2 U | ValidTgts$ Creature | AILogic$ Pump -S:Mode$ CantTarget | ValidCard$ Creature.EnchantedBy | Spell$ True | Description$ Enchanted creature can't be the target of spells and can't be enchanted by other Auras. +S:Mode$ CantTarget | ValidCard$ Creature.EnchantedBy | ValidSA$ Spell | Description$ Enchanted creature can't be the target of spells and can't be enchanted by other Auras. S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ CARDNAME can't be enchanted. SVar:Picture:http://www.wizards.com/global/images/magic/general/anti_magic_aura.jpg Oracle:Enchant creature\nEnchanted creature can't be the target of spells and can't be enchanted by other Auras. diff --git a/forge-gui/res/cardsfolder/a/autumns_veil.txt b/forge-gui/res/cardsfolder/a/autumns_veil.txt index 00ee04fdc3c..29443357f34 100644 --- a/forge-gui/res/cardsfolder/a/autumns_veil.txt +++ b/forge-gui/res/cardsfolder/a/autumns_veil.txt @@ -3,7 +3,7 @@ ManaCost:G Types:Instant A:SP$ Effect | Cost$ G | Name$ Autumn's Veil Effect | StaticAbilities$ AntiBlueBlack,STCantBeTarget | SpellDescription$ Spells you control can't be countered by blue or black spells this turn, and creatures you control can't be the targets of blue or black spells this turn. SVar:AntiBlueBlack:Mode$ Continuous | Affected$ Card.YouCtrl | AffectedZone$ Stack | EffectZone$ Command | AddHiddenKeyword$ CARDNAME can't be countered by blue or black spells. | Description$ Spells you control can't be countered by blue or black spells this turn. -SVar:STCantBeTarget:Mode$ CantTarget | ValidCard$ Creature.YouCtrl | ValidSource$ Card.Blue,Card.Black | Spell$ True | EffectZone$ Command | Description$ Creatures you control can't be the targets of blue or black spells this turn. +SVar:STCantBeTarget:Mode$ CantTarget | ValidCard$ Creature.YouCtrl | ValidSource$ Card.Blue,Card.Black | ValidSA$ Spell | EffectZone$ Command | Description$ Creatures you control can't be the targets of blue or black spells this turn. SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/autumns_veil.jpg diff --git a/forge-gui/res/cardsfolder/d/dense_foliage.txt b/forge-gui/res/cardsfolder/d/dense_foliage.txt index 9912196afc8..1175a9eee45 100644 --- a/forge-gui/res/cardsfolder/d/dense_foliage.txt +++ b/forge-gui/res/cardsfolder/d/dense_foliage.txt @@ -1,7 +1,7 @@ Name:Dense Foliage ManaCost:2 G Types:Enchantment -S:Mode$ CantTarget | ValidCard$ Creature | Spell$ True | Description$ Creatures can't be the target of spells. +S:Mode$ CantTarget | ValidCard$ Creature | ValidSA$ Spell | Description$ Creatures can't be the target of spells. SVar:NonStackingEffect:True SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dense_foliage.jpg diff --git a/forge-gui/res/cardsfolder/d/display_of_dominance.txt b/forge-gui/res/cardsfolder/d/display_of_dominance.txt index 40d7d76ed4b..b1f975e7535 100644 --- a/forge-gui/res/cardsfolder/d/display_of_dominance.txt +++ b/forge-gui/res/cardsfolder/d/display_of_dominance.txt @@ -4,7 +4,7 @@ Types:Instant A:SP$ Charm | Cost$ 1 G | Choices$ DBDestroy,DBProtect SVar:DBDestroy:DB$ Destroy | ValidTgts$ Permanent.nonCreature+Blue,Permanent.nonCreature+Black | TgtPrompt$ Select target blue or black noncreature permanent | SpellDescription$ Destroy target blue or black noncreature permanent. SVar:DBProtect:DB$ Effect | Name$ Display of Dominance Effect | StaticAbilities$ STCantBeTarget | SpellDescription$ Permanents you control can't be the targets of blue or black spells your opponents control this turn. -SVar:STCantBeTarget:Mode$ CantTarget | ValidCard$ Permanent.YouCtrl | ValidSource$ Card.Blue+OppCtrl,Card.Black+OppCtrl | Spell$ True | EffectZone$ Command | Description$ Permanents you control can't be the targets of blue or black spells your opponents control this turn. +SVar:STCantBeTarget:Mode$ CantTarget | ValidCard$ Permanent.YouCtrl | ValidSource$ Card.Blue+OppCtrl,Card.Black+OppCtrl | ValidSA$ Spell | EffectZone$ Command | Description$ Permanents you control can't be the targets of blue or black spells your opponents control this turn. SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/display_of_dominance.jpg Oracle:Choose one —\n• Destroy target blue or black noncreature permanent.\n• Permanents you control can't be the targets of blue or black spells your opponents control this turn. diff --git a/forge-gui/res/cardsfolder/f/fiendslayer_paladin.txt b/forge-gui/res/cardsfolder/f/fiendslayer_paladin.txt index f9fe1c1fb91..e4d55ca9625 100644 --- a/forge-gui/res/cardsfolder/f/fiendslayer_paladin.txt +++ b/forge-gui/res/cardsfolder/f/fiendslayer_paladin.txt @@ -4,6 +4,6 @@ Types:Creature Human Knight PT:2/2 K:First Strike K:Lifelink -S:Mode$ CantTarget | ValidCard$ Card.Self | ValidSource$ Card.Black,Card.Red | Spell$ True | Activator$ Opponent | Description$ CARDNAME can't be the target of black or red spells your opponents control. +S:Mode$ CantTarget | ValidCard$ Card.Self | ValidSource$ Card.Black,Card.Red | ValidSA$ Spell | Activator$ Opponent | Description$ CARDNAME can't be the target of black or red spells your opponents control. SVar:Picture:http://www.wizards.com/global/images/magic/general/fiendslayer_paladin.jpg Oracle:First strike, lifelink\nFiendslayer Paladin can't be the target of black or red spells your opponents control. diff --git a/forge-gui/res/cardsfolder/f/fight_or_flight.txt b/forge-gui/res/cardsfolder/f/fight_or_flight.txt index 1a99e492597..50fed68ed19 100644 --- a/forge-gui/res/cardsfolder/f/fight_or_flight.txt +++ b/forge-gui/res/cardsfolder/f/fight_or_flight.txt @@ -3,7 +3,7 @@ ManaCost:3 W Types:Enchantment T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ Player.Opponent | Execute$ TrigTwoPile | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of combat on each opponent's turn, separate all creatures that player controls into two piles. Only creatures in the pile of his or her choice can attack this turn. SVar:TrigTwoPile:DB$ TwoPiles | Defined$ TriggeredPlayer | Chooser$ TriggeredPlayer | ValidCards$ Creature | Zone$ Battlefield | Separator$ You | ChosenPile$ DBEffect -SVar:DBEffect:DB$ EFfect | RememberObjects$ Remembered | StaticAbilities$ STCantAttack | SubAbility$ DBCleanup +SVar:DBEffect:DB$ Effect | RememberObjects$ Remembered | StaticAbilities$ STCantAttack | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:STCantAttack:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature.IsNotRemembered | Description$ Only creatures in the pile of his or her choice can attack this turn. SVar:NonStackingAttachEffect:True diff --git a/forge-gui/res/cardsfolder/k/karplusan_strider.txt b/forge-gui/res/cardsfolder/k/karplusan_strider.txt index 96a75dff59c..5cca50e8307 100644 --- a/forge-gui/res/cardsfolder/k/karplusan_strider.txt +++ b/forge-gui/res/cardsfolder/k/karplusan_strider.txt @@ -2,6 +2,6 @@ Name:Karplusan Strider ManaCost:3 G Types:Creature Yeti PT:3/4 -S:Mode$ CantTarget | Spell$ True | ValidCard$ Card.Self | ValidSource$ Card.Blue,Card.Black | Description$ CARDNAME can't be the target of blue or black spells. +S:Mode$ CantTarget | ValidSA$ Spell | ValidCard$ Card.Self | ValidSource$ Card.Blue,Card.Black | Description$ CARDNAME can't be the target of blue or black spells. SVar:Picture:http://resources.wizards.com/magic/cards/csp/en-us/card121214.jpg Oracle:Karplusan Strider can't be the target of blue or black spells. diff --git a/forge-gui/res/cardsfolder/l/lurker.txt b/forge-gui/res/cardsfolder/l/lurker.txt index d5ac1abee2a..6ac9af6cefd 100644 --- a/forge-gui/res/cardsfolder/l/lurker.txt +++ b/forge-gui/res/cardsfolder/l/lurker.txt @@ -2,6 +2,6 @@ Name:Lurker ManaCost:2 G Types:Creature Beast PT:2/3 -S:Mode$ CantTarget | ValidCard$ Card.Self+notAttackedThisTurn+notBlockedThisTurn | Spell$ True | Description$ CARDNAME can't be the target of spells unless it attacked or blocked this turn. +S:Mode$ CantTarget | ValidCard$ Card.Self+notAttackedThisTurn+notBlockedThisTurn | ValidSA$ Spell | Description$ CARDNAME can't be the target of spells unless it attacked or blocked this turn. SVar:Picture:http://www.wizards.com/global/images/magic/general/lurker.jpg Oracle:Lurker can't be the target of spells unless it attacked or blocked this turn. diff --git a/forge-gui/res/cardsfolder/p/peace_talks.txt b/forge-gui/res/cardsfolder/p/peace_talks.txt new file mode 100644 index 00000000000..6811069f22e --- /dev/null +++ b/forge-gui/res/cardsfolder/p/peace_talks.txt @@ -0,0 +1,9 @@ +Name:Peace Talks +ManaCost:1 W +Types:Sorcery +A:SP$ Effect | Cost$ 1 W | Name$ Peace Talks Effect | StaticAbilities$ STCantAttack,STCantTarget,STCantTargetPlayer | Duration$ ThisTurnAndNextTurn | SpellDescription$ This turn and next turn, creatures can't attack, and players and permanents can't be the targets of spells or activated abilities. +SVar:STCantAttack:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature | Description$ Creatures can't attack. +SVar:STCantTarget:Mode$ CantTarget | ValidCard$ Permanent | EffectZone$ Command | ValidSA$ Spell,Activated | Activated$ True | Description$ Permanents can't be the targets of spells or activated abilities. +SVar:STCantTargetPlayer:Mode$ Continuous | Affected$ Player | EffectZone$ Command | AddKeyword$ You can't be the targets of spells or activated abilities | Description$ Players can't be the targets of spells or activated abilities. +SVar:Picture:http://www.wizards.com/global/images/magic/general/peace_talks.jpg +Oracle:This turn and next turn, creatures can't attack, and players and permanents can't be the targets of spells or activated abilities. From bee34c064b470a7df703087c8b6ac80f457c64ab Mon Sep 17 00:00:00 2001 From: swordshine Date: Wed, 10 Jan 2018 22:09:26 +0800 Subject: [PATCH 4/4] - Removed a param in the previous commit --- forge-gui/res/cardsfolder/p/peace_talks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-gui/res/cardsfolder/p/peace_talks.txt b/forge-gui/res/cardsfolder/p/peace_talks.txt index 6811069f22e..37e12faf05b 100644 --- a/forge-gui/res/cardsfolder/p/peace_talks.txt +++ b/forge-gui/res/cardsfolder/p/peace_talks.txt @@ -3,7 +3,7 @@ ManaCost:1 W Types:Sorcery A:SP$ Effect | Cost$ 1 W | Name$ Peace Talks Effect | StaticAbilities$ STCantAttack,STCantTarget,STCantTargetPlayer | Duration$ ThisTurnAndNextTurn | SpellDescription$ This turn and next turn, creatures can't attack, and players and permanents can't be the targets of spells or activated abilities. SVar:STCantAttack:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature | Description$ Creatures can't attack. -SVar:STCantTarget:Mode$ CantTarget | ValidCard$ Permanent | EffectZone$ Command | ValidSA$ Spell,Activated | Activated$ True | Description$ Permanents can't be the targets of spells or activated abilities. +SVar:STCantTarget:Mode$ CantTarget | ValidCard$ Permanent | EffectZone$ Command | ValidSA$ Spell,Activated | Description$ Permanents can't be the targets of spells or activated abilities. SVar:STCantTargetPlayer:Mode$ Continuous | Affected$ Player | EffectZone$ Command | AddKeyword$ You can't be the targets of spells or activated abilities | Description$ Players can't be the targets of spells or activated abilities. SVar:Picture:http://www.wizards.com/global/images/magic/general/peace_talks.jpg Oracle:This turn and next turn, creatures can't attack, and players and permanents can't be the targets of spells or activated abilities.