From f82f3a339ce26ed6a434e30fbc2cd1185f16c9be Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 30 Mar 2011 15:06:03 -0500 Subject: [PATCH] added gratch's gauntlet --- lib/Lacuna.pm | 2 +- lib/Lacuna/DB/Result/Building/Archaeology.pm | 7 ++++++ lib/Lacuna/DB/Result/Spies.pm | 25 +++++++++++++------- lib/Lacuna/RPC/Building/GratchsGauntlet.pm | 3 +++ var/www/public/changes.txt | 7 ++++-- var/www/public/resources.json | 2 +- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index 5443ed06..b092e2e5 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0301; +our $VERSION = 3.0400; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index 0102b344..1ee0e23b 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -162,6 +162,13 @@ my %recipies = ( }, }, chromite => { + bauxite => { + gold => { + kerogen => { + plan => 'Lacuna::DB::Result::Building::Permanent::GratchsGauntlet', + }, + }, + }, halite => { anthracite => { beryl => { diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index 50540fbd..739fdc96 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -294,13 +294,22 @@ sub is_available { return 1; } elsif ($task eq 'Travelling') { - my $infiltration_time = $self->available_on->clone->add(hours => 1); - if ($infiltration_time->epoch > time && $self->empire_id ne $self->on_body->empire_id) { - $self->task('Infiltrating'); - $self->started_assignment(DateTime->now); - $self->available_on($infiltration_time); - $self->update; - return 0; + if ($self->empire_id ne $self->on_body->empire_id) { + if (!$self->empire->alliance_id || $self->empire->alliance_id != $self->on_body->empire->alliance_id ) { + my $hours = 1; + my $gauntlet = $self->on_body->get_building_of_class('Lacuna::DB::Result::Building::Permanent::GratchsGauntlet'); + if (defined $gauntlet) { + $hours += $gauntlet->level * 3; + } + my $infiltration_time = $self->available_on->clone->add(hours => $hours); + if ($infiltration_time->epoch > time) { + $self->task('Infiltrating'); + $self->started_assignment(DateTime->now); + $self->available_on($infiltration_time); + $self->update; + return 0; + } + } } } $self->task('Idle'); @@ -569,7 +578,7 @@ sub get_defender { sub get_attacker { my $self = shift; - my @tasks; + my @tasks = 'Infiltrating'; foreach my $task ($self->offensive_assignments) { push @tasks, $task->{task}; } diff --git a/lib/Lacuna/RPC/Building/GratchsGauntlet.pm b/lib/Lacuna/RPC/Building/GratchsGauntlet.pm index dcccdfdf..4cc753c1 100644 --- a/lib/Lacuna/RPC/Building/GratchsGauntlet.pm +++ b/lib/Lacuna/RPC/Building/GratchsGauntlet.pm @@ -13,6 +13,9 @@ sub model_class { return 'Lacuna::DB::Result::Building::Permanent::GratchsGauntlet'; } + +__PACKAGE__->register_rpc_method_names(qw()); + no Moose; __PACKAGE__->meta->make_immutable; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 8ac7ddc1..34144c87 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,7 +1,12 @@ 3.0400 - Add: Added the Opera House, Art Museum, and Culinary Institute space station modules. - Add: The Lost City of Tyleon. + - Add: Added Gratch's Gauntlet which adds 3 hours to infiltration time per level. + - Add: The Police Station space station module has been added. + - Rule: Security Ministry Seekers can also target Police Stations now. - Rule: We now allow 20 ships per fleet. + - Rule: Allied spies no longer "infiltrate" on your planet. + - Rule: Security sweep can once again find infiltrating spies. - 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. - Rule: Security ministry is now more oppressive on happiness consumption. @@ -31,8 +36,6 @@ - API: The Mercenaries Guild API has been corrected. - API: The view_ships_orbiting() method of the SpacePort now correctly shows the foreign ships orbiting your planet as opposed to your ships that are orbiting foreign bodies. - Fix: Space station propositions weren't all working properly when passed/failed. - - Add: The Police Station space station module has been added. - - Rule: Security Ministry Seekers can also target Police Stations now. 3.0301 - Fixed the massive repeating resource warning messages. diff --git a/var/www/public/resources.json b/var/www/public/resources.json index c61f3925..9511201a 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -27,7 +27,7 @@ "/themepark" : { "description" : "Produces happiness for your citizens through food and entertainment.", "wiki" : "http://community.lacunaexpanse.com/wiki/theme-park" }, "/geneticslab" : { "description" : "Allows genetic experiements on captured spies to improve your species.", "wiki" : "http://community.lacunaexpanse.com/wiki/genetics-lab" }, "/massadshenge" : { "description" : "An ancient observatory.", "wiki" : "http://community.lacunaexpanse.com/wiki/massad-s-henge" }, - "/gratchsgauntlet" : { "description" : "The training grounds of the Great Race.", "wiki" : "http://community.lacunaexpanse.com/wiki/gratch-s-gauntlet" }, + "/gratchsgauntlet" : { "description" : "The anti-espionage system of the Great Race.", "wiki" : "http://community.lacunaexpanse.com/wiki/gratch-s-gauntlet" }, "/kasternskeep" : { "description" : "The place from which the Great Race commanded their armies.", "wiki" : "http://community.lacunaexpanse.com/wiki/kastern-s-keep" }, "/hallsofvrbansk" : { "description" : "The source of ancient wisdom.", "wiki" : "http://community.lacunaexpanse.com/wiki/halls-of-vrbansk" }, "/libraryofjith" : { "description" : "Where the Great Race kept records of their experiments.", "wiki" : "http://community.lacunaexpanse.com/wiki/library-of-jith" }, -- 2.51.2