' .
+ showrange($attack->{range}, $upattack->{range});
+
+ return $out;
}
sub showmagic {
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}",
- ) : '',
+ (map { $_ && " ($_)" } join ', ',
+ #TODO: apply upgrades
+ $_->{range} ? "range $_->{range}" : (),
+ $_->{cost} ? sprintf('cost %.0f%%%s',
+ 100 * $_->{cost} / $row->{energy},
+ defined $_->{maint} && sprintf('+%.1f%%/s',
+ 100 * $_->{maint} / $row->{energy},
+ ),
+ ) :
+ $_->{cooldown} ? "cooldown $_->{cooldown}s" : (),
+ ),
),
- $_->{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 ($_->{attr}->{structure}) {
+ $suitchar = 'b';
}
- elsif ($get{order} eq 'cost') {
- $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
+ elsif ($_->{suit}) {
+ $suitchar = [qw/? s m l/]->[$_->{suit}];
}
- else {
- $units->[$_]->{order} = $_ for 0 .. $#$units;
+ elsif ($_->{cargo} > 0) {
+ $suitchar = [qw/? s m l l h h h h/]->[abs $_->{cargo}];
+ }
+ elsif ($_->{size}) {
+ $suitchar = [qw/s m l h h h/]->[$_->{size}];
+ }
+ elsif ($_->{attr} and $_->{attr}->{light}) {
+ $suitchar = 's';
+ }
+ elsif ($_->{attr} and $_->{attr}->{armored}) {
+ $suitchar = 'l';
}
- }
- 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(
- '
each point decreases damage per hit by one, upto a minimum of ½
-
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
- a certain
- amount of time
-
splash damage+ hits nearby objects as well
-
explosive damage does only
+
reduction applies to initial damage, before size penalties
+ (so a plasma hit of 12 to 4 armor large deals 2 damage, not ½)
+
attack
+
damage given per single hit
+
dps indicates relative amount of damage
+ done in 1 second of in-game time
+
splash damage hits all objects nearby â
+ or in a straight line +.
+
<:
+if ($scver{major} > 1) {
+ :>does not include ≥bonus damage
+ dealt to susceptible unit types
+
â¢projectile shots are negated by
+ Point Defense Drones<:
+} else {
+ :>*explosive damage does only
50% damage to small units, 75% to medium, 100% to large
-
concussive/plasma damage does
- 25% to large, 50% medium, 100% to small units
+
~concussive/plasma damage does
+ 25% to large, 50% medium, 100% to small units<:
+} :>
+
targets â½ ground
+ and/or â³ air
+
range
+
maximum range of weapon (note siege tank also has a minimum range)
sight
range in which the unit detects other units
emphasis indicates ability to detect cloaked units
-
range
-
maximum range of weapon (note siege tank also has a minimum range)
speed
relative speed of movement (when in full motion, startup speed ignored)
specials
-
special abilities
parentheses () indicate that it needs to be researched first
+