-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathWeaponType.java
More file actions
660 lines (621 loc) · 35.9 KB
/
WeaponType.java
File metadata and controls
660 lines (621 loc) · 35.9 KB
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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
package bwapi;
/**
* This object identifies a weapon type used by a unit to attack and deal damage.
* <p>
* Some weapon types can be upgraded while others are used for special abilities.
*/
public enum WeaponType {
Gauss_Rifle(0),
Gauss_Rifle_Jim_Raynor(1),
C_10_Canister_Rifle(2),
C_10_Canister_Rifle_Sarah_Kerrigan(3),
Fragmentation_Grenade(4),
Fragmentation_Grenade_Jim_Raynor(5),
Spider_Mines(6),
Twin_Autocannons(7),
Hellfire_Missile_Pack(8),
Twin_Autocannons_Alan_Schezar(9),
Hellfire_Missile_Pack_Alan_Schezar(10),
Arclite_Cannon(11),
Arclite_Cannon_Edmund_Duke(12),
Fusion_Cutter(13),
Gemini_Missiles(15),
Burst_Lasers(16),
Gemini_Missiles_Tom_Kazansky(17),
Burst_Lasers_Tom_Kazansky(18),
ATS_Laser_Battery(19),
ATA_Laser_Battery(20),
ATS_Laser_Battery_Hero(21),
ATA_Laser_Battery_Hero(22),
ATS_Laser_Battery_Hyperion(23),
ATA_Laser_Battery_Hyperion(24),
Flame_Thrower(25),
Flame_Thrower_Gui_Montag(26),
Arclite_Shock_Cannon(27),
Arclite_Shock_Cannon_Edmund_Duke(28),
Longbolt_Missile(29),
Yamato_Gun(30),
Nuclear_Strike(31),
Lockdown(32),
EMP_Shockwave(33),
Irradiate(34),
Claws(35),
Claws_Devouring_One(36),
Claws_Infested_Kerrigan(37),
Needle_Spines(38),
Needle_Spines_Hunter_Killer(39),
Kaiser_Blades(40),
Kaiser_Blades_Torrasque(41),
Toxic_Spores(42),
Spines(43),
Acid_Spore(46),
Acid_Spore_Kukulza(47),
Glave_Wurm(48),
Glave_Wurm_Kukulza(49),
Seeker_Spores(52),
Subterranean_Tentacle(53),
Suicide_Infested_Terran(54),
Suicide_Scourge(55),
Parasite(56),
Spawn_Broodlings(57),
Ensnare(58),
Dark_Swarm(59),
Plague(60),
Consume(61),
Particle_Beam(62),
Psi_Blades(64),
Psi_Blades_Fenix(65),
Phase_Disruptor(66),
Phase_Disruptor_Fenix(67),
Psi_Assault(69),
Psionic_Shockwave(70),
Psionic_Shockwave_TZ_Archon(71),
Dual_Photon_Blasters(73),
Anti_Matter_Missiles(74),
Dual_Photon_Blasters_Mojo(75),
Anti_Matter_Missiles_Mojo(76),
Phase_Disruptor_Cannon(77),
Phase_Disruptor_Cannon_Danimoth(78),
Pulse_Cannon(79),
STS_Photon_Cannon(80),
STA_Photon_Cannon(81),
Scarab(82),
Stasis_Field(83),
Psionic_Storm(84),
Warp_Blades_Zeratul(85),
Warp_Blades_Hero(86),
Platform_Laser_Battery(92),
Independant_Laser_Battery(93),
Twin_Autocannons_Floor_Trap(96),
Hellfire_Missile_Pack_Wall_Trap(97),
Flame_Thrower_Wall_Trap(98),
Hellfire_Missile_Pack_Floor_Trap(99),
Neutron_Flare(100),
Disruption_Web(101),
Restoration(102),
Halo_Rockets(103),
Corrosive_Acid(104),
Mind_Control(105),
Feedback(106),
Optical_Flare(107),
Maelstrom(108),
Subterranean_Spines(109),
Warp_Blades(111),
C_10_Canister_Rifle_Samir_Duran(112),
C_10_Canister_Rifle_Infested_Duran(113),
Dual_Photon_Blasters_Artanis(114),
Anti_Matter_Missiles_Artanis(115),
C_10_Canister_Rifle_Alexei_Stukov(116),
None(130),
Unknown(131);
private static final int[] defaultWpnDamageAmt = {
6, 18, 10, 30, 20, 30, 125, 12, 10, 24, 20, 30, 70, 5, 0, 20, 8, 40, 16, 25, 25, 50, 50, 30, 30, 8, 16, 70,
150, 20, 260, 600, 0, 0, 250, 5, 10, 50, 10, 20, 20, 50, 4, 5, 0, 30, 20, 40, 9, 18, 5, 10, 15, 40, 500, 110,
0, 0, 0, 0, 300, 0, 5, 0, 8, 20, 20, 45, 5, 20, 30, 60, 4, 8, 14, 20, 28, 10, 20, 6, 20, 20, 100, 0, 14, 100,
45, 7, 7, 7, 7, 7, 7, 7, 4, 30, 10, 10, 8, 10, 5, 0, 20, 6, 25, 8, 8, 8, 0, 20, 6, 40, 25, 25, 20, 28, 30, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0
};
private static final int[] defaultWpnDamageBonus = {
1, 1, 1, 1, 2, 2, 0, 1, 2, 1, 1, 3, 3, 1, 0, 2, 1, 2, 1, 3, 3, 3, 3, 3, 3, 1, 1, 5, 5, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 3, 3, 1, 0, 0, 1, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 1,
3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 2,
1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0
};
private static final int[] wpnDamageCooldowns = {
15, 15, 22, 22, 30, 22, 22, 22, 22, 22, 22, 37, 37, 15, 15, 22, 30, 22, 30, 30, 30, 30, 30, 22, 22, 22, 22,
75, 75, 15, 15, 1, 1, 1, 75, 8, 8, 15, 15, 15, 15, 15, 15, 22, 22, 22, 30, 30, 30, 30, 22, 22, 15, 32, 1, 1,
1, 1, 1, 1, 1, 1, 22, 22, 22, 22, 30, 22, 30, 22, 20, 20, 22, 30, 22, 30, 22, 45, 45, 1, 22, 22, 1, 1, 45, 22,
30, 22, 22, 22, 22, 22, 22, 22, 9, 22, 22, 22, 22, 22, 8, 22, 22, 64, 100, 22, 22, 22, 1, 37, 15, 30, 22, 22,
30, 22, 22, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0
};
private static final int[] wpnDamageFactor = {
1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0
};
private static final int[] wpnMinRange = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private static final int[] wpnMaxRange = {
128, 160, 224, 192, 160, 160, 10, 192, 160, 160, 160, 224, 224, 10, 10, 160, 160, 160, 160, 192, 192, 192, 192,
192, 192, 32, 32, 384, 384, 224, 320, 3, 256, 256, 288, 15, 15, 15, 128, 160, 25, 25, 2, 32, 128, 64, 256, 256,
96, 96, 128, 128, 224, 224, 3, 3, 384, 288, 288, 288, 288, 16, 32, 10, 15, 15, 128, 128, 96, 96, 64, 64, 32,
128, 128, 128, 128, 160, 160, 128, 224, 224, 128, 288, 288, 15, 15, 128, 128, 32, 128, 224, 224, 128, 160, 192,
160, 160, 64, 160, 160, 288, 192, 192, 192, 256, 320, 288, 320, 192, 128, 15, 192, 192, 128, 128, 192, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0
};
private static final int[] wpnSplashRangeInner = {
0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 10, 10, 0, 0, 128, 0, 64, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0,
20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private static final int[] wpnSplashRangeMid = {
0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 25, 25, 0, 0, 192, 0, 64, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 50, 0, 0, 50, 0, 0, 0, 0, 0, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private static final int[] wpnSplashRangeOuter = {
0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 40, 40, 0, 0, 256, 0, 64, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 60, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 100, 0, 0, 100, 0, 0, 0, 0, 0, 20, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private static final int TARG_AIR = 0x01;
private static final int TARG_GROUND = 0x02;
private static final int TARG_MECH = 0x04;
private static final int TARG_ORGANIC = 0x08;
private static final int TARG_NOBUILD = 0x10;
private static final int TARG_NOROBOT = 0x20;
private static final int TARG_TERRAIN = 0x40;
private static final int TARG_ORGMECH = 0x80;
private static final int TARG_OWN = 0x100;
private static final int[] wpnFlags = {
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND | TARG_NOBUILD,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND | TARG_MECH | TARG_NOBUILD,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_AIR | TARG_GROUND | TARG_NOBUILD,
TARG_GROUND | TARG_NOBUILD | TARG_NOROBOT | TARG_ORGMECH,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_AIR | TARG_GROUND | TARG_ORGANIC | TARG_NOBUILD | TARG_OWN,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_AIR | TARG_GROUND | TARG_NOBUILD | TARG_TERRAIN,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_AIR,
TARG_AIR,
TARG_GROUND,
TARG_AIR,
TARG_AIR,
TARG_AIR,
TARG_AIR,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_GROUND,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_AIR,
TARG_AIR,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_GROUND,
TARG_AIR | TARG_GROUND | TARG_TERRAIN,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_GROUND,
TARG_AIR,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
TARG_AIR | TARG_GROUND,
0, 0
};
private static final UpgradeType[] upgrade = {
UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Vehicle_Weapons,
UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Upgrade_60, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Terran_Vehicle_Weapons,
UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons,
UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Ship_Weapons,
UpgradeType.Terran_Ship_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Upgrade_60,
UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Zerg_Melee_Attacks, UpgradeType.Zerg_Melee_Attacks, UpgradeType.Zerg_Melee_Attacks,
UpgradeType.Zerg_Missile_Attacks, UpgradeType.Zerg_Missile_Attacks, UpgradeType.Zerg_Melee_Attacks, UpgradeType.Zerg_Melee_Attacks, UpgradeType.Zerg_Melee_Attacks, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60,
UpgradeType.Zerg_Flyer_Attacks, UpgradeType.Zerg_Flyer_Attacks, UpgradeType.Zerg_Flyer_Attacks, UpgradeType.Zerg_Flyer_Attacks, UpgradeType.Zerg_Flyer_Attacks, UpgradeType.Zerg_Missile_Attacks,
UpgradeType.Zerg_Missile_Attacks, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60,
UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons,
UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons,
UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Upgrade_60,
UpgradeType.Upgrade_60, UpgradeType.Scarab_Damage, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Protoss_Ground_Weapons, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60,
UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Terran_Vehicle_Weapons,
UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Vehicle_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Terran_Ship_Weapons, UpgradeType.Zerg_Flyer_Attacks,
UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Upgrade_60, UpgradeType.Zerg_Missile_Attacks, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Protoss_Ground_Weapons,
UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Protoss_Air_Weapons, UpgradeType.Terran_Infantry_Weapons,
UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons,
UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons,
UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.Terran_Infantry_Weapons, UpgradeType.None, UpgradeType.Unknown
};
private static final DamageType[] damageType = {
DamageType.Normal, DamageType.Normal, DamageType.Concussive, DamageType.Concussive, DamageType.Concussive, DamageType.Concussive, DamageType.Explosive, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Explosive, DamageType.Explosive,
DamageType.Explosive, DamageType.Normal, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Concussive,
DamageType.Concussive, DamageType.Explosive, DamageType.Explosive, DamageType.Explosive, DamageType.Explosive, DamageType.Explosive, DamageType.Concussive, DamageType.Concussive, DamageType.Ignore_Armor, DamageType.Normal, DamageType.Normal, DamageType.Normal,
DamageType.Explosive, DamageType.Explosive, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Concussive, DamageType.Concussive,
DamageType.Normal, DamageType.Explosive, DamageType.Explosive, DamageType.Normal, DamageType.Independent, DamageType.Independent, DamageType.Independent, DamageType.Independent, DamageType.Independent, DamageType.Independent, DamageType.Normal, DamageType.Normal,
DamageType.Normal, DamageType.Normal, DamageType.Explosive, DamageType.Explosive, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Explosive, DamageType.Explosive,
DamageType.Explosive, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Independent, DamageType.Ignore_Armor, DamageType.Normal, DamageType.Normal, DamageType.Explosive, DamageType.Normal, DamageType.Explosive, DamageType.Explosive,
DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Explosive, DamageType.Concussive, DamageType.Explosive, DamageType.Explosive, DamageType.Ignore_Armor, DamageType.Ignore_Armor, DamageType.Explosive,
DamageType.Explosive, DamageType.Normal, DamageType.Ignore_Armor, DamageType.Independent, DamageType.Independent, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Concussive, DamageType.Concussive, DamageType.Normal, DamageType.Explosive,
DamageType.Concussive, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.Normal, DamageType.None, DamageType.Unknown
};
private static final ExplosionType[] explosionType = {
ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Radial_Splash, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.None,
ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Enemy_Splash, ExplosionType.Enemy_Splash, ExplosionType.Radial_Splash,
ExplosionType.Radial_Splash, ExplosionType.Normal, ExplosionType.Yamato_Gun, ExplosionType.Nuclear_Missile, ExplosionType.Lockdown, ExplosionType.EMP_Shockwave, ExplosionType.Irradiate, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal,
ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Radial_Splash, ExplosionType.Radial_Splash, ExplosionType.Normal, ExplosionType.Normal,
ExplosionType.Radial_Splash, ExplosionType.Normal, ExplosionType.Parasite, ExplosionType.Broodlings, ExplosionType.Ensnare, ExplosionType.Dark_Swarm, ExplosionType.Plague, ExplosionType.Consume, ExplosionType.Normal, ExplosionType.None, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal,
ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Enemy_Splash, ExplosionType.Enemy_Splash, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal,
ExplosionType.Enemy_Splash, ExplosionType.Stasis_Field, ExplosionType.Radial_Splash, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal,
ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Enemy_Splash, ExplosionType.Normal, ExplosionType.Air_Splash, ExplosionType.Disruption_Web, ExplosionType.Restoration, ExplosionType.Air_Splash, ExplosionType.Corrosive_Acid, ExplosionType.Mind_Control,
ExplosionType.Feedback, ExplosionType.Optical_Flare, ExplosionType.Maelstrom, ExplosionType.Enemy_Splash, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal,
ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.Normal, ExplosionType.None, ExplosionType.Unknown
};
private static final UnitType[] whatUses = {
UnitType.Terran_Marine, UnitType.Hero_Jim_Raynor_Marine, UnitType.Terran_Ghost, UnitType.Hero_Sarah_Kerrigan, UnitType.Terran_Vulture, UnitType.Hero_Jim_Raynor_Vulture,
UnitType.Terran_Vulture_Spider_Mine, UnitType.Terran_Goliath, UnitType.Terran_Goliath, UnitType.Hero_Alan_Schezar, UnitType.Hero_Alan_Schezar, UnitType.Terran_Siege_Tank_Tank_Mode,
UnitType.Hero_Edmund_Duke_Tank_Mode, UnitType.Terran_SCV, UnitType.Terran_SCV, UnitType.Terran_Wraith, UnitType.Terran_Wraith, UnitType.Hero_Tom_Kazansky, UnitType.Hero_Tom_Kazansky,
UnitType.Terran_Battlecruiser, UnitType.Terran_Battlecruiser, UnitType.Hero_Norad_II, UnitType.Hero_Norad_II, UnitType.Hero_Hyperion, UnitType.Hero_Hyperion, UnitType.Terran_Firebat,
UnitType.Hero_Gui_Montag, UnitType.Terran_Siege_Tank_Siege_Mode, UnitType.Hero_Edmund_Duke_Siege_Mode, UnitType.Terran_Missile_Turret, UnitType.Terran_Battlecruiser,
UnitType.Terran_Ghost, UnitType.Terran_Ghost, UnitType.Terran_Science_Vessel, UnitType.Terran_Science_Vessel, UnitType.Zerg_Zergling, UnitType.Hero_Devouring_One, UnitType.Hero_Infested_Kerrigan,
UnitType.Zerg_Hydralisk, UnitType.Hero_Hunter_Killer, UnitType.Zerg_Ultralisk, UnitType.Hero_Torrasque, UnitType.Zerg_Broodling, UnitType.Zerg_Drone, UnitType.Zerg_Drone, UnitType.None, UnitType.Zerg_Guardian,
UnitType.Hero_Kukulza_Guardian, UnitType.Zerg_Mutalisk, UnitType.Hero_Kukulza_Mutalisk, UnitType.None, UnitType.None, UnitType.Zerg_Spore_Colony, UnitType.Zerg_Sunken_Colony, UnitType.Zerg_Infested_Terran,
UnitType.Zerg_Scourge, UnitType.Zerg_Queen, UnitType.Zerg_Queen, UnitType.Zerg_Queen, UnitType.Zerg_Defiler, UnitType.Zerg_Defiler, UnitType.Zerg_Defiler, UnitType.Protoss_Probe, UnitType.Protoss_Probe,
UnitType.Protoss_Zealot, UnitType.Hero_Fenix_Zealot, UnitType.Protoss_Dragoon, UnitType.Hero_Fenix_Dragoon, UnitType.None, UnitType.Hero_Tassadar, UnitType.Protoss_Archon, UnitType.Hero_Tassadar_Zeratul_Archon,
UnitType.None, UnitType.Protoss_Scout, UnitType.Protoss_Scout, UnitType.Hero_Mojo, UnitType.Hero_Mojo, UnitType.Protoss_Arbiter, UnitType.Hero_Danimoth, UnitType.Protoss_Interceptor, UnitType.Protoss_Photon_Cannon,
UnitType.Protoss_Photon_Cannon, UnitType.Protoss_Scarab, UnitType.Protoss_Arbiter, UnitType.Protoss_High_Templar, UnitType.Hero_Zeratul, UnitType.Hero_Dark_Templar, UnitType.None, UnitType.None, UnitType.None, UnitType.None,
UnitType.None, UnitType.None, UnitType.Special_Independant_Starport, UnitType.None, UnitType.None, UnitType.Special_Floor_Gun_Trap, UnitType.Special_Wall_Missile_Trap, UnitType.Special_Wall_Flame_Trap,
UnitType.Special_Floor_Missile_Trap, UnitType.Protoss_Corsair, UnitType.Protoss_Corsair, UnitType.Terran_Medic, UnitType.Terran_Valkyrie, UnitType.Zerg_Devourer, UnitType.Protoss_Dark_Archon,
UnitType.Protoss_Dark_Archon, UnitType.Terran_Medic, UnitType.Protoss_Dark_Archon, UnitType.Zerg_Lurker, UnitType.None, UnitType.Protoss_Dark_Templar, UnitType.Hero_Samir_Duran, UnitType.Hero_Infested_Duran,
UnitType.Hero_Artanis, UnitType.Hero_Artanis, UnitType.Hero_Alexei_Stukov, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None, UnitType.None,
UnitType.None, UnitType.Unknown
};
private static final TechType[] attachedTech = {
// Terran
TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.Spider_Mines, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None,
TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.Yamato_Gun, TechType.Nuclear_Strike, TechType.Lockdown, TechType.EMP_Shockwave, TechType.Irradiate,
// Zerg
TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None,
TechType.None, TechType.Parasite, TechType.Spawn_Broodlings, TechType.Ensnare, TechType.Dark_Swarm, TechType.Plague, TechType.Consume,
// Protoss
TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None,
TechType.None, TechType.Stasis_Field, TechType.Psionic_Storm, TechType.None, TechType.None,
// Other
TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None,
// Expansion
TechType.None, TechType.Disruption_Web, TechType.Restoration, TechType.None, TechType.None, TechType.Mind_Control, TechType.Feedback, TechType.Optical_Flare, TechType.Maelstrom, TechType.None, TechType.None, TechType.None, TechType.None,
TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None, TechType.None
};
public final int id;
WeaponType(final int id) {
this.id = id;
}
/**
* Retrieves the technology type that must be researched before this weapon can
* be used.
*
* @return {@link TechType} required by this weapon.
* Returns {@link TechType#None} if no tech type is required to use this weapon.
* @see TechType#getWeapon
*/
public TechType getTech() {
return attachedTech[id];
}
/**
* Retrieves the unit type that is intended to use this weapon type.
* <p>
* There is a rare case where some hero unit types use the same weapon.
*
* @return The {@link UnitType} that uses this weapon.
* @see UnitType#groundWeapon
* @see UnitType#airWeapon
*/
public UnitType whatUses() {
return whatUses[id];
}
/**
* Retrieves the base amount of damage that this weapon can deal per attack.
* <p>
* That this damage amount must go through a {@link DamageType} and {@link UnitSizeType} filter
* before it is applied to a unit.
*
* @return Amount of base damage that this weapon deals.
*/
public int damageAmount() {
return defaultWpnDamageAmt[id];
}
/**
* Determines the bonus amount of damage that this weapon type increases by for every
* upgrade to this type.
*
* @return Amount of damage added for every weapon upgrade.
* @see #upgradeType
*/
public int damageBonus() {
return defaultWpnDamageBonus[id];
}
/**
* Retrieves the base amount of cooldown time between each attack, in frames.
*
* @return The amount of base cooldown applied to the unit after an attack.
* @see Unit#getGroundWeaponCooldown
* @see Unit#getAirWeaponCooldown
*/
public int damageCooldown() {
return wpnDamageCooldowns[id];
}
/**
* Obtains the intended number of missiles/attacks that are used.
* This is used to multiply with the damage amount to obtain the full amount of damage
* for an attack.
*
* @return The damage factor multiplied by the amount to obtain the total damage.
* @see #damageAmount
*/
public int damageFactor() {
return wpnDamageFactor[id];
}
/**
* Retrieves the upgrade type that increases this weapon's damage output.
*
* @return The {@link UpgradeType} used to upgrade this weapon's damage.
* @see #damageBonus
*/
public UpgradeType upgradeType() {
return upgrade[id];
}
/**
* Retrieves the damage type that this weapon applies to a unit type.
*
* @return {@link DamageType} used for damage calculation.
* @see DamageType
* @see UnitSizeType
*/
public DamageType damageType() {
return damageType[id];
}
/**
* Retrieves the explosion type that indicates how the weapon deals damage.
*
* @return ExplosionType identifying how damage is applied to a target location.
*/
public ExplosionType explosionType() {
return explosionType[id];
}
/**
* Retrieves the minimum attack range of the weapon, measured in pixels.
* This value is 0 for almost all weapon types, except for {@link WeaponType#Arclite_Shock_Cannon}
* and {@link WeaponType#Arclite_Shock_Cannon_Edmund_Duke}.
*
* @return Minimum attack range, in pixels.
*/
public int minRange() {
return wpnMinRange[id];
}
/**
* Retrieves the maximum attack range of the weapon, measured in pixels.
*
* @return Maximum attack range, in pixels.
*/
public int maxRange() {
return wpnMaxRange[id];
}
/**
* Retrieves the inner radius used for splash damage calculations, in pixels.
*
* @return Radius of the inner splash area, in pixels.
*/
public int innerSplashRadius() {
return wpnSplashRangeInner[id];
}
/**
* Retrieves the middle radius used for splash damage calculations, in pixels.
*
* @return Radius of the middle splash area, in pixels.
*/
public int medianSplashRadius() {
return wpnSplashRangeMid[id];
}
/**
* Retrieves the outer radius used for splash damage calculations, in pixels.
*
* @return Radius of the outer splash area, in pixels.
*/
public int outerSplashRadius() {
return wpnSplashRangeOuter[id];
}
/**
* Checks if this weapon type can target air units.
*
* @return true if this weapon type can target air units, and false otherwise.
* @see Unit#isFlying
* @see UnitType#isFlyer
*/
public boolean targetsAir() {
return (wpnFlags[id] & TARG_AIR) != 0;
}
/**
* Checks if this weapon type can target ground units.
*
* @return true if this weapon type can target ground units, and false otherwise.
* @see Unit#isFlying
* @see UnitType#isFlyer
*/
public boolean targetsGround() {
return (wpnFlags[id] & TARG_GROUND) != 0;
}
/**
* Checks if this weapon type can only target mechanical units.
*
* @return true if this weapon type can only target mechanical units, and false otherwise.
* @see #targetsOrgOrMech
* @see UnitType#isMechanical
*/
public boolean targetsMechanical() {
return (wpnFlags[id] & TARG_MECH) != 0;
}
/**
* Checks if this weapon type can only target organic units.
*
* @return true if this weapon type can only target organic units, and false otherwise.
* @see #targetsOrgOrMech
* @see UnitType#isOrganic
*/
public boolean targetsOrganic() {
return (wpnFlags[id] & TARG_ORGANIC) != 0;
}
/**
* Checks if this weapon type cannot target structures.
*
* @return true if this weapon type cannot target buildings, and false if it can.
* @see UnitType#isBuilding
*/
public boolean targetsNonBuilding() {
return (wpnFlags[id] & TARG_NOBUILD) != 0;
}
/**
* Checks if this weapon type cannot target robotic units.
*
* @return true if this weapon type cannot target robotic units, and false if it can.
* @see UnitType#isRobotic
*/
public boolean targetsNonRobotic() {
return (wpnFlags[id] & TARG_NOROBOT) != 0;
}
/**
* Checks if this weapon type can target the ground.
* <p>
* This is more for attacks like @Psi_Storm which can target a location, not to be
* confused with attack move.
*
* @return true if this weapon type can target a location, and false otherwise.
*/
public boolean targetsTerrain() {
return (wpnFlags[id] & TARG_TERRAIN) != 0;
}
/**
* Checks if this weapon type can only target organic or mechanical units.
*
* @return true if this weapon type can only target organic or mechanical units, and false otherwise.
* @see #targetsOrganic
* @see #targetsMechanical
* @see UnitType#isOrganic
* @see UnitType#isMechanical
*/
public boolean targetsOrgOrMech() {
return (wpnFlags[id] & TARG_ORGMECH) != 0;
}
/**
* Checks if this weapon type can only target units owned by the same player.
* This is used for {@link WeaponType#Consume}.
*
* @return true if this weapon type can only target your own units, and false otherwise.
* @see Unit#getPlayer
*/
public boolean targetsOwn() {
return (wpnFlags[id] & TARG_OWN) != 0;
}
}