X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/e7d0872468d9ff54c39ac8a7e64f283ba093c7aa..c09dbeb9c62930fc46ec793d4f18eda815cd8c34:/sc.plp diff --git a/sc.plp b/sc.plp index 13248fb..0534c04 100644 --- a/sc.plp +++ b/sc.plp @@ -63,7 +63,7 @@ sub coltoggle { min gas <:= coltoggle(qw'build cost') :> - <:= coltoggle(qw'size size') :> + <:= coltoggle(qw'size size') :> HP shield armor @@ -181,6 +181,18 @@ sub showval { if ($_->{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} // ''), @@ -190,14 +202,22 @@ sub showval { $_->{build} || '0', ), !$suitchar ? '' : sprintf('%s', $suitchar, ucfirst $suitchar), - '' . join('', - defined $_->{unit} && $_->{unit} == .5 ? '½' : $_->{unit}, - defined $_->{organic} && sprintf( - '%s', - $_->{organic} ? 'o' : 'u', - $_->{organic} ? 'organic' : 'mechanic', - $_->{organic} ? 'o' : 'm', - ), + '' . ( + defined $_->{unit} && $_->{unit} == .5 ? '½' : $_->{unit} + ), + '' . join('', grep { $_ } + (defined $_->{organic} || $_->{attr}->{organic}) + && 'o', + (defined $_->{organic} ? !$_->{organic} : $_->{attr}->{mech}) + && 'm', + $_->{attr}->{psionic} + && 'ψ', + ), + '' . join('', grep { $_ } + $_->{attr}->{armored} + && 'A', + $_->{attr}->{light} + && 'L', ), '' . $_->{hp} // '', '' . ( @@ -212,6 +232,7 @@ sub showval { showval($_, 'sight') ), '' . showval($_, 'speed'), + $_->{attr}->{massive} && '☇', '' . showmagic($_), "\n" ); @@ -237,7 +258,7 @@ sub showval { my ($race, $cat) = ('', ''); for (@rows) { if ($grouped) { - printf '

%s

'."\n", + printf '

%s

'."\n", $race = $_->{race}, ucfirst $race unless $race eq $_->{race}; } @@ -275,9 +296,17 @@ sub showval {
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