X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/4a625d5eed49b9c5b46fa9c7d4b6e04fa355fc64..ce2e637541f303d2967f7d424c3ea8240e579172:/sc.plp diff --git a/sc.plp b/sc.plp index 5d82a8d..d1c6fc8 100644 --- a/sc.plp +++ b/sc.plp @@ -119,6 +119,15 @@ sub showrange { return "$min-$max"; } + sub showcost { + my ($row, $unit) = @_; + return join(' ', + sprintf('cost %.0f%%', 100 * $row->{cost} / $unit->{energy}), + !defined $row->{maint} ? () : + sprintf('+%.1f%%/s', 100 * $row->{maint} / $unit->{energy}), + ); + } + sub showattack { my ($row, $area) = @_; my $attack = $row->{attack}->[$area] @@ -130,6 +139,8 @@ sub showrange { $maxdamage += ($upattack->{upgrade} // $attack->{upgrade}) * 3; my $out = '