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 $type = $row->{$elements[0]}->{$elements[1]}->{type} or next;
197 if ($type eq 'explosive') {
200 elsif ($type eq 'implosive') {
204 $_ = int($_ + .5) for $min, $max; # round halves up
206 return $min == $max ? $min : "$min-$max";
210 my ($row, $area) = @_;
211 local $_ = $row->{attack}->{$area};
213 return '<td colspan="2" class="hurt">' unless $_;
215 my $tagbase = '<td class="val hurt';
216 if (ref $_ and $_->{type}) {
217 if ($_->{type} eq 'explosive') {
218 $tagbase .= ' unit-l';
220 elsif ($_->{type} eq 'implosive') {
221 $tagbase .= ' unit-s';
226 my $out = showrange($row, 'attack', $area, 'damage');
227 $out .= '<span class="unit-splash">+</span>' if $_->{splash};
228 $out .= '<td class="val hurt hurtrel">' . showrange($row, 'attack', $area, 'dps');
229 return $tagbase . $out;
234 my $specials = $row->{special} or return '';
235 return join ' ', map {
236 sprintf '<span title="%s">%s</span>',
239 $_->{desc} ? ": $_->{desc}" : '',
240 $_->{range} ? sprintf(' (%s)', join ', ',
249 my $units = do 'sc-units.inc.pl';
250 die "Cannot open unit data: $_\n" for $@ || $! || ();
251 my $grouped = !exists $get{order};
252 if (exists $get{order}) {
254 if ($get{order} eq 'size') {
255 $_->{order} = $_->{unit}*8 + $_->{suit} + $_->{hp}/512 + $_->{min}/8192 for @$units;
257 elsif ($get{order} eq 'cost') {
258 $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
261 $units->[$_]->{order} = $_ for 0 .. $#$units;
264 my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
266 my ($race, $cat) = ('', '');
269 printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
270 if $grouped and $race ne $_->{race};
271 $_->{cat} = $_->{race} if not $grouped;
272 $_->{hp} += $_->{shield};
273 my $suitchar = [qw/? s m l/]->[$_->{suit}];
276 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
278 '<td class="val min">' . ($_->{min} || '0'),
279 '<td class="val gas">' . ($_->{gas} || ''),
280 sprintf('<td class="val time">%s%.0f',
281 !!$_->{base} && '<span class="unit-composed">+</span>',
284 sprintf('<td class="unit unit-%s">%s', $suitchar, ucfirst $suitchar),
285 '<td class="val unit">' . join('',
286 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
287 defined $_->{organic} && sprintf(
288 '<span class="unit-%s" title="%s">%s</span>',
289 $_->{organic} ? 'o' : 'u',
290 $_->{organic} ? 'organic' : 'mechanic',
291 $_->{organic} ? 'o' : 'm',
294 '<td class="val unit-hp">' . $_->{hp},
295 '<td class="val unit-shield">' . (
296 $_->{shield} ? sprintf('%.0f%%', 100 * $_->{shield} / $_->{hp}) : ' '
298 '<td class="val unit-armor">' . showrange($_, 'armor'),
299 showattack($_, 'ground'),
300 showattack($_, 'air'),
301 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
302 '<td class="val unit-sight">' . sprintf(
303 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
304 showrange($_, 'sight')
306 '<td class="val unit-speed">' . showrange($_, 'speed'),
307 '<td class="unit-magic">' . showmagic($_),
311 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
313 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
314 showattack($alt, 'ground'),
315 showattack($alt, 'air'),
316 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
317 '<td class="val unit-sight">' . sprintf(
318 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
319 showrange($alt, 'sight')
321 '<td class="val unit-speed">' . showrange($alt, 'speed'),
335 <dd>minerals+gas required to create one unit
336 <dd>includes total expenses if based on existing units
338 <dd>relative time needed to create at least one unit
339 <dd>excludes construction of dependencies such as buildings
340 and <span class="unit-composed">+</span>parent units
342 <dd>affected by <span class="unit unit-s">S</span>mall,
343 <span class="unit unit-m">M</span>edium,
344 or <span class="unit unit-l">L</span>arge unit damage
345 <dd>number of command points taken per unit
346 <dd><span class="unit unit-o">o</span>rganic/<span class="unit unit-u">m</span>echanic unit
348 total number of hitpoints (including shields)
350 <dd>percentage of HP in shields
351 <dd>shields always take full damage, irrelevant of unit size
352 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
355 <dd>can be increased by upto 3 at various facilities
356 <dd>each point decreases damage per hit by one, upto a minimum of ½
357 <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>
359 <dd>damage done per single attack against ground/air units
360 <dd>2nd column indicates relative amount of damage done in
361 <span title="the time in which a dragoon fires a shot">a certain
362 amount</span> of time
363 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
364 <dd><span class="hurt unit-l">explosive</span> damage does only
365 50% damage to small units, 75% to medium, 100% to large
366 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
367 25% to large, 50% medium, 100% to small units
369 <dd>range in which the unit detects other units
370 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
372 <dd>maximum range of weapon (note siege tank also has a minimum range)
374 <dd>relative speed of movement (when in full motion, startup speed ignored)
376 <dd>special abilities
377 <dd>parentheses () indicate that it needs to be researched first
378 <dd>hover for description
379 <dd>range is maximum range required to activate
380 <dd>cost is percentage of total energy lost
384 When two values are given (1-2), second value indicates attribute after all