diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index 763af4cf279..b1d671b8660 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -366,10 +366,9 @@ public class CostAdjustment { if (manaCost.toString().equals("{0}")) { return 0; } - final Map params = staticAbility.getMapParams(); final Card hostCard = staticAbility.getHostCard(); final Card card = sa.getHostCard(); - final String amount = params.get("Amount"); + final String amount = staticAbility.getParam("Amount"); if (!checkRequirement(sa, staticAbility)) { return 0; @@ -380,14 +379,16 @@ public class CostAdjustment { value = CardFactoryUtil.xCount(card, hostCard.getSVar(amount)); } else if ("Undaunted".equals(amount)) { value = card.getController().getOpponents().size(); + } else if (staticAbility.hasParam("Relative")) { + value = AbilityUtils.calculateAmount(hostCard, amount, sa); } else { value = AbilityUtils.calculateAmount(hostCard, amount, staticAbility); } - if (!params.containsKey("Cost") && ! params.containsKey("Color")) { + if (!staticAbility.hasParam("Cost") && ! staticAbility.hasParam("Color")) { int minMana = 0; - if (params.containsKey("MinMana")) { - minMana = Integer.valueOf(params.get("MinMana")); + if (staticAbility.hasParam("MinMana")) { + minMana = Integer.valueOf(staticAbility.getParam("MinMana")); } final int maxReduction = Math.max(0, manaCost.getConvertedManaCost() - minMana); @@ -395,7 +396,7 @@ public class CostAdjustment { return Math.min(value, maxReduction); } } else { - final String color = params.containsKey("Cost") ? params.get("Cost") : params.get("Color"); + final String color = staticAbility.getParamOrDefault("Cost", staticAbility.getParam("Color")); int sumGeneric = 0; // might be problematic for wierd hybrid combinations for (final String cost : color.split(" ")) { diff --git a/forge-gui/res/cardsfolder/n/not_of_this_world.txt b/forge-gui/res/cardsfolder/n/not_of_this_world.txt index e747fcf7b97..4e313af0fe7 100644 --- a/forge-gui/res/cardsfolder/n/not_of_this_world.txt +++ b/forge-gui/res/cardsfolder/n/not_of_this_world.txt @@ -1,8 +1,8 @@ Name:Not of This World ManaCost:7 Types:Tribal Instant Eldrazi -S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | References$ CostReduction,CheckTgt | EffectZone$ All | Description$ CARDNAME costs {7} less to cast if it targets a spell or ability that targets a creature you control with power 7 or greater. -A:SP$ Counter | Cost$ 7 | TargetType$ Spell,Activated,Triggered | TgtPrompt$ Select target spell or ability that targets a permanent you control | ValidTgts$ Card | TargetValidTargeting$ Permanent.YouCtrl+inZoneBattlefield | SpellDescription$ Counter target spell or ability that targets a permanent you control. +S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | Relative$ True | References$ CostReduction,CheckTgt | EffectZone$ All | Description$ CARDNAME costs {7} less to cast if it targets a spell or ability that targets a creature you control with power 7 or greater. +A:SP$ Counter | Cost$ 7 | TargetType$ Spell,Activated,Triggered | TgtPrompt$ Select target spell or ability that targets a permanent you control | ValidTgts$ Card | TargetValidTargeting$ Permanent.YouCtrl+inZoneBattlefield | References$ CostReduction,CheckTgt | SpellDescription$ Counter target spell or ability that targets a permanent you control. SVar:CostReduction:Count$Compare CheckTgt GE1.7.0 SVar:CheckTgt:TargetedByTarget$Valid Card.powerGE7+YouCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/not_of_this_world.jpg diff --git a/forge-gui/res/cardsfolder/p/price_of_fame.txt b/forge-gui/res/cardsfolder/p/price_of_fame.txt index 83fd2baf529..e29205ac3ef 100644 --- a/forge-gui/res/cardsfolder/p/price_of_fame.txt +++ b/forge-gui/res/cardsfolder/p/price_of_fame.txt @@ -1,8 +1,8 @@ Name:Price of Fame ManaCost:3 B Types:Instant -S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | EffectZone$ All | Description$ CARDNAME costs {2} less to cast if it targets a legendary creature. -A:SP$ Destroy | Cost$ 3 B | ValidTgts$ Creature | SubAbility$ DBSurveil | TgtPrompt$ Select target creature | SpellDescription$ Destroy target creature. +S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | Relative$ True | EffectZone$ All | References$ CostReduction,CheckTgt | Description$ CARDNAME costs {2} less to cast if it targets a legendary creature. +A:SP$ Destroy | Cost$ 3 B | ValidTgts$ Creature | SubAbility$ DBSurveil | TgtPrompt$ Select target creature | References$ CostReduction,CheckTgt | SpellDescription$ Destroy target creature. SVar:CostReduction:Count$Compare CheckTgt GE1.2.0 SVar:CheckTgt:Targeted$Valid Creature.Legendary SVar:DBSurveil:DB$ Surveil | Amount$ 2 diff --git a/forge-gui/res/cardsfolder/s/savage_stomp.txt b/forge-gui/res/cardsfolder/s/savage_stomp.txt index c5842261a68..1ebd7823dc5 100644 --- a/forge-gui/res/cardsfolder/s/savage_stomp.txt +++ b/forge-gui/res/cardsfolder/s/savage_stomp.txt @@ -1,7 +1,7 @@ Name:Savage Stomp ManaCost:2 G Types:Sorcery -S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | References$ CostReduction,CheckTgt | EffectZone$ All | Description$ CARDNAME costs {2} less to cast if it targets a Dinosaur you control. +S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | Relative$ True | References$ CostReduction,CheckTgt | EffectZone$ All | Description$ CARDNAME costs {2} less to cast if it targets a Dinosaur you control. SVar:CostReduction:Count$Compare CheckTgt GE1.2.0 SVar:CheckTgt:Targeted$Valid Creature.Dinosaur+YouCtrl A:SP$ PutCounter | Cost$ 2 G | AILogic$ Fight | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to put a +1/+1 counter | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBFight | References$ CostReduction,CheckTgt | SpellDescription$ Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control. diff --git a/forge-gui/res/cardsfolder/upcoming/titanic_brawl.txt b/forge-gui/res/cardsfolder/upcoming/titanic_brawl.txt index 88018deada9..abcc8bf9f01 100644 --- a/forge-gui/res/cardsfolder/upcoming/titanic_brawl.txt +++ b/forge-gui/res/cardsfolder/upcoming/titanic_brawl.txt @@ -1,9 +1,10 @@ Name:Titanic Brawl ManaCost:1 G Types:Instant -S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ 1 | EffectZone$ All | CheckSVar$ X | SVarCompare$ GE1 | Description$ This spell costs {1} less to cast if it targets a creature you control with a +1/+1 counter on it. -SVar:X:Count$Valid Creature.YouCtrl+counters_GE1_P1P1 +S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ CostReduction | EffectZone$ All | References$ CostReduction,CheckTgt | Relative$ True | Description$ This spell costs {1} less to cast if it targets a creature you control with a +1/+1 counter on it. +SVar:CostReduction:Count$Compare CheckTgt GE1.2.0 +SVar:CheckTgt:Targeted$Valid Creature.YouCtrl+counters_GE1_P1P1 DeckHints:Ability$Counters -A:SP$ Pump | Cost$ 1 G | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | SpellDescription$ Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) +A:SP$ Pump | Cost$ 1 G | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | References$ CostReduction,CheckTgt | SpellDescription$ Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Choose target creature you don't control Oracle:This spell costs {1} less to cast if it targets a creature you control with a +1/+1 counter on it.\nTarget creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.)