line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BalanceOfPower::Commands::AddRoute; |
2
|
|
|
|
|
|
|
$BalanceOfPower::Commands::AddRoute::VERSION = '0.400115'; |
3
|
13
|
|
|
13
|
|
61
|
use Moo; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
75
|
|
4
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
3060
|
use BalanceOfPower::Constants ":all"; |
|
13
|
|
|
|
|
15
|
|
|
13
|
|
|
|
|
7079
|
|
6
|
13
|
|
|
13
|
|
81
|
use BalanceOfPower::Utils qw( prev_turn ); |
|
13
|
|
|
|
|
38
|
|
|
13
|
|
|
|
|
3006
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'BalanceOfPower::Commands::NoArgs'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub IA |
11
|
|
|
|
|
|
|
{ |
12
|
3
|
|
|
3
|
0
|
7
|
my $self = shift; |
13
|
3
|
|
|
|
|
12
|
my $actor = $self->get_nation(); |
14
|
3
|
|
|
|
|
16
|
my $prev_year = prev_turn($actor->current_year); |
15
|
3
|
|
|
|
|
14
|
my @trade_ok = $actor->get_events("TRADE OK", $prev_year); |
16
|
3
|
|
|
|
|
12
|
my @trade_ko = $actor->get_events("TRADE KO", $prev_year); |
17
|
3
|
|
|
|
|
11
|
my @remains = $actor->get_events("REMAIN", $prev_year); |
18
|
3
|
|
|
|
|
8
|
my @deleted = $actor->get_events("TRADEROUTE DELETED", $prev_year); |
19
|
3
|
|
|
|
|
9
|
my @boost = $actor->get_events("BOOST OF PRODUCTION", $prev_year); |
20
|
3
|
50
|
66
|
|
|
24
|
if(@remains > 0 && @deleted == 0 && @boost == 0) |
|
|
|
66
|
|
|
|
|
21
|
|
|
|
|
|
|
{ |
22
|
1
|
|
|
|
|
2
|
my $rem = $remains[0]; |
23
|
1
|
|
|
|
|
5
|
$rem =~ m/^REMAIN (.*)$/; |
24
|
1
|
|
|
|
|
3
|
my $remaining = $1; |
25
|
1
|
50
|
|
|
|
5
|
if($remaining >= TRADING_QUOTE) |
26
|
|
|
|
|
|
|
{ |
27
|
1
|
|
|
|
|
4
|
return "ADD ROUTE"; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
2
|
|
|
|
|
5
|
return undef; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |