lib/BalanceOfPower/Commands/RebelMilitarySupport.pm

filter: Statementstmt 22.2% 6 / 27 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 0.0% 0 / 2 totaltotal 18.4% 7 / 38 CC 6 SCAR 26.8
CC
6
Cov
18%
get_available_targets
20.0
IA
12.0
BEGIN
1.0
CRAP 14.6
« blib/lib/BalanceOfPower/Role/Supporter.pm ↑ Summary lib/BalanceOfPower/Role/Supporter.pm »
1 package BalanceOfPower::Commands::RebelMilitarySupport;
2 11 $BalanceOfPower::Commands::RebelMilitarySupport::VERSION = '0.300010';
3 11 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 11 extends 'BalanceOfPower::Commands::TargetNation';
6  
7 sub get_available_targets
8 {
9 0 ▶ my $self = shift;
Subroutine get_available_targets: not called CC=4 SCAR=30.0
Pod undocumented
10 0 my $player = $self->actor;
11 0 my @ns = grep { $self->world->at_civil_war($_) } @{$self->world->nation_names};
12 0 my @out = ();
13 0 for(@ns)
14 {
15 0 my $rebsup = $self->world->rebel_supported($_);
16 0 ▶ if($rebsup)
Branch: 1 branch
BranchTrueFalseTotal
if ($rebsup) { } 0 0 0
17 {
18 0 ▶ if($rebsup->node1 eq $player)
Branch: 1 branch
BranchTrueFalseTotal
if ($rebsup->node1 eq $player) 0 0 0
19 {
20 0 push @out, $_;
21 }
22 }
23 else
24 {
25 0 push @out, $_;
26 }
27 }
28 0 return @out;
29 }
30  
31 sub IA
32 {
33 0 ▶ my $self = shift;
Subroutine IA: not called CC=3 SCAR=24.8
Pod undocumented
34 0 my $player = $self->actor;
35 0 my @enemies = $self->world->get_hates($self->actor);
36 0 @enemies = $self->world->shuffle("Choosing enemy for rebel support for " . $self->actor, @enemies);
37 0 foreach my $e (@enemies)
38 {
39 0 my $target = $e->destination($self->actor);
40 0 ▶ if($self->good_target($target))
Branch: 1 branch
BranchTrueFalseTotal
if ($self->good_target($target)) 0 0 0
41 {
42 0 return "REBEL MILITARY SUPPORT " . $e->destination($self->actor);
43 }
44 }
45 }
46  
47 11 1;
« blib/lib/BalanceOfPower/Role/Supporter.pm ↑ Summary lib/BalanceOfPower/Role/Supporter.pm »