Class DeathZoneComponent


public class DeathZoneComponent extends CombatStatsComponent
DeathZone component that makes sure to deal max damage to a player to kill them. As well as remove regular entity characteristics from the DeathZone such as health
  • Constructor Details

    • DeathZoneComponent

      public DeathZoneComponent()
      Setting DeathZone Base attack power to max
    • DeathZoneComponent

      public DeathZoneComponent(int health, int baseAttack)
      DeathZone component Initialisation
      Parameters:
      health -
      baseAttack -
  • Method Details

    • setHealth

      public void setHealth(int health)
      Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.
      Overrides:
      setHealth in class CombatStatsComponent
      Parameters:
      health - health
    • addHealth

      public void addHealth(int health)
      Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.
      Overrides:
      addHealth in class CombatStatsComponent
      Parameters:
      health - health
    • hit

      public void hit(CombatStatsComponent attacker)
      Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.
      Overrides:
      hit in class CombatStatsComponent
    • isDead

      public Boolean isDead()
      Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.
      Overrides:
      isDead in class CombatStatsComponent
      Returns:
      is player dead
    • damage

      public void damage(ColliderComponent collider)
      Damages colliding entity on contact with death zone
      Parameters:
      collider - Player's ColliderComponent (null if player leaves collision range)