sc: convert bw attack cooldown to seconds
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 15 Jun 2015 22:44:46 +0000 (00:44 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 15 Jun 2015 22:44:46 +0000 (00:44 +0200)
Move game-specific multiplication to data so hots values are left alone.

sc-units-bw.inc.pl
sc.plp

index b72a71c..9064f70 100644 (file)
@@ -29,7 +29,7 @@ attack => {
        ground => {
                name => "Particle Beam",
                damage => 5,
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        range => 1,
 },
@@ -56,7 +56,7 @@ armor => 0,
 attack => {
        ground => {
                damage => 20,
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        air => 'ground',
        range => 7,
@@ -88,7 +88,7 @@ attack => {
        ground => {
                name => "Psi Blades",
                damage => [16, 18, 20, 22],
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        range => 1,
 },
@@ -128,7 +128,7 @@ attack => {
                name => "Phase Disruptor",
                damage => [20, 22, 24, 26],
                type => 'explosive',
-               cooldown => 30,
+               cooldown => 30 / $FPS,
        },
        air => 'ground',
        range => 4,
@@ -225,7 +225,7 @@ attack => {
        ground => {
                name => "Warp Blades",
                damage => [40, 43, 46, 49],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
        },
        range => 1,
 },
@@ -263,7 +263,7 @@ attack => {
        ground => {
                name => "Psionic Shockwave",
                damage => [30, 33, 36, 39],
-               cooldown => 20,
+               cooldown => 20 / $FPS,
                splash => 1,
        },
        air => 'ground',
@@ -360,12 +360,12 @@ armor => 0,
 attack => {
        ground => {
                damage => [8, 9, 10, 11],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
        },
        air => {
                damage => [28, 30, 32, 34],
                type => 'explosive',
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        range => 4,
 },
@@ -409,7 +409,7 @@ armor => 1,
 attack => {
        air => {
                damage => [5, 6, 7, 8],
-               cooldown => 8,
+               cooldown => 8 / $FPS,
                splash => 1,
                type => 'explosive',
        },
@@ -485,7 +485,7 @@ special => [
                attack => {
                        ground => {
                                damage => [6, 7, 8, 9],
-                               cooldown => 43, # approximately 37 according to liquipedia
+                               cooldown => 43 / $FPS, # approximately 37 according to liquipedia
                                build => 20,
                        },
                        air => 'ground',
@@ -526,7 +526,7 @@ armor => 1,
 attack => {
        ground => {
                damage => [10, 11, 12, 13],
-               cooldown => 45,
+               cooldown => 45 / $FPS,
                type => 'explosive',
        },
        air => 'ground',
@@ -591,7 +591,7 @@ armor => 0,
 attack => {
        ground => {
                damage => 100,
-               cooldown => 60,
+               cooldown => 60 / $FPS,
                splash => 1,
                cost => 15,
                build => 7,
@@ -730,7 +730,7 @@ armor => 0,
 attack => {
        ground => {
                damage => 5,
-               cooldown => 15,
+               cooldown => 15 / $FPS,
        },
        range => 1,
 },
@@ -754,7 +754,7 @@ armor => 0,
 attack => {
        air => {
                damage => 20,
-               cooldown => 15,
+               cooldown => 15 / $FPS,
                type => 'explosive',
        },
        range => 7,
@@ -782,7 +782,7 @@ armor => 0,
 attack => {
        ground => {
                damage => [6, 7, 8, 9],
-               cooldown => 15,
+               cooldown => 15 / $FPS,
        },
        air => 'ground',
        range => 4,
@@ -811,7 +811,7 @@ special => [
                speed => 17,
                attack => {
                        ground => {
-                               cooldown => 7.5,
+                               cooldown => 7.5 / $FPS,
                        },
                        air => 'ground',
                },
@@ -835,7 +835,7 @@ armor => 1,
 attack => {
        ground => {
                damage => [16, 18, 20, 22],
-               cooldown => 22,
+               cooldown => 22 / $FPS,
                splash => 1,
                type => 'implosive',
        },
@@ -856,7 +856,7 @@ special => [
                speed => 17,
                attack => {
                        ground => {
-                               cooldown => 11,
+                               cooldown => 11 / $FPS,
                        },
                },
                duration => 220 / $FPS,
@@ -882,7 +882,7 @@ armor => 0,
 attack => {
        ground => {
                damage => [10, 11, 12, 13],
-               cooldown => 22,
+               cooldown => 22 / $FPS,
                type => 'implosive',
        },
        air => 'ground',
@@ -1026,7 +1026,7 @@ armor => 0,
 attack => {
        ground => {
                damage => [20, 22, 24, 26],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
                type => 'implosive',
        },
        range => 5,
@@ -1088,7 +1088,7 @@ armor => 1,
 attack => {
        ground => {
                damage => [30, 33, 36, 39],
-               cooldown => 37,
+               cooldown => 37 / $FPS,
                type => 'explosive',
        },
        range => 7,
@@ -1106,7 +1106,7 @@ special => [
                attack => {
                        ground => {
                                damage => [70, 75, 80, 85],
-                               cooldown => 75,
+                               cooldown => 75 / $FPS,
                                splash => 1,
                                type => 'explosive',
                        },
@@ -1135,12 +1135,12 @@ armor => 1,
 attack => {
        ground => {
                damage => [12, 13, 14, 15],
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        air => {
                damage => [20, 24, 28, 32],
                type => 'explosive',
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        range => 5,
 },
@@ -1177,11 +1177,11 @@ armor => 0,
 attack => {
        ground => {
                damage => [8, 9, 10, 11],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
        },
        air => {
                damage => [20, 22, 24, 26],
-               cooldown => 22,
+               cooldown => 22 / $FPS,
                type => 'explosive',
        },
        range => 5,
@@ -1231,7 +1231,7 @@ armor => 3,
 attack => {
        ground => {
                damage => [25, 28, 31, 34],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
        },
        air => 'ground',
        range => 6,
@@ -1353,7 +1353,7 @@ armor => 2,
 attack => {
        air => {
                damage => [6, 7, 8, 9],
-               cooldown => 64,
+               cooldown => 64 / $FPS,
                splash => 1,
                type => 'explosive',
                count => 8,
@@ -1400,7 +1400,7 @@ armor => 0,
 attack => {
        ground => {
                damage => 5,
-               cooldown => 22,
+               cooldown => 22 / $FPS,
        },
        range => 1,
 },
@@ -1497,7 +1497,7 @@ armor => 2,
 attack => {
        ground => {
                damage => 40,
-               cooldown => 32,
+               cooldown => 32 / $FPS,
                type => 'explosive',
        },
        range => 7,
@@ -1519,7 +1519,7 @@ armor => 0,
 attack => {
        air => {
                damage => 15,
-               cooldown => 15,
+               cooldown => 15 / $FPS,
        },
        range => 7,
 },
@@ -1543,7 +1543,7 @@ armor => 0,
 attack => {
        ground => {
                damage => [5, 6, 7, 8],
-               cooldown => 8,
+               cooldown => 8 / $FPS,
        },
        range => 1,
 },
@@ -1564,7 +1564,7 @@ upgrade => [
                build => 80,
                attack => {
                        ground => {
-                               cooldown => 6,
+                               cooldown => 6 / $FPS,
                        },
                },
        },
@@ -1587,7 +1587,7 @@ armor => 0,
 attack => {
        ground => {
                damage => [10, 11, 12, 13],
-               cooldown => 15,
+               cooldown => 15 / $FPS,
                type => 'explosive',
        },
        air => 'ground',
@@ -1637,7 +1637,7 @@ armor => 1,
 attack => {
        ground => {
                damage => [20, 22, 24, 26],
-               cooldown => 37,
+               cooldown => 37 / $FPS,
                splash => 'line',
        },
        range => 6,
@@ -1707,7 +1707,7 @@ special => [
                attack => {
                        ground => {
                                damage => [4, 5, 6, 7],
-                               cooldown => 15,
+                               cooldown => 15 / $FPS,
                        },
                        range => 1,
                },
@@ -1781,7 +1781,7 @@ armor => 0,
 attack => {
        ground => {
                damage => [9 .. 12],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
                splash => 'bounce',
        },
        air => 'ground',
@@ -1821,7 +1821,7 @@ armor => 2,
 attack => {
        ground => {
                damage => [20, 22, 24, 26],
-               cooldown => 30,
+               cooldown => 30 / $FPS,
        },
        range => 8,
 },
@@ -1846,7 +1846,7 @@ armor => 2,
 attack => {
        air => {
                damage => [25, 27, 29, 31],
-               cooldown => 100,
+               cooldown => 100 / $FPS,
                type => 'explosive',
        },
        range => 6,
@@ -1920,7 +1920,7 @@ armor => 1,
 attack => {
        ground => {
                damage => [20, 23, 26, 29],
-               cooldown => 15,
+               cooldown => 15 / $FPS,
        },
        range => 1,
 },
diff --git a/sc.plp b/sc.plp
index 06e377f..840e082 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -148,7 +148,7 @@ sub showval {
                        $attack->{splash} eq 'line' ? ('linear', '×') : ('splash', '+')
                ) if $attack->{splash};
                $attack->{dps} = $attack->{cooldown} && [
-                       map { 24 * $_ / $attack->{cooldown} * ($attack->{count} // 1) }
+                       map { $_ / $attack->{cooldown} * ($attack->{count} // 1) }
                        map { ref $_ ? @{$_} : $_ }
                        $attack->{damage}
                        #TODO: upgrade (zergling)