index: release v1.18 with only altgr index linked
[sheet.git] / sc.plp
1 <(common.inc.plp)><:
2 use List::Util qw(max sum);
3
4 my %scvers = (
5         bw => {
6                 name => 'Brood War',
7                 title => 'starcraft',
8                 game => 'StarCraft BW',
9                 major => 1,
10         },
11         hots => {
12                 name => 'Heart of the Swarm',
13                 title => 'starcraft2 hots',
14                 game => 'StarCraft II HotS',
15                 major => 2,
16         },
17         lotv => {
18                 name => 'Legacy of the Void',
19                 title => 'starcraft2 lotv',
20                 game => 'StarCraft II LotV',
21                 major => 2,
22         },
23         index => 'bw',
24         1     => 'bw',
25         2     => 'lotv',
26 );
27
28 my $requestver = $scvers{$Request ||= 'index'}
29         or Html(), Abort("Requested version <q>$Request</q> not available", '404 request not found');
30
31 if (ref $requestver ne 'HASH') {
32         $header{Location} = "/sc/$requestver";
33         Abort("Canonical URL for $Request is at $requestver", '302 subpage alias');
34 }
35
36 my %scver = %{$requestver};
37 my $datafile = "sc-units-$Request";
38
39 Html({
40         title => "$scver{title} unit cheat sheet",
41         version => '1.4',
42         description => [
43                 "Reference of $scver{game} unit properties,"
44                 . " comparing various statistics of all the units in $scver{name}"
45                 . ' including costs, damage, defense, speed, ranges, and abilities.',
46         ],
47         keywords => [
48                 qw'
49                 starcraft game unit statistics stats comparison table sheet cheat
50                 reference software attributes properties patch attribute multiplayer
51                 ',
52                 $scver{major} < 2 ? qw' bw broodwar brood war ' :
53                 qw' starcraft2 lotv hots wol ',
54         ],
55         stylesheet => [qw( light dark )],
56         raw => '<link rel="stylesheet" type="text/css" media="all" href="/sc.css?1.2">',
57         data => ["$datafile.inc.pl"],
58 });
59
60 say "<h1>$scver{game} units</h1>\n";
61
62 my $units = Data($datafile);
63 my $patch = shift @{$units}
64         or Abort("Cannot open unit data: metadata not found", 501);
65
66 say "<p>Unit properties as seen or measured in $scver{name}\n$patch.";
67 say "Also see the $_ tables." for join(' and ',
68         (showlink('StarCraft 2: LotV', '/sc/lotv'))    x ($Request ne 'lotv'),
69         (showlink(             'HotS', '/sc/hots'))    x ($Request ne 'hots'),
70         (showlink('original SC: Brood War', '/sc/bw')) x ($Request ne 'bw'),
71 );
72 say "</p>\n";
73
74 sub addupgrade {
75         my ($ref, $increase, $org) = @_;
76         if (ref $increase eq 'HASH') {
77                 addupgrade(\${$ref}->{$_}, $increase->{$_}, $org->{$_}) for keys %{$increase};
78         }
79         elsif (ref $increase eq 'ARRAY') {
80                 addupgrade(\${$ref}->[$_], $increase->[$_], $org->[$_]) for 0 .. $#{$increase};
81         }
82         ${$ref} //= $org;
83         ${$ref} += $increase if $increase =~ /^-?[0-9.]+/;
84 }
85
86 for my $unit (@{$units}) {
87         for my $upgrade (@{ $unit->{upgrade} }) {
88                 while (my ($col, $increase) = each %{$upgrade}) {
89                         defined $unit->{$col} or next;
90                         addupgrade(\$unit->{upgraded}->{$col}, $increase, $unit->{$col});
91                 }
92         }
93         for my $special (@{ $unit->{special} }) {
94                 for my $upgrade (@{ $special->{upgrade} }) {
95                         while (my ($col, $increase) = each %{$upgrade}) {
96                                 defined $special->{$col} or next;
97                                 addupgrade(\$special->{upgraded}->{$col}, $increase, $special->{$col});
98                         }
99                 }
100         }
101 }
102
103 sub coltoggle {
104         my ($name, $id, $nolink) = @_;
105         return "$name ▼" if defined $get{order} ? $get{order} eq $id : !$id;
106         return $name if $nolink;
107         return showlink($name, '?'.($id && "order=$id"));
108 }
109 :><table class="units">
110 <thead><tr>
111         <th><:= coltoggle(exists $get{order} ? 'race' : 'source' => '') :></th>
112         <th class="unit-name"><:= coltoggle(name => 'name') :></th>
113         <th class="val unit-min" title=minerals><:= coltoggle(cost => 'cost') :></th>
114         <th class="val unit-gas">gas</th>
115         <th class="val time"><:= coltoggle(build => 'build') :></th>
116         <th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
117         <th class="unit unit-attr" colspan="2">attr</th>
118         <th class="val unit-hp"><:= coltoggle(HP => 'hp') :></th>
119         <th class="val unit-shield">shield</th>
120         <th class="val unit-armor" title="armor">⛨</th>
121         <th class="val hurt"><:= coltoggle(attack => 'attack') :></th>
122         <th class="hurt hurtrel">dps</th>
123         <th class="val unit-range" colspan=3>range</th>
124         <th class="val unit-sight">sight</th>
125         <th class="val unit-speed"><:= coltoggle(speed => 'speed') :></th>
126         <th class="unit-magic">specials</th>
127 </tr></thead>
128 <:
129 sub showrange {
130         my ($min, $max) = @_;
131         return '' if not defined $min;
132         return $min || '-' if !$max or $min == $max;
133         return "$min-$max";
134 }
135
136 sub showrangeint {
137         $_ &&= int($_ + .5) for @_;  # round halves up
138         return showrange(@_);
139 }
140
141         sub showcost {
142                 my ($row, $unit) = @_;
143                 return join(' ',
144                         sprintf('cost %s%%', join '-',
145                                 map { $_ && sprintf '%.0f', 100 * $row->{cost} / $_ } grep { defined $_ }
146                                 $unit->{energy},
147                                 $unit->{upgraded}->{energy},
148                                 $unit->{capacity},
149                                 $unit->{upgraded}->{capacity},
150                         ),
151                         !defined $row->{maint} ? () : sprintf('+%s%%/s', join '-',
152                                 map { sprintf '%.1f', 100 * $row->{maint} / $_ } grep $_,
153                                 $unit->{capacity},
154                                 $unit->{upgraded}->{capacity},
155                         ),
156                 );
157         }
158
159         sub showattack {
160                 my ($row, $area) = @_;
161                 my $attack = $row->{attack}->[$area]
162                         or return '<td colspan=5 class="hurt">';
163
164                 my $upattack = $row->{upgraded}->{attack}->[$area];
165                 my $damage = $attack->{damage};
166                 my $maxdamage = $upattack->{damage} // $damage;
167                 $maxdamage += ($upattack->{upgrade} // $attack->{upgrade}) * 3;
168
169                 my $out = '<td class="val hurt">';
170                 $out .= sprintf '<span title="%s">¤</span> ', showcost($attack, $row)
171                         if $attack->{cost};
172                 $out .= sprintf('<small>%s× </small>',
173                         showrangeint($attack->{count}, $upattack->{count}),
174                 ) if $attack->{count} > 1;
175                 $out .= '<span class="unit-l" title="explosive">*</span>'
176                         if $attack->{type} eq 'explosive';
177                 $out .= '<span class="unit-s" title="implosive">~</span>'
178                         if $attack->{type} eq 'implosive';
179         if (my @bonus = sort grep { !/^-/ } keys %{ $attack->{bonus} }) {
180                 $out .= sprintf('<span class="%s" title="%s">&ge;</span>',
181                         (
182                                 $_ eq 'light' ? 'unit-s' :
183                                 $_ eq 'armored' ? 'unit-l' :
184                                 $_ eq 'organic' ? 'unit-o' :
185                                 $_ eq 'massive' ? 'unit-h' :
186                                 $_ eq 'shields' ? 'unit-shield' :
187                                 $_ eq 'structure' ? 'unit-x' :
188                                 '',
189                         ),
190                         (
191                                 sprintf('+%s vs %s',
192                                         showrangeint(
193                                                 $attack->{bonus}->{$_},
194                                                 ($upattack->{bonus} // $attack->{bonus})->{$_}
195                                                         + ($upattack->{bonus} // $attack->{bonus})->{"-$_"} * 3,
196                                         ),
197                                         $_,
198                                 ),
199                         ),
200                 ) for @bonus;
201         }
202                 $out .= '<span class="unit-pdd" title="projectile">•</span>'
203                         if $attack->{type} eq 'projectile';
204
205                 $out .= sprintf '<span title="%s">', $attack->{name} if $attack->{name};
206                 $out .= showrangeint($damage, $maxdamage);
207                 $out .= '</span>' if $attack->{name};
208                 $out .= sprintf('<span class="unit-splash" title="%s">%s</span>',
209                         $attack->{splash} eq 'line' ? ('linear', '+') : ('splash', '⁜')
210                 ) if $attack->{splash};
211
212                 $out .= '<td class="val hurt hurtrel">';
213                 if ($attack->{dps}) {
214                         # precalculated dps, do not touch
215                         $out .= showrangeint($attack->{dps}->[0],
216                                 $upattack->{dps}->[-1] // $attack->{dps}->[-1]
217                         );
218                 }
219                 elsif ($attack->{cooldown}) {
220                         if (my $type = $attack->{type}) {
221                                 if ($type eq 'explosive') {
222                                         $damage /= 2;
223                                 }
224                                 elsif ($type eq 'implosive') {
225                                         $damage /= 4;
226                                 }
227                         }
228                         $damage *= ($attack->{count} // 1) / $attack->{cooldown};
229                         if (my $bonus = $upattack->{bonus} // $attack->{bonus}) {
230                                 $maxdamage += $_ for max(
231                                         map { $bonus->{$_} + $bonus->{"-$_"} * 3 }
232                                         grep { !/^-/ } keys %{$bonus}
233                                 );
234                         }
235                         $maxdamage *= ($upattack->{count} // $attack->{count} // 1)
236                                     / ($upattack->{cooldown} // $attack->{cooldown});
237                         $out .= showrangeint($damage, $maxdamage);
238                 }
239
240                 $out .= '<td class="unit hurt-g">' . '▽' x !!($attack->{anti} & 1);
241                 $out .= '<td class="unit hurt-a">' . '△' x !!($attack->{anti} & 2);
242
243                 $out .= '<td class="val unit-range">' .
244                         showrangeint($attack->{range}, $upattack->{range});
245
246                 return $out;
247         }
248
249         sub showmagic {
250                 my ($row) = @_;
251                 my $specials = $row->{special} or return '';
252                 return join ' ', map {
253                         sprintf '<span%s title="%s">%s</span>',
254                                 join('',
255                                         $_->{duration} < 0 && ' class="magic-perma"',
256                                         $_->{detect} && ' class="unit-detect"',
257                                 ),
258                                 join('',
259                                         $_->{name} // $_->{alt},
260                                         $_->{desc} ? ": $_->{desc}" : '',
261                                         (map { $_ && " ($_)" } join ', ',
262                                                 #TODO: apply upgrades
263                                                 $_->{range} ? "range $_->{range}" : (),
264                                                 $_->{cost} ? showcost($_, $row) :
265                                                 $_->{cooldown} ? "cooldown $_->{cooldown}s" : (),
266                                         ),
267                                 ),
268                                 sprintf($_->{build} ? '(%s)' : '%s', $_->{abbr}),
269                 } grep { defined $_->{abbr} } @{$specials};
270         }
271
272         sub showunitcols {
273                 my ($row) = @_;
274                 local $_ = $row;
275                 $_->{hp} += $_->{shield} if $_->{shield};
276
277                 return (
278                         '<td class="val unit-min">' . ($_->{min} // ''),
279                         '<td class="val unit-gas">' . ($_->{gas} || ''),
280                         defined $_->{transform} ? sprintf('<td class="val time">%.0f',
281                                 $_->{transform},
282                         ) :
283                         !defined $_->{build} ? '<td>' : sprintf('<td class="val time"%s>%s%.0f',
284                                 defined $_->{warp} && sprintf(' title="%.0f without warpgate"', $_->{build}),
285                                 !!$_->{base} && sprintf(
286                                         '<span class="unit-composed" title="%s">+</span>',
287                                         'from '.join('+', @{ $_->{base} }),
288                                 ),
289                                 $_->{warp} // $_->{build} || '0',
290                         ),
291                         sprintf('<td class="unit unit-%s" title="%4$s%3$s">%s',
292                                 $_->            {cargo} < 0 ? ('supply',           T => 'transport') :
293                                 $_->{upgraded}->{cargo} < 0 ? ('supply magic-opt', T => 'optional transport') :
294                                 $_->            {attr}->{flying} ? ('air',           F => 'flying') :
295                                 $_->{upgraded}->{attr}->{flying} ? ('air magic-opt', F => 'potentially flying') :
296                                 $_->{attr}->{structure} ? ('x',   B => 'building') :
297                                 (
298                                         [qw( x s m l l h h h h )]->[ $_->{cargo} ],
299                                         $_->{cargo} || '-',
300                                         $_->{cargo} ? 'transportable' : 'untransportable',
301                                 ),
302                                 defined $_->{size} && sprintf('⌀%.1f ', $_->{size}),
303                         ),
304                         sprintf('<td class="val unit unit-pop%s">%s',
305                                 defined $_->{pop} && $_->{pop} < 0 && ' unit-supply',
306                                 defined $_->{pop} && $_->{pop} == .5 ? '½' : $_->{pop},
307                         ),
308                         '<td class="unit unit-type">' . join('', grep { $_ }
309                                 (defined $_->{organic} ? !$_->{organic} : $_->{attr}->{mech})
310                                         && '<span class="unit-u" title="mechanic">m</span>',
311                                 ($_->{organic} || $_->{attr}->{organic})
312                                         && '<span class="unit-o" title="organic">o</span>',
313                                 $_->{attr}->{psionic}
314                                         && '<span class="unit-p" title="psionic">ψ</span>',
315                         ),
316                         '<td class="unit unit-attr">' . join('', grep { $_ }
317                                 $_->{attr}->{armored}
318                                         && '<span class="unit unit-l" title="armored">A</span>',
319                                 $_->{attr}->{light}
320                                         && '<span class="unit unit-s" title="light">L</span>',
321                                 $_->{suit} && sprintf(
322                                         '<span class="unit unit-%s" title="%3$s">%s</span>',
323                                         map { @{$_} } [
324                                                 [qw( x ? unknown )],
325                                                 [qw( s S small )],
326                                                 [qw( m M medium )],
327                                                 [qw( l L large )],
328                                         ]->[ $_->{suit} ],
329                                 ),
330                                 $_->{attr}->{massive}
331                                         && '<span class="unit-massive" title="massive">⚓</span>',
332                         ),
333                         $_->{hp} < 0 ? '<td class="val unit-hp" title="invulnerable">∞' :
334                         '<td class="val unit-hp">' . showrangeint($_->{hp}, $_->{upgraded}->{hp}),
335                         $_->{shield} ? sprintf('<td class="val unit-shield">%.0f%%<td',
336                                 100 * $_->{shield} / $_->{hp}
337                         ) : '<td colspan=2',
338                         ' class="val unit-armor">' .
339                                 showrangeint($_->{armor}, $_->{upgraded}->{armor}),
340                         showattack($_, 0),
341                         '<td class="val unit-sight">' . sprintf(
342                                 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
343                                 showrangeint($_->{sight}, $_->{upgraded}->{sight})
344                         ),
345                         sprintf('<td class="val unit-speed"%2$s>%s',
346                                 showrange(
347                                         map { $_ && sprintf '%.1f', $_ }
348                                         $_->{speed}, $_->{upgraded}->{speed}
349                                 ),
350                                 defined $_->{creep} && sprintf(' title="%s on creep"',
351                                         $_->{creep} == 1 ? 'same' : showrange(
352                                                 map { $_ && sprintf '%.1f', $_ }
353                                                 $_->{speed} * $_->{creep},
354                                                 $_->{upgraded}->{speed} && $_->{upgraded}->{speed} *
355                                                         ($_->{upgraded}->{creep} // $_->{creep}),
356                                         ),
357                                 ),
358                         ),
359                         $_->{attr}->{jump}
360                                 && qq'<span class="unit unit-jump" title="$_->{attr}->{jump}">↕</span>',
361                         '<td class="unit-magic">' . showmagic($_),
362                         (map {(
363                                 '<tr class="sub"><th class="cat"><td><td colspan=10>',
364                                 showattack($row, $_),
365                                 '<td colspan=3>',
366                         )} 1 .. $#{ $_->{attack} }),
367                         "\n"
368                 );
369         }
370
371         my @rows = @{$units};
372         my $grouped = 1;  # race headers
373         if (exists $get{order}) {
374                 $grouped = 0;
375                 $get{order} ||= '';
376                 if ($get{order} eq 'name') {
377                         @rows = sort {$a->{name} cmp $b->{name}} @rows;
378                 }
379                 elsif ($get{order} eq 'cost') {
380                         $_->{order} = (
381                                 $_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8
382                         ) for @rows;
383                 }
384                 elsif ($get{order} eq 'build') {
385                         my %unittime = map { ($_->{name} => $_->{warp} // $_->{build}) } @rows;
386                         $unittime{Templar} = $unittime{'High Templar'};
387                         $_->{order} = (
388                                 ($_->{warp} // $_->{build})
389                                 + ($_->{gas}*1.5 + $_->{min} + $_->{pop}/8)/1024
390                                 + ($_->{base} ? ($unittime{$_->{base}->[0]} // 100) + 1 : 0)
391                         ) for @rows;
392                 }
393                 elsif ($get{order} eq 'size') {
394                         $_->{order} = (
395                                 $_->{pop}*16 + ($_->{size} // $_->{suit}) + $_->{cargo}/8
396                                 + $_->{hp}/512 + $_->{min}/8192
397                         ) for @rows;
398                 }
399                 elsif ($get{order} eq 'hp') {
400                         $_->{order} = (
401                                 $_->{hp}*1.01 + $_->{armor} + $_->{shield} + $_->{size}/1024,
402                         ) for @rows;
403                 }
404                 elsif ($get{order} eq 'attack') {
405                         $_->{order} = $_->{hp} / 16384 + max(
406                                 map {
407                                         ($_->{dps} ? $_->{dps}->[-1] :
408                                                 ($_->{damage} + $_->{upgrade} * 3)
409                                                 * ($_->{count} // 1) / ($_->{cooldown} // 1)
410                                         )
411                                         * ($_->{splash} ? 1.01 : 1)
412                                         * ($_->{type} eq 'implosive' ? .96 : 1)
413                                         * ($_->{type} eq 'explosive' ? .98 : 1)
414                                 } @{ $_->{attack} }
415                         ) for @rows;
416                 }
417                 elsif ($get{order} eq 'speed') {
418                         $_->{order} = (
419                                 ($_->{upgraded}->{speed} // $_->{speed}*1.01)
420                                 + $_->{sight}/1024 + $_->{detect}/2048
421                         ) for @rows;
422                 }
423                 @rows = sort {$a->{order} <=> $b->{order}} @rows if exists $rows[0]->{order};
424         }
425
426         my ($race, $cat) = ('', '');
427         for (@rows) {
428                 if ($grouped) {
429                         say sprintf '<tbody id="%s"><tr class="race"><th colspan="20"><h2>%s</h2>',
430                                 $race = $_->{race}, ucfirst $race
431                                         unless $race eq $_->{race};
432                 }
433                 else {
434                         $_->{cat} = $_->{race};
435                 }
436
437                 print(
438                         '<tr>',
439                         '<th class="cat">', $cat ne $_->{cat} && ($cat = $_->{cat}),
440                         '<td>', $_->{name},
441                         showunitcols($_),
442                 );
443
444                 for my $subrow (@{ $_->{special} }) {
445                         $subrow->{alt} or next;
446                         print(
447                                 '<tr class="alt"><th class="cat"><td>', $subrow->{alt},
448                                 showunitcols($subrow),
449                         );
450                 }
451         }
452 :>
453 </table>
454
455 <div class="legend">
456 <h2>Legend</h2>
457
458 <dl>
459 <dt>cost
460         <dd><span class="unit-min">minerals</span> and
461                 <span class="unit-gas">gas</span> required to create one unit
462         <dd>includes total expenses if based on existing units
463 <dt>build
464         <dd>relative time needed to create at least one unit
465         <dd>excludes construction of dependencies such as buildings
466                 and <span class="unit-composed">+</span>parent units
467 <dt>size
468         <dd><span class="unit unit-supply">T</span>ransports can fit upto
469                 8 non-<span class="unit unit-air">F</span>lying cargo units
470         <dd>number of command points taken while alive
471         <dd><:
472 if ($scver{major} > 1) {
473                 :>received damage depends on
474                 <span class="unit unit-o">o</span>rganic,
475                 <span class="unit unit-u">m</span>echanic,
476                 <span class="unit unit-p">ψ</span>(ps)ionic,
477                 <span class="unit unit-s">L</span>ight, and
478                 <span class="unit unit-l">A</span>rmored
479                 attributes
480         <dd>massive <span class="unit-massive">⚓</span> units
481                 cannot be lifted or slowed and can break force fields<:
482 } else {
483                 :>abilities may hit only <span class="unit unit-o">o</span>rganic
484                 or <span class="unit unit-u">m</span>echanic targets
485         <dd>affected by <span class="unit unit-s">S</span>mall,
486                 <span class="unit unit-m">M</span>edium, or
487                 <span class="unit unit-l">L</span>arge damage<:
488 } :>
489 <dt>HP
490         <dd>total number of hitpoints (including shields)
491         <dd>everything zerg (except for eggs) regenerates one point every
492                 <:= $scver{major} == 1 ? '4½' : '3.7' :> seconds
493 <dt>shield
494         <dd>percentage of HP in shields
495         <dd><:
496 if ($scver{major} > 1) {
497                 :>shields always take full damage, irrelevant of unit size
498         <dd><:
499 }
500                 :>does not take armor bonuses,
501                 but upgrades can decrease damage to any shield hit by upto 3
502         <dd><:
503 if ($scver{major} > 1) {
504                 :>after 10 seconds out of combat, 2 points are recharged per game second<:
505 } else {
506                 :>recharges one point every 2½ seconds<:
507 } :>
508 <dt>armor
509         <dd>base unit armor
510         <dd>can be increased by upto 3 at various facilities
511         <dd>each point decreases damage per hit by one, upto a minimum of ½
512         <dd>reduction applies to initial damage, before size penalties
513                 <small>(so a plasma hit of 12 to 4 armor large deals 2 damage, not ½)</small>
514 <dt>attack
515         <dd>damage per single hit
516         <dd>some weapons fire multiple × times, multiplying armor penalties
517         <dd>splash damage hits all objects nearby <span class="unit-splash">⁜</span>
518                 or in a straight line <span class="unit-splash">+</span>.
519         <dd><:
520 if ($scver{major} > 1) {
521                 :>does not include <span>&ge;</span>bonus damage
522                 dealt to susceptible unit types
523         <dd><span class="unit-pdd">•</span>projectile shots are negated by
524                 Point Defense Drones<:
525 } else {
526                 :><span class="unit-l">*</span>explosive damage does only
527                 50% damage to <span class="unit unit-s">S</span>mall units,
528                 75% to <span class="unit unit-m">M</span>edium,
529                 100% to <span class="unit unit-l">L</span>arge
530         <dd><span class="unit-s">~</span>concussive/plasma damage does
531                 25% to <span class="unit unit-l">L</span>arge,
532                 50% <span class="unit unit-m">M</span>edium,
533                 100% to <span class="unit unit-s">S</span>mall units<:
534 } :>
535         <dd><span class="hurtrel">dps</span> indicates relative total amount of damage
536                 done in 1 second of <:= $scver{major} > 1 ? '<em>Normal</em> in-game time' :
537                 'time on <em>Fast</em> game speed' :>
538         <dd>targets <span class="hurt-g">▽</span>&nbsp;ground
539                 and/or  <span class="hurt-a">△</span>&nbsp;air
540 <dt>range
541         <dd>maximum hex distance a weapon can fire (note Sieged Tank also has a minimum)
542 <dt>sight
543         <dd>range in which the unit detects other units
544         <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
545 <dt>speed
546         <dd>top movement speed in hex per second
547         <dd>acceleration and deceleration ignored
548 <dt>specials
549         <dd>parentheses () indicate that it needs to be researched first
550         <dd><span class="magic-perma">passive</span> abilities are always enabled
551         <dd>hover for description
552         <dd>range is maximum distance allowed to activate
553         <dd>cost describes energy loss percentage on spawn and when fully charged
554 </dl>
555
556 <p>
557 When two values are given (1-2), the second value indicates the attribute
558 after all possible upgrades.
559 </p>
560
561 </div>
562