sc: lotv version (unit list copied from hots data)
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 21 Apr 2018 19:18:42 +0000 (21:18 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 10 May 2018 14:49:06 +0000 (16:49 +0200)
sc-units-hots.inc.pl
sc-units-lotv.inc.pl [new file with mode: 0644]
sc.plp

index a4115e4fd33fec13826bf259d2206afd33560d86..65b54a7dcb30353c1c0ae3b8ffe66b7ff4207427 100644 (file)
@@ -2,7 +2,7 @@ use utf8;
 use strict;
 
 [
-'patch 2.1.10',
+'patch 2.1.9+',
 # http://wiki.teamliquid.net/starcraft2/Unit_Statistics
 # http://wiki.teamliquid.net/starcraft2/User:Roemy/Unit_Statistics_(detailed)
 # http://starcraft.wikia.com/wiki/List_of_StarCraft_II_units
diff --git a/sc-units-lotv.inc.pl b/sc-units-lotv.inc.pl
new file mode 100644 (file)
index 0000000..b2d61e6
--- /dev/null
@@ -0,0 +1,117 @@
+use utf8;
+use strict;
+
+my $RT = 1.4;  # real-time speed factor to faster
+
+my $hots = do 'sc-units-hots.inc.pl' or die $!;
+my %unit;
+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 @{ $_->{attack} // [] };
+       }
+       $unit{ lc $row->{name} =~ tr/ /_/r } = $row;
+}
+
+[
+'patch 4.1.4',
+
+# protoss
+
+$unit{probe},
+$unit{photon_cannon},
+$unit{mothership},
+$unit{nexus},
+$unit{zealot},
+$unit{sentry},
+$unit{stalker},
+{
+       race => 'protoss',
+       cat => 'gateway',
+       name => 'Adept',
+},
+$unit{high_templar},
+$unit{dark_templar},
+$unit{archon},
+$unit{observer},
+$unit{warp_prism},
+$unit{immortal},
+$unit{colossus},
+{
+       race => 'protoss',
+       cat => 'robotic',
+       name => 'Disruptor',
+},
+$unit{phoenix},
+$unit{void_ray},
+$unit{oracle},
+$unit{tempest},
+$unit{carrier},
+
+# terran
+
+$unit{scv},
+$unit{mule},
+$unit{missile_turret},
+$unit{planetary_fortress},
+$unit{marine},
+$unit{marauder},
+$unit{reaper},
+$unit{ghost},
+$unit{hellion},
+$unit{hellbat},
+$unit{widow_mine},
+$unit{siege_tank},
+{
+       race => 'terran',
+       cat => 'factory',
+       name => 'Cyclone',
+},
+$unit{thor},
+$unit{viking},
+$unit{medivac},
+{
+       race => 'terran',
+       cat => 'starport',
+       name => 'Liberator',
+},
+$unit{banshee},
+$unit{raven},
+$unit{battlecruiser},
+
+# zerg
+
+$unit{larva},
+$unit{drone},
+$unit{queen},
+$unit{overlord},
+$unit{overseer},
+$unit{larva},
+$unit{spine_crawler},
+$unit{spore_crawler},
+$unit{zergling},
+$unit{baneling},
+$unit{roach},
+{
+       race => 'zerg',
+       cat => 'hatchery',
+       name => 'Ravager',
+},
+$unit{hydralisk},
+{
+       race => 'zerg',
+       cat => 'lair',
+       name => 'Lurker',
+},
+$unit{infestor},
+$unit{nydus_worm},
+$unit{swarm_host},
+$unit{mutalisk},
+$unit{corruptor},
+$unit{brood_lord},
+$unit{viper},
+$unit{ultralisk},
+
+]
diff --git a/sc.plp b/sc.plp
index 78eebc43bc8fa648c3f768ba8a4b818d6e16a895..78c1a2d84fcdabb787fe1d9273568c75bc2654fd 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -5,19 +5,25 @@ my %scvers = (
        bw => {
                name => 'Brood War',
                title => 'starcraft',
-               game => 'StarCraft',
+               game => 'StarCraft BW',
                major => 1,
        },
        hots => {
                name => 'Heart of the Swarm',
-               title => 'starcraft2',
-               game => 'StarCraft II',
+               title => 'starcraft2 hots',
+               game => 'StarCraft II HotS',
+               major => 2,
+       },
+       lotv => {
+               name => 'Legacy of the Void',
+               title => 'starcraft2 lotv',
+               game => 'StarCraft II LotV',
                major => 2,
        },
 );
 
 $Request ||= 'bw';
-$Request = 'hots' if $Request eq '2';
+$Request = 'lotv' if $Request eq '2';
 my %scver = %{ $scvers{$Request} }
        or Abort("Requested version $Request not available", '404 unknown');
 
@@ -36,7 +42,8 @@ Html({
                starcraft game unit statistics stats comparison table sheet cheat
                reference software attributes properties patch attribute multiplayer
                ',
-               $scver{major} < 2 ? qw' bw broodwar brood war ' : qw' starcraft2 hots ',
+               $scver{major} < 2 ? qw' bw broodwar brood war ' :
+               qw' starcraft2 lotv hots wol ',
        ],
        stylesheet => [qw'light'],
        raw => '<link rel="stylesheet" type="text/css" media="all" href="/sc.css?1.1" title="light">',
@@ -51,8 +58,9 @@ my $patch = shift @{$units}
        or Abort("Cannot open unit data: metadata not found", 501);
 
 say "<p>Unit properties as seen or measured in $scver{name}\n$patch.";
-say "Also see the $_ table." for join(', ',
-       (showlink('StarCraft 2: HotS', '/sc/hots'))    x ($Request ne 'hots'),
+say "Also see the $_ tables." for join(' and ',
+       (showlink('StarCraft 2: LotV', '/sc/lotv'))    x ($Request ne 'lotv'),
+       (showlink(             'HotS', '/sc/hots'))    x ($Request ne 'hots'),
        (showlink('original SC: Brood War', '/sc/bw')) x ($Request ne 'bw'),
 );
 say "</p>\n";