From 37f905699c2547ebbf2134a5106acd8bbebbee55 Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Wed, 27 Jan 2021 08:07:11 +0000 Subject: [PATCH] AbilityUtils: CastTotalSnowManaSpent for snow spent --- .../main/java/forge/game/ability/AbilityUtils.java | 13 +++++++++++++ forge-gui/res/cardsfolder/u/ugins_insight.txt | 5 ++--- forge-gui/res/cardsfolder/upcoming/graven_lore.txt | 8 ++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/graven_lore.txt 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 c67284c1610..9383c885a4f 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -20,6 +20,7 @@ import forge.game.card.*; import forge.game.cost.Cost; import forge.game.keyword.Keyword; import forge.game.keyword.KeywordInterface; +import forge.game.mana.Mana; import forge.game.mana.ManaConversionMatrix; import forge.game.mana.ManaCostBeingPaid; import forge.game.player.Player; @@ -1771,6 +1772,18 @@ public class AbilityUtils { if (sq[0].startsWith("CastTotalManaSpent")) { return CardFactoryUtil.doXMath(c.getCastSA() != null ? c.getCastSA().getTotalManaSpent() : 0, expr, c); } + + if (sq[0].equals("CastTotalSnowManaSpent")) { + int v = 0; + if (c.getCastSA() != null) { + for (Mana m : c.getCastSA().getPayingMana()) { + if (m.isSnow()) { + v += 1; + } + } + } + return CardFactoryUtil.doXMath(v, expr, c); + } } } return CardFactoryUtil.xCount(c, s2); diff --git a/forge-gui/res/cardsfolder/u/ugins_insight.txt b/forge-gui/res/cardsfolder/u/ugins_insight.txt index afbe851f374..a6b9eb6b104 100644 --- a/forge-gui/res/cardsfolder/u/ugins_insight.txt +++ b/forge-gui/res/cardsfolder/u/ugins_insight.txt @@ -1,8 +1,7 @@ Name:Ugin's Insight ManaCost:3 U U Types:Sorcery -A:SP$ Scry | Cost$ 3 U U | ScryNum$ X | References$ X | SpellDescription$ Scry X, where X is the highest converted mana cost among permanents you control, then draw three cards. | SubAbility$ DBDraw +A:SP$ Scry | Cost$ 3 U U | ScryNum$ X | References$ X | SubAbility$ DBDraw | SpellDescription$ Scry X, where X is the highest converted mana cost among permanents you control, then draw three cards. SVar:X:Count$MaxCMCYouCtrl -SVar:DBDraw:DB$Draw | NumCards$ 3 -SVar:Picture:http://www.wizards.com/global/images/magic/general/ugins_insight.jpg +SVar:DBDraw:DB$ Draw | NumCards$ 3 Oracle:Scry X, where X is the highest converted mana cost among permanents you control, then draw three cards. diff --git a/forge-gui/res/cardsfolder/upcoming/graven_lore.txt b/forge-gui/res/cardsfolder/upcoming/graven_lore.txt new file mode 100644 index 00000000000..9d8e32588e4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/graven_lore.txt @@ -0,0 +1,8 @@ +Name:Graven Lore +ManaCost:3 U U +Types:Snow Instant +A:SP$ Scry | Cost$ 3 U U | ScryNum$ X | References$ X | SubAbility$ DBDraw | SpellDescription$ Scry X, where is the amount of {S} spent to cast this spell, then draw three cards. ({S} is mana from a snow source.) +SVar:DBDraw:DB$ Draw | NumCards$ 3 +SVar:X:Count$CastTotalSnowManaSpent +DeckNeeds:Type$Snow +Oracle:Scry X, where is the amount of {S} spent to cast this spell, then draw three cards. ({S} is mana from a snow source.)