Mario/NSMB/Wii.pm

filter: Statementstmt 89.4% 17 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 100% 1 / 1 totaltotal 85.7% 24 / 28 CC 1 SCAR 2.2
CC
1
Cov
89%
_items
2.0
games
2.0
BEGIN
1.0
CRAP 1.2
« Mario/NSMB.pm ↑ Summary Mario/SMBTLL.pm »
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::NSMB::Wii 0.209;
4 # ABSTRACT: a class for Italian plumbers who wave their hands around
5  
6 1 ▶use parent qw(Games::Nintendo::Mario::NSMB);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 #pod =head1 WARNING!!
9 #pod
10 #pod Nobody has given RJBS a copy of NSMB Wii yet, so he hasn't played it, so this
11 #pod class may not be an accurate reflection of its behavior.
12 #pod
13 #pod =head1 SYNOPSIS
14 #pod
15 #pod use Games::Nintendo::Mario::NSMB::Wii;
16 #pod
17 #pod my $hero = Games::Nintendo::Mario::SMB->new(
18 #pod name => 'Blue Toad',
19 #pod state => 'normal',
20 #pod );
21 #pod
22 #pod $hero->powerup('mushroom'); # doop doop doop!
23 #pod $hero->powerup('flower'); # change clothes
24 #pod
25 #pod $hero->damage for (1 .. 2); # cue the Mario Death Music
26 #pod
27 #pod =head1 DESCRIPTION
28 #pod
29 #pod This class subclasses Games::Nintendo::Mario, providing a model of the behavior
30 #pod of the Mario Brothers in New Super Mario Bros. for Wii. All of the methods
31 #pod described in the Mario interface exist as documented.
32 #pod
33 #pod =head2 NAMES
34 #pod
35 #pod The plumber may be named Mario or Luigi, or can be "Blue Toad" or "Yellow
36 #pod Toad."
37 #pod
38 #pod =head2 STATES
39 #pod
40 #pod The plumber's state may be any of: normal super fire shell mini mega ice
41 #pod penguin propeller
42 #pod
43 #pod =head2 POWERUPS
44 #pod
45 #pod Valid powerups are: mushroom flower shell mega_mushroom mini_mushroom
46 #pod ice_flower penguinsuit propeller_mushroom
47 #pod
48 #pod =method games
49 #pod
50 #pod This ruleset reflects Mario in New Super Mario Bros. Wii, the first SMB game
51 #pod for Nintendo Wii.
52 #pod
53 #pod =cut
54  
55 1 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 10 ▶sub _names { ('Mario', 'Luigi', 'Blue Toad', 'Yellow Toad') }
Subroutine _names: called CC=1 SCAR=0.0
58 10 ▶sub _states { qw[normal super fire shell mini mega propeller ice penguin] }
Subroutine _states: called CC=1 SCAR=0.0
59 0 ▶sub _items { qw[mushroom flower shell mega_mushroom mini_mushroom propeller_mushroom ice_flower penguinsuit] }
Subroutine _items: not called CC=1 SCAR=6.9
60  
61 1 my %__default_behavior = (
62 damage => 'dead',
63 mushroom => 'super',
64 flower => 'fire',
65 shell => 'shell',
66 mega_mushroom => 'mega',
67 mini_mushroom => 'mini',
68 propeller_mushroom => 'propeller',
69 ice_flower => 'ice',
70 penguinsuit => 'penguin',
71 );
72  
73 my %state = (
74 normal => { %__default_behavior },
75 super => {
76 %__default_behavior,
77 damage => 'normal',
78 mushroom => 'save',
79 },
80 fire => {
81 %__default_behavior,
82 damage => 'normal',
83 flower => 'save',
84 mushroom => 'save',
85 },
86 shell => {
87 %__default_behavior,
88 damage => 'super',
89 mushroom => 'save',
90 flower => 'save',
91 },
92 1 mega => { map { $_ => 'ignore' } keys %__default_behavior },
93 mini => { %__default_behavior, mini => 'save' },
94  
95 propeller => {
96 %__default_behavior,
97 damage => 'normal',
98 mushroom => 'save',
99 },
100 ice => {
101 %__default_behavior,
102 damage => 'normal',
103 mushroom => 'save',
104 },
105 penguin => {
106 %__default_behavior,
107 damage => 'normal',
108 mushroom => 'save',
109 },
110 );
111  
112 0 ▶sub games {
Subroutine games: not called CC=1 SCAR=6.9
Pod documented
113 0 return ('New Super Mario Bros. Wii');
114 }
115  
116 1 "Go Wigi!";
117  
118 __END__
« Mario/NSMB.pm ↑ Summary Mario/SMBTLL.pm »