OSDN Git Service

0694538906df2e46a07912fb97831f98cc89b78e
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / silas.scm
1 ;;----------------------------------------------------------------------------
2 ;; Constants
3 ;;----------------------------------------------------------------------------
4 (define silas-lvl 8)
5 (define silas-species sp_human)
6 (define silas-occ oc_wizard)
7 (define shrine-path-x 97)
8 (define shrine-path-y 5)
9
10 ;;----------------------------------------------------------------------------
11 ;; Schedule
12 ;; 
13 ;; In Old Absalot
14 ;;----------------------------------------------------------------------------
15 (define silas-bed oa-bed1)
16 (define silas-mealplace oa-tbl3)
17 (define silas-workplace oa-temple)
18 (define silas-leisureplace oa-baths)
19 (kern-mk-sched 'sch_silas
20                (list 0  0 silas-bed          "sleeping")
21                (list 7  0 silas-mealplace    "eating")
22                (list 8  0 silas-workplace    "working")
23                (list 12 0 silas-mealplace    "eating")
24                (list 13 0 silas-workplace    "working")
25                (list 18 0 silas-mealplace    "eating")
26                (list 19 0 silas-leisureplace "idle")
27                (list 22 0 silas-bed          "sleeping")
28                )
29
30 ;;----------------------------------------------------------------------------
31 ;; Gob
32 ;;----------------------------------------------------------------------------
33 (define (silas-mk) 
34   (list #f (mk-quest) #f))
35 (define (silas-set-will-help! gob) (set-car! gob #t))
36 (define (silas-will-help? gob) (car gob))
37 (define (silas-quest gob) (cadr gob))
38 (define (silas-met? gob) (caddr gob))
39 (define (silas-set-met! gob) (set-car! (cddr gob) #t))
40
41 ;;----------------------------------------------------------------------------
42 ;; Conv
43 ;; 
44 ;; Silas is the leader of the evil cult of the Accursed.
45 ;; He is a wizard of considerable power.
46 ;;----------------------------------------------------------------------------
47
48 ;; Basics...
49 (define (silas-hail knpc kpc)
50   (if (silas-met? (kobj-gob-data knpc))
51       (say knpc "Hello again, Wanderer.")
52       (begin
53         (silas-set-met! (kobj-gob-data knpc))
54         (say knpc "[You meet a charming older man] Hail, traveler. "
55              "If I am not mistaken, you are a Wanderer. Am I right?")
56         (if (yes? kpc)
57             (say knpc "I knew it! I've actually been expecting you.")
58             (say knpc "[He clearly does not believe you] "
59                  "Really, you are too modest. "
60                  "I've been expecting you for some time.")))))
61
62 (define (silas-default knpc kpc)
63   (say knpc "I'm afraid I cannot help you with that."))
64
65 (define (silas-name knpc kpc)
66   (say knpc "Forgive me, I am Silas. And you, my friend, "
67        "need no introduction."))
68
69 (define (silas-ask-help knpc kpc)
70   (cond ((yes? kpc)
71          (say knpc "I can't tell you how gratified I am to hear that. "
72               "With you on my side we will bring a new age of hope and "
73               "peace to the Shard. When you are ready to begin, "
74               "I have a quest for you.")
75          (silas-set-will-help! (kobj-gob-data knpc))
76          (make-allies knpc kpc)
77          )
78         (else
79          (say knpc "Although success is most doubtful now, "
80               "I shall have to do my best without you. "
81               "It is a pity. You know, in the past, the appearance of a "
82               "Wanderer always occurred at a pivotal moment in history. "
83               "The actions -- or inactions -- of the Wanderer sometimes "
84               "decided the fate of the world for centuries thereafter.")
85          )))
86
87 (define (silas-join knpc kpc)
88   (say knpc "[Chuckling] Actually, I was hoping to convince you to join ME. "
89        "I have a most difficult job ahead of me, but with your help I know it "
90        "can be done. Will you help me?")
91   (silas-ask-help knpc kpc)
92   )
93
94 (define (silas-job knpc kpc)
95   (say knpc "My goal is to bring a new golden age to the Shard. "
96        "Many obstacles lie before me, "
97        "and I greatly need someone with your talents. "
98        "Will you help me, Wanderer? I cannot do this without you.")
99   (silas-ask-help knpc kpc)
100   )
101
102 (define (silas-help knpc kpc)
103   (say knpc "Will you help me in my task?")
104   (silas-ask-help knpc kpc)
105   )
106
107 (define (silas-bye knpc kpc)
108   (say knpc "Farewell, Wanderer, and good fortune!"))
109
110 ;; Tier 2
111 (define (silas-expe knpc kpc)
112   (say knpc "Yes, I have heard of your coming. "
113        "I knew that sooner or later you would appear. "
114        "I have studied the history of the Wanderers quite extensively."))
115 (define (silas-hist knpc kpc)
116   (say knpc "When the library above was burnt most of the archives were lost. "
117        "I'm afraid the best record of the Wanderers is now in this feeble book. "
118        "[He taps his head]"))
119 (define (silas-wand knpc kpc)
120   (say knpc "All Wanderers arrive through the Shrine Gate, as you did. But did you know there is another Gate?")
121   (if (yes? kpc)
122       (say knpc "You are well-learned already! Of course I am speaking of the Demon Gate.")
123       (say knpc "Indeed there is. It is known as the Demon Gate.")))
124
125 (define (silas-demo knpc kpc)
126   (say knpc "For a long time the Demon Gate connected the Shard to other worlds. "
127        "This was a golden age of progress and enlightenment, "
128        "when Wizards from this world and others would freely mingle, "
129        "sharing knowledge and commerce.")
130   (prompt-for-key)
131   (say knpc "But eventually, trouble began to brew. "
132        "One of the other worlds began to conquer the others, "
133        "using the gate to move its armies. For fear that the Shard also would "
134        "be invaded our Wizards sealed the Demon Gate with eight locks, and divided the "
135        "keys among themselves for safe-keeping."))
136
137 (define (silas-key knpc kpc)
138   (if (any-in-inventory? kpc rune-types)
139       (say knpc "The keys are special runes, like the one you already carry.")
140       (say knpc "The keys are special runes. Unfortunately, they have been lost through the ages.")))
141
142 (define (silas-rune knpc kpc)
143   (say knpc "I have made it my goal to recover all of the lost runes. Even if "
144        "we choose to keep the Demon Gate locked forever, we should at least know that "
145        "the runes are all accounted for and safely guarded. Don't you agree?")
146   (if (yes? kpc)
147       (say knpc "Of course, it is merely sound policy.")
148       (say knpc "But consider if the runes were to fall into the wrong hands, "
149            "or if some day we should need to evacuate the Shard, "
150            "or if we needed to call on assistance from the other worlds? "
151            "Surely it is good to have the option of opening the Demon Gate, "
152            "even if we never intend to exercise it.")))
153
154 ;; Accursed, Wise
155 (define (silas-accu knpc kpc)
156   (say knpc "[He chuckles] Yes, I am Accursed. Unfortunately that name has come "
157        "to be demonized by the popular imagination. All sorts of wild tales abound "
158        "regarding our supposed activities. I assure you that none of them are true. But "
159        "we cannot defend ourselves by revealing what we really do, for we are all sworn "
160        "to secrecy."))
161
162 (define (silas-secr knpc kpc)
163   (say knpc "The rites of the Accursed are kept secret to protect them from "
164        "profane people, and to protect foolish people from attempting them! They are "
165        "sacred and dangerous, and not intended for the uninitiated. But I assure you, "
166        "they do not involve anything harmful to innocents!"))
167
168 (define (silas-wise knpc kpc)
169   (say knpc "Ah, yes. The so-called Wise. You know, they are part of a "
170        "venerable and useful tradition. At least, it was a useful tradition in bygone "
171        "days. [Sigh] I fear that now the Wise are as often an impediment to the Shard as "
172        "they are a help. Consider this whole business with Absalot."))
173  
174 (define (silas-absa knpc kpc)
175   (say knpc "By now you are no doubt familiar with the story. The Enchanter, in "
176        "misguided jealousy of our secrets, is obsessed with eliminating the "
177        "Accursed. The Stewardess of Glasdrin is hungry for power, and dreams of a "
178        "military empire. She plans to conquer or raze the cities of the Shard one by "
179        "one, Absalot was merely the first and most convenient target. She easily "
180        "manipulated the evidence against Absalot and convinced the other cities and the "
181        "Enchanter to destroy it. The rest is history."))
182
183 ;; Philosophy
184 (define (silas-evil knpc kpc)
185   (say knpc "What, really, is evil? Mind you, I am not saying that evil does "
186        "not exist. I simply ask you to challenge your conventional notions of what is "
187        "evil. If an authoritative figure tells us something is wrong, shall we take "
188        "them at their word? Are the authorities not people like us, with their own "
189        "agendas? Everyone acts from their own selfish motives, you know, whether or not "
190        "they admit it.")
191   (prompt-for-key)
192   (say knpc "And indeed, Wanderer, that is as it should be! All should strive "
193        "after their own interests, for that is the natural way of things. All Men are "
194        "pieces in a game they cannot avoid playing. To deny the game, to deny one's own "
195        "part in it, to accept the belief that one's own interests are not as important "
196        "as those of another, these are all deceptions propogated by one's opponents."))
197
198 (define (silas-good knpc kpc)
199   (say knpc "You ask me of good, and I ask you in return, what is it that you "
200        "most desire? A thing has value only when it is desired by Men. How ironic, that "
201        "Men are taught to suppress their desires, to quench them with forbearance, as "
202        "if they were evil because they were desires, when in fact the opposite is true! "
203        "I tell you a great secret, it is the desire of certain Men that all other Men "
204        "quench their desires!"))
205
206 (define (silas-desi knpc kpc)
207   (say knpc "Yes, as the spirit animates the flesh, so desire animates the "
208        "spirit. Without it the spirit is listless and void. This is the first step of "
209        "the Accursed, to acknowledge their own desires as what they are: the ultimate "
210        "good, worthy of all sacrifice and all striving."))
211
212 (define (silas-sacr knpc kpc)
213   (say knpc "The doctrine of the Accursed holds that sacrifice is the ladder of "
214        "desire. Sacrifice is the inevitable outcome of choice, for not all things are "
215        "possible! To make the object of desires possible, other possibilities must be "
216        "denied. As the branch of a tree can be cut by shears, so each choice one makes "
217        "shears off an entire branch of the future. That is what we mean by sacrifice: "
218        "the pruning of the tree of possibilities."))
219
220 ;; People
221 (define (silas-ench knpc kpc)
222   (say knpc "'Tis a pity he is such a foe to the Accursed. But I'm afraid he is "
223        "old and inflexible, and once he has decided something is evil there is no "
224        "changing his mind. Unfortunately his notions of good and evil are misguided and "
225        "unworkable."))
226
227 (define (silas-deni knpc kpc)
228   (say knpc "Dennis is an earnest but frankly unimaginative young man."))
229
230 (define (silas-sele knpc kpc)
231   (say knpc "Selene is a talented young woman. "
232        "Unfortunately her powers will always be inhibited by her insatiable "
233        "cruelty."))
234  
235 ;; Quest-related
236 (define (silas-ques knpc kpc)
237   (let* ((gob (kobj-gob-data knpc))
238         (quest (silas-quest gob)))
239
240     (define (has-all-runes?)
241       (all-in-inventory? kpc rune-types))
242
243     (define (missing-only-s-rune?)
244       (all-in-inventory? kpc
245                          (filter (lambda (ktype)
246                                    (not (eqv? ktype t_rune_s)))
247                                  rune-types)))
248
249     (define (give-last-rune)
250       (say knpc "I see you have all save 1 of the runes. Please forgive me for "
251            "a small deception, but I have hidden the last rune here in Old "
252            "Absalot. Consider it one last test for you to find it.")
253         (quest-data-update-with 'questentry-rune-s 'silasinfo 1 (quest-notify nil))
254         (quest-data-assign-once 'questentry-rune-s)
255         )
256
257     (define (continue-quest) 
258       (say knpc "I see you are still missing at least one rune. Don't give up, "
259            "Wanderer! Ask among the Wise, delve into the deeps, search far and wide."))
260
261     (define (end-quest)
262       (quest-done! quest #t)
263       (say knpc "Well done, Wanderer! You have collected all the lost runes, "
264            "a feat worthy of legend. Well done, indeed!")
265       (prompt-for-key)
266       (say knpc "Now that all the runes are recovered, it is imperative that "
267            "they be kept safe. Forgive me for being overly suspicious, but I do not trust "
268            "their keeping to the Wise, not even to the Enchanter himself.")
269       (prompt-for-key)
270       (say knpc "I know what you are thinking, my friend, but perish the thought! "
271            "I could not possibly keep them here with me. Nor do I want to. "
272            "No, I have something much more daring in mind. ")
273       (prompt-for-key)
274       (say knpc "Wanderer, the time has come to grasp the nettle. Indeed, I "
275            "sense that this is what brought you to the Shard. Take the keys, find the Gate, "
276            "and unlock it. Face what lies within. Be bold, and you will usher in a New "
277            "Age. Will you do this?")
278       (if (yes? kpc)
279           (say knpc "Then I will tell you a great secret hidden even from the "
280                "Wise: the gods yet live, as do their foes. I know not which you will face. But "
281                "this I know: their foes sealed the Gate. ")
282           (say knpc "[His shoulders slump] It was not your burden to bear, "
283                "Wanderer, for you are a stranger to this "
284                "world. Keep the keys safe, at least, if you will not change your mind.")))
285            
286     (define (offer-quest)
287       (say knpc "Wanderer, I have a most important task for you: find the eight "
288            "rune-keys which lock the Demon Gate. Will you do this?")
289       (if (yes? kpc)
290           (begin
291             (quest-accepted! quest #t)
292             (cond
293                 ((has-all-runes?)
294                         (say knpc "You already have the runes?")
295                         (prompt-for-key)
296                         (end-quest)
297                         )
298                 ((missing-only-s-rune?)
299                         (give-last-rune))
300                 (#t
301                         (say knpc "I know I can count on you. There is a most clever man, "
302                         "an Alchemist, who lives on Oparine. Perhaps you know of him already. He would "
303                         "be a good place to start."))
304              ))
305           (say knpc "It is imperative that we find them. I am disappointed, my "
306                "friend, but no doubt you have your reasons.")))
307
308     (if (silas-will-help? gob)
309         (if (quest-done? quest)
310             (say knpc "Seek the Demon Gate!")
311             (if (quest-accepted? quest)
312                 (if (has-all-runes?)
313                     (end-quest)
314                     (if (missing-only-s-rune?)
315                         (give-last-rune)
316                         (continue-quest)))
317                 (offer-quest)))
318         (say knpc "Join me, and there will be quests and glory in abundance. "
319              "You will become the most famous Wanderer -- indeed, "
320              "the greatest hero of the Shard -- for all time."))
321     ))
322
323 (define (pissed-off-silas knpc kpc)
324   (map (lambda (tag)
325          (if (defined? tag)
326              (let ((kchar (eval tag)))
327                (if (is-alive? kchar)
328                    (begin
329                      (kern-being-set-base-faction kchar faction-accursed)
330                      (kern-char-set-schedule kchar nil)
331                      )))))
332        (list 'ch_silas 'ch_dennis 'ch_selene))
333   (make-enemies knpc kpc)
334   )
335
336 (define (silas-noss knpc kpc)
337   (say knpc "[His face freezes] How did you learn that name, friend?")
338   (kern-conv-get-reply kpc)
339   (say knpc "Have you been nosing around in other people's property?")
340   (if (yes? kpc)
341       (say knpc "How unfortunate. I'm afraid it is time for you to leave.")
342       (say knpc "I think you have. I think you have been misbehaving, "
343            "and now you are telling a fib. You are not welcome here. "
344            "Leave at once."))
345   (pissed-off-silas knpc kpc)
346   (kern-conv-end)
347   )
348
349 (define silas-conv
350   (ifc basic-conv
351
352        ;; basics
353        (method 'default silas-default)
354        (method 'hail silas-hail)
355        (method 'bye  silas-bye)
356        (method 'job  silas-job)
357        (method 'name silas-name)
358        (method 'join silas-join)
359
360        (method 'absa silas-absa)
361        (method 'accu silas-accu)
362        (method 'demo silas-demo)
363        (method 'deni silas-deni)
364        (method 'denn silas-deni)
365        (method 'desi silas-desi)
366        (method 'ench silas-ench)
367        (method 'evil silas-evil)
368        (method 'expe silas-expe)
369        (method 'gate silas-demo)
370        (method 'good silas-good)
371        (method 'help silas-help)
372        (method 'hist silas-hist)
373        (method 'key  silas-key)
374        (method 'keys silas-key)
375        (method 'noss silas-noss)
376        (method 'ques silas-ques)
377        (method 'rune silas-rune)
378        (method 'sacr silas-sacr)
379        (method 'secr silas-secr)
380        (method 'sele silas-sele)
381        (method 'task silas-job)
382        (method 'wand silas-wand)
383        (method 'wise silas-wise)
384        ))
385
386 (define (mk-silas)
387   (bind 
388    (kern-mk-char 
389     'ch_silas           ; tag
390     "Silas"             ; name
391     silas-species         ; species
392     silas-occ              ; occ
393     s_silas     ; sprite
394     faction-men      ; starting alignment
395     0 5 0            ; str/int/dex
396     2 1              ; hp mod/mult
397     2 1              ; mp mod/mult
398     max-health ; hp
399     -1                   ; xp
400     max-health ; mp
401         0
402     silas-lvl
403     #f               ; dead
404     'silas-conv         ; conv
405     sch_silas           ; sched
406     'spell-sword-ai  ; special ai
407     nil              ; container
408     (list t_stun_wand) ; readied
409     )
410    (silas-mk)))