diff --git a/lib/Lacuna/Constants.pm b/lib/Lacuna/Constants.pm index 090cd7f9..a28a8efa 100644 --- a/lib/Lacuna/Constants.pm +++ b/lib/Lacuna/Constants.pm @@ -102,7 +102,7 @@ use constant BUILDABLE_CLASSES => (qw( )); use constant SHIP_TYPES => (qw( probe short_range_colony_ship colony_ship spy_pod cargo_ship space_station - smuggler_ship mining_platform_ship terraforming_platform_ship + smuggler_ship mining_platform_ship terraforming_platform_ship surveyor gas_giant_settlement_ship scow dory freighter snark snark2 snark3 drone fighter spy_shuttle observatory_seeker security_ministry_seeker spaceport_seeker excavator detonator scanner barge hulk galleon diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index 818f15a9..70638260 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -59,6 +59,7 @@ use constant MEDALS => { excavator => 'Built Excavator', detonator => 'Built Detonator', scanner => 'Built Scanner', + surveyor => 'Built Surveyor', rutile_glyph => 'Uncovered Rutile Glyph', chromite_glyph => 'Uncovered Chromite Glyph', chalcopyrite_glyph => 'Uncovered Chalcopyrite Glyph', diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index ec705bd0..2028667c 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -46,6 +46,7 @@ __PACKAGE__->typecast_map(type => { 'terraforming_platform_ship' => 'Lacuna::DB::Result::Ships::TerraformingPlatformShip', 'gas_giant_settlement_ship' => 'Lacuna::DB::Result::Ships::GasGiantSettlementPlatformShip', 'scanner' => 'Lacuna::DB::Result::Ships::Scanner', + 'surveyor' => 'Lacuna::DB::Result::Ships::Surveyor', 'detonator' => 'Lacuna::DB::Result::Ships::Detonator', 'excavator' => 'Lacuna::DB::Result::Ships::Excavator', 'scow' => 'Lacuna::DB::Result::Ships::Scow', diff --git a/lib/Lacuna/DB/Result/Ships/Surveyor.pm b/lib/Lacuna/DB/Result/Ships/Surveyor.pm new file mode 100644 index 00000000..886ca91d --- /dev/null +++ b/lib/Lacuna/DB/Result/Ships/Surveyor.pm @@ -0,0 +1,26 @@ +package Lacuna::DB::Result::Ships::Surveyor; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Ships'; + +use constant prereq => { class=> 'Lacuna::DB::Result::Building::Intelligence', level => 10 }; +use constant base_food_cost => 1500; +use constant base_water_cost => 2500; +use constant base_energy_cost => 25000; +use constant base_ore_cost => 29000; +use constant base_time_cost => 36000; +use constant base_waste_cost => 5200; +use constant base_speed => 60 * 60 * 6; +use constant base_combat => 1000; +use constant base_stealth => 3000; +use constant base_hold_size => 0; +use constant build_tags => [qw(Exploration Intelligence)]; + +with "Lacuna::Role::Ship::Send::Planet"; +with "Lacuna::Role::Ship::Arrive::TriggerDefense"; +with "Lacuna::Role::Ship::Arrive::SurveySurface"; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/Role/Ship/Arrive/ScanSurface.pm b/lib/Lacuna/Role/Ship/Arrive/ScanSurface.pm index 8968d2a9..2afd5af5 100644 --- a/lib/Lacuna/Role/Ship/Arrive/ScanSurface.pm +++ b/lib/Lacuna/Role/Ship/Arrive/ScanSurface.pm @@ -25,7 +25,7 @@ after handle_arrival_procedures => sub { $self->body->empire->send_predefined_message( tags => ['Alert'], filename => 'scanner_data.txt', - params => [$body_attacked->x, $body_attacked->y, $body_attacked->name], + params => [$self->type_formatted, $self->type_formatted, $self->named, $body_attacked->x, $body_attacked->y, $body_attacked->name], attachments => { map => { surface => $body_attacked->surface, @@ -39,7 +39,7 @@ after handle_arrival_procedures => sub { $body_attacked->empire->send_predefined_message( tags => ['Alert'], filename => 'we_were_scanned.txt', - params => [$body_attacked->id, $body_attacked->name, $self->body->empire_id, $self->body->empire->name], + params => [$body_attacked->id, $body_attacked->name, $self->type_formatted, $self->body->empire_id, $self->body->empire->name], ); $body_attacked->add_news(65, sprintf('Several people reported seeing a UFO in the %s sky today.', $body_attacked->name)); } diff --git a/lib/Lacuna/Role/Ship/Arrive/SurveySurface.pm b/lib/Lacuna/Role/Ship/Arrive/SurveySurface.pm new file mode 100644 index 00000000..7c2eaffb --- /dev/null +++ b/lib/Lacuna/Role/Ship/Arrive/SurveySurface.pm @@ -0,0 +1,61 @@ +package Lacuna::Role::Ship::Arrive::SurveySurface; + +use strict; +use Moose::Role; + +after handle_arrival_procedures => sub { + my ($self) = @_; + + # we're coming home + return if ($self->direction eq 'in'); + + # do the scan + my $body_attacked = $self->foreign_body; + my @map; + my @table = ([q(Name Level X Y)]); + my $buildings = $body_attacked->buildings; + while (my $building = $buildings->next) { + push @map, { + image => $building->image_level, + x => $building->x, + y => $building->y, + }; + push @table, [ + name => $building->name, + level => $building->level, + x => $building->x, + y => $building->y, + ]; + } + + # phone home + $self->body->empire->send_predefined_message( + tags => ['Alert'], + filename => 'scanner_data.txt', + params => [$self->type_formatted, $self->type_formatted, $self->name, $body_attacked->x, $body_attacked->y, $body_attacked->name], + attachments => { + map => { + surface => $body_attacked->surface, + buildings => \@map + }, + table => \@table, + }, + ); + + # alert empire scanned, if any + if ($body_attacked->empire_id && defined $body_attacked->empire) { + $body_attacked->empire->send_predefined_message( + tags => ['Alert'], + filename => 'we_were_scanned.txt', + params => [$body_attacked->id, $body_attacked->name, $self->type_formatted, $self->body->empire_id, $self->body->empire->name], + ); + $body_attacked->add_news(65, sprintf('Several people reported seeing a UFO in the %s sky today.', $body_attacked->name)); + } + + # all pow + $self->delete; + confess [-1]; +}; + + +1; diff --git a/var/messages/scanner_data.txt b/var/messages/scanner_data.txt index ac7a6daf..4d3d9e18 100644 --- a/var/messages/scanner_data.txt +++ b/var/messages/scanner_data.txt @@ -1,6 +1,6 @@ -Scan Results +%s Results ~~~ -Our scanner captured the attached map of {Starmap %s %s %s}. +Our %s named %s captured the attached map of {Starmap %s %s %s}. Regards, diff --git a/var/messages/we_were_scanned.txt b/var/messages/we_were_scanned.txt index b9d82e4c..b2be7ae6 100644 --- a/var/messages/we_were_scanned.txt +++ b/var/messages/we_were_scanned.txt @@ -1,6 +1,6 @@ We've Been Scanned ~~~ -Our sensors indicate that {Planet %s %s} has just been scanned by {Empire %s %s}. This could be idle curiosity or an indication of a pending attack. We need to get some Drones built to stop future scans, and other types of attacks. +Our sensors indicate that {Planet %s %s} has just been scanned by a %s controlled by {Empire %s %s}. This could be idle curiosity or an indication of a pending attack. We need to get some Drones built to stop future scans, and other types of attacks. Regards, diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 4c67043d..ce9d93b5 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -30,6 +30,7 @@ - Added Barge, Galleon, and Hulk trade ship classes. - Added Placebo 1 thru 6, which are used to fake an attack. - Added Bleeder attack ship. + - Added Surveyor reconnaissance ship. 2.3902 - Halls of Vrbansk now also returns building URL. diff --git a/var/www/public/resources.json b/var/www/public/resources.json index fc7f60fa..709dc992 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -153,6 +153,7 @@ "spaceport_seeker" : { "description" : "Variant of the Snark that attacks a SpacePort.", "wiki" : "http://community.lacunaexpanse.com/wiki/spaceport-seeker" }, "excavator" : { "description" : "Robotic explorer that searches remote bodies looking for artifacts.", "wiki" : "http://community.lacunaexpanse.com/wiki/excavator" }, "detonator" : { "description" : "Variant of the Snark that detonates in an electro magnetic pulse, which can be used to destroy probes.", "wiki" : "http://community.lacunaexpanse.com/wiki/detonator" }, + "surveyor" : { "description" : "Robotic explorer that snaps a photograph of the surface of a remote planet, and also identifies the buildings in the photograph.", "wiki" : "http://community.lacunaexpanse.com/wiki/surveyor" }, "scanner" : { "description" : "Robotic explorer that snaps a photograph of the surface of a remote planet.", "wiki" : "http://community.lacunaexpanse.com/wiki/scanner" } }, "tips" : [