File: items.txt

package info (click to toggle)
adonthell 0.3.5-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,228 kB
  • ctags: 4,563
  • sloc: cpp: 44,102; sh: 9,553; python: 1,902; makefile: 212; lex: 51; sed: 16
file content (90 lines) | stat: -rw-r--r-- 2,638 bytes parent folder | download | duplicates (9)
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
/*
    Copyright (C) 1999 The Adonthell Team.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY.
    See the COPYING file for more details.

*/

1) Item Structure

The item structure is:

typedef struct
{
	u_int16 number;
	u_int16 pattern;
	u_int16 event_walk;
	u_int16 event_action;
    lstr name;
    u_int8 status;
} item;

number: number of the item as stored in the items array
pattern: pattern of the item to be used in order to display it
event_walk: event that occurs when the character (or maybe any character) walks on the item (more on events further in this document).
event_action: event that occurs when the player is facing the item and when he presses the action key (more on events further in this document).
name: the name of the item
status: can be one of the following value
 ITEM_OPENED: the item can be opened/used etc... It can be closed as well
 ITEM_CLOSED: the item can be opened
 ITEM_UNLOCKED: the item can be opened. However, if an item that controls the operture of this item is removed from the inventory of the player, then the items status will go to ITEM_LOCKED
 ITEM_LOCKED: the item is unusable in this state. Getting an item that controls its opening decreases n. If n already equals 0, the the status of the item is changed to ITEM_UNLOCKED [+n], n can be any integer from 0: Dropping an item that controls the opening of this item increases n.

2) Item Events
The current available values for event_walk or event_action are currently:
EVENT_TELEPORT
EVENT_MODIF_PICT
EVENT_GET
EVENT_GET_KEY
EVENT_WALK_FLAG
EVENT_OPEN
EVENT_PLACE_ITEM

3) Item text file
# comment line
ITEM name_of_item
POS x y
EVENT event_type1 arg0 [arg1] [arg2...]
EVENT event_type2 arg0 [arg1] [...]
[EVENT etc.]
[OTHEREVENT]
END

event_type can be on of
TELEPORT
MODIF_PICT
GET
GET_KEY
WALK_FLAG
OPEN
ITEM_MAP

with the associated EVENT

4) Description of keywords
ITEM name_of_item
.
.
.
END

Those two keywords are used to describe an Item of name name_of_item and its associated characteristics.

POS x y
Sets up the position of the item on the map as beeing (x,y)

EVENT event_type1 arg0 [arg1] [arg2...]
EVENT event_type2 arg0 [arg1] [...]

This is the heart of the event script 

4) Description of events:
TELEPORT x y [x1 y1]
 indicates that the players teleports to (x,y). If the optional parameters x1 and y1 are indicated, it means that the new map will be centered on (x1,y1) instead of (x,y)

FRAMEFACTOR x
 changes the framefactor to x