4 title => 'starcraft unit cheat sheet',
7 'Reference of StarCraft unit properties,'
8 . ' comparing various statistics of all the units in Brood War'
9 . ' including costs, damage, defense, speed, ranges, and abilities.',
12 starcraft game unit statistics stats comparison table sheet cheat
13 reference software attributes properties
15 stylesheet => [qw'light'],
19 <h1>StarCraft units</h1>
22 Unit properties as seen or measured in Brood War
23 <span title="no known changes as of v1.16.1">version≥1.08</span>.
26 <style type="text/css">
28 border-collapse: separate;
33 .units th, .units td {
36 background: transparent;
41 border-top-style: dashed;
43 .units tr th:first-child {
46 .units tr:hover:not(.race) {
57 text-transform: uppercase;
59 .units thead th, .units tfoot th {
64 .unit-o {color: #C08} /* organic */
65 .unit-u {color: #44C} /* mechanic */
66 img.unit-o, img.unit-u {
68 vertical-align: middle;
74 .unit.unit-s {color: #770}
75 .unit.unit-m {color: #C70}
76 .unit.unit-l {color: #D22}
77 .hurt.unit-s::before {
81 .hurt.unit-l::before {
88 .hurtrel, .units .hurtrel {
96 .unit-detect::before {
100 vertical-align: super;
123 -webkit-column-break-before: avoid;
138 my ($name, $id) = @_;
140 (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s ▼'
141 : '<a href="?%s">%s</a>',
142 $id && "order=$id", $name
145 :><table class="units">
148 <th><:= coltoggle('name', '') :></th>
149 <th class="val min"><img src="/minerals.png" alt="min"></th>
150 <th class="val gas"><img src="/gas.png" alt="gas"></th>
151 <th class="val time"><:= coltoggle(qw'build cost') :></th>
152 <th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
153 <th class="val unit-hp">HP</th>
154 <th class="val unit-shield">shield</th>
155 <th class="val unit-armor">armor</th>
156 <th class="val hurt" colspan="2">ground</th>
157 <th class="val hurt" colspan="2">air</th>
158 <th class="val unit-range">range</th>
159 <th class="val unit-sight">sight</th>
160 <th class="val unit-speed">speed</th>
161 <th class="unit-magic">specials</th>
165 my ($row, @elements) = @_;
169 $value = ref $value eq 'HASH' && $value->{$_} or last for @elements;
170 if (ref $value eq 'ARRAY') {
175 $min = $max = $value;
177 defined $min or return '';
179 if ($row->{upgrade}) {
180 for (@{ $row->{upgrade} }) {
181 my $increase = $_ or next;
182 $increase = ref $increase eq 'HASH' && $increase->{$_} or last for @elements;
183 $increase = $increase->[-1] if ref $increase eq 'ARRAY';
184 $max += $increase if $increase;
188 if ($elements[0] eq 'attack' and $elements[1] ne 'range' and $elements[2] eq 'cmp') {{
189 my $type = $row->{$elements[0]}->{$elements[1]}->{type} or next;
190 if ($type eq 'explosive') {
193 elsif ($type eq 'implosive') {
196 $min = int($min + .5); # round halves up
199 return $min == $max ? $min : "$min-$max";
203 my ($row, $area) = @_;
204 local $_ = $row->{attack}->{$area};
206 return '<td colspan="2" class="hurt">' unless $_;
208 my $tagbase = '<td class="val hurt';
209 if (ref $_ and $_->{type}) {
210 if ($_->{type} eq 'explosive') {
211 $tagbase .= ' unit-l';
213 elsif ($_->{type} eq 'implosive') {
214 $tagbase .= ' unit-s';
219 my $out = showrange($row, 'attack', $area, 'damage');
220 $out .= '<span class="unit-splash">+</span>' if $_->{splash};
221 $out .= '<td class="val hurt hurtrel">' . showrange($row, 'attack', $area, 'cmp');
222 return $tagbase . $out;
227 my $specials = $row->{special} or return '';
228 return join ' ', map {
229 sprintf '<span title="%s">%s</span>',
232 $_->{desc} ? ": $_->{desc}" : '',
233 $_->{range} ? sprintf(' (%s)', join ', ',
242 my $units = do 'sc-units.inc.pl';
243 die "Cannot open unit data: $_\n" for $! || $@ || ();
244 my $grouped = !exists $get{order};
245 if (exists $get{order}) {
247 if ($get{order} eq 'size') {
248 $_->{order} = $_->{unit}*8 + $_->{size} + $_->{hp}/512 + $_->{min}/8192 for @$units;
250 elsif ($get{order} eq 'cost') {
251 $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
254 $units->[$_]->{order} = $_ for 0 .. $#$units;
257 my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
259 my ($race, $cat) = ('', '');
262 printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
263 if $grouped and $race ne $_->{race};
264 $_->{cat} = $_->{race} if not $grouped;
265 my $sizechar = [qw/? s m l/]->[$_->{size}];
268 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
270 '<td class="val min">' . ($_->{min} || '0'),
271 '<td class="val gas">' . ($_->{gas} || ''),
272 '<td class="val time">' . sprintf('%.0f', $_->{build} || '0'),
273 sprintf('<td class="unit unit-%s">%s', $sizechar, ucfirst $sizechar),
274 '<td class="val unit">' . join('',
275 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
276 defined $_->{organic} && sprintf(
277 '<span class="unit-%s" title="%s">%s</span>',
278 $_->{organic} ? 'o' : 'u',
279 $_->{organic} ? 'organic' : 'mechanic',
280 $_->{organic} ? 'o' : 'm',
283 '<td class="val unit-hp">' . $_->{hp},
284 '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
285 '<td class="val unit-armor">' . showrange($_, 'armor'),
286 showattack($_, 'ground'),
287 showattack($_, 'air'),
288 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
289 '<td class="val unit-sight">' . sprintf(
290 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
291 showrange($_, 'sight')
293 '<td class="val unit-speed">' . showrange($_, 'speed'),
294 '<td class="unit-magic">' . showmagic($_),
298 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
300 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
301 showattack($alt, 'ground'),
302 showattack($alt, 'air'),
303 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
304 '<td class="val unit-sight">' . sprintf(
305 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
306 showrange($alt, 'sight')
308 '<td class="val unit-speed">' . showrange($alt, 'speed'),
322 <dd>minerals+gas required to create one unit
324 <dd>relative time needed to create at least one unit
326 <dd><span class="unit unit-s">S</span>mall,
327 <span class="unit unit-m">M</span>edium,
328 or <span class="unit unit-l">L</span>arge unit damage
329 <dd>number of command points taken per unit
330 <dd><span class="unit unit-o">organic</span>/<span class="unit unit-u">mechanic</span> unit
332 total number of hitpoints (including shields)
334 <dd>percentage of HP in shields
335 <dd>shields always take full damage, irrelevant of unit size
336 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
339 <dd>can be increased by upto 3 at various facilities
340 <dd>each point decreases damage per hit by one, upto a minimum of ½
341 <dd>reduction applies to initial damage, before size penalties <small>(so a large plasma hit of 12 to 4 armor deals 2 damage, not ½)</small>
343 <dd>damage done per single attack against ground/air units
344 <dd>2nd column indicates relative amount of damage done in
345 <span title="the time in which a dragoon fires a shot">a certain
346 amount</span> of time
347 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
348 <dd><span class="hurt unit-l">explosive</span> damage does only
349 50% damage to small units, 75% to medium, 100% to large
350 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
351 25% to large, 50% medium, 100% to small units
353 <dd>range in which the unit detects other units
354 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
356 <dd>maximum range of weapon (note siege tank also has a minimum range)
358 <dd>relative speed of movement (when in full motion, startup speed ignored)
360 <dd>special abilities
361 <dd>parentheses () indicate that it needs to be researched first
362 <dd>hover for description
363 <dd>range is maximum range required to activate
364 <dd>cost is percentage of total energy lost
368 When two values are given (1-2), second value indicates attribute after all