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 'cmp') {{
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, 'cmp');
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 my $suitchar = [qw/? s m l/]->[$_->{suit}];
275 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
277 '<td class="val min">' . ($_->{min} || '0'),
278 '<td class="val gas">' . ($_->{gas} || ''),
279 sprintf('<td class="val time">%s%.0f',
280 !!$_->{base} && '<span class="unit-composed">+</span>',
283 sprintf('<td class="unit unit-%s">%s', $suitchar, ucfirst $suitchar),
284 '<td class="val unit">' . join('',
285 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
286 defined $_->{organic} && sprintf(
287 '<span class="unit-%s" title="%s">%s</span>',
288 $_->{organic} ? 'o' : 'u',
289 $_->{organic} ? 'organic' : 'mechanic',
290 $_->{organic} ? 'o' : 'm',
293 '<td class="val unit-hp">' . $_->{hp},
294 '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
295 '<td class="val unit-armor">' . showrange($_, 'armor'),
296 showattack($_, 'ground'),
297 showattack($_, 'air'),
298 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
299 '<td class="val unit-sight">' . sprintf(
300 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
301 showrange($_, 'sight')
303 '<td class="val unit-speed">' . showrange($_, 'speed'),
304 '<td class="unit-magic">' . showmagic($_),
308 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
310 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
311 showattack($alt, 'ground'),
312 showattack($alt, 'air'),
313 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
314 '<td class="val unit-sight">' . sprintf(
315 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
316 showrange($alt, 'sight')
318 '<td class="val unit-speed">' . showrange($alt, 'speed'),
332 <dd>minerals+gas required to create one unit
333 <dd>includes total expenses if based on existing units
335 <dd>relative time needed to create at least one unit
336 <dd>excludes construction of dependencies such as buildings
337 and <span class="unit-composed">+</span>parent units
339 <dd>affected by <span class="unit unit-s">S</span>mall,
340 <span class="unit unit-m">M</span>edium,
341 or <span class="unit unit-l">L</span>arge unit damage
342 <dd>number of command points taken per unit
343 <dd><span class="unit unit-o">o</span>rganic/<span class="unit unit-u">m</span>echanic unit
345 total number of hitpoints (including shields)
347 <dd>percentage of HP in shields
348 <dd>shields always take full damage, irrelevant of unit size
349 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
352 <dd>can be increased by upto 3 at various facilities
353 <dd>each point decreases damage per hit by one, upto a minimum of ½
354 <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>
356 <dd>damage done per single attack against ground/air units
357 <dd>2nd column indicates relative amount of damage done in
358 <span title="the time in which a dragoon fires a shot">a certain
359 amount</span> of time
360 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
361 <dd><span class="hurt unit-l">explosive</span> damage does only
362 50% damage to small units, 75% to medium, 100% to large
363 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
364 25% to large, 50% medium, 100% to small units
366 <dd>range in which the unit detects other units
367 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
369 <dd>maximum range of weapon (note siege tank also has a minimum range)
371 <dd>relative speed of movement (when in full motion, startup speed ignored)
373 <dd>special abilities
374 <dd>parentheses () indicate that it needs to be researched first
375 <dd>hover for description
376 <dd>range is maximum range required to activate
377 <dd>cost is percentage of total energy lost
381 When two values are given (1-2), second value indicates attribute after all