Class Actor
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Entity>
,HasCard
When actors enter or exit their respective zones (Spellsource.ZonesMessage.Zones.HERO
, Spellsource.ZonesMessage.Zones.BATTLEFIELD
, Spellsource.ZonesMessage.Zones.WEAPON
),
BoardChangedEvent
will be raised.
- See Also:
-
Field Summary
Fields inherited from class net.demilich.metastone.game.entities.Entity
attributes, effectSource, entityLocation, name, NO_OWNER, sourceCard
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAttackThisTurn
(GameContext context) clone()
Clone an entity, including its ID and location.int
getArmor()
int
int
int
Gets the card's inventory ID (unique instance of the card).getCopy()
abstract com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[]
Gets the zones where theCardDesc.getTrigger()
andCardDesc.getTriggers()
are active by default.int
getHp()
The current number of hitpoints this actor has.int
getMaxHp()
Returns the maximum amount of hitpoints this actor can have, considering all of its bonuses from effects andAura
s.protected boolean
hasNonZeroAttack
(GameContext context) boolean
Indicates whether or not the actor is mortally wounded.boolean
void
modifyAuraHpBonus
(int value) void
modifyHpBonus
(int value) Modifies the HP bonus for the given entity.void
Refreshes the number of attacks anActor
has, typically to 1 or the number ofAttribute.WINDFURY
attacks if the actor has Windfury.void
setAttack
(int value) void
setBaseAttack
(int value) void
setBaseHp
(int value) void
setHp
(int value) void
setId
(int id) void
setMaxHp
(int value) void
setOwner
(int ownerIndex) void
toString()
Methods inherited from class net.demilich.metastone.game.entities.Entity
compareTo, diedOnBattlefield, evaluateDescriptions, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getCopySource, getDescription, getDescription, getDynamicDescription, getEffectSource, getEntityLocation, getEntityType, getGameTriggers, getId, getIndex, getMaxNumberOfAttacks, getName, getOwner, getRace, getReference, getSourceCard, getUserId, getZone, hasAttribute, hasPersistentEffects, isInPlay, isRemovedPeacefully, modifyAttribute, moveOrAddTo, moveOrAddTo, resetEntityLocations, setAttribute, setAttribute, setAttribute, setDescription, setEffectSource, setEntityLocation, setName, setSourceCard, setUserId, transformResolved, transformResolved
-
Constructor Details
-
Actor
public Actor()
-
-
Method Details
-
refreshAttacksPerRound
public void refreshAttacksPerRound()Refreshes the number of attacks anActor
has, typically to 1 or the number ofAttribute.WINDFURY
attacks if the actor has Windfury. -
canAttackThisTurn
-
hasNonZeroAttack
-
clone
Description copied from class:Entity
Clone an entity, including its ID and location.Use this method for emulating an "immutable" view on an entity. This kind of cloning is not suitable for most gameplay situations, because using the clone will cause two entities with identical IDs and locations to exist. Instead, a subclass will provide a
getCopy()
method that is more helpful for gameplay. -
getArmor
public int getArmor() -
getAttack
public int getAttack() -
getBaseAttack
public int getBaseAttack() -
getBaseHp
public int getBaseHp() -
getHp
public int getHp()The current number of hitpoints this actor has.- Returns:
- The hitpoints.
-
getMaxHp
public int getMaxHp()Returns the maximum amount of hitpoints this actor can have, considering all of its bonuses from effects andAura
s.- Returns:
- The maximum hitpoints.
-
isDestroyed
public boolean isDestroyed()Indicates whether or not the actor is mortally wounded.A mortally wounded actor hasn't necessarily been taken off the board and put into the
Spellsource.ZonesMessage.Zones.GRAVEYARD
yet. This is useful for preventing effects from impacting already dead minions before aGameLogic.endOfSequence()
has been called.- Overrides:
isDestroyed
in classEntity
- Returns:
true
if the minion's health is less than 1 or if the minion has theAttribute.DESTROYED
attribute.- See Also:
-
isWounded
public boolean isWounded() -
modifyAuraHpBonus
public void modifyAuraHpBonus(int value) -
modifyHpBonus
public void modifyHpBonus(int value) Description copied from class:Entity
Modifies the HP bonus for the given entity.- Overrides:
modifyHpBonus
in classEntity
- Parameters:
value
- The amount to increment or decrement the HP bonus by.
-
setAttack
public void setAttack(int value) -
setBaseAttack
public void setBaseAttack(int value) -
setBaseHp
public void setBaseHp(int value) -
setHp
public void setHp(int value) -
setMaxHp
public void setMaxHp(int value) -
getHeroClass
-
setOwner
public void setOwner(int ownerIndex) -
setId
public void setId(int id) -
setRace
-
toString
-
getCardInventoryId
Description copied from class:Entity
Gets the card's inventory ID (unique instance of the card).- Overrides:
getCardInventoryId
in classEntity
- Returns:
- The card inventory ID.
-
getCopy
-
getDefaultActiveTriggerZones
public abstract com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[] getDefaultActiveTriggerZones()Gets the zones where theCardDesc.getTrigger()
andCardDesc.getTriggers()
are active by default.- Returns:
-