OSDN Git Service

cd5651c453e58b886d66ceb731e0b103cc3ffbc4
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / chanticleer.scm
1 ;;----------------------------------------------------------------------------
2 ;; Constants
3 ;;----------------------------------------------------------------------------
4
5 ;;----------------------------------------------------------------------------
6 ;; Schedule
7 ;;
8 ;; The schedule below is for the place "Trigrave"
9 ;;----------------------------------------------------------------------------
10 (kern-mk-sched 'sch_chant
11                (list 0  0  trigrave-east-west-road   "drunk")
12                (list 2  0  trigrave-chants-bed       "sleeping")
13                (list 12 0  trigrave-tavern-hall      "working")
14                (list 23 0  trigrave-east-west-road   "drunk")               
15                )
16
17 ;;----------------------------------------------------------------------------
18 ;; Gob
19 ;;
20 ;; Quest flags, etc, go here.
21 ;;----------------------------------------------------------------------------
22 (define (chant-mk) (list 0))
23 (define (chant-get-gold knpc) (car (kobj-gob-data knpc)))
24 (define (chant-has-gold? knpc) (> (chant-get-gold knpc) 0))
25 (define (chant-set-gold! knpc amount) 
26   (if (>= amount 0)
27       (set-car! (kobj-gob-data knpc) 
28                 amount)))
29 (define (chant-dec-gold! knpc) (chant-set-gold! knpc 
30                                                 (- (chant-get-gold knpc)
31                                                    1)))
32
33 ;; ----------------------------------------------------------------------------
34 ;; Chanticleer
35 ;;
36 ;; Chanticleer is a roaming bard who spends most of his time in Trigrave. He's
37 ;; a confident, easy-going fellow who is also an unstoppable showman. He
38 ;; possesses a great deal of knowledge about the region, loves rumours and
39 ;; gossip, has friends in low and high places (uncluding the reclusive
40 ;; Enchanter) and is probably a spy for *somebody* but it isn't clear who.
41 ;;
42 ;; ----------------------------------------------------------------------------
43 (define (chant-song knpc kpc)
44   (if (isdrunk? knpc)
45       (say knpc "All together now! Row, row, row your boat! [Hee hee hee!]")
46       (begin
47         (say knpc "A thousand songs wait caged behind the bars of my dry "
48              "throat! Perhaps a little coin to whet the pipes? [He looks at "
49              "you expectantly. Do you give him some gold?]")
50         (if (kern-conv-get-yes-no? kpc)
51             ;; yes - give chant some gold
52             (let ((amount (kern-conv-get-amount)))
53               (display "amount=")(display amount)(newline)
54               (cond ((= 0 amount) 
55                      (say knpc "An imaginary song then, for your imaginary "
56                           "gold! [He pretends to play his lute]"))
57                     ((< amount 2)
58                      (say knpc "Yes... I see. Here goes:\n"
59                           "There was a Wanderer oh so cheap\n"
60                           "He wanted all his gold to keep\n"
61                           "And when he mocked poor Chanticleer\n"
62                           "The sound of discord filled his ear!\n"
63                           " [He strikes a loud, brash, chord and bows]"))
64                     (else
65                      (say knpc "That will fill my yearning mug! "
66                           "Now, of what would you hear? Of Fen, Forest "
67                           "or Forgotten places?")
68                      (chant-set-gold! knpc amount))))
69             ;; no -- don't give him some gold
70             (say knpc "A sober bard doesn't do anybody any good!")))))
71
72 (define (chant-fen knpc kpc)
73   (if (isdrunk? knpc)
74       (say knpc "Nazzty place! [Hic]")
75       (if (not (chant-has-gold? knpc))
76           (chant-song knpc kpc)
77           (begin
78             (chant-dec-gold! knpc)
79             (say knpc 
80                  "THE FENS\n"
81                  "\n"
82                  "  If you like...\n"
83                  "  biting flies, and farting bogs,\n"
84                  "  dismal skies, man-sized frogs,\n"
85                  "  evil altars, muck-filled boots,\n"
86                  "  mislaid rangers (wary of strangers),\n"
87                  "  trackless wastes,\n"
88                  "  lichs, wraiths,\n"
89                  "  and skeletal warriors, too...\n"
90                  "  then, my friend,\n"
91                  "  to the northern Fen!\n"
92                  "  For that's the place for you.\n")))))
93
94 (define (chant-forest knpc kpc)
95   (if (isdrunk? knpc)
96       (say knpc "Run, Forest, run! [Hee-hee]")
97       (if (not (chant-has-gold? knpc))
98           (chant-song knpc kpc)
99           (begin
100             (chant-dec-gold! knpc)
101             (say knpc 
102                  "THE EASTERN WOODS\n"
103                  "\n"
104                  "The woods are lovely, dark and deep\n"
105                  "and always hungry, too!\n"
106                  "They've eaten many travelers\n"
107                  "and gulped a king or two.\n"
108                  "\n"
109                  "There goblins lurk and bandits hide\n"
110                  "and giant spiders drool,\n"
111                  "So if you go there don't forget\n"
112                  "to bring a slower fool!\n"
113                  )))))
114
115 (define (chant-forgotten knpc kpc)
116   (if (isdrunk? knpc)
117       (say knpc "I don't remember! [he weeps with laughter]")
118       (if (not (chant-has-gold? knpc))
119           (chant-song knpc kpc)
120           (begin
121             (chant-dec-gold! knpc)
122             (say knpc 
123                  "LOST HALLS\n"
124                  "\n"
125                  "Delving ever deeper,\n"
126                  "They woke the ancient sleeper,\n"
127                  "You know the tale\n"
128                  "(The moral's stale)\n"
129                  "So I won't bore you with detail!\n"
130                  "\n"
131                  "[stops playing] If you simply MUST go investigate, "
132                  "search the southern coast.")
133                  (if (null? (quest-data-getvalue 'questentry-rune-l 'know-hall))
134                         (quest-data-update-with 'questentry-rune-l 'approx-hall 1 (quest-notify nil))
135                 )
136                  ))))
137
138 (define (chant-thie knpc kpc)
139   (if (isdrunk? knpc)
140       (say knpc 
141            "Hey diddle riddle,\n"
142            "You're in the middle!\n"
143            "When Kalcifax jumped through moon\n"
144            "The Necromage laughed to see such sport\n"
145            "And the Thief ran away with the Rune!")
146       (say knpc "So Enchy has you looking too? The thief must have avoided this "
147            "town, but travelers may have crossed his path. Ask Gwen.")))
148
149 (define (chant-man knpc kpc)
150   (if (isdrunk? knpc)
151       (begin
152         (say knpc "HEY! Can you keep a zecret?")
153         (if (yes? knpc)
154             (begin
155               (say knpc "The MAN haz a zecret cave. You know where it iz?")
156               (if (yes? kpc)
157                   (say knpc "Me too! [Hee-hee!]")
158                   (say knpc "The mountain at [" 
159                        (loc-x the-mans-hideout-loc) " " 
160                        (loc-y the-mans-hideout-loc) 
161                        "] izn't really a mountain! Go zurprize him!")))
162             (say knpc "Me neither! [He snorts]")))
163       (say knpc "The MAN? I don't know anything about the MAN. Why are you asking me?")))
164
165 (define chant-conv
166   (ifc basic-conv
167        ;; default if the only "keyword" which may (indeed must!) be longer than
168        ;; 4 characters. The 4-char limit arises from the kernel's practice of
169        ;; truncating all player queries to the first four characters. Default,
170        ;; on the other hand, is a feature of the ifc mechanism (see ifc.scm).
171        (method 'default 
172                (lambda (knpc kpc) 
173                  (if (isdrunk? knpc)
174                      (say knpc "I's drunk... [hic]")
175                      (say knpc "I am at a loss."))))
176        (method 'hail 
177                (lambda (knpc kpc)
178                  (if (isdrunk? knpc)
179                      (say knpc "[Saluting drunkenly] Hail to the cheese!")
180                      (say knpc "Well met, my fine fellow!"))))
181        (method 'bye 
182                (lambda (knpc kpc) 
183                  (if (isdrunk? knpc)
184                  (say knpc "Buhhhh-bye [snicker]")
185                  (say knpc "May the road kiss your feet!"))))
186        (method 'job 
187                (lambda (knpc kpc) 
188                  (if (isdrunk? knpc)
189                      (say knpc "[Overdramatically, he points to his eyes, "
190                           "then his ears, then makes a zipping motion on his "
191                           "mouth, nods sagely and winks]")
192                      (say knpc "I am a very vessel of wit and song!"))))
193        (method 'name 
194                (lambda (knpc kpc)
195                  (if (isdrunk? knpc)
196                      (say knpc "Chantibard! [He tries to bow but falls down]")
197                      (say knpc "Chanticleer the Bard, at your service "
198                           "[He bows and flourishes]"))))
199        (method 'join 
200                (lambda (knpc kpc) 
201                  (if (isdrunk? knpc)
202                      (say knpc "Join you for a drink? "
203                           "I thought you'd never azzk!")
204                      (say knpc "Some bards adventure, others are wise. "
205                           "I am among the latter."))))
206
207        (method 'chan
208                (lambda (knpc kpc)
209                  (if (isdrunk? knpc)
210                      (say knpc "[Hic!] Whooze that maudlin, drunken fool,\n"
211                           "Who plaize the tung like beast made man...")
212                      (say knpc "\n"
213                           "\n"
214                           " Who is that wise, enchanting bard,\n"
215                           " Who plays the lute like song made flesh\n"
216                           " And tells tales Fate herself would tell\n"
217                           " If Fate could only lie so well?"))))
218        (method 'earl
219                (lambda (knpc kpc)
220                  (if (isdrunk? knpc)
221                      (say knpc "e's furgotten mor' 'an I'll ever know!")
222                      (say knpc 
223                           "Our distinguished shopkeeper...\n"
224                           "\n"
225                           " There once was a master of flame\n"
226                           " As a warmage he gathered great fame\n"
227                           " But as you can tell\n"
228                           " He tried a bad spell\n"
229                           " And now can't remember his name!\n"
230                           ))))
231
232        (method 'ench
233                (lambda (knpc kpc)
234                  (if (isdrunk? knpc)
235                      (say knpc "Enchy! Sits in his comfy tower, giving "
236                           "orders, while Chant has to make the rounds!")
237                      (say knpc 
238                           "My travels sometimes take me to the "
239                           "Enchanter's Tower."))))
240        (method 'gwen
241                (lambda (knpc kpc)
242                  (if (isdrunk? knpc)
243                      (say knpc "[He leans in close and whispers loudly] "
244                           "Ever seen a witch carry a sword?")
245                      (say knpc
246                           "Ah, our mysterious innkeeper...\n"
247                           "\n"
248                           " When the gray dove is weeping\n"
249                           " And the whole world is sleeping\n"
250                           " When ghosts rise like mist from the sea\n"
251                           " The owl in the moonlight\n"
252                           " Inquires of the still night\n"
253                           " The question we all ask of she!\n"))))
254        (method 'fen chant-fen)
255        (method 'fore chant-forest)
256        (method 'forg chant-forgotten)
257        (method 'jim
258                (lambda (knpc kpc)
259                  (if (isdrunk? knpc)
260                      (say knpc "A knight turned inside out! [Burp!]")
261                      (say knpc
262                           "Ha! Here's a bit of gossip!\n"
263                           "\n"
264                           " Full fell and grim\n"
265                           " the righteous Jim,\n"
266                           " His armour slicked in gore,\n"
267                           " Slew his master on the field,\n"
268                           " Scratched the emblem from his shield\n"
269                           " And fled that cursed shore."
270                           ))))
271        (method 'roun
272                (lambda (knpc kpc)
273                  (if (isdrunk? knpc)
274                      (say knpc "Azzright! I watches the roads, "
275                           "watching for them...")
276                      (say knpc "What a strange thing to inquire about!"))))
277        (method 'song chant-song)
278        (method 'them
279                (lambda (knpc kpc)
280                  (if (isdrunk? knpc)
281                      (say knpc "[Hissing] THEM! The Enemy of the Wise! Shhh!")
282                      (say knpc "[Looking at you with mock suspicion] "
283                           "Are you sure you're not paranoid?"))))
284        (method 'thie chant-thie)
285        
286        (method 'towe
287                (lambda (knpc kpc)
288                  (if (isdrunk? knpc)
289                      (say knpc "Deprezzing place!")
290                      (say knpc
291                           "It watches the Fen to the north, "
292                           "but if you're thinking of going there, "
293                           "know that the Enchanter does not like visitors!"))))
294
295        (method 'wit
296                (lambda (knpc kpc)
297                  (say knpc "Well, gossip really. Give me a name, I'll give "
298                       "you the dirt.")))
299        (method 'lost
300                (lambda (knpc kpc)
301                  (say knpc "Well, I wouldn't be a bard if I didn't know a song about the fabled Lost Halls!")))
302        (method 'man chant-man)
303        (method 'wrog chant-man)
304        ))