package game import "fmt" type ActionType string const ( ActionIdle ActionType = "" ActionGathering ActionType = "gathering" ActionCombating ActionType = "combating" ActionMoving ActionType = "moving" ActionUsing ActionType = "using" ActionTalking ActionType = "talking" ActionToggling ActionType = "toggling" ActionBurning ActionType = "burning" ActionStoking ActionType = "stoking" ActionPickingUp ActionType = "picking_up" ActionDropping ActionType = "dropping" ActionSearching ActionType = "searching" ActionResting ActionType = "resting" ActionWalking ActionType = "walking" ActionProducing ActionType = "producing" ActionFletching ActionType = "fletching" ActionEating ActionType = "eating" ActionCleaning ActionType = "cleaning" ActionMixing ActionType = "mixing" ActionIdentifying ActionType = "identifying" ) type ActionState struct { Type ActionType TargetName string ToolName string Direction string Verb string } func (a *ActionState) Description() string { if a == nil || a.Type == ActionIdle { return "" } switch a.Type { case ActionGathering: desc := a.Verb + " a " + a.TargetName if a.ToolName != "" { desc += " with a " + a.ToolName } return desc case ActionCombating: return "fighting a " + a.TargetName case ActionMoving: return "heading " + a.Direction case ActionUsing: return "using a " + a.TargetName case ActionTalking: return "talking to " + a.TargetName case ActionToggling: return fmt.Sprintf("pulling a %s", a.TargetName) case ActionBurning: return "trying to start a fire" case ActionStoking: return "tending to a fire" case ActionPickingUp: return "picking up " + a.TargetName case ActionDropping: return "dropping " + a.TargetName case ActionSearching: return "digging through a " + a.TargetName case ActionResting: return "resting" case ActionWalking: return "walking somewhere with a purpose!" case ActionProducing: return a.Verb + " some " + a.TargetName case ActionFletching: return "fletching " + a.TargetName case ActionEating: return "eating " + a.TargetName case ActionCleaning: return "cleaning herbs" case ActionMixing: return "mixing " + a.TargetName case ActionIdentifying: return "identifying scrap at " + a.TargetName } return "" }