Hitpoints
class Hitpoints( max: Int, current: Int = max, boost: Int = 0) : Component()on_npc_option(Assets.Npc.goblin.id, "Kick") { player -> val hp = target.findComponent<Hitpoints>() ?: return@on_npc_option hp.current = (hp.current - 2).coerceAtLeast(0) target.showHitsplat("damage", 2, source = player as? Actor) if (hp.isDepleted) player.message("The goblin collapses.")}var max: Intvar boost: Intcurrent
Section titled “current”var current: IntisBoosted
Section titled “isBoosted”val isBoosted: BooleanisDepleted
Section titled “isDepleted”val isDepleted: Boolean