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