X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/e75dbcba340459a1bef997680a7d1bf152039a32..3553bfad44ded8de93e288d7c73bd397c9d8a95a:/sc.plp diff --git a/sc.plp b/sc.plp index dc32a47..2a748dc 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,16 @@ 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} || '-', ''), ), - '' . ( - 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 +265,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 +309,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 +377,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 +389,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)