From: Mischa POSLAWSKY Date: Sat, 20 Jun 2015 06:44:54 +0000 (+0200) Subject: sc: show upgrade range in [Carrier] attack count X-Git-Tag: v1.8~108 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/e75dbcba340459a1bef997680a7d1bf152039a32 sc: show upgrade range in [Carrier] attack count --- diff --git a/sc-units-bw.inc.pl b/sc-units-bw.inc.pl index 4c1115d..94918dc 100644 --- a/sc-units-bw.inc.pl +++ b/sc-units-bw.inc.pl @@ -476,7 +476,7 @@ armor => 4, attack => [ { anti => 3, - dps => [17, undef, undef, 49], + dps => [17, undef, undef, 25], count => 4, range => 8, }, @@ -513,9 +513,12 @@ special => [ upgrade => [ { name => 'Carrier Capacity', - damage => { - count => 8-4, - }, + attack => [ + { + dps => [17, undef, undef, 24], + count => 8-4, + }, + ], }, ], counter => ['wraith', 'corsair', 'scourge'], diff --git a/sc.plp b/sc.plp index 3a11f0c..dc32a47 100644 --- a/sc.plp +++ b/sc.plp @@ -129,7 +129,9 @@ sub showrange { $maxdamage += ($upattack->{upgrade} // $attack->{upgrade}) * 3; my $out = ''; - $out .= "$attack->{count}× " if $attack->{count} > 1; + $out .= sprintf('%s× ', + showrange($attack->{count}, $upattack->{count}), + ) if $attack->{count} > 1; $out .= '*' if $attack->{type} eq 'explosive'; $out .= '~' @@ -167,7 +169,10 @@ sub showrange { $out .= ''; if ($attack->{dps}) { - $out .= showrange($attack->{dps}->[0], $attack->{dps}->[-1]); + # precalculated dps, do not touch + $out .= showrange($attack->{dps}->[0], + $upattack->{dps}->[-1] // $attack->{dps}->[-1] + ); } elsif ($attack->{cooldown}) { if (my $type = $attack->{type}) {