Class BossDefenseComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.BossDefenseComponent
Trigger for the boss's defense phase (one-time).
When health ≤ triggerHp
, activate DamageReductionComponent
(lasts durationSec
seconds, reducing/avoiding damage by reduction
).
Optionally disables self-damage during the defense phase
(via WeaponsStatsComponent.setDisableDamage(boolean)
).
Requires both CombatStatsComponent
and DamageReductionComponent
to be attached to the entity.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBossDefenseComponent
(float durationSec, float reduction, int triggerHp, boolean closeAttackWhileDefending) -
Method Summary
Modifier and TypeMethodDescriptionvoid
update()
Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
BossDefenseComponent
public BossDefenseComponent(float durationSec, float reduction, int triggerHp, boolean closeAttackWhileDefending) - Parameters:
durationSec
- Defense duration (seconds)reduction
- Damage reduction ratio, range [0, 1] (1 represents complete immunity)triggerHp
- Trigger threshold: Current HP ≤ this value triggers the attackcloseAttackWhileDefending
- Whether to close self-damage during defense
-
-
Method Details