Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Spy Training and SpacePort Seekers.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemming552 committed Jan 4, 2013
1 parent 1d2a6ca commit 21cc669
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Lacuna/DB/Result/Building/IntelTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/Lacuna/DB/Result/Building/MayhemTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/Lacuna/DB/Result/Building/PoliticsTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/Lacuna/DB/Result/Building/TheftTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 15 additions & 3 deletions lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
2 changes: 2 additions & 0 deletions var/www/public/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 21cc669

Please sign in to comment.