From 2be226fc5a32cdb245a971b3c69034416fe86c33 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Mon, 7 May 2012 16:51:51 -0600 Subject: [PATCH] Stockpile change --- lib/Lacuna.pm | 2 +- lib/Lacuna/DB/Result/Building.pm | 17 +++++++++++++---- var/www/public/changes.txt | 6 ++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index a6378232..1bcb383b 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0850; +our $VERSION = 3.0851; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index d666779d..ffc00769 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -682,17 +682,26 @@ sub is_not_max_level { if ($self->level >= 30) { confess [1009, 'This building is already at its maximum level.']; } - if ($self->level >= 15 && 'Resources' ~~ [$self->build_tags] && (!('Storage' ~~ [$self->build_tags]) || $self->isa('Lacuna::DB::Result::Building::Waste::Exchanger'))) { # resource buildings except storage buildings (treat a Waste Exchanger as if it were not a storage building) + my $max_level = 15; + if ($self->body->empire->university_level > 25) { + $max_level += ($self->body->empire->university_level - 25); + } + if ($self->level >= $max_level && + 'Resources' ~~ [ $self->build_tags] && (!('Storage' ~~ [$self->build_tags]) + || $self->isa('Lacuna::DB::Result::Building::Waste::Exchanger'))) { +# resource buildings except storage buildings (treat a Waste Exchanger as if it were not a storage building) my $stockpile = $self->body->get_building_of_class('Lacuna::DB::Result::Building::Stockpile'); if (defined $stockpile) { - if (15 + $stockpile->extra_resource_levels > $self->level) { + if ($max_level + $stockpile->extra_resource_levels > $self->level) { return 1; } else { - confess [1013, 'You must upgrade your Stockpile to upgrade this building further.']; + confess [1013, + sprintf("The maximum level of this building is %d with your University level and stockpile.", + $max_level + $stockpile->extra_resource_levels) ]; } } - confess [1013, 'Resource buildings cannot upgrade above level 15 without a Stockpile.']; + confess [1013, 'Resource buildings cannot upgrade above level '.$max_level.' without a Stockpile.']; } return 1; } diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index cb0748fb..5acfb48d 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,9 @@ +3.0851: + - Mod: Change in consumption rates for secondary food. +# - Fix: Colony ships and trade ships in flight away from insurrected planet now switch flag to their own Capitol. +# - Fix: Bleeders no longer count toward population totals. + - Mod: Stockpile change is testing. + 3.0850: - Fix: All non-trade inflight ships self destruct from an insurrected planet. -- 2.54.0