sc: prefer precalculated dps for aggregate attacks
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 20 Jun 2015 05:14:32 +0000 (07:14 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 22 Jun 2015 13:38:51 +0000 (15:38 +0200)
Carrier and Swarm Host do not have an attack of their own, but indirectly
deal damage through subunits which can be summed up manually.

sc-units-hots.inc.pl
sc.plp

index 5cedf2e5f4bc2e0c3971a275d425073bbc19769a..6b230d90be347c1e1d73c23d57603f745bfd3a83 100644 (file)
@@ -902,8 +902,10 @@ use strict;
        },
        attack => [
                {
+                       anti => 3,
+                       count => 8,
                        range => 8, # leash range 14
-                       dps => [13.3, undef, undef, 42.6],
+                       dps => [26.7, undef, undef, 42.6],
                        cooldown => 0.5,
                },
        ],
@@ -2612,9 +2614,12 @@ use strict;
        attack => [
                {
                        anti => 1,
-                       dps => [27.9, 30.2, 32.5, 34.8],
+                       dps => [16.7, undef, undef, 20.8], # 20/.6 * 2 /60*25
                        type => 'projectile',
-                       cooldown => 0.86,
+                       count => 2,
+                       cooldown => 60,
+                       duration => 25,
+                       range => 3*25, # locust speed * duration = theoretical walk limit
                },
        ],
        speed => 2.95,
diff --git a/sc.plp b/sc.plp
index 2a17bc86bae1fb009aef03f27b9a4d8b73276c3b..f1632eeaddfbf513c0fd28a8113feda44f8f39b7 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -164,7 +164,10 @@ sub showrange {
                ) if $attack->{splash};
 
                $out .= '<td class="val hurt hurtrel">';
-               if ($attack->{cooldown}) {
+               if ($attack->{dps}) {
+                       $out .= showrange($attack->{dps}->[0], $attack->{dps}->[-1]);
+               }
+               elsif ($attack->{cooldown}) {
                        if (my $type = $attack->{type}) {
                                if ($type eq 'explosive') {
                                        $damage /= 2;