X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/1de61e5745ecf3dd1a41e1e932bae2f7568353a4..e7d0872468d9ff54c39ac8a7e64f283ba093c7aa:/sc.plp diff --git a/sc.plp b/sc.plp index 55dbd09..13248fb 100644 --- a/sc.plp +++ b/sc.plp @@ -1,37 +1,53 @@ <(common.inc.plp)><: -my $scver = 'bw'; +my %scver = ( + id => 'bw', + name => 'Brood War', + title => 'starcraft', + game => 'StarCraft', + major => 1, +); + if ($ENV{PATH_INFO} and $ENV{PATH_INFO} eq '/2') { - my $scver = 'hots'; + %scver = ( + id => 'hots', + name => 'Heart of the Swarm', + title => 'starcraft2', + game => 'StarCraft II', + major => 2, + ); } -my $datafile = "sc-units-$scver.inc.pl"; +my $datafile = "sc-units-$scver{id}.inc.pl"; Html({ - title => 'starcraft unit cheat sheet', - version => 'v1.0', + title => "$scver{title} unit cheat sheet", + version => 'v1.1', description => [ - 'Reference of StarCraft unit properties,' - . ' comparing various statistics of all the units in Brood War' + "Reference of $scver{game} unit properties," + . " comparing various statistics of all the units in $scver{name}" . ' including costs, damage, defense, speed, ranges, and abilities.', ], - keywords => [qw' + keywords => [ + qw' starcraft game unit statistics stats comparison table sheet cheat reference software attributes properties - '], + ', + $scver{major} < 2 ? qw' bw broodwar brood war ' : qw' starcraft2 hots ', + ], stylesheet => [qw'light'], raw => '', data => [$datafile], }); -:> -

StarCraft units

+print "

$scver{game} units

\n\n"; -

-Unit properties as seen or measured in Brood War -version≥1.08. -

+my $units = do $datafile; +die "Cannot open unit data: $_\n" for $@ || $! || (); +my $patch = shift @{$units} + or die "Cannot open unit data: metadata not found\n"; + +print "

Unit properties as seen or measured in $scver{name}\n$patch.\n

\n\n"; -<: sub coltoggle { my ($name, $id) = @_; return sprintf( @@ -201,8 +217,6 @@ sub showval { ); } - my $units = do $datafile; - die "Cannot open unit data: $_\n" for $@ || $! || (); my $grouped = 1; # race headers if (exists $get{order}) { $grouped = 0;