This component makes something able to be targeted by attacks from the player, NPCs, and other objects. It handles incoming damage or healing, filtering it and passing it on to relative components before finally applying changes to the health component, if it has one.
More...
|
void | SetIsDamageable (Context instigator, bool isDamageable) |
| Changes whether or not this object can take damage. This only applies to negative (damaging values). An object can still get healed.
|
|
bool | GetIsDamageable () |
| Returns if the object is currently damageable or not.
|
|
void | SetIsTargetable (Context instigator, bool isTargetable) |
| Changes if this object can be tracked by Targeter components? Changing it during runtime allows something to potentially "become a threat," such as a turret turning on.
|
|
bool | GetIsTargetable () |
| Can this object be tracked by Targeter components?
|
|
bool | GetIsFullHealth () |
|
HealthChangeResult | ModifyHealth (Context instigator, int delta, int damageType) |
| This is the main way you deal damage to, or heal an object. If it doesn't have a health component, it will still trigger reactions, but no health value will change.
|
|
bool | GetIsDowned () |
| Is the object currently at 0 health?
|
|
This component makes something able to be targeted by attacks from the player, NPCs, and other objects. It handles incoming damage or healing, filtering it and passing it on to relative components before finally applying changes to the health component, if it has one.
◆ GetIsDamageable()
Returns if the object is currently damageable or not.
- Returns
- True means it can take damage, false means any damage will be ignored
◆ GetIsDowned()
Is the object currently at 0 health?
- Returns
◆ GetIsFullHealth()
◆ GetIsTargetable()
Can this object be tracked by Targeter components?
- Returns
- True means it can be targeted, false means they will ignore it
◆ ModifyHealth()
This is the main way you deal damage to, or heal an object. If it doesn't have a health component, it will still trigger reactions, but no health value will change.
- Parameters
-
instigator | What is the source of this damage? Some objects may react to this source and fight back, if they are capable |
delta | How much should health change by? Positive to heal, negative to deal damage |
damageType | What type of damage should this do? See DamageType. Note that this will be expanded later to allow for different types of damage and resistances and such! |
- Returns
- What effect did it have on this object?
◆ SetIsDamageable()
void SetIsDamageable |
( |
Context | instigator, |
|
|
bool | isDamageable ) |
Changes whether or not this object can take damage. This only applies to negative (damaging values). An object can still get healed.
- Parameters
-
instigator | The source context that is triggering this change |
isDamageable | True means it can take damage, false means any damage will be ignored |
◆ SetIsTargetable()
void SetIsTargetable |
( |
Context | instigator, |
|
|
bool | isTargetable ) |
Changes if this object can be tracked by Targeter components? Changing it during runtime allows something to potentially "become a threat," such as a turret turning on.
- Parameters
-
instigator | The source context that is triggering this change |
isTargetable | True means it can be targeted, false means they will ignore it |