Skip to content

Add health component#2373

Merged
wjt merged 12 commits into
endlessm:mainfrom
Litraxx:add-health-component
Jun 16, 2026
Merged

Add health component#2373
wjt merged 12 commits into
endlessm:mainfrom
Litraxx:add-health-component

Conversation

@Litraxx

@Litraxx Litraxx commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Added a generic health component that can be reused in different scenes.
It exports a max health property and provides various properties regarding health status.
It also provides two signals

  • health_depleted emitted when a change to the current health pushes it to zero or below
  • health_changed emitted when the health is changed and the change does not cause the health to deplete; emits the current health as an argument

Refactored the fragile barrel to use the new health component

Resolves #1747

Litraxx added 4 commits June 12, 2026 23:04
Changed break_barrel and take_damage functions to be called by health component signals
Replaced existing health logic with health component
This should make the setter more readable
Also removed the redundant `has_depleted_health` signal argument
The check is not needed since the signal is only ever called when the health change does not deplete the health
@Litraxx Litraxx marked this pull request as ready for review June 12, 2026 21:55
@Litraxx Litraxx requested a review from a team as a code owner June 12, 2026 21:55
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Test build no longer available.

@wjt wjt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start, thank you for working on this!

Comment thread scenes/game_logic/health_component.gd Outdated
Comment thread scenes/game_logic/health_component.gd Outdated
Comment thread scenes/game_elements/props/filling_barrel/components/fragile_barrel.gd Outdated
Comment thread scenes/game_elements/props/filling_barrel/components/fragile_barrel.gd Outdated
Comment thread scenes/game_logic/health_component.gd
@Litraxx Litraxx requested a review from wjt June 15, 2026 16:32

@wjt wjt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added a couple of tiny changes for things I only spotted while re-reviewing.

@wjt wjt merged commit 5ae3e40 into endlessm:main Jun 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement character health

2 participants