From b44dea44d7132fa7c2563fea122c21c5f6c7c9db Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 27 Mar 2011 15:46:34 -0500 Subject: [PATCH] added inlfuence buildings --- add_a_building.txt | 3 +++ bin/lacuna.psgi | 25 +++++++++++-------- docs/ArtMuseum.pod | 7 ++++++ docs/CulinaryInstitute.pod | 7 ++++++ docs/Modules.pod | 6 +++++ docs/OperaHouse.pod | 7 ++++++ docs/Parliament.pod | 4 ++- lib/Lacuna/DB/Result/Building.pm | 3 +++ .../DB/Result/Building/Module/ArtMuseum.pm | 15 +++++++++++ .../Building/Module/CulinaryInstitute.pm | 15 +++++++++++ lib/Lacuna/DB/Result/Building/Module/IBS.pm | 2 +- .../DB/Result/Building/Module/OperaHouse.pm | 15 +++++++++++ lib/Lacuna/DB/Result/Building/SSLa.pm | 3 +++ lib/Lacuna/DB/Result/Medals.pm | 11 +++++--- lib/Lacuna/RPC/Building/ArtMuseum.pm | 21 ++++++++++++++++ lib/Lacuna/RPC/Building/CulinaryInstitute.pm | 21 ++++++++++++++++ lib/Lacuna/RPC/Building/OperaHouse.pm | 21 ++++++++++++++++ lib/Lacuna/RPC/Building/Parliament.pm | 4 +-- t/Parliament.t | 2 +- var/www/public/changes.txt | 1 + var/www/public/resources.json | 14 +++++++++++ 21 files changed, 187 insertions(+), 20 deletions(-) create mode 100644 docs/ArtMuseum.pod create mode 100644 docs/CulinaryInstitute.pod create mode 100644 docs/OperaHouse.pod create mode 100644 lib/Lacuna/DB/Result/Building/Module/ArtMuseum.pm create mode 100644 lib/Lacuna/DB/Result/Building/Module/CulinaryInstitute.pm create mode 100644 lib/Lacuna/DB/Result/Building/Module/OperaHouse.pm create mode 100644 lib/Lacuna/RPC/Building/ArtMuseum.pm create mode 100644 lib/Lacuna/RPC/Building/CulinaryInstitute.pm create mode 100644 lib/Lacuna/RPC/Building/OperaHouse.pm diff --git a/add_a_building.txt b/add_a_building.txt index db94b41f..a3d4ed9a 100644 --- a/add_a_building.txt +++ b/add_a_building.txt @@ -13,3 +13,6 @@ create wiki entry # if buildable add to Lacuna::Constants::BUILDABLE_CLASSES update the tech tree image + +# if it's a space station module +add it to the list of buildable modules in SSLa diff --git a/bin/lacuna.psgi b/bin/lacuna.psgi index 41840a9f..0af33c1b 100644 --- a/bin/lacuna.psgi +++ b/bin/lacuna.psgi @@ -79,10 +79,13 @@ my $app = builder { mount "/captcha" => Lacuna::RPC::Captcha->new->to_app; for my $building (qw( - Lacuna::RPC::Building::StationCommand - Lacuna::RPC::Building::IBS - Lacuna::RPC::Building::Warehouse - Lacuna::RPC::Building::Parliament + Lacuna::RPC::Building::Shipyard + Lacuna::RPC::Building::SpacePort + Lacuna::RPC::Building::Intelligence + Lacuna::RPC::Building::Security + Lacuna::RPC::Building::Trade + Lacuna::RPC::Building::Transporter + Lacuna::RPC::Building::Archaeology Lacuna::RPC::Building::DistributionCenter Lacuna::RPC::Building::SAW Lacuna::RPC::Building::AtmosphericEvaporator @@ -144,7 +147,6 @@ my $app = builder { Lacuna::RPC::Building::GasGiantPlatform Lacuna::RPC::Building::Geo Lacuna::RPC::Building::Hydrocarbon - Lacuna::RPC::Building::Intelligence Lacuna::RPC::Building::Lapis Lacuna::RPC::Building::Malcud Lacuna::RPC::Building::Mine @@ -162,19 +164,13 @@ my $app = builder { Lacuna::RPC::Building::Oversight Lacuna::RPC::Building::RockyOutcrop Lacuna::RPC::Building::Lake - Lacuna::RPC::Building::Security Lacuna::RPC::Building::Shake - Lacuna::RPC::Building::Shipyard Lacuna::RPC::Building::Singularity Lacuna::RPC::Building::Soup - Lacuna::RPC::Building::SpacePort Lacuna::RPC::Building::Syrup Lacuna::RPC::Building::TerraformingLab Lacuna::RPC::Building::GeneticsLab - Lacuna::RPC::Building::Archaeology Lacuna::RPC::Building::TerraformingPlatform - Lacuna::RPC::Building::Trade - Lacuna::RPC::Building::Transporter Lacuna::RPC::Building::University Lacuna::RPC::Building::WasteEnergy Lacuna::RPC::Building::WasteRecycling @@ -216,6 +212,13 @@ my $app = builder { Lacuna::RPC::Building::AmalgusMeadow Lacuna::RPC::Building::DentonBrambles Lacuna::RPC::Building::MercenariesGuild + Lacuna::RPC::Building::StationCommand + Lacuna::RPC::Building::OperaHouse + Lacuna::RPC::Building::ArtMuseum + Lacuna::RPC::Building::CulinaryInstitute + Lacuna::RPC::Building::IBS + Lacuna::RPC::Building::Warehouse + Lacuna::RPC::Building::Parliament )) { mount $building->new->to_app_with_url; } diff --git a/docs/ArtMuseum.pod b/docs/ArtMuseum.pod new file mode 100644 index 00000000..181abb1a --- /dev/null +++ b/docs/ArtMuseum.pod @@ -0,0 +1,7 @@ +=head1 Art Museum Methods + +Art Museum 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/docs/CulinaryInstitute.pod b/docs/CulinaryInstitute.pod new file mode 100644 index 00000000..915aa820 --- /dev/null +++ b/docs/CulinaryInstitute.pod @@ -0,0 +1,7 @@ +=head1 Culinary Institute Methods + +Culinary Institute 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/docs/Modules.pod b/docs/Modules.pod index fb92b9fa..4924984c 100644 --- a/docs/Modules.pod +++ b/docs/Modules.pod @@ -12,8 +12,14 @@ Below is a list of the different types of structures that can be built on space =over +=item L + +=item L + =item L +=item L + =item L =item L diff --git a/docs/OperaHouse.pod b/docs/OperaHouse.pod new file mode 100644 index 00000000..4b34e19a --- /dev/null +++ b/docs/OperaHouse.pod @@ -0,0 +1,7 @@ +=head1 Opera House Methods + +Opera House 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/docs/Parliament.pod b/docs/Parliament.pod index 04073ea0..2f820364 100644 --- a/docs/Parliament.pod +++ b/docs/Parliament.pod @@ -124,6 +124,8 @@ The following methods propose laws or actions to be taken by the station on beha Proproses an unenforceable law. Only works with Parliament 4 and higher. +B See the C section of C. These should be included as selectable options as a way to start the writeup of a title and description for a writ. + { "status" : { ... }, "proposition" : { @@ -164,7 +166,7 @@ An explict reason why the BFG should be fired upon the target. Same rules as an =head2 propose_transfer_station_ownership ( session_id, building_id, to_empire_id ) -Transfer the ownership of the station to another member of the alliance. Only works with Parliament 5 and higher. +Transfer the ownership of the station to another member of the alliance. Only works with Parliament 6 and higher. { "status" : { ... }, diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index df550251..3ddd8079 100644 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -1052,6 +1052,9 @@ sub spend_efficiency { 'Lacuna::DB::Result::Building::SSLb' => 'Lacuna::DB::Result::Building::SSLb', 'Lacuna::DB::Result::Building::SSLc' => 'Lacuna::DB::Result::Building::SSLc', 'Lacuna::DB::Result::Building::SSLd' => 'Lacuna::DB::Result::Building::SSLd', + 'Lacuna::DB::Result::Building::Module::ArtMuseum' => 'Lacuna::DB::Result::Building::Module::ArtMuseum', + 'Lacuna::DB::Result::Building::Module::CulinaryInstitute' => 'Lacuna::DB::Result::Building::Module::CulinaryInstitute', + 'Lacuna::DB::Result::Building::Module::OperaHouse' => 'Lacuna::DB::Result::Building::Module::OperaHouse', 'Lacuna::DB::Result::Building::Module::StationCommand' => 'Lacuna::DB::Result::Building::Module::StationCommand', 'Lacuna::DB::Result::Building::Module::IBS' => 'Lacuna::DB::Result::Building::Module::IBS', 'Lacuna::DB::Result::Building::Module::Warehouse' => 'Lacuna::DB::Result::Building::Module::Warehouse', diff --git a/lib/Lacuna/DB/Result/Building/Module/ArtMuseum.pm b/lib/Lacuna/DB/Result/Building/Module/ArtMuseum.pm new file mode 100644 index 00000000..02f5ee42 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Module/ArtMuseum.pm @@ -0,0 +1,15 @@ +package Lacuna::DB::Result::Building::Module::ArtMuseum; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Module'; + +use constant controller_class => 'Lacuna::RPC::Building::ArtMuseum'; +use constant image => 'artmuseum'; +use constant name => 'Art Museum'; +use constant max_instances_per_planet => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Module/CulinaryInstitute.pm b/lib/Lacuna/DB/Result/Building/Module/CulinaryInstitute.pm new file mode 100644 index 00000000..e83e7fab --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Module/CulinaryInstitute.pm @@ -0,0 +1,15 @@ +package Lacuna::DB::Result::Building::Module::CulinaryInstitute; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Module'; + +use constant controller_class => 'Lacuna::RPC::Building::CulinaryInstitute'; +use constant image => 'culinaryinstitute'; +use constant name => 'Culinary Institute'; +use constant max_instances_per_planet => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Module/IBS.pm b/lib/Lacuna/DB/Result/Building/Module/IBS.pm index 327de310..dfe500c2 100644 --- a/lib/Lacuna/DB/Result/Building/Module/IBS.pm +++ b/lib/Lacuna/DB/Result/Building/Module/IBS.pm @@ -9,7 +9,7 @@ use constant controller_class => 'Lacuna::RPC::Building::IBS'; use constant image => 'ibs'; use constant name => 'Interstellar Broadcast System'; use constant max_instances_per_planet => 1; - +use constant energy_consumption => 600; no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Module/OperaHouse.pm b/lib/Lacuna/DB/Result/Building/Module/OperaHouse.pm new file mode 100644 index 00000000..78779486 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Module/OperaHouse.pm @@ -0,0 +1,15 @@ +package Lacuna::DB::Result::Building::Module::OperaHouse; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Module'; + +use constant controller_class => 'Lacuna::RPC::Building::OperaHouse'; +use constant image => 'operahouse'; +use constant name => 'Opera House'; +use constant max_instances_per_planet => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/SSLa.pm b/lib/Lacuna/DB/Result/Building/SSLa.pm index c1388777..07535f99 100644 --- a/lib/Lacuna/DB/Result/Building/SSLa.pm +++ b/lib/Lacuna/DB/Result/Building/SSLa.pm @@ -62,6 +62,9 @@ sub makeable_plans { return { command => 'Lacuna::DB::Result::Building::Module::StationCommand', ibs => 'Lacuna::DB::Result::Building::Module::IBS', + art => 'Lacuna::DB::Result::Building::Module::ArtMuseum', + opera => 'Lacuna::DB::Result::Building::Module::OperaHouse', + food => 'Lacuna::DB::Result::Building::Module::CulinaryInstitute', parliament => 'Lacuna::DB::Result::Building::Module::Parliament', warehouse => 'Lacuna::DB::Result::Building::Module::Warehouse', }; diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index 43f56d6b..0b39b3be 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -184,10 +184,13 @@ use constant MEDALS => { building29 => 'Built Level 29 Building', building30 => 'Built Level 30 Building', SAW => 'Built Shield Against Weapons', - IBS => 'Built Interstellar Broadcast System', - StationCommand => 'Built Station Command Center', - Parliament => 'Built Parliament', - Warehouse => 'Built Warehouse', + OperaHouse => 'Installed Opera House', + ArtMuseum => 'Installed Art Museum', + CulinaryInstitute => 'Installed Culinary Institute', + IBS => 'Installed Interstellar Broadcast System', + StationCommand => 'Installed Station Command Center', + Parliament => 'Installed Parliament', + Warehouse => 'Installed Warehouse', DistributionCenter => 'Built Distribution Center', AtmosphericEvaporator => 'Built Atmospheric Evaporator', GreatBallOfJunk => 'Built Great Ball of Junk', diff --git a/lib/Lacuna/RPC/Building/ArtMuseum.pm b/lib/Lacuna/RPC/Building/ArtMuseum.pm new file mode 100644 index 00000000..3d89bd31 --- /dev/null +++ b/lib/Lacuna/RPC/Building/ArtMuseum.pm @@ -0,0 +1,21 @@ +package Lacuna::RPC::Building::ArtMuseum; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/artmuseum'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::Module::ArtMuseum'; +} + + +__PACKAGE__->register_rpc_method_names(qw()); + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/CulinaryInstitute.pm b/lib/Lacuna/RPC/Building/CulinaryInstitute.pm new file mode 100644 index 00000000..54f768f5 --- /dev/null +++ b/lib/Lacuna/RPC/Building/CulinaryInstitute.pm @@ -0,0 +1,21 @@ +package Lacuna::RPC::Building::CulinaryInstitute; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/culinaryinstitute'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::Module::CulinaryInstitute'; +} + + +__PACKAGE__->register_rpc_method_names(qw()); + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/OperaHouse.pm b/lib/Lacuna/RPC/Building/OperaHouse.pm new file mode 100644 index 00000000..92119822 --- /dev/null +++ b/lib/Lacuna/RPC/Building/OperaHouse.pm @@ -0,0 +1,21 @@ +package Lacuna::RPC::Building::OperaHouse; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/operahouse'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::Module::OperaHouse'; +} + + +__PACKAGE__->register_rpc_method_names(qw()); + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/Parliament.pm b/lib/Lacuna/RPC/Building/Parliament.pm index 6ae4b475..c6cb155e 100644 --- a/lib/Lacuna/RPC/Building/Parliament.pm +++ b/lib/Lacuna/RPC/Building/Parliament.pm @@ -147,8 +147,8 @@ sub propose_transfer_station_ownership { confess [1015, 'Sitters cannot create propositions.']; } my $building = $self->get_building($empire, $building_id); - unless ($building->level >= 5) { - confess [1013, 'Parliament must be level 5 to transfer station ownership.',5]; + unless ($building->level >= 6) { + confess [1013, 'Parliament must be level 6 to transfer station ownership.',6]; } unless ($to_empire_id) { confess [1002, 'Must specify an empire id to transfer the station to.']; diff --git a/t/Parliament.t b/t/Parliament.t index bf00a4d8..ef4fabd1 100644 --- a/t/Parliament.t +++ b/t/Parliament.t @@ -57,7 +57,7 @@ $result = $tester->post('parliament', 'view_laws', [$session_id, $station->id]); is($result->{result}{laws}[0]{name}, 'Do the big thing.', 'writ enacted'); $result = $tester->post('parliament', 'propose_transfer_station_ownership', [$session_id, $par->id]); -is($result->{error}{data}, 5, 'transfering ownership of station requires level 5 parliament'); +is($result->{error}{data}, 6, 'transfering ownership of station requires level 6 parliament'); $result = $tester->post('parliament', 'propose_fire_bfg', [$session_id, $par->id]); is($result->{error}{data}, 30, 'firing bfg requires level 30 parliament'); diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 15782875..a8c73fd8 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,4 +1,5 @@ 3.0400 + - Add: Added the Opera House, Art Museum, and Culinary Institute space station modules. - Rule: SAWs now cost less in upkeep. - API: Added proposing enacting writs at Parliament level 4. - API: Added transfering ownership of stations at Parliament level 5. diff --git a/var/www/public/resources.json b/var/www/public/resources.json index f08e6b36..1a520513 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -1,5 +1,8 @@ { "buildings" : { + "/operahouse" : { "description" : "A source of cultural influence for your space station.", "wiki" : "http://community.lacunaexpanse.com/wiki/opera-house" }, + "/artmuseum" : { "description" : "A source of cultural influence for your space station.", "wiki" : "http://community.lacunaexpanse.com/wiki/art-museum" }, + "/culinaryinstitute" : { "description" : "A source of cultural influence for your space station.", "wiki" : "http://community.lacunaexpanse.com/wiki/culinary-institute" }, "/stationcommand" : { "description" : "The internal operations of a space station. Controls how big the station can be expanded.", "wiki" : "http://community.lacunaexpanse.com/wiki/station-command-center" }, "/parliament" : { "description" : "The central government for the star systems that are controlled by a space station. Laws for the jurisdiction are made here.", "wiki" : "http://community.lacunaexpanse.com/wiki/parliament" }, "/warehouse" : { "description" : "Resource storage for a space station.", "wiki" : "http://community.lacunaexpanse.com/wiki/warehouse" }, @@ -234,6 +237,17 @@ "A higher level Security Ministry increases the chance of catching enemy spies as they come and go from your planet.", "A higher level Security Ministry allows you to see more detail about the enemy spies that are on your planet.", "You can make a new planet your home planet by building a Capitol building." + ], + "writ_templates" : [ + { "title" : "Non-Agression Mandate", "description" : "Planets in this jurisdiction may not attack anyone inside the jurisdiction." }, + { "title" : "No Munitions", "description" : "Planets in this jurisdiction, except for members of ______ alliance are not allowed to build a Munitions Lab. If you are found with one the penalty shall be _______." }, + { "title" : "No Operatives", "description" : "Planets in this jurisdiction, except for members of ______ alliance are not allowed to build a Espionage Ministry. If you are found with one the penalty shall be _______." }, + { "title" : "Defense Mandate", "description" : "Planets in this jurisdiction are required to come to the aid of the other planets in this jurisdiction when under attack from both foreign and domestic enemies." }, + { "title" : "Confederacy with ______", "description" : "_______ alliance declares a mutual conferation with _______ alliance." }, + { "title" : "NAP with ______", "description" : "_______ alliance declares a non-aggression pact with _______ alliance." }, + { "title" : "Declaration of War", "description" : "_______ alliance declares war on ______ alliance. All citizens in this jurisdiction are required to supply the war effort with all available ships, operatives, and aid packages." }, + { "title" : "Centure of ______", "description" : "We, the members of _______ alliance, hereby declare a formal repremand of _______ for __________________." }, + { "title" : "Glyph Heresy", "description" : "_______ alliance hereby denounces the existence of the Great Race. Anyone in our jurisdiction found using glyph technology shall be treated cruely and without mercy." } ] } -- 2.51.2