diff --git a/bin/lacuna.psgi b/bin/lacuna.psgi index 77458c73..ea2793a6 100644 --- a/bin/lacuna.psgi +++ b/bin/lacuna.psgi @@ -35,6 +35,7 @@ $urlmap->map("/facebook" => Lacuna::Web::Facebook->new->to_app); $urlmap->map("/apikey" => Lacuna::Web::ApiKey->new->to_app); # buildings +$urlmap->map(Lacuna::RPC::Building::PantheonOfHagness->new->to_app_with_url); $urlmap->map(Lacuna::RPC::Building::Capitol->new->to_app_with_url); $urlmap->map(Lacuna::RPC::Building::Stockpile->new->to_app_with_url); $urlmap->map(Lacuna::RPC::Building::Algae->new->to_app_with_url); diff --git a/docs/Buildings.pod b/docs/Buildings.pod index e987c633..df6669f7 100644 --- a/docs/Buildings.pod +++ b/docs/Buildings.pod @@ -392,6 +392,8 @@ Below is a list of the different types of structures that can be built on planet =item L +=item L + =item L =item L diff --git a/docs/PantheonOfHagness.pod b/docs/PantheonOfHagness.pod new file mode 100644 index 00000000..b4e69ac1 --- /dev/null +++ b/docs/PantheonOfHagness.pod @@ -0,0 +1,7 @@ +=head1 Pantheon of Hagness Methods + +Pantheon of Hagness is accessible via the URL C. + +The list of methods below represents changes and additions to the methods that all L share. + +=cut diff --git a/lib/Lacuna/Constants.pm b/lib/Lacuna/Constants.pm index 360d10f0..3c5231f2 100644 --- a/lib/Lacuna/Constants.pm +++ b/lib/Lacuna/Constants.pm @@ -8,6 +8,7 @@ use constant GROWTH => 1.55; use constant FOOD_TYPES => (qw(cheese bean lapis potato apple root corn cider wheat bread soup chip pie pancake milk meal algae syrup fungus burger shake beetle)); use constant ORE_TYPES => (qw(rutile chromite chalcopyrite galena gold uraninite bauxite goethite halite gypsum trona kerogen methane anthracite sulfur zircon monazite fluorite beryl magnetite)); use constant FINDABLE_PLANS => (qw( + Lacuna::DB::Result::Building::Permanent::PantheonOfHagness Lacuna::DB::Result::Building::Permanent::CitadelOfKnope Lacuna::DB::Result::Building::Permanent::CrashedShipSite Lacuna::DB::Result::Building::Permanent::InterDimensionalRift diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index a29e755a..1d00a53f 100644 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -1015,6 +1015,7 @@ sub spend_efficiency { 'Lacuna::DB::Result::Building::Permanent::LapisForest' => 'Lacuna::DB::Result::Building::Permanent::LapisForest', 'Lacuna::DB::Result::Building::Permanent::AlgaePond' => 'Lacuna::DB::Result::Building::Permanent::AlgaePond', 'Lacuna::DB::Result::Building::Permanent::Ravine' => 'Lacuna::DB::Result::Building::Permanent::Ravine', + 'Lacuna::DB::Result::Building::Permanent::PantheonOfHagness' => 'Lacuna::DB::Result::Building::Permanent::PantheonOfHagness', }); } diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index d8a69894..7bf71264 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -217,6 +217,13 @@ my %recipies = ( sulfur => { plan => 'Lacuna::DB::Result::Building::Permanent::Beach8', }, + trona => { + beryl => { + anthracite => { + plan => 'Lacuna::DB::Result::Building::Permanent::PantheonOfHagness', + }, + }, + }, uraninite => { plan => 'Lacuna::DB::Result::Building::Permanent::Beach4', }, diff --git a/lib/Lacuna/DB/Result/Building/Permanent/PantheonOfHagness.pm b/lib/Lacuna/DB/Result/Building/Permanent/PantheonOfHagness.pm new file mode 100644 index 00000000..7b8c513d --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Permanent/PantheonOfHagness.pm @@ -0,0 +1,42 @@ +package Lacuna::DB::Result::Building::Permanent::PantheonOfHagness; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Permanent'; + +use constant controller_class => 'Lacuna::RPC::Building::PantheonOfHagness'; +use Lacuna::Util qw(randint); + +around can_build => sub { + my ($orig, $self, $body) = @_; + if ($body->get_plan(__PACKAGE__, 1)) { + return $orig->($self, $body); + } + confess [1013,"You can't build the Pantheon Of Hagness. It was left behind by the Great Race."]; +}; + +sub can_upgrade { + confess [1013, "You can't upgrade the Pantheon Of Hagness. It was left behind by the Great Race."]; +} + +use constant image => 'pantheonofhagness'; + +sub image_level { + my ($self) = @_; + return $self->image.'1'; +} + +after finish_upgrade => sub { + my $self = shift; + $self->body->add_news(50, sprintf('No one is certain how, but measurements of %s from the ground indicate it\'s bigger than measurements from space.', $self->body->name)); +}; + +use constant name => 'Pantheon of Hagness'; + +use constant time_to_build => 0; +use constant max_instances_per_planet => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index bfdc0656..c0b2002f 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -601,7 +601,7 @@ sub recalc_stats { $stats{$type.'_production_hour'} = 0; } #calculate building production - my ($gas_giant_platforms, $terraforming_platforms); + my ($gas_giant_platforms, $terraforming_platforms, $pantheon_of_hagness); while (my $building = $buildings->next) { $stats{waste_capacity} += $building->waste_capacity; $stats{water_capacity} += $building->water_capacity; @@ -634,19 +634,10 @@ sub recalc_stats { if ($building->isa('Lacuna::DB::Result::Building::Permanent::TerraformingPlatform')) { $terraforming_platforms += $building->level; } - } - - # deal with plot usage - my $max_plots = $self->size; - if ($self->isa('Lacuna::DB::Result::Map::Body::Planet::GasGiant')) { - $max_plots = $gas_giant_platforms < $max_plots ? $gas_giant_platforms : $max_plots; - } - if ($self->isa('Lacuna::DB::Result::Map::Body::Planet')) { - if ($self->orbit > $self->empire->max_orbit || $self->orbit < $self->empire->min_orbit) { - $max_plots = $terraforming_platforms < $max_plots ? $terraforming_platforms : $max_plots; + if ($building->isa('Lacuna::DB::Result::Building::Permanent::PantheonOfHagness')) { + $pantheon_of_hagness += $building->level; } } - $stats{plots_available} = $max_plots - $self->building_count; # deal with ore overages my $overage; @@ -665,6 +656,19 @@ sub recalc_stats { if ($stats{ore_hour} < 0) { # if there's not enough total ore production to go around $stats{gold_hour} = $stats{ore_hour}; # arbitrarily assign it to one type } + + # deal with plot usage + my $max_plots = $self->size + $pantheon_of_hagness; + if ($self->isa('Lacuna::DB::Result::Map::Body::Planet::GasGiant')) { + $max_plots = $gas_giant_platforms < $max_plots ? $gas_giant_platforms : $max_plots; + } + if ($self->isa('Lacuna::DB::Result::Map::Body::Planet')) { + if ($self->orbit > $self->empire->max_orbit || $self->orbit < $self->empire->min_orbit) { + $max_plots = $terraforming_platforms < $max_plots ? $terraforming_platforms : $max_plots; + } + } + $stats{plots_available} = $max_plots - $self->building_count; + $self->update(\%stats); return $self; } diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index e5232cbf..8fc25bf7 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -195,6 +195,7 @@ use constant MEDALS => { CitadelOfKnope => 'Discovered the Citadel of Knope', KalavianRuins => 'Discovered the Kalavian Ruins', MassadsHenge => 'Discovered Massad\'s Henge', + PantheonOfHagness => 'Discovered the Pantheon of Hagness', Volcano => 'Discovered a Volcano', TempleOfTheDrajilites => 'Discovered the Temple of the Drajilites', GeoThermalVent => 'Discovered a Geo Thermal Vent', diff --git a/lib/Lacuna/RPC/Building/PantheonOfHagness.pm b/lib/Lacuna/RPC/Building/PantheonOfHagness.pm new file mode 100644 index 00000000..bfc951c3 --- /dev/null +++ b/lib/Lacuna/RPC/Building/PantheonOfHagness.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::PantheonOfHagness; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/pantheonofhagness'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::Permanent::PantheonOfHagness'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/var/www/public/resources.json b/var/www/public/resources.json index 385486a2..8242f902 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -1,5 +1,6 @@ { "buildings" : { + "/pantheonofhagness" : { "description" : "Increases the number of available plots on your planet.", "wiki" : "http://community.lacunaexpanse.com/wiki/pantheon-of-hagness" }, "/crashedshipsite" : { "description" : "Harvest technology from a crashed ship to make your own ships better.", "wiki" : "http://community.lacunaexpanse.com/wiki/crashed-ship-site" }, "/citadelofknope" : { "description" : "Defends your planet from incoming hostile ships by absorbing the damage onto itself.", "wiki" : "http://community.lacunaexpanse.com/wiki/citadel-of-knope" }, "/ravine" : { "description" : "A natural place to store waste.", "wiki" : "http://community.lacunaexpanse.com/wiki/ravine" }, @@ -115,7 +116,7 @@ "smuggler_ship" : { "description" : "Stealthy transport ship. Can be used to push resources between your colonies, trade with other empires, or gather ore from mining platforms.", "wiki" : "http://community.lacunaexpanse.com/wiki/smuggler-ship" }, "mining_platform_ship" : { "description" : "Allows the gathering of resources from asteroids.", "wiki" : "http://community.lacunaexpanse.com/wiki/mining-platform-ship" }, "terraforming_platform_ship" : { "description" : "Allows you to settle planets your species could not normally colonize.", "wiki" : "http://community.lacunaexpanse.com/wiki/terraforming-platform-ship" }, - "gas_giant_settlement_ship" : { "description" : "Allows you to settle gas giants.", "wiki" : "http://community.lacunaexpanse.com/wiki/gas-giant-settlement-platform-ship" }, + "gas_giant_settlement_ship" : { "description" : "Allows you to settle gas giants.", "wiki" : "http://community.lacunaexpanse.com/wiki/gas-giant-settlement-ship" }, "scow" : { "description" : "Robotic waste transport ship. Can be used to dispose of waste in space.", "wiki" : "http://community.lacunaexpanse.com/wiki/scow" }, "dory" : { "description" : "Small transport ship. Can be used to push resources between your colonies, trade with other empires, or gather ore from mining platforms.", "wiki" : "http://community.lacunaexpanse.com/wiki/dory" }, "freighter" : { "description" : "Large transport ship. Can be used to push resources between your colonies, trade with other empires, or gather ore from mining platforms.", "wiki" : "http://community.lacunaexpanse.com/wiki/freighter" },