Debian Codegraph @

data/storyline/act1/dialogs/Koan.lua

raw
1 ---------------------------------------------------------------------
2 -- This file is part of Freedroid
3 --
4 -- Freedroid is free software; you can redistribute it and/or modify
5 -- it under the terms of the GNU General Public License as published by
6 -- the Free Software Foundation; either version 2 of the License, or
7 -- (at your option) any later version.
8 --
9 -- Freedroid is distributed in the hope that it will be useful,
10 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- GNU General Public License for more details.
13 --
14 -- You should have received a copy of the GNU General Public License
15 -- along with Freedroid; see the file COPYING. If not, write to the
16 -- Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17 -- MA 02111-1307 USA
18 ----------------------------------------------------------------------
19 --[[WIKI
20 PERSONALITY = { "Contemplative", "Peaceful", "Hopeful" },
21 MARKERS = { NPCID1 = "Duncan", QUESTID1 = "Doing Duncan a favor", NPCID2 = "Tania" },
22 PURPOSE = "$$NAME$$ is the focus of the $$QUESTID1$$ quest",
23 BACKSTORY = "$$NAME$$ has turned a hidden bunker into an \'Oasis of Peace\' hidden from the ravaged world above.",
24 RELATIONSHIP = {
25 {
26 actor = "$$NPCID1$$",
27 text = "$$NAME$$ is the opposite of $$NPCID1$$. $$NPCID1$$ destroys life while $$NAME$$ creates life."
28 },
29 {
30 actor = "$$NPCID2$$",
31 text = "$$NAME$$ has an unknown relationship with $$NPCID2$$. She will be very angry if $$NAME$$ is killed."
32 },
33 }
34 WIKI]]--
35
36
37 local Npc = FDrpg.get_npc()
38 local Tux = FDrpg.get_tux()
39
40 return {
41 EveryTime = function()
42 if (Tania_position == "bunker") then --Tania is following you
43 tania_is_here = true
44 Tania:heal()
45 else
46 tania_is_here = false
47 end
48
49 if (not Koan_met) then
50 Koan_met = true
51 Npc:says(_"So you have come. I knew Duncan would not let me live for too long.")
52 Npc:says(_"Once I am gone this oasis of peace in the world will dry up and die. A shame.")
53 Npc:says(_"I hoped to turn the whole desert into a sanctuary. And now my dream will never come true.")
54 Npc:says(_"Do what you must.")
55 if Tux:has_quest("Doing Duncan a favor") then
56 show("node2")
57 else
58 if (not Tux:has_met("Duncan")) then
59 show("node4")
60 else
61 show("node5")
62 end
63 end
64 show("node3")
65 elseif (Koan_spared_via_dialog) then
66 Npc:says_random(_"It's a pleasure to meet you again.",
67 _"I am happy to see you've returned.")
68 if (tania_is_here) then
69 Npc:says(_"I see you have brought a friend along with you.")
70 end
71 elseif Tux:has_quest("Doing Duncan a favor") then
72 Npc:says(_"I see the troubles of the world in your eyes.")
73 show("node10", "node11")
74 hide("node20", "node21", "node99")
75 --elseif (met_koan_before_duncan) then
76 -- Npc:says_random(_"Come sit down my friend.",
77 -- _"Please take some time and relax here in the cool.")
78 -- if (tania_is_here) then
79 -- Npc:says(_"I see you've brought a friend along with you.")
80 -- end
81 end
82 end,
83
84 {
85 id = "node2",
86 text = _"With pleasure.",
87 code = function()
88 Npc:drop_dead()
89 Tux:update_quest("Doing Duncan a favor", _"I took revenge for Duncan by killing Koan.")
90 respawn_level(38) --this is the desert above the bunker
91 if (tania_is_here) then
92 Koan_murdered = true
93 start_chat("Tania")
94 end
95 end,
96 },
97 {
98 id = "node3",
99 text = _"No. I have not come here to kill you.",
100 code = function()
101 Npc:says(_"Thank you.")
102 Npc:says(_"Feel free to stay here. There is no danger.")
103 Npc:says(_"The water is safe to drink and the fruit from the tree is quite delicious. I have a few extra provisions here with me. Please take some.")
104 Tux:add_item("Strength Pill", 1)
105 Tux:add_item("Doc-in-a-can", 2)
106 Tux:add_item("Source Book of Repair equipment", 1)
107 Tux:add_item("Strength Capsule", 1)
108 if Tux:has_quest("Doing Duncan a favor") then
109 next("node12")
110 end
111 hide("node2", "node3") show("node5", "node20", "node99")
112 end,
113 },
114 {
115 --has not met Duncan yet
116 id = "node4",
117 text = _"Who are you? Who is Duncan?",
118 code = function()
119 Npc:set_name("Koan")
120 Npc:says(_"I am Koan.")
121 Npc:says(_"Duncan is one obsessed with destroying things, while I create.")
122 Npc:says(_"Therefore, he desires my destruction.")
123 hide("node3", "node4", "node5") show("node20", "node99")
124 end,
125 },
126 {
127 id = "node5",
128 text = _"Who are you?",
129 code = function()
130 Npc:set_name("Koan")
131 Npc:says(_"I am Koan.")
132 Npc:says(_"Beyond that I am a creator.")
133 Npc:says(_"I give life to things, even if they eventually will be destroyed.")
134 hide("node3", "node5") show("node20", "node99")
135 end,
136 },
137 {
138 id = "node10",
139 text = _"You shall die.",
140 code = function()
141 Npc:drop_dead()
142 Tux:update_quest("Doing Duncan a favor", _"I took revenge for Duncan by killing Koan.")
143 respawn_level(38) --this is the desert above the bunker
144 if (tania_is_here) then
145 Koan_murdered = true
146 start_chat("Tania")
147 end
148 end,
149 },
150 {
151 id = "node11",
152 text = _"Duncan sent me to kill you, but I came to make certain you were safe.",
153 code = function()
154 Npc:says(_"Thanks for checking up on me.")
155 hide("node10", "node11") show("node99") next("node12")
156 end,
157 },
158 {
159 id = "node12",
160 code = function()
161 Koan_spared_via_dialog = true
162 Tux:update_quest("Doing Duncan a favor", _"I met and talked to Koan, but didn't kill him.")
163 show("node13")
164 end,
165 },
166 {
167 id = "node13",
168 text = _"Why does Duncan want you dead?",
169 code = function()
170 Npc:says(_"Very simple. He likes destruction, and I am creation.")
171 Npc:says(_"There is nothing more to it.")
172 hide("node13")
173 end,
174 },
175 {
176 id = "node20",
177 text = _"What is this place? Why is there grass and water under the desert?",
178 code = function()
179 Npc:says(_"Ah, yes. That is my fault, I am afraid.")
180 Npc:says(_"Wherever I go, life follows me.")
181 Npc:says(_"I thought I could hide from Duncan in this old bunker.")
182 Npc:says(_"When I woke up the next day, things were as you see them now.")
183 hide("node20") show("node21")
184 end,
185 },
186 {
187 id = "node21",
188 text = _"This was a bunker?",
189 code = function()
190 Npc:says(_"Yes. The place has changed a bit, as you can see.")
191 Npc:says(_"I like the way it is right now. The water cools everything down and the plants give the air a very fresh smell.")
192 Npc:says(_"As soon as I leave, everything will die. I have seen that happen before.")
193 Npc:says(_"Because this place is just like a small bit of paradise, I decided to stay here.")
194 Npc:says(_"I do not want this wonderful bunker to become devoid of life again.")
195 hide("node21")
196 end,
197 },
198 {
199 id = "node99",
200 text = _"I will go now.",
201 code = function()
202 Npc:says_random(_"This place will always wait for you.",
203 _"This is a sanctuary from the desert above.")
204 Tux:heal()
205 hide("node2", "node3", "node4", "node5")
206 end_dialog()
207 end,
208 },
209 }