The Heart-Based Life System is a heart-based life management system inspired by classic Zelda-style games. It integrates into Unreal Engine to provide health systems with customizable heart containers, life updates, animations, and low-life feedback.
The UHLSLifeComponent is responsible for managing the life system of an entity, including the number of hearts, life values, and events triggered during life changes. It handles the logic for adding or removing hearts, as well as managing additional hearts and the low-life state.
This component manages the life system of an entity, including health points, heart counts, additional hearts, and low-life state handling. It serves as the core logic for life management.
Property | Description | Default Value |
---|---|---|
MaxNumHearts | Maximum number of hearts. | 100 |
StartNumHearts | Initial number of hearts. | 1 |
HeartNumPart | Number of parts per heart (e.g., quarter hearts). | 4 |
LowLifeThreshold | Threshold below which low-life feedback is triggered. | 3 |
bShouldRestoreFullLifeWhenAddingNormalHearts | Whether full life is restored when adding normal hearts. | true |
bStartWithCustomLife | Whether to start with a custom life value. | false |
StartWithCustomLife | Custom starting life value (requires bStartWithCustomLife to be true). |
0 |
Property | Description |
---|---|
Life | Current life value. |
MaxLife | Maximum possible life value (based on heart and part counts). |
NumOfHearts | Number of regular hearts. |
NumOfAdditionalHearts | Number of additional hearts. |
bIsLowLife | Whether the entity is in a low-life state. |
TotalNumOfHearts | Total number of hearts (regular + additional). |
AddLife(int32 LifeAmount)
: Adds life to the entity.RemoveLife(int32 Damage)
: Removes life from the entity.