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 TypeMethodDescriptionvoidaddHealth(int health) Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.voiddamage(ColliderComponent collider) Damages colliding entity on contact with death zonevoidhit(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.voidsetHealth(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, getIsInvulnerable, getLastAttacker, setBaseAttack, setIsInvulnerable, setLastAttackerMethods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, 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:
setHealthin 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:
addHealthin 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:
hitin classCombatStatsComponent- Parameters:
attacker- the attacker's CombatStatsComponent
-
isDead
Override CombatStatsComponent health-related functions to do nothing, as death zones should not be able to be damaged or healed.- Overrides:
isDeadin 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)
-