| 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 = { "Isolated" }, |
| 21 |
PURPOSE = "$$NAME$$ challenges Tux with a puzzle" |
| 22 |
WIKI]]-- |
| 23 |
|
| 24 |
local Npc = FDrpg.get_npc() |
| 25 |
local Tux = FDrpg.get_tux() |
| 26 |
|
| 27 |
return { |
| 28 |
FirstTime = function() |
| 29 |
show("node0") |
| 30 |
JohnPuzzlefalse = 0 |
| 31 |
JohnPuzzlefalseA = 0 |
| 32 |
JohnPuzzlefalseB = 0 |
| 33 |
JohnPuzzlefalseC = 0 |
| 34 |
end, |
| 35 |
|
| 36 |
EveryTime = function() |
| 37 |
John_puzzle_score = JohnPuzzlefalseA + JohnPuzzlefalseB + JohnPuzzlefalseC |
| 38 |
|
| 39 |
if (John_dislike) then |
| 40 |
--; TRANSLATORS: I am sorry |
| 41 |
Tux:says(_"I am s-") |
| 42 |
Npc:says(_"Go away please.") |
| 43 |
end_dialog() |
| 44 |
end |
| 45 |
|
| 46 |
if (John_puzzle_started) then |
| 47 |
|
| 48 |
-- if Tux ran into false teleporter of the storage room |
| 49 |
if (John_lvl28to28_teleported) and |
| 50 |
(not John_lvl28to28_hide) then |
| 51 |
Tux:says(_"What was that?!") |
| 52 |
Npc:says(_"See..?") |
| 53 |
Npc:says(_"It's not as easy as you thought.") |
| 54 |
Npc:says(_"Take a closer look at the storage room again...") |
| 55 |
Tux:says(_"Okay.") |
| 56 |
John_lvl28to28_hide = true |
| 57 |
end |
| 58 |
|
| 59 |
-- Puzzle is neither solved nor locked: |
| 60 |
if (not John_puzzle_locked) or |
| 61 |
(not John_puzzle_solved) then |
| 62 |
|
| 63 |
-- Tux walked through the false teleporter one time |
| 64 |
if (not John_problems_1) then |
| 65 |
if (JohnPuzzlefalseA == 1) or |
| 66 |
(JohnPuzzlefalseB == 1) or |
| 67 |
(JohnPuzzlefalseC == 1) then |
| 68 |
Npc:says(_"Looks like you had some problems?") |
| 69 |
Tux:says(_"Yes...") |
| 70 |
Npc:says(_"Ok, I'll give you another chance.") |
| 71 |
Npc:says(_"But it will be your last chance, so take care...") |
| 72 |
Tux:says(_"Thanks.") |
| 73 |
John_problems_1 = true |
| 74 |
end |
| 75 |
end |
| 76 |
|
| 77 |
--Tux walked through the same teleporter twice (wtf?!) |
| 78 |
|
| 79 |
if (JohnPuzzlefalseA == 2) or |
| 80 |
(JohnPuzzlefalseB == 2) or |
| 81 |
(JohnPuzzlefalseC == 2) then |
| 82 |
Npc:says(_"Dude!") |
| 83 |
Npc:says(_"You made the same mistake twice.") |
| 84 |
Npc:says(_"You walked through the same teleporter twice!") |
| 85 |
Npc:says(_"What's wrong with your mind?") |
| 86 |
Tux:says(_"I-") |
| 87 |
Npc:says(_"How is that ever going to work?") |
| 88 |
Npc:says(_"I locked the puzzle.") |
| 89 |
Npc:says(_"It doesn't seem like you'd ever be able to solve it.") |
| 90 |
John_puzzle_locked = true |
| 91 |
end |
| 92 |
|
| 93 |
if (not John_puzzle_locked) then |
| 94 |
-- Tux walked through a false teleporter second time |
| 95 |
if (John_puzzle_score >= 2) then |
| 96 |
Npc:says(_"Sorry, seems like that puzzle was too hard for you.") |
| 97 |
Tux:says(_"But I-") |
| 98 |
Npc:says(_"It is locked now.") |
| 99 |
Tux:says(_"I was very close to the solution.") |
| 100 |
Npc:says(_"Well, why did you still fail if you were so close?") |
| 101 |
Tux:says(_"Hmpf..") |
| 102 |
John_puzzle_locked = true |
| 103 |
end |
| 104 |
end |
| 105 |
|
| 106 |
end -- of 'if (not John_puzzle_locked) or |
| 107 |
-- (not John_puzzle_solved) then' |
| 108 |
|
| 109 |
-- if Tux solved the puzzle, went into the correct teleporter |
| 110 |
if (not John_puzzle_locked) and |
| 111 |
(John_puzzle_solved) then |
| 112 |
if (John_lvl28to28_teleported) or |
| 113 |
(John_puzzle_score > 0 ) then |
| 114 |
Npc:says(_"Congratulations, you solved my little puzzle.") |
| 115 |
Npc:says(_"I give you this as a small reward.") |
| 116 |
Tux:add_item("Dexterity Pill", 1) |
| 117 |
else |
| 118 |
-- Tux solved the puzzle without retrying! |
| 119 |
Npc:says(_"Wow... you solved it, and on your first time, too.") |
| 120 |
Npc:says(_"That's pretty good.") |
| 121 |
Npc:says(_"Here, take this as reward.") |
| 122 |
Tux:says(_"Oh, thank you.") |
| 123 |
Tux:add_item("Dexterity Pill", 1) |
| 124 |
Tux:add_item("Strength Pill", 1) |
| 125 |
end |
| 126 |
John_puzzle_locked = true |
| 127 |
Npc:set_destination("JohnFreeLabel") |
| 128 |
end |
| 129 |
|
| 130 |
end -- of 'if (John_puzzle_started) then' |
| 131 |
|
| 132 |
Npc:set_rush_tux(false) |
| 133 |
|
| 134 |
show("node99") |
| 135 |
end, |
| 136 |
|
| 137 |
{ |
| 138 |
id = "node0", |
| 139 |
text = _"Hello.", |
| 140 |
code = function() |
| 141 |
Npc:says(_"Hello.") |
| 142 |
Npc:says(_"Err... How did you get in here?!") |
| 143 |
Tux:says(_"I just walked through the door.") |
| 144 |
Npc:says(_"And your name?") |
| 145 |
--; TRANSLATORS: %s = Tux:get_player_name() |
| 146 |
Tux:says(_"I'm %s.", Tux:get_player_name()) |
| 147 |
Npc:says(_"And you were not slaughtered by the bots outside?") |
| 148 |
Tux:says(_"Apparently, I am still alive.") |
| 149 |
Tux:says(_"Does that answer your question?") |
| 150 |
Npc:says(_"It does... smart aleck.") |
| 151 |
hide("node0") show("node1") |
| 152 |
end, |
| 153 |
}, |
| 154 |
{ |
| 155 |
id = "node1", |
| 156 |
text = _"What do you do here?", |
| 157 |
code = function() |
| 158 |
Npc:says(_"I'm living here.") |
| 159 |
Npc:says(_"What did you expect?") |
| 160 |
Tux:says(_"Okay, that question was a little stupid.") |
| 161 |
hide("node1") show("node2") |
| 162 |
end, |
| 163 |
}, |
| 164 |
{ |
| 165 |
id = "node2", |
| 166 |
text = _"Are there any other people around here?", |
| 167 |
code = function() |
| 168 |
Npc:says(_"Not that I know.") |
| 169 |
Npc:says(_"Only you and me.") |
| 170 |
Tux:says(_"Okay, that question was also a little stupid.") |
| 171 |
hide("node2") show("node3") |
| 172 |
end, |
| 173 |
}, |
| 174 |
{ |
| 175 |
id = "node3", |
| 176 |
text = _"Isn't it a little boring in here, isolated from the outer world?", |
| 177 |
code = function() |
| 178 |
Npc:says(_"I'm fine.") |
| 179 |
Npc:says(_"When I'm bored, I try to make up some puzzles...") |
| 180 |
hide("node3") show("node4", "node5") |
| 181 |
end, |
| 182 |
}, |
| 183 |
{ |
| 184 |
id = "node4", |
| 185 |
text = _"'Puzzles'?", |
| 186 |
code = function() |
| 187 |
Npc:says(_"Yeah, puzzles.") |
| 188 |
Npc:says(_"Do you want to try one?") |
| 189 |
hide("node4", "node5") show("node10", "node11") |
| 190 |
end, |
| 191 |
}, |
| 192 |
{ |
| 193 |
id = "node5", |
| 194 |
text = _"Sounds interesting.", |
| 195 |
code = function() |
| 196 |
Tux:says(_"Can you tell me more about it?") |
| 197 |
Npc:says(_"No.") |
| 198 |
Npc:says(_"But you can experience it for yourself.") |
| 199 |
Npc:says(_"Interested?") |
| 200 |
hide("node4", "node5") show("node10", "node11") |
| 201 |
end, |
| 202 |
}, |
| 203 |
{ |
| 204 |
id = "node10", |
| 205 |
text = _"Yeah, sure!", |
| 206 |
code = function() |
| 207 |
Npc:says(_"Ok, so the entrance is in my storage room.") |
| 208 |
Npc:says(_"Shouldn't be too difficult to find.") |
| 209 |
Tux:says(_"Ok, let me take a look.") |
| 210 |
Npc:says(_"Wait, wait. I'll give you a hint:") |
| 211 |
Npc:says(_"'Looking from above hostiles may appear as salvation.'") |
| 212 |
Tux:says(_"Uh, ok, thanks.") |
| 213 |
John_puzzle_started = true |
| 214 |
hide("node10", "node11") |
| 215 |
end_dialog() |
| 216 |
end, |
| 217 |
}, |
| 218 |
{ |
| 219 |
id = "node11", |
| 220 |
text = _"Hmm... I don't trust you.", |
| 221 |
code = function() |
| 222 |
Tux:says(_"I think, it's a trap!") |
| 223 |
Npc:says(_"Well, you can leave at any time.") |
| 224 |
Npc:says(_"I wish you would!") |
| 225 |
John_dislike = true |
| 226 |
hide("node10", "node11") |
| 227 |
end_dialog() |
| 228 |
end, |
| 229 |
}, |
| 230 |
{ |
| 231 |
id = "node99", |
| 232 |
text = _"See you.", |
| 233 |
code = function() |
| 234 |
if (John_dislike) then |
| 235 |
Npc:says(_"I don't think so...") |
| 236 |
else |
| 237 |
Npc:says(_"See you later.") |
| 238 |
end |
| 239 |
end_dialog() |
| 240 |
end, |
| 241 |
}, |
| 242 |
} |