sc: drop zero value in spider mine attack data
[sheet.git] / sc.plp
diff --git a/sc.plp b/sc.plp
index 25c9863c36cf6d3a75beb6ca3225ec620d08d244..0426b6eacb1eb97baabac2179d63773a55896838 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -108,6 +108,9 @@ Unit properties as seen or measured in Brood War
        .unit-magic {
                padding-left: 0.5em;
        }
+       .magic-perma {
+               text-decoration: underline;
+       }
 
        .units .val {
                text-align: right;
@@ -246,17 +249,20 @@ sub showrange {
                my ($row) = @_;
                my $specials = $row->{special} or return '';
                return join ' ', map {
-                       sprintf '<span title="%s">%s</span>',
+                       sprintf '<span%s title="%s">%s</span>',
+                               $_->{duration} < 0 && ' class="magic-perma"',
                                join('',
                                        $_->{name},
                                        $_->{desc} ? ": $_->{desc}" : '',
-                                       $_->{range} ? sprintf(' (%s)', join ', ',
-                                               "range $_->{range}",
-#                                              "cost $_->{cost}",
+                                       $_->{range} || $_->{cost} ? sprintf(' (%s)', join ', ',
+                                               $_->{range} ? "range $_->{range}" : (),
+                                               $_->{cost} ? sprintf('cost %.0f%%',
+                                                       100 * $_->{cost} / $row->{energy}
+                                               ) : (),
                                        ) : '',
                                ),
-                               $_->{abbr},
-               } @$specials;
+                               sprintf($_->{build} ? '(%s)' : '%s', $_->{abbr}),
+               } grep { defined $_->{abbr} } @{$specials};
        }
 
        sub showunitcols {
@@ -389,7 +395,7 @@ sub showrange {
 <dt>speed
        <dd>relative speed of movement (when in full motion, startup speed ignored)
 <dt>specials
-       <dd>special abilities
+       <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>hover for description
        <dd>range is maximum range required to activate