OSDN Git Service

4d59f7c9afd9ecf8ea3ad736ded3ab11aa8c4ae4
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / edward.scm
1 ;;----------------------------------------------------------------------------
2 ;; Constants
3 ;;----------------------------------------------------------------------------
4 (define edward-start-lvl 4)
5
6 ;;----------------------------------------------------------------------------
7 ;; Schedule
8 ;;
9 ;; In the dungeons below Green Tower.
10 ;;----------------------------------------------------------------------------
11 (kern-mk-sched 'sch_edward
12                (list 0  0  gtl-jailor-bed "sleeping")
13                (list 7  0  gtl-jail       "working" )
14                (list 21 0  gtl-jailor-bed "sleeping")
15                )
16
17 ;;----------------------------------------------------------------------------
18 ;; Gob
19 ;;
20 ;; Quest flags, etc, go here.
21 ;;----------------------------------------------------------------------------
22 (define (edward-mk) (list #f #f))
23 (define (edward-met? gob) (car gob))
24 (define (edward-meet! gob) (set-car! gob #t))
25 (define (edward-has-nate? gob) (cadr gob))
26 (define (edward-has-nate! gob) (set-car! (cdr gob) #t))
27
28 ;;----------------------------------------------------------------------------
29 ;; Conv
30 ;;
31 ;; Edward is a old blind man, serving as the jailor 
32 ;; in the dungeons below Green Tower.
33 ;;----------------------------------------------------------------------------
34 (define (edward-hail knpc kpc)
35   (meet "You meet a pale old man whose eyes are milky white.")
36   (let ((edward (kobj-gob-data knpc)))
37     (cond ((not (edward-met? edward))
38            (say knpc "Who goes there?")
39            (reply? kpc)
40            (edward-meet! edward)
41            (say knpc "I don't know you. Are you hear to make a jail-break?")
42            (if (yes? kpc)
43                (say knpc "Well get on with it! I'm too old to stop you.")
44                (say knpc "That's a relief. I'd have no-one to talk to.")
45                )
46            )
47           (else
48            (say knpc "Welcome back. I remember your footfalls.")
49            ))))
50
51 (define (edward-give-nate knpc kpc)
52   (say knpc "Are you delivering a prisoner?")
53   (cond ((yes? kpc)
54          (cond ((is-only-living-party-member? ch_nate)
55                 (say knpc "Turn yourself in if you like, "
56                      "but get rid of that dead body first! "
57                      "This isn't a morgue.")
58                 )
59                (else
60                 (say knpc "Oh, good. More company. [He takes Nate into custody and "
61                      "locks him in a cell]")
62                 (kern-char-leave-player ch_nate)
63                 (kern-obj-relocate ch_nate (mk-loc p_green_tower_lower 9 10) nil)
64                 (prompt-for-key)
65                 (say knpc "Here's your receipt, in case the Captain wants it.")
66                 (give (kern-get-player) t_prisoner_receipt 1)
67                 (edward-has-nate! (kobj-gob-data knpc))
68                 (quest-data-update-with 'questentry-bandits 'nate-given-to-jailor 1 (quest-notify nil))                
69                 )))
70         (else
71          (say knpc "Hokay. [He gives Nate a look, then shrugs]")
72          )))
73
74 (define (edward-pris knpc kpc)
75   (cond ((in-player-party? 'ch_nate) (edward-give-nate knpc kpc))
76         (else
77          (let ((edward (kobj-gob-data knpc)))
78            (if (edward-has-nate? edward)
79                (say knpc "I've got a forest goblin and that fellow you brought in.")
80                (say knpc "I've just got a forest goblin right now. "
81                     "He and I can't understand each other, "
82                     "but that doesn't stop us from swapping stories."))))
83         ))
84
85 (define (edward-gobl knpc kpc)
86   (say knpc "I'm not afraid of them. They never done me no harm."))
87
88 (define (edward-stor knpc kpc)
89   (say knpc "Have you heard the one about Will-o-the-Woods?")
90   (cond ((no? kpc)
91          (say knpc "Will-o-the-Woods was a spirit that used to haunt these woods, "
92               "in the old days when the gates worked and the gods were honored. ")
93          (prompt-for-key kpc)
94          (say knpc "If a pretty maiden ventured into the woods alone, "
95               "he would appear as a handsome woodsman or ranger, "
96               "and entice her back to his sacred grove. "
97               "There, he would turn her into a tree. ")
98          (prompt-for-key kpc)
99          (say knpc "That's how the Great Wood got its beginning, in his grove. "
100               "And that's why you find so many haunted trees in the woods even to this day.")
101          )
102         (else
103          (say knpc "No one knows what become of Will-o-the-Woods. "
104               "Passed into legend like the other gods, I suppose.")
105          )))
106
107 (define (edward-gate knpc kpc)
108   (say knpc "I don't know anything about them. They used to work, that's all I know."))
109
110 (define (edward-gods knpc kpc)
111   (say knpc "It's not a good idea to talk about the old gods. "
112        "Folks might think us Accursed if they were to overhear."))
113
114 (define (edward-accu knpc kpc)
115   (say knpc "The Accursed seek power from the old gods... and other things. "
116        "I've had a few in my jail."))
117
118 (define (edward-talk knpc kpc)
119   (say knpc "The prisoners are the only ones I can talk to down here."))
120
121 (define (edward-blin knpc kpc)
122   (say knpc "The dark doesn't bother me. Neither does the light, for that matter. "
123        "It's all the same to me."))
124
125 (define (edward-guar knpc kpc)
126   (say knpc "Truth be told, I'm not much of a guard."))
127
128 (define (edward-jail knpc kpc)
129   (cond ((in-player-party? 'ch_nate) (edward-give-nate knpc kpc))
130         (else
131          (say knpc "I feed the prisoners and swap stories with them. "
132               "I'm supposed to guard them, too. Prevent escapes.")
133          )))
134
135 (define edward-conv
136   (ifc ranger-conv
137        ;; default if the only "keyword" which may (indeed must!) be longer than
138        ;; 4 characters. The 4-char limit arises from the kernel's practice of
139        ;; truncating all player queries to the first four characters. Default,
140        ;; on the other hand, is a feature of the ifc mechanism (see ifc.scm).
141        (method 'default 
142                (lambda (knpc kpc) 
143                  (say knpc "[He shrugs]")))
144        (method 'hail edward-hail)
145        (method 'bye 
146                (lambda (knpc kpc) 
147                  (say knpc "Watch your step in the dark!")))
148        (method 'job 
149                (lambda (knpc kpc) 
150                  (say knpc "I'm the jailor.")))
151        (method 'name 
152                (lambda (knpc kpc) 
153                  (say knpc "I am Edward. And you already told me your name.")))
154        (method 'join 
155                (lambda (knpc kpc) 
156                  (say knpc "Love to. [But he doesn't]")))
157        (method 'accu edward-accu)
158        (method 'blin edward-blin)
159        (method 'esca edward-guar)
160        (method 'gate edward-gate)
161        (method 'gobl edward-gobl)
162        (method 'god  edward-gods)
163        (method 'gods edward-gods)
164        (method 'guar edward-guar)
165        (method 'jail edward-jail)
166        (method 'old  edward-gods)
167        (method 'pris edward-pris)
168        (method 'stor edward-stor)
169        (method 'talk edward-talk)
170        ))
171
172 ;;----------------------------------------------------------------------------
173 ;; First-time constructor
174 ;;----------------------------------------------------------------------------
175 (define (mk-edward)
176   (bind 
177    (kern-char-arm-self
178     (kern-mk-char 
179      'ch_edward ;;..........tag
180      "Edward" ;;.......name
181      sp_human ;;.....species
182      oc_ranger ;;.. .occupation
183      s_old_townsman ;;..sprite
184      faction-men ;;..faction
185      0 ;;...........custom strength modifier
186      0 ;;...........custom intelligence modifier
187      0 ;;...........custom dexterity modifier
188      0 ;;............custom base hp modifier
189      0 ;;............custom hp multiplier (per-level)
190      0 ;;............custom base mp modifier
191      0 ;;............custom mp multiplier (per-level)
192      max-health ;;..current hit points
193      -1  ;;...........current experience points
194      max-health ;;..current magic points
195      0
196      edward-start-lvl  ;;..current level
197      #f ;;...........dead?
198      'edward-conv ;;...conversation (optional)
199      sch_edward ;;.....schedule (optional)
200      'townsman-ai ;;..........custom ai (optional)
201
202      ;;..............container (and contents)
203      (mk-inventory
204       (list
205        (list 1 t_torch)
206        (list 1 t_dagger)
207        ))
208      (list t_armor_leather)                ; readied ;;.........readied arms (in addition to the container contents)
209      nil ;;..........hooks in effect
210      ))
211    (edward-mk)))