diff options
| author | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
| commit | 9d4b799db4868bcab291b83599ff088763cd4ed6 (patch) | |
| tree | 252f0fcc779acf35243983d643d6399ee2e0cd0b /internal/world/mob.go | |
| parent | d25638d98fe63efdeab570ef77e6a6a97f2d7a60 (diff) | |
| download | thehouseoficarus-9d4b799db4868bcab291b83599ff088763cd4ed6.tar.gz | |
feat: new type of non-violent 'combat': work
Diffstat (limited to 'internal/world/mob.go')
| -rw-r--r-- | internal/world/mob.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/world/mob.go b/internal/world/mob.go index ec7db36..4864e5c 100644 --- a/internal/world/mob.go +++ b/internal/world/mob.go @@ -58,11 +58,23 @@ type MobDef struct { DamageWithout string `yaml:"damage_without"` Size string `yaml:"size"` + // Kind discriminates a normal combat mob ("" or "combat") from a "task" + // worksite (build a solar panel, survey a rock, etc.). A task mob reuses the + // entire combat engine but its HP drains to 0 to COMPLETE the work; it never + // attacks back (the room hazard, if any, supplies the danger). The progress + // bar is displayed inverted (filling toward 100%). + Kind string `yaml:"kind"` + Verb string `yaml:"verb"` // flavor verb for messages (default "work") + ProgressNoun string `yaml:"progress_noun"` // flavor noun, e.g. "construction" + CompleteMessage string `yaml:"complete_message"` // shown on completion + Talk *action.TalkConfig `yaml:"talk,omitempty"` } func (d *MobDef) IsTalkable() bool { return d.Talk != nil } +func (d *MobDef) IsTask() bool { return d.Kind == "task" } + type MobInstance struct { InstanceID string DefID string @@ -109,11 +121,18 @@ type MobInstance struct { DamageWithout string Size string + Kind string + Verb string + ProgressNoun string + CompleteMessage string + TalkConfig *action.TalkConfig } func (m *MobInstance) IsTalkable() bool { return m.TalkConfig != nil } +func (m *MobInstance) IsTask() bool { return m.Kind == "task" } + func NewMobInstance(def *MobDef, instanceID string, roomID int, wanderRooms []int, wanderInterval float64) *MobInstance { return &MobInstance{ InstanceID: instanceID, @@ -153,6 +172,10 @@ func NewMobInstance(def *MobDef, instanceID string, roomID int, wanderRooms []in FinishingBlow: def.FinishingBlow, DamageWithout: def.DamageWithout, Size: def.Size, + Kind: def.Kind, + Verb: def.Verb, + ProgressNoun: def.ProgressNoun, + CompleteMessage: def.CompleteMessage, TalkConfig: def.Talk, } } |
