diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 6176c543..54cf08e5 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -1201,7 +1201,7 @@ sub recalc_stats { $stats{$method} += $building->$method(); $food_production_hour += $building->$method(); } - if ($building->isa('Lacuna::DB::Result::Building::SpacePort') and $building->efficiency == 100) { + if ($building->isa('Lacuna::DB::Result::Building::SpacePort') and $building->effective_efficiency == 100) { $stats{max_berth} = $building->effective_level if ($building->effective_level > $stats{max_berth}); } if ($building->isa('Lacuna::DB::Result::Building::Ore::Ministry')) { @@ -1219,7 +1219,7 @@ sub recalc_stats { while (my $waste_chain = $waste_chains->next) { my $percent = $waste_chain->percent_transferred; $percent = $percent > 100 ? 100 : $percent; - $percent *= $building->efficiency / 100; + $percent *= $building->effective_efficiency / 100; my $waste_hour = sprintf('%.0f',$waste_chain->waste_hour * $percent / 100); $stats{waste_hour} -= $waste_hour; } @@ -1230,7 +1230,7 @@ sub recalc_stats { while (my $out_chain = $output_chains->next) { my $percent = $out_chain->percent_transferred; $percent = $percent > 100 ? 100 : $percent; - $percent *= $building->efficiency / 100; + $percent *= $building->effective_efficiency / 100; my $resource_hour = sprintf('%.0f',$out_chain->resource_hour * $percent / 100); my $resource_name = $self->resource_name($out_chain->resource_type); @@ -1272,7 +1272,7 @@ sub recalc_stats { while (my $in_chain = $input_chains->next) { my $percent = $in_chain->percent_transferred; $percent = $percent > 100 ? 100 : $percent; - $percent *= $in_chain->building->efficiency / 100; + $percent *= $in_chain->building->effective_efficiency / 100; my $resource_hour = sprintf('%.0f',$in_chain->resource_hour * $percent / 100); my $resource_name = $self->resource_name($in_chain->resource_type); $stats{$resource_name} += $resource_hour; @@ -1548,7 +1548,7 @@ sub tick_to { } # Process excavator sites if ( my $arch = $self->archaeology) { - if ($arch->efficiency == 100 and $arch->effective_level > 0) { + if ($arch->effective_efficiency == 100 and $arch->effective_level > 0) { my $dig_sec = $now->epoch - $arch->last_check->epoch; if ($dig_sec >= 3600) { my $dig_hours = int($dig_sec/3600); diff --git a/lib/Lacuna/DB/Result/Propositions/FireBfg.pm b/lib/Lacuna/DB/Result/Propositions/FireBfg.pm index e49cf4ef..42b8cf41 100644 --- a/lib/Lacuna/DB/Result/Propositions/FireBfg.pm +++ b/lib/Lacuna/DB/Result/Propositions/FireBfg.pm @@ -49,15 +49,26 @@ before pass => sub { $self->pass_extra_message('Unfortunately, by the time the proposition passed, the planet was no longer occupied.'); } } - else { + elsif ($parl) { $parl->level($parl->level - 1); - $parl->efficiency($parl->efficiency - 25); - $parl->update; + if ($parl->level >= 1) + { + $parl->spend_efficiency(120); # becomes 25% + $parl->update; + $self->station->add_news(49, sprintf('The parliament of %s suffered a malfunction today while trying to fire their BFG.', $self->station->name)); + } + else + { + $parl->demolish; + $self->station->add_news(99, sprintf('The parliament of %s suffered a critical malfunction today while trying to fire their BFG.', $self->station->name)); + } $self->station->update; - $self->station->add_news(49, sprintf('The parliament of %s suffered a malfunction today while trying to fire their BFG.', $self->station->name)); $self->pass_extra_message('Unfortunately, by the time the proposition passed, the station no longer had sufficient resources to fire with.'); } + else { + $self->pass_extra_message('Unfortunately, by the time the proposition passed, there was no parliament to enact it.'); + } } else { $self->pass_extra_message('Unfortunately, by the time the proposition passed, the planet was no longer in the Station\'s jurisdiction, effectively nullifying the vote.'); diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 68a8c598..099ec264 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -5,6 +5,7 @@ - Add: Fleet Lite - Mod: Sweepers adjusted for balance. - Fix: Most buildings should no longer ignore uni level. + - Add: Overheating Parliament does damage. 3.0908: - Mod: trash_messages_where now defaults to not returning deleted message IDs.