diff --git a/bin/lacuna.psgi b/bin/lacuna.psgi index ab4dd36a..17e6c6ab 100644 --- a/bin/lacuna.psgi +++ b/bin/lacuna.psgi @@ -35,6 +35,13 @@ $urlmap->map("/facebook" => Lacuna::Web::Facebook->new->to_app); $urlmap->map("/apikey" => Lacuna::Web::ApiKey->new->to_app); # buildings +$urlmap->map(Lacuna::RPC::Building::SAW->new->to_app_with_url); +$urlmap->map(Lacuna::RPC::Building::Water::AtmosphericEvaporator->new->to_app_with_url); +$urlmap->map(Lacuna::RPC::Building::Permanent::GreatBallOfJunk->new->to_app_with_url); +$urlmap->map(Lacuna::RPC::Building::Permanent::JunkHengeSculpture->new->to_app_with_url); +$urlmap->map(Lacuna::RPC::Building::Permanent::MetalJunkArches->new->to_app_with_url); +$urlmap->map(Lacuna::RPC::Building::Permanent::PyramidJunkSculpture->new->to_app_with_url); +$urlmap->map(Lacuna::RPC::Building::Permanent::SpaceJunkPark->new->to_app_with_url); $urlmap->map(Lacuna::RPC::Building::ThemePark->new->to_app_with_url); $urlmap->map(Lacuna::RPC::Building::BlackHoleGenerator->new->to_app_with_url); $urlmap->map(Lacuna::RPC::Building::TheDillonForge->new->to_app_with_url); diff --git a/docs/AtmosphericEvaporator.pod b/docs/AtmosphericEvaporator.pod new file mode 100644 index 00000000..682911ec --- /dev/null +++ b/docs/AtmosphericEvaporator.pod @@ -0,0 +1,7 @@ +=head1 Atmospheric Evaporator Methods + +Atmospheric Evaporator 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/Buildings.pod b/docs/Buildings.pod index 3a1e64b3..b9ae7c9a 100644 --- a/docs/Buildings.pod +++ b/docs/Buildings.pod @@ -286,6 +286,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 @@ -352,6 +354,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 @@ -362,6 +366,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 @@ -380,6 +386,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 @@ -418,10 +426,14 @@ Below is a list of the different types of structures that can be built on planet =item L +=item L + =item L =item L +=item L + =item L =item L @@ -432,6 +444,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/GreatBallOfJunk.pod b/docs/GreatBallOfJunk.pod new file mode 100644 index 00000000..d53b2011 --- /dev/null +++ b/docs/GreatBallOfJunk.pod @@ -0,0 +1,7 @@ +=head1 Great Ball Of Junk Methods + +Great Ball Of Junk 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/JunkHengeSculpture.pod b/docs/JunkHengeSculpture.pod new file mode 100644 index 00000000..de6a04ef --- /dev/null +++ b/docs/JunkHengeSculpture.pod @@ -0,0 +1,7 @@ +=head1 Junk Henge Sculpture Methods + +Junk Henge Sculpture 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/PyramidJunkSculpture.pod b/docs/PyramidJunkSculpture.pod new file mode 100644 index 00000000..1275fd6d --- /dev/null +++ b/docs/PyramidJunkSculpture.pod @@ -0,0 +1,7 @@ +=head1 PyramidJunkSculpture Methods + +Pyramid Junk Sculpture 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/SAW.pod b/docs/SAW.pod new file mode 100644 index 00000000..6a70731d --- /dev/null +++ b/docs/SAW.pod @@ -0,0 +1,7 @@ +=head1 Shield Against Weapons Methods + +Shield Against Weapons 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/SpaceJunkPark.pod b/docs/SpaceJunkPark.pod new file mode 100644 index 00000000..f0b52242 --- /dev/null +++ b/docs/SpaceJunkPark.pod @@ -0,0 +1,7 @@ +=head1 Space Junk Park Methods + +Space Junk Park 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 10a0e523..baa7008f 100644 --- a/lib/Lacuna/Constants.pm +++ b/lib/Lacuna/Constants.pm @@ -29,6 +29,13 @@ use constant FINDABLE_PLANS => (qw( Lacuna::DB::Result::Building::Permanent::AlgaePond )); use constant BUILDABLE_CLASSES => (qw( + Lacuna::RPC::Building::AtmosphericEvaporator + Lacuna::RPC::Building::MetalJunkArches + Lacuna::RPC::Building::SpaceJunkPark + Lacuna::RPC::Building::SAW + Lacuna::RPC::Building::PyramidJunkSculpture + Lacuna::RPC::Building::JunkHengeSculpture + Lacuna::RPC::Building::GreatBallOfJunk Lacuna::RPC::Building::ThemePark Lacuna::RPC::Building::MissionCommand Lacuna::RPC::Building::CloakingLab @@ -105,7 +112,7 @@ use constant SHIP_TYPES => (qw( probe short_range_colony_ship colony_ship spy_po smuggler_ship mining_platform_ship terraforming_platform_ship surveyor gas_giant_settlement_ship scow dory freighter snark snark2 snark3 thud drone fighter spy_shuttle observatory_seeker security_ministry_seeker - spaceport_seeker excavator detonator scanner barge hulk galleon + spaceport_seeker excavator detonator scanner barge hulk galleon stake placebo placebo2 placebo3 placebo4 placebo5 placebo6 bleeder sweeper )); diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index 51db4995..fe6e1a37 100644 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -1026,6 +1026,11 @@ sub spend_efficiency { 'Lacuna::DB::Result::Building::Permanent::HallsOfVrbansk' => 'Lacuna::DB::Result::Building::Permanent::HallsOfVrbansk', 'Lacuna::DB::Result::Building::Permanent::KasternsKeep' => 'Lacuna::DB::Result::Building::Permanent::KasternsKeep', 'Lacuna::DB::Result::Building::Permanent::TheDillonForge' => 'Lacuna::DB::Result::Building::Permanent::TheDillonForge', + 'Lacuna::DB::Result::Building::Permanent::GreatBallOfJunk' => 'Lacuna::DB::Result::Building::Permanent::GreatBallOfJunk', + 'Lacuna::DB::Result::Building::Permanent::PyramidJunkSculpture' => 'Lacuna::DB::Result::Building::Permanent::PyramidJunkSculpture', + 'Lacuna::DB::Result::Building::Permanent::MetalJunkArches' => 'Lacuna::DB::Result::Building::Permanent::MetalJunkArches', + 'Lacuna::DB::Result::Building::Permanent::JunkHengeSculpture' => 'Lacuna::DB::Result::Building::Permanent::JunkHengeSculpture', + 'Lacuna::DB::Result::Building::Permanent::SpaceJunkPark' => 'Lacuna::DB::Result::Building::Permanent::SpaceJunkPark', }); } diff --git a/lib/Lacuna/DB/Result/Building/Energy/Singularity.pm b/lib/Lacuna/DB/Result/Building/Energy/Singularity.pm index 5d570e2d..abec2dbb 100644 --- a/lib/Lacuna/DB/Result/Building/Energy/Singularity.pm +++ b/lib/Lacuna/DB/Result/Building/Energy/Singularity.pm @@ -34,6 +34,7 @@ use constant energy_production => 475; use constant ore_consumption => 5; use constant water_consumption => 6; +use constant max_instances_per_planet => 2; use constant waste_production => 23; diff --git a/lib/Lacuna/DB/Result/Building/LuxuryHousing.pm b/lib/Lacuna/DB/Result/Building/LuxuryHousing.pm index b463aa4d..7ada7d96 100644 --- a/lib/Lacuna/DB/Result/Building/LuxuryHousing.pm +++ b/lib/Lacuna/DB/Result/Building/LuxuryHousing.pm @@ -41,6 +41,7 @@ use constant water_consumption => 85; use constant waste_production => 60; use constant happiness_production => 230; +use constant max_instances_per_planet => 2; diff --git a/lib/Lacuna/DB/Result/Building/Permanent/GreatBallOfJunk.pm b/lib/Lacuna/DB/Result/Building/Permanent/GreatBallOfJunk.pm new file mode 100644 index 00000000..c835f52e --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Permanent/GreatBallOfJunk.pm @@ -0,0 +1,30 @@ +package Lacuna::DB::Result::Building::Permanent::GreatBallOfJunk; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Permanent'; + +use constant controller_class => 'Lacuna::RPC::Building::GreatBallOfJunk'; + +sub can_upgrade { + confess [1013, "You can't upgrade a monument."]; +} + +use constant image => 'greatballofjunk'; + +sub image_level { + my ($self) = @_; + return $self->image.'1'; +} + +use constant name => 'Great Ball of Junk'; +use constant time_to_build => 60 * 60 * 20; +use constant max_instances_per_planet => 1; +use constant happiness_production => 20_000; +use constant university_prereq => 23; +use constant waste_to_build => -4_000_000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Permanent/JunkHengeSculpture.pm b/lib/Lacuna/DB/Result/Building/Permanent/JunkHengeSculpture.pm new file mode 100644 index 00000000..c4219af7 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Permanent/JunkHengeSculpture.pm @@ -0,0 +1,31 @@ +package Lacuna::DB::Result::Building::Permanent::JunkHengeSculpture; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Permanent'; + +use constant controller_class => 'Lacuna::RPC::Building::JunkHengeSculpture'; + + +sub can_upgrade { + confess [1013, "You can't upgrade a monument."]; +} + +use constant image => 'junkhengesculpture'; + +sub image_level { + my ($self) = @_; + return $self->image.'1'; +} + +use constant name => 'Junk Henge Sculpture'; +use constant time_to_build => 60 * 60 * 10; +use constant max_instances_per_planet => 1; +use constant happiness_production => 10_000; +use constant university_prereq => 21; +use constant waste_to_build => -2_000_000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Permanent/MetalJunkArches.pm b/lib/Lacuna/DB/Result/Building/Permanent/MetalJunkArches.pm new file mode 100644 index 00000000..eac4efd3 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Permanent/MetalJunkArches.pm @@ -0,0 +1,30 @@ +package Lacuna::DB::Result::Building::Permanent::MetalJunkArches; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Permanent'; + +use constant controller_class => 'Lacuna::RPC::Building::MetalJunkArches'; + +sub can_upgrade { + confess [1013, "You can't upgrade a monument."]; +} + +use constant image => 'metaljunkarches'; + +sub image_level { + my ($self) = @_; + return $self->image.'1'; +} + +use constant name => 'Metal Junk Arches'; +use constant time_to_build => 60 * 60 * 30; +use constant max_instances_per_planet => 1; +use constant happiness_production => 30_000; +use constant university_prereq => 25; +use constant waste_to_build => -6_000_000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Permanent/PyramidJunkSculpture.pm b/lib/Lacuna/DB/Result/Building/Permanent/PyramidJunkSculpture.pm new file mode 100644 index 00000000..4b5aea69 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Permanent/PyramidJunkSculpture.pm @@ -0,0 +1,30 @@ +package Lacuna::DB::Result::Building::Permanent::PyramidJunkSculpture; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Permanent'; + +use constant controller_class => 'Lacuna::RPC::Building::PyramidJunkSculpture'; + +sub can_upgrade { + confess [1013, "You can't upgrade a monument."]; +} + +use constant image => 'pyramidjunksculpture'; + +sub image_level { + my ($self) = @_; + return $self->image.'1'; +} + +use constant name => 'Pyramid Junk Sculpture'; +use constant time_to_build => 60 * 60 * 50; +use constant max_instances_per_planet => 1; +use constant happiness_production => 50_000; +use constant university_prereq => 29; +use constant waste_to_build => -10_000_000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Permanent/SpaceJunkPark.pm b/lib/Lacuna/DB/Result/Building/Permanent/SpaceJunkPark.pm new file mode 100644 index 00000000..73505619 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Permanent/SpaceJunkPark.pm @@ -0,0 +1,30 @@ +package Lacuna::DB::Result::Building::Permanent::SpaceJunkPark; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Permanent'; + +use constant controller_class => 'Lacuna::RPC::Building::SpaceJunkPark'; + +sub can_upgrade { + confess [1013, "You can't upgrade a monument."]; +} + +use constant image => 'spacejunkpark'; + +sub image_level { + my ($self) = @_; + return $self->image.'1'; +} + +use constant name => 'Space Junk Park'; +use constant time_to_build => 60 * 60 * 40; +use constant max_instances_per_planet => 1; +use constant happiness_production => 40_000; +use constant university_prereq => 27; +use constant waste_to_build => -8_000_000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/SAW.pm b/lib/Lacuna/DB/Result/Building/SAW.pm new file mode 100644 index 00000000..f0648f86 --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/SAW.pm @@ -0,0 +1,57 @@ +package Lacuna::DB::Result::Building::SAW; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building'; + +around 'build_tags' => sub { + my ($orig, $class) = @_; + return ($orig->($class), qw(Infrastructure Ships)); +}; + +before has_special_resources => sub { + my $self = shift; + my $planet = $self->body; + my $amount_needed = sprintf('%.0f', $self->ore_to_build * $self->upgrade_cost * 0.20); + if ($planet->chalcopyrite_stored + $planet->gold_stored + $planet->bauxite_stored < $amount_needed) { + confess [1012,"You do not have a sufficient supply (".$amount_needed.") of conductive metals such as Chalcopyrite, Gold, and Bauxite to build magnetic pulse cannons."]; + } + if ($planet->rutile_stored + $planet->chromite_stored + $planet->bauxite_stored + $planet->magnetite_stored + $planet->monazite_stored < $amount_needed) { + confess [1012,"You do not have a sufficient supply (".$amount_needed.") of magnetic and paramagnetic minerals such as Magnetite, Monazite, Rutile, Bauxite, and Chromite needed to build high-impact shells."]; + } +}; + +use constant controller_class => 'Lacuna::RPC::Building::SAW'; + +use constant university_prereq => 15; + +use constant image => 'saw'; + +use constant name => 'Shield Against Weapons'; + +use constant food_to_build => 180; + +use constant energy_to_build => 250; + +use constant ore_to_build => 250; + +use constant water_to_build => 200; + +use constant waste_to_build => 100; + +use constant time_to_build => 60 * 2; + +use constant food_consumption => 8; + +use constant energy_consumption => 80; + +use constant ore_consumption => 20; + +use constant water_consumption => 12; + +use constant waste_production => 30; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Building/Water/AtmosphericEvaporator.pm b/lib/Lacuna/DB/Result/Building/Water/AtmosphericEvaporator.pm new file mode 100644 index 00000000..3d83ba8f --- /dev/null +++ b/lib/Lacuna/DB/Result/Building/Water/AtmosphericEvaporator.pm @@ -0,0 +1,49 @@ +package Lacuna::DB::Result::Building::Water::AtmosphericEvaporator; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Building::Water'; + +use constant controller_class => 'Lacuna::RPC::Building::AtmosphericEvaporator'; + +use constant image => 'atmposphericevaporator'; + +use constant name => 'Atmospheric Evaporator'; + +use constant food_to_build => 630; + +use constant energy_to_build => 560; + +use constant ore_to_build => 770; + +use constant water_to_build => 70; + +use constant waste_to_build => 140; + +use constant time_to_build => 60 * 3; + +use constant food_consumption => 7; + +use constant energy_consumption => 63; + +use constant ore_consumption => 21; + +use constant water_consumption => 14; + +use constant water_production => 280; +use constant max_instances_per_planet => 2; +use constant university_prereq => 17; + +use constant waste_production => 63; + +sub water_production_hour { + my ($self) = @_; + return sprintf('%.0f',$self->body->water * $self->water_production * $self->production_hour / 10000); +} + + + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index c00c2281..04868a8d 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -33,7 +33,7 @@ use constant MEDALS => { smuggler_ship => 'Built Smuggler Ship', mining_platform_ship => 'Built Mining Platform Ship', terraforming_platform_ship => 'Built Terraforming Platform Ship', - gas_giant_settlement_ship => 'Built Gas Giant Settlement Platform Ship', + gas_giant_settlement_ship => 'Built Gas Giant Settlement Platform Ship', scow => 'Built Scow', dory => 'Built Dory', barge => 'Built Barge', @@ -48,6 +48,7 @@ use constant MEDALS => { hulk => 'Built Hulk', freighter => 'Built Freighter', thud => 'Built Thud', + stake => 'Built Stake', sweeper => 'Built Sweeper', snark => 'Built Snark', snark2 => 'Built Snark II', @@ -177,6 +178,13 @@ use constant MEDALS => { building28 => 'Built Level 28 Building', building29 => 'Built Level 29 Building', building30 => 'Built Level 30 Building', + SAW => 'Built Shield Against Weapons', + AtmosphericEvaporator => 'Built Atmospheric Evaporator', + GreatBallOfJunk => 'Built Great Ball of Junk', + PyramidJunkSculpture => 'Built Pyramid Junk Sculpture', + SpaceJunkPark => 'Built Space Junk Park', + MetalJunkArches => 'Built Metal Junk Arches', + JunkHengeSculpture => 'Built Junk Henge Sculpture', Capitol => 'Built Capitol', ThemePark => 'Built Theme Park', BlackHoleGenerator => 'Discovered a Black Hole Generator', diff --git a/lib/Lacuna/RPC/Building/AtmosphericEvaporator.pm b/lib/Lacuna/RPC/Building/AtmosphericEvaporator.pm new file mode 100644 index 00000000..39817d53 --- /dev/null +++ b/lib/Lacuna/RPC/Building/AtmosphericEvaporator.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::AtmosphericEvaporator; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/atmosphericevaporator'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::AtmosphericEvaporator'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/GreatBallOfJunk.pm b/lib/Lacuna/RPC/Building/GreatBallOfJunk.pm new file mode 100644 index 00000000..a8e9cbaa --- /dev/null +++ b/lib/Lacuna/RPC/Building/GreatBallOfJunk.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::GreatBallOfJunk; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/greatballofjunk'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::GreatBallOfJunk'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/JunkHengeSculpture.pm b/lib/Lacuna/RPC/Building/JunkHengeSculpture.pm new file mode 100644 index 00000000..0ee7dd1f --- /dev/null +++ b/lib/Lacuna/RPC/Building/JunkHengeSculpture.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::JunkHengeSculpture; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/junkhengesculpture'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::JunkHengeSculpture'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/MetalJunkArches.pm b/lib/Lacuna/RPC/Building/MetalJunkArches.pm new file mode 100644 index 00000000..317a572e --- /dev/null +++ b/lib/Lacuna/RPC/Building/MetalJunkArches.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::MetalJunkArches; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/metaljunkarches'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::MetalJunkArches'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/PyramidJunkSculpture.pm b/lib/Lacuna/RPC/Building/PyramidJunkSculpture.pm new file mode 100644 index 00000000..ac915992 --- /dev/null +++ b/lib/Lacuna/RPC/Building/PyramidJunkSculpture.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::PyramidJunkSculpture; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/pyramidjunksculpture'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::PyramidJunkSculpture'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/SAW.pm b/lib/Lacuna/RPC/Building/SAW.pm new file mode 100644 index 00000000..32830e7e --- /dev/null +++ b/lib/Lacuna/RPC/Building/SAW.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::SAW; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/saw'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::SAW'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/RPC/Building/SpaceJunkPark.pm b/lib/Lacuna/RPC/Building/SpaceJunkPark.pm new file mode 100644 index 00000000..88b64692 --- /dev/null +++ b/lib/Lacuna/RPC/Building/SpaceJunkPark.pm @@ -0,0 +1,18 @@ +package Lacuna::RPC::Building::SpaceJunkPark; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::RPC::Building'; + +sub app_url { + return '/spacejunkpark'; +} + +sub model_class { + return 'Lacuna::DB::Result::Building::SpaceJunkPark'; +} + +no Moose; +__PACKAGE__->meta->make_immutable; + diff --git a/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm b/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm index 8e09bbb8..81500106 100644 --- a/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm +++ b/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm @@ -38,6 +38,22 @@ after handle_arrival_procedures => sub { } $self->damage_in_combat($damage); } + + # get SAWs + my $saws = $body_attacked->get_buildings_of_class('Lacuna::DB::Result::Building::SAW'); + + # if there are SAWs lets duke it out + while (my $saw = $saws->next) { + next if $saw->efficiency < 1; + next if $saw->is_working; + my $combat = ($saw->level * 1000) * ( $saw->efficiency / 100 ); + $saw->spend_efficiency( int( $self->combat / 100 ) ); + $saw->start_work({}, 60 * $self->level); + $saw->update; + $self->damage_in_combat($combat); + } + + }; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 970670bf..04e89287 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,14 @@ +2.4100 + - When looking at trades in the market they are now sorted by price. + - Added 5 new waste monuments: Great Ball of Junk, Junk Henge Sculpture, Space Junk Park, Pyramid Junk Sculpture, and Metal Junk Arches. + - Added Shield Against Weapons building. SAW is great for ripping enemy ships from the sky. + - Added Atmospheric Evaporator water producer building. This is the tier 2 water building. + - Added Stake ship. This can be used to hold a target planet until your colony ship arrives. + - You can now only have 2 singularity plants per planet. Existing planets with more than 2 are grandfathered in. + - You can now only have 2 luxury housing buildings per planet. Existing planets with more than 2 are grandfathered in. + - Fixed: Was calculating efficiency wrong for security ministry and space port as far as detecting ships. + - Flipped Space Port's ability to see the type of ship vs the path of where it's coming from, because it's more realistic that way. + 2.4002 - Scanners had a typo that caused them to create crash bug upon arrival. - Fixed a bug in the new market system. diff --git a/var/www/public/resources.json b/var/www/public/resources.json index 2ce711bb..779c3269 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -1,5 +1,12 @@ { "buildings" : { + "/saw" : { "description" : "A railgun system used to protect your planet from enemy ships.", "wiki" : "http://community.lacunaexpanse.com/wiki/shield-against-weapons" }, + "/atmosphericevaporator" : { "description" : "Produces water by condensing it from the air and soil.", "wiki" : "http://community.lacunaexpanse.com/wiki/atmospheric-evaporator" }, + "/greatballofjunk" : { "description" : "Eliminate waste and give your citizens something to be proud of at the same time.", "wiki" : "http://community.lacunaexpanse.com/wiki/great-ball-of-junk" }, + "/pyramidjunksculpture" : { "description" : "Eliminate waste and give your citizens something to be proud of at the same time.", "wiki" : "http://community.lacunaexpanse.com/wiki/pyramid-junk-sculpture" }, + "/spacejunkpark" : { "description" : "Eliminate waste and give your citizens something to be proud of at the same time.", "wiki" : "http://community.lacunaexpanse.com/wiki/space-junk-park" }, + "/junkhengesculpture" : { "description" : "Eliminate waste and give your citizens something to be proud of at the same time.", "wiki" : "http://community.lacunaexpanse.com/wiki/junk-henge-sculpture" }, + "/metaljunkarches" : { "description" : "Eliminate waste and give your citizens something to be proud of at the same time.", "wiki" : "http://community.lacunaexpanse.com/wiki/metal-junk-arches" }, "/deployedbleeder" : { "description" : "Converts planet's resources directly into waste.", "wiki" : "http://community.lacunaexpanse.com/wiki/bleeder" }, "/oracleofanid" : { "description" : "The all seeing Oracle can help detect enemy threats.", "wiki" : "http://community.lacunaexpanse.com/wiki/oracle-of-anid" }, "/themepark" : { "description" : "Produces happiness for your citizens through food and entertainment.", "wiki" : "http://community.lacunaexpanse.com/wiki/theme-park" }, @@ -119,6 +126,7 @@ "/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" } }, "ships" : { + "stake" : { "description" : "Allows you to claim a planet prior to your colony ship arriving.", "wiki" : "http://community.lacunaexpanse.com/wiki/stake" }, "thud" : { "description" : "Temporarily destroys plots on a planet's surface.", "wiki" : "http://community.lacunaexpanse.com/wiki/thud" }, "sweeper" : { "description" : "An upgraded Figher who's primary role is offense rather than defense.", "wiki" : "http://community.lacunaexpanse.com/wiki/sweeper" }, "placebo" : { "description" : "Use to fake an attack on another player.", "wiki" : "http://community.lacunaexpanse.com/wiki/placebo" },