diff --git a/lib/Lacuna/DB/Result/Building/IntelTraining.pm b/lib/Lacuna/DB/Result/Building/IntelTraining.pm index e38f623b..6e3d7292 100644 --- a/lib/Lacuna/DB/Result/Building/IntelTraining.pm +++ b/lib/Lacuna/DB/Result/Building/IntelTraining.pm @@ -124,7 +124,7 @@ sub training_costs { $train_time = int($train_time * $unhappy_workers); } $train_time = 5184000 if ($train_time > 5184000); # Max time per spy is 60 days - $train_time = 3600 if ($train_time < 3600); # Min time is 1 hour + $train_time = 21600 if ($train_time < 21600); # Min time is 6 hour push @{$costs->{time}}, { spy_id => $spy->id, name => $spy->name, diff --git a/lib/Lacuna/DB/Result/Building/MayhemTraining.pm b/lib/Lacuna/DB/Result/Building/MayhemTraining.pm index ab9238cf..948f6c64 100644 --- a/lib/Lacuna/DB/Result/Building/MayhemTraining.pm +++ b/lib/Lacuna/DB/Result/Building/MayhemTraining.pm @@ -125,7 +125,7 @@ sub training_costs { $train_time = int($train_time * $unhappy_workers); } $train_time = 5184000 if ($train_time > 5184000); # Max time per spy is 60 days - $train_time = 3600 if ($train_time < 3600); # Min time is 1 hour + $train_time = 21600 if ($train_time < 21600); # Min time is 6 hour push @{$costs->{time}}, { spy_id => $spy->id, name => $spy->name, diff --git a/lib/Lacuna/DB/Result/Building/PoliticsTraining.pm b/lib/Lacuna/DB/Result/Building/PoliticsTraining.pm index b6b80735..224336b2 100644 --- a/lib/Lacuna/DB/Result/Building/PoliticsTraining.pm +++ b/lib/Lacuna/DB/Result/Building/PoliticsTraining.pm @@ -122,7 +122,7 @@ sub training_costs { $train_time = int($train_time * $unhappy_workers); } $train_time = 5184000 if ($train_time > 5184000); # Max time per spy is 60 days - $train_time = 3600 if ($train_time < 3600); # Min time is 1 hour + $train_time = 21600 if ($train_time < 21600); # Min time is 6 hour push @{$costs->{time}}, { spy_id => $spy->id, name => $spy->name, diff --git a/lib/Lacuna/DB/Result/Building/TheftTraining.pm b/lib/Lacuna/DB/Result/Building/TheftTraining.pm index f8462a8f..425b613f 100644 --- a/lib/Lacuna/DB/Result/Building/TheftTraining.pm +++ b/lib/Lacuna/DB/Result/Building/TheftTraining.pm @@ -122,7 +122,7 @@ sub training_costs { $train_time = int($train_time * $unhappy_workers); } $train_time = 5184000 if ($train_time > 5184000); # Max time per spy is 60 days - $train_time = 3600 if ($train_time < 3600); # Min time is 1 hour + $train_time = 21600 if ($train_time < 21600); # Min time is 6 hour push @{$costs->{time}}, { spy_id => $spy->id, name => $spy->name, diff --git a/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm b/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm index 9ff21d89..0260d91c 100644 --- a/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm +++ b/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm @@ -21,12 +21,24 @@ after handle_arrival_procedures => sub { if (defined $citadel) { $building = $citadel; } - if ($self->target_building) { + elsif ($self->target_building) { + my @builds; for my $tb ( @{$self->target_building} ) { - $building ||= $body_attacked->get_building_of_class($tb); + my @temp = $body_attacked->get_buildings_of_class($tb); + if (@temp) { + push @builds, @temp; + } } + ($building) = + sort { + $b->efficiency <=> $a->efficiency || + rand() <=> rand() + } + grep { + ($_->efficiency > 0) + } @builds; } - if (not defined $building) { + else { ($building) = sort { $b->efficiency <=> $a->efficiency || diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 3ffc6a5f..1ac41f3b 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -6,6 +6,8 @@ - Add: Individual builds can be subsidized in the Development Ministry - Add: Fissures send email if they don't find a fissure at target. - Fix: Influence no longer left from dead SS added into stats. + - Fix: Minimum extra spy training time made consistant. + - Fix: Spaceport Seekers hit a random Spaceport, not just the same one. 3.0876: - Add: Seasonal gift