diff options
| author | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
| commit | abd612c15799f604e671e83dc7c410ed2b44185f (patch) | |
| tree | 0597ca92350de73aac2a7cf26b2f2d6595dac0cc /internal/game/act_state.go | |
| parent | 2725e2927a1595c7b100d942d1f14146252adeb7 (diff) | |
| download | thehouseoficarus-abd612c15799f604e671e83dc7c410ed2b44185f.tar.gz | |
slop refactor
Diffstat (limited to 'internal/game/act_state.go')
| -rw-r--r-- | internal/game/act_state.go | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/internal/game/act_state.go b/internal/game/act_state.go new file mode 100644 index 0000000..a219875 --- /dev/null +++ b/internal/game/act_state.go @@ -0,0 +1,97 @@ +package game + +import ( + "thehouseoficarus/internal/behavior" + "thehouseoficarus/internal/player" +) + +func (g *Game) playerActionDisplay(p *player.Player) string { + if cs := g.Combat.Get(p.Name); cs != nil { + mob := g.MobStore.GetInstance(cs.MobID) + if mob != nil { + if mob.IsTask() { + return "working on a " + mob.Name + } + return "fighting a " + mob.Name + } + } + + if p.MoveTicks > 0 { + return "heading " + p.MoveDirection + } + if len(p.WalkSequence) > 0 { + return "walking somewhere with a purpose!" + } + + if ss, ok := g.safespot.Get(p.Name); ok && ss.Active { + obj, err := g.ObjectStore.Load(ss.ObjectDefID) + if err == nil { + return "positioning behind a " + obj.Name + } + return "hiding" + } + + if a := p.Action; a != nil { + switch a.Type { + case behavior.TypeGather: + if d, ok := a.Data.(*behavior.GatherData); ok { + desc := d.Verb + " a " + a.TargetName + if d.ToolName != "" { + desc += " with a " + d.ToolName + } + return desc + } + case behavior.TypeSteal: + return "stealing from " + a.TargetName + case behavior.TypeTalk: + return "talking to " + a.TargetName + case behavior.TypeUse: + return "using a " + a.TargetName + case behavior.TypeBurn: + return "trying to start a fire" + case behavior.TypeStoke: + return "tending to a fire" + case behavior.TypeSearch: + return "digging through a " + a.TargetName + case behavior.TypeIdentify: + return "identifying scrap at " + a.TargetName + case behavior.TypePlant: + return "planting " + a.TargetName + case behavior.TypeHarvest: + return "harvesting " + a.TargetName + case behavior.TypeRake: + return "raking a " + a.TargetName + case behavior.TypeWater: + return "watering a " + a.TargetName + case behavior.TypeCure: + return "curing a " + a.TargetName + case behavior.TypeObstacle: + return "traversing across " + a.TargetName + case behavior.TypeCook: + return "cooking some " + a.TargetName + case behavior.TypeSmelt: + return "smelting some " + a.TargetName + case behavior.TypeSmith: + return "smithing some " + a.TargetName + case behavior.TypeCraft: + return "crafting some " + a.TargetName + case behavior.TypeCombine: + return "combining some " + a.TargetName + case behavior.TypeMix: + return "mixing some " + a.TargetName + case behavior.TypeConstruct: + return "constructing some " + a.TargetName + } + } + + if a := p.BackgroundAction; a != nil { + switch a.Type { + case behavior.TypeFletch: + return "fletching " + a.TargetName + case behavior.TypeClean: + return "cleaning herbs" + } + } + + return "" +} |
