<:= coltoggle(exists $get{order} ? 'race' : 'source' => '') :> |
<:= coltoggle(name => 'name') :> |
- <:= coltoggle(cost => 'cost') :> |
- gas |
+ <:= coltoggle(cost => 'cost') :> |
+ gas |
<:= coltoggle(build => 'build') :> |
<:= coltoggle(qw'size size') :> |
attr |
@@ -184,7 +191,8 @@ sub showrangeint {
sprintf('+%s vs %s',
showrangeint(
$attack->{bonus}->{$_},
- $attack->{bonus}->{$_} + $attack->{bonus}->{"-$_"} * 3,
+ ($upattack->{bonus} // $attack->{bonus})->{$_}
+ + ($upattack->{bonus} // $attack->{bonus})->{"-$_"} * 3,
),
$_,
),
@@ -264,8 +272,8 @@ sub showrangeint {
$_->{hp} += $_->{shield} if $_->{shield};
return (
- '' . ($_->{min} // ''),
- ' | ' . ($_->{gas} || ''),
+ ' | ' . ($_->{min} // ''),
+ ' | ' . ($_->{gas} || ''),
defined $_->{transform} ? sprintf(' | %.0f',
$_->{transform},
) :
@@ -366,11 +374,6 @@ sub showrangeint {
if ($get{order} eq 'name') {
@rows = sort {$a->{name} cmp $b->{name}} @rows;
}
- elsif ($get{order} eq 'hp') {
- $_->{order} = (
- $_->{hp}*1.01 + $_->{armor} + $_->{shield} + $_->{size}/1024,
- ) for @rows;
- }
elsif ($get{order} eq 'cost') {
$_->{order} = (
$_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8
@@ -391,6 +394,11 @@ sub showrangeint {
+ $_->{hp}/512 + $_->{min}/8192
) for @rows;
}
+ elsif ($get{order} eq 'hp') {
+ $_->{order} = (
+ $_->{hp}*1.01 + $_->{armor} + $_->{shield} + $_->{size}/1024,
+ ) for @rows;
+ }
elsif ($get{order} eq 'attack') {
$_->{order} = $_->{hp} / 1024 + $_->{shield} / 1008 + max(
map {
@@ -447,7 +455,8 @@ sub showrangeint {
- cost
-
- minerals and gas required to create one unit
+
- minerals and
+ gas required to create one unit
- includes total expenses if based on existing units
- build
- relative time needed to create at least one unit
|