| 1 | package BalanceOfPower::Commands::InMilitaryRange; | ||||||||||
| 2 | 11 | $BalanceOfPower::Commands::InMilitaryRange::VERSION = '0.300010'; | |||||||||
| 3 | 11 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 11 | extends 'BalanceOfPower::Commands::TargetNation'; | |||||||||
| 6 | |||||||||||
| 7 | 11 | has crisis_needed => ( | |||||||||
| 8 | is => 'ro', | ||||||||||
| 9 | default => 0 | ||||||||||
| 10 | ); | ||||||||||
| 11 | |||||||||||
| 12 | sub get_available_targets | ||||||||||
| 13 | { | ||||||||||
| 14 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
get_available_targets: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||
| 15 | 0 | my $player = $self->actor; | |||||||||
| 16 | 0 | my @out = (); | |||||||||
| 17 | 0 | for($self->SUPER::get_available_targets()) | |||||||||
| 18 | { | ||||||||||
| 19 | 0 | my $n = $_; | |||||||||
| 20 | 0 | my $push = 0; | |||||||||
| 21 | 0 | ▶ | if($self->world->in_military_range($player, $n)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | { | ||||||||||
| 23 | 0 | ▶ | if($self->crisis_needed) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | { | ||||||||||
| 25 | 0 | ▶ | if($self->world->crisis_exists($player, $n)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | { | ||||||||||
| 27 | 0 | $push = 1; | |||||||||
| 28 | } | ||||||||||
| 29 | } | ||||||||||
| 30 | else | ||||||||||
| 31 | { | ||||||||||
| 32 | 0 | $push = 1; | |||||||||
| 33 | } | ||||||||||
| 34 | } | ||||||||||
| 35 | 0 | ▶ | if($push) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | { | ||||||||||
| 37 | 0 | push @out, $n; | |||||||||
| 38 | } | ||||||||||
| 39 | } | ||||||||||
| 40 | 0 | return @out; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 11 | 1; | |||||||||