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 () |
| | Is this object at it full health? If this object doesn't have a health component it also returns true.
|
| |
| int | 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?
|
| |
| void | ChangeThreatLevel (Context instigator, int threatLevel) |
| | Changes the ThreatLevel of this hittable component. This is used by the targeter component to modify target priority by their threat level.
|
| |
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.
◆ ChangeThreatLevel()
| void ChangeThreatLevel |
( |
Context | instigator, |
|
|
int | threatLevel ) |
Changes the ThreatLevel of this hittable component. This is used by the targeter component to modify target priority by their threat level.
- Parameters
-
| instigator | The context making this change. |
| threatLevel | The new ThreatLevel of the hittable. |
◆ 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()
Is this object at it full health? If this object doesn't have a health component it also returns true.
- Returns
- Returns true if the object is at full health or doesn't have a health component.
◆ GetIsTargetable()
Can this object be tracked by Targeter components?
- Returns
- True means it can be targeted, false means they will ignore it
◆ ModifyHealth()
| int 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.
- 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? Returns an integer value that represents a HealthChangeResult
◆ 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 |