Class Hero
java.lang.Object
net.demilich.metastone.game.logic.CustomCloneable
net.demilich.metastone.game.entities.Entity
net.demilich.metastone.game.entities.Actor
net.demilich.metastone.game.entities.heroes.Hero
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Entity>
,HasCard
- 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 TypeMethodDescriptionclone()
Clone an entity, including its ID and location.com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[]
Gets the zones where theCardDesc.getTrigger()
andCardDesc.getTriggers()
are active by default.int
com.hiddenswitch.spellsource.rpc.Spellsource.EntityTypeMessage.EntityType
Gets the type of entity this is.protected boolean
hasNonZeroAttack
(GameContext context) int
modifyArmor
(int armor) Changes the amount of armor the hero has.void
setHeroClass
(String heroClass) Methods inherited from class net.demilich.metastone.game.entities.Actor
canAttackThisTurn, getArmor, getAttack, getBaseAttack, getBaseHp, getCardInventoryId, getCopy, getHp, getMaxHp, isDestroyed, isWounded, modifyAuraHpBonus, modifyHpBonus, refreshAttacksPerRound, setAttack, setBaseAttack, setBaseHp, setHp, setId, setMaxHp, setOwner, setRace, toString
Methods inherited from class net.demilich.metastone.game.entities.Entity
compareTo, diedOnBattlefield, evaluateDescriptions, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getCopySource, getDescription, getDescription, getDynamicDescription, getEffectSource, getEntityLocation, 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
-
Hero
-
-
Method Details
-
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. -
getEffectiveHp
public int getEffectiveHp() -
getEntityType
public com.hiddenswitch.spellsource.rpc.Spellsource.EntityTypeMessage.EntityType getEntityType()Description copied from class:Entity
Gets the type of entity this is. These will very nearly match up with the classes, but are primarily used for filters that e.g. draw a Spell or destroy all Secrets.- Specified by:
getEntityType
in classEntity
- Returns:
- An
Spellsource.EntityTypeMessage.EntityType
-
getDefaultActiveTriggerZones
public com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[] getDefaultActiveTriggerZones()Description copied from class:Actor
Gets the zones where theCardDesc.getTrigger()
andCardDesc.getTriggers()
are active by default.- Specified by:
getDefaultActiveTriggerZones
in classActor
- Returns:
-
hasNonZeroAttack
- Overrides:
hasNonZeroAttack
in classActor
-
modifyArmor
public int modifyArmor(int armor) Changes the amount of armor the hero has.- Parameters:
armor
- The requested change in armor.- Returns:
- The amount the armor changed. If damage is being dealt, then the armor will change
-Infinity < armor <= 0
if it is possible.
-
setHeroClass
-
getHeroClass
- Overrides:
getHeroClass
in classActor
-