Package com.csse3200.game.components
Class DeathZoneComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.CombatStatsComponent
com.csse3200.game.components.DeathZoneComponent
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
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSetting DeathZone Base attack power to maxDeathZoneComponent
(int health, int baseAttack) DeathZone component Initialisation -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHealth
(int health) Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.void
damage
(ColliderComponent collider) Damages colliding entity on contact with death zonevoid
hit
(CombatStatsComponent attacker) Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.isDead()
Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.void
setHealth
(int health) Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.Methods inherited from class com.csse3200.game.components.CombatStatsComponent
getBaseAttack, getHealth, setBaseAttack
Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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 classCombatStatsComponent
- 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 classCombatStatsComponent
- Parameters:
health
- health
-
hit
Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.- Overrides:
hit
in classCombatStatsComponent
-
isDead
Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.- Overrides:
isDead
in classCombatStatsComponent
- Returns:
- is player dead
-
damage
Damages colliding entity on contact with death zone- Parameters:
collider
- Player's ColliderComponent (null if player leaves collision range)
-