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 aSpellDesc
that 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 aOpenerDesc
that will soon be added by aAddBattlecrySpell
.This argument is added by the resolution ofGameLogic.resolveAftermaths(Player, Actor)
.Typically interpreted as a position relative to thesource
of a spell.Whentrue
, indicatesDiscoverSpell
should not show a card the player already has in his hand.Interpreted as the card the spell is acting on.Describes aCardCostModifier
for theCardCostModifierSpell
.Describes the kind of card created in aCreateCardSpell
.AnEntityFilter
that typically operates on cards.Multiple card filters that are used by effects likeDiscoverFilteredCardSpell
.A value fromSpellsource.ZonesMessage.Zones
that represents a place to or from a card will be affected.ACardSource
that specifies an original list of cards that should be filtered, typically with aCARD_FILTER
.Used by theCreateCardSpell
to determine what kind of card to make.An array version ofCARD
.The Java subclass ofSpell
, located in thenet.demilich.metastone.game.spells
ornet.demilich.metastone.game.spells.custom
(when prefixed with"custom."
) packages in this module.ACondition
that 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.AnEntityFilter
that is applied to the targets returned by theTARGET
orTargetSelection
specified on theCardDesc.getTargetSelection()
.Whentrue
, indicates toModifyMaxManaSpell
whether it should give a player full or empty mana crystals.For internal use only.For spells whereVALUE
has a separate interpretation from "copies" or "duplicates," this arg is typically used to indicate copies or duplicates.Used byBuffSpell
to indicate how much additional full-healed health should be given to thetarget
as a buff.Used by theDamageSpell
to 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 theCreateCardSpell
to 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.AnAlgebraicOperation
that is typically used to do math.Like aQUEST
but a player can have multiple of these active at once.Used byAddQuestSpell
to define aQuest
to put into play.Used by theSetRaceSpell
to 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 theRevertableSpell
series of spells to indicate whichEventTrigger
will cause the effects to be "reverted."Used by theRevertableSpell
series of spells to indicate anotherEventTrigger
that will cause the effects to be "reverted."Used by theCreateCardSpell
to 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 theAddSecretSpell
to define aSecret
to put into play.Overrides the source of an effect with the specifiedEntityReference
, which must resolve to zero to one targets.Typically theSpellDesc
that is cast withEntityReference.OUTPUT
set to the result of the parent spell's effect; or, the spell that is cast when aCondition
is met.An array of spells, used almost exclusively byMetaSpell
as the spells to cast, one after another, or byConditionalSpell
, cast when the corresponding conditions inCONDITIONS
are 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 theEntityReference
on which this spell should be cast, overriding thetarget
received from the parent or selected by the user.Indicates whose point of view this spell should be cast from.Used by theCreateCardSpell
to indicate the card's target selection.Specifies theEnchantmentDesc
enchantment that should be created, typically by theAddEnchantmentSpell
.The plural version ofTRIGGER
.The value is either an integer or aValueProvider
which 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.spells
ornet.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 likeSummonSpell
to 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 thesource
of a spell. -
CANNOT_RECEIVE_OWNED
Whentrue
, indicatesDiscoverSpell
should 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 (CARD
being one of them) as a way to specify "a bunch of cards." -
CARD_COST_MODIFIER
Describes aCardCostModifier
for theCardCostModifierSpell
. -
CARD_DESC_TYPE
Describes the kind of card created in aCreateCardSpell
. Considered obsolete. -
CARD_FILTER
AnEntityFilter
that typically operates on cards. These cards are retrieved from aCardSource
, which when not specified is theUnweightedCatalogueSource
by default for random effects andCatalogueSource
for 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
. AnyEntityFilter
can 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.Zones
that represents a place to or from a card will be affected. -
CARD_SOURCE
ACardSource
that specifies an original list of cards that should be filtered, typically with aCARD_FILTER
. Common choices for a card source includeCatalogueSource
andUnweightedCatalogueSource
. -
CARD_SOURCES
-
CARD_TYPE
Used by theCreateCardSpell
to 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
true
suppresses the firing of an event. This is used by e.g.ShuffleToDeckSpell
to prevent an infinite loop of shuffles for cards like Augmented Elekk.In other cases, setting this arg to
true
only causes the "secondary" effect to occur in the spell. This is used by e.g.ExcessDamageSpell
to only deal excess damage instead of both the regular and excess damage.Finally, this arg is used by
SummonSpell
to 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
AnEntityFilter
that is applied to the targets returned by theTARGET
orTargetSelection
specified 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
Spell
class in particular.- See Also:
-
FULL_MANA_CRYSTALS
Whentrue
, indicates toModifyMaxManaSpell
whether it should give a player full or empty mana crystals. -
HOW_MANY
For spells whereVALUE
has a separate interpretation from "copies" or "duplicates," this arg is typically used to indicate copies or duplicates.Because
VALUE
is 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 byBuffSpell
to indicate how much additional full-healed health should be given to thetarget
as a buff. -
IGNORE_SPELL_DAMAGE
Used by theDamageSpell
to 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 theCreateCardSpell
to 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
AnAlgebraicOperation
that is typically used to do math.Currently only used by
ModifyDamageSpell
. -
PACT
Like aQUEST
but a player can have multiple of these active at once. -
RACE
Used by theSetRaceSpell
to change a target minion's race. -
QUEST
Used byAddQuestSpell
to define aQuest
to 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 aCARDS
argument, will interpret this arg to mean that a single card should be chosen from the list of cards to summon. -
REVERT_TRIGGER
Used by theRevertableSpell
series of spells to indicate whichEventTrigger
will cause the effects to be "reverted." -
SECRET
Used by theAddSecretSpell
to define aSecret
to put into play. -
SECOND_REVERT_TRIGGER
Used by theRevertableSpell
series of spells to indicate anotherEventTrigger
that will cause the effects to be "reverted." -
SECONDARY_NAME
Used by theCreateCardSpell
to 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
EntityReference
here 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 theSpellDesc
that is cast withEntityReference.OUTPUT
set to the result of the parent spell's effect; or, the spell that is cast when aCondition
is met. -
SPELL1
-
SPELL2
-
SPELLS
An array of spells, used almost exclusively byMetaSpell
as the spells to cast, one after another, or byConditionalSpell
, cast when the corresponding conditions inCONDITIONS
are 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 theEntityReference
on which this spell should be cast, overriding thetarget
received 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 theplayer
object in the spell's Spell#cast(GameContext, Player, SpellDesc, Entity, List) implementationonCast
. -
TARGET_SELECTION
Used by theCreateCardSpell
to indicate the card's target selection. Considered obsolete. -
TRIGGER
Specifies theEnchantmentDesc
enchantment 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 aValueProvider
which 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_MANY
is used to indicate copies. -
BATTLECRY
Specifies a battlecry as aOpenerDesc
that will soon be added by aAddBattlecrySpell
. -
AFTERMATH_ID
Specifies a unique integer ID for aSpellDesc
that 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
-