line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
449
|
use 5.16.0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
3
|
|
|
|
|
|
|
package Games::Nintendo::Mario::SMB2 0.208; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use base qw(Games::Nintendo::Mario::Hearts); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
593
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
sub _names { qw[Mario Luigi Peach Toad] } |
8
|
2
|
|
|
2
|
|
6
|
sub _states { qw[normal] } # super isn't listed to prevent creation-as-super |
9
|
4
|
|
|
4
|
|
9
|
sub _items { qw[mushroom heart] } |
10
|
|
|
|
|
|
|
|
11
|
6
|
|
|
6
|
|
13
|
sub _goto_hash { {} } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _char_attr { |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
|
0
|
Mario => { |
16
|
|
|
|
|
|
|
power => 4, |
17
|
|
|
|
|
|
|
speed => 4, |
18
|
|
|
|
|
|
|
jump => 4 |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
Luigi => { |
21
|
|
|
|
|
|
|
power => 3, |
22
|
|
|
|
|
|
|
speed => 3, |
23
|
|
|
|
|
|
|
jump => 5 |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
Peach => { |
26
|
|
|
|
|
|
|
power => 2, |
27
|
|
|
|
|
|
|
speed => 2, |
28
|
|
|
|
|
|
|
jump => 3 |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
Toad => { |
31
|
|
|
|
|
|
|
power => 5, |
32
|
|
|
|
|
|
|
speed => 5, |
33
|
|
|
|
|
|
|
jump => 2 |
34
|
|
|
|
|
|
|
} } |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub state { ## no critic Homonym |
38
|
13
|
|
|
13
|
1
|
13
|
my $hero = shift; |
39
|
13
|
100
|
|
|
|
34
|
if ($hero->hearts < 1) { return "dead" } |
|
2
|
|
|
|
|
7
|
|
40
|
11
|
100
|
|
|
|
25
|
if ($hero->hearts > 1) { return "super" } |
|
3
|
|
|
|
|
17
|
|
41
|
8
|
|
|
|
|
23
|
else { return "normal" } |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
1
|
498
|
sub name { $_[0]->{name} } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub powerup { |
47
|
4
|
|
|
4
|
1
|
7
|
my $hero = shift; |
48
|
4
|
|
|
|
|
5
|
my $item = shift; |
49
|
|
|
|
|
|
|
|
50
|
4
|
100
|
100
|
|
|
18
|
if (($item eq 'mushroom') and ($hero->max_hearts < 5)) { |
51
|
2
|
|
|
|
|
4
|
$hero->{max_hearts}++; |
52
|
|
|
|
|
|
|
} |
53
|
4
|
|
|
|
|
14
|
$hero->SUPER::powerup($item); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
sub power { $_[0]->_char_attr->{$_[0]->name}->{power} } |
57
|
0
|
|
|
0
|
1
|
|
sub speed { $_[0]->_char_attr->{$_[0]->name}->{speed} } |
58
|
0
|
|
|
0
|
1
|
|
sub jump { $_[0]->_char_attr->{$_[0]->name}->{jump} } |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub games { |
61
|
0
|
|
|
0
|
1
|
|
return ('Super Mario Bros. 2'); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
"It's-a me! Mario!"; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |