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

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

    • Weapon

      public Weapon(Card sourceCard)
  • Method Details

    • clone

      public Weapon 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.
    • getHp

      public int getHp()
      Description copied from class: Actor
      The current number of hitpoints this actor has.
      Overrides:
      getHp in class Actor
      Returns:
      The hitpoints.
    • getAttack

      public int getAttack()
      Overrides:
      getAttack in class Actor
    • getBaseDurability

      public int getBaseDurability()
    • getDurability

      public int getDurability()
    • 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
    • getMaxDurability

      public int getMaxDurability()
    • getWeaponDamage

      public int getWeaponDamage()
    • isActive

      public boolean isActive()
    • isBroken

      public boolean isBroken()
    • isDestroyed

      public boolean isDestroyed()
      Description copied from class: Actor
      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 a GameLogic.endOfSequence() has been called.

      Overrides:
      isDestroyed in class Actor
      Returns:
      true if the minion's health is less than 1 or if the minion has the Attribute.DESTROYED attribute.
      See Also:
    • 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:
    • onEquip

      public void onEquip(GameContext context, Player player)
    • onUnequip

      public void onUnequip(GameContext context, Player player)
    • setActive

      public void setActive(boolean active)
    • setOnEquip

      public void setOnEquip(SpellDesc onEquip)
    • setOnUnequip

      public void setOnUnequip(SpellDesc onUnequip)