OSDN Git Service

d868b77e2884db0b159c815fd5e214e1c503249f
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / may.scm
1 ;;----------------------------------------------------------------------------
2 ;; Constants
3 ;;----------------------------------------------------------------------------
4 (define may-start-lvl  6)
5 (define inn-room-price 30)
6
7 ;;----------------------------------------------------------------------------
8 ;; Schedule
9 ;; 
10 ;; In Bole.
11 ;;----------------------------------------------------------------------------
12 (kern-mk-sched 'sch_may
13                (list 0  0  bole-bed-may "sleeping")
14                (list 6  0  bole-dining-hall "working")
15                )
16
17 ;;----------------------------------------------------------------------------
18 ;; Gob
19 ;;
20 ;; Quest flags, etc, go here.
21 ;;----------------------------------------------------------------------------
22 (define (may-mk) nil)
23
24 ;;----------------------------------------------------------------------------
25 ;; Conv
26 ;; 
27 ;; May is a female innkeeper, who lives in Bole.
28 ;; Melvin is her (seventh) husband.
29 ;;----------------------------------------------------------------------------
30 (define (may-trade knpc kpc)
31   (say knpc "Talk to my husband Melvin in the kitchen."))
32
33 (define (may-hail knpc kpc)
34   (say knpc "[You meet a stout older woman who looks at you keenly] "
35        "I know you are trouble, but I welcome thee."))
36
37 (define (may-job knpc kpc)
38   (say knpc "I run the tavern with my husband here in the Bole"))
39
40 (define (may-husband knpc kpc)
41   (say knpc "My husband Melvin is a worthless drunk and a coward "
42        "but he is a good enough cook. I have outlived six other husbands. "
43        "I married him because I needed help running the inn, that is all."))
44
45 (define (may-other-husbands knpc kpc)
46   (say knpc "My other husbands were all fools! A few, indeed, I loved. "
47        "But they were fools and each met his own foolish death. "
48        "I see that you are a fool, too, and will meet your own foolish "
49        "death some day."))
50
51 (define (may-tavern knpc kpc)
52   (say knpc "Melvin is the cook and I serve the guests. "
53        "Perhaps you would care to buy a drink or some supper, "
54        "or a room where you may rest."))
55
56 (define (may-guests knpc kpc)
57   (say knpc "[She gives you a canny look] Aye, even now we have a strange "
58        "woman and her... companion. But perhaps you were looking for "
59        "someone else, eh?")
60   (if (kern-conv-get-yes-no? kpc)
61       (begin
62         (say knpc "Yes, I thought so. And perhaps this other person had "
63              "something of interest to you?")
64         (if (kern-conv-get-yes-no? kpc)
65             (begin
66               (say knpc "How odd, because that item was also of interest to "
67                    "our current guests. Not that it is any of my business, "
68                    "but one suspects that the woman and he whom you seek "
69                    "arranged to meet here. Perhaps to make an... "
70                    "exchange."))
71             (say knpc "Well, there was another man here briefly. But he "
72                  "left shortly before you arrived.")))
73       (say knpc "Perhaps you are just out admiring the countryside then.")))
74
75 (define (may-woman knpc kpc)
76   (say knpc "Yes, we don't often get such beautiful people in these parts. "
77        "Poor Bill is quite smitten. And my fool of a husband ogles here "
78        "whenever he gets a chance. [She leans in close and whispers] But "
79        "if she isn't a sorceress, or one in training, then I'm a goose!"))
80
81 (define (may-companion knpc kpc)
82   (say knpc "This woman travels with a great brute. I suspect he has ogre "
83        "blood in his veins. Obviously he is her protector, though what bind "
84        "she has over him I know not."))
85
86 (define (may-bill knpc kpc)
87   (say knpc "Aye, Bill is a local boy. Not too bright, but he makes an "
88        "honest living as a woodcutter. He eats here, and sometimes talks "
89        "to the guests."))
90
91 (define (may-hackle knpc kpc)
92   (say knpc "Hackle is a crazy but harmless old hedge-witch who lives across "
93        "the stream. She has a knack for the healing arts but hasn't the wits "
94        "for much else."))
95
96 (define (may-room knpc kpc)
97   (if (not (string=? "working" (kern-obj-get-activity knpc)))
98       (say knpc "The Inn is closed. Come back in the morning at 0600.")
99       (let ((door (eval 'bole-inn-room-door)))
100         ;; is the room still open?
101         (if (not (door-locked? (kobj-gob door)))
102             ;; yes - remind player
103             (say knpc "Your room is still open.")
104             ;; no - ask if player needs a room
105             (begin
106               (say knpc "Would ye like a room?")
107               (if (kern-conv-get-yes-no? kpc)
108                   ;; yes - player wants a room
109                   (begin
110                     (say knpc 
111                          "It will be " inn-room-price " gold, "
112                          "and you may use the room as "
113                          "long as you are in town. Agreed?")
114                     (if (kern-conv-get-yes-no? kpc)
115                         ;; yes - player agrees to the price
116                         (let ((gold (kern-player-get-gold)))
117                           ;; does player have enough gold?
118                           (if (>= gold inn-room-price)
119                               ;; yes - player has enough gold
120                               (begin
121                                 (kern-player-set-gold 
122                                  (- gold 
123                                     inn-room-price))
124                                 (say knpc "Good. Your room is down the hall "
125                                      "on the left.")
126                                 (send-signal knpc door 'unlock)
127                                 (kern-conv-end)
128                                 )
129                               ;; no - player does not have enouvh gold)
130                               (say knpc "Ye have not the gold!")))
131                         ;; no - player does not agree to the price
132                         (say knpc 
133                              "Sleep on the ground then. Mind the wolves.")))
134                   ;; no - player does not want a room
135                   (say knpc "Even one such as you must sometimes rest!")))))))
136   
137 (define (may-thief knpc kpc)
138   (say knpc "Ah... thou playest the thief-catcher. I suspected something of "
139        "the kind. We HAVE had some odd guests here lately."))
140
141 (define (may-trouble knpc kpc)
142   (say knpc "Ye have the hard, pitiless visage like the men of the Old Era. "
143        "But I sense that thou art not unjust."))
144
145 (define may-conv
146   (ifc nil
147        (method 'default (lambda (knpc kpc) (say knpc "I can't help thee.")))
148        (method 'hail may-hail)
149        (method 'bye  (lambda (knpc kpc) (say knpc "Begone then for now.")))
150        (method 'job  may-job)
151        (method 'name (lambda (knpc kpc) (say knpc "I am called May.")))
152        (method 'join (lambda (knpc kpc)
153                        (say knpc "Don't flatter me with your foolishness.")))
154
155        (method 'buy   may-trade)
156        (method 'food  may-trade)
157        (method 'drin  may-trade)
158        (method 'supp  may-trade)
159        (method 'trade may-trade)
160
161        (method 'bill  may-bill)
162        (method 'comp  may-companion)
163        (method 'gues  may-guests)
164        (method 'hack  may-hackle)
165        (method 'husb  may-husband)
166        (method 'inn   may-tavern)
167        (method 'melv  may-husband)
168        (method 'other may-other-husbands)
169        (method 'run   may-tavern)
170        (method 'room  may-room)
171        (method 'six   may-other-husbands)
172        (method 'tave  may-tavern)
173        (method 'thie  may-thief)
174        (method 'trou  may-trouble)
175        (method 'woma  may-woman)
176
177        ))
178
179 ;;----------------------------------------------------------------------------
180 ;; First-time constructor
181 ;;----------------------------------------------------------------------------
182 (define (mk-may)
183   (bind 
184    (kern-char-arm-self
185     (kern-mk-char 
186      'ch_may ;;......tag
187      "May" ;;.......name
188      sp_human ;;.....species
189      nil ;;..........occupation
190      s_townswoman ;;...sprite
191      faction-men ;;..faction
192      0 ;;............custom strength modifier
193      1 ;;............custom intelligence modifier
194      0 ;;............custom dexterity modifier
195      0 ;;............custom base hp modifier
196      0 ;;............custom hp multiplier (per-level)
197      0 ;;............custom base mp modifier
198      0 ;;............custom mp multiplier (per-level)
199      max-health ;;..current hit points
200      -1  ;;...........current experience points
201      max-health ;;..current magic points
202      0
203      may-start-lvl  ;;..current level
204      #f ;;...........dead?
205      'may-conv ;;...conversation (optional)
206      sch_may ;;.....schedule (optional)
207      'townsman-ai ;;..........custom ai (optional)
208      nil ;;..........container (and contents)
209      (list t_dagger) ;;.........readied arms (in addition to the container contents)
210      nil ;;..........hooks in effect
211      ))
212    (may-mk)))