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