-
Notifications
You must be signed in to change notification settings - Fork 11
/
units.go
416 lines (413 loc) · 13.2 KB
/
units.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
package swgoh
import (
"strings"
)
// CharName does a best effort to normalize the character name.
// Aliases like 'gat' for Grand Admiral Thrawn works.
// If no correction can be made, the original value is returned.
func CharName(src string) string {
switch strings.ToLower(src) {
case "ayla", "aayla", "aayla secura":
return "Aayla Secura"
case "aa", "ackbar", "admiral ackbar":
return "Admiral Ackbar"
case "ahsoka", "ahsoka tano", "asoka", "at":
return "Ahsoka Tano"
case "ahsoka tano fulcrum", "fulcrum", "atf":
return "Ahsoka Tano (Fulcrum)"
case "av", "asaj", "asajj", "assajj", "ventres", "ventress", "asajj ventress":
return "Asajj Ventress"
case "holdo":
return "Amilyn Holdo"
case "b1":
return "B1 Battle Droid"
case "b2", "b2 battle droid", "b2 super battle droid":
return "B2 Super Battle Droid"
case "bastila", "bastilla", "bs":
return "Bastila Shan"
case "bastila fallen", "fallen bastila", "bsf", "badstila", "hot topic bastila", "gothstila":
return "Bastila Shan (Fallen)"
case "barris", "baris", "barriss", "offee", "zarris", "barriss offee", "barris offee", "bariss offee", "baris offee":
return "Barriss Offee"
case "baze", "baze malbus":
return "Baze Malbus"
case "bb8", "bb-8":
return "BB-8"
case "biggs", "biggs darklighter":
return "Biggs Darklighter"
case "bistan":
return "Bistan"
case "bodhi", "bodhi rook":
return "Bodhi Rook"
case "boba", "boba fett":
return "Boba Fett"
case "c3po", "3po":
return "C-3PO"
case "bane", "cad", "cad bane":
return "Cad Bane"
case "canderous", "ordo":
return "Canderous Ordo"
case "cara", "kara", "kara dune":
return "Cara Dune"
case "carth", "onasi":
return "Carth Onasi"
case "chs", "cholo", "captain han", "captain han solo":
return "Captain Han Solo"
case "phasma", "captain phasma":
return "Captain Phasma"
case "cassian", "cassian andor":
return "Cassian Andor"
case "cody":
return "CC-2224 \"Cody\""
case "chirpa", "chief chirpa":
return "Chief Chirpa"
case "nebit", "chief nebit":
return "Chief Nebit"
case "chirrut", "chirut", "chirutt":
return "Chirrut Îmwe"
case "chopp", "chop", "chopper":
return "Chopper"
case "sarge", "sargento", "clone sergeant", "sergeant":
return "Clone Sergeant - Phase I"
case "chewe", "chewie", "chewbacca", "chewbaca":
return "Chewbacca"
case "clone wars chewe":
return "Clone Wars Chewbacca"
case "cls", "commander luke", "commander luke skywalker":
return "Commander Luke Skywalker"
case "colonel", "starck", "stark":
return "Colonel Starck"
case "cup", "coruscant", "coruscant police":
return "Coruscant Underworld Police"
case "dooku", "dokan", "dookan", "count dooku":
return "Count Dooku"
case "echo":
return "CT-21-0408 \"Echo\""
case "fives", "5s":
return "CT-5555 \"Fives\""
case "rex", "zrex":
return "CT-7567 \"Rex\""
case "malak":
return "Darth Malak"
case "maul", "zaul", "zmaul", "darth maul":
return "Darth Maul"
case "dn", "nihilus", "znihilus", "darth nihilis":
return "Darth Nihilus"
case "sion":
return "Darth Sion"
case "sidious", "zsidious", "darth sidious", "zidious":
return "Darth Sidious"
case "traya":
return "Darth Traya"
case "vader", "zader", "zvader", "darth vader":
return "Darth Vader"
case "datcha":
return "Dathcha"
case "dt", "death", "death trooper":
return "Death Trooper"
case "dengar":
return "dengar"
case "dk", "director", "director krennic", "krennic":
return "Director Krennic"
case "enfys", "nest", "nasty", "nesty":
return "Enfys Nest"
case "eeth", "eth", "ek", "eeth koth":
return "Eeth Koth"
case "palpatine", "emperor", "ep", "ip", "emperor palpatine":
return "Emperor Palpatine"
case "ee", "elder", "anciao", "ancião", "ewok elder":
return "Ewok Elder"
case "es", "ewok scout":
return "Ewok Scout"
case "ezra", "bridger":
return "Ezra Bridger"
case "finn", "zinn", "traitor":
return "Finn"
case "fox", "foe", "executioner", "panda", "death panda":
return "First Order Executioner"
case "foo", "fo officer", "first order officer":
return "First Order Officer"
case "fost", "fo stormtrooper", "first order stormtrooper":
return "First Order Stormtrooper"
case "fotp", "fo tie", "fo pilot", "fo tie pilot", "first order pilot", "first order tie", "first order tie pilot":
return "First Order TIE Pilot"
case "fosf", "fosftp", "sftp", "sf tie pilot":
return "First Order SF TIE Pilot"
case "gamorrean", "guard", "pig", "gamorrean guard", "pig guard", "gam guard":
return "Gamorrean Guard"
case "gar", "saxon", "gar saxon":
return "Gar Saxon"
case "zeb", "garrazeb", "garazeb", "garrazeb orrelios", "garrazeb zeb orrelios":
return "Garazeb \"Zeb\" Orrelios"
case "gg", "grevous", "grievous", "grivous", "general grievous":
return "General Grievous"
case "kenobi", "gk", "general kenobi":
return "General Kenobi"
case "veers", "general veers":
return "General Veers"
case "sg", "gs", "geonosian", "geono", "geonosian soldier":
return "Geonosian Soldier"
case "spy", "gspy", "geonosian spy":
return "Geonosian Spy"
case "gat", "thrawn", "grand admiral", "admiral thrawn", "grand admiral thrawn":
return "Grand Admiral Thrawn"
case "yoda", "zoda", "gmy", "master yoda", "grand master yoda":
return "Grand Master Yoda"
case "gmt", "tarkin", "moff", "grand moff", "moff tarkin", "grand moff tarkin":
return "Grand Moff Tarkin"
case "greedo":
return "Greedo"
case "greef", "karga":
return "Greef Karga"
case "han", "solo", "zolo", "zsolo", "han solo", "han zolo":
return "Han Solo"
case "hera", "hera syndulla":
return "Hera Syndulla"
case "hy", "hermit", "hermit yoda", "hoda":
return "Hermit Yoda"
case "hk", "hk47", "hk-47":
return "HK-47"
case "hrs", "hrscout", "hoth scout", "rebel scout", "hoth rebel scout":
return "Hoth Rebel Scout"
case "hrsolder", "hoth soldier", "rebel soldier", "hoth rebel soldier":
return "Hoth Rebel Soldier"
case "ig-100", "ig100", "ig 100", "magna", "magnaguard", "magna guard":
return "IG-100 MagnaGuard"
case "ig-86", "ig86", "ig 86":
return "IG-86 Sentinel Droid"
case "ig88", "ig-88", "ig 88":
return "IG-88"
case "ima", "igd", "ima gun", "gun di", "ima gun di", "ima-gun di", "ima-gun-di":
return "Ima-Gun Di"
case "ipd", "probe", "probe droid", "imperial droid":
return "Imperial Probe Droid"
case "isc", "imperial commando", "super commando", "imperial super commando":
return "Imperial Super Commando"
case "jawa":
return "Jawa"
case "je", "engineer", "jawa engineer":
return "Jawa Engineer"
case "js", "scavenger", "jawa scavenger":
return "Jawa Scavenger"
case "jedi revan", "jkr", "revan":
return "Jedi Knight Revan"
case "jolee", "jole", "bindo", "jb":
return "Jolee Bindo"
case "consul", "jc", "cj", "consular", "jedi consular":
return "Jedi Consular"
case "jka", "anakin", "jedi knight anakin":
return "Jedi Knight Anakin"
case "jkg", "jedi knight guardian":
return "Jedi Knight Guardian"
case "jyn", "zjyn", "zyn", "jyn erso":
return "Jyn Erso"
case "k2", "k2so", "k-2s0":
return "K-2SO"
case "kanan", "jarrus", "jarus", "kanan jarrus", "kanan jarus":
return "Kanan Jarrus"
case "kit", "fisto", "kit fisto":
return "Kit Fisto"
case "kylo", "ren", "zylo", "kylo ren":
return "Kylo Ren"
case "kru", "unmasked kylo", "kylo unmasked", "kylo ren unmasked":
return "Kylo Ren (Unmasked)"
case "lando", "calrissian", "lando calrissian":
return "Lando Calrissian"
case "lobot":
return "Lobot"
case "logray":
return "Logray"
case "luke", "farmboy", "farmboy luke", "luke skywalker":
return "Luke Skywalker (Farmboy)"
case "lumi", "luminara", "unduli", "luminara unduli":
return "Luminara Unduli"
case "mace", "windu", "mace windu":
return "Mace Windu"
case "magma", "magmatrooper", "magma trooper":
return "Magmatrooper"
case "mission", "vao":
return "Mission Vao"
case "mob", "enforcer", "mob enforcer":
return "Mob Enforcer"
case "acolyte", "ns acolyte", "nsa", "night sister acolyte", "nightsister acolyte":
return "Nightsister Acolyte"
case "initiate", "ns initiate", "nsi", "night sister initiate", "nightsister initiate":
return "Nightsister Initiate"
case "nute", "gunray", "nute gunray":
return "Nute Gunray"
case "old ben", "obi", "obi wan", "obi wan kenobi":
return "Obi-Wan Kenobi (Old Ben)"
case "daka":
return "Old Daka"
case "plo", "koon":
return "Plo Koon"
case "poe":
return "Poe Dameron"
case "poggle", "pogle", "pogle the lesser":
return "Poggle the Lesser"
case "leia", "zleia", "léia":
return "Princess Leia"
case "qira":
return "Qi'ra"
case "qgj", "quigon", "qui-gon", "qui gon jin", "qui-gon-jin":
return "Qui-Gon Jin"
case "r2d2", "r2":
return "R2-D2"
case "range", "rangetrooper":
return "Range Trooper"
case "rp":
return "Resistance Pilot"
case "rt":
return "Resistance Trooper"
case "rolo", "rebel leia":
return "Rebel Officer Leia Organa"
case "rey jedi training", "rjt", "rey jt", "jtr":
return "Rey (Jedi Training)"
case "rg", "royal":
return "Royal Guard"
case "rose", "tico":
return "Rose Tico"
case "sabine", "wren":
return "Sabine Wren"
case "savage", "so", "zavage":
return "Savage Opress"
case "scarif", "srp", "pathfinder":
return "Scarif Rebel Pathfinder"
case "shore":
return "Shoretrooper"
case "sass", "assassin", "sassassin":
return "Sith Assassin"
case "strooper", "trooper", "sit":
return "Sith Trooper"
case "snow":
return "Snowtrooper"
case "st", "storm":
return "Stormtrooper"
case "sth", "sthan":
return "Stormtrooper Han"
case "sf":
return "Sun Fac"
case "slkr", "slk":
return "Supreme Leader Kylo Ren"
case "t3m4", "t3", "m4":
return "T3-M4"
case "talia":
return "Talia"
case "teebo":
return "teebo"
case "mando", "the man":
return "The Mandalorian"
case "tfp", "tie", "tie pilot", "tie fighter":
return "TIE Fighter Pilot"
case "tusken", "Raider":
return "Tusken Raider"
case "shaman":
return "Tusken Shaman"
case "ug", "ugg":
return "Ugnaught"
case "uror", "urorr":
return "URoRRuR'R'R"
case "visas":
return "Visas Marr"
case "vchewie", "vchewbacca", "vet chewie", "vet chewbacca", "veteran chewie", "veteran chewbacca", "smuggler chewie", "smuggler chewbacca":
return "Veteran Smuggler Chewbacca"
case "vhan", "vet han", "veteran han", "veteran han solo", "smuggler han":
return "Veteran Smuggler Han Solo"
case "wedge", "wedge antilles":
return "Wedge Antilles"
case "wicket":
return "Wicket"
case "yolo", "young solo", "yhs":
return "Young Han Solo"
case "yando", "young lando", "ylc":
return "Young Lando Calrissian"
case "zam", "zw", "zam wesell":
return "Zam Wesell"
case "padme", "padme amidala":
return "Padmé Amidala"
case "drevan", "dr", "dr evan":
return "Darth Revan"
case "marauder", "sm":
return "Sith Marauder"
}
return src
}
// ShipName returns the ship name for the provided crew member or ship name.
// Crew member name is first parsed/adjusted by CharName function,
// so aliases supported there work here too.
func ShipName(pilot string) string {
pilot = CharName(pilot)
switch strings.ToLower(pilot) {
case "ahsoka tano":
return "Ahsoka Tano's Jedi Starfighter"
case "biggs darklighter":
return "Biggs Darklighter's X-wing"
case "bistan", "scarif rebel pathfinder":
return "Bistan's U-wing"
case "cassian andor", "jyn erso", "k-2so":
return "Cassian's U-wing"
case "grand admiral thrawn", "chimaera":
return "Chimaera"
case "clone sergeant - phase i":
return "Clone Sergeant's ARC-170"
case "mace windu", "endurance":
return "Endurance"
case "grand moff tarkin", "executrix":
return "Executrix"
case "first order tie pilot":
return "First Order TIE Fighter"
case "gar saxon", "imperial super comando", "gauntlet":
return "Gauntlet Starfighter"
case "geonosian soldier":
return "Geonosian Soldier's Starfighter"
case "geonosian spy":
return "Geonosian Spy's Starfighter"
case "hera syndulla", "kanan jarrus", "garazeb \"zeb\" orrelios", "ghost":
return "Ghost"
case "admiral ackbar", "home", "home one":
return "Home One"
case "ht", "hound", "tooth":
return "Hound's Tooth"
case "tie fighter pilot":
return "Imperial TIE Fighter"
case "jedi consular":
return "Jedi Consular's Starfighter"
case "kylo ren":
return "Kylo Ren's Command Shuttle"
case "kylo ren (unmasked)":
return "TIE Silencer"
case "rey (scavenger)", "finn", "millennium", "falcon", "milenium", "milennium":
return "Millennium Falcon (Ep VII)"
case "sabine wren", "ezra bridger", "chopper", "phantom":
return "Phantom II"
case "plo koon":
return "Plo Koon's Jedi Starfighter"
case "poe dameron", "poe":
return "Poe Dameron's X-wing"
case "resistance pilot":
return "Resistance X-wing"
case "ct-7567 \"rex\"":
return "Rex's ARC-170"
case "darth maul", "scimitar":
return "Scimitar"
case "boba fett", "slave", "slave i", "slavei", "slave one":
return "Slave I"
case "sun fac":
return "Sun Fac's Geonosian Starfighter"
case "darth vader", "tie x1", "tie advanced", "x1":
return "TIE Advanced x1"
case "death trooper", "shoretrooper", "reaper", "tie reaper":
return "TIE Reaper"
case "ct-5555 \"fives\"", "umbaram":
return "Umbaran Starfighter"
case "wedge antiles":
return "Wedge Antilles's X-wing"
case "eh":
return "Ebon Hawk"
case "mf", "milf":
return "Han's Millennium Falcon"
}
// To allow a fallback mode when you don't have a ship shortcut,
// return the same words as received
return pilot
}