| 1 | package BalanceOfPower::Commands::EconomicAid; | ||
| 2 | $BalanceOfPower::Commands::EconomicAid::VERSION = '0.200000'; | ||
| 3 | use Moo; | ||
| 4 | |||
| 5 | |||
| 6 | extends 'BalanceOfPower::Commands::TargetNation'; | ||
| 7 | |||
| 8 | sub IA | ||
| 9 | { | ||
| 10 | my $self = shift; | ||
| 11 | my $actor = $self->get_nation(); | ||
| 12 | |||
| 13 | my @hates = $self->world->get_hates($actor->name); | ||
| 14 | if(@hates) | ||
| 15 | { | ||
| 16 | #Minor hate is used | ||
| 17 | @hates = sort { $b->factor <=> $a->factor } @hates; | ||
| 18 | my $other = $hates[0]->destination($actor->name); | ||
| 19 | return "ECONOMIC AID FOR $other"; | ||
| 20 | } | ||
| 21 | return undef; | ||
| 22 | } | ||
| 23 | |||
| 24 | 1; |