Debian Codegraph @

dat/missions/zalek/neburesearch/neburesearch_04.lua

raw
1 --[[
2 <?xml version='1.0' encoding='utf8'?>
3 <mission name="Shielding Prototype Funding">
4 <flags>
5 <unique />
6 </flags>
7 <avail>
8 <priority>4</priority>
9 <done>The Substitute Speaker</done>
10 <chance>10</chance>
11 <location>Bar</location>
12 <faction>Za'lek</faction>
13 </avail>
14 <notes>
15 <campaign>Nebula Research</campaign>
16 </notes>
17 </mission>
18 --]]
19 --[[
20
21 Mission: Shielding Prototype Funding
22
23 Description: The player has to help acquiring funds for the shielding prototype. This is going to be hilariously complicated.
24
25 Difficulty: Easy to Medium
26
27 --]]
28
29 require "numstring.lua"
30 require "missions/zalek/common.lua"
31
32 bar_desc = _("She probably has a new poorly paid job for you. Maybe she won't notice you if you leave now.")
33 mtitle = _("Shielding Prototype Funding")
34 mdesc = _("Help Dr. Mensing to get funding for constructing a shielding prototype.")
35 misn_reward = _("%s")
36
37 proposal_text = _([["It appears we keep running into each other %s. You may be happy to hear that I finished my theoretical work on the nebula resistant shielding technique. Of course I can't provide you a shielding system; we scientists usually don't bother with engineering. However in this case, I'd actually like to build a prototype shielding device. The prospect of exploring the Sol system is far too tempting.
38 "This is were you come into play. I need a few capable engineers and some expensive hardware; my budget is too small though. This is why I have to acquire additional funding. Your task will be to chauffeur me around. Apparently it is sometimes required to show up in person. So annoying..."]])
39 accept_text = _([["Great! Our first destination is %s in the %s system."]])
40 decline_title = _("No science for today")
41 decline_text = _([["Too bad. Maybe you will change your mind."]])
42
43 setback_title = _("No luck")
44 first_planet_text = _([[After landing on %s Dr. Mensing tells you to wait until she returns. "Not more than a couple of periods." she said; in fact you had to wait for only two periods until she returned. She comes back looking defeated.
45 "This is the first time that one of my applications was rejected. That's weird, I got positive feedback at first. It makes no sense that my application was rejected at the last minute. I guess things like this happen. Let's just go to %s in the %s system next and try again."]])
46 second_planet_text = _([["Alright, I'm sure it will work out this time!", Dr. Mensing said on arriving on %s. This time you have to wait even longer for her to return. The result is the same as her first try.
47 "I don't get it. My presentation is flawless and my proposal is exciting. Why wouldn't they grant me additional funds? I tell you, something is wrong here! Hmm... Time to change tactics. I have to speak with Professor Voges himself but he is currently on %s in the %s system and just ignores us. I guess we have to go there to speak with him face-to-face."]])
48 ruadan_title = _("No clearance to land")
49 ruadan_text = _([[Apparently you are not allowed to land on %s and explaining the situation was futile. Dr. Mensing enters the cockpit asking why you aren't landing. "We're not allowed to? Let me try to talk with them."
50 After a heated discussion Dr. Mensing gives up. "Right, they won't allow anyone to land on %s. That's so frustrating. Let's land on %s instead."]])
51 third_planet_text = _([["Good news! I asked around and found a clue how to contact Professor Voges. He promised one of his colleagues to show up to his party. Something about his wife, like they have gotten married or she died or something. Anyway, I managed to get invited there as well. So let's go to %s in the %s system!"]])
52 party_title = _("Crashing a party")
53 party_arrival_text = _([[The two of you arrive at the party site. "Listen, this is probably your first party so let me briefly explain to you how it works. Your goal usually is to talk with all people, draw some attention, let them know you were attending the party. Efficiency is most important here. The earlier you're done with demonstrating your presence and making a good impression; the earlier you can leave and do something useful.
54 "You'll need an escape strategy to leave unnoticed though; It'd be rude when someone sees you leaving early. As you're a beginner I give you a tip: take the window of the bath room in the ground floor. No one will be able to see you from inside the house if you climb over the fence."]])
55 party_professor_text = _([[You wonder if anything of that was meant serious. Before you can ask, Dr. Mensing runs off engaging an older looking man, probably Professor Voges. She does not waste any time and brings up the issue straight on, visibly discomforting him. It's time to explore the party.
56 You expect a Za'lek party to be much different from a regular party. In fact the first two things you notice are the classical music and the absence of any alcoholic drinks. There is however a buffet, in particular there is a small fridge with ice cream. You can spot a fair amount of people eating ice cream. Is this the Za'lek equivalent of beer?
57 Before you know it you've engaged in a conversation with one of the scientists; He saw you enter with Dr. Mensing which motivates him to ask the question of the hour.. whether you and her are dating. In an attempt to clear his misgivings about the situation you tell him that she hired you. Hopefully he believes you..
58 You continue your tour, as you come close to one of the windows from the corner of your eye you see something fall outside, followed by a dull thump. Looking out of the window you see a figure dressed in a lab coat trying to stand up slowly. You're about to open the window and ask if he needs help, but he notices you and gestures to be silent as he hobbles off. Those Za'lek are indeed trying to escape the party.]])
59 party_end_text = _([["At least the ice cream is great!" you think as you take another bite. Suddenly someone grabs your arm. "We're done here. Bring me back to %s!" Dr. Mensing quietly tells you. For a moment you wonder what she is doing as she drags you towards the bathroom; finally you remember what she said about her 'escape strategy'. She mentioned that you are supposed to leave the building through the window of the bathroom.]])
60 home_title = _("Finally back home")
61 return_text = _([["That took long enough! I'm glad Professor Voges promised to take care of the funding. The problem was that my recent research is related to a secret project on Ruadan Prime and my funding was shut down - like some kind of conspiracy; can you believe it! Actually I'm not supposed to tell you anything as you could possibly get into a lot of trouble.. forget I said anything! I have much work to do!"
62 She gives you a credit chip worth %s and leaves.]])
63
64 warning_title = _("Caution!")
65 warning_text = _([[You receive a system wide broadcast. It appears to be a warning. "Caution! A drone squadron in the %s system went haywire! Proceed with care."
66 Why is this happening so frequently in Za'lek space? On a second glance you see on your radar that a drone squadron is flying right towards your ship.]])
67 second_warning_text = _([[The now familiar warning appears once again on your ship's screen. "Caution! A drone squadron in the %s system went haywire! Proceed with care."
68 Just how often is this going to happen?]])
69
70 osd_msg = {}
71 osd_title = _("Shielding Prototype Funding")
72 osd_fly_to = _("Land on %s in the %s system.")
73 osd_return = _("Return to %s in the %s system.")
74
75 log_text = _([[You helped Dr. Mensing to acquire funding for a shielding prototype that will enable to explore the Sol nebula.]])
76
77 function create()
78 -- mission variables
79 credits = 500000 -- 500K
80 homeworld, homeworld_sys = planet.get("Jorla")
81 dest_planet, dest_sys = planet.get("Jurai")
82
83 -- Spaceport bar stuff
84 misn.setNPC(_("Dr. Mensing"), "zalek/unique/mensing")
85 misn.setDesc(bar_desc)
86 end
87
88 function accept()
89 if not tk.yesno("", proposal_text:format(player:name())) then
90 tk.msg(decline_title, decline_text)
91 misn.finish()
92 end
93 tk.msg("", accept_text:format(dest_planet:name(), dest_sys:name()))
94 stage = 0
95
96 -- Set up mission information
97 misn.setTitle(mtitle)
98 misn.setReward(misn_reward:format(creditstring(credits)))
99 misn.setDesc(mdesc:format(dest_planet:name(), dest_sys:name()))
100 misn_marker = misn.markerAdd(dest_sys, "low")
101
102 misn.accept()
103 osd_msg[1] = osd_fly_to:format(dest_planet:name(), dest_sys:name())
104 osd_msg[2] = osd_return:format(homeworld:name(), homeworld_sys:name())
105 misn.osdCreate(osd_title, osd_msg)
106
107 hook.land("land")
108 hook.jumpin("jumpin")
109 hook.takeoff("takeoff")
110 end
111
112 function land()
113 landed = planet.cur()
114 if landed == dest_planet then
115 if stage == 0 then
116 local planet_name = dest_planet:name()
117 stage = 1
118 dest_planet, dest_sys = planet.get("Neo Pomerania")
119 tk.msg(setback_title, first_planet_text:format(planet_name, dest_planet:name(), dest_sys:name()))
120 misn.markerMove(misn_marker, dest_sys)
121 osd_msg[1] = osd_fly_to:format(dest_planet:name(), dest_sys:name())
122 osd_msg[2] = osd_return:format(homeworld:name(), homeworld_sys:name())
123 misn.osdCreate(osd_title, osd_msg)
124 elseif stage == 2 then
125 local planet_name = dest_planet:name()
126 stage = 3
127 dest_planet, dest_sys = planet.get("Ruadan Prime")
128 tk.msg(setback_title, second_planet_text:format(planet_name, dest_planet:name(), dest_sys:name()))
129 misn.markerMove(misn_marker, dest_sys)
130 osd_msg[1] = osd_fly_to:format(dest_planet:name(), dest_sys:name())
131 osd_msg[2] = osd_return:format(homeworld:name(), homeworld_sys:name())
132 misn.osdCreate(osd_title, osd_msg)
133 elseif stage == 4 then
134 stage = 5
135 dest_planet, dest_sys = planet.get("Excelcior")
136 tk.msg("", third_planet_text:format(dest_planet:name(), dest_sys:name()))
137 misn.markerMove(misn_marker, dest_sys)
138 osd_msg[1] = osd_fly_to:format(dest_planet:name(), dest_sys:name())
139 osd_msg[2] = osd_return:format(homeworld:name(), homeworld_sys:name())
140 misn.osdCreate(osd_title, osd_msg)
141 elseif stage == 5 or stage == 6 then
142 stage = 7
143 dest_planet = homeworld
144 dest_sys = homeworld_sys
145 tk.msg(party_title, party_arrival_text)
146 tk.msg(party_title, party_professor_text)
147 tk.msg(party_title, party_end_text:format(dest_planet:name()))
148 misn.markerMove(misn_marker, dest_sys)
149 misn.osdActive(2)
150 elseif stage == 7 then
151 tk.msg(home_title, return_text:format(creditstring(credits)))
152 player.pay(credits)
153 misn.markerRm(misn_marker)
154 zlk_addNebuResearchLog(log_text)
155 misn.finish(true)
156 end
157 end
158 end
159
160 function jumpin()
161 if stage == 1 and system.cur() == dest_sys then
162 local scom = {}
163 stage = 2
164 scom[1] = pilot.addRaw("Za'lek Light Drone", "mercenary", dest_planet, "Mercenary")
165 scom[2] = pilot.addRaw("Za'lek Light Drone", "mercenary", dest_planet, "Mercenary")
166 scom[3] = pilot.addRaw("Za'lek Heavy Drone", "mercenary", dest_planet, "Mercenary")
167 for i=1,#scom do
168 scom[i]:setHostile(false)
169 scom[i]:control()
170 scom[i]:attack(player.pilot())
171 end
172 hook.timer(10000, "warningMessage")
173 elseif stage == 3 and system.cur() == dest_sys then
174 hook.timer(60000, "cannotLand")
175 end
176 end
177
178 function takeoff()
179 if stage == 5 then
180 stage = 6
181 hook.timer(2000, "startAmbush")
182 hook.timer(12000, "secondWarningMessage")
183 end
184 end
185
186 function warningMessage()
187 tk.msg(warning_title, warning_text:format(system.cur():name()))
188 end
189
190 function secondWarningMessage()
191 tk.msg(warning_title, second_warning_text:format(system.cur():name()))
192 end
193
194 function startAmbush()
195 local scom = {}
196 local origins = {}
197 origins[1] = system.get("Vauban")
198 origins[2] = system.get("Woreck")
199 origins[3] = system.get("Damien")
200 for i=1,#origins do
201 scom[2*i-1] = pilot.addRaw("Za'lek Light Drone", "mercenary", origins[i], "Mercenary")
202 scom[2*i] = pilot.addRaw("Za'lek Heavy Drone", "mercenary", origins[i], "Mercenary")
203 end
204 for i=1,#scom do
205 scom[i]:setHostile(false)
206 scom[i]:control()
207 scom[i]:attack(player.pilot())
208 end
209 end
210
211 function cannotLand()
212 local planet_name = dest_planet:name()
213 stage = 4
214 dest_planet, dest_sys = planet.get("Ruadan Station")
215 tk.msg(ruadan_title, ruadan_text:format(planet_name, planet_name, dest_planet:name()))
216 osd_msg[1] = osd_fly_to:format(dest_planet:name(), dest_sys:name())
217 osd_msg[2] = osd_return:format(homeworld:name(), homeworld_sys:name())
218 misn.osdCreate(osd_title, osd_msg)
219 end