From be9d4788815fac719e6aab8cdcf7ac35183eea7c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 22 Apr 2018 03:02:19 +0200 Subject: [PATCH] sc: distinguish transformation time from build attribute --- sc-units-hots.inc.pl | 6 +++--- sc-units-lotv.inc.pl | 4 ++-- sc.plp | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sc-units-hots.inc.pl b/sc-units-hots.inc.pl index 65b54a7..e69bb81 100644 --- a/sc-units-hots.inc.pl +++ b/sc-units-hots.inc.pl @@ -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 => [ diff --git a/sc-units-lotv.inc.pl b/sc-units-lotv.inc.pl index c0fb81e..9d99fcc 100644 --- a/sc-units-lotv.inc.pl +++ b/sc-units-lotv.inc.pl @@ -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 78c1a2d..bbcd9c9 100644 --- a/sc.plp +++ b/sc.plp @@ -266,6 +266,9 @@ sub showrangeint { return ( '' . ($_->{min} // ''), '' . ($_->{gas} || ''), + defined $_->{transform} ? sprintf('%.0f', + $_->{transform}, + ) : !defined $_->{build} ? '' : sprintf('%s%.0f', defined $_->{warp} && qq(title="$_->{build} without warpgate"), !!$_->{base} && sprintf( -- 2.30.0