From 7063bd42cefa83e06ad972f65f870848d0a99612 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 8 May 2012 11:24:56 -0600 Subject: [PATCH] Platform and plot fun. --- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 15 +++++++++++---- var/www/public/changes.txt | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 36d9b99f..c4897086 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -386,10 +386,11 @@ has building_count => ( lazy => 1, default => sub { my $self = shift; +# Bleeders count toward building count, but supply pods don't since they can't be shot down. return $self->buildings->search( { class => { 'not like' => 'Lacuna::DB::Result::Building::Permanent%', - '!=' => 'Lacuna::DB::Result::Building::DeployedBleeder' }, + '!=' => 'Lacuna::DB::Result::Building::SupplyPod' }, } )->count; }, @@ -932,13 +933,13 @@ sub recalc_stats { } } if ($building->isa('Lacuna::DB::Result::Building::Permanent::GasGiantPlatform')) { - $gas_giant_platforms += $building->level; + $gas_giant_platforms += int($building->level * $building->efficiency/100); } if ($building->isa('Lacuna::DB::Result::Building::Permanent::TerraformingPlatform')) { - $terraforming_platforms += $building->level; + $terraforming_platforms += int($building->level * $building->efficiency/100); } if ($building->isa('Lacuna::DB::Result::Building::Permanent::PantheonOfHagness')) { - $pantheon_of_hagness += $building->level; + $pantheon_of_hagness += int($building->level * $building->efficiency/100); } if ($building->isa('Lacuna::DB::Result::Building::Module::StationCommand')) { $station_command += $building->level; @@ -1002,6 +1003,12 @@ sub recalc_stats { } } $stats{plots_available} = $max_plots - $self->building_count; +# Decrease happiness production if short on plots. + if ($stats{plots_available} < 0) { + my $plot_tax = int(50 * 1.62 ** (abs($stats{plots_available})-1)); + $plot_tax = 120_000_000_000 if ($plot_tax > 120_000_000_000); + $stats{happiness_hour} -= $plot_tax; + } $self->update(\%stats); return $self; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 1d55b130..9cf0be6e 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -5,6 +5,8 @@ - Fix: Waste Chains have star_id change to current star in moved via BHG. - Mod: Stockpile change in testing. - Mod: Ships in a fleet will return at their own speed if on return trip. + - Mod: Damaged Platforms give plots based on efficiency. + - Mod: Having negative plots available makes your people unhappy. 3.0850: - Fix: All non-trade inflight ships self destruct from an insurrected planet. -- 2.51.2