From 195b812e0c407b975d5cf4508370146ca26048d4 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 20 Oct 2010 21:00:24 -0500 Subject: [PATCH] started adding saben --- bin/saben/create_empire.pl | 76 +++++++++++++++++++++++++++++++++++ bin/saben/warning1.pl | 73 ++++++++++++++++++++++++++++++++++ bin/saben/warning2.pl | 81 ++++++++++++++++++++++++++++++++++++++ bin/setup/init_lacuna.pl | 1 + 4 files changed, 231 insertions(+) create mode 100644 bin/saben/create_empire.pl create mode 100644 bin/saben/warning1.pl create mode 100644 bin/saben/warning2.pl diff --git a/bin/saben/create_empire.pl b/bin/saben/create_empire.pl new file mode 100644 index 00000000..40f7ad37 --- /dev/null +++ b/bin/saben/create_empire.pl @@ -0,0 +1,76 @@ +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; +use List::MoreUtils qw(uniq); +$|=1; +our $quiet; +GetOptions( + 'quiet' => \$quiet, +); + + + +out('Started'); +my $start = time; + +out('Loading DB'); +our $db = Lacuna->db; + +out('Creating empire...'); +my $empire = Lacuna->db->resultset('Lacuna::DB::Result::Empire')->new({ + id => -1, + name => 'Sābēn Demesne', + stage => 'founded', + date_created => DateTime->now, + status_message => 'Waging war!', + password => Lacuna::DB::Result::Empire->encrypt_password(rand(99999999)), + species_name => 'Sābēn', + species_description => 'This is our Demesne and you have violated it.', + min_orbit => 1, + max_orbit => 7, + manufacturing_affinity => 4, # cost of building new stuff + deception_affinity => 7, # spying ability + research_affinity => 1, # cost of upgrading + management_affinity => 7, # speed to build + farming_affinity => 1, # food + mining_affinity => 1, # minerals + science_affinity => 7, # energy, propultion, and other tech + environmental_affinity => 1, # waste and water + political_affinity => 1, # happiness + trade_affinity => 7, # speed of cargoships, and amount of cargo hauled + growth_affinity => 1, # price and speed of colony ships, and planetary command center start level +}); + +out('Find home planet...'); +my $bodies = $db->resultset('Lacuna::DB::Result::Map::Body'); +my $zone = $bodies->get_column('zone')->max; +my $home = $bodies->search({size => 35, zone => $zone },{rows=>1})->single; +$empire->insert; +$empire->found($home); + +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/saben/warning1.pl b/bin/saben/warning1.pl new file mode 100644 index 00000000..3c95d120 --- /dev/null +++ b/bin/saben/warning1.pl @@ -0,0 +1,73 @@ +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; +use List::MoreUtils qw(uniq); +$|=1; +our $quiet; +GetOptions( + 'quiet' => \$quiet, +); + + + +out('Started'); +my $start = time; + +out('Loading DB'); +our $db = Lacuna->db; +my $empires = Lacuna->db->resultset('Lacuna::DB::Result::Empire'); + +out('getting empires...'); +my $saben = $empires->find(-1); +my $lec = $empires->find(1); + +out('Sending warning...'); +my $message = q{I hope this message finds you well. I unfortunately have disturbing news. A threat we thought was long since vanquished has risen again. They call themselves Sābēn Demesne. Sābēn are an authoritarian people who believe that the Expanse is theirs. In fact "Sābēn Demesne" literally means "territory owned by Sābēn", and it is their name for the Expanse. The are singled minded in this belief, so negotiation is unfortunately not an option. + +Adding to our problems is their use of alien technology. Some say they have mastered the science of the Great Race, but we do not believe the Great Race ever existed. Great Race or not, they do have advanced technology, and we cannot underestimate their ability to employ it. + +I do not know when they will arrive in the center of the Expanse where you are now, but I have received word that they have already been building colonies in fringe space at the edge of the Expanse. + +I will send more information as I have it. Just know that war is coming. + +Your Trading Partner, + +Tou Re Ell + +Lacuna Expanse Corp}; +while (my $empire = $empires->next) { + $empire->send_message( + tag => 'Correspondence', + subject => 'War Is Coming', + 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/saben/warning2.pl b/bin/saben/warning2.pl new file mode 100644 index 00000000..e5eb3aa8 --- /dev/null +++ b/bin/saben/warning2.pl @@ -0,0 +1,81 @@ +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; +use List::MoreUtils qw(uniq); +$|=1; +our $quiet; +GetOptions( + 'quiet' => \$quiet, +); + + + +out('Started'); +my $start = time; + +out('Loading DB'); +our $db = Lacuna->db; +my $empires = Lacuna->db->resultset('Lacuna::DB::Result::Empire'); + +out('getting empires...'); +my $saben = $empires->find(-1); +my $lec = $empires->find(1); + + +out('Send Network 19 messages....'); +$saben->home->add_news(200, '$%^#%^#!%~!~!*::::::::........'); +sleep 1; +$saben->home->add_news(200, 'We are Sābēn. You have violated our Demesne. You have seven days to vacate or perish.'); +sleep 1; +$saben->home->add_news(200, '^#%$$^#!%~!~:::::::........'); +sleep 1; +$saben->home->add_news(200, 'We are sorry for that unscheduled interruption. We at Network 19 do not endorse the previous transmission.'); + +out('Sending warning...'); +my $message = q{I hoped to provide you with more warning, but I must tell you now that war is upon us. We were able to destroy one Sābēn foothold colony in zone 0|0, but our intelligence indicates that there is at least one more and we do not know its location or even which zone it is in. + +You have no doubt seen the messages that Sābēn have broadcast on Network 19. We aren't sure how they have penetrated our broadcast system, but if they are able to do that, who knows what else they have access to, including your systems? + +They will start by testing the strongest among us. When they have figured out our weaknesses, they will exploit them and attempt to destroy us. When we are gone they will either destroy or enslave the weak. Our only hope is to locate their foothold colonies, capture their spies, destroy their supply lines, and ultimately demoralize their people. If we can do that, they will retreat, at least for a while. + +Good Luck, + +Tou Re Ell + +Lacuna Expanse Corp}; +while (my $empire = $empires->next) { + $empire->send_message( + tag => 'Correspondence', + subject => 'War Is Upon Us', + 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/setup/init_lacuna.pl b/bin/setup/init_lacuna.pl index b94b15bf..41456733 100644 --- a/bin/setup/init_lacuna.pl +++ b/bin/setup/init_lacuna.pl @@ -226,6 +226,7 @@ sub create_lacunan_home_world { id => 1, name => 'Lacuna Expanse Corp', date_created => DateTime->now, + stage => 'founded', status_message => 'Will trade for Essentia.', password => Lacuna::DB::Result::Empire->encrypt_password(rand(99999999)), species_name => 'Lacunan', -- 2.51.2