The player can have different status depending on health, but also other additional status caused by external sources (e.g. Poisoned)
The default Health status is referenced from the Status component on the player
On this “Healthy” asset, we specify the health ranges and colours used on the Status monitor inside the inventory.
You can create additional status or your own Healthy status by right clicking on the Project panel and selecting: Create→Horror Engine→Status→StatusData
<aside> ⚠️
Any new status needs to be added to the corresponding StatusDB, referenced from the GameManager, in order to be able to load the game if this is saved while the player has a status applied.
</aside>
There is already an existing alternate status called “Poisoned”. This is currently being applied by an enviromental attack to the player, but a Status can also be applied from code directly.
Apply from code
A status can be applied to the player from any point by calling the method AddStatus on the Status component. For example:
public StatusData MyStatus;
var playerStatus = GameManager.Instance.Player.GetComponent<Status>();
playerStatus.AddStatus(MyStatus);
Apply from an attack
An enemy or an enviroment hazard can apply a status to the player by using an AttackEffect on the AttackData.
For example, if we wanted to poison the player when any enemy hits the player, we could add the AttackEffect_AttachStatus_Poison to the PostDamageEffects