-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharturo.lisp
380 lines (328 loc) · 11.4 KB
/
arturo.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
(in-package :cypress)
;;; Arturo Pentaquin
(defthing (arturo monk)
:met-player nil
:next-target nil
:has-letter nil
:discussed-woods nil
:description "Arturo")
(defparameter *arturo-walk*
'(:repeat t
:scale 980
:frames (("arturo-walk-1.png" 4)
("arturo-walk-2.png" 4)
("arturo-walk-3.png" 4)
("arturo-walk-4.png" 4))))
(defmethod walking-animation ((self arturo))
*arturo-walk*)
(defparameter *arturo-stand*
'(:scale 980
:frames (("arturo-stand-1.png" 19)
("arturo-stand-2.png" 16)
("arturo-stand-3.png" 24))))
(defmethod standing-animation ((self arturo))
*arturo-stand*)
(defmethod choose-target ((self arturo))
(setf (field-value :next-target self)
(let ((targets (find-instances (current-scene) 'silverwood)))
(when targets (random-choose targets)))))
(defmethod return-home ((self arturo))
(multiple-value-bind (x y) (below (find-pentaquin-house))
(walk-to self x y)))
(defmethod run ((self arturo))
(with-fields (next-target met-player gump waypoints) self
(call-next-method)
(unless gump (choose-target self))
(let ((distance (distance-to-cursor self)))
(unless (field-value :discussed-woods self)
(cond
((or (> distance 500)
(not (field-value :locked (find-pentaquin-house))))
(when (and next-target (null waypoints))
(percent-of-time 4 (walk-to-thing self next-target))))
((and (< distance 220) (> distance 200))
(show-hint "Double-click Arturo to talk.")
(walk-to-thing self (geoffrey)))
((or gump (<= distance 270))
(setf waypoints nil))
((search-inventory (geoffrey) 'alonso-letter)
(percent-of-time 4 (walk-to-thing self (geoffrey)))))))))
(defmethod activate ((self arturo))
(play-talk-sound self)
(with-fields (met-player has-letter) self
(if (not met-player)
(progn (setf met-player t)
(set-objective "Ask Arturo about Dr. Quine.")
(discuss self :hello))
(cond
((and (field-value :discussed-woods self)
(field-value :locked (find-pentaquin-house)))
(discuss self :house))
((and (not (field-value :discussed-woods self))
(field-value :locked (find-pentaquin-house)))
(discuss self :hello))
((search-inventory (geoffrey) 'alonso-letter)
(discuss self :welcome-back))
(has-letter (discuss self :southern-cave))
(t (discuss self :farewell))))))
(define-topic hello arturo
"Well, you do look rather unusual!
Those are most extraordinary robes. Oh,
but I'm being so rude! Greetings and
salutations, traveler. I am Arturo
Pentaquin, retired Lieutenant Commander
of the Green Paladins. And I can see
you've already met my grandson! So,
Lucius, why don't you introduce me to
your friend?"
:traveler)
(define-topic traveler arturo
"Oh Lord, this is absolutely incredible.
I never thought I would actually see a
Time Traveler. Can it really be true?
They say you can live a hundred thousand
years without one passing through your
life."
:time-travel)
(define-topic time-travel arturo
"It is recorded in the Histories that
certain people who vanished in one time
could reappear many years later, without
the traveler experiencing the time in
between. The magicks behind such events
are unknown to me, but I can see from
the design of your robes that you have
come to us from a distant year. Come to
think of it, for all my years of travel,
your speech is of a lilt I cannot quite
recognize. I sense you are telling the
Truth."
:quine :garden :town)
(define-topic quine arturo
"A second traveler, in one Age? I can
hardly believe it. But, the name doesn't
sound familiar at all. Perhaps he
stepped into a different year? I wish I
could help more."
:garden :town)
(define-topic garden arturo
"I used one of the ancient walls to
string up my silverwood garden.
Silverwood arrows are the best way to
take down a wolf. Even Dire Wolves can be
felled by a single arrow, if your aim is
true." :wolves :town :walls)
(define-topic walls arturo
"You'll find archaic stone walls and
other stone objects throughout the Vale.
They are the remains of a vanished
civilization." :wolves :town :ancients)
(define-topic wolves arturo
"Wolves can kill with ease, but are an
important source of food when traveling
in the wilderness. Sadly, the influx of
Dire Wolves threatens the food supply,
because the cursed flesh of the Dire
Wolf cannot be eaten." :town :flesh :ancients)
(define-topic flesh arturo
"One can cure the meat of wolves and
other un-cursed animals by means of a
Curing spell. I'll teach it to you
before you leave town!" :town :ancients)
(define-topic ancients arturo
"Much of what we know about the
Ancients comes to us from legends. But
there are also the Stones. Aside from
the mysterious locked doors leading into
the mountain, you will find throughout
the countryside the remains of stone
walls, odd arrangements of weathered
stones, and cubic megaliths known as
Waystones. With a magic sextant, you can
find the nearest Waystone by following
the direction its needle points. These
Waystones are also said to be good
places to stop, rest, and collect your
thoughts and memories before continuing
a journey. There's a Waystone here in
town, over by the stone well."
:sextant :wolves)
(define-topic sextant arturo
"I almost forgot, I happen to have an
extra one! It will help you find your
way in the forest. You are welcome to
grab it from my house before you leave
town." :town :wolves)
(define-topic town arturo
"Nothbehem is one of the few remaining
towns in the Vale---everything in the
North fell to ruins when the weather
grew cold. That was a hundred years
ago---and in fact, your robes are not
decked out with fur. I reckon you've
been gone for more than a century."
:cold :ancients :wolves)
(define-topic cold arturo
"You'll have to wear something warmer if
you want to keep looking for your
Dr. Quine, for it is rumored that the
sealed mountainside caves with the oddly
carven stones and the green copper
plating, are related somehow to the
appearance of Travelers. You'll have to
travel through snowy regions to reach
most of these caves."
:caves :clothing :ancients)
(define-topic clothing arturo
"I can give you something from my house
to wear, before you leave town." :caves :ancients)
(define-topic caves arturo
"The cave entrances are decorated with
stone carvings, an irregular motif with
rays and intersecting semi-circles.
Beyond these markings lay massive copper
doors, and strange copper plates whose
workings have never been deciphered.
What sleeps beyond the sealed doors,
none have ever found."
:plates :ancients)
(define-topic plates arturo
"Some caves have two plates, and some
have three or more. I believe that these
mechanisms can be activated by a set of
matching copper gears. My brother Alonso
found one gear on an archaeological dig,
and I found another while on an
expedition to the Northeast; but Alonso
would not share his gear with me, for he
greedily desired whatever treasure may
lay behind the doors, all to himself. To
this day, we each hold one gear, and are
bitterly estranged. If you want to find
Dr. Quine, you'd better find my
brother's gear first."
:alonso :expedition :ancients)
(define-topic expedition arturo
"We went in search of a woman of
Nothbehem, named Amalia, who had run
away from town. But we never found her.
By chance we found an ancient crypt with
a copper key buried inside." :alonso :amalia :ancients)
(define-topic amalia arturo
"I'll give you the written expedition
report before you leave for your
journey. I'm sure it will contain much
valuable help." :alonso :ancients)
(define-topic alonso arturo
"My brother became a hermit as he
aged. Last I heard, he built a cabin in
the Wilmont Woods, far to the northwest,
just north of another Waystone. Perhaps
if you can find him, you'll find the
key.
If you return with news of my brother,
I'll give you the other gear. For I am
an old man now, too weak to undertake
the journey to the Gates." :woods :ancients)
(define-topic woods arturo
"Come to my house before you leave town,
and I'll give you enough supplies to get
started on your journey." :bye :ancients :house)
(defmethod discuss :after ((self arturo) (topic (eql :woods)))
(set-objective "Ask Arturo to unlock his house for you.")
(setf (field-value :discussed-woods self) t))
(define-topic house arturo
"Here, I'll let you in. Grab the things
I told you about! And, you are welcome
to take all the silverwood in the
garden; I have plenty of my own. You
have a long journey ahead of you; I hope
my gifts will help you on your way. And
please, tell me what you find of my
brother. It is too bad that we've been
apart for so long. Farewell,
Geoffrey. And a safe return."
:bye)
(defparameter *follow-arturo-hint*
"Lucius has left the party.
Follow Arturo to the house.")
(defmethod discuss :after ((self arturo) (topic (eql :house)))
(when (lucius)
(unfollow (lucius))
(bark (lucius) "Good luck, Geoffrey!"))
(let ((house (find-pentaquin-house)))
(with-fields (x y width height) house
(walk-to self (+ x (units 5)) (+ y height (units 3)))))
(show-hint *follow-arturo-hint*)
(add-journal-entry (current-buffer) *after-arturo*)
(unlock (find-pentaquin-house)))
(define-topic farewell arturo
"Farewell, Geoffrey. Please come back
soon, and tell me what you've
learned. And don't forget to stop by my
house before you leave!"
:bye)
(define-topic welcome-back arturo
"Welcome back, Traveler! Good to see
you are still in one piece. So, what did
you learn of my brother?" :give-letter)
(define-topic give-letter arturo
"So, now both my brothers are
gone. You are a most kind and honest
Stranger, to have brought this letter
back to me, so that I could know my
brother's Fate, and see our feud laid
also to rest.
If only our own time had men so virtuous
as those from your era! Here---the other
ancient Gear is now yours. You should be
able to enter the southern cave by using
both gears.
I know that you are not seeking mere
treasure, for it is not gold or jewels
the Ancients kept, but rather the riches
of Knowledge.
I suspect, in that regard, you shall be
wealthier than a King one day. For if I
follow aright the Logic of these events,
I can see that you are one of the
Ancients. If you can somehow reverse
these Magicks and return to your own
Time, you would be inheriting a Golden
Age.
"
:southern-cave)
(defmethod discuss :after ((arturo arturo) (topic (eql :give-letter)))
(let ((letter (find-inventory-item (geoffrey) 'alonso-letter)))
(when letter
(destroy letter)
(setf (field-value :has-letter arturo) t)
(add-event :completed-alonso-quest)
(set-objective "Find the southern cave and open the gates.")
(drop arturo (quantity-of 'copper-gear 1)
(units 5) (units 5)))))
(define-topic southern-cave arturo
"There is a Waystone due west of that
cave, and southeast of Nothbehem.
Remember, as long as you hold the
Sextant, the Waystones you've found will
show on your map as a red letter 'W'.
I hope you succeed in your quest to find
Dr. Quine, and to understand your
Origins and the meaning of your becoming
a Traveler."
:goodbye)
(define-topic goodbye arturo
"Fare thee well, Geoffrey. You will be
in my prayers and meditations, for while
I have been content to die little by
little, you have seen the death of your
old life in an instant. I pray you will
keep your Spirits up and not lose hope.
You should stop and talk to Maxwell
before you leave town. He is an
archaeologist, and knows more about the
Ancients than anyone alive. Perhaps he
will be able to help you.
" :bye)
(defmethod will-accept ((self arturo) (thing thing)) nil)