Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld a8eb6562-1…

Vitals

The numbers of one living thing — hp, maxHp, level, xp, xpToNext, attack, invuln and dead — as one synced component, plus the rules that own them.

by◐15220200202·posted 17d ago
What it does

Vitals

The numbers of one living thing — hp, maxHp, level, xp, xpToNext, attack, invuln and dead — as one synced component, plus the rules that own them.

Attach it to anything that can be hurt: a player's body with { player = true }, a slime root with { maxHp = Rules.SLIME_MAX_HP, hp = Rules.SLIME_MAX_HP } and player left false. Every read and every change from outside goes through game.combat.vitals, which decides whether this peer may write it; the component body only ever runs on the peer that owns the entity, and that is what keeps health correct across four peers.

Methods: applyDamage(amount, attackerId), applyHeal(amount), addXp(amount) (which resolves every level-up it earns: max HP +20, attack +5, full heal), die(attackerId) and respawn() (full bar, Rules.INVULN_TIME of invulnerability). It has no sibling components; nothing else is required beside it.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

Vitals — the numbers of one living thing: a player's body, or a slime root. The data and the rules that own it. Everything outside goes through `game.combat.vitals`, which decides whether this peer may write it at all; this component is what actually changes the numbers, and it only ever runs on the peer that owns the entity. Player bodies: add with `{ player = true }`. Slime roots: add with `{ maxHp = Rules.SLIME_MAX_HP, hp = Rules.SLIME_MAX_HP }` and leave `player` false.

stats( ) → void

The entity's current frame, ready to be read.

applyDamage(amount: number, attackerId: string?) → boolean

Take damage. Returns whether the hit landed (false when down or invulnerable).

argtypedescription
amountnumber
attackerIdstring?

applyHeal(amount: number) → boolean

Restore health, never past the bar's top.

argtypedescription
amountnumber

addXp(amount: number) → void

Add experience and resolve every level-up it earns.

argtypedescription
amountnumber

die(attackerId: string?) → void

Go down. Pays the killer and announces it, once.

argtypedescription
attackerIdstring?

respawn( ) → void

Come back: full bar, invulnerable for Rules.INVULN_TIME, experience kept.

update(dt: number) → void

argtypedescription
dtnumber

awake( ) → void

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

5items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · game/combat/Vitals.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.