Class BuffSpell

java.lang.Object
All Implemented Interfaces:
java.io.Serializable, HasDesc<SpellDesc>
Direct Known Subclasses:
BuffHeroSpell, BuffLeftmostMinionInHandSpell, GainArmorSpell, GainStatsOfHighestCostMinionSpell, StealHealthSpell, VileIntentSpell

public class BuffSpell
extends RevertableSpell
Gives the target a stats boost of either *+ SpellArg.VALUE / + SpellArg.VALUE) or (+ SpellArg.ATTACK_BONUS / + SpellArg.HP_BONUS ). If the target is a Hero, like EntityReference.FRIENDLY_HERO, SpellArg.ARMOR_BONUS will give the hero armor.

If a ModifyBuffSpellAura is in play and matches the source, this effect will add the aura's specified attack and HP bonuses to the buff given by this spell only if the buff spell has the specified key.

When a ModifyBuffSpellAura is in play, this effect sets the GameValue.SPELL_VALUE retrieved by GameValueProvider (1) to the HP bonus specified on this effect when querying the aura for the amount of additional HP bonus to apply, and then (2) to the attack bonus specified on this effect when querying the aura for the amount of additional attack bonus to apply.

For example, this trigger implements "Whenever you cast a spell, gain Armor equal to its Cost:"

   "trigger": {
     "eventTrigger": {
       "class": "SpellCastedTrigger",
       "sourcePlayer": "SELF"
     },
     "spell": {
       "class": "BuffSpell",
       "target": "FRIENDLY_HERO",
       "armorBonus": {
         "class": "ManaCostProvider",
         "target": "EVENT_TARGET"
       }
     }
   }
 
Observe that the "armorBonus" can be a ValueProvider.

Or, in this example "Battlecry: Shuffle a friendly minion into your deck and give it +3/+3.":

   "battlecry": {
     "targetSelection": "FRIENDLY_MINIONS",
     "spell": {
       "class": "ShuffleMinionToDeckSpell",
       "spell": {
         "class": "BuffSpell",
         "target": "OUTPUT",
         "attackBonus": 3,
         "hpBonus": 3
       },
       "howMany": 1
     }
   },
 
Here, the target is EntityReference.OUTPUT, which refers to the card that was shuffled into the player's deck, and the bonuses are expressed as integer values.

Weapons will interpret the HP bonus as a benefit to durability. For example, "Give your weapon +1/+1":

     "spell": {
       "class": "BuffSpell",
       "target": "FRIENDLY_WEAPON",
       "attackBonus": 1,
       "hpBonus": 1
     }
 
See Also:
to "buff" attributes., Serialized Form