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) {
55 .units thead th, .units tfoot th {
60 .unit-o {color: #C08} /* organic */
61 .unit-u {color: #44C} /* mechanic */
62 img.unit-o, img.unit-u {
64 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;
145 my ($name, $id) = @_;
147 (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s ▼'
148 : '<a href="?%s">%s</a>',
149 $id && "order=$id", $name
152 :><table class="units">
155 <th><:= coltoggle('name', '') :></th>
156 <th class="val min"><img src="/minerals.png" alt="min"></th>
157 <th class="val gas"><img src="/gas.png" alt="gas"></th>
158 <th class="val time"><:= coltoggle(qw'build cost') :></th>
159 <th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
160 <th class="val unit-hp">HP</th>
161 <th class="val unit-shield">shield</th>
162 <th class="val unit-armor">armor</th>
163 <th class="val hurt" colspan="2">ground</th>
164 <th class="val hurt" colspan="2">air</th>
165 <th class="val unit-range">range</th>
166 <th class="val unit-sight">sight</th>
167 <th class="val unit-speed">speed</th>
168 <th class="unit-magic">specials</th>
172 my ($row, @elements) = @_;
176 $value = ref $value eq 'HASH' && $value->{$_} or last for @elements;
177 if (ref $value eq 'ARRAY') {
182 $min = $max = $value;
184 defined $min or return '';
186 if ($row->{upgrade}) {
187 for (@{ $row->{upgrade} }) {
188 my $increase = $_ or next;
189 $increase = ref $increase eq 'HASH' && $increase->{$_} or last for @elements;
190 $increase = $increase->[-1] if ref $increase eq 'ARRAY';
191 $max += $increase if $increase;
195 if ($elements[0] eq 'attack' and $elements[1] ne 'range' and $elements[2] eq 'dps') {{
196 my $attack = $row->{ $elements[0] }->{ $elements[1] };
197 ref $attack or $attack = $row->{ $elements[0] }->{$attack}; # follow
198 my $type = $attack->{type} or next;
199 if ($type eq 'explosive') {
202 elsif ($type eq 'implosive') {
206 $_ = int($_ + .5) for $min, $max; # round halves up
208 return $min == $max ? $min : "$min-$max";
212 my ($row, $area) = @_;
213 local $_ = $row->{attack}->{$area};
215 # reference to another area
217 $_ = $row->{attack}->{$area};
220 return '<td colspan="2" class="hurt">' unless $_;
222 my $tagbase = '<td class="val hurt';
223 if (ref $_ and $_->{type}) {
224 if ($_->{type} eq 'explosive') {
225 $tagbase .= ' unit-l';
227 elsif ($_->{type} eq 'implosive') {
228 $tagbase .= ' unit-s';
233 my $out = showrange($row, 'attack', $area, 'damage');
234 $out .= '<span class="unit-splash">+</span>' if $_->{splash};
235 $out .= '<td class="val hurt hurtrel">' . showrange($row, 'attack', $area, 'dps');
236 return $tagbase . $out;
241 my $specials = $row->{special} or return '';
242 return join ' ', map {
243 sprintf '<span title="%s">%s</span>',
246 $_->{desc} ? ": $_->{desc}" : '',
247 $_->{range} ? sprintf(' (%s)', join ', ',
256 my $units = do 'sc-units.inc.pl';
257 die "Cannot open unit data: $_\n" for $@ || $! || ();
258 my $grouped = !exists $get{order};
259 if (exists $get{order}) {
261 if ($get{order} eq 'size') {
262 $_->{order} = $_->{unit}*8 + $_->{suit} + $_->{hp}/512 + $_->{min}/8192 for @$units;
264 elsif ($get{order} eq 'cost') {
265 $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
268 $units->[$_]->{order} = $_ for 0 .. $#$units;
271 my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
273 my ($race, $cat) = ('', '');
276 printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
277 if $grouped and $race ne $_->{race};
278 $_->{cat} = $_->{race} if not $grouped;
279 $_->{hp} += $_->{shield};
280 my $suitchar = [qw/? s m l/]->[$_->{suit}];
283 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
285 '<td class="val min">' . ($_->{min} || '0'),
286 '<td class="val gas">' . ($_->{gas} || ''),
287 sprintf('<td class="val time">%s%.0f',
288 !!$_->{base} && '<span class="unit-composed">+</span>',
291 sprintf('<td class="unit unit-%s">%s', $suitchar, ucfirst $suitchar),
292 '<td class="val unit">' . join('',
293 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
294 defined $_->{organic} && sprintf(
295 '<span class="unit-%s" title="%s">%s</span>',
296 $_->{organic} ? 'o' : 'u',
297 $_->{organic} ? 'organic' : 'mechanic',
298 $_->{organic} ? 'o' : 'm',
301 '<td class="val unit-hp">' . $_->{hp},
302 '<td class="val unit-shield">' . (
303 $_->{shield} ? sprintf('%.0f%%', 100 * $_->{shield} / $_->{hp}) : ' '
305 '<td class="val unit-armor">' . showrange($_, 'armor'),
306 showattack($_, 'ground'),
307 showattack($_, 'air'),
308 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
309 '<td class="val unit-sight">' . sprintf(
310 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
311 showrange($_, 'sight')
313 '<td class="val unit-speed">' . showrange($_, 'speed'),
314 '<td class="unit-magic">' . showmagic($_),
318 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
320 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
321 showattack($alt, 'ground'),
322 showattack($alt, 'air'),
323 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
324 '<td class="val unit-sight">' . sprintf(
325 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
326 showrange($alt, 'sight')
328 '<td class="val unit-speed">' . showrange($alt, 'speed'),
342 <dd>minerals+gas required to create one unit
343 <dd>includes total expenses if based on existing units
345 <dd>relative time needed to create at least one unit
346 <dd>excludes construction of dependencies such as buildings
347 and <span class="unit-composed">+</span>parent units
349 <dd>affected by <span class="unit unit-s">S</span>mall,
350 <span class="unit unit-m">M</span>edium,
351 or <span class="unit unit-l">L</span>arge unit damage
352 <dd>number of command points taken per unit
353 <dd><span class="unit unit-o">o</span>rganic/<span class="unit unit-u">m</span>echanic unit
355 total number of hitpoints (including shields)
357 <dd>percentage of HP in shields
358 <dd>shields always take full damage, irrelevant of unit size
359 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
362 <dd>can be increased by upto 3 at various facilities
363 <dd>each point decreases damage per hit by one, upto a minimum of ½
364 <dd>reduction applies to initial damage, before size penalties <small>(so a plasma hit of 12 to 4 armor large deals 2 damage, not ½)</small>
366 <dd>damage done per single attack against ground/air units
367 <dd>2nd column indicates relative amount of damage done in
368 <span title="the time in which a dragoon fires a shot">a certain
369 amount</span> of time
370 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
371 <dd><span class="hurt unit-l">explosive</span> damage does only
372 50% damage to small units, 75% to medium, 100% to large
373 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
374 25% to large, 50% medium, 100% to small units
376 <dd>range in which the unit detects other units
377 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
379 <dd>maximum range of weapon (note siege tank also has a minimum range)
381 <dd>relative speed of movement (when in full motion, startup speed ignored)
383 <dd>special abilities
384 <dd>parentheses () indicate that it needs to be researched first
385 <dd>hover for description
386 <dd>range is maximum range required to activate
387 <dd>cost is percentage of total energy lost
391 When two values are given (1-2), second value indicates attribute after all