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.TypeBurn: return "trying to start a fire" case behavior.TypeStoke: return "tending to a fire" 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 case behavior.TypeTriggerModule: return "triggering " + 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 "" }