1;;----------------------------------------------------------------------------
2;; Constants
3;;----------------------------------------------------------------------------
4(define angriss-lvl 20)
5
6;;----------------------------------------------------------------------------
7;; Schedule
8;;
9;; No schedule.  (Angriss' Lair)
10;;----------------------------------------------------------------------------
11
12;;----------------------------------------------------------------------------
13;; Gob
14;;----------------------------------------------------------------------------
15(define (angriss-mk)
16  (list #f (mk-quest)))
17
18(define (angriss-quest angriss) (cadr angriss))
19(define (angriss-spoke? angriss) (car angriss))
20(define (angriss-spoke! angriss) (set-car! angriss #t))
21
22;;----------------------------------------------------------------------------
23;; Conv
24;;
25;; Angriss is Queen of the Spiders, dwelling in Angriss' Lair.
26;; Suspicious, jealous, alien.
27;;----------------------------------------------------------------------------
28
29;; Basics...
30(define (angriss-hail knpc kpc)
31  (say knpc "Hideous Soft One, who\n"
32       "comes uninvited, be quick\n"
33       "in honor, or die."))
34
35(define (angriss-default knpc kpc)
36  (say knpc "[Still as a statue in her web, she gives no response]"))
37
38(define (angriss-name knpc kpc)
39  (say knpc "To Men, Angriss; to\n"
40       "the Goblins, Ruka; to the\n"
41       "Trolls, Hibliminos."))
42
43(define (angriss-join knpc kpc)
44  (say knpc "Do lips join a cup\n"
45       "but to drain it dry? My kind\n"
46       "to Men join the same."))
47
48(define (angriss-job knpc kpc)
49  (say knpc "Hunger."))
50
51(define (angriss-bye knpc kpc)
52  (say knpc "The empire of light\n"
53       "Calls you back. Ascend the stair\n"
54       "if you can reach it.\n"))
55
56
57(define (angriss-soft knpc kpc)
58  (say knpc "To drink the dark wine\n"
59       "Men crush the grape. I drink the\n"
60       "wine that's crushed from Men."))
61
62(define (angriss-hung knpc kpc)
63  (say knpc "A river of blood\n"
64       "flows down to my lair, a pile\n"
65       "of bones waxes there."))
66
67(define (angriss-men knpc kpc)
68  (say knpc "So proud in armor\n"
69       "so soft in hidden aspect\n"
70       "so sweet in folly."))
71
72(define (angriss-gobl knpc kpc)
73  (say knpc "A stealthy hunt, a\n"
74       "terrible struggle, in the\n"
75       "end the longest rest."))
76
77(define (angriss-trol knpc kpc)
78  (say knpc "Stone-thrower and rock\n"
79       "beater, your fearsome bellow\n"
80       "will become a scream."))
81
82(define (angriss-choose knpc kpc)
83  (say knpc "Choose whom you will give to me.")
84  (let ((kchar (kern-ui-select-party-member))
85        (quest (angriss-quest (kobj-gob-data knpc))))
86    (if (null? kchar)
87        (begin
88          (say knpc "You toy with a monster, now flee.")
89          (harm-relations knpc kpc)
90          (harm-relations knpc kpc)
91          (kern-conv-end))
92        (if (is-dead? kchar)
93            (begin
94              (say knpc "FRESH meat I require!\n"
95                   "Poison! Foul, is that dead blood!\n"
96                   "Bring me another.")
97              (kern-conv-end))
98            (begin
99              (say knpc "Honor is satisfied.\n")
100              (if (not (quest-done? quest))
101                  (quest-done! quest #t))
102              (kern-char-leave-player kchar)
103              (kern-being-set-base-faction kchar faction-none)
104              (improve-relations knpc kpc)
105              (kern-conv-end))))))
106
107
108(define (angriss-rune knpc kpc)
109  (let ((quest (angriss-quest (kobj-gob-data knpc))))
110    (if (quest-done? quest)
111        (begin
112          (say knpc "The ancient secret,\n"
113               "The key to a lock of hell.\n"
114               "Take it, it is thine.")
115          (kern-obj-remove-from-inventory knpc t_rune_f 1)
116          (kern-obj-add-to-inventory kpc t_rune_f 1)
117          (rune-basic-quest 'questentry-rune-f s_runestone_f)
118         )
119        (say knpc "I know what you seek.\n"
120             "But I wonder, do you? First,\n"
121             "satisfy honor."))))
122
123(define (angriss-sacr knpc kpc)
124
125  (define (player-alone?)
126    (< (num-player-party-members)
127       2))
128
129  (let ((quest (angriss-quest (kobj-gob-data knpc))))
130
131    (define (refused)
132      (say knpc "Flee from my presence.\n"
133           "You may escape my wrath, but\n"
134           "You will not return.")
135      (harm-relations knpc kpc)
136      (harm-relations knpc kpc)
137      (kern-conv-end))
138
139    (define (offer-quest)
140      (display "offer-quest")(newline)
141      (if (player-alone?)
142          (begin
143            (say knpc "You will find, if you\n"
144                 "seek, a fool to join you. Bring\n"
145                 "that fool unto me.\n"
146                 "...Agreed?")
147            (if (kern-conv-get-yes-no? kpc)
148                (begin
149                  (quest-accepted! quest)
150                  (improve-relations knpc kpc)
151                  (improve-relations knpc kpc))
152                (refused)))
153          (begin
154            (say knpc "Among your party\n"
155                 "Choose one as a sacrifice\n"
156                 "and you will go free.\n"
157                 "...Agreed?")
158            (if (kern-conv-get-yes-no? kpc)
159                (angriss-choose knpc kpc)
160                (refused)))))
161
162    (if (quest-done? quest)
163        (say knpc "It is done.")
164        (if (quest-accepted? quest)
165            (if (player-alone?)
166                (say knpc "Alone you come back.\n"
167                     "Where is the sacrifice that\n"
168                     "will keep you from doom?")
169                (choose-victim))
170            (offer-quest)))))
171
172
173(define (angriss-hono knpc kpc)
174  (say knpc "I demand honor\n"
175       "and sacrifice. Give them to\n"
176       "me, or flee, or die."))
177
178(define angriss-conv
179  (ifc basic-conv
180
181       ;; basics
182       (method 'default angriss-default)
183       (method 'hail angriss-hail)
184       (method 'bye angriss-bye)
185       (method 'job angriss-job)
186       (method 'name angriss-name)
187       (method 'join angriss-join)
188
189       (method 'soft angriss-soft)
190       (method 'hung angriss-hung)
191       (method 'rune angriss-rune)
192       (method 'men angriss-men)
193       (method 'gobl angriss-gobl)
194       (method 'trol angriss-trol)
195       (method 'sacr angriss-sacr)
196       (method 'hono angriss-hono)
197       ))
198
199(define (angriss-ai kchar)
200  (if (angriss-spoke? (kobj-gob-data kchar))
201      (spider-ai kchar)
202      (begin
203        (angriss-spoke! (kobj-gob-data kchar))
204        (kern-conv-begin kchar))))
205
206(define (mk-angriss)
207  (bind
208   (kern-char-force-drop
209    (kern-mk-char
210     'ch_angriss         ; tag
211     "Angriss"           ; name
212     sp_queen_spider     ; species
213     nil                 ; occ
214     s_purple_spider     ; sprite
215     faction-spider ; starting alignment
216     20 0 20             ; str/int/dex
217     10 5                ; hp mod/mult
218     10 5                ; mp mod/mult
219     max-health ;;..current hit points
220     -1 ;;...........current experience points
221     max-health ;;..current magic points
222     0
223     angriss-lvl
224     #f                  ; dead
225     'angriss-conv       ; conv
226     nil                 ; sched
227     'angriss-ai          ; special ai
228
229     ;;..........container (and contents)
230     (mk-inventory (list (list 1 t_rune_f)))
231     nil                 ; readied
232     )
233    #t)
234    (angriss-mk)))
235