line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::CoC::Util; |
2
|
3
|
|
|
3
|
|
1270
|
use strict; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
93
|
|
3
|
3
|
|
|
3
|
|
17
|
use utf8; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
12
|
|
4
|
3
|
|
|
3
|
|
65
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
82
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1548
|
use parent qw/Exporter/; |
|
3
|
|
|
|
|
928
|
|
|
3
|
|
|
|
|
16
|
|
7
|
3
|
|
|
3
|
|
1680
|
use Smart::Args; |
|
3
|
|
|
|
|
71110
|
|
|
3
|
|
|
|
|
178
|
|
8
|
3
|
|
|
3
|
|
1897
|
use Moose; |
|
3
|
|
|
|
|
1441809
|
|
|
3
|
|
|
|
|
31
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw/ |
11
|
|
|
|
|
|
|
eq_any |
12
|
|
|
|
|
|
|
is_ccb |
13
|
|
|
|
|
|
|
get_target |
14
|
|
|
|
|
|
|
is_extream |
15
|
|
|
|
|
|
|
is_hard |
16
|
|
|
|
|
|
|
is_failed |
17
|
|
|
|
|
|
|
/; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub eq_any { |
20
|
4
|
|
|
4
|
0
|
8410
|
my ($target, $array) = @_; |
21
|
4
|
|
|
|
|
6
|
for my $item (@{ $array }) { |
|
4
|
|
|
|
|
12
|
|
22
|
11
|
100
|
|
|
|
40
|
return 1 if $target eq $item; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub is_ccb { |
27
|
12
|
|
|
12
|
0
|
2145
|
my ($command) = @_; |
28
|
12
|
|
|
|
|
78
|
return $command =~ /skill|ccb|cc/; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_target { |
32
|
7
|
|
|
7
|
0
|
2037
|
my ($command) = @_; |
33
|
7
|
|
|
|
|
32
|
$command =~ /(cc|ccb) ([1-9][0-9]*)/; |
34
|
7
|
|
|
|
|
35
|
return $2; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub is_extream { |
38
|
5
|
|
|
5
|
0
|
2007
|
my ($dice, $target) = @_; |
39
|
5
|
|
|
|
|
50
|
my $rate = sprintf("%.5g", ($dice / $target)); |
40
|
5
|
|
|
|
|
34
|
return $rate <= 0.20000; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub is_hard { |
44
|
5
|
|
|
5
|
0
|
1822
|
my ($dice, $target) = @_; |
45
|
5
|
|
|
|
|
29
|
my $rate = sprintf("%.5g", ($dice / $target)); |
46
|
5
|
|
|
|
|
25
|
return $rate <= 0.50000; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub is_failed { |
50
|
5
|
|
|
5
|
0
|
1721
|
my ($dice, $target) = @_; |
51
|
5
|
|
|
|
|
20
|
return $dice > $target; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |