sc: distinguish transformation time from build attribute
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Apr 2018 01:02:19 +0000 (03:02 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 10 May 2018 14:49:06 +0000 (16:49 +0200)
sc-units-hots.inc.pl
sc-units-lotv.inc.pl
sc.plp

index 65b54a7dcb30353c1c0ae3b8ffe66b7ff4207427..e69bb81dbfd9386966be2d008b05dee1d814eb76 100644 (file)
@@ -1491,7 +1491,7 @@ use strict;
                        name => 'Hellion Mode',
                        abbr => 'hm',
                        desc => 'transform to Hellion',
-                       duration => 4,
+                       transform => 4,
                },
        ],
        upgrade => [
@@ -1607,7 +1607,7 @@ use strict;
                                },
                        ],
                        speed => 0,
-                       duration => 4,
+                       transform => 4,
                },
        ],
        speed => 2.25,
@@ -1708,7 +1708,7 @@ use strict;
                {
                        name => 'Assault Mode',
                        abbr => 'am',
-                       build => 3, # transformation time
+                       transform => 3,
                        alt => 'Landed Viking',
                        cargo => 2,
                        attack => [
index c0fb81ec8577a3934e76401a037f026d610ff476..9d99fcc0ce4bf182563bbd64d49881c327a229fd 100644 (file)
@@ -9,7 +9,7 @@ for my $row (@{$hots}) {
        ref $row eq 'HASH' or next;
        for ($row, @{ $row->{special} }, @{ $row->{upgrade} }) {
                $_ *= $RT for $_->{speed} // ();
-               $_ /= $RT for $_->{build} // (), $_->{warp} // (), $_->{cooldown} // ();
+               $_ /= $RT for $_->{build} // (), $_->{transform} // (), $_->{warp} // (), $_->{cooldown} // ();
                $_->{cooldown} and $_->{cooldown} /= $RT for @{ $_->{attack} // [] };
        }
        $unit{ lc $row->{name} =~ tr/ /_/r } = $row;
@@ -541,7 +541,7 @@ $unit{medivac},
                {
                        name => 'Defender Mode',
                        abbr => 'dm',
-                       build => 2.88, # transformation time, 1.46s to revert
+                       transform => 2.88, # 1.46s to revert
                        alt => 'Defender Liberator',
                        attack => [
                                {
diff --git a/sc.plp b/sc.plp
index 78c1a2d84fcdabb787fe1d9273568c75bc2654fd..bbcd9c91102c181cefb9a0c325ca7b8527693f43 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -266,6 +266,9 @@ sub showrangeint {
                return (
                        '<td class="val min">' . ($_->{min} // ''),
                        '<td class="val gas">' . ($_->{gas} || ''),
+                       defined $_->{transform} ? sprintf('<td class="val time">%.0f',
+                               $_->{transform},
+                       ) :
                        !defined $_->{build} ? '<td>' : sprintf('<td class="val time"%s>%s%.0f',
                                defined $_->{warp} && qq(title="$_->{build} without warpgate"),
                                !!$_->{base} && sprintf(