component.healthcomponent

Makes an entity have limited health and die when that health is reduced to zero.

struct HealthComponent;

Makes an entity have limited health and die when that health is reduced to zero.

uint maxHealth;

Maximum health.

uint health;

Current health.

EntityID mostRecentlyDamagedBy;

ID of the last entity we've been damaged by.

bool damagedThisUpdate;

Have we've been damaged during this update?

this(ref Node yaml);

Load from a YAML node. Throws YAMLException on error.

void applyDamage(const EntityID damagedBy, const int damage);

Apply damage (or healing, if negative).