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 (from parent 1:
ed44d79
)
sc: option to order by hp
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 21 Apr 2018 18:25:41 +0000
(20:25 +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 8f512164cc4c8a1ab0bcb34d38c3f7f84389b42e..711e4203e82617da25e7f6283889242f07d07717 100644
(file)
--- a/
sc.plp
+++ b/
sc.plp
@@
-98,7
+98,7
@@
sub coltoggle {
<th class="val time"><:= coltoggle(qw'build cost') :></th>
<th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
<th class="unit" colspan="2">attr</th>
<th class="val time"><:= coltoggle(qw'build cost') :></th>
<th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
<th class="unit" colspan="2">attr</th>
- <th class="val unit-hp">
HP
</th>
+ <th class="val unit-hp">
<:= coltoggle(HP => 'hp') :>
</th>
<th class="val unit-shield">shield</th>
<th class="val unit-armor" title="armor">⛨</th>
<th class="val hurt"><:= coltoggle(attack => 'attack') :></th>
<th class="val unit-shield">shield</th>
<th class="val unit-armor" title="armor">⛨</th>
<th class="val hurt"><:= coltoggle(attack => 'attack') :></th>
@@
-346,6
+346,11
@@
sub showrangeint {
if ($get{order} eq 'name') {
@rows = sort {$a->{name} cmp $b->{name}} @rows;
}
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
elsif ($get{order} eq 'cost') {
$_->{order} = (
$_->{gas}*1.5 + $_->{min} + $_->{pop}/8 + $_->{build}/256/8