' . showval($row, 'attack', $area, 'dps');
return $tagbase . $out;
}
@@ -233,57 +157,47 @@ sub showrange {
my ($row) = @_;
my $specials = $row->{special} or return '';
return join ' ', map {
- sprintf '%s',
+ sprintf '%s',
+ $_->{duration} < 0 && ' class="magic-perma"',
join('',
$_->{name},
$_->{desc} ? ": $_->{desc}" : '',
- $_->{range} ? sprintf(' (%s)', join ', ',
- "range $_->{range}",
-# "cost $_->{cost}",
+ $_->{range} || $_->{cost} ? sprintf(' (%s)', join ', ',
+ $_->{range} ? "range $_->{range}" : (),
+ $_->{cost} ? sprintf('cost %.0f%%',
+ 100 * $_->{cost} / $row->{energy}
+ ) : (),
) : '',
),
- $_->{abbr},
- } @$specials;
+ sprintf($_->{build} ? '(%s)' : '%s', $_->{abbr}),
+ } grep { defined $_->{abbr} } @{$specials};
}
- my $units = do 'sc-units.inc.pl';
- die "Cannot open unit data: $_\n" for $@ || $! || ();
- my $grouped = !exists $get{order};
- if (exists $get{order}) {
- $get{order} ||= '';
- if ($get{order} eq 'size') {
- $_->{order} = $_->{unit}*8 + $_->{suit} + $_->{hp}/512 + $_->{min}/8192 for @$units;
+ sub showunitcols {
+ my ($row) = @_;
+ local $_ = $row;
+ $_->{hp} += $_->{shield} if $_->{shield};
+ my $suitchar = '';
+ if ($_->{cargo} > 0) {
+ $suitchar = [qw/? s m l l h h h h/]->[abs $_->{cargo}];
}
- elsif ($get{order} eq 'cost') {
- $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
+ elsif ($_->{size}) {
+ $suitchar = [qw/s m l h h h/]->[$_->{size}];
}
- else {
- $units->[$_]->{order} = $_ for 0 .. $#$units;
+ elsif ($_->{suit}) {
+ $suitchar = [qw/? s m l/]->[$_->{suit}];
}
- }
- my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
- my ($race, $cat) = ('', '');
- for (@rows) {
- $race = $_->{race},
- printf '
%s
'."\n", $race, ucfirst $race
- if $grouped and $race ne $_->{race};
- $_->{cat} = $_->{race} if not $grouped;
- $_->{hp} += $_->{shield};
- my $suitchar = [qw/? s m l/]->[$_->{suit}];
- print(
- '
excludes construction of dependencies such as buildings
and +parent units
size
-
affected by Small,
+
<:
+if ($scver{major} > 1) {
+ :>transports can fit 8 Small,
+ 4 Medium,
+ 2 Large,
+ or a single Huge unit<:
+} else {
+ :>affected by Small,
Medium,
- or Large unit damage
+ or Large unit damage<:
+} :>
number of command points taken per unit
organic/mechanic unit
HP
@@ -358,8 +308,7 @@ sub showrange {
ground/air
damage done per single attack against ground/air units
2nd column indicates relative amount of damage done in
- a certain
- amount of time
+ 1 second of fastest game time
splash damage+ hits nearby objects as well
explosive damage does only
50% damage to small units, 75% to medium, 100% to large
@@ -373,7 +322,7 @@ sub showrange {
speed
relative speed of movement (when in full motion, startup speed ignored)
specials
-
special abilities
+
special abilities are usually casted manually, but some are always active
parentheses () indicate that it needs to be researched first