From f5f9ec89a5c7e9b94705861ea9503b978b2f61bc Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 30 Mar 2011 10:42:40 -0500 Subject: [PATCH] added the lost city of tyleon --- bin/lacuna.psgi | 9 ++ docs/Buildings.pod | 2 + docs/LostCityOfTyleon.pod | 7 ++ lib/Lacuna/DB/Result/Building.pm | 9 ++ lib/Lacuna/DB/Result/Building/LCOTa.pm | 97 +++++++++++++++++++ lib/Lacuna/DB/Result/Building/LCOTb.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTc.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTd.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTe.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTf.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTg.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTh.pm | 33 +++++++ lib/Lacuna/DB/Result/Building/LCOTi.pm | 25 +++++ .../DB/Result/Building/Permanent/Beach1.pm | 6 ++ .../DB/Result/Building/Permanent/Beach10.pm | 6 ++ .../DB/Result/Building/Permanent/Beach11.pm | 6 ++ .../DB/Result/Building/Permanent/Beach12.pm | 6 ++ .../DB/Result/Building/Permanent/Beach13.pm | 6 ++ .../DB/Result/Building/Permanent/Beach2.pm | 6 ++ .../DB/Result/Building/Permanent/Beach3.pm | 6 ++ .../DB/Result/Building/Permanent/Beach4.pm | 6 ++ .../DB/Result/Building/Permanent/Beach5.pm | 6 ++ .../DB/Result/Building/Permanent/Beach6.pm | 6 ++ .../DB/Result/Building/Permanent/Beach7.pm | 6 ++ .../DB/Result/Building/Permanent/Beach8.pm | 6 ++ .../DB/Result/Building/Permanent/Beach9.pm | 6 ++ .../DB/Result/Building/Permanent/Lagoon.pm | 6 ++ .../DB/Result/Building/Permanent/Lake.pm | 6 ++ lib/Lacuna/DB/Result/Medals.pm | 9 ++ lib/Lacuna/RPC/Building/LCOTa.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTb.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTc.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTd.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTe.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTf.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTg.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTh.pm | 23 +++++ lib/Lacuna/RPC/Building/LCOTi.pm | 23 +++++ lib/Lacuna/Role/LCOT.pm | 25 +++++ var/www/public/changes.txt | 1 + var/www/public/resources.json | 11 ++- 41 files changed, 722 insertions(+), 1 deletion(-) create mode 100644 docs/LostCityOfTyleon.pod create mode 100644 lib/Lacuna/DB/Result/Building/LCOTa.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTb.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTc.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTd.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTe.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTf.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTg.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTh.pm create mode 100644 lib/Lacuna/DB/Result/Building/LCOTi.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTa.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTb.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTc.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTd.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTe.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTf.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTg.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTh.pm create mode 100644 lib/Lacuna/RPC/Building/LCOTi.pm create mode 100644 lib/Lacuna/Role/LCOT.pm diff --git a/bin/lacuna.psgi b/bin/lacuna.psgi index 0af33c1b..65c8919c 100644 --- a/bin/lacuna.psgi +++ b/bin/lacuna.psgi @@ -219,6 +219,15 @@ my $app = builder { Lacuna::RPC::Building::IBS Lacuna::RPC::Building::Warehouse Lacuna::RPC::Building::Parliament + Lacuna::RPC::Building::LCOTa + Lacuna::RPC::Building::LCOTb + Lacuna::RPC::Building::LCOTc + Lacuna::RPC::Building::LCOTd + Lacuna::RPC::Building::LCOTe + Lacuna::RPC::Building::LCOTf + Lacuna::RPC::Building::LCOTg + Lacuna::RPC::Building::LCOTh + Lacuna::RPC::Building::LCOTi )) { mount $building->new->to_app_with_url; } diff --git a/docs/Buildings.pod b/docs/Buildings.pod index ac490918..c1fb271b 100644 --- a/docs/Buildings.pod +++ b/docs/Buildings.pod @@ -391,6 +391,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/LostCityOfTyleon.pod b/docs/LostCityOfTyleon.pod new file mode 100644 index 00000000..02f060dc --- /dev/null +++ b/docs/LostCityOfTyleon.pod @@ -0,0 +1,7 @@ +=head1 Lost City of Tyleon Methods + +Space Station Lab is accessible via the URLs C, C, C, C, C, C, C, C, and C. The C URL controls all the actual functions of the city, but you must build all nine components to get the benefits. + +The list of methods below represents changes and additions to the methods that all L share. + +=cut diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index 3ddd8079..0e78cb27 100644 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -1062,6 +1062,15 @@ sub spend_efficiency { 'Lacuna::DB::Result::Building::Permanent::AmalgusMeadow' => 'Lacuna::DB::Result::Building::Permanent::AmalgusMeadow', 'Lacuna::DB::Result::Building::Permanent::DentonBrambles' => 'Lacuna::DB::Result::Building::Permanent::DentonBrambles', 'Lacuna::DB::Result::Building::MercenariesGuild' => 'Lacuna::DB::Result::Building::MercenariesGuild', + 'Lacuna::DB::Result::Building::LCOTa' => 'Lacuna::DB::Result::Building::LCOTa', + 'Lacuna::DB::Result::Building::LCOTb' => 'Lacuna::DB::Result::Building::LCOTb', + 'Lacuna::DB::Result::Building::LCOTc' => 'Lacuna::DB::Result::Building::LCOTc', + 'Lacuna::DB::Result::Building::LCOTd' => 'Lacuna::DB::Result::Building::LCOTd', + 'Lacuna::DB::Result::Building::LCOTe' => 'Lacuna::DB::Result::Building::LCOTe', + 'Lacuna::DB::Result::Building::LCOTf' => 'Lacuna::DB::Result::Building::LCOTf', + 'Lacuna::DB::Result::Building::LCOTg' => 'Lacuna::DB::Result::Building::LCOTg', + 'Lacuna::DB::Result::Building::LCOTh' => 'Lacuna::DB::Result::Building::LCOTh', + 'Lacuna::DB::Result::Building::LCOTi' => 'Lacuna::DB::Result::Building::LCOTi', }); } diff --git a/lib/Lacuna/DB/Result/Building/LCOTa.pm b/lib/Lacuna/DB/Result/Building/LCOTa.pm new file mode 100644 index 00000000..fe00563a --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTa.pm @@ -0,0 +1,97 @@ +package Lacuna::DB::Result::Building::LCOTa; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +use Lacuna::Constants qw(GROWTH); +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTa'; +use constant image => 'lcota'; +use constant name => 'Lost City of Tyleon (A)'; +use constant energy_storage => 21000; +use constant water_storage => 21000; +use constant food_storage => 21000; +use constant ore_storage => 21000; +use constant waste_storage => 7000; +use constant waste_consumption => 700; +use constant happiness_production => 6300; +use constant energy_production => 6300; +use constant water_production => 6300; +use constant ore_production => 6300; +use constant burger_production => 6300; +use constant chip_production => 1100; +use constant pie_production => 1100; +use constant shake_production => 1100; +use constant soup_production => 1100; +use constant syrup_production => 1100; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(burger chip pie shake soup syrup); + return $foods; +}; + +has effective_efficiency => ( + is => 'rw', + lazy => 1, + predicate => 'has_effective_efficiency', +); + +has effective_level => ( + is => 'rw', + lazy => 1, + predicate => 'has_effective_efficiency', +); + +sub production_hour { + my $self = shift; + return 0 unless $self->level; + unless ($self->has_effective_level) { + $self->calculate_effective_stats; + } + my $production = (GROWTH ** ( $self->effective_level - 1)); + $production = ($production * $self->effective_efficiency) / 100; + return $production; +} + +sub calculate_effective_stats { + my $self = shift; + my $level = $self->level; + my $efficiency = $self->efficiency; + my $body = $self->body; + foreach my $ext (qw(b c d e f g h i)) { + my $part = $body->get_building_of_class('Lacuna::DB::Result::Building::LCOT'.$ext); + if (defined $part) { + $level = $part->level < $level ? $part->level : $level; + $efficiency = $part->efficiency < $efficiency ? $part->efficiency : $efficiency; + } + else { + $level = 0; + $efficiency = 0; + } + last if $level < 1 || $efficiency < 1; + } + $self->effective_level($level); + $self->effective_efficiency($efficiency); +} + + +before 'can_demolish' => sub { + my $self = shift; + my $b = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTb'); + if (defined $b) { + confess [1013, 'You have to demolish your Lost City of Tyleon (B) before you can demolish your Lost City of Tyleon (A).']; + } +}; + +before can_build => sub { + my $self = shift; + if ($self->x ~~ [-5,-1,0,1,5] || $self->y ~~ [-5,-1,0,1,5]) { + confess [1009, 'Lost City of Tyleon cannot be placed in that location.']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTb.pm b/lib/Lacuna/DB/Result/Building/LCOTb.pm new file mode 100644 index 00000000..3efdee79 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTb.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTb; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTb'; +use constant image => 'lcotb'; +use constant name => 'Lost City of Tyleon (B)'; + +before 'can_demolish' => sub { + my $self = shift; + my $c = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTc'); + if (defined $c) { + confess [1013, 'You have to demolish your Lost City of Tyleon (C) before you can demolish your Lost City of Tyleon (B).']; + } +}; + +before can_build => sub { + my $self = shift; + my $a = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTa'); + unless (defined $a) { + confess [1013, 'You must have a Lost City of Tyleon (A) before you can build Lost City of Tyleon (B).']; + } + unless ($self->x == $a->x - 1 && $self->y == $a->y) { + confess [1013, 'Lost City of Tyleon (B) must be placed to the left of the Lost City of Tyleon (A).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTc.pm b/lib/Lacuna/DB/Result/Building/LCOTc.pm new file mode 100644 index 00000000..6716dbb6 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTc.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTc; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTc'; +use constant image => 'lcotc'; +use constant name => 'Lost City of Tyleon (C)'; + +before 'can_demolish' => sub { + my $self = shift; + my $d = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTd'); + if (defined $d) { + confess [1013, 'You have to demolish your Lost City of Tyleon (D) before you can demolish your Lost City of Tyleon (C).']; + } +}; + +before can_build => sub { + my $self = shift; + my $b = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTb'); + unless (defined $b) { + confess [1013, 'You must have a Lost City of Tyleon (B) before you can build Lost City of Tyleon (C).']; + } + unless ($self->x == $b->x && $self->y == $b->y + 1) { + confess [1013, 'Lost City of Tyleon (C) must be placed above of the Lost City of Tyleon (B).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTd.pm b/lib/Lacuna/DB/Result/Building/LCOTd.pm new file mode 100644 index 00000000..087decf8 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTd.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTd; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTd'; +use constant image => 'lcotd'; +use constant name => 'Lost City of Tyleon (D)'; + +before 'can_demolish' => sub { + my $self = shift; + my $e = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTe'); + if (defined $e) { + confess [1013, 'You have to demolish your Lost City of Tyleon (E) before you can demolish your Lost City of Tyleon (D).']; + } +}; + +before can_build => sub { + my $self = shift; + my $c = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTc'); + unless (defined $c) { + confess [1013, 'You must have a Lost City of Tyleon (C) before you can build Lost City of Tyleon (D).']; + } + unless ($self->x == $c->x + 1 && $self->y == $c->y) { + confess [1013, 'Lost City of Tyleon (D) must be placed to the right of the Lost City of Tyleon (C).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTe.pm b/lib/Lacuna/DB/Result/Building/LCOTe.pm new file mode 100644 index 00000000..b2bddc2e --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTe.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTe; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTe'; +use constant image => 'lcote'; +use constant name => 'Lost City of Tyleon (E)'; + +before 'can_demolish' => sub { + my $self = shift; + my $f = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTf'); + if (defined $f) { + confess [1013, 'You have to demolish your Lost City of Tyleon (F) before you can demolish your Lost City of Tyleon (E).']; + } +}; + +before can_build => sub { + my $self = shift; + my $d = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTd'); + unless (defined $d) { + confess [1013, 'You must have a Lost City of Tyleon (D) before you can build Lost City of Tyleon (E).']; + } + unless ($self->x == $d->x + 1 && $self->y == $d->y) { + confess [1013, 'Lost City of Tyleon (E) must be placed to the right of the Lost City of Tyleon (D).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTf.pm b/lib/Lacuna/DB/Result/Building/LCOTf.pm new file mode 100644 index 00000000..48faf1a9 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTf.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTf; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTf'; +use constant image => 'lcotf'; +use constant name => 'Lost City of Tyleon (F)'; + +before 'can_demolish' => sub { + my $self = shift; + my $g = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTg'); + if (defined $g) { + confess [1013, 'You have to demolish your Lost City of Tyleon (G) before you can demolish your Lost City of Tyleon (F).']; + } +}; + +before can_build => sub { + my $self = shift; + my $e = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTe'); + unless (defined $e) { + confess [1013, 'You must have a Lost City of Tyleon (E) before you can build Lost City of Tyleon (F).']; + } + unless ($self->x == $e->x && $self->y == $e->y - 1) { + confess [1013, 'Lost City of Tyleon (F) must be placed below the Lost City of Tyleon (E).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTg.pm b/lib/Lacuna/DB/Result/Building/LCOTg.pm new file mode 100644 index 00000000..4d5a9cde --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTg.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTg; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTg'; +use constant image => 'lcotg'; +use constant name => 'Lost City of Tyleon (G)'; + +before 'can_demolish' => sub { + my $self = shift; + my $h = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTh'); + if (defined $h) { + confess [1013, 'You have to demolish your Lost City of Tyleon (H) before you can demolish your Lost City of Tyleon (G).']; + } +}; + +before can_build => sub { + my $self = shift; + my $f = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTf'); + unless (defined $f) { + confess [1013, 'You must have a Lost City of Tyleon (F) before you can build Lost City of Tyleon (G).']; + } + unless ($self->x == $f->x && $self->y == $f->y - 1) { + confess [1013, 'Lost City of Tyleon (G) must be placed below the Lost City of Tyleon (F).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTh.pm b/lib/Lacuna/DB/Result/Building/LCOTh.pm new file mode 100644 index 00000000..07e8c958 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTh.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Building::LCOTh; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTh'; +use constant image => 'lcoth'; +use constant name => 'Lost City of Tyleon (H)'; + +before 'can_demolish' => sub { + my $self = shift; + my $i = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTi'); + if (defined $i) { + confess [1013, 'You have to demolish your Lost City of Tyleon (I) before you can demolish your Lost City of Tyleon (H).']; + } +}; + +before can_build => sub { + my $self = shift; + my $g = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTg'); + unless (defined $g) { + confess [1013, 'You must have a Lost City of Tyleon (G) before you can build Lost City of Tyleon (H).']; + } + unless ($self->x == $g->x - 1 && $self->y == $g->y) { + confess [1013, 'Lost City of Tyleon (H) must be placed to the left of the Lost City of Tyleon (G).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/LCOTi.pm b/lib/Lacuna/DB/Result/Building/LCOTi.pm new file mode 100644 index 00000000..da6200d7 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/LCOTi.pm @@ -0,0 +1,25 @@ +package Lacuna::DB::Result::Building::LCOTi; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::LCOT'; + +use constant controller_class => 'Lacuna::RPC::Building::LCOTi'; +use constant image => 'lcoti'; +use constant name => 'Lost City of Tyleon (I)'; + +before can_build => sub { + my $self = shift; + my $h = $self->body->get_building_of_class('Lacuna::DB::Result::Building::LCOTh'); + unless (defined $h) { + confess [1013, 'You must have a Lost City of Tyleon (H) before you can build Lost City of Tyleon (I).']; + } + unless ($self->x == $h->x - 1 && $self->y == $h->y) { + confess [1013, 'Lost City of Tyleon (I) must be placed to the left of the Lost City of Tyleon (H).']; + } +}; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach1.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach1.pm index a34a0624..c148bf72 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach1.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach1.pm @@ -19,6 +19,12 @@ sub can_upgrade { confess [1013, "You can't upgrade a beach. It forms naturally."]; } use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; use constant image => 'beach1'; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach10.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach10.pm index 742310af..aafd0ea0 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach10.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach10.pm @@ -19,6 +19,12 @@ sub can_upgrade { confess [1013, "You can't upgrade a beach. It forms naturally."]; } use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; use constant image => 'beach10'; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach11.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach11.pm index c94afe56..c53d6583 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach11.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach11.pm @@ -19,6 +19,12 @@ sub can_upgrade { confess [1013, "You can't upgrade a beach. It forms naturally."]; } use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; use constant image => 'beach11'; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach12.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach12.pm index 0d54fd2e..29ef6ca2 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach12.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach12.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach12'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach13.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach13.pm index b28cafbc..4d13b42b 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach13.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach13.pm @@ -19,6 +19,12 @@ sub can_upgrade { confess [1013, "You can't upgrade a beach. It forms naturally."]; } use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; use constant image => 'beach13'; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach2.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach2.pm index 3b865b13..73bac9bb 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach2.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach2.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach2'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach3.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach3.pm index 728e1925..6b3b61aa 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach3.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach3.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach3'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach4.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach4.pm index 19cbadde..46a285b1 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach4.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach4.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach4'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach5.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach5.pm index f00f649b..6d2bdcf7 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach5.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach5.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach5'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach6.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach6.pm index 145f4197..b01250e9 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach6.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach6.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach6'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach7.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach7.pm index 28aa843b..084ea95f 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach7.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach7.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach7'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach8.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach8.pm index 12d11b72..1ebdc355 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach8.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach8.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'beach8'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Beach9.pm b/lib/Lacuna/DB/Result/Building/Permanent/Beach9.pm index 74c45f99..0db395a6 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Beach9.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Beach9.pm @@ -28,6 +28,12 @@ sub image_level { use constant name => 'Beach [9]'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant ore_production => 10; use constant water_production => 10; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Lagoon.pm b/lib/Lacuna/DB/Result/Building/Permanent/Lagoon.pm index 556f28e6..3f295115 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Lagoon.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Lagoon.pm @@ -23,6 +23,12 @@ use constant water_to_build => 1; use constant ore_to_build => 1; use constant time_to_build => 1; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant water_production => 10; no Moose; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Lake.pm b/lib/Lacuna/DB/Result/Building/Permanent/Lake.pm index eb3a03f8..c721e420 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/Lake.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/Lake.pm @@ -21,6 +21,12 @@ sub can_upgrade { use constant image => 'lake'; use constant algae_production => 10; +around produces_food_items => sub { + my ($orig, $class) = @_; + my $foods = $orig->($class); + push @{$foods}, qw(algae); + return $foods; +}; use constant water_production => 10; sub image_level { diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index 0b39b3be..ce57dc25 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -231,6 +231,15 @@ use constant MEDALS => { EnergyReserve => 'Built Energy Reserve', Entertainment => 'Built Entertainment District', Espionage => 'Built Espionage Ministry', + LCOTa => 'Discovered Lost City of Tyleon (A)', + LCOTb => 'Discovered Lost City of Tyleon (B)', + LCOTc => 'Discovered Lost City of Tyleon (C)', + LCOTd => 'Discovered Lost City of Tyleon (D)', + LCOTe => 'Discovered Lost City of Tyleon (E)', + LCOTf => 'Discovered Lost City of Tyleon (F)', + LCOTg => 'Discovered Lost City of Tyleon (G)', + LCOTh => 'Discovered Lost City of Tyleon (H)', + LCOTi => 'Discovered Lost City of Tyleon (I)', SSLa => 'Built Space Station Lab (A)', SSLb => 'Built Space Station Lab (B)', SSLc => 'Built Space Station Lab (C)', diff --git a/lib/Lacuna/RPC/Building/LCOTa.pm b/lib/Lacuna/RPC/Building/LCOTa.pm new file mode 100644 index 00000000..c9b00fe3 --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTa.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTa; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcota'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTa'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTb.pm b/lib/Lacuna/RPC/Building/LCOTb.pm new file mode 100644 index 00000000..866045c1 --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTb.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTb; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcotb'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTb'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTc.pm b/lib/Lacuna/RPC/Building/LCOTc.pm new file mode 100644 index 00000000..25bfcded --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTc.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTc; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcotc'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTc'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTd.pm b/lib/Lacuna/RPC/Building/LCOTd.pm new file mode 100644 index 00000000..aae3ed14 --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTd.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTd; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcotd'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTd'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTe.pm b/lib/Lacuna/RPC/Building/LCOTe.pm new file mode 100644 index 00000000..c9d70c2c --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTe.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTe; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcote'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTe'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTf.pm b/lib/Lacuna/RPC/Building/LCOTf.pm new file mode 100644 index 00000000..e36bd979 --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTf.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTf; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcotf'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTf'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTg.pm b/lib/Lacuna/RPC/Building/LCOTg.pm new file mode 100644 index 00000000..5a9a9413 --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTg.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTg; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcotg'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTg'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTh.pm b/lib/Lacuna/RPC/Building/LCOTh.pm new file mode 100644 index 00000000..670f80bc --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTh.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTh; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcoth'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTh'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/LCOTi.pm b/lib/Lacuna/RPC/Building/LCOTi.pm new file mode 100644 index 00000000..a598a630 --- /dev/null +++ b/lib/Lacuna/RPC/Building/LCOTi.pm @@ -0,0 +1,23 @@ +package Lacuna::RPC::Building::LCOTi; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/lcoti'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::LCOTi'; +} + + + +__PACKAGE__->register_rpc_method_names(qw()); + + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/Role/LCOT.pm b/lib/Lacuna/Role/LCOT.pm new file mode 100644 index 00000000..a80537a1 --- /dev/null +++ b/lib/Lacuna/Role/LCOT.pm @@ -0,0 +1,25 @@ +package Lacuna::Role::LCOT; + +use Moose::Role; + +use constant food_to_build => 21000; +use constant energy_to_build => 21000; +use constant ore_to_build => 21000; +use constant water_to_build => 21000; +use constant time_to_build => 60 * 2; +use constant food_consumption => 100; +use constant energy_consumption => 100; +use constant ore_consumption => 100; +use constant water_consumption => 100; +use constant waste_production => 100; +use constant max_instances_per_planet => 1; + +around 'build_tags' => sub { + my ($orig, $class) = @_; + return ($orig->($class), qw(Water Food Waste Energy Ore Storage Happiness)); +}; + + + + +1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index ac64a770..783a91a4 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,5 +1,6 @@ 3.0400 - Add: Added the Opera House, Art Museum, and Culinary Institute space station modules. + - Add: The Lost City of Tyleon. - Rule: We now allow 20 ships per fleet. - Rule: Spies no longer bounce. There is either a success or a failure. They can still however not be able to complete a mission on success (try to steal a ship and there isn't one to steal, etc). - Rule: Spies now have luck. A random number between -500 and 500. diff --git a/var/www/public/resources.json b/var/www/public/resources.json index 1a520513..2619d037 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -141,7 +141,16 @@ "/waterpurification" : { "description" : "Produces water from the planet's sources. The higher the building level the more water it can purify.", "wiki" : "http://community.lacunaexpanse.com/wiki/water-purification-plant" }, "/waterreclamation" : { "description" : "Converts waste into water. A higher building level means more resources are converted. If you don't have a good supply of halite or sulfur you cannot treat waste water.", "wiki" : "http://community.lacunaexpanse.com/wiki/water-reclamation-plant" }, "/waterstorage" : { "description" : "Stores the water you've collected. A higher building level allows more water to be stored.", "wiki" : "http://community.lacunaexpanse.com/wiki/water-storage-tank" }, - "/wheat" : { "description" : "Allows you to grow wheat on your planet. You can only grow wheat on planets that are in orbits 2, 3 or 4 (the goldilox zone). The Farm will produce more wheat for each level it is increased. All plants need a source of phosphorus to photosynthesize their food. Therefore you need a good source of gypsum, sulfur, or monazite for plants to thrive.", "wiki" : "http://community.lacunaexpanse.com/wiki/wheat-farm" } + "/wheat" : { "description" : "Allows you to grow wheat on your planet. You can only grow wheat on planets that are in orbits 2, 3 or 4 (the goldilox zone). The Farm will produce more wheat for each level it is increased. All plants need a source of phosphorus to photosynthesize their food. Therefore you need a good source of gypsum, sulfur, or monazite for plants to thrive.", "wiki" : "http://community.lacunaexpanse.com/wiki/wheat-farm" }, + "/lcota" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcotb" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcotc" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcotd" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcote" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcotf" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcotg" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcoth" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" }, + "/lcoti" : { "description" : "A self contained city that produces all it's own resources and waste management. It also produces a lot extra for you to use to support your other infrastructure.", "wiki" : "http://community.lacunaexpanse.com/wiki/lost-city-of-tyleon" } }, "ships" : { "stake" : { "description" : "Allows you to claim a planet prior to your colony ship arriving.", "wiki" : "http://community.lacunaexpanse.com/wiki/stake" }, -- 2.51.2