-
Notifications
You must be signed in to change notification settings - Fork 5
/
osample.adv
152 lines (131 loc) · 4.2 KB
/
osample.adv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
; OSAMPLE.ADV
;
; This is a VERY simple sample adventure that uses the "OBJECTS.ADI"
; runtime support code. It isn't interesting to play, but does illustrate
; most of the features of the adventure authoring system. Try compiling
; it using the command:
;
; A>ADVCOM OSAMPLE
;
; When the compile has finished, run the adventure using the command:
;
; A>ADVINT OSAMPLE
;
; You should then see the initial welcome message and a description of
; your initial location. You can use the direction names to move from
; one location to the next (or the abreviations N,S,E,W). You should try
; manipulating objects using TAKE and DROP. You can manipulate more than
; one at a time by using the conjunction AND. You can also GIVE an object
; to another creature like the DOG or CAT. You can instruct another
; creature to perform an action like:
;
; CAT, GIVE THE DOG THE KEY
;
; You can also experiment with using adjectives to distinguish between
; objects (there is more than one KEY in this adventure).
(adventure sample 1)
(define welcome "Welcome to the sample adventure.\n")
@objects.adi
(actor adventurer
(noun me)
(property
initial-location livingroom))
(actor dog
(noun dog)
(adjective small)
(property
description "There is a small dog here."
short-description "a small dog"
initial-location kitchen))
(actor cat
(noun cat)
(property
description "There is a cat here."
short-description "a cat"
initial-location kitchen))
(location storage-room
(property
description "You are in a small storage room with many empty shelves.
The only exit is a door to the west."
short-description "You are in the storage room."
west hallway)
(method (leave obj dir)
(if (send obj carrying? rusty-key)
(send-super leave obj dir)
(print "You seem to be missing something!\n"))))
(location hallway
(property
description "You are in a long narrow hallway. There is a door to the
east into a small dark room. There are also exits on both
the north and south ends of the hall."
short-description "You are in the hallway."
east storage-room
north kitchen
south livingroom))
(location kitchen
(property
description "This is a rather dusty kitchen. There is a hallway to the
south and a pantry to the west."
short-description "You are in the kitchen."
south hallway
west pantry))
(location pantry
(property
description "This is the kitchen pantry. The kitchen is through a
doorway to the east."
short-description "You are in the pantry."
east kitchen)
(method (enter obj)
(send-super enter obj)))
(location livingroom
(property
description "This appears to be the livingroom. There is a hallway to
the north and a closet to the west."
short-description "You are in the livingroom."
north hallway
west closet
south front-door-1))
(location outside
(property
description "You are outside a small house. The front door is to the
north."
short-description "You are outside."
north front-door-2))
(portal front-door
(noun door)
(adjective front)
(class-property
short-description "front door"
closed t
locked t
key rusty-key))
(front-door front-door-1
(property
initial-location livingroom
other-side front-door-2))
(front-door front-door-2
(property
initial-location outside
other-side front-door-1))
(location closet
(property
description "This is the livingroom closet. The livingroom is through
a doorway to the east."
short-description "You are in the closet."
east livingroom)
(method (enter obj)
(send-super enter obj)))
(thing rusty-key
(noun key)
(adjective rusty)
(property
description "There is a rusty key here."
short-description "a rusty key"
initial-location storage-room))
(thing silver-key
(noun key)
(adjective small silver)
(property
description "There is a small silver key here."
short-description "a small silver key"
initial-location closet))