1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
2#[allow(clippy::enum_variant_names)]
3pub enum Prefix {
4 Large = 1,
5 Massive = 2,
6 Dangerous = 3,
7 Savage = 4,
8 Sharp = 5,
9 Pointy = 6,
10 Tiny = 7,
11 Terrible = 8,
12 Small = 9,
13 Dull = 10,
14 Unhappy = 11,
15 Bulky = 12,
16 Shameful = 13,
17 Heavy = 14,
18 Light = 15,
19 Sighted = 16,
20 Rapid = 17,
21 HastyRanged = 18,
22 Intimidating = 19,
23 DeadlyRanged = 20,
24 Staunch = 21,
25 Awful = 22,
26 Lethargic = 23,
27 Awkward = 24,
28 Powerful = 25,
29 Mystic = 26,
30 Adept = 27,
31 Masterful = 28,
32 Inept = 29,
33 Ignorant = 30,
34 Deranged = 31,
35 Intense = 32,
36 Taboo = 33,
37 Celestial = 34,
38 Furious = 35,
39 Keen = 36,
40 Superior = 37,
41 Forceful = 38,
42 Broken = 39,
43 Damaged = 40,
44 Shoddy = 41,
45 QuickWeapon = 42,
46 Deadly = 43,
47 Agile = 44,
48 Nimble = 45,
49 Murderous = 46,
50 Slow = 47,
51 Sluggish = 48,
52 Lazy = 49,
53 Annoying = 50,
54 Nasty = 51,
55 Manic = 52,
56 Hurtful = 53,
57 Strong = 54,
58 Unpleasant = 55,
59 Weak = 56,
60 Ruthless = 57,
61 Frenzying = 58,
62 Godly = 59,
63 Demonic = 60,
64 Zealous = 61,
65 Hard = 62,
66 Guarding = 63,
67 Armored = 64,
68 Warding = 65,
69 Arcane = 66,
70 Precise = 67,
71 Lucky = 68,
72 Jagged = 69,
73 Spiked = 70,
74 Angry = 71,
75 Menacing = 72,
76 Brisk = 73,
77 Fleeting = 74,
78 HastyAccessory = 75,
79 QuickAccessory = 76,
80 Wild = 77,
81 Rash = 78,
82 Intrepid = 79,
83 Violent = 80,
84 Legendary = 81,
85 Unreal = 82,
86 Mythical = 83,
87}
88
89#[cfg(feature = "convert")]
90impl TryFrom<terra_items::Prefix> for Prefix {
91 type Error = ();
92 fn try_from(value: terra_items::Prefix) -> Result<Self, Self::Error> {
93 Ok(match value {
94 terra_items::Prefix::Large => Self::Large,
95 terra_items::Prefix::Massive => Self::Massive,
96 terra_items::Prefix::Dangerous => Self::Dangerous,
97 terra_items::Prefix::Savage => Self::Savage,
98 terra_items::Prefix::Sharp => Self::Sharp,
99 terra_items::Prefix::Pointy => Self::Pointy,
100 terra_items::Prefix::Tiny => Self::Tiny,
101 terra_items::Prefix::Terrible => Self::Terrible,
102 terra_items::Prefix::Small => Self::Small,
103 terra_items::Prefix::Dull => Self::Dull,
104 terra_items::Prefix::Unhappy => Self::Unhappy,
105 terra_items::Prefix::Bulky => Self::Bulky,
106 terra_items::Prefix::Shameful => Self::Shameful,
107 terra_items::Prefix::Heavy => Self::Heavy,
108 terra_items::Prefix::Light => Self::Light,
109 terra_items::Prefix::Sighted => Self::Sighted,
110 terra_items::Prefix::Rapid => Self::Rapid,
111 terra_items::Prefix::HastyRanged => Self::HastyRanged,
112 terra_items::Prefix::Intimidating => Self::Intimidating,
113 terra_items::Prefix::Deadly => Self::Deadly,
114 terra_items::Prefix::Staunch => Self::Staunch,
115 terra_items::Prefix::Awful => Self::Awful,
116 terra_items::Prefix::Lethargic => Self::Lethargic,
117 terra_items::Prefix::Awkward => Self::Awkward,
118 terra_items::Prefix::Powerful => Self::Powerful,
119 terra_items::Prefix::Mystic => Self::Mystic,
120 terra_items::Prefix::Adept => Self::Adept,
121 terra_items::Prefix::Masterful => Self::Masterful,
122 terra_items::Prefix::Inept => Self::Inept,
123 terra_items::Prefix::Ignorant => Self::Ignorant,
124 terra_items::Prefix::Deranged => Self::Deranged,
125 terra_items::Prefix::Intense => Self::Intense,
126 terra_items::Prefix::Taboo => Self::Taboo,
127 terra_items::Prefix::Celestial => Self::Celestial,
128 terra_items::Prefix::Furious => Self::Furious,
129 terra_items::Prefix::Keen => Self::Keen,
130 terra_items::Prefix::Superior => Self::Superior,
131 terra_items::Prefix::Forceful => Self::Forceful,
132 terra_items::Prefix::Broken => Self::Broken,
133 terra_items::Prefix::Damaged => Self::Damaged,
134 terra_items::Prefix::Shoddy => Self::Shoddy,
135 terra_items::Prefix::QuickWeapon => Self::QuickWeapon,
136 terra_items::Prefix::DeadlyRanged => Self::DeadlyRanged,
137 terra_items::Prefix::Agile => Self::Agile,
138 terra_items::Prefix::Nimble => Self::Nimble,
139 terra_items::Prefix::Murderous => Self::Murderous,
140 terra_items::Prefix::Slow => Self::Slow,
141 terra_items::Prefix::Sluggish => Self::Sluggish,
142 terra_items::Prefix::Lazy => Self::Lazy,
143 terra_items::Prefix::Annoying => Self::Annoying,
144 terra_items::Prefix::Nasty => Self::Nasty,
145 terra_items::Prefix::Manic => Self::Manic,
146 terra_items::Prefix::Hurtful => Self::Hurtful,
147 terra_items::Prefix::Strong => Self::Strong,
148 terra_items::Prefix::Unpleasant => Self::Unpleasant,
149 terra_items::Prefix::Weak => Self::Weak,
150 terra_items::Prefix::Ruthless => Self::Ruthless,
151 terra_items::Prefix::Frenzying => Self::Frenzying,
152 terra_items::Prefix::Godly => Self::Godly,
153 terra_items::Prefix::Demonic => Self::Demonic,
154 terra_items::Prefix::Zealous => Self::Zealous,
155 terra_items::Prefix::Hard => Self::Hard,
156 terra_items::Prefix::Guarding => Self::Guarding,
157 terra_items::Prefix::Armored => Self::Armored,
158 terra_items::Prefix::Warding => Self::Warding,
159 terra_items::Prefix::Arcane => Self::Arcane,
160 terra_items::Prefix::Precise => Self::Precise,
161 terra_items::Prefix::Lucky => Self::Lucky,
162 terra_items::Prefix::Jagged => Self::Jagged,
163 terra_items::Prefix::Spiked => Self::Spiked,
164 terra_items::Prefix::Angry => Self::Angry,
165 terra_items::Prefix::Menacing => Self::Menacing,
166 terra_items::Prefix::Brisk => Self::Brisk,
167 terra_items::Prefix::Fleeting => Self::Fleeting,
168 terra_items::Prefix::HastyAccessory => Self::HastyAccessory,
169 terra_items::Prefix::QuickAccessory => Self::QuickAccessory,
170 terra_items::Prefix::Wild => Self::Wild,
171 terra_items::Prefix::Rash => Self::Rash,
172 terra_items::Prefix::Intrepid => Self::Intrepid,
173 terra_items::Prefix::Violent => Self::Violent,
174 terra_items::Prefix::Legendary => Self::Legendary,
175 terra_items::Prefix::Unreal => Self::Unreal,
176 terra_items::Prefix::Mythical => Self::Mythical,
177 _ => return Err(()),
178 })
179 }
180}
181
182#[cfg(feature = "convert")]
183impl From<Prefix> for terra_items::Prefix {
184 fn from(value: Prefix) -> Self {
185 match value {
186 Prefix::Large => Self::Large,
187 Prefix::Massive => Self::Massive,
188 Prefix::Dangerous => Self::Dangerous,
189 Prefix::Savage => Self::Savage,
190 Prefix::Sharp => Self::Sharp,
191 Prefix::Pointy => Self::Pointy,
192 Prefix::Tiny => Self::Tiny,
193 Prefix::Terrible => Self::Terrible,
194 Prefix::Small => Self::Small,
195 Prefix::Dull => Self::Dull,
196 Prefix::Unhappy => Self::Unhappy,
197 Prefix::Bulky => Self::Bulky,
198 Prefix::Shameful => Self::Shameful,
199 Prefix::Heavy => Self::Heavy,
200 Prefix::Light => Self::Light,
201 Prefix::Sighted => Self::Sighted,
202 Prefix::Rapid => Self::Rapid,
203 Prefix::HastyRanged => Self::HastyRanged,
204 Prefix::Intimidating => Self::Intimidating,
205 Prefix::Deadly => Self::Deadly,
206 Prefix::Staunch => Self::Staunch,
207 Prefix::Awful => Self::Awful,
208 Prefix::Lethargic => Self::Lethargic,
209 Prefix::Awkward => Self::Awkward,
210 Prefix::Powerful => Self::Powerful,
211 Prefix::Mystic => Self::Mystic,
212 Prefix::Adept => Self::Adept,
213 Prefix::Masterful => Self::Masterful,
214 Prefix::Inept => Self::Inept,
215 Prefix::Ignorant => Self::Ignorant,
216 Prefix::Deranged => Self::Deranged,
217 Prefix::Intense => Self::Intense,
218 Prefix::Taboo => Self::Taboo,
219 Prefix::Celestial => Self::Celestial,
220 Prefix::Furious => Self::Furious,
221 Prefix::Keen => Self::Keen,
222 Prefix::Superior => Self::Superior,
223 Prefix::Forceful => Self::Forceful,
224 Prefix::Broken => Self::Broken,
225 Prefix::Damaged => Self::Damaged,
226 Prefix::Shoddy => Self::Shoddy,
227 Prefix::QuickWeapon => Self::QuickWeapon,
228 Prefix::DeadlyRanged => Self::DeadlyRanged,
229 Prefix::Agile => Self::Agile,
230 Prefix::Nimble => Self::Nimble,
231 Prefix::Murderous => Self::Murderous,
232 Prefix::Slow => Self::Slow,
233 Prefix::Sluggish => Self::Sluggish,
234 Prefix::Lazy => Self::Lazy,
235 Prefix::Annoying => Self::Annoying,
236 Prefix::Nasty => Self::Nasty,
237 Prefix::Manic => Self::Manic,
238 Prefix::Hurtful => Self::Hurtful,
239 Prefix::Strong => Self::Strong,
240 Prefix::Unpleasant => Self::Unpleasant,
241 Prefix::Weak => Self::Weak,
242 Prefix::Ruthless => Self::Ruthless,
243 Prefix::Frenzying => Self::Frenzying,
244 Prefix::Godly => Self::Godly,
245 Prefix::Demonic => Self::Demonic,
246 Prefix::Zealous => Self::Zealous,
247 Prefix::Hard => Self::Hard,
248 Prefix::Guarding => Self::Guarding,
249 Prefix::Armored => Self::Armored,
250 Prefix::Warding => Self::Warding,
251 Prefix::Arcane => Self::Arcane,
252 Prefix::Precise => Self::Precise,
253 Prefix::Lucky => Self::Lucky,
254 Prefix::Jagged => Self::Jagged,
255 Prefix::Spiked => Self::Spiked,
256 Prefix::Angry => Self::Angry,
257 Prefix::Menacing => Self::Menacing,
258 Prefix::Brisk => Self::Brisk,
259 Prefix::Fleeting => Self::Fleeting,
260 Prefix::HastyAccessory => Self::HastyAccessory,
261 Prefix::QuickAccessory => Self::QuickAccessory,
262 Prefix::Wild => Self::Wild,
263 Prefix::Rash => Self::Rash,
264 Prefix::Intrepid => Self::Intrepid,
265 Prefix::Violent => Self::Violent,
266 Prefix::Legendary => Self::Legendary,
267 Prefix::Unreal => Self::Unreal,
268 Prefix::Mythical => Self::Mythical,
269 }
270 }
271}
272
273impl Prefix {
274 pub fn to_id(self) -> u8 {
275 self as u8
276 }
277
278 pub fn from_id(id: u8) -> Option<Self> {
279 Some(match id {
280 1 => Prefix::Large,
281 2 => Prefix::Massive,
282 3 => Prefix::Dangerous,
283 4 => Prefix::Savage,
284 5 => Prefix::Sharp,
285 6 => Prefix::Pointy,
286 7 => Prefix::Tiny,
287 8 => Prefix::Terrible,
288 9 => Prefix::Small,
289 10 => Prefix::Dull,
290 11 => Prefix::Unhappy,
291 12 => Prefix::Bulky,
292 13 => Prefix::Shameful,
293 14 => Prefix::Heavy,
294 15 => Prefix::Light,
295 16 => Prefix::Sighted,
296 17 => Prefix::Rapid,
297 18 => Prefix::HastyRanged,
298 19 => Prefix::Intimidating,
299 20 => Prefix::DeadlyRanged,
300 21 => Prefix::Staunch,
301 22 => Prefix::Awful,
302 23 => Prefix::Lethargic,
303 24 => Prefix::Awkward,
304 25 => Prefix::Powerful,
305 26 => Prefix::Mystic,
306 27 => Prefix::Adept,
307 28 => Prefix::Masterful,
308 29 => Prefix::Inept,
309 30 => Prefix::Ignorant,
310 31 => Prefix::Deranged,
311 32 => Prefix::Intense,
312 33 => Prefix::Taboo,
313 34 => Prefix::Celestial,
314 35 => Prefix::Furious,
315 36 => Prefix::Keen,
316 37 => Prefix::Superior,
317 38 => Prefix::Forceful,
318 39 => Prefix::Broken,
319 40 => Prefix::Damaged,
320 41 => Prefix::Shoddy,
321 42 => Prefix::QuickWeapon,
322 43 => Prefix::Deadly,
323 44 => Prefix::Agile,
324 45 => Prefix::Nimble,
325 46 => Prefix::Murderous,
326 47 => Prefix::Slow,
327 48 => Prefix::Sluggish,
328 49 => Prefix::Lazy,
329 50 => Prefix::Annoying,
330 51 => Prefix::Nasty,
331 52 => Prefix::Manic,
332 53 => Prefix::Hurtful,
333 54 => Prefix::Strong,
334 55 => Prefix::Unpleasant,
335 56 => Prefix::Weak,
336 57 => Prefix::Ruthless,
337 58 => Prefix::Frenzying,
338 59 => Prefix::Godly,
339 60 => Prefix::Demonic,
340 61 => Prefix::Zealous,
341 62 => Prefix::Hard,
342 63 => Prefix::Guarding,
343 64 => Prefix::Armored,
344 65 => Prefix::Warding,
345 66 => Prefix::Arcane,
346 67 => Prefix::Precise,
347 68 => Prefix::Lucky,
348 69 => Prefix::Jagged,
349 70 => Prefix::Spiked,
350 71 => Prefix::Angry,
351 72 => Prefix::Menacing,
352 73 => Prefix::Brisk,
353 74 => Prefix::Fleeting,
354 75 => Prefix::HastyAccessory,
355 76 => Prefix::QuickAccessory,
356 77 => Prefix::Wild,
357 78 => Prefix::Rash,
358 79 => Prefix::Intrepid,
359 80 => Prefix::Violent,
360 81 => Prefix::Legendary,
361 82 => Prefix::Unreal,
362 83 => Prefix::Mythical,
363 _ => return None,
364 })
365 }
366}