X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/ca987f558f793b296a159060a2fbe3f8f164eb67..80a615f8414664e34d48d6ffc1263943ae6fbf73:/sc.plp diff --git a/sc.plp b/sc.plp index 7ae2805..44940e5 100644 --- a/sc.plp +++ b/sc.plp @@ -1,7 +1,7 @@ <(common.inc.plp)><: Html({ - title => 'starcraft unit cheat sheets', + title => 'starcraft unit cheat sheet', version => 'v1.0', description => [ 'Reference of StarCraft unit properties,' @@ -16,7 +16,7 @@ Html({ }); :> -

StarCraft unit cheat sheet

+

StarCraft units

Unit properties as seen or measured in Brood War @@ -25,15 +25,16 @@ Unit properties as seen or measured in Brood War <: @@ -126,8 +153,8 @@ sub coltoggle { <:= coltoggle('name', '') :> - min - gas + min + gas <:= coltoggle(qw'build cost') :> <:= coltoggle(qw'size size') :> HP @@ -140,7 +167,6 @@ sub coltoggle { speed specials - <: sub showrange { my ($row, @elements) = @_; @@ -221,7 +247,7 @@ sub showrange { } my $units = do 'sc-units.inc.pl'; - die "Cannot open unit data: $_\n" for $! || $@ || (); + die "Cannot open unit data: $_\n" for $@ || $! || (); my $grouped = !exists $get{order}; if (exists $get{order}) { $get{order} ||= ''; @@ -240,7 +266,7 @@ sub showrange { my ($race, $cat) = ('', ''); for (@rows) { $race = $_->{race}, - printf '

%1$s

'."\n", $race + printf '

%s

'."\n", $race, ucfirst $race if $grouped and $race ne $_->{race}; $_->{cat} = $_->{race} if not $grouped; my $sizechar = [qw/? s m l/]->[$_->{size}]; @@ -250,15 +276,18 @@ sub showrange { '' . $_->{name}, '' . ($_->{min} || '0'), '' . ($_->{gas} || ''), - '' . sprintf('%.0f', $_->{build} || '0'), + sprintf('%s%.0f', + !!$_->{base} && '+', + $_->{build} || '0', + ), sprintf('%s', $sizechar, ucfirst $sizechar), '' . join('', $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ', defined $_->{organic} && sprintf( - '%s', + '%s', $_->{organic} ? 'o' : 'u', - $_->{race} . ($_->{organic} ? 'o' : ''), - $_->{organic} ? 'o' : 'm' + $_->{organic} ? 'organic' : 'mechanic', + $_->{organic} ? 'o' : 'm', ), ), '' . $_->{hp}, @@ -293,22 +322,25 @@ sub showrange { } } :> - +

Legend

-
+
cost
minerals+gas required to create one unit +
includes total expenses if based on existing units
build
relative time needed to create at least one unit +
excludes construction of dependencies such as buildings + and +parent units
size -
Small, +
affected by Small, Medium, or Large unit damage
number of command points taken per unit -
organic/mechanic unit +
organic/mechanic unit
HP
total number of hitpoints (including shields)
shield @@ -319,7 +351,7 @@ sub showrange {
base unit armor
can be increased by upto 3 at various facilities
each point decreases damage per hit by one, upto a minimum of ½ -
reduction applies to initial damage, before size penalties (so a large plasma hit of 12 to 4 armor deals 2 damage, not ½) +
reduction applies to initial damage, before size penalties (so a plasma hit of 12 to 4 armor large deals 2 damage, not ½)
ground/air
damage done per single attack against ground/air units
2nd column indicates relative amount of damage done in @@ -339,7 +371,7 @@ sub showrange {
relative speed of movement (when in full motion, startup speed ignored)
specials
special abilities -
parentheses () indicated that it needs to be researched first +
parentheses () indicate that it needs to be researched first
hover for description
range is maximum range required to activate
cost is percentage of total energy lost @@ -350,28 +382,5 @@ When two values are given (1-2), second value indicates attribute after all possible upgrades.

-<: exit :> -

Magic

- -
    <: -for (@$units) { - print '
  • ', $_->{name}; - print '
    '; -# my $units = {qw/protoss W zerg B terran R/}->{$_->{race}} x int($_->{unit} + .5); -# my $cost = int(($_->{min} + $_->{gas}) / 50 - $_->{unit}) || ''; - my $units = {qw/protoss W zerg B terran R/}->{$_->{race}} x int($_->{gas} / 50) || ''; - my $cost = int($_->{min} / 50) || 0; - my @desc; - push @desc, "Flying" if $_->{flying}; - push @desc, "Cloaking" if $_->{cloak}; - push @desc, "First Strike" if $_->{range} and $_->{range} >= 4; - my $att = $_->{attack}->{ground}; - push @desc, "Trample" if $att and $att->{splash}; - $att = $att->{damage} if $att; - $att = $att->[0] if ref $att eq "ARRAY"; - $att = int($att / 5); - my $def = int($_->{hp} / 45); - printf "%s
    %s
    %s/%s", $cost . $units, join(",", @desc), $att, $def; -} -:>
+