Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

started adding capitol and stockpile

  • Loading branch information...
commit be37dd15c30ff41e252a022b39bd726baab470c6 1 parent e0c5a92
JT Smith authored
View
13 add_a_building.txt
@@ -0,0 +1,13 @@
+create DB::Result class
+create RPC class
+create pod file
+link pod file in docs/Buildings.pod
+add to class types in Lacuna::DB::Result::Building
+add to bin/lacuna.psgi
+add to Lacuna::DB::Result::Medals
+create wiki entry
+add to var/www/public/building_descriptions.json
+update the tech tree image
+
+# if buildable
+add to Lacuna::Constants::BUILDABLE_CLASSES
View
2  bin/lacuna.psgi
@@ -31,6 +31,8 @@ $urlmap->map("/facebook" => Lacuna::Web::Facebook->new->to_app);
$urlmap->map("/apikey" => Lacuna::Web::ApiKey->new->to_app);
# buildings
+$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);
$urlmap->map(Lacuna::RPC::Building::Apple->new->to_app_with_url);
$urlmap->map(Lacuna::RPC::Building::Bean->new->to_app_with_url);
View
8 docs/Buildings.pod
@@ -1,3 +1,7 @@
+=head1 Building Descriptions
+
+Your app can download a copy of the building descriptions from C<http://servername.lacunaexpanse.com/building_descriptions.json>. Your app should cache this file, and only download a new copy if it has changed. We do not include this information in L<Body/"get_buildings"> because it's the same on every request for every empire and would add a lot of bandwidth for nothing.
+
=head1 Building Methods
All buildings have some methods in common. This is a description of the methods available from each building.
@@ -286,6 +290,8 @@ Below is a list of the different types of structures that can be built on planet
=item L<Burger>
+=item L<Capitol>
+
=item L<Cheese>
=item L<Chip>
@@ -392,6 +398,8 @@ Below is a list of the different types of structures that can be built on planet
=item L<SpacePort>
+=item L<Stockpile>
+
=item L<Syrup>
=item L<TempleOfTheDrajilites>
View
7 docs/Capitol.pod
@@ -0,0 +1,7 @@
+=head1 Capitol Methods
+
+Capitol is accessible via the URL C</capitol>.
+
+The list of methods below represents changes and additions to the methods that all L<Buildings> share.
+
+=cut
View
7 docs/Stockpile.pod
@@ -0,0 +1,7 @@
+=head1 Stockpile Methods
+
+Stockpile is accessible via the URL C</stockpile>.
+
+The list of methods below represents changes and additions to the methods that all L<Buildings> share.
+
+=cut
View
2  lib/Lacuna/Constants.pm
@@ -8,6 +8,8 @@ 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 BUILDABLE_CLASSES => (qw(
+ Lacuna::RPC::Building::Capitol
+ Lacuna::RPC::Building::Stockpile
Lacuna::RPC::Building::Algae
Lacuna::RPC::Building::Apple
Lacuna::RPC::Building::Bean
View
2  lib/Lacuna/DB/Result/Building.pm
@@ -47,6 +47,8 @@ __PACKAGE__->typecast_map(class => {
'Lacuna::DB::Result::Building::Observatory' => 'Lacuna::DB::Result::Building::Observatory',
'Lacuna::DB::Result::Building::Park' => 'Lacuna::DB::Result::Building::Park',
'Lacuna::DB::Result::Building::PlanetaryCommand' => 'Lacuna::DB::Result::Building::PlanetaryCommand',
+ 'Lacuna::DB::Result::Building::Stockpile' => 'Lacuna::DB::Result::Building::Stockpile',
+ 'Lacuna::DB::Result::Building::Capitol' => 'Lacuna::DB::Result::Building::Capitol',
'Lacuna::DB::Result::Building::Propulsion' => 'Lacuna::DB::Result::Building::Propulsion',
'Lacuna::DB::Result::Building::Oversight' => 'Lacuna::DB::Result::Building::Oversight',
'Lacuna::DB::Result::Building::Security' => 'Lacuna::DB::Result::Building::Security',
View
47 lib/Lacuna/DB/Result/Building/Capitol.pm
@@ -0,0 +1,47 @@
+package Lacuna::DB::Result::Building::Capitol;
+
+use Moose;
+no warnings qw(uninitialized);
+extends 'Lacuna::DB::Result::Building';
+
+around 'build_tags' => sub {
+ my ($orig, $class) = @_;
+ return ($orig->($class), qw(Infrastructure Happiness Intelligence));
+};
+
+use constant building_prereq => {'Lacuna::DB::Result::Building::PlanetaryCommand'=>10};
+
+use constant controller_class => 'Lacuna::RPC::Building::Capitol';
+
+use constant image => 'capitol';
+
+use constant name => 'Capitol';
+
+use constant food_to_build => 350;
+
+use constant energy_to_build => 350;
+
+use constant ore_to_build => 350;
+
+use constant water_to_build => 350;
+
+use constant waste_to_build => 100;
+
+use constant time_to_build => 230;
+
+use constant food_consumption => 18;
+
+use constant energy_consumption => 13;
+
+use constant ore_consumption => 2;
+
+use constant water_consumption => 20;
+
+use constant waste_production => 5;
+
+use constant happiness_production => 15;
+
+
+
+no Moose;
+__PACKAGE__->meta->make_immutable(inline_constructor => 0);
View
54 lib/Lacuna/DB/Result/Building/Stockpile.pm
@@ -0,0 +1,54 @@
+package Lacuna::DB::Result::Building::Stockpile;
+
+use Moose;
+no warnings qw(uninitialized);
+extends 'Lacuna::DB::Result::Building';
+
+around 'build_tags' => sub {
+ my ($orig, $class) = @_;
+ return ($orig->($class), qw(Resources Storage Food Water Ore Energy));
+};
+
+use constant building_prereq => {'Lacuna::DB::Result::Building::Capitol'=>10};
+
+use constant controller_class => 'Lacuna::RPC::Building::Stockpile';
+
+use constant image => 'stockpile';
+
+use constant name => 'Stockpile';
+
+use constant food_to_build => 330;
+
+use constant energy_to_build => 330;
+
+use constant ore_to_build => 330;
+
+use constant water_to_build => 330;
+
+use constant waste_to_build => 100;
+
+use constant time_to_build => 230;
+
+use constant food_consumption => 2;
+
+use constant energy_consumption => 5;
+
+use constant ore_consumption => 1;
+
+use constant water_consumption => 2;
+
+use constant waste_production => 1;
+
+use constant food_storage => 300;
+
+use constant energy_storage => 300;
+
+use constant ore_storage => 300;
+
+use constant water_storage => 300;
+
+
+
+
+no Moose;
+__PACKAGE__->meta->make_immutable(inline_constructor => 0);
View
2  lib/Lacuna/DB/Result/Medals.pm
@@ -123,6 +123,8 @@ use constant MEDALS => {
building28 => 'Built Level 28 Building',
building29 => 'Built Level 29 Building',
building30 => 'Built Level 30 Building',
+ Capitol => 'Build Capitol',
+ Stockpile => 'Build Stockpile',
Algae => 'Build Algae Cropper',
Apple => 'Built Apple Orchard',
Bean => 'Built Bean Plantation',
View
19 lib/Lacuna/RPC/Building/Capitol.pm
@@ -0,0 +1,19 @@
+package Lacuna::RPC::Building::Capitol;
+
+use Moose;
+no warnings qw(uninitialized);
+extends 'Lacuna::RPC::Building';
+
+sub app_url {
+ return '/capitol';
+}
+
+sub model_class {
+ return 'Lacuna::DB::Result::Building::Capitol';
+}
+
+
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
View
2  lib/Lacuna/RPC/Building/PlanetaryCommand.pm
@@ -22,8 +22,6 @@ around 'view' => sub {
return $out;
};
-__PACKAGE__->register_rpc_method_names(qw(view_plans));
-
no Moose;
__PACKAGE__->meta->make_immutable;
View
19 lib/Lacuna/RPC/Building/Stockpile.pm
@@ -0,0 +1,19 @@
+package Lacuna::RPC::Building::Stockpile;
+
+use Moose;
+no warnings qw(uninitialized);
+extends 'Lacuna::RPC::Building';
+
+sub app_url {
+ return '/stockpile';
+}
+
+sub model_class {
+ return 'Lacuna::DB::Result::Building::Stockpile';
+}
+
+
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
View
1  var/www/public/building_descriptions.json
@@ -0,0 +1 @@
+{
Please sign in to comment.
Something went wrong with that request. Please try again.