From: Mischa POSLAWSKY Date: Fri, 19 Jun 2015 06:00:49 +0000 (+0200) Subject: sc: add best case bonus damage to maximum dps X-Git-Tag: v1.8~131 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/e63f4654e84f3753b2f271189ec8f9b7ddb5322a sc: add best case bonus damage to maximum dps --- diff --git a/sc.plp b/sc.plp index c8f508d..e5a5b44 100644 --- a/sc.plp +++ b/sc.plp @@ -1,4 +1,5 @@ <(common.inc.plp)><: +use List::Util qw(max); my %scver = ( id => 'bw', @@ -157,6 +158,11 @@ sub showrange { } } $damage *= ($attack->{count} // 1) / $attack->{cooldown}; + if (my $bonus = $upattack->{bonus} // $attack->{bonus}) { + $maxdamage += $_ for max( + map { ref $_ ? $_->[-1] : $_ } values %{$bonus} + ); + } $maxdamage *= ($upattack->{count} // $attack->{count} // 1) / ($upattack->{cooldown} // $attack->{cooldown}); $out .= showrange($damage, $maxdamage);