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