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:
6cbcbe6
)
sc: simplify code by concatenating all showattack() output
author
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 19 Jun 2015 01:04:16 +0000
(
03:04
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 19 Jun 2015 01:04:16 +0000
(
03:04
+0200)
sc.plp
patch
|
blob
|
history
diff --git
a/sc.plp
b/sc.plp
index 08cbc45890e414dd64efefc0098eb0068b6aad45..c8be6c7cebb55dfa42a6548661f40572ca54a741 100644
(file)
--- a/
sc.plp
+++ b/
sc.plp
@@
-113,19
+113,19
@@
sub showrange {
my $attack = $row->{attack}->[$area]
or return '<td colspan=4 class="hurt">';
my $attack = $row->{attack}->[$area]
or return '<td colspan=4 class="hurt">';
- my $
tagbase
= '';
- $
tagbase
.= '<td class="unit hurt-g">' . '▽' x !!($attack->{anti} & 1);
- $
tagbase
.= '<td class="unit hurt-a">' . '△' x !!($attack->{anti} & 2);
- $
tagbase
.= '<td class="val hurt';
+ my $
out
= '';
+ $
out
.= '<td class="unit hurt-g">' . '▽' x !!($attack->{anti} & 1);
+ $
out
.= '<td class="unit hurt-a">' . '△' x !!($attack->{anti} & 2);
+ $
out
.= '<td class="val hurt';
if (ref $attack and $attack->{type}) {
if ($attack->{type} eq 'explosive') {
if (ref $attack and $attack->{type}) {
if ($attack->{type} eq 'explosive') {
- $
tagbase
.= ' unit-l';
+ $
out
.= ' unit-l';
}
elsif ($attack->{type} eq 'implosive') {
}
elsif ($attack->{type} eq 'implosive') {
- $
tagbase
.= ' unit-s';
+ $
out
.= ' unit-s';
}
}
}
}
- $
tagbase
.= '">';
+ $
out
.= '">';
my $upattack = $row->{upgraded}->{attack}->[$area];
my $maxdamage =
my $upattack = $row->{upgraded}->{attack}->[$area];
my $maxdamage =
@@
-133,7
+133,7
@@
sub showrange {
($damage, $maxdamage) = ($damage->[0], $upattack->{damage} // $damage->[-1])
if ref $damage;
($damage, $maxdamage) = ($damage->[0], $upattack->{damage} // $damage->[-1])
if ref $damage;
-
my $out
= showrange($damage, $maxdamage);
+
$out .
= showrange($damage, $maxdamage);
$out .= sprintf('<span class="unit-splash" title="%s">%s</span>',
$attack->{splash} eq 'line' ? ('linear', '×') : ('splash', '+')
) if $attack->{splash};
$out .= sprintf('<span class="unit-splash" title="%s">%s</span>',
$attack->{splash} eq 'line' ? ('linear', '×') : ('splash', '+')
) if $attack->{splash};
@@
-154,7
+154,7
@@
sub showrange {
$out .= showrange($damage, $maxdamage);
}
$out .= showrange($damage, $maxdamage);
}
- return $
tagbase . $
out;
+ return $out;
}
sub showmagic {
}
sub showmagic {