sc: indicate cooldown of costless specials instead
[sheet.git] / sc.plp
diff --git a/sc.plp b/sc.plp
index c86ef0bc47bd33c2d9f55bbdc8974b37bb3fa83c..a7da312c8207b4ef8650d2291355c7796da91b44 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -145,7 +145,9 @@ sub showrange {
                        )} keys %{ $attack->{bonus} }),
                ) if $attack->{bonus};
 
+               $out .= sprintf '<span title="%s">', $attack->{name} if $attack->{name};
                $out .= showrange($damage, $maxdamage);
+               $out .= '</span>' if $attack->{name};
                $out .= sprintf('<span class="unit-splash" title="%s">%s</span>',
                        $attack->{splash} eq 'line' ? ('linear', '×') : ('splash', '+')
                ) if $attack->{splash};
@@ -186,15 +188,17 @@ sub showrange {
                                join('',
                                        $_->{name},
                                        $_->{desc} ? ": $_->{desc}" : '',
-                                       $_->{range} || $_->{cost} ? sprintf(' (%s)', join ', ',
+                                       (map { $_ && " ($_)" } join ', ',
+                                               #TODO: apply upgrades
                                                $_->{range} ? "range $_->{range}" : (),
                                                $_->{cost} ? sprintf('cost %.0f%%%s',
                                                        100 * $_->{cost} / $row->{energy},
                                                        defined $_->{maint} && sprintf('+%.1f%%/s',
                                                                100 * $_->{maint} / $row->{energy},
                                                        ),
-                                               ) : (),
-                                       ) : '',
+                                               ) :
+                                               $_->{cooldown} ? "cooldown $_->{cooldown}s" : (),
+                                       ),
                                ),
                                sprintf($_->{build} ? '(%s)' : '%s', $_->{abbr}),
                } grep { defined $_->{abbr} } @{$specials};
@@ -418,8 +422,8 @@ if ($scver{major} > 1) {
 <dt>speed
        <dd>relative speed of movement (when in full motion, startup speed ignored)
 <dt>specials
-       <dd>special abilities are usually casted manually, but some are <span class="magic-perma">always active</span>
        <dd>parentheses () indicate that it needs to be researched first
+       <dd><span class="magic-perma">passive</span> abilities are always enabled
        <dd>hover for description
        <dd>range is maximum range required to activate
        <dd>cost is percentage of total energy lost