Class OpenerDesc
- All Implemented Interfaces:
Serializable
,Cloneable
,HasEntrySet<BattlecryDescArg,
,Object> AbstractEnchantmentDesc<Opener>
Like a spell, battlecries take targetSelection
, assumed to be TargetSelection.NONE
if not specified
in the JSON.
For example, this battlecry summons a 2/1 minion:
{ "spell": { "class": "SummonSpell", "boardPositionRelative": "RIGHT", "card": "token_ooze", "targetPlayer": "SELF" } }This battlecry deals 2 damage to the chosen minion:
{ "targetSelection": "MINIONS", "spell": { "class": "DamageSpell", "value": 2 } }This battlecry implements, "If you're holding a spell, deal 1 damage."
{ "targetSelection": "ANY", "spell": { "class": "DamageSpell", "value": 1 }, "condition": { "class": "HoldsCardCondition", "cardFilter": { "class": "CardFilter", "cardType": "SPELL" } } }This battlecry is one of two for "Choose One - Deal 2 damage, or Draw a Card". Notice the flavorful name.
{ "spell": { "class": "DrawCardSpell" }, "name": "Study in the Library", "description": "Draw a Card" }
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.demilich.metastone.game.cards.desc.HasEntrySet
HasEntrySet.BfsEnum, HasEntrySet.BfsNode<T extends Enum,
V> -
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
entrySet()
The condition to evaluate if the player will be prompted to make a battlecry action.A description used to render a card representing the battlecry.getName()
A name used to render a card representing the battlecry.getSpell()
The spell to cast when this battlecry'scondition
is true (or always cast if no condition is specified and a valid target is available).The targets the battlecry can choose from.void
setCondition
(ConditionDesc condition) void
setDescription
(String description) void
void
void
setTargetSelection
(TargetSelection targetSelection) void
setTargetSelectionCondition
(ConditionDesc targetSelectionCondition) void
setTargetSelectionOverride
(TargetSelection targetSelectionOverride) tryCreate
(GameContext context, Player player, Entity effectSource, Card enchantmentSource, Entity host, boolean force) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.demilich.metastone.game.cards.desc.HasEntrySet
bfs
-
Field Details
-
spell
-
targetSelection
-
condition
-
name
-
description
-
targetSelectionOverride
-
targetSelectionCondition
-
-
Constructor Details
-
OpenerDesc
public OpenerDesc()
-
-
Method Details
-
getTargetSelection
The targets the battlecry can choose from.Battlecries only go into target selection if their
condition
is met.If target selection is specified and no valid targets are available, the battlecry is not cast.
-
toOpenerAction
-
getSpell
The spell to cast when this battlecry'scondition
is true (or always cast if no condition is specified and a valid target is available). -
setSpell
-
setTargetSelection
-
getCondition
The condition to evaluate if the player will be prompted to make a battlecry action.The condition is also used to determine if the
Card
in the player's hand should receive a "yellow glow" indicating its condition is met.In order to implement this glow, it is preferred to specify a condition here rather than using a
ConditionalSpell
in thespell
field. -
setCondition
-
getName
A name used to render a card representing the battlecry. When not specified, the description is used instead. Used for choose-one battlecries.If the
spell
is aTransformMinionSpell
, theSpellArg.CARD
of that spell (the minion the choose-one minion will be transformed into) will be used to render the choice instead, regardless of your specification of name. -
setName
-
getDescription
A description used to render a card representing the battlecry. Used for choose-one battlecries.If the
spell
is aTransformMinionSpell
, theSpellArg.CARD
of that spell (the minion the choose-one minion will be transformed into) will be used to render the choice instead, regardless of your specification of description. -
setDescription
-
entrySet
- Specified by:
entrySet
in interfaceHasEntrySet<BattlecryDescArg,
Object>
-
clone
-
getTargetSelectionCondition
-
getTargetSelectionOverride
-
setTargetSelectionCondition
-
setTargetSelectionOverride
-
tryCreate
public Optional<Opener> tryCreate(GameContext context, Player player, Entity effectSource, Card enchantmentSource, Entity host, boolean force) - Specified by:
tryCreate
in interfaceAbstractEnchantmentDesc<Opener>
-