From cd9702fd0337190f25de078996e448657a1f4583 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 11:59:27 +0800 Subject: [PATCH 01/10] - DOM: Added Karn, Scion of Urza, Jhoira's Familiar, Jodah, Archmage Eternal, Mishra's Self-Replicator, and Mox Amber --- .../java/forge/game/ability/effects/DigEffect.java | 8 ++++++-- .../src/main/java/forge/game/card/CounterType.java | 2 ++ forge-gui/res/cardsfolder/c/corrupted_grafstone.txt | 2 +- .../res/cardsfolder/upcoming/jhoiras_familiar.txt | 9 +++++++++ .../cardsfolder/upcoming/jodah_archmage_eternal.txt | 10 ++++++++++ .../res/cardsfolder/upcoming/karn_scion_of_urza.txt | 12 ++++++++++++ .../cardsfolder/upcoming/mishras_self_replicator.txt | 8 ++++++++ forge-gui/res/cardsfolder/upcoming/mox_amber.txt | 7 +++++++ 8 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/jhoiras_familiar.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/jodah_archmage_eternal.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/karn_scion_of_urza.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/mishras_self_replicator.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/mox_amber.txt diff --git a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java index f5e62b6e745..64528663ff1 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java @@ -9,6 +9,7 @@ import forge.game.card.Card; import forge.game.card.CardCollection; import forge.game.card.CardCollectionView; import forge.game.card.CardLists; +import forge.game.card.CounterType; import forge.game.player.DelayedReveal; import forge.game.player.Player; import forge.game.player.PlayerView; @@ -370,11 +371,14 @@ public class DigEffect extends SpellAbilityEffect { Card c = rest.get(i); final PlayerZone toZone = c.getOwner().getZone(destZone2); c = game.getAction().moveTo(toZone, c, sa); - if (destZone2.equals(ZoneType.Battlefield) && !keywords.isEmpty()) { + if (destZone2 == ZoneType.Battlefield && !keywords.isEmpty()) { for (final String kw : keywords) { c.addExtrinsicKeyword(kw); } - } else if (destZone2.equals(ZoneType.Exile)) { + } else if (destZone2 == ZoneType.Exile) { + if (sa.hasParam("ExileWithCounter")) { + c.addCounter(CounterType.getType(sa.getParam("ExileWithCounter")), 1, effectHost, false); + } c.setExiledWith(effectHost); } } diff --git a/forge-game/src/main/java/forge/game/card/CounterType.java b/forge-game/src/main/java/forge/game/card/CounterType.java index e0af2cefa17..541c19f0e2c 100644 --- a/forge-game/src/main/java/forge/game/card/CounterType.java +++ b/forge-game/src/main/java/forge/game/card/CounterType.java @@ -239,6 +239,8 @@ public enum CounterType { SHRED("SHRED", 255, 165, 152), + SILVER("SILVER", 192, 192, 192), + SLEEP("SLEEP", 178, 192, 255), SLEIGHT("SLGHT", 185, 174, 255), diff --git a/forge-gui/res/cardsfolder/c/corrupted_grafstone.txt b/forge-gui/res/cardsfolder/c/corrupted_grafstone.txt index 15d50f09c11..bb1195d4d2d 100644 --- a/forge-gui/res/cardsfolder/c/corrupted_grafstone.txt +++ b/forge-gui/res/cardsfolder/c/corrupted_grafstone.txt @@ -2,7 +2,7 @@ Name:Corrupted Grafstone ManaCost:2 Types:Artifact K:CARDNAME enters the battlefield tapped. -A:AB$ ManaReflected | Cost$ T | ColorOrType$ Color | Valid$ Defined.ValidGraveyard Card.YouOwn | ReflectProperty$ Is | SpellDescription$ Choose a color of a permanent you control. Add one mana of that color to your mana pool. +A:AB$ ManaReflected | Cost$ T | ColorOrType$ Color | Valid$ Defined.ValidGraveyard Card.YouOwn | ReflectProperty$ Is | SpellDescription$ Choose a color of a card in your graveyard. Add one mana of that color to your mana pool. SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/corrupted_grafstone.jpg Oracle:Corrupted Grafstone enters the battlefield tapped.\n{T}: Choose a color of a card in your graveyard. Add one mana of that color to your mana pool. diff --git a/forge-gui/res/cardsfolder/upcoming/jhoiras_familiar.txt b/forge-gui/res/cardsfolder/upcoming/jhoiras_familiar.txt new file mode 100644 index 00000000000..24143ed6193 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/jhoiras_familiar.txt @@ -0,0 +1,9 @@ +Name:Jhoira's Familiar +ManaCost:4 +Types:Artifact Creature Bird +PT:2/2 +K:Flying +S:Mode$ ReduceCost | ValidCard$ Card.Historic | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Historic spells you cast cost {1} less to cast. (Artifacts, legendaries, and Sagas are historic.) +SVar:BuffedBy:Card.Historic +SVar:Picture:http://www.wizards.com/global/images/magic/general/jhoiras_familiar.jpg +Oracle:Flying\nHistoric spells you cast cost {1} less to cast. (Artifacts, legendaries, and Sagas are historic.) diff --git a/forge-gui/res/cardsfolder/upcoming/jodah_archmage_eternal.txt b/forge-gui/res/cardsfolder/upcoming/jodah_archmage_eternal.txt new file mode 100644 index 00000000000..e3e99c78b66 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/jodah_archmage_eternal.txt @@ -0,0 +1,10 @@ +Name:Jodah, Archmage Eternal +ManaCost:1 U R W +Types:Legendary Creature Human Wizard +PT:4/3 +K:Flying +S:Mode$ Continuous | Affected$ Card.YouCtrl | AddKeyword$ Alternative Cost:W U B R G | AffectedZone$ Hand,Graveyard,Exile,Library,Command | Description$ You may pay {W}{U}{B}{R}{G} rather than pay the mana cost for spells that you cast. +SVar:NonStackingEffect:True +SVar:RemRandomDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/jodah_archmage_eternal.jpg +Oracle:Flying\nYou may pay {W}{U}{B}{R}{G} rather than pay the mana cost for spells that you cast. diff --git a/forge-gui/res/cardsfolder/upcoming/karn_scion_of_urza.txt b/forge-gui/res/cardsfolder/upcoming/karn_scion_of_urza.txt new file mode 100644 index 00000000000..27261b936ae --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/karn_scion_of_urza.txt @@ -0,0 +1,12 @@ +Name:Karn, Scion of Urza +ManaCost:4 +Types:Legendary Planeswalker Karn +Loyalty:5 +A:AB$ Dig | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | DigNum$ 2 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Card | DestinationZone$ Hand | DestinationZone2$ Exile | ExileWithCounter$ SILVER | Choser$ Opponent | SpellDescription$ Reveal the top two cards of your library. An opponent chooses one of them. Put that card into your hand and exile the other with a silver counter on it. +A:AB$ ChangeZone | Cost$ SubCounter<1/LOYALTY> | Planeswalker$ True | Hidden$ True | Origin$ Exile | Destination$ Hand | ChangeType$ Card.YouOwn+counters_GE1_SILVER | SpellDescription$ Put a card you own with a silver counter on it from exile into your hand. +A:AB$ Token | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Ultimate$ True | TokenName$ Construct | TokenTypes$ Artifact,Creature,Construct | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 0 | TokenToughness$ 0 | TokenStaticAbilities$ TokenPT | TokenSVars$ X | References$ X | TokenImage$ c 0 0 construct DOM | SpellDescription$ Create a 0/0 colorless Construct artifact creature token with "This creature gets +1/+1 for each artifact you control." +SVar:TokenPT:Mode$ Continuous | AddPower$ X | AddToughness$ X | Description$ This creature gets +1/+1 for each artifact you control. +SVar:X:Count$Valid Artifact.YouCtrl +SVar:BuffedBy:Artifact +SVar:Picture:http://www.wizards.com/global/images/magic/general/karn_scion_of_urza.jpg +Oracle:[+1]: Reveal the top two cards of your library. An opponent chooses one of them. Put that card into your hand and exile the other with a silver counter on it.\n[-1]: Put a card you own with a silver counter on it from exile into your hand.\n[-2]: Create a 0/0 colorless Construct artifact creature token with "This creature gets +1/+1 for each artifact you control." diff --git a/forge-gui/res/cardsfolder/upcoming/mishras_self_replicator.txt b/forge-gui/res/cardsfolder/upcoming/mishras_self_replicator.txt new file mode 100644 index 00000000000..fbb283eda55 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/mishras_self_replicator.txt @@ -0,0 +1,8 @@ +Name:Mishra's Self-Replicator +ManaCost:5 +Types:Artifact Creature Assembly-Worker +PT:2/2 +T:Mode$ SpellCast | ValidCard$ Card.Historic | ValidActivatingPlayer$ You | Execute$ TrigCopy | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a historic spell, you may pay {1}. If you do, create a token that's a copy of CARDNAME. (Artifacts, legendaries, and Sagas are historic.) +SVar:TrigCopy:AB$ CopyPermanent | Cost$ 1 | Defined$ Self +SVar:Picture:http://www.wizards.com/global/images/magic/general/mishras_self_replicator.jpg +Oracle:Whenever you cast a historic spell, you may pay {1}. If you do, create a token that's a copy of CARDNAME. (Artifacts, legendaries, and Sagas are historic.) diff --git a/forge-gui/res/cardsfolder/upcoming/mox_amber.txt b/forge-gui/res/cardsfolder/upcoming/mox_amber.txt new file mode 100644 index 00000000000..622cef365a0 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/mox_amber.txt @@ -0,0 +1,7 @@ +Name:Mox Amber +ManaCost:0 +Types:Legendary Artifact +A:AB$ ManaReflected | Cost$ T | ColorOrType$ Color | Valid$ Creature.Legendary+YouCtrl,Planeswalker.Legendary+YouCtrl | ReflectProperty$ Is | SpellDescription$ Add one mana of any color among legendary creatures and planeswalkers you control. +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/mox_amber.jpg +Oracle:{T}: Add one mana of any color among legendary creatures and planeswalkers you control. From 23fcaaf5d0fd4a8502ca2b4f391011c2cbb9373d Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 13:19:46 +0800 Subject: [PATCH 02/10] - DOM: Added Darigaaz Reincarnated --- .../forge/game/ability/effects/DigEffect.java | 2 +- .../main/java/forge/game/card/CounterType.java | 2 ++ .../upcoming/darigaaz_reincarnated.txt | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/darigaaz_reincarnated.txt diff --git a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java index 64528663ff1..19e434bd55f 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java @@ -377,7 +377,7 @@ public class DigEffect extends SpellAbilityEffect { } } else if (destZone2 == ZoneType.Exile) { if (sa.hasParam("ExileWithCounter")) { - c.addCounter(CounterType.getType(sa.getParam("ExileWithCounter")), 1, effectHost, false); + c.addCounter(CounterType.getType(sa.getParam("ExileWithCounter")), 1, effectHost, true); } c.setExiledWith(effectHost); } diff --git a/forge-game/src/main/java/forge/game/card/CounterType.java b/forge-game/src/main/java/forge/game/card/CounterType.java index 541c19f0e2c..fcf5e5fee84 100644 --- a/forge-game/src/main/java/forge/game/card/CounterType.java +++ b/forge-game/src/main/java/forge/game/card/CounterType.java @@ -87,6 +87,8 @@ public enum CounterType { ECHO("ECHO", 225, 180, 255), + EGG("EGG", 255, 245, 195), + ELIXIR("ELIXR", 81, 221, 175), EON("EON", 23, 194, 255), diff --git a/forge-gui/res/cardsfolder/upcoming/darigaaz_reincarnated.txt b/forge-gui/res/cardsfolder/upcoming/darigaaz_reincarnated.txt new file mode 100644 index 00000000000..e9b589fa2d6 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/darigaaz_reincarnated.txt @@ -0,0 +1,15 @@ +Name:Darigaaz Reincarnated +ManaCost:4 B R G +Types:Legendary Creature Dragon +PT:7/7 +K:Flying +K:Trample +K:Haste +R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | ReplaceWith$ Exile | Description$ If CARDNAME would die, instead exile it with three egg counters on it. +SVar:Exile:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | SubAbility$ DBAddCounter | Defined$ ReplacedCard +SVar:DBAddCounter:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ EGG | CounterNum$ 3 +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Exile | IsPresent$ Card.Self+counters_GE1_EGG | PresentZone$ Exile | Execute$ DBRemoveCounter | TriggerDescription$ At the beginning of your upkeep, if CARDNAME is exiled with an egg counter on it, remove an egg counter from it. Then if CARDNAME has no egg counters on it, return it to the battlefield. +SVar:DBRemoveCounter:DB$ RemoveCounter | Defined$ Self | CounterType$ EGG | CounterNum$ 1 | SubAbility$ DBReturn +SVar:DBReturn:DB$ ChangeZone | Defined$ Self | Origin$ Exile | Destination$ Battlefield | ConditionDefined$ Self | ConditionPresent$ Card.counters_EQ0_EGG +SVar:Picture:http://www.wizards.com/global/images/magic/general/darigaaz_reincarnated.jpg +Oracle:Flying, trample, haste\nIf Darigaaz Reincarnated would die, instead exile it with three egg counters on it.\nAt the beginning of your upkeep, if Darigaaz is exiled with an egg counter on it, remove an egg counter from it. Then if Darigaaz has no egg counters on it, return it to the battlefield. From d8b31ec4bcaa57a5bc6746437820239e0188c72a Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 17:09:04 +0800 Subject: [PATCH 03/10] - DOM: Added a few cards --- .../cardsfolder/upcoming/adeliz_the_cinder_wind.txt | 12 ++++++++++++ .../res/cardsfolder/upcoming/arvad_the_cursed.txt | 12 ++++++++++++ .../upcoming/aryel_knight_of_windgrace.txt | 12 ++++++++++++ .../cardsfolder/upcoming/chandra_bold_pyromancer.txt | 10 ++++++++++ 4 files changed, 46 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/adeliz_the_cinder_wind.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/arvad_the_cursed.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/aryel_knight_of_windgrace.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/chandra_bold_pyromancer.txt diff --git a/forge-gui/res/cardsfolder/upcoming/adeliz_the_cinder_wind.txt b/forge-gui/res/cardsfolder/upcoming/adeliz_the_cinder_wind.txt new file mode 100644 index 00000000000..f308398799e --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/adeliz_the_cinder_wind.txt @@ -0,0 +1,12 @@ +Name:Adeliz, the Cinder Wind +ManaCost:1 U R +Types:Legendary Creature Human Wizard +PT:2/2 +K:Flying +K:Haste +T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPumpAll | TriggerDescription$ Whenever you cast an instant or sorcery spell, Wizards you control get +1/+1 until end of turn. +SVar:TrigPumpAll:DB$ PumpAll | ValidCards$ Wizard.YouCtrl | NumAtt$ +1 | NumDef$ +1 +SVar:BuffedBy:Instant,Sorcery +DeckHints:Type$Instant|Sorcery +SVar:Picture:http://www.wizards.com/global/images/magic/general/adeliz_the_cinder_wind.jpg +Oracle:Flying, haste\nWhenever you cast an instant or sorcery spell, Wizards you control get +1/+1 until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/arvad_the_cursed.txt b/forge-gui/res/cardsfolder/upcoming/arvad_the_cursed.txt new file mode 100644 index 00000000000..a62066548a1 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/arvad_the_cursed.txt @@ -0,0 +1,12 @@ +Name:Arvad the Cursed +ManaCost:3 W B +Types:Legendary Creature Vampire Knight +PT:3/3 +K:Deathtouch +K:Lifelink +S:Mode$ Continuous | Affected$ Creature.Legendary+Other+YouCtrl | AddPower$ 2 | AddToughness$ 2 | Description$ Other legendary creatures you control get +2/+2. +SVar:RemRandomDeck:True +SVar:PlayMain1:TRUE +DeckHints:Type$Legendary +SVar:Picture:http://www.wizards.com/global/images/magic/general/arvad_the_cursed.jpg +Oracle:Deathtouch, lifelink\nOther legendary creatures you control get +2/+2. diff --git a/forge-gui/res/cardsfolder/upcoming/aryel_knight_of_windgrace.txt b/forge-gui/res/cardsfolder/upcoming/aryel_knight_of_windgrace.txt new file mode 100644 index 00000000000..295da7a1317 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/aryel_knight_of_windgrace.txt @@ -0,0 +1,12 @@ +Name:Aryel, Knight of Windgrace +ManaCost:2 W B +Types:Legendary Creature Human Knight +PT:3/3 +K:Vigilance +A:AB$ Token | Cost$ 2 W T | TokenAmount$ 1 | TokenName$ Knight | TokenTypes$ Creature,Knight | TokenOwner$ You | TokenColors$ White | TokenPower$ 2 | TokenToughness$ 2 | TokenKeywords$ Vigilance | TokenImage$ w 2 2 knight dom | SpellDescription$ Create a 2/2 white Knight creature token with vigilance. +A:AB$ Destroy | Cost$ B T tapXType | Announce$ X | ValidTgts$ Creature.powerLEX | TgtPrompt$ Select target creature with power X or less | References$ X | SpellDescription$ Destroy target creature with power X or less. +SVar:X:XChoice +DeckHas:Ability$Token +DeckHints:Type$Knight +SVar:Picture:http://www.wizards.com/global/images/magic/general/aryel_knight_of_windgrace.jpg +Oracle:Vigilance\n{2}{W}, T: Create a 2/2 white Knight creature token with vigilance.\n{B}, {T}, Tap X untapped Knights you control: Destroy target creature with power X or less. diff --git a/forge-gui/res/cardsfolder/upcoming/chandra_bold_pyromancer.txt b/forge-gui/res/cardsfolder/upcoming/chandra_bold_pyromancer.txt new file mode 100644 index 00000000000..348ddcca437 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/chandra_bold_pyromancer.txt @@ -0,0 +1,10 @@ +Name:Chandra, Bold Pyromancer +ManaCost:4 R R +Types:Legendary Planeswalker Chandra +Loyalty:5 +A:AB$ Mana | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Produced$ R | Amount$ 2 | AILogic$ ManaRitual | SubAbility$ DBDealDamage | SpellDescription$ Add {R}{R}. CARDNAME deals 2 damage to target player. +SVar:DBDealDamage:DB$ DealDamage | ValidTgts$ Player | TgtPrompt$ Select target player | NumDmg$ 2 +A:AB$ DealDamage | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | NumDmg$ 3 | SubAbility$ DBGainLife | SpellDescription$ CARDNAME deals 3 damage to target creature or planeswalker. +A:AB$ DamageAll | Cost$ SubCounter<7/LOYALTY> | Planeswalker$ True | Ultimate$ True | NumDmg$ 10 | ValidTgts$ Player | TgtPrompt$ Select a player | ValidCards$ Creature,Planeswalker | ValidPlayers$ Targeted | ValidDescription$ target player and each creature and planeswalker they control. | SpellDescription$ CARDNAME deals 10 damage to target player and each creature and planeswalker they control. +SVar:Picture:http://www.wizards.com/global/images/magic/general/chandra_bold_pyromancer.jpg +Oracle:[+1]: Add {R}{R}. Chandra, Bold Pyromancer deals 2 damage to target player.\n[-3]: Chandra, Bold Pyromancer deals 3 damage to target creature or planeswalker.\n[-7]: Chandra, Bold Pyromancer deals 10 damage to target player and each creature and planeswalker they control. \ No newline at end of file From b560df49a3a98d8c8eece0a546c1268dbc3f6048 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 18:23:47 +0800 Subject: [PATCH 04/10] - DOM: Added Firesong and Sunspeaker --- forge-game/src/main/java/forge/game/player/Player.java | 1 + .../main/java/forge/game/trigger/TriggerLifeGained.java | 6 ++++++ .../res/cardsfolder/upcoming/firesong_and_sunspeaker.txt | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt 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 f1762cf8de5..d6062e2279c 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -405,6 +405,7 @@ public class Player extends GameEntity implements Comparable { final Map runParams = Maps.newHashMap(); runParams.put("Player", this); runParams.put("LifeAmount", lifeGain); + runParams.put("Source", source); game.getTriggerHandler().runTrigger(TriggerType.LifeGained, runParams, false); game.fireEvent(new GameEventPlayerLivesChanged(this, oldLife, life)); diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java b/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java index 6c520df4570..ebd9dc56f5b 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java @@ -55,6 +55,12 @@ public class TriggerLifeGained extends Trigger { return false; } } + if (this.mapParams.containsKey("ValidSource")) { + if (!matchesValid(runParams2.get("Source"), this.mapParams.get("ValidSource").split(","), + this.getHostCard())) { + return false; + } + } return true; } diff --git a/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt b/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt new file mode 100644 index 00000000000..aea02829915 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt @@ -0,0 +1,9 @@ +Name:Firesong and Sunspeaker +ManaCost:4 R W +Types:Legendary Creature Minotaur Cleric +PT:4/6 +S:Mode$ Continuous | AddKeyword$ Lifelink | Affected$ Instant.Red+YouCtrl,Sorcery.Red+YouCtrl | AffectedZone$ Stack | Description$ Red instant and sorcery spells you control have lifelink. +T:Mode$ LifeGained | ValidPlayer$ You | ValidSource$ Instant.White,Sorcery.White | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever a white instant or sorcery spell causes you to gain life, CARDNAME deals 3 damage to target creature or player. +SVar:TrigDealDamage:DB$ DealDamage | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 3 +SVar:Picture:http://www.wizards.com/global/images/magic/general/firesong_and_sunspeaker.jpg +Oracle:Red instant and sorcery spells you control have lifelink.\nWhenever a white instant or sorcery spell causes you to gain life, Firesong and Sunspeaker deals 3 damage to target creature or player. From 6f60bb264a585421e8cb8c3b3e6267f2eb39d95a Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 19:28:34 +0800 Subject: [PATCH 05/10] - DOM: Added 3 cards --- .../res/cardsfolder/upcoming/garna_the_bloodflame.txt | 10 ++++++++++ .../res/cardsfolder/upcoming/grand_warlord_radha.txt | 10 ++++++++++ .../cardsfolder/upcoming/hallar_the_firefletcher.txt | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/garna_the_bloodflame.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/grand_warlord_radha.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/hallar_the_firefletcher.txt diff --git a/forge-gui/res/cardsfolder/upcoming/garna_the_bloodflame.txt b/forge-gui/res/cardsfolder/upcoming/garna_the_bloodflame.txt new file mode 100644 index 00000000000..a6110f52eae --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/garna_the_bloodflame.txt @@ -0,0 +1,10 @@ +Name:Garna, the Bloodflame +ManaCost:3 B R +Types:Legendary Creature Human Warrior +PT:3/3 +K:Flash +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChangeZone | TriggerDescription$ When CARDNAME enters the battlefield, return to your hand all creature cards in your graveyard that were put there from anywhere this turn. +SVar:TrigChangeZone:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | Defined$ ThisTurnEntered_Graveyard_Card.Creature+YouOwn+nonToken +S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddKeyword$ Haste | Description$ Other creatures you control have haste. +SVar:Picture:http://www.wizards.com/global/images/magic/general/garna_the_bloodflame.jpg +Oracle:Flash\nWhen Garna, the Bloodflame enters the battlefield, return to your hand all creature cards in your graveyard that were put there from anywhere this turn.\nOther creatures you control have haste. diff --git a/forge-gui/res/cardsfolder/upcoming/grand_warlord_radha.txt b/forge-gui/res/cardsfolder/upcoming/grand_warlord_radha.txt new file mode 100644 index 00000000000..dd7e3248250 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/grand_warlord_radha.txt @@ -0,0 +1,10 @@ +Name:Grand Warlord Radha +ManaCost:2 R G +Types:Legendary Creature Elf Warrior +PT:3/4 +K:Haste +T:Mode$ AttackersDeclared | AttackingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigMana | TriggerDescription$ Whenever one or more creatures you control attack, add that much mana in any combination of {R} and/or {G}. Until end of turn, you don't lose this mana as steps and phases end. +SVar:TrigMana:DB$ Mana | Produced$ Combo R G | Amount$ X | References$ X | PersistentMana$ True +SVar:X:Count$Valid Creature.attacking+YouCtrl +SVar:Picture:http://www.wizards.com/global/images/magic/general/grand_warlord_radha.jpg +Oracle:Haste\nWhenever one or more creatures you control attack, add that much mana in any combination of {R} and/or {G}. Until end of turn, you don't lose this mana as steps and phases end. diff --git a/forge-gui/res/cardsfolder/upcoming/hallar_the_firefletcher.txt b/forge-gui/res/cardsfolder/upcoming/hallar_the_firefletcher.txt new file mode 100644 index 00000000000..8b211596459 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/hallar_the_firefletcher.txt @@ -0,0 +1,11 @@ +Name:Hallar, the Firefletcher +ManaCost:1 R G +Types:Legendary Creature Elf Archer +PT:3/3 +K:Trample +T:Mode$ SpellCast | ValidCard$ Card.kicked | ValidActivatingPlayer$ You | Execute$ DBPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a spell, if that spell was kicked, put a +1/+1 counter on CARDNAME, then CARDNAME deals damage equal to the number of +1/+1 counters on it to each opponent. +SVar:DBPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBDealDamage +SVar:DBDealDamage:DB$ DealDamage | Defined$ Player.Opponent | NumDmg$ X | References$ X +SVar:X:Count$CardCounters.P1P1 +SVar:Picture:http://www.wizards.com/global/images/magic/general/hallar_the_firefletcher.jpg +Oracle:Trample\nWhenever you cast a spell, if that spell was kicked, put a +1/+1 counter on Hallar, the Firefletcher, then Hallar deals damage equal to the number of +1/+1 counters on it to each opponent. From 67064b32758feb9957e26271a0e21aded691b267 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 20:16:13 +0800 Subject: [PATCH 06/10] - DOM: Added Oath of Teferi --- .../game/spellability/SpellAbilityRestriction.java | 5 ++++- .../res/cardsfolder/upcoming/oath_of_teferi.txt | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/oath_of_teferi.txt diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java b/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java index 168b52f4605..996c7a3fc9a 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java @@ -479,7 +479,10 @@ public class SpellAbilityRestriction extends SpellAbilityVariables { && !activator.canCastSorcery()) { return false; } - final int limits = c.getAmountOfKeyword("May activate CARDNAME's loyalty abilities once"); + + final int initialLimit = c.hasKeyword("CARDNAME's loyalty abilities can be activated twice each turn rather than only once") ? 1 : 0; + final int limits = c.getAmountOfKeyword("May activate CARDNAME's loyalty abilities once") + initialLimit; + int numActivates = 0; for (final SpellAbility pwAbs : c.getAllSpellAbilities()) { // check all abilities on card that have their planeswalker diff --git a/forge-gui/res/cardsfolder/upcoming/oath_of_teferi.txt b/forge-gui/res/cardsfolder/upcoming/oath_of_teferi.txt new file mode 100644 index 00000000000..dadb25aa912 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/oath_of_teferi.txt @@ -0,0 +1,12 @@ +Name:Oath of Teferi +ManaCost:3 W U +Types:Legendary Enchantment +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, exile another target permanent you control. Return that card to the battlefield under its owner's control at the beginning of the next end step. +SVar:TrigExile:DB$ ChangeZone | ValidTgts$ Permanent.Other+YouCtrl | Mandatory$ True | TgtPrompt$ Select another target permanent you control | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DelTrig +SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigBounce | TriggerDescription$ Return exiled permanent to the battlefield. | RememberObjects$ Remembered | SubAbility$ DBCleanup +SVar:TrigBounce:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | Defined$ DelayTriggerRemembered +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +S:Mode$ Continuous | AffectedZone$ Battlefield | Affected$ Planeswalker.YouCtrl | AddHiddenKeyword$ CARDNAME's loyalty abilities can be activated twice each turn rather than only once | Description$ You may activate the loyalty abilities of planeswalkers you control twice each turn rather than only once. +SVar:NeedsToPlay:Planeswalker.YouCtrl +SVar:Picture:http://www.wizards.com/global/images/magic/general/oath_of_teferi.jpg +Oracle:When Oath of Teferi enters the battlefield, exile another target permanent you control. Return it to the battlefield under its owner's control at the beginning of the next end step.\nYou may activate the loyalty abilities of planeswalkers you control twice each turn rather than only once. From 7b837b446811efb96a7237427cbfe088ec12870b Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 11 Mar 2018 23:23:29 +0800 Subject: [PATCH 07/10] - DOM: Added a few cards --- .../src/main/java/forge/game/card/Card.java | 5 ----- forge-gui/res/cardsfolder/b/bartel_runeaxe.txt | 2 +- .../cardsfolder/upcoming/rona_disciple_of_gix.txt | 15 +++++++++++++++ .../cardsfolder/upcoming/shanna_sisays_legacy.txt | 10 ++++++++++ .../upcoming/slimefoot_the_stowaway.txt | 10 ++++++++++ .../upcoming/teferi_hero_of_dominaria.txt | 13 +++++++++++++ 6 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/rona_disciple_of_gix.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/shanna_sisays_legacy.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/slimefoot_the_stowaway.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/teferi_hero_of_dominaria.txt diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index f453cf12e6d..93378243eed 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -5002,11 +5002,6 @@ public class Card extends GameEntity implements Comparable { } } break; - case "CARDNAME can't be the target of Aura spells.": - if (source.isAura() && sa.isSpell()) { - result.setFalse(); - } - break; case "CARDNAME can't be enchanted.": if (source.isAura()) { result.setFalse(); diff --git a/forge-gui/res/cardsfolder/b/bartel_runeaxe.txt b/forge-gui/res/cardsfolder/b/bartel_runeaxe.txt index 95dcd9d6fc2..19bd942f504 100644 --- a/forge-gui/res/cardsfolder/b/bartel_runeaxe.txt +++ b/forge-gui/res/cardsfolder/b/bartel_runeaxe.txt @@ -3,6 +3,6 @@ ManaCost:3 B R G Types:Legendary Creature Giant Warrior PT:6/5 K:Vigilance -K:CARDNAME can't be the target of Aura spells. +S:Mode$ CantTarget | ValidCard$ Card.Self | ValidSource$ Aura | ValidSA$ Spell | Description$ CARDNAME can't be the target of Aura spells. SVar:Picture:http://www.wizards.com/global/images/magic/general/bartel_runeaxe.jpg Oracle:Vigilance\nBartel Runeaxe can't be the target of Aura spells. diff --git a/forge-gui/res/cardsfolder/upcoming/rona_disciple_of_gix.txt b/forge-gui/res/cardsfolder/upcoming/rona_disciple_of_gix.txt new file mode 100644 index 00000000000..2a7f4d4884c --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/rona_disciple_of_gix.txt @@ -0,0 +1,15 @@ +Name:Rona, Disciple of Gix +ManaCost:1 U B +Types:Legendary Creature Human Artificer +PT:2/2 +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ HistoricExile | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may exile target historic card from your graveyard. (Artifacts, legendaries, and Sagas are historic.) +SVar:HistoricExile:DB$ ChangeZone | ValidTgts$ Card.Historic | TgtPrompt$ Select target historic card from your graveyard | Origin$ Graveyard | Destination$ Exile | RememberChanged$ True +S:Mode$ Continuous | MayPlay$ True | Affected$ Card.nonLand+IsRemembered+ExiledWithSource | AffectedZone$ Exile | Description$ You may play cards exiled with CARDNAME. +T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget +SVar:DBForget:DB$ Pump | Defined$ TriggeredCard | ForgetObjects$ TriggeredCard +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Static$ True | ValidCard$ Card.Self | Execute$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +A:AB$ Mill | Cost$ 4 T | Defined$ You | NumCards$ 1 | Destination$ Exile | RememberMilled$ True | SpellDescription$ Exile the top card of your library. +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/rona_disciple_of_gix.jpg +Oracle:When Rona, Disciple of Gix enters the battlefield, you may exile target historic card from your graveyard. (Artifacts, legendaries, and Sagas are historic.)\nYou may cast nonland cards exiled with Rona.\n{4}, {T}: Exile the top card of your library. diff --git a/forge-gui/res/cardsfolder/upcoming/shanna_sisays_legacy.txt b/forge-gui/res/cardsfolder/upcoming/shanna_sisays_legacy.txt new file mode 100644 index 00000000000..7722d9d99d8 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/shanna_sisays_legacy.txt @@ -0,0 +1,10 @@ +Name:Shanna, Sisay's Legacy +ManaCost:G W +Types:Creature Human Warrior +PT:0/0 +S:Mode$ CantTarget | ValidCard$ Card.Self | ValidSource$ Card | ValidSA$ Activated,Triggered | Activator$ Player.Opponent | Description$ CARDNAME can't be the target of abilities your opponents control. +S:Mode$ Continuous | Affected$ Card.Self | AddPower$ X | AddToughness$ X | References$ X | Description$ CARDNAME gets +1/+1 for each creature you control. +SVar:X:Count$Valid Creature.YouCtrl +SVar:BuffedBy:Creature +SVar:Picture:http://www.wizards.com/global/images/magic/general/shanna_sisays_legacy.jpg +Oracle:Shanna, Sisay's Legacy can't be the target of abilities your opponents control.\nShanna gets +1/+1 for each creature you control. diff --git a/forge-gui/res/cardsfolder/upcoming/slimefoot_the_stowaway.txt b/forge-gui/res/cardsfolder/upcoming/slimefoot_the_stowaway.txt new file mode 100644 index 00000000000..3e5a647a9f4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/slimefoot_the_stowaway.txt @@ -0,0 +1,10 @@ +Name:Slimefoot, the Stowaway +ManaCost:1 B G +Types:Legendary Creature Fungus +PT:2/3 +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Saproling.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever a Saproling you control dies, CARDNAME deals 1 damage to each opponent and you gain 1 life. +SVar:TrigDealDamage:DB$ DamageAll | ValidPlayers$ Player.Opponent | NumDmg$ 1 | SubAbility$ DBGainLife +SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 1 +A:AB$ Token | Cost$ 4 | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 | TokenImage$ g 1 1 saproling dom | SpellDescription$ Create a 1/1 green Saproling creature token. +SVar:Picture:http://www.wizards.com/global/images/magic/general/slimefoot_the_stowaway.jpg +Oracle:Whenever a Saproling you control dies, Slimefoot, the Stowaway deals 1 damage to each opponent and you gain 1 life.\n{4}: Create a 1/1 green Saproling creature token. diff --git a/forge-gui/res/cardsfolder/upcoming/teferi_hero_of_dominaria.txt b/forge-gui/res/cardsfolder/upcoming/teferi_hero_of_dominaria.txt new file mode 100644 index 00000000000..29919a6d2e4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/teferi_hero_of_dominaria.txt @@ -0,0 +1,13 @@ +Name:Teferi, Hero of Dominaria +ManaCost:3 W U +Types:Legendary Planeswalker Teferi +Loyalty:4 +A:AB$ Draw | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Defined$ You | NumCards$ 1 | SubAbility$ DelTrigUntap | SpellDescription$ Draw a card. At the beginning of the next end step, untap two lands. +SVar:DelTrigUntap:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigUntap | TriggerDescription$ At the beginning of the next end step, untap two lands. +SVar:TrigUntap:DB$ Untap | UntapExactly$ True | UntapType$ Land | Amount$ 2 | Defined$ You +A:AB$ ChangeZone | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 2 | IsCurse$ True | SpellDescription$ Put target nonland permanent into its owner's library third from the top. +A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Emblem - Teferi, Hero of Dominaria | Image$ emblem_teferi_hero_of_dominaria | Triggers$ TrigDraw | SVars$ EffSpellCast | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "Whenever you draw a card, exile target permanent an opponent controls." +SVar:TrigDraw:Mode$ Drawn | ValidCard$ Card.YouCtrl | Execute$ EffSpellCast | TriggerDescription$ Whenever you draw a card, exile target permanent an opponent controls. +SVar:EffSpellCast:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Permanent.OppCtrl | TgtPrompt$ Select target permanent an opponent controls +SVar:Picture:http://www.wizards.com/global/images/magic/general/teferi_hero_of_dominaria.jpg +Oracle:[+1]: Draw a card. At the beginning of the next end step, untap two lands.\n[-3]: Put target nonland permanent into its owner's library third from the top.\n[-8]: You get an emblem with "Whenever you draw a card, exile target permanent an opponent controls." From 0251d5776ebe9f5c2ac6fc392a34e52e404780e8 Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 12 Mar 2018 09:10:18 +0800 Subject: [PATCH 08/10] - DOM: Fixed Firesong and Sunspeaker so cycling Renewed Faith wouldn't trigger it --- .../java/forge/game/ability/effects/LifeExchangeEffect.java | 4 ++-- .../game/ability/effects/LifeExchangeVariantEffect.java | 2 +- .../java/forge/game/ability/effects/LifeGainEffect.java | 2 +- forge-game/src/main/java/forge/game/cost/CostGainLife.java | 2 +- forge-game/src/main/java/forge/game/player/Player.java | 5 +++++ .../src/main/java/forge/game/trigger/TriggerLifeGained.java | 6 ++++++ .../res/cardsfolder/upcoming/firesong_and_sunspeaker.txt | 2 +- 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeEffect.java b/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeEffect.java index db89905d8d5..c813793b545 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeEffect.java @@ -65,11 +65,11 @@ public class LifeExchangeEffect extends SpellAbilityEffect { if ((life1 > life2) && p1.canLoseLife() && p2.canGainLife()) { final int diff = life1 - life2; p1.loseLife(diff); - p2.gainLife(diff, source); + p2.gainLife(diff, source, sa); } else if ((life2 > life1) && p2.canLoseLife() && p1.canGainLife()) { final int diff = life2 - life1; p2.loseLife(diff); - p1.gainLife(diff, source); + p1.gainLife(diff, source, sa); } else { // they are equal, so nothing to do } diff --git a/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeVariantEffect.java b/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeVariantEffect.java index c0836c66c06..beeafe366f6 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeVariantEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/LifeExchangeVariantEffect.java @@ -84,7 +84,7 @@ public class LifeExchangeVariantEffect extends SpellAbilityEffect { game.fireEvent(new GameEventCardStatsChanged(source)); } else if ((num > pLife) && p.canGainLife()) { final int diff = num - pLife; - p.gainLife(diff, source); + p.gainLife(diff, source, sa); source.addNewPT(power, toughness, timestamp); game.fireEvent(new GameEventCardStatsChanged(source)); } else { diff --git a/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java b/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java index e1826ea8e4d..780a7f04838 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java @@ -46,7 +46,7 @@ public class LifeGainEffect extends SpellAbilityEffect { for (final Player p : tgtPlayers) { if (!sa.usesTargeting() || p.canBeTargetedBy(sa)) { - p.gainLife(lifeAmount, sa.getHostCard()); + p.gainLife(lifeAmount, sa.getHostCard(), sa); } } } diff --git a/forge-game/src/main/java/forge/game/cost/CostGainLife.java b/forge-game/src/main/java/forge/game/cost/CostGainLife.java index aac1a5dbd2f..d2837e8ee61 100644 --- a/forge-game/src/main/java/forge/game/cost/CostGainLife.java +++ b/forge-game/src/main/java/forge/game/cost/CostGainLife.java @@ -114,7 +114,7 @@ public class CostGainLife extends CostPart { return false; playersLeft--; - opp.gainLife(c, null); + opp.gainLife(c, ability.getHostCard(), ability); } return true; } 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 d6062e2279c..c05bd569f7d 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -360,6 +360,10 @@ public class Player extends GameEntity implements Comparable { } public final boolean gainLife(int lifeGain, final Card source) { + return gainLife(lifeGain, source, null); + } + + public final boolean gainLife(int lifeGain, final Card source, final SpellAbility sa) { // Run any applicable replacement effects. final Map repParams = Maps.newHashMap(); @@ -406,6 +410,7 @@ public class Player extends GameEntity implements Comparable { runParams.put("Player", this); runParams.put("LifeAmount", lifeGain); runParams.put("Source", source); + runParams.put("SourceSA", sa); game.getTriggerHandler().runTrigger(TriggerType.LifeGained, runParams, false); game.fireEvent(new GameEventPlayerLivesChanged(this, oldLife, life)); diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java b/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java index ebd9dc56f5b..939c4c3019b 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java @@ -61,6 +61,12 @@ public class TriggerLifeGained extends Trigger { return false; } } + if (this.mapParams.containsKey("Spell")) { + final SpellAbility spellAbility = (SpellAbility) runParams2.get("SourceSA"); + if (spellAbility == null || !spellAbility.isSpell()) { + return false; + } + } return true; } diff --git a/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt b/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt index aea02829915..95b76a1a09c 100644 --- a/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt +++ b/forge-gui/res/cardsfolder/upcoming/firesong_and_sunspeaker.txt @@ -3,7 +3,7 @@ ManaCost:4 R W Types:Legendary Creature Minotaur Cleric PT:4/6 S:Mode$ Continuous | AddKeyword$ Lifelink | Affected$ Instant.Red+YouCtrl,Sorcery.Red+YouCtrl | AffectedZone$ Stack | Description$ Red instant and sorcery spells you control have lifelink. -T:Mode$ LifeGained | ValidPlayer$ You | ValidSource$ Instant.White,Sorcery.White | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever a white instant or sorcery spell causes you to gain life, CARDNAME deals 3 damage to target creature or player. +T:Mode$ LifeGained | ValidPlayer$ You | ValidSource$ Instant.White,Sorcery.White | Spell$ True | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever a white instant or sorcery spell causes you to gain life, CARDNAME deals 3 damage to target creature or player. SVar:TrigDealDamage:DB$ DealDamage | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 3 SVar:Picture:http://www.wizards.com/global/images/magic/general/firesong_and_sunspeaker.jpg Oracle:Red instant and sorcery spells you control have lifelink.\nWhenever a white instant or sorcery spell causes you to gain life, Firesong and Sunspeaker deals 3 damage to target creature or player. From 57c9c2fe90827194401c4c4e22746037b5b2c5ba Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 12 Mar 2018 09:32:39 +0800 Subject: [PATCH 09/10] - Fixed Firesong and Sunspeaker: the trigger should check the root spellability - FIXME: forge.game.card.CardDamageMap.triggerDamageDoneOnce(boolean) should add the source spellability to fix spells with Lifelink --- .../src/main/java/forge/game/trigger/TriggerLifeGained.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java b/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java index 939c4c3019b..86b310e1c74 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerLifeGained.java @@ -63,7 +63,7 @@ public class TriggerLifeGained extends Trigger { } if (this.mapParams.containsKey("Spell")) { final SpellAbility spellAbility = (SpellAbility) runParams2.get("SourceSA"); - if (spellAbility == null || !spellAbility.isSpell()) { + if (spellAbility == null || !spellAbility.getRootAbility().isSpell()) { return false; } } From 2120d4493e8dfb65313488a25eecba6a35c993cd Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 12 Mar 2018 09:51:14 +0800 Subject: [PATCH 10/10] - DOM: Added Tiana, Ship's Caretaker --- .../src/main/java/forge/game/card/CardDamageMap.java | 1 + .../cardsfolder/upcoming/tiana_ships_caretaker.txt | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/tiana_ships_caretaker.txt diff --git a/forge-game/src/main/java/forge/game/card/CardDamageMap.java b/forge-game/src/main/java/forge/game/card/CardDamageMap.java index 10460db5c0f..b9dc7d91617 100644 --- a/forge-game/src/main/java/forge/game/card/CardDamageMap.java +++ b/forge-game/src/main/java/forge/game/card/CardDamageMap.java @@ -53,6 +53,7 @@ public class CardDamageMap extends ForwardingTable { sourceLKI.getGame().getTriggerHandler().runTrigger(TriggerType.DamageDealtOnce, runParams, false); if (sourceLKI.hasKeyword("Lifelink")) { + // FIXME: add sourceSA to fix Firesong and Sunspeaker sourceLKI.getController().gainLife(sum, sourceLKI); } } diff --git a/forge-gui/res/cardsfolder/upcoming/tiana_ships_caretaker.txt b/forge-gui/res/cardsfolder/upcoming/tiana_ships_caretaker.txt new file mode 100644 index 00000000000..bf48ebaf89d --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/tiana_ships_caretaker.txt @@ -0,0 +1,11 @@ +Name:Tiana, Ship's Caretaker +ManaCost:3 R W +Types:Legendary Creature Angel Artificer +PT:3/3 +K:Flying +K:First Strike +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Equipment.YouCtrl,Aura.YouCtrl | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ DelayedTrig | TriggerDescription$ Whenever an Aura or Equipment you control is put into a graveyard from the battlefield, you may return that card to its owner's hand at the beginning of the next end step. +SVar:DelayedTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigBounce | RememberObjects$ TriggeredCard | TriggerDescription$ Return that card to its owner's hand at the beginning of the next end step. +SVar:TrigBounce:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | Defined$ DelayTriggerRemembered +SVar:Picture:http://www.wizards.com/global/images/magic/general/tiana_ships_caretaker.jpg +Oracle:Flying, first strike\nWhenever an Aura or Equipment you control is put into a graveyard from the battlefield, you may return that card to its owner's hand at the beginning of the next end step.