aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_state.go
blob: ffce5450e8962fa899d8d98a6c451599a6a8d40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package game

type ActionType string

const (
	ActionIdle      ActionType = ""
	ActionGathering ActionType = "gathering"
	ActionCombating ActionType = "combating"
	ActionMoving    ActionType = "moving"
	ActionUsing     ActionType = "using"
	ActionTalking   ActionType = "talking"
	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"
	ActionIdentifying ActionType = "identifying"
	ActionStealing   ActionType = "stealing"
	ActionPlanting   ActionType = "planting"
	ActionHarvesting ActionType = "harvesting_crop"
	ActionRaking     ActionType = "raking"
	ActionWatering   ActionType = "watering"
	ActionCuring      ActionType = "curing"
	ActionTraversing  ActionType = "traversing"
	ActionHacking     ActionType = "hacking"
	ActionHiding      ActionType = "hiding"
)

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 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 ActionIdentifying:
		return "identifying scrap at " + a.TargetName
	case ActionStealing:
		return "stealing from " + a.TargetName
	case ActionPlanting:
		return "planting " + a.TargetName
	case ActionHarvesting:
		return "harvesting " + a.TargetName
	case ActionRaking:
		return "raking a " + a.TargetName
	case ActionWatering:
		return "watering a " + a.TargetName
	case ActionCuring:
		return "curing a " + a.TargetName
	case ActionTraversing:
		return a.Verb + " across " + a.TargetName
	case ActionHacking:
		return "jacked into a " + a.TargetName
	case ActionHiding:
		return "positioning behind a " + a.TargetName
	}
	return ""
}