From 3479bad919ccdbaea1548bdc04bb2e2030a0eafc Mon Sep 17 00:00:00 2001 From: Ian Docherty Date: Thu, 30 Aug 2012 04:24:43 -0400 Subject: [PATCH] Revert "Merge branch 'master' of github.com:plainblack/Lacuna-Server-Open" This reverts commit 1905a3467e1bca236a9ef6635ad96614ebef9f98, reversing changes made to bf636d168618c0d49824374c29138fc564bc157d. Conflicts: bin/util/revamp_map.pl --- bin/lacuna.psgi | 1 - bin/util/revamp_map.pl | 188 ------------------ bin/util/revamp_map_message_1.pl | 67 ------- bin/util/revamp_map_message_2.pl | 65 ------ bin/util/revamp_map_message_3.pl | 69 ------- docs/Buildings.pod | 2 - docs/Fissure.pod | 7 - lib/Lacuna/DB/Result/Building.pm | 1 - .../DB/Result/Building/Permanent/Fissure.pm | 83 -------- lib/Lacuna/DB/Result/Medals.pm | 1 - lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 2 +- lib/Lacuna/RPC/Building/Fissure.pm | 18 -- var/www/public/changes.txt | 4 - var/www/public/resources.json | 1 - 14 files changed, 1 insertion(+), 508 deletions(-) delete mode 100644 bin/util/revamp_map.pl delete mode 100644 bin/util/revamp_map_message_1.pl delete mode 100644 bin/util/revamp_map_message_2.pl delete mode 100644 bin/util/revamp_map_message_3.pl delete mode 100644 docs/Fissure.pod delete mode 100644 lib/Lacuna/DB/Result/Building/Permanent/Fissure.pm delete mode 100644 lib/Lacuna/RPC/Building/Fissure.pm diff --git a/bin/lacuna.psgi b/bin/lacuna.psgi index 37c15ee9..a2092f3b 100644 --- a/bin/lacuna.psgi +++ b/bin/lacuna.psgi @@ -205,7 +205,6 @@ my $app = builder { Lacuna::RPC::Building::CloakingLab Lacuna::RPC::Building::MunitionsLab Lacuna::RPC::Building::LuxuryHousing - Lacuna::RPC::Building::Fissure Lacuna::RPC::Building::Ravine Lacuna::RPC::Building::AlgaePond Lacuna::RPC::Building::LapisForest diff --git a/bin/util/revamp_map.pl b/bin/util/revamp_map.pl deleted file mode 100644 index efb4b309..00000000 --- a/bin/util/revamp_map.pl +++ /dev/null @@ -1,188 +0,0 @@ -use 5.010; -use strict; -use lib '/data/Lacuna-Server/lib'; -use Lacuna::DB; -use Lacuna; -use Lacuna::Util qw(randint format_date random_element); -use Getopt::Long; -use List::MoreUtils qw(uniq); -$|=1; -our $quiet; -GetOptions( - 'quiet' => \$quiet, -); - -out('Started'); -my $start = time; - -out('Loading DB'); -our $db = Lacuna->db; -my $bodies = $db->resultset('Map::Body'); -my $stars = $db->resultset('Map::Star'); -my $empire = $db->resultset('Empire'); -my $db_config = $db->resultset('Config'); -my $config = Lacuna->config; - -my @asteroid_types = qw(A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 A23 A24 A25 A26); -my @habital_types = qw(P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P20 P21 P22 P23 P24 P25 P26 P27 P28 P29 P30 P31 P32 P33 P34 P35 P36 P37 P38 P39 P40); -my @gas_giant_types = qw(G1 G2 G3 G4 G5); - -my $z_config = $db_config->search({name => 'revamp_zone'})->single; -my $x_min = int($config->get('map_size/x')->[0]/250); -my $y_min = int($config->get('map_size/y')->[0]/250); -my $x_max = int($config->get('map_size/x')->[1]/250); -my $y_max = int($config->get('map_size/y')->[1]/250); - -if (not defined $z_config) { - my $starting_zone = "$x_min|$y_min"; - out("Starting on zone $starting_zone. Good Luck!"); - - $z_config = $db_config->create({ - name => 'revamp_zone', - value => $starting_zone, - }); -} -my $zone = $z_config->value; -my ($x,$y) = $zone =~ m/(-?\d+)\|(-?\d+)/; - -my %zone_details; - -out('Working on zone '.$zone); -my $first_in_zone = 1; -my $zone_bodies = $bodies->search({zone => $zone},{order_by => ['x','y']}); -determine_zone_details(); -if ($x > $x_max || $y > $y_max) { - out('All done! You may stop the cron job!'); - exit; -} -while (my $body = $zone_bodies->next) { - if ($body->empire_id > 1) { - if ($first_in_zone) { - $first_in_zone = 0; - $body->add_news(100,'... --- ...'); - $body->add_news(100,'- .... . .-. .. -... -... --- -. .. ... .... . .-. .'); - $body->add_news(100,'a$'.randint(1111,9999).' ribbon ha$ ajd..a# zone '.$zone.'___23kkd..'); - $body->add_news(100,'9990()(destroyed much of|||938....'); - $body->add_news(100,'.-- .... .- - .... .- ...- . .-- . -.. --- -. . ..--.. '); - } - wreck_planet($body); - } - elsif ($body->get_type eq 'space station') { - #skip it - } - else { - convert_body($body); - } -} - -$x = $x + 1; -if ($x > $x_max) { - $x = $x_min; - $y = $y + 1; -} - -$z_config->value("$x|$y"); -$z_config->update; - -sub wreck_planet { - my $body = shift; - out('Wrecking planet '.$body->name); - $body->needs_surface_refresh(1); - foreach my $building (@{$body->building_cache}) { - if ($building->class eq 'Lacuna::DB::Result::Building::Permanent::BlackHoleGenerator') { - $building->class('Lacuna::DB::Result::Building::Permanent::Fissure'); - $building->update; - } - else { - $building->spend_efficiency(randint(1,25)); - $building->update; - } - } -} - - -sub convert_body { - my $body = shift; - out('Converting body '.$body->name); - my $type = $body->get_type; - my $class_prefix = 'Lacuna::DB::Result::Map::Body::'; - if ($type eq 'gas giant') { - $class_prefix .= 'Planet::GasGiant::'; - } - elsif ($type eq 'asteroid') { - $class_prefix .= 'Asteroid::'; - } - else { - $class_prefix .= 'Planet::'; - } - my $details = $zone_details{$type}; - $body->size(randint($details->{min_size}, $details->{max_size})); - $body->class($class_prefix.random_element($details->{types})); - $body->update; -} - -sub determine_zone_details { - out('determining zone details'); - # asteroids - my %asteroid; - $asteroid{min_size} = randint(1,6); - $asteroid{max_size} = $asteroid{min_size} + 6; - push @{$asteroid{types}}, element_rarity(\@asteroid_types, 1, 1); # rare - push @{$asteroid{types}}, element_rarity(\@asteroid_types, 2, 3); # uncommon - push @{$asteroid{types}}, element_rarity(\@asteroid_types, 3, 6); # common - - # habitals - my %habital; - $habital{min_size} = randint(30,50); - $habital{max_size} = $habital{min_size} + 20; - push @{$habital{types}}, element_rarity(\@habital_types, 1, 1); # rare - push @{$habital{types}}, element_rarity(\@habital_types, 2, 3); # uncommon - push @{$habital{types}}, element_rarity(\@habital_types, 4, 6); # common - - # gas giants - my %gas_giant; - $gas_giant{min_size} = randint(80,100); - $gas_giant{max_size} = $gas_giant{min_size} + 21; - push @{$gas_giant{types}}, element_rarity(\@gas_giant_types, 1, 1); # rare - push @{$gas_giant{types}}, element_rarity(\@gas_giant_types, 1, 3); # uncommon - push @{$gas_giant{types}}, element_rarity(\@gas_giant_types, 1, 6); # common - - %zone_details = ( - 'asteroid' => \%asteroid, - 'habital planet' => \%habital, - 'gas giant' => \%gas_giant, - ); -} - -sub element_rarity { - my ($list, $quantity, $rarity) = @_; - my @elements; - for (1..$quantity) { - my $element = random_element($list); - for (1..$rarity) { - push @elements, $element; - } - } - return @elements; -} - -my $finish = time; -out('Finished'); -out((($finish - $start)/60)." minutes have elapsed"); - - - - -############### -## SUBROUTINES -############### - - -sub out { - my $message = shift; - unless ($quiet) { - say format_date(DateTime->now), " ", $message; - } -} - - diff --git a/bin/util/revamp_map_message_1.pl b/bin/util/revamp_map_message_1.pl deleted file mode 100644 index b47671bc..00000000 --- a/bin/util/revamp_map_message_1.pl +++ /dev/null @@ -1,67 +0,0 @@ -use 5.010; -use strict; -use lib '/data/Lacuna-Server/lib'; -use Lacuna::DB; -use Lacuna; -use Lacuna::Util qw(randint format_date); -use Getopt::Long; -$|=1; -our $quiet; -GetOptions( - 'quiet' => \$quiet, -); - - -out('Started'); -my $start = time; - -out('Loading DB'); -our $db = Lacuna->db; -my $empires = $db->resultset('Lacuna::DB::Result::Empire'); -my $lec = $empires->find(1); - -my $message = q{Over the past three years the Expanse has seen an explosion of new races seeking assylum from whatever they left behind. We were glad to have the new trading partners. However, some of you may have inadvertantly destroyed us all. The Sābēn Demesne were nothing compared to the threat we face now. - -It has come to my attention that some of you have been experimenting with singularities through devices you call Black Hole Generators. These technologies are barely within your comprehension, yet you use them as freely as you peel a Beeldeban! These devices are dangerous. I'm sure you've experienced some of their side-effects, but what you do not understand can kill us all. - -A storm approaches. Those of you manipulating these singularities have built up a form of energy on the entire expanse. It's like the static electricity that's built up on your body when you walk across carpet in wool socks; only in this case, the energy envelops the entire expanse. When this energy discharges, it could rip a hole in the fabric of space and time itself! - -Stop using thse blasted devices now, while we try to sort out how to resolve this mess. - -Your Trading Partner, - -Tou Re Ell - -Lacuna Expanse Corp}; - -out('Sending Messages'); -while (my $empire = $empires->next) { - my $home = $empire->home_planet; - next unless defined $home; - out('Sending message to '.$empire->name); - $empire->send_message( - tag => 'Correspondence', - subject => 'A Storm Approaches', - from => $lec, - body => $message, - ); - -} - -my $finish = time; -out('Finished'); -out((($finish - $start)/60)." minutes have elapsed"); - - -############### -## SUBROUTINES -############### - -sub out { - my $message = shift; - unless ($quiet) { - say format_date(DateTime->now), " ", $message; - } -} - - diff --git a/bin/util/revamp_map_message_2.pl b/bin/util/revamp_map_message_2.pl deleted file mode 100644 index 7b48e319..00000000 --- a/bin/util/revamp_map_message_2.pl +++ /dev/null @@ -1,65 +0,0 @@ -use 5.010; -use strict; -use lib '/data/Lacuna-Server/lib'; -use Lacuna::DB; -use Lacuna; -use Lacuna::Util qw(randint format_date); -use Getopt::Long; -$|=1; -our $quiet; -GetOptions( - 'quiet' => \$quiet, -); - - -out('Started'); -my $start = time; - -out('Loading DB'); -our $db = Lacuna->db; -my $empires = $db->resultset('Lacuna::DB::Result::Empire'); -my $lec = $empires->find(1); - -my $message = q{You didn't heed our warning. The storm has been unleashed. All we can do is brace ourselves and hope that the Expanse doesn't tear itself apart as the storm washes over us. - -The use of these singularities has created a ribbon of energy that is passing over the entire Expanse. The discharge is so great that all ships and probes we've sent to investigate were instantly destroyed. Our sensors cannot see beyond the ribbon, so we are unable to see if the Expanse remains behind it in any form, or if it has been completely destroyed. - -We suggest you do what you can to fortify your empire. With any luck the ribbon will not ignite your atmosphere as it washes over your planet. Good luck. Hope to see you on the other side. - -Your Trading Partner, - -Tou Re Ell - -Lacuna Expanse Corp}; - -out('Sending Messages'); -while (my $empire = $empires->next) { - my $home = $empire->home_planet; - next unless defined $home; - out('Sending message to '.$empire->name); - $empire->send_message( - tag => 'Correspondence', - subject => 'A Ribbon of Energy', - from => $lec, - body => $message, - ); - -} - -my $finish = time; -out('Finished'); -out((($finish - $start)/60)." minutes have elapsed"); - - -############### -## SUBROUTINES -############### - -sub out { - my $message = shift; - unless ($quiet) { - say format_date(DateTime->now), " ", $message; - } -} - - diff --git a/bin/util/revamp_map_message_3.pl b/bin/util/revamp_map_message_3.pl deleted file mode 100644 index 4eca4142..00000000 --- a/bin/util/revamp_map_message_3.pl +++ /dev/null @@ -1,69 +0,0 @@ -use 5.010; -use strict; -use lib '/data/Lacuna-Server/lib'; -use Lacuna::DB; -use Lacuna; -use Lacuna::Util qw(randint format_date); -use Getopt::Long; -$|=1; -our $quiet; -GetOptions( - 'quiet' => \$quiet, -); - - -out('Started'); -my $start = time; - -out('Loading DB'); -our $db = Lacuna->db; -my $empires = $db->resultset('Lacuna::DB::Result::Empire'); -my $lec = $empires->find(1); - -my $message = q{Luckily we appear to have weathered the storm, but it appears that the Expanse is forever changed. - -Early sensor data indicates that the energy ribbon did not in-fact destroy the Expanse, but rather evolved it. Many bodies have changed their very composition. In many ways this is an entirely new Expanse. While I'm sure that adventure seekers will love the opportunities for exploration, but we stand reserved. - -Your immaturity as a species is showing. You rush to use the latest technologies without fully understanding the implications of that usage. Your decisions affect not only your empire, but the whole Expanse. You didn't destroy us this time, but we were pushed to the brink of annihilation. Please pursue a higher aptitude with the technologies you acquire before putting them to use in the future. - -Now that we know there is a future, we look forward to hearing your reports about what you find in this new Expanse. Our probes are showing some anomalous readings. They're indicating that there are entirely new planetary compositions in the Expanse. This seems unlikely, but perhaps you would be so kind to verify our readings. - -Good luck. And please be careful. - -Your Trading Partner, - -Tou Re Ell - -Lacuna Expanse Corp}; - -out('Sending Messages'); -while (my $empire = $empires->next) { - my $home = $empire->home_planet; - next unless defined $home; - out('Sending message to '.$empire->name); - $empire->send_message( - tag => 'Correspondence', - subject => 'Forever Changed', - from => $lec, - body => $message, - ); - -} - -my $finish = time; -out('Finished'); -out((($finish - $start)/60)." minutes have elapsed"); - - -############### -## SUBROUTINES -############### - -sub out { - my $message = shift; - unless ($quiet) { - say format_date(DateTime->now), " ", $message; - } -} - - diff --git a/docs/Buildings.pod b/docs/Buildings.pod index 7c37025e..8e4d1914 100644 --- a/docs/Buildings.pod +++ b/docs/Buildings.pod @@ -354,8 +354,6 @@ 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/Fissure.pod b/docs/Fissure.pod deleted file mode 100644 index 7e775eb8..00000000 --- a/docs/Fissure.pod +++ /dev/null @@ -1,7 +0,0 @@ -=head1 Fissure Methods - -Fissure 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/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index f5d19cf8..e8472c00 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -1118,7 +1118,6 @@ sub spend_efficiency { 'Lacuna::DB::Result::Building::Permanent::LapisForest' => 'Lacuna::DB::Result::Building::Permanent::LapisForest', 'Lacuna::DB::Result::Building::Permanent::AlgaePond' => 'Lacuna::DB::Result::Building::Permanent::AlgaePond', 'Lacuna::DB::Result::Building::Permanent::Ravine' => 'Lacuna::DB::Result::Building::Permanent::Ravine', - 'Lacuna::DB::Result::Building::Permanent::Fissure' => 'Lacuna::DB::Result::Building::Permanent::Fissure', 'Lacuna::DB::Result::Building::Permanent::PantheonOfHagness' => 'Lacuna::DB::Result::Building::Permanent::PantheonOfHagness', 'Lacuna::DB::Result::Building::SubspaceSupplyDepot' => 'Lacuna::DB::Result::Building::SubspaceSupplyDepot', 'Lacuna::DB::Result::Building::ThemePark' => 'Lacuna::DB::Result::Building::ThemePark', diff --git a/lib/Lacuna/DB/Result/Building/Permanent/Fissure.pm b/lib/Lacuna/DB/Result/Building/Permanent/Fissure.pm deleted file mode 100644 index 2018fd3c..00000000 --- a/lib/Lacuna/DB/Result/Building/Permanent/Fissure.pm +++ /dev/null @@ -1,83 +0,0 @@ -package Lacuna::DB::Result::Building::Permanent::Fissure; - -use Moose; -use utf8; -no warnings qw(uninitialized); -extends 'Lacuna::DB::Result::Building::Permanent'; - -use constant controller_class => 'Lacuna::RPC::Building::Fissure'; - -around can_build => sub { - my ($orig, $self, $body) = @_; - if ($body->get_plan(__PACKAGE__, 1)) { - return $orig->($self, $body); - } - confess [1013,"You can't build a Fissure. It is created by a violent release of energy."]; -}; - -around can_upgrade => sub { - my ($orig, $self) = @_; - if ($self->body->get_plan(__PACKAGE__, $self->level + 1)) { - return $orig->($self); - } - confess [1013,"You can't upgrade a Fissure. It is expanded by a violent release of energy."]; -}; - -use constant image => 'fissure'; - -sub image_level { - my ($self) = @_; - return $self->image.'1'; -} - -after finish_upgrade => sub { - my $self = shift; - $self->body->add_news(30, sprintf('Scientists are worried that %s may collapse in on itself.', $self->body->name)); -}; - -before 'can_demolish' => sub { - my $self = shift; - unless ($self->level == 1) { - confess [1013, 'You must fill in the fissure by spending resources to downgrade it before you can demolish it.']; - } -}; - -before 'can_downgrade' => sub { - my $self = shift; - if ($self->has_resources_to_fill_in_fissure) { - confess [1013, 'You need '.$self->cost_to_fill_in_fissure.' in ore to fill in the fissure.']; - } -}; - -before downgrade => sub { - my $self = shift; - my $body = $self->body; - my $cost = $self->cost_to_fill_in_fissure; - my $stored = $body->ore_stored; - if ($stored >= $cost) { - $body->spend_ore($cost); - } - else { - $cost -= $stored; - $body->spend_ore($stored); - } -}; - -sub cost_to_fill_in_fissure { - my $self = shift; - return $self->current_level_cost * 1350; -} - -sub has_resources_to_fill_in_fissure { - my $self = shift; - my $body = $self->body; - my $available = $body->ore_stored; - return ($self->cost_to_fill_in_fissure <= $available) ? 1 : 0; -} - -use constant name => 'Fissure'; -use constant time_to_build => 0; - - -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 3256d596..5fcd2ccb 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -271,7 +271,6 @@ use constant MEDALS => { SSLc => 'Built Space Station Lab (C)', SSLd => 'Built Space Station Lab (D)', MalcudField => 'Discovered a Malcud Field', - Fissure => 'Caused a Fissure', Ravine => 'Discovered a Ravine', AlgaePond => 'Discovered a Algae Pond', LapisForest => 'Discovered a Lapis Forest', diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index 6509d19a..839fd651 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -757,7 +757,7 @@ sub bhg_self_destruct { $body->needs_surface_refresh(1); $body->needs_recalc(1); $body->update; - $building->update({class=>'Lacuna::DB::Result::Building::Permanent::Fissure'}); + $building->update({class=>'Lacuna::DB::Result::Building::Permanent::Crater'}); $return->{message} = "Black Hole Generator Destroyed"; return $return; } diff --git a/lib/Lacuna/RPC/Building/Fissure.pm b/lib/Lacuna/RPC/Building/Fissure.pm deleted file mode 100644 index 1cfbc927..00000000 --- a/lib/Lacuna/RPC/Building/Fissure.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Lacuna::RPC::Building::Fissure; - -use Moose; -use utf8; -no warnings qw(uninitialized); -extends 'Lacuna::RPC::Building'; - -sub app_url { - return '/fissure'; -} - -sub model_class { - return 'Lacuna::DB::Result::Building::Permanent::Fissure'; -} - -no Moose; -__PACKAGE__->meta->make_immutable; - diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index f6ef019f..1009dfe3 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,7 +1,3 @@ -3.0866: - - Add: Fissure. - - Mod: BHG creates a Fissure instead of a Crater when it explodes. - 3.0865: - Mod: Removed option to disable display of incoming ships. (To see if it fixes some resource issues) - Mod: Attempt to make Counter Espionage tutorial message clearer since people don't read the entire email. diff --git a/var/www/public/resources.json b/var/www/public/resources.json index cf850e46..ec993ce8 100644 --- a/var/www/public/resources.json +++ b/var/www/public/resources.json @@ -39,7 +39,6 @@ "/crashedshipsite" : { "description" : "Harvest technology from a crashed ship to make your own ships better.", "wiki" : "http://community.lacunaexpanse.com/wiki/crashed-ship-site" }, "/citadelofknope" : { "description" : "Defends your planet from incoming hostile ships by absorbing the damage onto itself.", "wiki" : "http://community.lacunaexpanse.com/wiki/citadel-of-knope" }, "/ravine" : { "description" : "A natural place to store waste.", "wiki" : "http://community.lacunaexpanse.com/wiki/ravine" }, - "/fissure" : { "description" : "The first sign of a dying planet.", "wiki" : "http://community.lacunaexpanse.com/wiki/fissure" }, "/amalgusmeadow" : { "description" : "A wild meadow filled with wild amalgus beans.", "wiki" : "http://community.lacunaexpanse.com/wiki/amalgus-meadow" }, "/dentonbrambles" : { "description" : "A thorny patch of brambles, who's roots happen to be the delicious denton roots.", "wiki" : "http://community.lacunaexpanse.com/wiki/denton-brambles" }, "/malcudfield" : { "description" : "A natural source of food.", "wiki" : "http://community.lacunaexpanse.com/wiki/malcud-field" }, -- 2.51.2