Mario/SMB3.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 91.3% 21 / 23 CC 1 SCAR 1.2
CC
1
Cov
93%
games
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Mario/SMB.pm ↑ Summary
1 1 ▶use 5.20.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Games::Nintendo::Mario::SMB3 0.209;
4 # ABSTRACT: a class for fuzzy-tailed Italian plumbers
5  
6 1 ▶use parent qw(Games::Nintendo::Mario);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 #pod =head1 SYNOPSIS
9 #pod
10 #pod use Games::Nintendo::Mario::SMB3;
11 #pod
12 #pod my $hero = Games::Nintendo::Mario::SMB->new(
13 #pod name => 'Mario',
14 #pod state => 'hammer',
15 #pod );
16 #pod
17 #pod $hero->powerup('mushroom'); # Nothing happens.
18 #pod $hero->damage; # back to super
19 #pod
20 #pod print "It's-a me! ", $hero->name, "!\n"; # 'Super Mario'
21 #pod
22 #pod $hero->powerup('frogsuit'); # Nothing happens.
23 #pod
24 #pod $hero->damage for (1 .. 2); # cue the Mario Death Music
25 #pod
26 #pod =head1 DESCRIPTION
27 #pod
28 #pod This class subclasses Games::Nintendo::Mario, providing a model of the behavior
29 #pod of the Mario Brothers in Super Mario Brothers 3. All of the methods described
30 #pod in the Mario interface exist as documented.
31 #pod
32 #pod =head2 NAMES
33 #pod
34 #pod The plumber may be named Mario or Luigi.
35 #pod
36 #pod =head2 STATES
37 #pod
38 #pod The plumber's state may be any of: C<normal>, C<super>, C<fire>, C<raccoon>,
39 #pod C<tanooki>, C<hammer>, C<frog>, or C<pwing>
40 #pod
41 #pod =head2 POWERUPS
42 #pod
43 #pod Valid powerups are: C<mushroom>, C<flower>, C<leaf>, C<tanookisuit>,
44 #pod C<hammersuit>, C<frogsuit>, or C<pwing>
45 #pod
46 #pod =method games
47 #pod
48 #pod This ruleset reflects Mario in Super Mario Bros. 3.
49 #pod
50 #pod =cut
51  
52 1 ▶sub _names { qw[Mario Luigi] }
Subroutine _names: called CC=1 SCAR=0.0
53 1 ▶sub _states { qw[normal super fire raccoon tanooki frog hammer pwing] }
Subroutine _states: called CC=1 SCAR=0.0
54 2 ▶sub _items { qw[mushroom flower leaf tanookisuit frogsuit hammersuit pwing] }
Subroutine _items: called CC=1 SCAR=0.0
55  
56 3 ▶sub _goto_hash {
Subroutine _goto_hash: called CC=1 SCAR=0.0
57 {
58 3 damage => {
59 normal => 'dead',
60 super => 'normal',
61 _else => 'super'
62 },
63 mushroom => {
64 normal => 'super'
65 },
66 flower => 'fire',
67 leaf => 'raccoon',
68 tanookisuit => 'tanooki',
69 hammersuit => 'hammer',
70 frogsuit => 'frog',
71 pwing => 'pwing'
72 }
73 }
74  
75 0 ▶sub games {
Subroutine games: not called CC=1 SCAR=6.9
Pod documented
76 0 return ('Super Mario Bros. 3');
77 }
78  
79 1 "It's-a me! Mario!";
80  
81 __END__
« Mario/SMB.pm ↑ Summary