From 4713b4876396efca2b3b2f7d21f15225c190bb8b Mon Sep 17 00:00:00 2001 From: lemming552 Date: Mon, 7 May 2012 23:20:39 -0600 Subject: [PATCH] Bleeder pop, ship empires retained after insurrection, ships return from destination at their own speed. --- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 2 ++ lib/Lacuna/DB/Result/Ships.pm | 5 ++++- lib/Lacuna/DB/Result/Spies.pm | 11 ++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 331bce6e..836aa593 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -375,6 +375,7 @@ has population => ( return $self->buildings->search( { class => { 'not like' => 'Lacuna::DB::Result::Building::Permanent%' }, + class => { '!=' => 'Lacuna::DB::Result::Building::DeployedBleeder' }, } )->get_column('level')->sum * 10_000; }, @@ -388,6 +389,7 @@ has building_count => ( return $self->buildings->search( { class => { 'not like' => 'Lacuna::DB::Result::Building::Permanent%' }, # these don't count against you + class => { '!=' => 'Lacuna::DB::Result::Building::DeployedBleeder' }, } )->count; }, diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index 131cdeb6..abc7c1bc 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -264,7 +264,10 @@ sub seconds_remaining { sub turn_around { my $self = shift; $self->direction( ($self->direction eq 'out') ? 'in' : 'out' ); - $self->date_available(DateTime->now->add_duration( $self->date_available - $self->date_started )); +# $self->date_available(DateTime->now->add_duration( $self->date_available - $self->date_started )); + $self->fleet_speed(0); + my $target = ($self->foreign_body_id) ? $self->foreign_body : $self->foreign_star; + $self->date_available(DateTime->now->add(seconds=>$self->calculate_travel_time($target))); $self->date_started(DateTime->now); return $self; } diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index 2d9df3e0..f1d17a99 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -1398,8 +1398,9 @@ sub steal_planet { task => { '!=' => 'Docked' } }); while (my $ship = $ships->next) { next if ($ship->task eq 'Waiting On Trade'); - next if ($ship->task eq 'Travelling' and - (grep { $ship->type eq $_ } @{['cargo_ship', + if ($ship->task eq 'Travelling' and + (grep { $ship->type eq $_ } + @{['cargo_ship', 'smuggler_ship', 'galleon', 'freighter', @@ -1407,7 +1408,11 @@ sub steal_planet { 'hulk_fast', 'hulk_huge', 'dory', - 'barge']})); + 'barge', + 'colony_ship', + 'short_range_colony_ship', + ]})) { + } $ship->delete; } -- 2.51.2