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;
32 .units th, .units td {
35 background: transparent;
40 border-top-style: dashed;
42 .units tr th:first-child {
45 .units tr:hover:not(.race) {
56 text-transform: uppercase;
58 .units thead th, .units tfoot th {
63 .unit-o {color: #C08} /* organic */
64 .unit-u {color: #44C} /* mechanic */
65 img.unit-o, img.unit-u {
67 vertical-align: middle;
73 .unit.unit-s {color: #770}
74 .unit.unit-m {color: #C70}
75 .unit.unit-l {color: #D22}
76 .hurt.unit-s::before {
80 .hurt.unit-l::before {
87 .hurtrel, .units .hurtrel {
95 .unit-detect::before {
99 vertical-align: super;
111 -moz-column-width: 20em;
112 -webkit-column-width: 20em;
126 -webkit-column-break-before: avoid;
132 my ($name, $id) = @_;
134 (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s ▼'
135 : '<a href="?%s">%s</a>',
136 $id && "order=$id", $name
139 :><table class="units">
142 <th><:= coltoggle('name', '') :></th>
143 <th class="val min"><img src="minerals.png" alt="min"></th>
144 <th class="val gas"><img src="gas.png" alt="gas"></th>
145 <th class="val time"><:= coltoggle(qw'build cost') :></th>
146 <th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
147 <th class="val unit-hp">HP</th>
148 <th class="val unit-shield">shield</th>
149 <th class="val unit-armor">armor</th>
150 <th class="val hurt" colspan="2">ground</th>
151 <th class="val hurt" colspan="2">air</th>
152 <th class="val unit-range">range</th>
153 <th class="val unit-sight">sight</th>
154 <th class="val unit-speed">speed</th>
155 <th class="unit-magic">specials</th>
159 my ($row, @elements) = @_;
163 $value = ref $value eq 'HASH' && $value->{$_} or last for @elements;
164 if (ref $value eq 'ARRAY') {
169 $min = $max = $value;
171 defined $min or return '';
173 if ($row->{upgrade}) {
174 for (@{ $row->{upgrade} }) {
175 my $increase = $_ or next;
176 $increase = ref $increase eq 'HASH' && $increase->{$_} or last for @elements;
177 $increase = $increase->[-1] if ref $increase eq 'ARRAY';
178 $max += $increase if $increase;
182 if ($elements[0] eq 'attack' and $elements[1] ne 'range' and $elements[2] eq 'cmp') {{
183 my $type = $row->{$elements[0]}->{$elements[1]}->{type} or next;
184 if ($type eq 'explosive') {
187 elsif ($type eq 'implosive') {
190 $min = int($min + .5); # round halves up
193 return $min == $max ? $min : "$min-$max";
197 my ($row, $area) = @_;
198 local $_ = $row->{attack}->{$area};
200 return '<td colspan="2" class="hurt">' unless $_;
202 my $tagbase = '<td class="val hurt';
203 if (ref $_ and $_->{type}) {
204 if ($_->{type} eq 'explosive') {
205 $tagbase .= ' unit-l';
207 elsif ($_->{type} eq 'implosive') {
208 $tagbase .= ' unit-s';
213 my $out = showrange($row, 'attack', $area, 'damage');
214 $out .= '<span class="unit-splash">+</span>' if $_->{splash};
215 $out .= '<td class="val hurt hurtrel">' . showrange($row, 'attack', $area, 'cmp');
216 return $tagbase . $out;
221 my $specials = $row->{special} or return '';
222 return join ' ', map {
223 sprintf '<span title="%s">%s</span>',
226 $_->{desc} ? ": $_->{desc}" : '',
227 $_->{range} ? sprintf(' (%s)', join ', ',
236 my $units = do 'sc-units.inc.pl';
237 die "Cannot open unit data: $_\n" for $! || $@ || ();
238 my $grouped = !exists $get{order};
239 if (exists $get{order}) {
241 if ($get{order} eq 'size') {
242 $_->{order} = $_->{unit}*8 + $_->{size} + $_->{hp}/512 + $_->{min}/8192 for @$units;
244 elsif ($get{order} eq 'cost') {
245 $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
248 $units->[$_]->{order} = $_ for 0 .. $#$units;
251 my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
253 my ($race, $cat) = ('', '');
256 printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
257 if $grouped and $race ne $_->{race};
258 $_->{cat} = $_->{race} if not $grouped;
259 my $sizechar = [qw/? s m l/]->[$_->{size}];
262 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
264 '<td class="val min">' . ($_->{min} || '0'),
265 '<td class="val gas">' . ($_->{gas} || ''),
266 '<td class="val time">' . sprintf('%.0f', $_->{build} || '0'),
267 sprintf('<td class="unit unit-%s">%s', $sizechar, ucfirst $sizechar),
268 '<td class="val unit">' . join('',
269 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
270 defined $_->{organic} && sprintf(
271 '<img class="unit-%s" src="s%s.png" alt="%s">',
272 $_->{organic} ? 'o' : 'u',
273 $_->{race} . ($_->{organic} ? 'o' : ''),
274 $_->{organic} ? 'o' : 'm'
277 '<td class="val unit-hp">' . $_->{hp},
278 '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
279 '<td class="val unit-armor">' . showrange($_, 'armor'),
280 showattack($_, 'ground'),
281 showattack($_, 'air'),
282 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
283 '<td class="val unit-sight">' . sprintf(
284 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
285 showrange($_, 'sight')
287 '<td class="val unit-speed">' . showrange($_, 'speed'),
288 '<td class="unit-magic">' . showmagic($_),
292 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
294 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
295 showattack($alt, 'ground'),
296 showattack($alt, 'air'),
297 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
298 '<td class="val unit-sight">' . sprintf(
299 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
300 showrange($alt, 'sight')
302 '<td class="val unit-speed">' . showrange($alt, 'speed'),
316 <dd>minerals+gas required to create one unit
318 <dd>relative time needed to create at least one unit
320 <dd><span class="unit unit-s">S</span>mall,
321 <span class="unit unit-m">M</span>edium,
322 or <span class="unit unit-l">L</span>arge unit damage
323 <dd>number of command points taken per unit
324 <dd><span class="unit unit-o">organic</span>/<span class="unit unit-u">mechanic</span> unit
326 total number of hitpoints (including shields)
328 <dd>percentage of HP in shields
329 <dd>shields always take full damage, irrelevant of unit size
330 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
333 <dd>can be increased by upto 3 at various facilities
334 <dd>each point decreases damage per hit by one, upto a minimum of ½
335 <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>
337 <dd>damage done per single attack against ground/air units
338 <dd>2nd column indicates relative amount of damage done in
339 <span title="the time in which a dragoon fires a shot">a certain
340 amount</span> of time
341 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
342 <dd><span class="hurt unit-l">explosive</span> damage does only
343 50% damage to small units, 75% to medium, 100% to large
344 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
345 25% to large, 50% medium, 100% to small units
347 <dd>range in which the unit detects other units
348 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
350 <dd>maximum range of weapon (note siege tank also has a minimum range)
352 <dd>relative speed of movement (when in full motion, startup speed ignored)
354 <dd>special abilities
355 <dd>parentheses () indicate that it needs to be researched first
356 <dd>hover for description
357 <dd>range is maximum range required to activate
358 <dd>cost is percentage of total energy lost
362 When two values are given (1-2), second value indicates attribute after all