Debian Codegraph @

dat/missions/neutral/foodbiz/delivercake.lua

raw
1 --[[
2 <?xml version='1.0' encoding='utf8'?>
3 <mission name="Deliver Cake">
4 <flags>
5 <unique />
6 </flags>
7 <avail>
8 <priority>4</priority>
9 <chance>50</chance>
10 <done>Deliver Love</done>
11 <location>Bar</location>
12 <planet>Zhiru</planet>
13 </avail>
14 </mission>
15 --]]
16 --[[
17 Mission Name: Deliver Cake
18 Author: iwaschosen
19
20 Plot: on Zhiru you meet the same girl who received the love letters,her name is Paddy. Asks if you'd be willing to run another delivery and work with Michal on food biz. she says the man is an entrepreneur, and is trying to build a Food business
21 on Zeo where he will sell her baked goodies etc. asks if you can take recipes and plans to him on Zeo. Fills you cargo hold with cake which you don’t like. You can sell cake or bring to Michal who will pay a lot of $ for the cake, player doesn’t know that he will get payed for cake he brings.
22 --]]
23
24 require "numstring.lua"
25 require "missions/neutral/common.lua"
26
27
28 -- Dialogue
29 title = _("A Tasty Job")
30 npc_name = _("Familiar Face")
31 bar_desc = _("A familiar looking young woman is looking at you")
32
33 firstcontact = _([[The woman smiles. "Aren't you the pilot that delivered those sweet love letters to me? I think you are! My name is Paddy, sorry I didn't introduce myself before. I was caught up in the moment; Michal's letters are always very exciting." She blushes. "Anyway, Michal is trying to start a restaurant on %s. Would you be interested in giving him a hand?"]])
34
35 toobad = _([["Oh, that's too bad. I thought it was such a good idea, too...."]])
36
37 objectives = _([["Great!" Paddy says with a smile. She hands you what appear to be recipes. "I just need you to deliver these recipes to him. Oh, and some of my homemade cake! I've packed that cake into your ship. Feel free to give it a taste! It's delicious! Anyway, Michal will pay you %s when you get there. Thank you so much!"
38 When you arrive at your ship, you find your cargo hold packed to the brim with cake. You decide to try some, but the second it enters your mouth, you can't help but to spit it out in disgust. This is easily the most disgusting cake you've ever tasted. Well, as long as you get paid....]])
39
40 objectives_nocake = _([["Great!" Paddy says with a smile. She hands you what appear to be recipes. "I just need you to deliver these recipes to him. I was hoping to deliver some cake to him too, but it seems your ship doesn't have enough space for it, so that's unfortunate. In any case, Michal will pay you %s when you arrive. Thank you so much!"]])
41
42 -- Mission Computer text
43 misn_desc = _([[Deliver the recipes to Michal on %s in the %s system.]])
44
45 -- Mission Ending
46 finish = _([[As Michal takes the recipes and cake off your hands, you can't help but wonder how quickly his business will fail with food as bad as the cake you tried. When he remarks how delicious he apparently thinks the cake is, that confirms in your mind that he doesn't have a clue what he's doing. You bite your tongue, however, wishing him good luck as you take your pay.]])
47
48 finish_nocake = _([[Michal takes the recipes from you gleefully and tells you how unfortunate it is that you weren't able to taste Paddy's cake, which he says is delicious. You shrug it off and collect your pay.]])
49
50 osd_desc = {}
51 osd_desc[1] = _("Fly to %s in the %s system.")
52 osd_desc["__save"] = true
53
54 log_text = _([[You delivered a whole lot of the most disgusting cake you've ever tasted in your life as well as recipes for making said cake to Michal, the man who had you deliver a literal tonne of love letters before. Supposedly this is for an attempt to start a restaurant, but with food as disgusting as that cake, you're sure the business will fail.]])
55 log_text_nocake = _([[You delivered recipes for making some kind of cake to Michal, the man who had you deliver a literal tonne of love letters before.]])
56
57 cakes = "Food"
58
59
60 function create () --No system shall be claimed by mission
61 startworld, startworld_sys = planet.cur()
62 targetworld, targetworld_sys = planet.get( "Zeo" )
63
64 reward = 10000
65
66 misn.setNPC( npc_name, "neutral/unique/paddy" )
67 misn.setDesc( bar_desc )
68 end
69
70 function accept()
71 if not tk.yesno( title, firstcontact:format( targetworld:name() ) ) then
72 tk.msg( title, toobad )
73 misn.finish()
74 end
75
76 misn.accept()
77
78 amount = player.pilot():cargoFree()
79 if amount > 0 then
80 misn.cargoAdd( cakes, amount )
81 reward = reward + ( 1000 * amount )
82 tk.msg( title, objectives:format( creditstring( reward ) ) )
83 else
84 tk.msg( title, objectives_nocake:format( creditstring( reward ) ) )
85 end
86
87 -- set up mission computer
88 misn.setTitle( title )
89 misn.setReward( creditstring( reward ) )
90 misn.setDesc( misn_desc:format( targetworld:name(), targetworld_sys:name() ) )
91
92 osd_desc[1] = osd_desc[1]:format( targetworld:name(), targetworld_sys:name() )
93 misn.osdCreate( title, osd_desc )
94 misn.markerAdd( targetworld_sys, "low" )
95
96 --set up hooks
97 landhook = hook.land( "land" )
98 end
99
100 function land()
101 if planet.cur() == targetworld then
102 if amount > 0 then
103 tk.msg( "", finish )
104 addMiscLog( log_text )
105 else
106 tk.msg( "", finish_nocake )
107 addMiscLog( log_text_nocake )
108 end
109
110 player.pay( reward )
111 misn.finish(true)
112 end
113 end