This repository has been archived by the owner on Feb 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgame.xml
294 lines (206 loc) · 9.44 KB
/
game.xml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<?xml version="1.0"?>
<game>
<!-- Section 0. Global Event Handlers and Scripts (optional) -->
<events>
<!-- identifies one or more scripts containing event handling functions -->
<script src="script/global1.lua"></script>
<!-- identifies a script function to call for a given event -->
<event name="beforeDropObject">sampleDropObject</event>
</events>
<!-- Section I. Player Configuration -->
<player>
<!-- configuration options related to the player's inventory -->
<inventory>
<!-- Determines the maximum weight of the inventory. 0 means the
inventory has unlimited size. Any integer greater than 0
determines the inventory's maximum capacity (consider this the
sum total of all object weights.) For example, if object "candle"
is defined with a weight of 2, and object "sword" is defined with
a weight of 10, and the inventory weight is defined to be 11, you
can then hold either the candle or the sword, but not both. What
integers you choose to use are totally up to you and are
completely subjective.
-->
<weight>0</weight>
</inventory>
<!-- By default, player attributes are distributed evenly (10 given to
each attribute.) Here, you can optionally set your own values, which
will be assigned by default to all new players. -->
<attributes>
<strength>10</strength>
<dexterity>10</dexterity>
<intelligence>10</intelligence>
</attributes>
<!-- whether or not creature starts out alive or dead (optional:
default is 1 for alive) -->
<alive>1</alive>
<!-- default starting health (optional: default is 0) -->
<health>10</health>
<!-- a max health of 0 means the creature is immortal (optional:
default is 0 for immortal) -->
<maxHealth>10</maxHealth>
<!-- default maximum probability of being hit during combat
(optional: default is 0.5) -->
<woundrate>0.5</woundrate>
</player>
<!-- Section II. Objects -->
<objects>
<!-- every object MUST HAVE a UNIQUE name -->
<object name="candle">
<!-- The user will see this description the first time they encounter the
object, or everytime they issue the command "look at candle."
-->
<description>
It appears to be a firey cylinder of wax burning with the passion of a thousand suns.
</description>
<!-- specifies an object's weight; not specifying this will default to
0, which means it has no weight. -->
<weight>1</weight>
<!-- messages for various events are defined here (pre-defined for the
engine or custom for scripts)
-->
<messages>
<message name="take">The candle jumps up into the air, does a backflip and turns into a spoon.</message>
<message name="drop">You hesitate before dropping that awesome waxy goodness.</message>
</messages>
<!-- one or more scripts can be attached to an object, which define
functions that get triggered by the event handler -->
<script src="script/object/candle.lua"></script>
<!-- event handlers (make sure functions are defined in scripts specific
to this object -->
<event name="beforeTakeObject">beforeTakeCandle</event>
<event name="beforeDropObject">beforeDropCandle</event>
<synonym>fire</synonym>
<synonym>flame</synonym>
</object>
<!-- owned by Trogdor the Burninator -->
<object name="stick">
<description>It's long, narrow and definitely looks like a stick.</description>
<weight>1</weight>
</object>
<object name="rock">
<description>
It's nothing special. It's gray, bumpy and a little lopsided.
</description>
<!-- this optional tag allows you to turn off the ability for the
player to drop an object. An object is droppable by default (you
can achieve the same effect manually by setting this to 1.) -->
<droppable>0</droppable>
<synonym>stone</synonym>
</object>
<object name="boulder">
<description>
It's a huge rock. You're not sure if you'll be able to lift it.
</description>
<weight>1</weight>
<!-- This optional tag allows you to turn off the player's ability to
take an object. An object is takeable by default (you can
achieve the same effect manually by setting this to 1.)-->
<takeable>0</takeable>
<synonym>rock</synonym>
<synonym>stone</synonym>
</object>
<object name="sword">
<description>
A smooth metallic sheen covers its surface, which looks to be of recent make and in good repair.
</description>
<!-- If set to 1, the object is a weapon (optional: default 0) -->
<weapon>1</weapon>
<!-- Amount of damage object does as a weapon (optional: default 1) -->
<damage>10</damage>
</object>
</objects>
<!-- Section III. Creatures -->
<creatures>
<creature name="trogdor">
<title>Trogdor the Burninator</title>
<description>
He stands 8 feet tall and breathes fire from his nostrils.
</description>
<allegiance>enemy</allegiance>
<!-- even if a creature is an enemy, we may or may not be allowed to
attack it (optional) -->
<attackable>1</attackable>
<!-- whether or not the creature will return each attack against it
with one of its own. (optional: default is 1 for true) -->
<counterattack>1</counterattack>
<!-- creature's maximum probability of being hit during combat
(optional: default is 0.5) -->
<woundrate>0.35</woundrate>
<!-- whether or not creature starts out alive or dead (optional:
default is 1 for alive) -->
<alive>1</alive>
<!-- default starting health (optional: default is 0) -->
<health>20</health>
<!-- a max health of 0 means the creature is immortal (optional:
default is 0 for immortal) -->
<maxHealth>25</maxHealth>
<!-- Creatures can also be given attributes that affect their behavior
(by default, creatures are given an even spread of 10 points
each.) This setting is optional. -->
<attributes>
<strength>10</strength>
<dexterity>10</dexterity>
<intelligence>10</intelligence>
</attributes>
<messages>
<message name="dead">Trogdor is very much dead.</message>
</messages>
<object>stick</object>
</creature>
</creatures>
<!-- Section IV. Rooms -->
<rooms>
<!-- every room MUST HAVE a UNIQUE name. One room MUST have the name
"start," which is where the player will start when the game begins.
-->
<room name="start">
<!-- user will see the room's title above its description -->
<title>The Palace</title>
<!-- user will see the room's description when they enter -->
<description>
You're standing in the middle of a sprawling white marble castle, the walls lined with portraits of long deceased ancestors of some forgotten king. Servants are bustling about, rushing around with steaming plates of meats and cooked vegetables, rushing in and out of rooms to serve princes and heads of state.
You peer off into the distance and notice a dark hole in the wall a little ways to the north.
</description>
<script src="script/room/start.lua"></script>
<event name="beforeRoomDisplay">beforeRoomSample</event>
<!-- name of the room north of this one -->
<north>cave</north>
<!-- we place the object "candle" in this room. Note that an object cannot
be in more than one room.
-->
<object>sword</object>
<object>candle</object>
<!-- you can define transition messages when you come to or go from
specific directions (two possible messages for each direction) -->
<messages>
<message name="fromNorth">Back to start from the cave!</message>
<message name="goNorth">Transitioning to the cave!</message>
</messages>
</room>
<room name="cave">
<title>The Cave</title>
<description>
You're in a dark musty cave. You see a light some ways off to the south. To the west, you spy a large dark chamber of some sort.
</description>
<!-- Since this room is north of "start," start is south of here. You
can specify one way movements by not placing this line here (maybe,
for example, the user got shut behind a trap door?)
-->
<west>chamber</west>
<south>start</south>
</room>
<room name="chamber">
<title>Dark Chamber</title>
<description>
You find yourself in a dark secluded chamber. Be careful. There may be nasty
things waiting for you here!
</description>
<east>cave</east>
<!-- you can place creatures in rooms -->
<creature>trogdor</creature>
<object>rock</object>
<object>boulder</object>
</room>
</rooms>
</game>