Ninja/Action2.pm untested

filter: Statementstmt 0.0% 0 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 5 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
CRAP 2.0
1 sub new {
2 ### This Action uses 2 other Actions such as HitAction, HittedAction
3 ### instead of functors as in Action.pm
4  
5 ### NOTE that both actions can be at the same time to care
6 ### for defense, god mode etc. Actions' functors can e.g. use
7 ### the Metropolis algorithm in this codebase.
8  
9 ### hitaction is what you hit with and hittedaction is the action
10 ### on which you get hit
11  
12 my ($class, $entity1, $entity2, $hitaction, $hittedaction) = @_;
13  
14 $self = { playerentity => $entity1, adversaryentity => $entity2,
15 hitaction => $hitaction, hittedaction => $hittedaction, };
16  
17 bless $self, $class;
18 };
19  
20 1;