X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/e75dbcba340459a1bef997680a7d1bf152039a32..a691b071501b1ef5239752a1e594a449e8c2d16d:/sc.plp
diff --git a/sc.plp b/sc.plp
index dc32a47..5b7e4a7 100644
--- a/sc.plp
+++ b/sc.plp
@@ -233,25 +233,6 @@ sub showrange {
my ($row) = @_;
local $_ = $row;
$_->{hp} += $_->{shield} if $_->{shield};
- my $suitchar = '';
- if ($_->{attr}->{structure}) {
- $suitchar = 'b';
- }
- elsif ($_->{suit}) {
- $suitchar = [qw/? s m l/]->[$_->{suit}];
- }
- 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';
- }
return (
'
' . ($_->{min} // ''),
@@ -260,13 +241,15 @@ sub showrange {
!!$_->{base} && '+',
$_->{build} || '0',
),
- !$suitchar ? ' | ' : sprintf(' | %s%s',
- $suitchar, ucfirst $suitchar,
- $_->{attr}->{massive}
- && 'â',
+ sprintf(' | %s',
+ $_->{cargo} < 0 ? ('supply', T => 'transport') :
+ $_->{attr}->{flying} ? ('air', F => 'flying') :
+ $_->{attr}->{structure} ? ('x', B => 'building') :
+ ([qw( x s m l l h h h h )]->[ $_->{cargo} ], $_->{cargo} || '-', ''),
),
- ' | ' . (
- defined $_->{unit} && $_->{unit} == .5 ? '½' : $_->{unit}
+ sprintf(' | %s',
+ defined $_->{pop} && $_->{pop} < 0 && ' unit-supply',
+ defined $_->{pop} && $_->{pop} == .5 ? '½' : $_->{pop},
),
' | ' . join('', grep { $_ }
(defined $_->{organic} ? !$_->{organic} : $_->{attr}->{mech})
@@ -281,6 +264,17 @@ sub showrange {
&& 'A',
$_->{attr}->{light}
&& 'L',
+ $_->{suit} && sprintf(
+ '%s',
+ map { @{$_} } [
+ [qw( x ? unknown )],
+ [qw( s S small )],
+ [qw( m M medium )],
+ [qw( l L large )],
+ ]->[ $_->{suit} ],
+ ),
+ $_->{attr}->{massive}
+ && 'â',
),
' | ' . $_->{hp} // '',
$_->{shield} ? sprintf(' | %.0f%% | {order} = (
- $_->{unit}*16 + ($_->{size} // $_->{suit}) + $_->{cargo}/8
+ $_->{pop}*16 + ($_->{size} // $_->{suit}) + $_->{cargo}/8
+ $_->{hp}/512 + $_->{min}/8192
) for @$units;
}
elsif ($get{order} eq 'cost') {
$_->{order} = (
- $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8
+ $_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8
) for @$units;
}
elsif ($get{order} eq 'attack') {
@@ -384,19 +378,9 @@ sub showrange {
excludes construction of dependencies such as buildings
and +parent units
size
- <:
-if ($scver{major} > 1) {
- :>transports can fit 8 Small,
- 4 Medium,
- 2 Large,
- or a single Huge unit
- massive â units
- cannot be lifted or slowed and can break force fields<:
-} else {
- :>affected by Small,
- Medium, or
- Large unit damage<:
-} :>
+ Transports can fit upto
+ 8
+ non-Flying units
number of command points taken per unit
<:
if ($scver{major} > 1) {
@@ -406,9 +390,14 @@ if ($scver{major} > 1) {
Ï(ps)ionic,
Light, and
Armored
- attributes<:
+ attributes
+ massive â units
+ cannot be lifted or slowed and can break force fields<:
} else {
- :>organic/mechanic unit<:
+ :>organic/mechanic unit
+ affected by Small,
+ Medium, or
+ Large unit damage<:
} :>
HP
total number of hitpoints (including shields)
|