Enum Class SpellArg
- All Implemented Interfaces:
Serializable,Comparable<SpellArg>,Constable
SpellDesc / the keys of the dictionaries in the CardDesc card JSON files for spells.}
To see how a particular argument is interpreted, refer to the Java Spell
class written in the CLASS field of the SpellDesc. For example, if you see the spell:
{
"class": "DrawCardSpell",
"value": 1
}
Observe that VALUE corresponds to the key "value" in this JSON. All the fields in the JSON
in camelCase have a corresponding field name in UPPER_CASE. To see what "value" / VALUE means in this context, visit DrawCardSpell.
Observe that every SpellArg enum value is a key in the JSON for spell effects, except camelCased and
surrounded by quotation marks. When you read documentation for Spell
subclasses and you see a SpellArg referred to there, assume the documentation is telling you to write a
camelCased version of the SpellArg into the JSON to get the effect you want. For example, if the
documentation says that EXCLUSIVE, when set to true, does something, you'll write something like
this in the JSON:
{
...
"exclusive": true
}
Whenever a new entry is added here, a corresponding deserialization instruction must be authoered in DescDeserializer.init(DescDeserializer.SerializationContext). If a new type is added (the right hand side of the
JSON key/value pair), a new ParseValueType needs to be added.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSpecifies a unique integer ID for aSpellDescthat is also a deathrattle, to allow deathrattles to identify themselves inside iterators forHasDeathrattleEnchantments.getDeathrattleEnchantments().The amount of armor to buff to an entity, which is almost always only a hero.The amount of attack to buff to an entity.Indicates an attribute for the spell, typically the one being added, removed, targeted or filtered.Indicates anAuraDesc, typically one that will be put into play on a target.Specifies a battlecry as aOpenerDescthat will soon be added by aAddBattlecrySpell.This argument is added by the resolution ofGameLogic.resolveAftermaths(Player, Actor).Typically interpreted as a position relative to thesourceof a spell.Whentrue, indicatesDiscoverSpellshould not show a card the player already has in his hand.Interpreted as the card the spell is acting on.Describes aCardCostModifierfor theCardCostModifierSpell.Describes the kind of card created in aCreateCardSpell.AnEntityFilterthat typically operates on cards.Multiple card filters that are used by effects likeDiscoverFilteredCardSpell.A value fromSpellsource.ZonesMessage.Zonesthat represents a place to or from a card will be affected.ACardSourcethat specifies an original list of cards that should be filtered, typically with aCARD_FILTER.Used by theCreateCardSpellto determine what kind of card to make.An array version ofCARD.The Java subclass ofSpell, located in thenet.demilich.metastone.game.spellsornet.demilich.metastone.game.spells.custom(when prefixed with"custom.") packages in this module.AConditionthat is evaluated against atarget.The array version ofCONDITION.A piece of text that gets written on the card using theSetDescriptionSpell, or a description to appear on a generated card in aCastFromGroupSpell.A typically catch-all boolean argument.AnEntityFilterthat is applied to the targets returned by theTARGETorTargetSelectionspecified on theCardDesc.getTargetSelection().Whentrue, indicates toModifyMaxManaSpellwhether it should give a player full or empty mana crystals.For internal use only.For spells whereVALUEhas a separate interpretation from "copies" or "duplicates," this arg is typically used to indicate copies or duplicates.Used byBuffSpellto indicate how much additional full-healed health should be given to thetargetas a buff.Used by theDamageSpellto indicate that even though this effect is written on a spell card, the amount of damage dealt (theVALUE) should not be affected by spell damage.Used by theCreateCardSpellto indicate how much the card it creates should cost.Used by various spells to put a name on a card or to change the name of a target card.AnAlgebraicOperationthat is typically used to do math.Like aQUESTbut a player can have multiple of these active at once.Used byAddQuestSpellto define aQuestto put into play.Used by theSetRaceSpellto change a target minion's race.Whentrue, indicates that a random single target from the list of filtered targets should be cast on by this spell.Used by theRevertableSpellseries of spells to indicate whichEventTriggerwill cause the effects to be "reverted."Used by theRevertableSpellseries of spells to indicate anotherEventTriggerthat will cause the effects to be "reverted."Used by theCreateCardSpellto name the card is creates.Typically interpreted as a second target for effects that have asource, atarget, and another entity that does something to thetarget.Indicates a second value.Used by theAddSecretSpellto define aSecretto put into play.Overrides the source of an effect with the specifiedEntityReference, which must resolve to zero to one targets.Typically theSpellDescthat is cast withEntityReference.OUTPUTset to the result of the parent spell's effect; or, the spell that is cast when aConditionis met.An array of spells, used almost exclusively byMetaSpellas the spells to cast, one after another, or byConditionalSpell, cast when the corresponding conditions inCONDITIONSare met.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.For internal use only.Specifies theEntityReferenceon which this spell should be cast, overriding thetargetreceived from the parent or selected by the user.Indicates whose point of view this spell should be cast from.Used by theCreateCardSpellto indicate the card's target selection.Specifies theEnchantmentDescenchantment that should be created, typically by theAddEnchantmentSpell.The plural version ofTRIGGER.The value is either an integer or aValueProviderwhich is typically interpreted as the amount or copies of an action.Specifies which zones the spell's effects apply to. -
Method Summary
-
Enum Constant Details
-
CLASS
The Java subclass ofSpell, located in thenet.demilich.metastone.game.spellsornet.demilich.metastone.game.spells.custom(when prefixed with"custom.") packages in this module. -
ARMOR_BONUS
The amount of armor to buff to an entity, which is almost always only a hero. -
ATTACK_BONUS
The amount of attack to buff to an entity. Used by a few spells and auras. -
ATTRIBUTE
Indicates an attribute for the spell, typically the one being added, removed, targeted or filtered. -
AURA
Indicates anAuraDesc, typically one that will be put into play on a target. -
BOARD_POSITION_ABSOLUTE
This argument is added by the resolution ofGameLogic.resolveAftermaths(Player, Actor). It stores the position of the minion before it died. This then gets used by spells likeSummonSpellto summon a minion where the minion died.It may someday be interpreted by other spells to put an entity in a particular position.
-
BOARD_POSITION_RELATIVE
Typically interpreted as a position relative to thesourceof a spell. -
CANNOT_RECEIVE_OWNED
Whentrue, indicatesDiscoverSpellshould not show a card the player already has in his hand. -
CARD
Interpreted as the card the spell is acting on. It is typically the ID (file name of a card without the".json"extension) of a card.This argument is fairly common. For a
SummonSpell, it indicates which card to summon. For aReceiveCardSpell, it indicates which card should be put in the player's hand.Many spells use a
SpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int)system to interpret a set of arguments (CARDbeing one of them) as a way to specify "a bunch of cards." -
CARD_COST_MODIFIER
Describes aCardCostModifierfor theCardCostModifierSpell. -
CARD_DESC_TYPE
Describes the kind of card created in aCreateCardSpell. Considered obsolete. -
CARD_FILTER
AnEntityFilterthat typically operates on cards. These cards are retrieved from aCardSource, which when not specified is theUnweightedCatalogueSourceby default for random effects andCatalogueSourcefor discovers. LikeCARD, it is used by pipelines likeSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int)andSpellDesc.getFilteredCards(GameContext, Player, Entity)to generate a list of cards for some effect.This argument shouldn't be confused with
CardFilter. AnyEntityFiltercan be on the right hand side of a"cardFilter". -
CARD_FILTERS
Multiple card filters that are used by effects likeDiscoverFilteredCardSpell. Considered obsolete. -
CARD_LOCATION
A value fromSpellsource.ZonesMessage.Zonesthat represents a place to or from a card will be affected. -
CARD_SOURCE
ACardSourcethat specifies an original list of cards that should be filtered, typically with aCARD_FILTER. Common choices for a card source includeCatalogueSourceandUnweightedCatalogueSource. -
CARD_SOURCES
-
CARD_TYPE
Used by theCreateCardSpellto determine what kind of card to make. Considered obsolete. -
CARDS
An array version ofCARD. Typically interpreted as a group of cards, rather than as a random selection of one of these cards. -
CONDITION
-
CONDITIONS
The array version ofCONDITION. -
DESCRIPTION
A piece of text that gets written on the card using theSetDescriptionSpell, or a description to appear on a generated card in aCastFromGroupSpell.Eventually, the value of this argument will support dynamic text generation and more advanced text manipulation.
-
EXCLUSIVE
A typically catch-all boolean argument.In many cases, this arg is interpreted to mean the difference between affecting the
target(whentrue) versus the base card (whenfalse). Consult the spell's documentation for its specific interpretation.In other cases, setting this arg to
truesuppresses the firing of an event. This is used by e.g.ShuffleToDeckSpellto prevent an infinite loop of shuffles for cards like Augmented Elekk.In other cases, setting this arg to
trueonly causes the "secondary" effect to occur in the spell. This is used by e.g.ExcessDamageSpellto only deal excess damage instead of both the regular and excess damage.Finally, this arg is used by
SummonSpellto only summon minions whose card ID is not already present on the casting player's battlefield.Use "Find Usages" to see the various ways this arg is used.
-
FILTER
AnEntityFilterthat is applied to the targets returned by theTARGETorTargetSelectionspecified on theCardDesc.getTargetSelection(). After filtering, if no targets remain, the spell is not cast; or, if the spell has a target selection specified and no targets are available, the spell typically cannot be cast.This arg is interpreted by the spell casting system and never by any
Spellclass in particular.- See Also:
-
FULL_MANA_CRYSTALS
Whentrue, indicates toModifyMaxManaSpellwhether it should give a player full or empty mana crystals. -
HOW_MANY
For spells whereVALUEhas a separate interpretation from "copies" or "duplicates," this arg is typically used to indicate copies or duplicates.Because
VALUEis used bySpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int)to indicate how many random cards should be selected, this arg is typically used to indicate the number of copies of those cards. Therefore, a good rule of thumb is that the number of cards that will be operated on by aSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int)call is"value" x "howMany"cards. -
HP_BONUS
Used byBuffSpellto indicate how much additional full-healed health should be given to thetargetas a buff. -
IGNORE_SPELL_DAMAGE
Used by theDamageSpellto indicate that even though this effect is written on a spell card, the amount of damage dealt (theVALUE) should not be affected by spell damage. -
MANA
Used by theCreateCardSpellto indicate how much the card it creates should cost. Considered obsolete. -
NAME
Used by various spells to put a name on a card or to change the name of a target card. -
OPERATION
AnAlgebraicOperationthat is typically used to do math.Currently only used by
ModifyDamageSpell. -
PACT
Like aQUESTbut a player can have multiple of these active at once. -
RACE
Used by theSetRaceSpellto change a target minion's race. -
QUEST
Used byAddQuestSpellto define aQuestto put into play. -
RANDOM_TARGET
Whentrue, indicates that a random single target from the list of filtered targets should be cast on by this spell.SummonSpell, when given aCARDSargument, will interpret this arg to mean that a single card should be chosen from the list of cards to summon. -
REVERT_TRIGGER
Used by theRevertableSpellseries of spells to indicate whichEventTriggerwill cause the effects to be "reverted." -
SECRET
Used by theAddSecretSpellto define aSecretto put into play. -
SECOND_REVERT_TRIGGER
Used by theRevertableSpellseries of spells to indicate anotherEventTriggerthat will cause the effects to be "reverted." -
SECONDARY_NAME
Used by theCreateCardSpellto name the card is creates. Considered obsolete. -
SECONDARY_TARGET
Typically interpreted as a second target for effects that have asource, atarget, and another entity that does something to thetarget.The
EntityReferencehere is typically interpreted usingGameContext.resolveSingleTarget(Player, Entity, EntityReference), a method which returns one entity from "group references" (i.e.EntityReference.isTargetGroup()= true). -
SECONDARY_VALUE
Indicates a second value. Implements some Reservoir effects and otherwise only used by Swipe spell. -
SPELL
Typically theSpellDescthat is cast withEntityReference.OUTPUTset to the result of the parent spell's effect; or, the spell that is cast when aConditionis met. -
SPELL1
-
SPELL2
-
SPELLS
An array of spells, used almost exclusively byMetaSpellas the spells to cast, one after another, or byConditionalSpell, cast when the corresponding conditions inCONDITIONSare met. -
SUMMON_BASE_HP
For internal use only. -
SUMMON_BASE_ATTACK
For internal use only. -
SUMMON_WINDFURY
For internal use only. -
SUMMON_TAUNT
For internal use only. -
SUMMON_CHARGE
For internal use only. -
SUMMON_DIVINE_SHIELD
For internal use only. -
SUMMON_STEALTH
For internal use only. -
SUMMON_TRIGGERS
For internal use only. -
SUMMON_BATTLECRY
For internal use only. -
SUMMON_DEATHRATTLE
For internal use only. -
SUMMON_AURA
For internal use only. -
TARGET
Specifies theEntityReferenceon which this spell should be cast, overriding thetargetreceived from the parent or selected by the user.This entity reference, when a
EntityReference.isTargetGroup()group reference, is filtered byFILTER. If the target turns out to be empty or the filtering removes all targets, the spell is not cast. -
SOURCE
Overrides the source of an effect with the specifiedEntityReference, which must resolve to zero to one targets.Some references are still "group references" that typically refer to exactly one entity if it exists, or zero if it does not. For example,
EntityReference.FRIENDLY_WEAPON. This is an appropriate specifier for source. -
TARGET_PLAYER
Indicates whose point of view this spell should be cast from. Typically becomes theplayerobject in the spell's Spell#cast(GameContext, Player, SpellDesc, Entity, List) implementationonCast. -
TARGET_SELECTION
Used by theCreateCardSpellto indicate the card's target selection. Considered obsolete. -
TRIGGER
Specifies theEnchantmentDescenchantment that should be created, typically by theAddEnchantmentSpell. -
GROUP
For internal use only. -
TRIGGERS
The plural version ofTRIGGER. -
VALUE
The value is either an integer or aValueProviderwhich is typically interpreted as the amount or copies of an action.For most spells that generate cards using
SpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int), the value is interpreted as the number of cards to select from the randomly generated list. In that case,HOW_MANYis used to indicate copies. -
BATTLECRY
Specifies a battlecry as aOpenerDescthat will soon be added by aAddBattlecrySpell. -
AFTERMATH_ID
Specifies a unique integer ID for aSpellDescthat is also a deathrattle, to allow deathrattles to identify themselves inside iterators forHasDeathrattleEnchantments.getDeathrattleEnchantments(). -
ZONES
Specifies which zones the spell's effects apply to. The interpretation may depend on the spell.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-