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;
70 .unit.unit-s {color: #770}
71 .unit.unit-m {color: #C70}
72 .unit.unit-l {color: #D22}
73 .hurt.unit-s::before {
77 .hurt.unit-l::before {
84 .hurtrel, .units .hurtrel {
92 .unit-detect::before {
96 vertical-align: super;
119 -webkit-column-break-before: avoid;
134 my ($name, $id) = @_;
136 (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s ▼'
137 : '<a href="?%s">%s</a>',
138 $id && "order=$id", $name
141 :><table class="units">
144 <th><:= coltoggle('name', '') :></th>
145 <th class="val min"><img src="/minerals.png" alt="min"></th>
146 <th class="val gas"><img src="/gas.png" alt="gas"></th>
147 <th class="val time"><:= coltoggle(qw'build cost') :></th>
148 <th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
149 <th class="val unit-hp">HP</th>
150 <th class="val unit-shield">shield</th>
151 <th class="val unit-armor">armor</th>
152 <th class="val hurt" colspan="2">ground</th>
153 <th class="val hurt" colspan="2">air</th>
154 <th class="val unit-range">range</th>
155 <th class="val unit-sight">sight</th>
156 <th class="val unit-speed">speed</th>
157 <th class="unit-magic">specials</th>
161 my ($row, @elements) = @_;
165 $value = ref $value eq 'HASH' && $value->{$_} or last for @elements;
166 if (ref $value eq 'ARRAY') {
171 $min = $max = $value;
173 defined $min or return '';
175 if ($row->{upgrade}) {
176 for (@{ $row->{upgrade} }) {
177 my $increase = $_ or next;
178 $increase = ref $increase eq 'HASH' && $increase->{$_} or last for @elements;
179 $increase = $increase->[-1] if ref $increase eq 'ARRAY';
180 $max += $increase if $increase;
184 if ($elements[0] eq 'attack' and $elements[1] ne 'range' and $elements[2] eq 'cmp') {{
185 my $type = $row->{$elements[0]}->{$elements[1]}->{type} or next;
186 if ($type eq 'explosive') {
189 elsif ($type eq 'implosive') {
192 $min = int($min + .5); # round halves up
195 return $min == $max ? $min : "$min-$max";
199 my ($row, $area) = @_;
200 local $_ = $row->{attack}->{$area};
202 return '<td colspan="2" class="hurt">' unless $_;
204 my $tagbase = '<td class="val hurt';
205 if (ref $_ and $_->{type}) {
206 if ($_->{type} eq 'explosive') {
207 $tagbase .= ' unit-l';
209 elsif ($_->{type} eq 'implosive') {
210 $tagbase .= ' unit-s';
215 my $out = showrange($row, 'attack', $area, 'damage');
216 $out .= '<span class="unit-splash">+</span>' if $_->{splash};
217 $out .= '<td class="val hurt hurtrel">' . showrange($row, 'attack', $area, 'cmp');
218 return $tagbase . $out;
223 my $specials = $row->{special} or return '';
224 return join ' ', map {
225 sprintf '<span title="%s">%s</span>',
228 $_->{desc} ? ": $_->{desc}" : '',
229 $_->{range} ? sprintf(' (%s)', join ', ',
238 my $units = do 'sc-units.inc.pl';
239 die "Cannot open unit data: $_\n" for $@ || $! || ();
240 my $grouped = !exists $get{order};
241 if (exists $get{order}) {
243 if ($get{order} eq 'size') {
244 $_->{order} = $_->{unit}*8 + $_->{size} + $_->{hp}/512 + $_->{min}/8192 for @$units;
246 elsif ($get{order} eq 'cost') {
247 $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
250 $units->[$_]->{order} = $_ for 0 .. $#$units;
253 my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
255 my ($race, $cat) = ('', '');
258 printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
259 if $grouped and $race ne $_->{race};
260 $_->{cat} = $_->{race} if not $grouped;
261 my $sizechar = [qw/? s m l/]->[$_->{size}];
264 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
266 '<td class="val min">' . ($_->{min} || '0'),
267 '<td class="val gas">' . ($_->{gas} || ''),
268 '<td class="val time">' . sprintf('%.0f', $_->{build} || '0'),
269 sprintf('<td class="unit unit-%s">%s', $sizechar, ucfirst $sizechar),
270 '<td class="val unit">' . join('',
271 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
272 defined $_->{organic} && sprintf(
273 '<span class="unit-%s" title="%s">%s</span>',
274 $_->{organic} ? 'o' : 'u',
275 $_->{organic} ? 'organic' : 'mechanic',
276 $_->{organic} ? 'o' : 'm',
279 '<td class="val unit-hp">' . $_->{hp},
280 '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
281 '<td class="val unit-armor">' . showrange($_, 'armor'),
282 showattack($_, 'ground'),
283 showattack($_, 'air'),
284 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
285 '<td class="val unit-sight">' . sprintf(
286 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
287 showrange($_, 'sight')
289 '<td class="val unit-speed">' . showrange($_, 'speed'),
290 '<td class="unit-magic">' . showmagic($_),
294 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
296 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
297 showattack($alt, 'ground'),
298 showattack($alt, 'air'),
299 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
300 '<td class="val unit-sight">' . sprintf(
301 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
302 showrange($alt, 'sight')
304 '<td class="val unit-speed">' . showrange($alt, 'speed'),
318 <dd>minerals+gas required to create one unit
320 <dd>relative time needed to create at least one unit
322 <dd><span class="unit unit-s">S</span>mall,
323 <span class="unit unit-m">M</span>edium,
324 or <span class="unit unit-l">L</span>arge unit damage
325 <dd>number of command points taken per unit
326 <dd><span class="unit unit-o">organic</span>/<span class="unit unit-u">mechanic</span> unit
328 total number of hitpoints (including shields)
330 <dd>percentage of HP in shields
331 <dd>shields always take full damage, irrelevant of unit size
332 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
335 <dd>can be increased by upto 3 at various facilities
336 <dd>each point decreases damage per hit by one, upto a minimum of ½
337 <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>
339 <dd>damage done per single attack against ground/air units
340 <dd>2nd column indicates relative amount of damage done in
341 <span title="the time in which a dragoon fires a shot">a certain
342 amount</span> of time
343 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
344 <dd><span class="hurt unit-l">explosive</span> damage does only
345 50% damage to small units, 75% to medium, 100% to large
346 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
347 25% to large, 50% medium, 100% to small units
349 <dd>range in which the unit detects other units
350 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
352 <dd>maximum range of weapon (note siege tank also has a minimum range)
354 <dd>relative speed of movement (when in full motion, startup speed ignored)
356 <dd>special abilities
357 <dd>parentheses () indicate that it needs to be researched first
358 <dd>hover for description
359 <dd>range is maximum range required to activate
360 <dd>cost is percentage of total energy lost
364 When two values are given (1-2), second value indicates attribute after all