From b6a6a9e67ca94d4f852bb738cf607c1121e55cf4 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 19 Nov 2010 10:32:50 -0600 Subject: [PATCH] added mission command to tutorial --- lib/Lacuna/Tutorial.pm | 34 ++++++++++++++++++- var/messages/tutorial/mission_command.txt | 15 ++++++++ var/messages/tutorial/university.txt | 2 +- var/missions/dung-beeldeban.mission | 2 ++ var/missions/essentia-for-gold.mission | 2 ++ var/missions/fusion-for-the-masses.mission | 2 ++ var/missions/help-a-farmer-out.mission | 2 ++ var/missions/more-ore.mission | 2 ++ var/missions/need-a-probe.mission | 2 ++ var/missions/need-fuel-to-get-home.mission | 2 ++ var/missions/solve-your-waste-problem.mission | 2 ++ .../soylent-trade-opportunity.mission | 2 ++ var/missions/soylent-trade-opportunity.part2 | 2 ++ var/missions/soylent-trade-opportunity.part3 | 2 ++ var/missions/soylent-trade-opportunity.part4 | 2 ++ var/missions/university-for-essentia.mission | 2 ++ var/www/public/changes.txt | 4 +++ 17 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 var/messages/tutorial/mission_command.txt create mode 100644 var/missions/dung-beeldeban.mission create mode 100644 var/missions/essentia-for-gold.mission create mode 100644 var/missions/fusion-for-the-masses.mission create mode 100644 var/missions/help-a-farmer-out.mission create mode 100644 var/missions/more-ore.mission create mode 100644 var/missions/need-a-probe.mission create mode 100644 var/missions/need-fuel-to-get-home.mission create mode 100644 var/missions/solve-your-waste-problem.mission create mode 100644 var/missions/soylent-trade-opportunity.mission create mode 100644 var/missions/soylent-trade-opportunity.part2 create mode 100644 var/missions/soylent-trade-opportunity.part3 create mode 100644 var/missions/soylent-trade-opportunity.part4 create mode 100644 var/missions/university-for-essentia.mission diff --git a/lib/Lacuna/Tutorial.pm b/lib/Lacuna/Tutorial.pm index 99f3bce0..45e99d6b 100644 --- a/lib/Lacuna/Tutorial.pm +++ b/lib/Lacuna/Tutorial.pm @@ -330,6 +330,38 @@ sub university { my $home = $empire->home_planet; if ($finish) { my $building = $home->get_building_of_class('Lacuna::DB::Result::Building::University'); + if (defined $building && $building->level >= 1) { + $home->add_trona(1000); + $home->add_bread(1000); + $home->add_energy(1000); + $home->add_water(1000); + $home->update; + $home->add_plan('Lacuna::DB::Result::Building::MissionCommand', 1); + our $missions = Lacuna->db->resultset('Lacuna::DB::Result::Mission'); + foreach my $filename (qw(soylent-trade-opportunity.mission need-a-probe.mission dung-beeldeban.mission)) { + my $mission = $missions->new({ + zone => $home->zone, + mission_file_name => $filename, + }); + $mission->max_university_level($mission->params->get('max_university_level')); + $mission->insert; + } + $self->start('mission_command'); + return undef; + } + } + return { + params => [$empire->name], + filename => 'tutorial/university.txt', + }; +} + +sub mission_command { + my ($self, $finish) = @_; + my $empire = $self->empire; + my $home = $empire->home_planet; + if ($finish) { + my $building = $home->get_building_of_class('Lacuna::DB::Result::Building::MissionCommand'); if (defined $building && $building->level >= 1) { $home->add_trona(700); $home->add_bread(700); @@ -342,7 +374,7 @@ sub university { } return { params => [$empire->name], - filename => 'tutorial/university.txt', + filename => 'tutorial/mission_command.txt', }; } diff --git a/var/messages/tutorial/mission_command.txt b/var/messages/tutorial/mission_command.txt new file mode 100644 index 00000000..87198edc --- /dev/null +++ b/var/messages/tutorial/mission_command.txt @@ -0,0 +1,15 @@ +Mission Command +~~~ +I've just given you a plan for a Mission Command building. You should build it now. + +Mission Command is kind of a like a job board. People all around the expanse have need of certain tasks to be completed, or resources to be acquired. You can help them do that for a profit. Some missions are more interesting than others, and some missions are more profitable than others, but one thing is true: there is no shortage of missions. + +At some point you'll likely want to raise your resource production so you can upgrade Mission Command. The higher the level the more jobs are available to you. However, it's a bit too expensive for you to worry about upgrading it just yet. Let's just get it built for now and we can worry about missions later. + +Regards, + +Tou Re Ell +Lacuna Expanse Corp + +Task: Build the Mission Command plan. +Reward: Free resources. diff --git a/var/messages/tutorial/university.txt b/var/messages/tutorial/university.txt index 58bf43c2..be83d210 100644 --- a/var/messages/tutorial/university.txt +++ b/var/messages/tutorial/university.txt @@ -12,4 +12,4 @@ Tou Re Ell Lacuna Expanse Corp Task: Build a University. -Reward: Free resources. +Reward: Free resources and a new building plan. diff --git a/var/missions/dung-beeldeban.mission b/var/missions/dung-beeldeban.mission new file mode 100644 index 00000000..ace5a98c --- /dev/null +++ b/var/missions/dung-beeldeban.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Researcher needs waste for experiment.","network_19_completion":"%s helps researcher cross-breed dung beetle with beeldeban.","description":"I need your help, or really I need your waste and a small amount of malcud. I'm working on an experiment to cross-breed a dung beetle from Earth with the beeldeban beetle native to the Expanse. However, I need a fairly large amount of waste and malcud to complete my habitat for the new beetle. I have some other resources left over in my lab that I could trade.","max_university_level":"3","name":"Dung Beeldeban","mission_objective":{"resources":{"waste":500,"fungus":100}},"mission_reward":{"resources":{"energy":2000,"zircon":2000,"water":2000}}} \ No newline at end of file diff --git a/var/missions/essentia-for-gold.mission b/var/missions/essentia-for-gold.mission new file mode 100644 index 00000000..c24445ac --- /dev/null +++ b/var/missions/essentia-for-gold.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Mourner needs help to have a proper funeral for his mother.","network_19_completion":"%s made local woman's funeral a joyous event rather than a sad one.","description":"I need help. My mother recently died. She wanted more than anything to be buried with her gold jewelry. The only problem is how she died. She was getting mugged and had a heart attack. So the theif absconded with her jewelry. I'm willing to give you our family's life savings if you'll help me get the things I need to bury my mother.","max_university_level":"2","name":"Essentia for Gold","mission_objective":{"resources":{"waste":100,"gold":2}},"mission_reward":{"essentia":1}} \ No newline at end of file diff --git a/var/missions/fusion-for-the-masses.mission b/var/missions/fusion-for-the-masses.mission new file mode 100644 index 00000000..47dabbc0 --- /dev/null +++ b/var/missions/fusion-for-the-masses.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Developer looks to bring fusion to the masses.","network_19_completion":"Developer starts fusion pilot project with %s.","description":"By the looks of your civilization, you're still years away from having workable fusion reactors. What if I could give you this technology now, so you don't have to wait for it? Would that be of interest to you? All I'd ask are some small amounts of water and energy to prove that you're serious.","max_university_level":"6","name":"Fusion For The Masses","mission_objective":{"resources":{"energy":2000,"water":2000}},"mission_reward":{"plans":[{"extra_build_level":0,"level":1,"classname":"Lacuna::DB::Result::Building::Energy::Fusion"}]}} \ No newline at end of file diff --git a/var/missions/help-a-farmer-out.mission b/var/missions/help-a-farmer-out.mission new file mode 100644 index 00000000..9702cf5b --- /dev/null +++ b/var/missions/help-a-farmer-out.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Farmer will trade milk for fertilizer.","network_19_completion":"Farmer thanks %s for being a good trading partner.","description":"Hey you there. I need some help. My crops need some fertilzer or they just won't grow. I've got some two day old milk here that I can trade you, and make you a really good deal. Will you help a farmer out?","max_university_level":"2","name":"Help a Farmer Out","mission_objective":{"resources":{"sulfur":10}},"mission_reward":{"resources":{"milk":100}}} \ No newline at end of file diff --git a/var/missions/more-ore.mission b/var/missions/more-ore.mission new file mode 100644 index 00000000..b05c6898 --- /dev/null +++ b/var/missions/more-ore.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Researcher claims to have found the secret to getting more usable ore.","network_19_completion":"Researcher strikes a deal with %s to try out new ore processing rig.","description":"I have discovered a way to get more ore per ton out of the rock you process. If you're willing to provide a small down payment to prove your interest, I'll give you a plan for my new ore refinery.","max_university_level":"2","name":"More Ore","mission_objective":{"resources":{"algae":100,"energy":100,"water":100}},"mission_reward":{"plans":[{"extra_build_level":0,"level":1,"classname":"Lacuna::DB::Result::Building::Ore::Refinery"}]}} \ No newline at end of file diff --git a/var/missions/need-a-probe.mission b/var/missions/need-a-probe.mission new file mode 100644 index 00000000..f47118bf --- /dev/null +++ b/var/missions/need-a-probe.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Amateur astronomer seeks probe.","network_19_completion":"%s helped local astronomer realize his dreams.","description":"I have a hypothesis about the nature of the Expanse, but I need to send out a probe to find out if I'm correct. Only trouble is I've got no probe. Could you build me one? I can pay.","max_university_level":"5","name":"Need A Probe","mission_objective":{"ships":[{"type":"probe","hold_size":0,"speed":0,"stealth":0}]},"mission_reward":{"resources":{"energy":2000,"bread":1000,"milk":1000,"water":2000,"sulfur":2000}}} \ No newline at end of file diff --git a/var/missions/need-fuel-to-get-home.mission b/var/missions/need-fuel-to-get-home.mission new file mode 100644 index 00000000..027cff73 --- /dev/null +++ b/var/missions/need-fuel-to-get-home.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Dory captain stranded. Requests fuel.","network_19_completion":"%s saved stranded captain.","description":"I'm on my way back from a cargo run and wouldn't you know it, my fuel cells are empty. I need a little energy so I can get home. If you can help me out I've got load of pies here you could have.","max_university_level":"5","name":"Need Fuel To Get Home","mission_objective":{"resources":{"energy":1000}},"mission_reward":{"resources":{"pie":1500}}} \ No newline at end of file diff --git a/var/missions/solve-your-waste-problem.mission b/var/missions/solve-your-waste-problem.mission new file mode 100644 index 00000000..1f36b15d --- /dev/null +++ b/var/missions/solve-your-waste-problem.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Sluik Waste Management offers new waste treatment options to fledgling economies.","network_19_completion":"%s signs contract with Sluik Waste Management.","description":"I'm Dahl Sluik of Sluik Waste Management. I can see that you've got a little bit of a waste problem to deal with there. I can give you an exciting new technology that will allow you to convert your waste into valuable water. Does that sound like something you'd be interested in? I'm willing to give you this for a low price in exchange for your future waste management business contracts. Do we have a deal?","max_university_level":"6","name":"Solve Your Waste Problem","mission_objective":{"resources":{"algae":100,"energy":1000,"waste":500,"water":1000}},"mission_reward":{"plans":[{"extra_build_level":0,"level":1,"classname":"Lacuna::DB::Result::Building::Water::Reclamation"}]}} \ No newline at end of file diff --git a/var/missions/soylent-trade-opportunity.mission b/var/missions/soylent-trade-opportunity.mission new file mode 100644 index 00000000..1c59c07e --- /dev/null +++ b/var/missions/soylent-trade-opportunity.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Soylent food processing company looks for partner for food trial.","network_19_completion":"%s Ministry of Health declares world-wide sick day after citizens ate new soylent syrup.","description":"You've got waste, and you need food. I'm willing to turn your waste into food for you, using our newly patented process. Our sticky sweet soylent syrup is to die for. What do you say?","max_university_level":"2","name":"Soylent Trade Opportunity","mission_objective":{"resources":{"waste":500}},"mission_reward":{"resources":{"syrup":500}}} \ No newline at end of file diff --git a/var/missions/soylent-trade-opportunity.part2 b/var/missions/soylent-trade-opportunity.part2 new file mode 100644 index 00000000..aa1655c2 --- /dev/null +++ b/var/missions/soylent-trade-opportunity.part2 @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Soylent food processing company begins phase 2 trials.","network_19_completion":"%s people seem to be getting used to the idea of consuming their waste as food.","description":"You've got waste, and you need food. I'm willing to turn your waste into food for you, using our newly patented process. Our sticky sweet soylent syrup is to die for. What do you say?","max_university_level":"3","name":"Soylent Trade Opportunity","mission_objective":{"resources":{"waste":1500}},"mission_reward":{"resources":{"syrup":1500}}} \ No newline at end of file diff --git a/var/missions/soylent-trade-opportunity.part3 b/var/missions/soylent-trade-opportunity.part3 new file mode 100644 index 00000000..c0e68e38 --- /dev/null +++ b/var/missions/soylent-trade-opportunity.part3 @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Soylent food processing company starts stocking shelves with Soylent Syrup.","network_19_completion":"Soylent syrup is now the number one food in the %s colonies.","description":"You've got waste, and you need food. I'm willing to turn your waste into food for you, using our newly patented process. Our sticky sweet soylent syrup is to die for. What do you say?","max_university_level":"4","name":"Soylent Trade Opportunity","mission_objective":{"resources":{"waste":2500}},"mission_reward":{"resources":{"syrup":2500}}} \ No newline at end of file diff --git a/var/missions/soylent-trade-opportunity.part4 b/var/missions/soylent-trade-opportunity.part4 new file mode 100644 index 00000000..38f0b648 --- /dev/null +++ b/var/missions/soylent-trade-opportunity.part4 @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Soylent Syrup, it's what's for dinner!","network_19_completion":"Obesity and diabetes have become real problems in the %s colonies due to their consumption of Soylent Syrup.","description":"You've got waste, and you need food. I'm willing to turn your waste into food for you, using our newly patented process. Our sticky sweet soylent syrup is to die for. What do you say?","max_university_level":"5","name":"Soylent Trade Opportunity","mission_objective":{"resources":{"waste":3500}},"mission_reward":{"resources":{"syrup":3500}}} \ No newline at end of file diff --git a/var/missions/university-for-essentia.mission b/var/missions/university-for-essentia.mission new file mode 100644 index 00000000..70db5fe5 --- /dev/null +++ b/var/missions/university-for-essentia.mission @@ -0,0 +1,2 @@ +# config-file-type: JSON 1 +{"network_19_headline":"Builder seeks funding.","network_19_completion":"%s provides builder with the funding he sought.","description":"My name is Jalad and I own a construction outfit that can really help you out. If you can provide me with the essentia I need, then I'll upgrade your university from 3 to 5.","max_university_level":"3","name":"University for Essentia","mission_objective":{"essentia":1},"mission_reward":{"plans":[{"extra_build_level":0,"level":4,"classname":"Lacuna::DB::Result::Building::University"},{"extra_build_level":0,"level":5,"classname":"Lacuna::DB::Result::Building::University"}]}} \ No newline at end of file diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 48427ccb..e26550fd 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,7 @@ +2.3400 + - Fixed Archaeology Ministry to have a University prereq of 11 rather than 10. + - Added Mission Command to the tutorial. + 2.3300 - Started keeping a public change log. - Added missioncommand.skip_mission(). -- 2.51.2