| 1 | package BalanceOfPower::Commands::RecallMilitarySupport; | ||||||||||
| 2 | 11 | $BalanceOfPower::Commands::RecallMilitarySupport::VERSION = '0.200000'; | |||||||||
| 3 | 11 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 11 | ▶ | use BalanceOfPower::Constants ':all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 11 | extends 'BalanceOfPower::Commands::TargetNation'; | |||||||||
| 8 | |||||||||||
| 9 | sub get_available_targets | ||||||||||
| 10 | { | ||||||||||
| 11 | 12 | ▶ | my $self = shift; | ||||||||
|
Subroutine
get_available_targets: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 12 | 12 | my @supported = $self->world->supporter($self->actor); | |||||||||
| 13 | 12 | my @out = (); | |||||||||
| 14 | 12 | for(@supported) | |||||||||
| 15 | { | ||||||||||
| 16 | 1 | push @out, $_->destination($self->actor); | |||||||||
| 17 | } | ||||||||||
| 18 | 12 | return @out; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | sub IA | ||||||||||
| 22 | { | ||||||||||
| 23 | 15 | ▶ | my $self = shift; | ||||||||
|
Subroutine
IA: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 24 | 15 | my $actor = $self->get_nation(); | |||||||||
| 25 | 15 | ▶ | if($actor->army <= ARMY_TO_RECALL_SUPPORT) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | { | ||||||||||
| 27 | 12 | my @supports = $self->get_available_targets(); | |||||||||
| 28 | 12 | ▶ | if(@supports > 0) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | { | ||||||||||
| 30 | 1 | @supports = $self->world->shuffle("Choosing support to recall", @supports); | |||||||||
| 31 | 1 | return "RECALL MILITARY SUPPORT " . $supports[0]; | |||||||||
| 32 | } | ||||||||||
| 33 | } | ||||||||||
| 34 | 14 | return undef; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 11 | 1; | |||||||||