OSDN Git Service

a3acfe560f7fa1b6b41ef6b197dd9f6842836702
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / patch.scm
1 ;;----------------------------------------------------------------------------
2 ;; Constants
3 ;;----------------------------------------------------------------------------
4
5 ;;----------------------------------------------------------------------------
6 ;; Schedule
7 ;; 
8 ;; In Glasdrin
9 ;;----------------------------------------------------------------------------
10 (kern-mk-sched 'sch_patch
11                (list 0  0  gdp-bed "sleeping")
12                (list 7  0  ghg-s1  "eating")
13                (list 8  0  gh-ward "working")
14                (list 11 0  ghg-s1  "eating")
15                (list 12 0  gh-ward "working")
16                (list 17 0  ghg-s1  "eating")
17                (list 18 0  gc-hall "idle")
18                (list 21 0  gdp-hut "idle")
19                (list 22 0  gdp-bed "sleeping")
20                )
21
22 ;;----------------------------------------------------------------------------
23 ;; Gob
24 ;;----------------------------------------------------------------------------
25 (define (patch-mk) (list 'townsman))
26
27 ;;----------------------------------------------------------------------------
28 ;; Conv
29 ;; 
30 ;; An old wizard living in Glasdrin, who works as a healer.
31 ;; He wears an eyepatch, and is known as "Doc Patch".
32 ;;----------------------------------------------------------------------------
33
34 ;; Basics...
35 (define (patch-hail knpc kpc)
36   (say knpc "[You meet a sprightly old wizard with an eyepatch] "
37        "Hail, traveler."))
38
39 (define (patch-default knpc kpc)
40   (say knpc "I can't help you with that."))
41
42 (define (patch-name knpc kpc)
43   (say knpc "People call me Doc Patch."))
44
45 (define (patch-join knpc kpc)
46   (say knpc "No, my duty is here, Wanderer."))
47
48 (define (patch-job knpc kpc)
49   (say knpc "I run the hospital. Do you need healing?")
50   (if (kern-conv-get-yes-no? kpc)
51       (patch-trade knpc kpc)
52       (say knpc "Well if you ever do, I can fix you up.")))
53
54 (define (patch-bye knpc kpc)
55   (say knpc "Keep well!"))
56
57 ;; Trade...
58 (define (patch-trade knpc kpc)
59   (if (trade-services knpc kpc
60                       (list
61                        (svc-mk "Heal" 30 heal-service)
62                        (svc-mk "Cure" 30 cure-service)
63                        (svc-mk "Resurrect" 100 resurrect-service)))
64       (begin
65         (say knpc "What else can I do for you?")
66         (patch-trade knpc kpc))
67       (begin
68         (say knpc "Will there be anything else?")
69         (if (kern-conv-get-yes-no? kpc)
70             (patch-trade knpc kpc)
71             (say knpc "Very well.")))))
72   
73 ;; Patch...
74 (define (patch-patc knpc kpc)
75   (say knpc "I lost my eye in Kurpolis. It's so dark there I didn't really "
76        "need it. [He winks. With his good eye.]"))
77
78 (define (patch-kurp knpc kpc)
79   (say knpc "The paladins keep an outpost in the dungeon, and "
80        "I did a tour of duty down there in my youth."))
81
82 (define (patch-tour knpc kpc)
83   (say knpc "All citizens of Glasdrin are required to serve a tour of duty. "
84        "I was a medik."))
85
86 (define (patch-medi knpc kpc)
87   (say knpc "A medik is a mage that specializes in healing arts. Paladin "
88        "squads are all assigned a medik to support them in battle. "
89        "We get some basic combat training, but I only had to use my dagger "
90        "once."))
91
92 (define (patch-dagg knpc kpc)
93   (say knpc "Yep, I carried that dagger for six months and finally got to use "
94        "it... peeling potatoes for kitchen duty."))
95
96 (define (patch-dung knpc kpc)
97   (say knpc "Monsters breed in the deeps, and it's better to stop them there "
98        "before they can get to the surface. Don't you agree?")
99   (if (kern-conv-get-yes-no? kpc)
100       (say knpc "You're damned tootin'! So the paladins keep a company there "
101            "to patrol the middle levels. If you ever find yourself in need "
102            "of help down there, seek them out. They'll have a medik.")
103       (say knpc "Harumph! I suppose you'd rather let them run amok over "
104            "the countryside!")))
105
106 (define (patch-doc knpc kpc)
107   (say knpc "I'm a medik. Are you in need of healing?")
108   (if (kern-conv-get-yes-no? kpc)
109       (patch-trade knpc kpc)
110       (say knpc "Ok. Come by the hospital if you ever need assistance. "
111            "I know how you adventurers get torn up in fights!")))
112
113 (define (patch-hosp knpc kpc)
114   (say knpc "Yep. The paladins of Glasdrin are always getting in scraps. "
115        "I get the odd adventurer and sick villager in, too."))
116
117 ;; Townspeople...
118
119 (define patch-conv
120   (ifc glasdrin-conv
121
122        ;; basics
123        (method 'default patch-default)
124        (method 'hail patch-hail)
125        (method 'bye  patch-bye)
126        (method 'job  patch-job)
127        (method 'name patch-name)
128        (method 'join patch-join)
129        
130        ;; trade
131        (method 'trad patch-trade)
132        (method 'heal patch-trade)
133        (method 'cure patch-trade)
134        (method 'resu patch-trade)
135        (method 'help patch-trade)
136
137        ;; patch
138        (method 'patc patch-patc)
139        (method 'kurp patch-kurp)
140        (method 'tour patch-tour)
141        (method 'medi patch-medi)
142        (method 'dagg patch-dagg)
143        (method 'dung patch-dung)
144        (method 'doc  patch-doc)
145        (method 'hosp patch-hosp)
146        (method 'outp patch-dung)
147
148        ;; town & people
149
150        ))
151
152 (define (mk-patch)
153   (bind 
154    (kern-mk-char 'ch_patch           ; tag
155                  "Patch"             ; name
156                  sp_human            ; species
157                  oc_wizard           ; occ
158                  s_companion_wizard  ; sprite
159                  faction-glasdrin         ; starting alignment
160                  1 3 0               ; str/int/dex
161                  0 0                 ; hp mod/mult
162                  0 0                 ; mp mod/mult
163                  max-health -1 max-health 0 6            ; hp/xp/mp/AP_per_turn/lvl
164                  #f                  ; dead
165                  'patch-conv         ; conv
166                  sch_patch           ; sched
167                  'townsman-ai                 ; special ai
168                  (mk-inventory (list (list 1 t_staff)))                 ; container
169                  (list t_dagger)                 ; readied
170                  )
171    (patch-mk)))