line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BalanceOfPower::Commands::MilitaryAid; |
2
|
|
|
|
|
|
|
$BalanceOfPower::Commands::MilitaryAid::VERSION = '0.400110'; |
3
|
13
|
|
|
13
|
|
42
|
use Moo; |
|
13
|
|
|
|
|
12
|
|
|
13
|
|
|
|
|
1461
|
|
4
|
13
|
|
|
13
|
|
7276
|
use BalanceOfPower::Constants ":all"; |
|
13
|
|
|
|
|
768
|
|
|
13
|
|
|
|
|
6400
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'BalanceOfPower::Commands::TargetNation'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub IA |
10
|
|
|
|
|
|
|
{ |
11
|
8
|
|
|
8
|
0
|
10
|
my $self = shift; |
12
|
8
|
|
|
|
|
17
|
my $actor = $self->get_nation(); |
13
|
|
|
|
|
|
|
|
14
|
8
|
|
|
|
|
51
|
my @friends = $self->world->shuffle("Choosing nation to military aid for " . $actor->name, $self->world->get_friends($actor->name)); |
15
|
8
|
|
|
|
|
21
|
for(@friends) |
16
|
|
|
|
|
|
|
{ |
17
|
10
|
|
|
|
|
12
|
my $f = $_; |
18
|
10
|
100
|
|
|
|
33
|
if($self->world->get_nation($f)->army < MINIMUM_ARMY_FOR_AID) |
19
|
|
|
|
|
|
|
{ |
20
|
8
|
|
|
|
|
22
|
return "MILITARY AID FOR $f"; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
0
|
|
|
|
|
|
return undef; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |