lib/BalanceOfPower/Commands/DiplomaticPressure.pm

filter: Statementstmt 33.3% 6 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 0.0% 0 / 2 totaltotal 25.9% 7 / 27 CC 3 SCAR 16.1
CC
3
Cov
27%
get_available_targets
6.0
IA
6.0
BEGIN
1.0
CRAP 5.0
« lib/BalanceOfPower/Commands/AidInsurgents.pm ↑ Summary blib/lib/BalanceOfPower/Player.pm »
1 package BalanceOfPower::Commands::DiplomaticPressure;
2 11 $BalanceOfPower::Commands::DiplomaticPressure::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=2 SCAR=17.9
Pod undocumented
10 0 my @targets = $self->SUPER::get_available_targets();
11 0 my $nation = $self->actor;
12 0 ▶ @targets = grep { (! $self->world->is_under_influence($_)
Branch: 1 branch
BranchTrueFalseTotal
not $self->world->is_under_influence($_) or $self->world->is_under_influence($_) ne $nation 0 0 0
13 || $self->world->is_under_influence($_) ne $nation) } @targets;
14 0 return @targets;
15 }
16  
17  
18 sub IA
19 {
20 0 ▶ my $self = shift;
Subroutine IA: not called CC=2 SCAR=17.9
Pod undocumented
21 0 my $actor = $self->get_nation();
22 0 my @hates = $self->world->shuffle("Choosing target for diplomatic pressure for ". $self->actor, $self->world->get_nations_with_status($self->actor, ['HATE']));
23 0 ▶ if(@hates)
Branch: 1 branch
BranchTrueFalseTotal
if (@hates) { } 0 0 0
24 {
25 0 return "DIPLOMATIC PRESSURE ON " . $hates[0];
26 }
27 else
28 {
29 0 return undef;
30 }
31 }
32 11 1;
« lib/BalanceOfPower/Commands/AidInsurgents.pm ↑ Summary blib/lib/BalanceOfPower/Player.pm »