OSDN Git Service

76ab9f2c22a8c7c7f6813edaa4087bdcf8dc2ffd
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / oscar.scm
1 ;;----------------------------------------------------------------------------
2 ;; Constants
3 ;;----------------------------------------------------------------------------
4
5 ;;----------------------------------------------------------------------------
6 ;; Schedule
7 ;;
8 ;; In Oparine
9 ;;----------------------------------------------------------------------------
10 (kern-mk-sched 'sch_oscar
11                (list 0  0  oparine-innkeepers-bed "sleeping")
12                (list 8  0  bilge-water-seat-3     "eating")
13                (list 9  0  cheerful-counter       "working")
14                (list 12 0  bilge-water-seat-3     "eating")
15                (list 13 0  cheerful-counter       "working")
16                (list 21 0  bilge-water-seat-3     "eating")
17                (list 22 0  bilge-water-hall       "idle")
18                (list 23 0  oparine-innkeepers-bed "sleeping")
19                )
20
21 ;;----------------------------------------------------------------------------
22 ;; Gob
23 ;;
24 ;; Quest flags, etc, go here.
25 ;;----------------------------------------------------------------------------
26 (define (oscar-mk) nil)
27
28 ;;----------------------------------------------------------------------------
29 ;; Conv
30 ;;
31 ;; Oscar is the innkeeper in Oparine.  He is a glum fellow, with a wooden leg.
32 ;;----------------------------------------------------------------------------
33
34 ;; Basics...
35 (define (oscar-hail knpc kpc)
36   (say knpc "[You meet a glum man with a wooden leg] Hello."))
37
38 (define (oscar-default knpc kpc)
39   (say knpc "I don't know."))
40
41 (define (oscar-name knpc kpc)
42   (say knpc "I'm Oscar the Innkeeper."))
43
44 (define (oscar-join knpc kpc)
45   (say knpc "I would just get in the way."))
46
47 (define (oscar-job knpc kpc)
48   (say knpc "I'm the Innkeeper. "
49        "I doubt you want to rent a room, "
50        "but if you do let me know."))
51
52 (define (oscar-bye knpc kpc)
53   (say knpc "Bye"))
54
55 ;; Trade...
56 (define (oscar-trade knpc kpc)
57   (if (not (string=? "working" (kern-obj-get-activity knpc)))
58       (say knpc "The inn is open from 9 to 9, and I do have to eat sometime, "
59            "so try me later.")
60       (let ((door (eval 'oparine-inn-room-1-door)))
61         ;; is the room still open?
62         (if (not (door-locked? (kobj-gob door)))
63             ;; yes - remind player
64             (say knpc "Your room is still open.")
65             ;; no - ask if player needs a room
66             (begin
67               (say knpc "Do you need a room?")
68               (if (kern-conv-get-yes-no? kpc)
69                   ;; yes - player wants a room
70                   (begin
71                     (say knpc 
72                          "That will be " oparine-inn-room-price " gold. "
73                          "You can have the room as long as you're in town. "
74                          "Do you still want it?")
75                     (if (kern-conv-get-yes-no? kpc)
76                         ;; yes - player agrees to the price
77                         (let ((gold (kern-player-get-gold)))
78                           ;; does player have enough gold?
79                           (if (>= gold oparine-inn-room-price)
80                               ;; yes - player has enough gold
81                               (begin
82                                 (say knpc "Ok, you're in room 1, "
83                                      "but you won't like it. "
84                                      "Don't complain to me because I told you "
85                                      "so.")
86                                 (kern-player-set-gold 
87                                  (- gold 
88                                     oparine-inn-room-price))
89                                 (send-signal knpc door 'unlock)
90                                 (kern-conv-end)
91                                 )
92                               ;; no - player does not have enouvh gold)
93                               (say knpc "Sorry, but you don't have the gold. "
94                                    "This isn't a poorhouse, you know." )))
95                         ;; no - player does not agree to the price
96                         (say knpc 
97                              "I knew you wouldn't.")))
98                   ;; no - player does not want a room
99                   (say knpc "I didn't think so. "
100                        "I was just being polite.")))))))
101
102 ;; Inn...
103 (define (oscar-inn knpc kpc)
104   (say knpc "The former owner gave it the name. "
105        "I didn't feel like changing it. Besides, that would be bad luck."))
106
107 (define (oscar-luck knpc kpc)
108   (say knpc "The ghost in room 3 likes the name. I don't want the ghost of "
109        "a wicked pirate mad at me.")
110         (quest-data-assign-once 'questentry-ghertie)
111         (quest-data-update 'questentry-ghertie 'ghertieloc 1))
112
113 (define (oscar-ghost knpc kpc)
114   (say knpc "Ghastly Ghertie was murdered by her crew in room 3. "
115        "She still haunts it so I don't rent it out. "
116        "I wish she would pay her bill.")
117         (quest-data-update 'questentry-ghertie 'ghertieid 1)
118         (quest-data-update 'questentry-ghertie 'ghertieloc 1)
119         (quest-data-assign-once 'questentry-ghertie))
120
121 ;; Leg...
122 (define (oscar-leg knpc kpc)
123   (say knpc "I tried to be a sailor but nobody would take me. "
124        "So I cut off my leg to make myself look like a sailor. "
125        "They still wouldn't take me. I miss that leg."))
126
127 ;; Townspeople...
128 (define (oscar-opar knpc kpc)
129   (say knpc "This is a port city. Most of my customers are travelers who "
130        "disembark here before traveling north."))
131
132 (define (oscar-gher knpc kpc)
133   (say knpc "Ghertie was a wicked pirate back before my time. "
134        "Her own crew murdered her and left with her ship and her treasure.")
135         (quest-data-assign-once 'questentry-ghertie))
136
137 (define (oscar-alch knpc kpc)
138   (say knpc "His shop is next to the tavern. He's always looking for weird "
139        "stuff to use in his experiments."))
140
141 (define (oscar-bart knpc kpc)
142   (say knpc "Bart the shipwright has a shop just across the way. "
143        "He usually gets pretty drunk at night. I can't keep up with him."))
144
145 (define (oscar-seaw knpc kpc)
146   (say knpc "The sea witch is very beautiful but keeps to herself. "
147        "She ignores me, of course."))
148
149 (define (oscar-henr knpc kpc)
150   (say knpc "There's a real sailor. I'll never be like him."))
151
152 (define oscar-conv
153   (ifc basic-conv
154
155        ;; basics
156        (method 'default oscar-default)
157        (method 'hail oscar-hail)
158        (method 'bye  oscar-bye)
159        (method 'job  oscar-job)
160        (method 'name oscar-name)
161        (method 'join oscar-join)
162        
163        ;; trade
164        (method 'trad oscar-trade)
165        (method 'room oscar-trade)
166        (method 'buy  oscar-trade)
167        (method 'sell oscar-trade)
168
169        ;; inn
170        (method 'inn  oscar-inn)
171        (method 'luck oscar-luck)
172        (method 'ghos oscar-ghost)
173        (method 'pira oscar-ghost)
174        (method 'leg  oscar-leg)
175
176        ;; town & people
177        (method 'opar oscar-opar)
178        (method 'alch oscar-alch)
179        (method 'gher oscar-gher)
180        (method 'ghas oscar-gher)
181        (method 'henr oscar-henr)
182        (method 'bart oscar-bart)
183        (method 'sea  oscar-seaw)
184        (method 'witc oscar-seaw)
185
186        ))
187
188 (define (mk-oscar)
189   (bind 
190    (kern-mk-char 'ch_oscar           ; tag
191                  "Oscar"             ; name
192                  sp_human            ; species
193                  nil                 ; occ
194                  s_townsman          ; sprite
195                  faction-men         ; starting alignment
196                  1 1 0               ; str/int/dex
197                  0 0                 ; hp mod/mult
198                  0 0                 ; mp mod/mult
199                  max-health -1 max-health 0 1  ; hp/xp/mp/AP_per_turn/lvl
200                  #f                  ; dead
201                  'oscar-conv         ; conv
202                  sch_oscar           ; sched
203                  'townsman-ai        ; special ai
204                  nil                 ; container
205                  (list t_dagger)     ; readied
206                  )
207    (oscar-mk)))