1;;----------------------------------------------------------------------------
2;; Constants
3;;----------------------------------------------------------------------------
4
5;;----------------------------------------------------------------------------
6;; Schedule
7;;
8;; In Glasdrin.
9;;----------------------------------------------------------------------------
10(kern-mk-sched 'sch_jess
11               (list 0  0  gj-bed      "sleeping")
12               (list 7  0  ghg-counter "working")
13               (list 9  0  g-fountain  "idle")
14               (list 10 0  ghg-counter "working")
15               (list 13 0  gc-hall     "idle")
16               (list 14 0  ghg-counter "working")
17               )
18
19;;----------------------------------------------------------------------------
20;; Gob
21;;----------------------------------------------------------------------------
22(define (jess-mk) (list 'townsman))
23
24;;----------------------------------------------------------------------------
25;; Conv
26;;
27;; Jess is the female proprietress of the Holy Grail tavern in Glasdrin.
28;; Her face is scarred, the result of an encounter with goblins
29;; when serving as a crossbowman in the Glasdrin militia.
30;;----------------------------------------------------------------------------
31
32;; Basics...
33(define (jess-hail knpc kpc)
34  (if (string=? "working" (kern-obj-get-activity knpc))
35      (say knpc "[You meet an otherwise attractive young woman with a hideous "
36           "scar on one side of her face]. Relax, gentlemen, you've finally "
37           "found the Holy Grail!")
38      (say knpc "[You meet an otherwise attractive young woman with a hideous "
39           "scar on one side of her face]. Nice day, isn't it?")))
40
41(define (jess-default knpc kpc)
42  (say knpc "Hm... I don't know."))
43
44(define (jess-name knpc kpc)
45  (if (working? knpc)
46      (say knpc "I'm Jess, proprieter of this here oasis.")
47      (say knpc "I'm Jess, proprieter of the Holy Grail. "
48           "Come by some time when you're thirsty.")))
49
50(define (jess-join knpc kpc)
51  (say knpc "No thanks, I get enough action throwing out drunks and "
52       "breaking up fights."))
53
54(define (jess-job knpc kpc)
55  (say knpc "I tempt the weak-minded with my wares. Care to see them?")
56  (if (kern-conv-get-yes-no? kpc)
57      (begin
58        (say knpc "[She winks] I thought you would!")
59        (jess-trade knpc kpc))
60      (say knpc "Too bad.")))
61
62(define (jess-bye knpc kpc)
63  (say knpc "So long, come back again!"))
64
65(define jess-catalog
66  (list
67   (list t_food 7  "The paladins love my roast beef.")
68   (list t_beer 12 "Have a grail-ful!")
69   ))
70
71(define jess-merch-msgs
72  (list "Come by the Holy Grail when I'm working. Breakfast is between 7:00AM and 9:00AM, lunch is 10:00AM to 1:00PM and I reopen at 2:00PM until midnight."
73        "Here's a menu!"
74        nil ;; sell
75        nil ;; trade
76        "Enjoy!" ;; sold-something
77        "Well, it beats hard-tack!" ;; sold-nothing
78        nil ;; the rest are nil
79        ))
80
81;; Trade...
82(define (jess-buy knpc kpc) (conv-trade knpc kpc "buy" jess-merch-msgs jess-catalog))
83
84;; Holy Grail
85(define (jess-grai knpc kpc)
86  (say knpc "According to legend, a Wanderer suggested the title. "
87       "It was based on a popular story in his home-world."))
88
89;; Scar
90(define (jess-scar knpc kpc)
91  (say knpc "I got that courtesy of some cave goblins and a guard who "
92       "couldn't stay awake. They ambushed us while we were sleeping, "
93       "I caught the edge of an axe with my cheek, but my helmet took "
94       "the worst of it. Do you like stories of battles?")
95  (if (kern-conv-get-yes-no? kpc)
96      (say knpc "Everyone in town has at least one. We've all served.")
97      (say knpc "Too bad, because this is the place to hear them.")))
98
99(define (jess-serv knpc kpc)
100  (say knpc "All citizens of Glasdrin must serve a tour of duty. "
101       "I was a crossbowman, my job was to support the heavy armor from "
102       "behind. My outfit served on the eastern marches of the Great Wood."))
103
104(define (jess-wood knpc kpc)
105  (say knpc "The rangers keep things pretty well in hand, but that year "
106       "the cave goblins and trolls were coming out in force."))
107
108;; Townspeople...
109(define (jess-glas knpc kpc)
110  (say knpc "It's a nice enough place, considering its an armed camp."))
111
112(define (jess-ange knpc kpc)
113  (say knpc "A nice lady. Not exactly a fighter, but she does her part."))
114
115(define (jess-patc knpc kpc)
116  (say knpc "Dirty old man! No, I'm just teasing him."))
117
118(define jess-conv
119  (ifc glasdrin-conv
120
121       ;; basics
122       (method 'default jess-default)
123       (method 'hail jess-hail)
124       (method 'bye  jess-bye)
125       (method 'job  jess-job)
126       (method 'name jess-name)
127       (method 'join jess-join)
128
129       ;; trade
130       (method 'grai jess-grai)
131       (method 'holy jess-grai)
132       (method 'trad jess-buy)
133       (method 'room jess-buy)
134       (method 'buy  jess-buy)
135       (method 'drin jess-buy)
136       (method 'ware jess-buy)
137       (method 'food jess-buy)
138
139       ;; scar
140       (method 'trade jess-buy)
141       (method 'scar  jess-scar)
142       (method 'serv  jess-serv)
143       (method 'wood  jess-wood)
144
145       ;; town & people
146       (method 'glas jess-glas)
147       (method 'ange jess-ange)
148       (method 'patc jess-patc)
149
150       ))
151
152(define (mk-jess)
153  (bind
154   (kern-mk-char 'ch_jess           ; tag
155                 "Jess"             ; name
156                 sp_human            ; species
157                 nil                 ; occ
158                 s_townswoman        ; sprite
159                 faction-glasdrin         ; starting alignment
160                 0 0 1               ; str/int/dex
161                 0 0                 ; hp mod/mult
162                 0 0                 ; mp mod/mult
163                 max-health -1 max-health 0 3  ; hp/xp/mp/AP_per_turn/lvl
164                 #f                  ; dead
165                 'jess-conv         ; conv
166                 sch_jess           ; sched
167                 'townsman-ai                 ; special ai
168                 (mk-inventory (list (list 1 t_dagger)))                 ; container
169                 nil                 ; readied
170                 )
171   (jess-mk)))
172