This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathstatus.go
125 lines (119 loc) · 2.13 KB
/
status.go
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package main
type status int
const (
StatusBerserk status = iota
StatusSlow
StatusExhausted
StatusSwift
StatusAgile
StatusLignification
StatusConfusion
StatusTele
StatusNausea
StatusDisabledShield
StatusCorrosion
StatusFlames // fake status
StatusDig
StatusSwap
StatusShadows
StatusSlay
StatusAccurate
)
func (st status) Good() bool {
switch st {
case StatusBerserk, StatusSwift, StatusAgile, StatusDig, StatusSwap, StatusShadows, StatusSlay, StatusAccurate:
return true
default:
return false
}
}
func (st status) Bad() bool {
switch st {
case StatusSlow, StatusConfusion, StatusNausea, StatusDisabledShield, StatusFlames, StatusCorrosion:
return true
default:
return false
}
}
func (st status) String() string {
switch st {
case StatusBerserk:
return "Berserk"
case StatusSlow:
return "Slow"
case StatusExhausted:
return "Exhausted"
case StatusSwift:
return "Swift"
case StatusLignification:
return "Lignified"
case StatusAgile:
return "Agile"
case StatusConfusion:
return "Confused"
case StatusTele:
return "Tele"
case StatusNausea:
return "Nausea"
case StatusDisabledShield:
return "-Shield"
case StatusCorrosion:
return "Corroded"
case StatusFlames:
return "Flames"
case StatusDig:
return "Dig"
case StatusSwap:
return "Swap"
case StatusShadows:
return "Shadows"
case StatusSlay:
return "Slay"
case StatusAccurate:
return "Accurate"
default:
// should not happen
return "unknown"
}
}
func (st status) Short() string {
switch st {
case StatusBerserk:
return "Be"
case StatusSlow:
return "Sl"
case StatusExhausted:
return "Ex"
case StatusSwift:
return "Sw"
case StatusLignification:
return "Li"
case StatusAgile:
return "Ag"
case StatusConfusion:
return "Co"
case StatusTele:
return "Te"
case StatusNausea:
return "Na"
case StatusDisabledShield:
return "-S"
case StatusCorrosion:
return "Co"
case StatusFlames:
return "Fl"
case StatusDig:
return "Di"
case StatusSwap:
return "Sw"
case StatusShadows:
return "Sh"
case StatusSlay:
return "Sl"
case StatusAccurate:
return "Ac"
default:
// should not happen
return "?"
}
}