df8b843e3eb1ea3c7c77c4e1be0f6c8fcc02e97e
[sheet.git] / sc-units-lotv.inc.pl
1 use utf8;
2 use strict;
3
4 my $V = v5.0.12;
5 my $RT = 1.4;  # real-time speed factor to faster
6
7 my $hots = do 'sc-units-hots.inc.pl' or die $!;
8 my %unit;
9 for my $row (@{$hots}) {
10         ref $row eq 'HASH' or next;
11         for ($row, @{ $row->{special} }, @{ $row->{upgrade} }) {
12                 $_ *= $RT for $_->{speed} // ();
13                 $_ /= $RT for $_->{build} // (), $_->{transform} // (), $_->{warp} // (), $_->{cooldown} // ();
14                 $_->{cooldown} and $_->{cooldown} /= $RT for @{ $_->{attack} // [] };
15         }
16         $unit{ lc $row->{name} =~ tr/ /_/r } = $row;
17 }
18
19 [
20 sprintf('patch %vd', $V),
21
22 # protoss
23
24 $unit{probe},
25
26 $unit{photon_cannon},
27
28 {
29         %{ $unit{mothership} },
30         pop => $V ge v5.0.12 ? 6 : 8,
31         min => $V ge v5.0.12 ? 300 : 400,
32         gas => $V ge v5.0.12 ? 300 : 400,
33         build => $V ge v5.0.12 ? 79 : 114,
34         size => $V ge v5.0.12 ? 2.475 : 2.75,
35         hp => $V ge v5.0.12 ? 250 : 350,
36         shield => $V ge v5.0.12 ? 250 : 350,
37         speed => $V ge v5.0.12 ? 2.83 : 2.62, # rotation speed also increased
38         energy => $V ge v5.0.12 ? 0 : 50,
39         special => [
40                 {
41                         %{ $unit{mothership}->{special}->[0] }, # cf
42                         $V lt v5.0.12 ? () : (
43                                 cooldown => 50,
44                                 duration => 20,
45                                 desc => $unit{mothership}->{special}->[0]->{desc} . ' for 20s',
46                         ),
47                 },
48                 {
49                         %{ $unit{mothership}->{special}->[1] }, # mr
50                         cost => $V ge v5.0.12 ? 0 : 100,
51                         cooldown => $V ge v5.0.12 ? 89 : 0,
52                         radius => $V ge v5.0.12 ? 5 : 6.5,
53                 },
54                 {
55                         %{ $unit{mothership}->{special}->[2] }, # tw
56                         desc => $V lt v4.11.0 ? 'create a temporal field which slows ground units by 50%' :
57                                 $V lt v5.0.12 ? 'create a temporal field which slows ground and air units by 50%' :
58                                                 'create a temporal field which slows ground and air units by 40%',
59                         cost => $V ge v5.0.12 ? 0 : 100,
60                         cooldown => $V ge v5.0.12 ? 60 : 0,
61                         radius => $V ge v5.0.12 ? 3.75 : 4,
62                         delay => $V ge v5.0.12 ? .71 : 1.79,
63                 },
64         ],
65 },
66
67 {
68         %{ $unit{nexus} },
69         attack => [],
70         energy => 50,
71         capacity => 200,
72         special => [
73                 $unit{nexus}->{special}->[0], # chrono boost
74                 {
75                         name => $V lt v4.7.1 ? 'Mass Recall' : 'Strategic Recall',
76                         abbr => 'sr',
77                         desc => 'recalls units owned by the player in the target area to the Nexus',
78                         cost => 50,
79                         cooldown => $V lt v4.7.1 || $V ge v4.10.1 ? 130 : 85,
80                         radius => $V lt v4.7.1 ? 6.5 : 2.5,
81                         duration => 3.6, # +.7 warp in
82                 },
83                 $V lt v4.12.0 ? () : {
84                         name => 'Battery Overcharge',
85                         abbr => 'bo',
86                         desc => sprintf(
87                                 'increase target Shield Battery restoration rate by %d%% and function without consuming energy for 14s',
88                                 $V ge v5.0.11 ? 50 : 100,
89                         ),
90                         cost => 50,
91                         duration => 14,
92                         cooldown => 60, # shared by all nexuses
93                         range => 8, # within any friendly nexus
94                 },
95         ],
96 },
97
98 {
99         %{ $unit{zealot} },
100         special => [
101                 {
102                         name => 'Charge',
103                         abbr => 'ch',
104                         desc => 'on attack, increases movement speed to 8.47 for 2.5s and deals 8 damage on hit',
105                         min => 100, # changed in 3.14.0
106                         gas => 100,
107                         build => 100,
108                         speed => .5,
109                         range => 4,
110                         duration => 2.5,
111                         cooldown => 7,
112                 },
113         ],
114         upgrade => [
115                 {
116                         name => 'Charge',
117                         speed => $V lt v4.11.0 ? .98 : 1.57,
118                 },
119         ],
120 },
121
122 {
123         %{ $unit{sentry} },
124         build => $V ge v5.0.11 ? 22.9 : 26.4,
125         speed => $V ge v5.0.11 ? 3.5 : 3.15,
126         special => [
127                 $unit{sentry}->{special}->[0], # ff
128                 {
129                         %{ $unit{sentry}->{special}->[1] }, # gs
130                         radius => $V lt v4.7.1 ? 4 : 4.5,
131                         duration => $V ge v5.0.12 ? 12.86 : 10.71,
132                 },
133                 {
134                         %{ $unit{sentry}->{special}->[2] }, # hl
135                         cost => $V lt v4.7.1 ? 100 : 75,
136                 },
137         ],
138 },
139
140 {
141         %{ $unit{stalker} },
142         attack => [
143                 {
144                         %{ $unit{stalker}->{attack}->[0] }, # particle disruptors
145                         damage => 13,
146                         bonus => {
147                                 armored => 5,
148                                 -armored => 1,
149                         },
150                         cooldown => 1.34,
151                 },
152         ],
153 },
154
155 {
156         race => 'protoss',
157         cat => 'gateway',
158         name => 'Adept',
159         pop => 2,
160         min => 100,
161         gas => 25,
162         build => $V lt v4.8.2 ? 27 : 30,
163         warp => 20,
164         size => 1,
165         cargo => 2,
166         armor => 1,
167         hp => 70,
168         shield => 70,
169         attr => {
170                 light => 1,
171                 organic => 1,
172         },
173         attack => [
174                 {
175                         anti => 1,
176                         name => undef, #TODO
177                         damage => 10,
178                         upgrade => 1,
179                         bonus => {
180                                 light => 12,
181                                 -light => 1,
182                         },
183                         type => 'projectile', #XXX: assumption
184                         cooldown => 1.61,
185                         range => 4,
186                 },
187         ],
188         speed => 3.5,
189         sight => 9,
190         special => [
191                 {
192                         name => 'Psionic Transfer',
193                         abbr => 'pt',
194                         desc => 'project shade, teleport after 7s',
195                         cooldown => 11,
196
197                         alt => 'Shade',
198                         build => 0,
199                         size => 0,
200                         cargo => 0,
201                         hp => -1,
202                         attack => [], #TODO: indicate diff from parent
203                         speed => 5, #XXX: faster than 3.5
204                         range => 7, #XXX: calculate from speed
205                         sight => 4,
206                 },
207         ],
208         upgrade => [
209                 {
210                         name => 'Resonating Glaives',
211                         min => 100,
212                         gas => 100,
213                         build => 100,
214                         attack => [
215                                 {
216                                         cooldown => $V lt v4.11.0 || $V ge v4.11.3 ? -.5 : -.6, # +45%/60%
217                                 },
218                         ],
219                 },
220         ],
221 },
222
223 {
224         %{ $unit{high_templar} },
225         speed => $V ge v5.0.11 ? 2.82 : 2.63,
226         attack => [
227                 {
228                         anti => 1,
229                         name => '?', #XXX
230                         damage => 4,
231                         upgrade => 1,
232                         cooldown => 1.25,
233                         range => 6,
234                 },
235         ],
236         special => [
237                 {
238                         $unit{high_templar}->{special}->[0], # fb
239                         range => $V lt v4.12.0 ? 9 : 10,
240                 },
241                 $unit{high_templar}->{special}->[1], # ps
242         ],
243 },
244
245 {
246         %{ $unit{dark_templar} },
247         special => [
248                 $unit{dark_templar}->{special}->[0], # cl
249                 {
250                         name => 'Shadow Stride',
251                         abbr => 'bl',
252                         desc => sprintf('teleport to visible location, %.2fs attack delay afterwards', $V ge v5.0.11 ? .71 : .75),
253                         min => 100,
254                         gas => 100,
255                         build => $V lt v4.7.1 ? 121 : 100,
256                         range => 8,
257                         cooldown => $V lt v4.7.1 ? 21 : 14,
258                 },
259         ],
260 },
261
262 $unit{archon},
263
264 {
265         %{ $unit{observer} },
266         speed => $V ge v5.0.11 ? 2.82 : $V lt v4.8.2 || $V ge v4.11.0 ? 2.63 : 3.01,
267         size => $V ge v5.0.11 ? 1.1 : 1,
268         special => [
269                 $unit{observer}->{special}->[0], # cloak
270                 {
271                         name => 'Surveillance Mode',
272                         abbr => 'sm',
273                         desc => 'gain 25% vision while immobilized',
274                         speed => 0,
275                         sight => 2.75, # +25%
276                         transform => .54,
277                 },
278         ],
279 },
280
281 {
282         %{ $unit{warp_prism} },
283         hp => 80,
284         min => $V lt v4.10.1 ? 200 : 250,
285         range => $V lt v4.10.1 ? 6 : 5, # pickup
286         upgrade => [
287                 {
288                         %{ $unit{warp_prism}->{special}->[0] }, # gravitic drive
289                         speed => 1.23,
290                 },
291         ],
292 },
293
294 {
295         %{ $unit{immortal} },
296         min => $V ge v4.8.2 ? 275 : 250,
297         special => [
298                 {
299                         name => 'Barrier',
300                         abbr => 'br',
301                         desc => 'block initial damage, then absorb up to 100 damage for 2s',
302                         duration => 2,
303                         cooldown => $V ge v3.8.0 ? 32 : 43,
304                 },
305         ],
306 },
307
308 {
309         %{ $unit{colossus} },
310         attack => [
311                 {
312                         %{ $unit{colossus}->{attack}->[0] }, # thermal lances
313                         damage => 10,
314                         upgrade => 1,
315                         bonus => {
316                                 light => 5,
317                                 -light => 1,
318                         },
319 #                       cooldown => 1.18, #XXX
320                 },
321         ],
322 },
323
324 {
325         race => 'protoss',
326         cat => 'robotic',
327         name => 'Disruptor',
328         pop => $V ge v5.0.12 ? 4 : 3,
329         min => 150,
330         gas => 150,
331         build => 36,
332         size => $V ge v5.0.12 ? 1.25 : 1, # much larger model
333         cargo => 4,
334         armor => 1,
335         hp => 100,
336         shield => 100,
337         attr => {
338                 armored => 1,
339                 mech => 1,
340         },
341         attack => [
342                 {
343                         anti => 1,
344                         name => 'Purification Nova',
345                         damage => 145,
346                         bonus => {
347                                 shields => 55,
348                         },
349                         type => 'trans', #TODO: indicate
350                         splash => $V ge v5.0.11 ? 1.375 : 1.5,
351                         cooldown => 14.3,
352                         range => 13, # 2s
353                 },
354         ],
355         speed => 3.15,
356         sight => 9,
357 },
358
359 $unit{phoenix},
360
361 {
362         %{ $unit{void_ray} },
363         min => $V lt v5.0.9 && $V ge v5.0.2 ? 200 : 250,
364         speed => $V lt v5.0.2 ? 3.5 : 3.85,
365         build => $V lt v5.0.9 && $V ge v5.0.2 ? 37 : 43,
366         upgrade => [
367                 {
368                         name => 'Flux Vanes',
369                         min => 100,
370                         gas => 100,
371                         build => 57,
372                         speed => $V lt v5.0.2 ? 1.15 : .798,
373                 },
374         ],
375 },
376
377 {
378         %{ $unit{oracle} },
379         build => 37,
380         attr => {
381                 $V lt v4.8.2 ? 'light' : 'armored' => 1,
382                 mech => 1,
383                 psionic => 1,
384                 flying => 1,
385         },
386         attack => [
387                 {
388                         %{ $unit{oracle}->{attack}->[0] }, # pulsar beam
389                         bonus => {
390                                 light => 7,
391                         },
392                 },
393         ],
394         special => [
395                 {
396                         name => 'Revelation',
397                         abbr => 'rv',
398                         desc => 'hit enemy units and buildings are revealed for Â½ minute',
399                         cost => $V lt v4.12.0 ? 50 : 25,
400                         range => 9,
401                         cooldown => $V lt v4.12.0 ? 2 : 10,
402                         duration => $V lt v4.12.0 ? 30 : $V lt v5.0.2 ? 15 : 20,
403                         radius => 6,
404                         detect => 1,
405                 },
406                 {
407                         name => 'Stasis Ward',
408                         abbr => 'sw',
409                         desc => 'places ward for 170s',
410                         cost => 50,
411                         range => 6,
412                         build => 3.58,
413                         duration => 170,
414                         alt => 'Stasis Ward',
415                         hp => 30,
416                         shield => 30,
417                         armor => 0,
418                         attr => {
419                                 light => 1,
420                                 structure => 1,
421                         },
422                         sight => $V ge v5.0.12 ? 7 : 4,
423                         speed => 0,
424                         special => [
425                                 {
426                                         name => 'Permanent Cloak',
427                                         abbr => 'cl',
428                                         desc => 'cloaked at all times',
429                                         duration => -1,
430                                 },
431                                 {
432                                         name => 'Stasis Trap',
433                                         abbr => 'st',
434                                         desc => 'triggered by nearby ground units, trapping them for 21½s',
435                                 },
436                         ],
437                 },
438         ],
439 },
440
441 {
442         %{ $unit{tempest} },
443         hp => $V lt v4.7.1 ? 300 : $V lt v4.11.0 ? 150 : 200,
444         shield => $V lt v4.7.1 ? 150 : $V lt v4.11.0 ? 125 : 100,
445         min => $V lt v4.7.1 ? 300 : 250,
446         gas => $V lt v4.7.1 ? 200 : 175,
447         pop => $V lt v4.7.1 ? 6 : 5,
448         speed => $V lt v4.7.1 ? 2.63 : $V lt v4.8.2 ? 3.5 : 3.15,
449         # acceleration increased in v5.0.12
450         size => $V ge v5.0.12 ? 2.25 : 2.5,
451         attack => [
452                 {
453                         %{ $unit{tempest}->{attack}->[0] }, # kinetic overload
454                         bonus => {
455                                 massive => 22,
456                                 -massive => 2,
457                         },
458                         range => $V lt v4.11.0 ? 15 : 14,
459                 },
460                 {
461                         %{ $unit{tempest}->{attack}->[1] }, # resonance coil
462                         bonus => {
463                                 structure => 0,
464                         },
465                         damage => 40,
466                         upgrade => 4,
467                 },
468         ],
469         upgrade => [
470                 $V lt v5.0.2 ? () : {
471                         name => 'Tectonic Destabilizers',
472                         attack => [
473                                 {},
474                                 {
475                                         bonus => {
476                                                 structure => 40,
477                                         },
478                                 },
479                         ],
480                         min => 150,
481                         gas => 150,
482                         build => 100,
483                 },
484         ],
485 },
486
487 {
488         %{ $unit{carrier} },
489         hp => $V lt v4.7.1 ? 250 : 300,
490         build => $V lt v4.7.1 ? 86 : 64,
491         special => [
492                 {
493                         %{ $unit{carrier}->{special}->[0] }, # interceptor
494                         min => 5,
495                         build => $V lt v4.7.1 ? 6 : $V lt v4.10.1 ? 11 : 9,
496                 },
497         ],
498         $V lt v4.7.1 ? () : (upgrade => []), # remove Graviton Catapult
499 },
500
501 # terran
502
503 $unit{scv},
504 $unit{mule},
505 $unit{missile_turret},
506 $unit{planetary_fortress},
507
508 $unit{marine},
509
510 {
511         %{ $unit{marauder} },
512         attack => [
513                 {
514                         %{ $unit{marauder}->{attack}->[0] }, # punisher grenades
515                         count => $V lt v4.3.0 ? 2 : 1,
516                         damage => $V lt v4.3.0 ? 5 : 10,
517                         upgrade => 1,
518                         bonus => {
519                                 armored => $V lt v4.3.0 ? 5 : 10,
520                                 -armored => $V lt v4.3.0 ? 0 : 1,
521                         },
522                 },
523         ],
524 },
525
526 {
527         %{ $unit{reaper} },
528         build => 32,
529 },
530
531 {
532         %{ $unit{ghost} },
533         min => 150,
534         gas => 125,
535         speed => 3.94,
536         special => [
537                 {
538                         # replaces Sniper Round
539                         name => 'Steady Targeting',
540                         abbr => 'st',
541                         desc => ($V ge v5.0.12 ? '130 damage (+40 psionic)' : '170 damage') .
542                                 ' ignoring armor to a biological unit after 1.43s without damage',
543                         cost => 50,
544                         range => 10, # kept until 14
545                         duration => 1.43,
546                 },
547                 {
548                         %{ $unit{ghost}->{special}->[1] }, # emp round
549                         radius => $V ge v5.0.12 || $V lt v4.10.1 ? 1.5 : $V lt v5.0.11 ? 2 : 1.75,
550                 },
551                 $unit{ghost}->{special}->[2], # cloak
552                 $unit{ghost}->{special}->[3], # tac nuke strike
553         ],
554         upgrade => [
555                 $V ge v5.0.11 || $V lt v4.10.1 ? () : {
556                         name => 'Enhanced Shockwaves',
557                         min => 150,
558                         gas => 150,
559                         build => 79,
560                         special => [
561                                 {},
562                                 { radius => .5 }, # emp
563                                 {},
564                                 {},
565                         ],
566                 },
567         ],
568 },
569
570 {
571         %{ $unit{hellion} },
572         attack => [
573                 {
574                         %{ $unit{hellion}->{attack}->[0] }, # infernal flamethrower
575                         bonus => {
576                                 light => 5,
577                                 -light => 0,
578                         },
579                 },
580         ],
581         #TODO smart servos
582 },
583
584 {
585         %{ $unit{hellbat} },
586         special => [
587                 $unit{hellbat}->{special}->[0], # Hellion Mode
588                 {
589                         name => 'Smart Servos',
590                         min => 100,
591                         gas => 100,
592                         build => 79,
593                         transform => -1.43, # halve #TODO: alter special duration?
594                 },
595         ],
596         upgrade => [
597                 {
598                         %{ $unit{hellbat}->{upgrade}->[0] }, # Pre-Igniter
599                         attack => [
600                                 {
601                                         bonus => {
602                                                 light => 12,
603                                                 -light => $V ge v5.0.12 ? 0 : 1,
604                                         },
605                                 },
606                         ],
607                 },
608         ],
609 },
610
611 {
612         %{ $unit{widow_mine} },
613         build => 21,
614         attack => [
615                 {
616                         %{ $unit{widow_mine}->{attack}->[0] }, # Sentinel Missiles
617                         bonus => {
618                                 shields => 25,
619                         },
620                         transform => $V lt v5.0.9 ? .71 : 1.07,
621                 },
622         ],
623         upgrade => [
624                 {
625                         %{ $unit{widow_mine}->{upgrade}->[0] }, # drilling claws
626                         desc => 'halves burrow/unburrow time from upto 2½/1 to 1½/½ seconds',
627                 },
628         ],
629 },
630
631 {
632         %{ $unit{siege_tank} },
633         hp => 175,
634         special => [
635                 {
636                         %{ $unit{siege_tank}->{special}->[0] }, # siege mode
637                         attack => [
638                                 {
639                                         %{ $unit{siege_tank}->{special}->[0]->{attack}->[0] }, # shock cannon
640                                         damage => 40,
641                                         upgrade => 4,
642                                         bonus => {
643                                                 armored => 30,
644                                                 -armored => 1,
645                                         },
646                                         cooldown => 2.14,
647                                 },
648                         ],
649                 },
650         ],
651 },
652
653 {
654         race => 'terran',
655         cat => 'factory',
656         name => 'Cyclone',
657         pop => 3,
658         min => $V ge v5.0.12 ? 125 : 150,
659         gas => $V ge v5.0.12 ? 50 : 100,
660         build => 32,
661         size => 1.5,
662         cargo => $V ge v5.0.12 ? 2 : 3,
663         armor => $V ge v5.0.12 ? 0 : 1,
664         hp => $V ge v5.0.12 ? 110 : $V ge v4.7.1 ? 120 : 180,
665         attr => {
666                 armored => 1,
667                 mech => 1,
668         },
669         attack => [
670                 {
671                         anti => 1,
672                         name => $V lt v4.7.1 ? 'Tornado Blaster' : 'Typhoon Missile Pod',
673                         damage => $V ge v5.0.12 ? 11 : $V ge v4.7.1 ? 18 : 3,
674                         upgrade => $V lt v4.7.1 ? 1 : 2,
675                         bonus => $V ge v4.7.1 ? {} : {
676                                 armored => $V ge v5.0.12 ? 0 : 2,
677                                 -armored => 0,
678                                 mech => $V ge v5.0.12 ? 3 : 0,
679                         },
680                         cooldown => $V lt v4.7.1 ? .1 : $V lt v5.0.12 ? .71 : .481,
681                         range => $V ge v5.0.12 || $V lt v4.7.1 ? 6 : 5,
682                 },
683         ],
684         speed => $V ge v5.0.12 ? 3.94 : $V ge v4.7.1 ? 4.73 : 4.13,
685         sight => 11,
686         special => [
687                 {
688                         name => 'Lock On',
689                         abbr => 'lo',
690                         desc => (
691                                 $V ge v5.0.12 ? 'attack single target while within 9 range' :
692                                 $V ge v5.0.11 ? 'deal 400 damage (600 after upgrade) over 14 seconds' :
693                                 $V ge v4.7.1 ? 'deal 400 damage (double to armored after upgrade) over 14 seconds' :
694                                 'target air for 160 damage ignoring armor while visible and within 15 range'
695                         ),
696                         range => $V lt v5.0.12 ? 7 : 6,
697                         duration => $V lt v5.0.12 ? 14.3 : 0,
698                         cooldown => $V lt v5.0.12 ? 4 : 0,
699                 },
700                 $V ge v4.7.1 ? () : {
701                         name => 'Rapid Fire Launchers',
702                         abbr => 'rf',
703                         desc => 'rapid first 12 Lock On shots',
704                         min => 75,
705                         gas => 75,
706                         build => 79,
707                 },
708         ],
709         upgrade => [
710                 $V ge v5.0.12 || $V lt v4.7.1 ? () : {
711                         name => 'Mag-Field Accelerator',
712                         min => 100,
713                         gas => 100,
714                         build => $V lt v4.8.2 ? 79 : 100,
715                         desc => 'increases lock-on damage by '.($V ge v5.0.11 ? '50%' : '100% vs armored'),
716                 },
717                 $V lt v5.0.12 ? () : {
718                         name => 'Hurricane Engines',
719                         speed => .79,
720                         min => 100,
721                         gas => 100,
722                         build => 100,
723                 },
724         ],
725 },
726
727 {
728         %{ $unit{thor} },
729         armor => $V ge v3.14.0 && $V lt v4.7.1 ? 2 : 1,
730         attack => [
731                 $unit{thor}->{attack}->[0], # thor's hammer
732                 $unit{thor}->{attack}->[1], # javelin missiles
733                 {
734                         %{ $unit{thor}->{attack}->[2] }, # punisher cannons
735                         name => 'High Impact Payload',
736                         damage => $V lt v4.7.1 ? 35 : $V lt v4.11.0 ? 40 : 25,
737                         upgrade => 3,
738                         bonus => {
739                                 $V lt v4.7.1 ? 'armored' : 'massive' => $V lt v4.11.0 ? 15 : 10,
740                                 $V lt v4.7.1 ? '-armored' : '-massive' => 2,
741                         },
742                         cooldown => $V lt v4.7.1 ? 2.14 : $V lt v4.11.0 ? 1.71 : .9,
743                         range => $V lt v4.8.2 ? 10 : 11,
744                 },
745         ],
746         #TODO smart servos
747 },
748
749 {
750         %{ $unit{viking} },
751         hp => $V lt v4.3.0 ? 125 : 135,
752 },
753
754 {
755         %{ $unit{medivac} },
756         special => [
757                 $unit{medivac}->{special}->[0], # heal
758                 {
759                         %{ $unit{medivac}->{special}->[1] }, # ignite afterburners
760                         desc => 'boost speed and accelleration to 4.25 for 8s',
761                         speed => 5.94,
762                         duration => $V lt v4.7.1 ? 6.43 : 4.29,
763                         cooldown => $V lt v4.11.0 ? 20 : 14,
764                         -cooldown => 9,
765                 },
766         ],
767         upgrade => [
768                 $V ge v5.0.12 ? {
769                         name => 'Caduceus Reactor',
770                         desc => 'double energy regeneration rate',
771                         min => 100,
772                         gas => 100,
773                         build => 53.57,
774                 } : {
775                         name => 'Rapid Reignition System',
776                         min => 100,
777                         gas => 100,
778                         build => 57,
779                         speed => .63,
780                 },
781         ],
782 },
783
784 {
785         race => 'terran',
786         cat => 'starport',
787         name => 'Liberator',
788
789         pop => 3,
790         min => 150,
791         gas => $V ge v5.0.11 ? 125 : 150,
792         build => 43,
793         size => 1.5,
794         armor => 0,
795         hp => 180,
796         attr => {
797                 armored => 1,
798                 mech => 1,
799                 flying => 1,
800         },
801         attack => [
802                 {
803                         anti => 2,
804                         name => 'Lexington Rockets',
805                         damage => 5,
806                         upgrade => 1,
807                         type => 'projectile',
808                         cooldown => 1.29,
809                         count => 2,
810                         range => 5,
811                 },
812         ],
813         special => [
814                 {
815                         name => 'Defender Mode',
816                         abbr => 'dm',
817                         transform => 2.88, # 1.46s to revert
818                         alt => 'Defender Liberator',
819                         attack => [
820                                 {
821                                         anti => 1,
822                                         name => 'Concord Cannon',
823                                         desc => 'within 5 diameter circle',
824                                         damage => 75,
825                                         upgrade => 5,
826                                         cooldown => 1.14,
827                                         range => 10,
828                                 },
829                         ],
830                         speed => 0,
831                         sight => 15, # only targeted area
832                         upgrade => [
833                                 {
834                                         name => 'Advanced Ballistics',
835                                         min => 150,
836                                         gas => 150,
837                                         build => 79,
838                                         attack => [
839                                                 {
840                                                         range => 4,
841                                                 },
842                                         ],
843                                         sight => 4,
844                                 },
845                         ],
846                 },
847         ],
848         speed => 4.72,
849         sight => 10,
850 },
851
852 {
853         %{ $unit{banshee} },
854         speed => 3.85,
855         upgrade => [
856                 {
857                         name => 'Hyperflight Rotors',
858                         speed => 1.4,
859                         min => $V ge v5.0.11 ? 125 : $V ge v4.7.1 ? 150 : 200,
860                         gas => $V ge v5.0.11 ? 125 : $V ge v4.7.1 ? 150 : 200,
861                         build => $V ge v5.0.11 ? 100 : 121.4,
862                 },
863         ],
864 },
865
866 {
867         %{ $unit{raven} },
868         gas => $V ge v5.0.11 ? 150 : 200,
869         build => $V ge v5.0.11 ? 34.3 : 42.9,
870         speed => $V lt v4.11.0 ? 3.85 : 4.13,
871         upgrade => $V ge v5.0.11 ? [] : $unit{raven}->{upgrade}, # corvid reactor
872         special => [
873                 {
874                         %{ $unit{raven}->{special}->[0] }, # auto-turret
875                         attack => [
876                                 {
877                                         anti => 3,
878                                         name => '12 mm Gauss Cannon',
879                                         damage => 18,
880                                         cooldown => .57,
881                                         range => 6,
882                                 },
883                         ],
884                         hp => $V ge v5.0.11 ? 100 : 150,
885                         armor => $V ge v5.0.11 ? 0 : 1,
886                         range => $V lt v4.3.0 ? 1 : 2,
887                         duration => $V ge v5.0.11 ? 7.9 : 10,
888                         upgrade => [
889                                 $unit{raven}->{special}->[0]->{upgrade}->[0], # hi-sec auto tracking
890                                 $unit{raven}->{special}->[0]->{upgrade}->[1], # structure armor
891                                 # no more durable materials
892                         ],
893                 },
894                 {
895                         name => 'Interference Matrix',
896                         abbr => 'im',
897                         desc => 'disable target mech or psionic unit rendering it unable to attack or cast',
898                         $V lt v5.0.12 ? () : (
899                                 min => 50,
900                                 gas => 50,
901                                 build => 57.14,
902                         ),
903                         cost => $V lt v4.11.0 ? 50 : 75,
904                         range => 9,
905                         duration => $V lt v4.11.0 ? 7.9 : 11,
906                 },
907                 {
908                         name => 'Anti-Armor Missile',
909                         abbr => 'aa',
910                         desc => sprintf('launches missile %s reduce armor by %d',
911                                 $V lt v4.7.1 ? 'to do splash damage and' : 'to',
912                                 $V ge v5.0.11 ? 2 : 3,
913                         ),
914                         range => 10,
915                         size => 2.88,
916                         attack => [
917                                 {
918                                         damage => $V lt v4.3.0 ? 30 : $V lt v4.7.1 ? 15 : 0,
919                                         splash => 1,
920                                 },
921                         ],
922                         cost => 75,
923                         duration => 21,
924                 },
925         ],
926 },
927
928 {
929         %{ $unit{battlecruiser} },
930         attack => [
931                 $unit{battlecruiser}->{attack}->[0], # ats laser
932                 {
933                         %{ $unit{battlecruiser}->{attack}->[1] }, # ata laser
934                         damage => $V lt v4.7.1 ? 6 : 5,
935                 },
936         ],
937         special => [
938                 {
939                         name => 'Tactical Jump',
940                         abbr => 'tj',
941                         desc => 'warps to the target location after 5s (invulnerable after 1s)',
942                         duration => 4,
943                         cooldown => 71,
944                 },
945                 {
946                         %{ $unit{battlecruiser}->{special}->[0] }, # yc
947                         desc => '240 damage to a single target',
948                         attack => [
949                                 {
950                                         damage => 240,
951                                 },
952                         ],
953                         cost => undef,
954                         cooldown => 71,
955                 },
956         ],
957         upgrade => [],
958 },
959
960 # zerg
961
962 $unit{drone},
963
964 {
965         %{ $unit{queen} },
966         attack => [
967                 $unit{queen}->{attack}->[0], # claws
968                 {
969                         %{ $unit{queen}->{attack}->[1] }, # acid spines
970                         range => $V lt v4.12.0 ? 8 : 7,
971                 },
972         ],
973         range => 8,
974 },
975
976 {
977         %{ $unit{overlord} },
978         speed => .9023, # changed in 4.0.0
979         # deceleration speed increased in v5.0.12
980         upgrade => [
981                 {
982                         %{ $unit{overlord}->{upgrade}->[0] }, # carapace
983                         speed => ($V ge v5.0.12 ? 2.83 : 2.63)-.9023,
984                 },
985                 {
986                         %{ $unit{overlord}->{upgrade}->[1] }, # sacs
987                         speed => $V ge v5.0.12 ? 1.099-.9023 : 0,
988                 },
989         ],
990 },
991
992 {
993         %{ $unit{overseer} },
994         special => [
995                 {
996                         name => 'Oversight Mode',
997                         abbr => 'om',
998                         desc => 'gain 25% vision while immobilized',
999                         speed => 0,
1000                         sight => 11 * 1.25,
1001                         transform => .54,
1002                 },
1003                 @{ $unit{overseer}->{special} }, # changeling, contaminate
1004         ],
1005 },
1006
1007 $unit{larva},
1008 $unit{spine_crawler},
1009
1010 {
1011         %{ $unit{spore_crawler} },
1012         attack => [
1013                 {
1014                         %{ $unit{spore_crawler}->{attack}->[0] }, # seeker spores
1015                         bonus => {
1016                                 organic => 15,
1017                         },
1018                 },
1019         ],
1020         speed => (1.5),
1021         creep => 2.6,
1022 },
1023
1024 $unit{zergling},
1025
1026 {
1027         %{ $unit{baneling} },
1028         min => 25,
1029         attack => [
1030                 {
1031                         %{ $unit{baneling}->{attack}->[0] }, # volatile burst
1032                         damage => $V lt v4.12.0 ? 20 : $V lt v5.0.2 ? 18 : 15,
1033                         bonus => {
1034                                 light => $V lt v4.12.0 ? 15 : $V lt v5.0.2 ? 17 : 20,
1035                                 -light => $V ge v5.0.12 ? 0 : 2,
1036                                 structure => 80,
1037                                 -structure => 5,
1038                         },
1039                         splash => 1,
1040                         range => 0,
1041                 },
1042         ],
1043         upgrade => [
1044                 {
1045                         %{ $unit{baneling}->{upgrade}->[0] }, # centrifugal hooks
1046                         $V ge v5.0.12 ? (
1047                                 min => 100,
1048                                 gas => 100,
1049                                 build => 71,
1050                         ) : (
1051                                 hp => 5,
1052                         ),
1053                 },
1054         ],
1055 },
1056
1057 {
1058         %{ $unit{roach} },
1059         special => [
1060                 {
1061                         %{ $unit{roach}->{special}->[0] }, # rapid regeneration
1062                         desc => 'regenerates health at 7 HP/s while burrowed',
1063                 },
1064                 {
1065                         %{ $unit{roach}->{special}->[1] }, # tunneling claws
1066                         min => $V lt v4.7.1 ? 150 : 100,
1067                         gas => $V lt v4.7.1 ? 150 : 100,
1068                         build => 79,
1069                         desc => 'move while burrowed at speed of 2.8',
1070                 },
1071         ],
1072 },
1073
1074 {
1075         race => 'zerg',
1076         cat => 'hatchery',
1077         name => 'Ravager',
1078         base => ['Roach'],
1079         pop => 3,
1080         min => 25,
1081         gas => 75,
1082         build => $V ge v5.0.11 ? 12.14 : 8.57+.36, # added max random
1083         size => 1.5,
1084         cargo => 4,
1085         armor => 1,
1086         hp => 120,
1087         attr => {
1088                 organic => 1,
1089         },
1090         attack => [
1091                 {
1092                         anti => 1,
1093                         name => '?',
1094                         damage => 16,
1095                         upgrade => 2,
1096                         type => 'projectile',
1097                         cooldown => 1.14,
1098                         range => 6,
1099                 },
1100         ],
1101         speed => 3.85,
1102         creep => 1.3,
1103         sight => 9,
1104 },
1105
1106 {
1107         %{ $unit{hydralisk} },
1108         hp => 90,
1109         upgrade => [
1110                 {
1111                         %{ $unit{hydralisk}->{upgrade}->[0] }, # grooved spines
1112                         min => $V ge v5.0.12 ? 75 : 100,
1113                         gas => $V ge v5.0.12 ? 75 : 100,
1114                         build => $V ge v5.0.12 ? 50 : 71,
1115                         attack => [
1116                                 {
1117                                         range => 2,
1118                                 },
1119                         ],
1120                 },
1121                 {
1122                         %{ $unit{hydralisk}->{upgrade}->[1] }, # muscular augments
1123                         build => $V ge v5.0.12 ? 64 : 71,
1124                 },
1125         ],
1126 },
1127
1128 {
1129         race => 'zerg',
1130         cat => 'lair',
1131         name => 'Lurker',
1132         base => ['Hydralisk'],
1133         pop => 3,
1134         min => 50,
1135         gas => 100,
1136         build => 18,
1137         cargo => 4,
1138         armor => 1,
1139         hp => 200,
1140         attr => {
1141                 armored => 1,
1142                 organic => 1,
1143         },
1144         attack => [
1145                 {
1146                         anti => 1,
1147                         name => 'Spines',
1148                         damage => 20,
1149                         upgrade => 2,
1150                         splash => 'line',
1151                         cooldown => 1.43,
1152                         range => $V lt v4.11.0 ? 9 : 8,
1153                         bonus => {
1154                                 armored => 10,
1155                                 -armored => 1,
1156                         },
1157                 },
1158         ],
1159         transform => 2.0,
1160         upgrade => [
1161                 $V lt v4.11.0 ? () : {
1162                         name => 'Seismic Spines',
1163                         attack => [
1164                                 {
1165                                         range => 2,
1166                                 },
1167                         ],
1168                         req => 'Hive',
1169                         min => 150,
1170                         gas => 150,
1171                         build => 57,
1172                 },
1173                 {
1174                         name => 'Adaptive Talons',
1175                         desc => $V ge v5.0.12 ? 'halves burrow time from 2 seconds to 1' :
1176                                 'halves burrow time and increases movement speed',
1177                         speed => $V ge v5.0.12 ? 0 : .413,
1178                         transform => $V lt v5.0.9 ? .71 : 1.07,
1179                         min => $V ge v5.0.12 ? 100 : 150,
1180                         gas => $V ge v5.0.12 ? 100 : 150,
1181                         build => 57,
1182                 },
1183         ],
1184         speed => 4.13,
1185         creep => 1.3,
1186         sight => 10,
1187 },
1188
1189 {
1190         %{ $unit{infestor} },
1191         energy => $V ge v5.0.12 ? 75 : 50,
1192         special => [
1193                 {
1194                         %{ $unit{infestor}->{special}->[0] }, # neural parasite
1195                         range => $V lt v4.11.0 ? 9 : 8,
1196                 },
1197                 {
1198                         %{ $unit{infestor}->{special}->[1] }, # fungal growth
1199                         desc => 'for 4 seconds, immobilize enemy units in target area and deal '.($V lt v5.0.12 ? 30 : 25).' damage',
1200                         range => $V lt v5.0.12 ? 10 : 9,
1201                 },
1202                 {
1203                         name => 'Microbial Shroud',
1204                         abbr => 'ms',
1205                         desc => 'reduce damage from air by 50% to ground units in target area',
1206                         cost => $V lt v4.11.3 ? 100 : 75,
1207                         min => $V lt v4.11.3 ? 150 : undef,
1208                         gas => $V lt v4.11.3 ? 150 : undef,
1209                         build => $V lt v4.11.3 ? 79 : undef,
1210                         req => $V lt v4.11.3 ? 'Hive' : undef,
1211                         range => 9,
1212                         duration => 11,
1213                         radius => $V lt v4.11.3 ? 3 : 3.5,
1214                 },
1215                 $V ge v4.11.0 ? () : {
1216                         %{ $unit{infestor}->{special}->[2] }, # infested terran
1217                         attack => [
1218                                 {
1219                                         %{ $unit{infestor}->{special}->[2]->{attack}->[0] }, # rockets
1220                                         cooldown => $V lt v4.10.1 ? .95 : 1.14,
1221                                 },
1222                         ],
1223                 },
1224         ],
1225         upgrade => [
1226                 $V lt v5.0.12 ? $unit{infestor}->{upgrade}->[0] : (), # Pathogen Glands
1227         ],
1228 },
1229
1230 {
1231         % {$unit{nydus_worm} },
1232         min => $V lt v4.7.1 ? 100 : $V lt v4.11.0 ? 50 : 75, # Nydus Network costs 150/150
1233         gas => $V lt v4.7.1 ? 100 : $V lt v4.11.0 ? 50 : 75,
1234         cooldown => $V lt v4.11.0 ? 0 : 14, # Summon Nydus Worm
1235 },
1236
1237 {
1238         %{ $unit{swarm_host} },
1239         gas => 75,
1240         special => [
1241                 {
1242                         %{ $unit{swarm_host}->{special}->[0] }, # locust
1243                         hp => 50,
1244                         upgrade => [], # no flying
1245                 },
1246         ],
1247         upgrade => [],
1248 },
1249
1250 $unit{mutalisk},
1251 $unit{corruptor},
1252
1253 {
1254         %{ $unit{brood_lord} },
1255         speed => $V ge v5.0.12 ? 2.62 : $V ge v5.0.11 ? 2.24 : 1.97,
1256         special => [
1257                 {
1258                         %{ $unit{brood_lord}->{special}->[0] }, # broodling
1259                         attack => [
1260                                 {
1261                                         %{ $unit{brood_lord}->{special}->[0]->{attack}->[0] }, # claws
1262                                         cooldown => $V ge v5.0.12 ? .57 : .46,
1263                                 },
1264                         ],
1265                         hp => $V ge v5.0.12 ? 20 : 30,
1266                         speed => $V ge v5.0.12 ? 4.13 : 5.37,
1267                 },
1268                 $unit{brood_lord}->{special}->[1], # fz
1269         ],
1270 },
1271
1272 {
1273         %{ $unit{viper} },
1274         special => [
1275                 $unit{viper}->{special}->[0], # bc
1276                 $unit{viper}->{special}->[1], # ad
1277                 {
1278                         %{ $unit{viper}->{special}->[2] }, # consume
1279                         desc => 'leaches '.($V ge v5.0.12 ? 150 : 200).' life of friendly building over 20s to gain 50 energy',
1280                 },
1281         ],
1282 },
1283
1284 {
1285         %{ $unit{ultralisk} },
1286         min => $V ge v5.0.12 ? 275 : 300,
1287         armor => 2,
1288         size => $V ge v5.0.11 ? 1.75 : 2,
1289         upgrade => [
1290                 $unit{ultralisk}->{upgrade}->[0], # chitinous plating
1291                 {
1292                         name => 'Anabolic Synthesis',
1293                         min => 150,
1294                         gas => 150,
1295                         build => 42.85,
1296                         speed => $V lt v4.8.2 ? .41 : .82,
1297                         creep => -.215, # reverse speed increase
1298                 },
1299         ],
1300 },
1301
1302 ]