Package net.demilich.metastone.game.spells
package net.demilich.metastone.game.spells
Spells contain all the functional pieces of the card JSON (Click on description to learn more about how to use this).
Each of these classes correspond to the value part of a spell's "class" key in the card JSON. For
example, if you saw the following in the card JSON:
{
"class": "DrawCardSpell"
}
You would look up DrawCardSpell here.
Then, SpellArg referenced in the documentation correspond to keys in
the JSON. For example, if you saw the following in the card JSON:
{
"class": "DrawCardSpell",
"value": 1
}
You'll see that DrawCardSpell says that SpellArg.VALUE is the number of cards to draw. That arg refers to the key
"value" in the JSON. We refer to this change in casing as "camelCase"; each spell arg corresponds to a
camelCased version in the JSON, where you remove the underscores and start the first letter lowercase, subsequent
starts of words uppercase.-
ClassDescriptionA base class for spells that modify the enchantments hosted by
targetor thetargetitself if it is an enchantment.Indicates this effect will remove a card somehow.Activates the enchantments hosted by the target or the enchantment targeted intargetSimply performsSpellArg.SPELL1if the target entity is an Actor, orSpellArg.SPELL2if they are a Card.Gives thetargettheSpellArg.SPELLas a deathrattle.Adds theSpellArg.SECONDARY_TARGETcard's text to thetarget's description, concatenating with a space.Adds anSpellArg.AURA(Aura) or aEnchantment(in theSpellArg.TRIGGER) to the specifiedtargetand immediately puts that aura/enchantment into play (i.e., activates it).Adds the specifiedSpellArg.PACTfor the specifiedSpellArg.TARGET_PLAYER.Adds the specifiedSpellArg.QUESTfor the specifiedSpellArg.TARGET_PLAYER.Puts the specifiedSpellArg.SECRET(anEnchantmentDesc) into play.CastsSpellArg.SPELL1on thetargetminion, andSpellArg.SPELL2on the minions adjacent to the target.An internal spell used to implementBuffAura.Indicates that the effects should occur for both players, without using theTargetPlayer.BOTHvalue inSpellArg.TARGET_PLAYER.Deprecated.Gives thetargeta stats boost of either *+SpellArg.VALUE/ +SpellArg.VALUE) or (+SpellArg.ATTACK_BONUS/ +SpellArg.HP_BONUS).Creates aCardCostModifierspecified bySpellArg.CARD_COST_MODIFIERthat is hosted by the specifiedSpellArg.TARGET.Casts the subspell after the sequence has ended.Casts the specifiedSpellArg.CARDor the card targeted bySpellArg.SECONDARY_TARGETonto thetarget.Use aDiscoverSpellinstead, since groups were never well thought-out anyway.Casts a random spell from theSpellArg.CARD_SOURCE,SpellArg.CARD_FILTERandSpellArg.CARDSprovided.Casts the specifiedSpellArg.SPELLforSpellArg.HOW_MANYtimes.Tries to cast the spell card (given either bySpellArg.CARDorSpellArg.SECONDARY_TARGET) onto the specified target.Changes theSpellArg.TARGET_PLAYERhero power to a random hero power retrieved fromSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc).Changes the hero ofSpellArg.TARGET_PLAYERto the specified hero card ID inSpellArg.CARD.Prompts the player to choose among cards in their hand.The definition of aChooseOneSpell's sub spells.Provides a choice betweenSpellArg.SPELL1andSpellArg.SPELL2, using theSpellArg.NAMEandSpellArg.DESCRIPTIONin those spells to generate the choice cards.Deprecated.Deprecated.Use SummonSpell instead.Shorthand for aConditionalEffectSpellthat only plays the spell if the player has activated a combo (i.e., previously played a card earlier this turn).Deprecated.Use aBuffAurainstead.CastsSpellArg.SPELL1and evaluates theSpellArg.CONDITION: if it is fulfilled, castsSpellArg.SPELL2.Casts theSpellArg.SPELLif theConditioninSpellArg.CONDITIONis met; or, when aSpellArg.SPELLSarray is specified, casts the spell in the array if its correspondingSpellArg.CONDITIONSarray member is met.Copies atarget's source card.Copies thetargetactor's deathrattles onto thesource(i.e., result ofEntityReference.SELF) of this spell.CallsChangeHeroPowerSpellwithSpellArg.CARDequal to the casting player's opponent's hero power card ID.Deprecated.This spell is fairly brittle and you will be better off implementing the intended effects directly.Deprecated.Deals damage to the specified actor, bypassing its armor.DealsSpellArg.VALUEdamage to the specifiedtarget.Deactivates the enchantments hosted by the target or deactivates thetargetenchantment.DealsSpellsource.DamageTypeMessage.DamageType.DECAYdamage to thesource.Destroys all minions except one.Destroys all the secrets belonging toSpellArg.TARGET_PLAYER.Destroys thetargetActor.Discards or removes all cards fromSpellArg.TARGET_PLAYER's deck, up toSpellArg.VALUErandom cards.Discards cards from theSpellsource.ZonesMessage.Zones.HANDor from aCardSourcelikeDeckSourcewhich does not generate new cards (does not implementHasCardCreationSideEffects), likeDeckSource.Deprecated.UseDiscoverSpellwith a"spell": {"class": "ReceiveCardSpell"}instead.Deprecated.UseDiscoverSpellinstead.This class is currently only used for tri-class card discoveries.Deprecated.The discover option spell is fairly brittle.Deprecated.UseDiscoverSpellwith aSpellArg.CARD_FILTERinstead.Prompts the user to make an irreversible choice of some number of cards, and casts a spell for the chosen (and optionally, unchosen) cards.Doubles thetargetActor's total attack.DealsSpellArg.VALUEdamage to thetarget.Deprecated.Use aDrawCardSpellwith a sub spell like{"class": "DrawCardSpell", "spell": {"class": ..., "target": "OUTPUT"}}instead.Draws a card from the graveyard.DrawsSpellArg.VALUEcards from the top of the player's deck.Draws cards until a condition is met.Makes each actor inSpellArg.SECONDARY_TARGETattack another random actor inSpellArg.TARGET.Implements the attack bonus portion of a complete Enrage effect.Deprecated.byEquipWeaponSpell.Equips the specified weapon inSpellArg.CARDor chooses a random one based on theSpellArg.CARD_FILTERandSpellArg.CARD_SOURCEfor the specifiedSpellArg.TARGET_PLAYER.Performs aHealSpelleffect.Increments and deals fatigue damage to theplayer(SpellArg.TARGET_PLAYER).Causes thesourceor each entity inSpellArg.SECONDARY_TARGETtoGameLogic.fight(Player, Actor, Actor, PhysicalAttackAction)thetarget.LikeConditionalSpell, except executes the first matching condition.At the moment this spell is invoked, the sequence is ended and dead entities are cleaned up from the board, triggering deathrattles.Moves a card from the deck to the hand.Implements "50% chance to target the wrong entity" when coupled with an appropriate trigger.Gives the hero of thetarget's ownerSpellArg.VALUEarmor.Gives the player a temporary amount ofSpellArg.VALUEmana.Used inMetaSpellandGameValueProviderto refer to specific values calculated at the timeMetaSpellis evaluated.Casts healing missiles.Heals the specifiedtargetforSpellArg.VALUEamount.Signifies that the subspellsSpellArg.SPELL,SpellArg.SPELLS, etc.) represent the "hero power effect" for cards that interact with the hero power.Casts an Invoke effect specified inSpellArg.SPELLforSpellArg.MANAmana cost.When the player has at leastAttribute.INVOKEadditional unspent mana, source an extra bonus effect for that cost.A joust causes both players to show a random card satisfying theSpellArg.CARD_FILTERand performs an action if the mana cost of the caster's card is higher than the opponent's card's cost.A class that defines a collection of spells that should be executed one after another in theSpellArg.SPELLSargument.Takes control of atarget, changing its owner to the caster.Misdirection overrides theEntityReference.ATTACKER's current target to another random target withinSpellArg.SECONDARY_TARGET.This spell castsSpellArg.HOW_MANYmissiles, each dealingSpellArg.VALUEdamage (with spell damage) to random targets.Increments (or decrements, if negative) bySpellArg.VALUEtheSpellArg.ATTRIBUTEon the giventarget.Modifies the amount of damage that is currently about to be dealt.Modifies the durability of a weapon regardless of which weapon is equipped.Adds or destroysSpellArg.VALUEmana crystals.Gives a minionAttribute.WITHERand the appropriate trigger if it does not already have it.CastsSpellArg.SPELLon a random target from the list of targets inSpellArg.TARGETat mostSpellArg.VALUEtimes or until random targets are exhausted, whichever comes first.A spell that has no effects.Acts like anAdjacentEffectSpellexcept on minions opposite of thetargetThis spell implements the new Overkill mechanic introduced in Rastakhan's Rumble.Overrides the target of the nextGameLogic.targetAcquisition(Player, Entity, GameAction)call.Indicates a measurement about a player to use withPlayerAttributeValueProvider.MakesSpellArg.HOW_MANYcopies of the base card of thetarget.Puts the specified cards (targetor otherwise fromSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int)) on the top of the deck.Puts the target minion card into theSpellsource.ZonesMessage.Zones.BATTLEFIELDfrom theSpellsource.ZonesMessage.Zones.DECK.Summons a minion from thetargetcard onto the board in a way that counts it as being played from the hand or deck.Puts the cards fromSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int)on the bottom of the player's deck.Deprecated.TakesSpellArg.HOW_MANYsecret cards from theSpellArg.CARD_SOURCE(defaulting to aDeckSource) and puts those secrets directly into play without triggering aSecretPlayedTrigger.Interprets the spell arguments as a query of targets and castsSpellArg.SPELLon each resultingtargetin order.Indicates that theSpellArg.SPELLandSpellArg.SPELLSon this spell are Quick Draw effects.Casts a spell card with random targets.Givem a list of effects inSpellArg.SPELLS, randomly choose one to cast thetarget.Deprecated.UseCastRandomSpellSpellinstead.Recasts theSpellArg.SPELLSpellArg.HOW_MANYtimes or up to 60 (14 if this is Grim Patron) by default.Deprecated.byReceiveCardSpell, which supports sub spells inSpellArg.SPELL.Puts a card in your hand.Retrieves the last card from the filtered list of cards specified bySpellArg.CARD_SOURCEandSpellArg.CARD_FILTER.Recruits (summons and removes the source card of)SpellArg.VALUEminions fromSpellArg.CARD_LOCATIONlocation.Refreshes the caster's hero power so it can be used again.Refreshes the player's mana by gaining an amount of mana equal to the difference in their max mana and current mana.This abstract class provides a way to cast spell effects on targets.Removes atargetactor peacefully (without triggering its deathrattles) from its current zone.Removes theSpellArg.ATTRIBUTEfrom the specifiedtarget.Removes "bonus" attributes, or attributes that didn't start on the text of the minion.Deprecated.Use aRemoveCardSpellwith a sub spell like{"class": "RemoveCardSpell", "spell": {"class": ..., "target": "OUTPUT"}}instead.Removes thetargetCardby putting it directly from the zone it's currently in into theSpellsource.ZonesMessage.Zones.GRAVEYARD.Expires and removesSpellArg.HOW_MANYcopies (defaultInteger.MAX_VALUE) of the enchantments whoseEntity.getSourceCard()has the card ID ofSpellArg.CARDfrom thetarget.Deprecated.Has no implementation.Deprecated.UseReplaceCardsSpellinstead.Replaces thetargetwith one of the cards fromSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int).Shorthand for aConditionalEffectSpellthat only plays the conditional (second) spell if the caster's deck has a number of cards greater than or equal to theSpellArg.VALUE.Sets the deck to its initial state at the start of the game.Resurrects minions from both player's graveyards.Resurrects minions from the caster's graveyard.Deprecated.UseReturnTargetToHandSpellinstead.Returns thetargetto the player's hand as a card.Returns thetargetto the hand, keeping its enchantments.Reveals a card from a filter,SpellArg.CARDor thetargetif neither is specified.This spell is the base class for spells that can be undone by aSpellArg.REVERT_TRIGGERorSpellArg.SECOND_REVERT_TRIGGER.Reviving a minion, unlike resurrecting it, puts a minion back into the position on the board where it died.Roasting a card removes the card from the top of the deck and adds theAttribute.ROASTEDto it.During aTargetAcquisitionEventor aPhysicalAttackEventfiring, changes theEntityReference.ATTACKERto the specifiedtarget.Sets thetarget's attack-related attributes such that the result ofActor.getAttack()orCard.getAttack()is equal to theSpellArg.VALUE.Sets thetargetCard'sAttribute.CARD_IDorAttribute.AURA_CARD_IDto the card ID specified inSpellArg.CARD.Sets thetargetentity'sAttribute.DESCRIPTIONto the string specified inSpellArg.DESCRIPTION, or clears it if no description is specified.Deprecated.Sets theActororCard's hitpoints to the specifiedSpellArg.VALUE, overriding any existing bonuses stored inAttribute.HP_BONUS.Sets a player's max mana to the givenSpellArg.VALUEPeacefully removes thetargetminion and shuffles it into the caster's deck.Shuffles a card directly into the deck, not its copy.Shuffles copies of the specifiedtargetorSpellArg.CARD_SOURCE&SpellArg.CARD_FILTERcards into the deck.Shuffles thetargetSpellsource.EntityTypeMessage.EntityType.MINIONinto the player's deck with the enchantmentsSilences the specifiedActor.Sorts a deck by mana costs, putting the lowest cost cards on top.The base class for "spells," or collections of effects in the engine.A set of utilities to help write spells.An object that contains results of aSpellUtils.determineCastingPlayer(GameContext, Player, Entity, TargetPlayer)call.Steals thetargetcard and moves it to the caster's zone fromSpellArg.CARD_LOCATION.Steals a random secret belonging to the opponent ofSpellArg.TARGET_PLAYER.Reads a card ID from the specified attributeSpellArg.ATTRIBUTE.Summons minions specified by cards; summons random minions from card filters; or copies minions according to targets.Indicates that the subspells should be cast as the "Supremacy" effect.Swaps thetarget's attack and hitpoints, making the target's hitpoints its attack value and vice versa.Swaps thetarget's attack with thesourceactor's attack.Swaps thetarget's hitpoints with thesourceactor's hitpoints.Swaps the minion specified bySpellArg.SECONDARY_TARGETwith thetarget.DealsSpellArg.VALUEdamage to thetargetandSpellArg.SECONDARY_VALUEdamage to theSpellArg.SECONDARY_TARGETactors.Indicates a player reference.Puts thetargetthat's passed into this spell as the sub spell'ssource.Gives thetargetactorSpellArg.VALUEbonus attack until the end of the current turn.Transforms atargetcard to the specifiedSpellArg.CARDby removing the old card and receiving a new one.Transforms thetargetminion into theSpellArg.CARDor the source card of the entity pointed to bySpellArg.SECONDARY_TARGET.Transforms thetargetinto a random base minion fromSpellUtils.getCards(GameContext, Player, Entity, Entity, SpellDesc, int).Triggers thetargetentity's aftermaths.Triggers the opener written on eachtargetentity with random targets (except itself).Triggers the Quick Draw effect wrapped by theQuickDrawSpellwritten on thetarget.Triggers a specific secret, either from theSpellArg.CARDif specified or thetargetcard.Uses theSpellArg.TARGET_PLAYER's hero power, choosing a target randomly.Deals magical damage from the weapon equipped by theplayer(SpellArg.TARGET_PLAYER), correctly accounting for effects likeAttribute.LIFESTEALandAttribute.POISONOUS.Casts a spell on a target and its copies "wherever they are" in theplayer(casting player's) zones.
BuffSpellinstead.