From 2cea9debcf56f51d77dc40c0430782cd2f3555da Mon Sep 17 00:00:00 2001 From: Sloth Date: Sun, 13 Oct 2013 19:26:17 +0000 Subject: [PATCH] - Added Carom. --- .gitattributes | 1 + res/cardsfolder/c/carom.txt | 20 +++++++++++++++++++ .../java/forge/card/ability/AbilityUtils.java | 6 ++++++ .../card/ability/SpellAbilityEffect.java | 3 +++ 4 files changed, 30 insertions(+) create mode 100644 res/cardsfolder/c/carom.txt diff --git a/.gitattributes b/.gitattributes index c2b95053108..b8337230da5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1608,6 +1608,7 @@ res/cardsfolder/c/carnival_hellsteed.txt -text res/cardsfolder/c/carnival_of_souls.txt svneol=native#text/plain res/cardsfolder/c/carnivorous_plant.txt svneol=native#text/plain res/cardsfolder/c/carnophage.txt svneol=native#text/plain +res/cardsfolder/c/carom.txt -text res/cardsfolder/c/carpet_of_flowers.txt -text res/cardsfolder/c/carrier_pigeons.txt svneol=native#text/plain res/cardsfolder/c/carrion.txt svneol=native#text/plain diff --git a/res/cardsfolder/c/carom.txt b/res/cardsfolder/c/carom.txt new file mode 100644 index 00000000000..df44475d558 --- /dev/null +++ b/res/cardsfolder/c/carom.txt @@ -0,0 +1,20 @@ +Name:Carom +ManaCost:1 W +Types:Instant +A:SP$ Pump | Cost$ 1 W | ValidTgts$ Creature | TgtPrompt$ Select target creature to redirect damage to | ImprintTargets$ True | SubAbility$ DBEffect | StackDescription$ SpellDescription | SpellDescription$ The next 1 damage that would be dealt to target creature this turn is dealt to another target creature instead. Draw a card. +SVar:DBEffect:DB$ Effect | ValidTgts$ Creature | TgtPrompt$ Select target creature to redirect damage from | TargetUnique$ True | ReplacementEffects$ SelflessCombat,SelflessNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,RestDmgCombat,RestDmg,ExileEffect,X,Y | References$ SelflessCombat,SelflessNonCombat,OutOfSight,CombatDmg,NonCombatDmg,RestDmgCombat,RestDmg,ExileEffect,X,Y | RememberObjects$ Targeted | ImprintCards$ Imprinted | SubAbility$ DBCleanup +SVar:SelflessCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to target creature this turn is dealt to another target creature instead. +SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to target creature this turn is dealt to another target creature instead. +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True +SVar:X:ReplaceCount$DamageAmount/Minus.1 +SVar:Y:ReplaceCount$DamageAmount +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True | SubAbility$ DBDraw +SVar:DBDraw:DB$ Draw | NumCards$ 1 +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/carom.jpg +Oracle:The next 1 damage that would be dealt to target creature this turn is dealt to another target creature instead.\nDraw a card. \ No newline at end of file diff --git a/src/main/java/forge/card/ability/AbilityUtils.java b/src/main/java/forge/card/ability/AbilityUtils.java index 6c9e2390a68..83a95c529f7 100644 --- a/src/main/java/forge/card/ability/AbilityUtils.java +++ b/src/main/java/forge/card/ability/AbilityUtils.java @@ -1189,6 +1189,12 @@ public class AbilityUtils { } } + if (sa.hasParam("ImprintTargets") && sa.getTargetRestrictions() != null) { + for (final Card c : sa.getTargets().getTargetCards()) { + host.addImprinted(c); + } + } + if (sa.hasParam("RememberCostCards")) { if (sa.getParam("Cost").contains("Exile")) { final List paidListExiled = sa.getPaidList("Exiled"); diff --git a/src/main/java/forge/card/ability/SpellAbilityEffect.java b/src/main/java/forge/card/ability/SpellAbilityEffect.java index 32c1c6285e6..9b2255d17a8 100644 --- a/src/main/java/forge/card/ability/SpellAbilityEffect.java +++ b/src/main/java/forge/card/ability/SpellAbilityEffect.java @@ -60,6 +60,9 @@ import forge.card.spellability.SpellAbility; if (stackDesc != null) { if ("SpellDescription".equalsIgnoreCase(stackDesc)) { // by typing "none" they want to suppress output sb.append(params.get("SpellDescription").replace("CARDNAME", sa.getSourceCard().getName())); + if (sa.getTargets() != null && !sa.getTargets().getTargets().isEmpty()) { + sb.append(" (Targeting: " + sa.getTargets().getTargets() + ")"); + } } else if (!"None".equalsIgnoreCase(stackDesc)) { // by typing "none" they want to suppress output makeSpellDescription(sa, sb, stackDesc); }