git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7914537
)
sc: option to order by build time
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 21 Apr 2018 18:49:40 +0000
(20:49 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 10 May 2018 14:49:06 +0000
(16:49 +0200)
sc.plp
patch
|
blob
|
history
diff --git
a/sc.plp
b/sc.plp
index b20e51df3597e6feda0506b2f8af7ea2233c6701..d0b269144c5df9db3712d882d69389465b1403d6 100644
(file)
--- a/
sc.plp
+++ b/
sc.plp
@@
-95,7
+95,7
@@
sub coltoggle {
<th><:= coltoggle(name => 'name') :></th>
<th class="val min" title=minerals><:= coltoggle(cost => 'cost') :></th>
<th class="val gas">gas</th>
<th><:= coltoggle(name => 'name') :></th>
<th class="val min" title=minerals><:= coltoggle(cost => 'cost') :></th>
<th class="val gas">gas</th>
- <th class="val time">
build
</th>
+ <th class="val time">
<:= coltoggle(build => 'build') :>
</th>
<th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
<th class="unit" colspan="2">attr</th>
<th class="val unit-hp"><:= coltoggle(HP => 'hp') :></th>
<th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
<th class="unit" colspan="2">attr</th>
<th class="val unit-hp"><:= coltoggle(HP => 'hp') :></th>
@@
-356,6
+356,15
@@
sub showrangeint {
$_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8
) for @rows;
}
$_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8
) for @rows;
}
+ elsif ($get{order} eq 'build') {
+ my %unittime = map { ($_->{name} => $_->{warp} // $_->{build}) } @rows;
+ $unittime{Templar} = $unittime{'High Templar'};
+ $_->{order} = (
+ ($_->{warp} // $_->{build})
+ + ($_->{gas}*1.5 + $_->{min} + $_->{pop}/8)/1024
+ + ($_->{base} ? ($unittime{$_->{base}->[0]} // 100) + 1 : 0)
+ ) for @rows;
+ }
elsif ($get{order} eq 'size') {
$_->{order} = (
$_->{pop}*16 + ($_->{size} // $_->{suit}) + $_->{cargo}/8
elsif ($get{order} eq 'size') {
$_->{order} = (
$_->{pop}*16 + ($_->{size} // $_->{suit}) + $_->{cargo}/8