Class OpenerAction
java.lang.Object
net.demilich.metastone.game.actions.GameAction
net.demilich.metastone.game.actions.OpenerAction
- All Implemented Interfaces:
- Serializable,- Cloneable,- Notification
Battlecry actions occur when 
Actor entities are played from cards and
 have battlecries. A battlecry is a possibly targeted effect.- See Also:
- 
Field SummaryFieldsFields inherited from class net.demilich.metastone.game.actions.GameActionchooseOneOptionIndex
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanBeExecuted(GameContext context, Player player) Computes whether the condition is fulfilled for a battlecry action to be executable.final booleancanBeExecutedOn(GameContext context, Player player, Entity entity) Computes whether the given targetentitycan be targeted by this battlecry.clone()static OpenerActioncreateBattlecry(SpellDesc spell, TargetSelection targetSelection) Creates a battlecry action that performs the specified spell and requests a target.booleanvoidexecute(GameContext context, int playerId) Casts thegetSpell()on this action with the specified target.getDescription(GameContext context, int playerId) Creates a formatted description for the battlecry given its target.Returns theSpellArg.FILTERof the spell.Returns either the target chosen by the user or the predefined target (possible a group reference /EntityReference.isTargetGroup()) written on theSpellDescof the spell.getSource(GameContext context) getSpell()getTargets(GameContext context, int player) For visualization purposes, what are the targets of this notification?inthashCode()voidsetCondition(Condition condition) voidsetTargetSelectionCondition(Condition targetSelectionCondition) voidsetTargetSelectionOverride(TargetSelection targetSelectionOverride) booleanshouldOverrideTargetSelection(GameContext context, Player player, Actor actor) Methods inherited from class net.demilich.metastone.game.actions.GameActiongetActionType, getChooseOneOptionIndex, getId, getSource, getSourceReference, getTargetReference, getTargetRequirement, isClientInterested, isOverrideChild, isPowerHistory, setActionType, setChooseOneOptionIndex, setId, setOverrideChild, setSourceReference, setTarget, setTargetReference, setTargetRequirement, toString, withTargetReference
- 
Field Details- 
NONE
 
- 
- 
Constructor Details- 
OpenerAction
 
- 
- 
Method Details- 
createBattlecryCreates a battlecry action that performs the specified spell and requests a target.To filter the target, make sure to add a SpellArg.FILTERto the spell.- Parameters:
- spell- The spell to cast for this battlecry action.
- targetSelection- The target selection to make.
- Returns:
- An instance
 
- 
clone- Overrides:
- clonein class- GameAction
 
- 
canBeExecutedComputes whether the condition is fulfilled for a battlecry action to be executable. Conditions are not evaluated against targets.- Parameters:
- context- The game context
- player- The casting player
- Returns:
- trueif this battlecry can be executed generally (if it will even prompt the user for targeting).
 
- 
canBeExecutedOnComputes whether the given targetentitycan be targeted by this battlecry.- Overrides:
- canBeExecutedOnin class- GameAction
- Parameters:
- context- The game context
- player- The casting player
- entity- The target entity
- Returns:
- trueif the entity is a valid target for the battlecry.
 
- 
executeCasts thegetSpell()on this action with the specified target.- Specified by:
- executein class- GameAction
- Parameters:
- context- The game context
- playerId- The casting player.
- See Also:
 
- 
getPredefinedSpellTargetOrUserTargetReturns either the target chosen by the user or the predefined target (possible a group reference /EntityReference.isTargetGroup()) written on theSpellDescof the spell.- Returns:
- An entity reference
 
- 
getCondition
- 
getEntityFilterReturns theSpellArg.FILTERof the spell.- Returns:
- The filter.
 
- 
getSpell
- 
setCondition
- 
getSource- Specified by:
- getSourcein interface- Notification
- Overrides:
- getSourcein class- GameAction
 
- 
getTargetsDescription copied from interface:NotificationFor visualization purposes, what are the targets of this notification?- Specified by:
- getTargetsin interface- Notification
- Overrides:
- getTargetsin class- GameAction
- Parameters:
- context- game context
- player- the player
- Returns:
- A reference to the entity that is the visualizable target of this notification.
 
- 
equals- Overrides:
- equalsin class- GameAction
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- GameAction
 
- 
getDescriptionCreates a formatted description for the battlecry given its target.- Specified by:
- getDescriptionin interface- Notification
- Overrides:
- getDescriptionin class- GameAction
- Parameters:
- context-
- playerId-
- Returns:
 
- 
shouldOverrideTargetSelection
- 
getTargetSelectionCondition
- 
getTargetSelectionOverride
- 
setTargetSelectionCondition
- 
setTargetSelectionOverride
 
-