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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAttackThisTurn(GameContext context) clone()Clone an entity, including its ID and location.intgetArmor()intintintGets 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.intgetHp()The current number of hitpoints this actor has.intgetMaxHp()Returns the maximum amount of hitpoints this actor can have, considering all of its bonuses from effects andAuras.protected booleanhasNonZeroAttack(GameContext context) booleanIndicates whether or not the actor is mortally wounded.booleanvoidmodifyAuraHpBonus(int value) voidmodifyHpBonus(int value) Modifies the HP bonus for the given entity.voidRefreshes the number of attacks anActorhas, typically to 1 or the number ofAttribute.WINDFURYattacks if the actor has Windfury.voidsetAttack(int value) voidsetBaseAttack(int value) voidsetBaseHp(int value) voidsetHp(int value) voidsetId(int id) voidsetMaxHp(int value) voidsetOwner(int ownerIndex) voidtoString()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 anActorhas, typically to 1 or the number ofAttribute.WINDFURYattacks if the actor has Windfury. -
canAttackThisTurn
-
hasNonZeroAttack
-
clone
Description copied from class:EntityClone 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 andAuras.- 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.GRAVEYARDyet. This is useful for preventing effects from impacting already dead minions before aGameLogic.endOfSequence()has been called.- Overrides:
isDestroyedin classEntity- Returns:
trueif the minion's health is less than 1 or if the minion has theAttribute.DESTROYEDattribute.- See Also:
-
isWounded
public boolean isWounded() -
modifyAuraHpBonus
public void modifyAuraHpBonus(int value) -
modifyHpBonus
public void modifyHpBonus(int value) Description copied from class:EntityModifies the HP bonus for the given entity.- Overrides:
modifyHpBonusin 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:EntityGets the card's inventory ID (unique instance of the card).- Overrides:
getCardInventoryIdin 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:
-