Class HeroPowerAction
java.lang.Object
net.demilich.metastone.game.actions.GameAction
net.demilich.metastone.game.actions.PlayCardAction
net.demilich.metastone.game.actions.PlaySpellCardAction
net.demilich.metastone.game.actions.HeroPowerAction
- All Implemented Interfaces:
Serializable,Cloneable,HasChoiceCard,Notification
public final class HeroPowerAction
extends PlaySpellCardAction
implements HasChoiceCard, Serializable
Indicates an action that is a hero power card.
- See Also:
-
Field Summary
Fields inherited from class net.demilich.metastone.game.actions.PlayCardAction
loggerFields inherited from class net.demilich.metastone.game.actions.GameAction
chooseOneOptionIndex -
Constructor Summary
ConstructorsConstructorDescriptionHeroPowerAction(SpellDesc spell, Card card, TargetSelection targetSelection) HeroPowerAction(SpellDesc spell, Card card, TargetSelection targetRequirement, Card chosenCard) -
Method Summary
Modifier and TypeMethodDescriptionclone()voidexecute(GameContext context, int playerId) Plays a card from the hand.voidinnerExecute(GameContext context, int playerId) Represents the consequences of playing a spell card, minion card, hero card, hero power card, etc.Methods inherited from class net.demilich.metastone.game.actions.PlaySpellCardAction
getDescription, getSpell, setSpellMethods inherited from class net.demilich.metastone.game.actions.PlayCardAction
canBeExecutedOn, getSource, getTargetsMethods inherited from class net.demilich.metastone.game.actions.GameAction
equals, getActionType, getChooseOneOptionIndex, getId, getSource, getSourceReference, getTargetReference, getTargetRequirement, hashCode, isClientInterested, isOverrideChild, isPowerHistory, setActionType, setChooseOneOptionIndex, setId, setOverrideChild, setSourceReference, setTarget, setTargetReference, setTargetRequirement, toString, withTargetReference
-
Constructor Details
-
HeroPowerAction
public HeroPowerAction(SpellDesc spell, Card card, TargetSelection targetRequirement, Card chosenCard) -
HeroPowerAction
-
-
Method Details
-
clone
- Overrides:
clonein classPlaySpellCardAction
-
execute
Description copied from class:PlayCardActionPlays a card from the hand. Evaluates whether the card was countered, increments combos, and deducts mana.- Overrides:
executein classPlayCardAction- Parameters:
context- The game contextplayerId- The player who actually plays the card- See Also:
-
innerExecute
Description copied from class:PlayCardActionRepresents the consequences of playing a spell card, minion card, hero card, hero power card, etc.Unlike
PlayCardAction.execute(GameContext, int), this method will not deduct mana, will not be counterable, and will not increment combos. In other words, this method omits the effects of playing a card from the hand.However, by using the action, a
TargetSelectionwill still occur.The
EntityReference.TARGETwill refer to whatever is theGameAction.getTargetReference().The
GameAction.getTargetRequirement()indicates whether or not these effects require a target to be selected.- Overrides:
innerExecutein classPlaySpellCardAction
-
getChoiceCardId
- Specified by:
getChoiceCardIdin interfaceHasChoiceCard
-