line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
860
|
use 5.20.0; |
|
2
|
|
|
|
|
15
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
121
|
|
3
|
|
|
|
|
|
|
package Games::Nintendo::Mario::SMB 0.209; |
4
|
|
|
|
|
|
|
# ABSTRACT: a class for mushroom-eating Italian plumbers |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
489
|
use parent qw(Games::Nintendo::Mario); |
|
2
|
|
|
|
|
391
|
|
|
2
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
9
|
|
|
|
|
|
|
#pod |
10
|
|
|
|
|
|
|
#pod use Games::Nintendo::Mario::SMB; |
11
|
|
|
|
|
|
|
#pod |
12
|
|
|
|
|
|
|
#pod my $hero = Games::Nintendo::Mario::SMB->new( |
13
|
|
|
|
|
|
|
#pod name => 'Luigi', |
14
|
|
|
|
|
|
|
#pod state => 'normal', |
15
|
|
|
|
|
|
|
#pod ); |
16
|
|
|
|
|
|
|
#pod |
17
|
|
|
|
|
|
|
#pod $hero->powerup('mushroom'); # doop doop doop! |
18
|
|
|
|
|
|
|
#pod $hero->powerup('flower'); # change clothes |
19
|
|
|
|
|
|
|
#pod |
20
|
|
|
|
|
|
|
#pod $hero->damage for (1 .. 2); # cue the Mario Death Music |
21
|
|
|
|
|
|
|
#pod |
22
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
23
|
|
|
|
|
|
|
#pod |
24
|
|
|
|
|
|
|
#pod This class subclasses Games::Nintendo::Mario, providing a model of the behavior |
25
|
|
|
|
|
|
|
#pod of the Mario Brothers in Super Mario Brothers. All of the methods described in |
26
|
|
|
|
|
|
|
#pod the Mario interface exist as documented. |
27
|
|
|
|
|
|
|
#pod |
28
|
|
|
|
|
|
|
#pod =head2 NAMES |
29
|
|
|
|
|
|
|
#pod |
30
|
|
|
|
|
|
|
#pod The plumber may be named Mario or Luigi. |
31
|
|
|
|
|
|
|
#pod |
32
|
|
|
|
|
|
|
#pod =head2 STATES |
33
|
|
|
|
|
|
|
#pod |
34
|
|
|
|
|
|
|
#pod The plumber's state may be any of: C, C, or C |
35
|
|
|
|
|
|
|
#pod |
36
|
|
|
|
|
|
|
#pod =head2 POWERUPS |
37
|
|
|
|
|
|
|
#pod |
38
|
|
|
|
|
|
|
#pod Valid powerups are: C and C |
39
|
|
|
|
|
|
|
#pod |
40
|
|
|
|
|
|
|
#pod =method games |
41
|
|
|
|
|
|
|
#pod |
42
|
|
|
|
|
|
|
#pod This ruleset reflects Mario in Super Mario Bros., the original SMB game. |
43
|
|
|
|
|
|
|
#pod |
44
|
|
|
|
|
|
|
#pod =cut |
45
|
|
|
|
|
|
|
|
46
|
16
|
|
|
16
|
|
49
|
sub _names { qw[Mario Luigi] } |
47
|
16
|
|
|
16
|
|
39
|
sub _states { qw[normal super fire] } |
48
|
7
|
|
|
7
|
|
18
|
sub _items { qw[mushroom flower] } |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _goto_hash { |
51
|
|
|
|
|
|
|
{ |
52
|
16
|
|
|
16
|
|
95
|
damage => { |
53
|
|
|
|
|
|
|
normal => 'dead', |
54
|
|
|
|
|
|
|
_else => 'normal' |
55
|
|
|
|
|
|
|
}, |
56
|
|
|
|
|
|
|
mushroom => { |
57
|
|
|
|
|
|
|
fire => 'fire', |
58
|
|
|
|
|
|
|
_else => 'super', |
59
|
|
|
|
|
|
|
}, |
60
|
|
|
|
|
|
|
flower => { |
61
|
|
|
|
|
|
|
normal => 'super', |
62
|
|
|
|
|
|
|
_else => 'fire' |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub games { |
68
|
0
|
|
|
0
|
1
|
|
return ('Super Mario Bros.'); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
"It's-a me! Mario!"; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |