sc: show upgrade range in [Carrier] attack count
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 20 Jun 2015 06:44:54 +0000 (08:44 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 22 Jun 2015 13:38:51 +0000 (15:38 +0200)
sc-units-bw.inc.pl
sc.plp

index 4c1115d..94918dc 100644 (file)
@@ -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 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -129,7 +129,9 @@ sub showrange {
                $maxdamage += ($upattack->{upgrade} // $attack->{upgrade}) * 3;
 
                my $out = '<td class="val hurt">';
-               $out .= "<small>$attack->{count}× </small>" if $attack->{count} > 1;
+               $out .= sprintf('<small>%s× </small>',
+                       showrange($attack->{count}, $upattack->{count}),
+               ) if $attack->{count} > 1;
                $out .= '<span class="unit-l" title="explosive">*</span>'
                        if $attack->{type} eq 'explosive';
                $out .= '<span class="unit-s" title="implosive">~</span>'
@@ -167,7 +169,10 @@ sub showrange {
 
                $out .= '<td class="val hurt hurtrel">';
                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}) {