From: Mischa POSLAWSKY Date: Mon, 22 Jun 2015 07:37:57 +0000 (+0200) Subject: sc: transport slots instead or in addition to unit size X-Git-Tag: v1.8~105 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/a691b071501b1ef5239752a1e594a449e8c2d16d sc: transport slots instead or in addition to unit size --- diff --git a/sc-units-hots.inc.pl b/sc-units-hots.inc.pl index df37944..2efb4b4 100644 --- a/sc-units-hots.inc.pl +++ b/sc-units-hots.inc.pl @@ -1013,6 +1013,7 @@ use strict; cat => 'base', name => 'Mule', pop => 0, + cargo => 0, min => 0, build => 0, size => 0.75, diff --git a/sc.css b/sc.css index 17aec81..7ad23e1 100644 --- a/sc.css +++ b/sc.css @@ -47,7 +47,11 @@ table h2 { color: #C88; font-size: 70%; } -.unit-s {color: #770} +.unit-air { + color: #08C; +} +.unit-x {color: #888} +.unit-s {color: #890} .unit-m {color: #C70} .unit-l {color: #D22} .unit-h {color: #804} diff --git a/sc.plp b/sc.plp index 09ae989..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,10 +241,11 @@ 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} || '-', ''), ), sprintf('%s', defined $_->{pop} && $_->{pop} < 0 && ' unit-supply', @@ -282,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%%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) { @@ -407,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)