X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/e75dbcba340459a1bef997680a7d1bf152039a32..5fdb6bb62ed0471d0bb82f19865e47ab3bd0625a:/sc.plp
diff --git a/sc.plp b/sc.plp
index dc32a47..ec79a7c 100644
--- a/sc.plp
+++ b/sc.plp
@@ -98,7 +98,8 @@ sub coltoggle {
|
|
<:= coltoggle(qw'build cost') :> |
- <:= coltoggle(qw'size size') :> |
+ <:= coltoggle(qw'size size') :> |
+ attr |
HP |
shield |
⨠|
@@ -114,7 +115,7 @@ sub showrange {
my ($min, $max) = @_;
return '' if not defined $min;
$_ &&= int($_ + .5) for $min, $max; # round halves up
- return $min if not defined $max or $min == $max;
+ return $min || '-' if not defined $max or $min == $max;
return "$min-$max";
}
@@ -233,25 +234,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 +242,21 @@ sub showrange {
!!$_->{base} && '+',
$_->{build} || '0',
),
- !$suitchar ? ' | ' : sprintf(' | %s%s',
- $suitchar, ucfirst $suitchar,
- $_->{attr}->{massive}
- && 'â',
+ sprintf(' | %s',
+ $_-> {cargo} < 0 ? ('supply', T => 'transport') :
+ $_->{upgraded}->{cargo} < 0 ? ('supply magic-opt', T => 'optional transport') :
+ $_->{attr}->{flying} ? ('air', F => 'flying') :
+ $_->{attr}->{structure} ? ('x', B => 'building') :
+ (
+ [qw( x s m l l h h h h )]->[ $_->{cargo} ],
+ $_->{cargo} || '-',
+ $_->{cargo} ? 'transportable' : 'untransportable',
+ ),
+ defined $_->{size} && sprintf('â%.1f ', $_->{size}),
),
- ' | ' . (
- 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 +271,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%% | {speed}, $_->{upgraded}->{speed}),
$_->{attr}->{jump}
&& qq'â',
- $_->{attr}->{flying}
- && qq'â',
' | ' . showmagic($_),
!$_->{attack}->[1] ? () : (
' | ', showattack($_, 1), ' | '
@@ -316,13 +315,13 @@ sub showrange {
$get{order} ||= '';
if ($get{order} eq 'size') {
$_->{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 +383,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 +395,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)
|