java.lang.Object
net.demilich.metastone.game.spells.desc.valueprovider.ValueProvider
net.demilich.metastone.game.spells.desc.valueprovider.GameValueProvider
All Implemented Interfaces:
Serializable, HasDesc<ValueProviderDesc>

public class GameValueProvider extends ValueProvider
Used to retrieve a variable calculated in a MetaSpell.

This value provider lets you "bake in" or calculate a value at one point of time, using it at a later point. This is especially useful for effects that deal damage based on the number of minions destroyed, for example; an earlier part of the spell destroyed the minions you need to count, so you can count how many minions were on the board before the destroy spell was run, and then see how many of those old ones still remain.

To retrieve the SpellArg.VALUE from a MetaSpell, use GameValue.SPELL_VALUE:

   {
     "class": "MetaSpell",
     "value": { ... },
     "spells": [
       {
         "class": "DamageSpell",
         "value": {
           "class": "GameValueProvider",
           "gameValue": "SPELL_VALUE"
         }
       }
     ]
   }
 
See Also: