All Implemented Interfaces:
Serializable, Cloneable, Comparable<Entity>, HasCard

public final class Hero extends Actor
See Also:
  • Constructor Details

    • Hero

      public Hero(Card heroCard)
  • Method Details

    • clone

      public Hero 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.

      Overrides:
      clone in class Actor
      Returns:
      An exact clone.
    • 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 class Entity
      Returns:
      An Spellsource.EntityTypeMessage.EntityType
    • getDefaultActiveTriggerZones

      public com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[] getDefaultActiveTriggerZones()
      Description copied from class: Actor
      Gets the zones where the CardDesc.getTrigger() and CardDesc.getTriggers() are active by default.
      Specified by:
      getDefaultActiveTriggerZones in class Actor
      Returns:
    • hasNonZeroAttack

      protected boolean hasNonZeroAttack(GameContext context)
      Overrides:
      hasNonZeroAttack in class Actor
    • 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

      public void setHeroClass(String heroClass)
    • getHeroClass

      public String getHeroClass()
      Overrides:
      getHeroClass in class Actor