ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/define.h
(Generate patch)

Comparing deliantra/server/include/define.h (file contents):
Revision 1.21 by elmex, Wed Dec 20 03:57:01 2006 UTC vs.
Revision 1.39 by root, Mon Jan 15 00:40:49 2007 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
3 3
4 Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
4 Copyright (C) 2003-2005 Mark Wedel & Crossfire Development Team 5 Copyright (C) 2003-2005 Mark Wedel & Crossfire Development Team
5 Copyright (C) 1992 Frank Tore Johansen 6 Copyright (C) 1992 Frank Tore Johansen
6 7
7 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
110 * flags 111 * flags
111 * Also, if you add new entries, try and fill up the holes in this list. 112 * Also, if you add new entries, try and fill up the holes in this list.
112 * Additionally, when you add a new entry, include it in the table in item.c 113 * Additionally, when you add a new entry, include it in the table in item.c
113 */ 114 */
114 115
115/* type 0 will be undefined and shows a non valid type information */ 116/* USED TYPES: (for dead types please look at the bottom of the type
117 * definitions)
118 */
119
120/* type 0 objects have the default behaviour */
116 121
117#define PLAYER 1 122#define PLAYER 1
118#define TRANSPORT 2 /* see pod/objects.pod */ 123#define TRANSPORT 2 /* see pod/objects.pod */
119#define ROD 3 124#define ROD 3
120#define TREASURE 4 125#define TREASURE 4
122#define FOOD 6 127#define FOOD 6
123#define POISON 7 128#define POISON 7
124#define BOOK 8 129#define BOOK 8
125#define CLOCK 9 130#define CLOCK 9
126 131
127/*#define FBULLET 10 */
128/*#define FBALL 11 */
129
130#define LIGHTNING 12
131#define ARROW 13 132#define ARROW 13
132#define BOW 14 133#define BOW 14
133#define WEAPON 15 134#define WEAPON 15
134#define ARMOUR 16 135#define ARMOUR 16
135#define PEDESTAL 17 136#define PEDESTAL 17
136#define ALTAR 18 137#define ALTAR 18
137 138
138/*#define CONFUSION 19 */
139
140#define LOCKED_DOOR 20 139#define LOCKED_DOOR 20
141#define SPECIAL_KEY 21 140#define SPECIAL_KEY 21
142#define MAP 22 141#define MAP 22
143#define DOOR 23 142#define DOOR 23
144#define KEY 24 143#define KEY 24
145
146/*#define MMISSILE 25 */
147 144
148#define TIMED_GATE 26 145#define TIMED_GATE 26
149#define TRIGGER 27 146#define TRIGGER 27
150#define GRIMREAPER 28 147#define GRIMREAPER 28
151#define MAGIC_EAR 29 148#define MAGIC_EAR 29
161#define AMULET 39 158#define AMULET 39
162#define PLAYERMOVER 40 159#define PLAYERMOVER 40
163#define TELEPORTER 41 160#define TELEPORTER 41
164#define CREATOR 42 161#define CREATOR 42
165#define SKILL 43 /* also see SKILL_TOOL (74) below */ 162#define SKILL 43 /* also see SKILL_TOOL (74) below */
166#define EXPERIENCE 44 /* This is basically obsolete now. It used to contain 163
167 * experience for broad skill categories. This value
168 * is now automatically converteed at load time.
169 */
170#define EARTHWALL 45 164#define EARTHWALL 45
171#define GOLEM 46 165#define GOLEM 46
172 166
173/*#define BOMB 47 */
174#define THROWN_OBJ 48 167#define THROWN_OBJ 48
175#define BLINDNESS 49 168#define BLINDNESS 49
176#define GOD 50 169#define GOD 50
177#define DETECTOR 51 /* peterm: detector is an object 170#define DETECTOR 51 /* peterm: detector is an object
178 * which notices the presense of 171 * which notices the presense of
193 186
194#define PEACEMAKER 59 /* Object owned by a player which can convert 187#define PEACEMAKER 59 /* Object owned by a player which can convert
195 * a monster into a peaceful being incapable of attack. 188 * a monster into a peaceful being incapable of attack.
196 */ 189 */
197#define GEM 60 190#define GEM 60
198
199/*#define FIRECHEST 61*/ /* FIRECHEST folded into FIREWALL */
200 191
201#define FIREWALL 62 192#define FIREWALL 62
202#define ANVIL 63 193#define ANVIL 63
203#define CHECK_INV 64 /* by b.t. thomas@nomad.astro.psu.edu */ 194#define CHECK_INV 64 /* by b.t. thomas@nomad.astro.psu.edu */
204#define MOOD_FLOOR 65 /* by b.t. thomas@nomad.astro.psu.edu 195#define MOOD_FLOOR 65 /* by b.t. thomas@nomad.astro.psu.edu
217#define FLESH 72 /* animal 'body parts' -b.t. */ 208#define FLESH 72 /* animal 'body parts' -b.t. */
218#define INORGANIC 73 /* metals and minerals */ 209#define INORGANIC 73 /* metals and minerals */
219#define SKILL_TOOL 74 /* Allows the use of a skill */ 210#define SKILL_TOOL 74 /* Allows the use of a skill */
220#define LIGHTER 75 211#define LIGHTER 75
221 212
222/* The trap_part, wall, light_source, misc_object, monster, and spawn_generator 213#define BUILDABLE_WALL 77 /* this is a buildable wall */
223 * types are not used in any archetypes, and should perhaps be removed.
224 */
225 214
226#define TRAP_PART 76 /* Needed by set traps skill -b.t. */
227 215
228#define WALL 77 /* this is a wall. put it always in layer 1 if not set is_floor */
229#define LIGHT_SOURCE 78 /* torches, lamps, etc. */
230#define MISC_OBJECT 79 /* misc. objects are for objects without a function 216#define MISC_OBJECT 79 /* misc. objects are for objects without a function
231 in the engine. Like statues, clocks, chairs,... 217 in the engine. Like statues, clocks, chairs,...
232 If perhaps we create a function where we can sit 218 If perhaps we create a function where we can sit
233 on chairs, we create a new type and remove all 219 on chairs, we create a new type and remove all
234 chairs from here. */ 220 chairs from here. */
235#define MONSTER 80 /* yes, thats a real, living creature */ 221
236#define SPAWN_GENERATOR 81 /* a spawn point or monster generator object */
237#define LAMP 82 /* a lamp */ 222#define LAMP 82 /* a lamp */
238#define DUPLICATOR 83 /* duplicator/multiplier object */ 223#define DUPLICATOR 83 /* duplicator/multiplier object */
239#define TOOL 84 /* a tool for building objects */ 224
240#define SPELLBOOK 85 225#define SPELLBOOK 85
241#define BUILDFAC 86 /* facilities for building objects */ 226
242#define CLOAK 87 227#define CLOAK 87
243
244/*#define CONE 88 */
245/*#define AURA 89 */ /* aura spell object */
246 228
247#define SPINNER 90 229#define SPINNER 90
248#define GATE 91 230#define GATE 91
249#define BUTTON 92 231#define BUTTON 92
250#define CF_HANDLE 93 232#define CF_HANDLE 93
251#define HOLE 94 233#define HOLE 94
252#define TRAPDOOR 95 234#define TRAPDOOR 95
253
254/*#define WORD_OF_RECALL 96 */
255/*#define PARAIMAGE 97 */
256 235
257#define SIGN 98 236#define SIGN 98
258#define BOOTS 99 237#define BOOTS 99
259#define GLOVES 100 238#define GLOVES 100
260#define SPELL 101 239#define SPELL 101
261#define SPELL_EFFECT 102 240#define SPELL_EFFECT 102
262#define CONVERTER 103 241#define CONVERTER 103
263#define BRACERS 104 242#define BRACERS 104
264#define POISONING 105 243#define POISONING 105
265#define SAVEBED 106 244#define SAVEBED 106
266#define POISONCLOUD 107 245
267#define FIREHOLES 108
268#define WAND 109 246#define WAND 109
269 247
270/*#define ABILITY 110*/
271#define SCROLL 111 248#define SCROLL 111
272#define DIRECTOR 112 249#define DIRECTOR 112
273#define GIRDLE 113 250#define GIRDLE 113
274#define FORCE 114 251#define FORCE 114
275#define POTION_EFFECT 115 /* a force, holding the effect of a potion */ 252#define POTION_EFFECT 115 /* a force, holding the effect of a potion */
278#define CLOSE_CON 121 /* Eneq(@csd.uu.se): Id for close_container archetype. */ 255#define CLOSE_CON 121 /* Eneq(@csd.uu.se): Id for close_container archetype. */
279#define CONTAINER 122 256#define CONTAINER 122
280#define ARMOUR_IMPROVER 123 257#define ARMOUR_IMPROVER 123
281#define WEAPON_IMPROVER 124 258#define WEAPON_IMPROVER 124
282 259
283/* unused: 125 - 129
284 * type 125 was MONEY_CHANGER
285 */
286
287#define SKILLSCROLL 130 /* can add a skill to player's inventory -bt. */ 260#define SKILLSCROLL 130 /* can add a skill to player's inventory -bt. */
288#define DEEP_SWAMP 138 261#define DEEP_SWAMP 138
289#define IDENTIFY_ALTAR 139 262#define IDENTIFY_ALTAR 139
290 263
291/*#define CANCELLATION 141 */ /* not used with new spell code */
292
293#define MENU 150 /* Mark Wedel (mark@pyramid.com) Shop inventories */ 264#define MENU 150 /* Mark Wedel (mark@pyramid.com) Shop inventories */
294
295/*#define BALL_LIGHTNING 151 */ /* peterm: ball lightning and color spray */
296/*#define SWARM_SPELL 153*/
297 265
298#define RUNE 154 266#define RUNE 154
299#define TRAP 155 267#define TRAP 155
300 268
301#define POWER_CRYSTAL 156 269#define POWER_CRYSTAL 156
304#define DISEASE 158 272#define DISEASE 158
305#define SYMPTOM 159 273#define SYMPTOM 159
306#define BUILDER 160 /* Generic item builder, see subtypes */ 274#define BUILDER 160 /* Generic item builder, see subtypes */
307#define MATERIAL 161 /* Material for building */ 275#define MATERIAL 161 /* Material for building */
308 276
309/* #define GPS 162 Ground positionning system, moved to Python plugin */
310#define ITEM_TRANSFORMER 163 /* Transforming one item with another */ 277#define ITEM_TRANSFORMER 163 /* Transforming one item with another */
311#define QUEST 164 /* See below for subtypes */ 278
312#define SAFE_GROUND 165 /* This is a safe ground, means that neither bombs, 279#define SAFE_GROUND 165 /* This is a safe ground, means that neither bombs,
313 potions, alchemy, or magic works here (elmex) */ 280 potions, alchemy, or magic works here (elmex) */
281
282/* DEAD TYPES: */
283//#define FBULLET 10
284//#define FBALL 11
285//#define LIGHTNING 12 // elmex: implemented by type 102 subtype 4
286//#define CONFUSION 19
287//#define MMISSILE 25
288/*#define EXPERIENCE 44*//* This is basically obsolete now. It used to contain
289 * experience for broad skill categories. This value
290 * is now automatically converteed at load time.
291 */
292//#define BOMB 47
293//#define FIRECHEST 61 /* FIRECHEST folded into FIREWALL */
294
295/* random crossfire developer: The trap_part, wall, light_source,
296 * misc_object, monster, and spawn_generator
297 * types are not used in any archetypes,
298 * and should perhaps be removed.
299 *
300 * Wed Dec 20 13:35:24 CET 2006:
301 * elmex: haha, removed TRAP_PART, LIGHT_SOURCE, MONSTER and SPAWN_GENERATOR now.
302 * monsters are marked by FLAG_MONSTER and generator with FLAG_GENERATOR.
303 * renamed WALL to BUILDABLE_WALL.
304 */
305
306//#define TRAP_PART 76 /* Needed by set traps skill -b.t. */
307//#define LIGHT_SOURCE 78 /* torches, lamps, etc. */
308//#define MONSTER 80 /* yes, thats a real, living creature */
309//#define SPAWN_GENERATOR 81 /* a spawn point or monster generator object */
310//#define TOOL 84 /* a tool for building objects */
311//#define BUILDFAC 86 /* facilities for building objects */
312//#define CONE 88
313//#define AURA 89 /* aura spell object */
314//#define WORD_OF_RECALL 96
315//#define PARAIMAGE 97
316//#define POISONCLOUD 107
317//#define FIREHOLES 108
318//#define ABILITY 110
319/* unused: 125 - 129
320 * type 125 was MONEY_CHANGER
321 */
322//#define CANCELLATION 141 /* not used with new spell code */
323//#define BALL_LIGHTNING 151 /* peterm: ball lightning and color spray */
324//#define SWARM_SPELL 153
325//#define GPS 162 /* Ground positionning system, moved to Python plugin */
326//#define QUEST 164 /* See below for subtypes */
314 327
315/* END TYPE DEFINE */ 328/* END TYPE DEFINE */
316 329
317#define NUM_SUBTYPES 64 // maximum supported subtype number + 1, can be increased to 256 330#define NUM_SUBTYPES 64 // maximum supported subtype number + 1, can be increased to 256
318 331
409 * If any FLAG's are added or changed, make sure the flag_names structure in 422 * If any FLAG's are added or changed, make sure the flag_names structure in
410 * common/loader.l is updated. 423 * common/loader.l is updated.
411 */ 424 */
412 425
413/* Basic routines to do above */ 426/* Basic routines to do above */
414#define SET_FLAG(obj, flag) (obj)->flags[flag] = 1 427#define SET_FLAG(obj, flg) (obj)->flag [flg] = 1
415#define CLEAR_FLAG(obj, flag) (obj)->flags[flag] = 0 428#define CLEAR_FLAG(obj, flg) (obj)->flag [flg] = 0
416#define QUERY_FLAG(obj, flag) (obj)->flags[flag] 429#define QUERY_FLAG(obj, flg) (obj)->flag [flg]
417 430
418/* the flags */ 431/* the flags */
419 432
420#define FLAG_ALIVE 0 /* Object can fight (or be fought) */ 433#define FLAG_ALIVE 0 /* Object can fight (or be fought) */
421#define FLAG_WIZ 1 /* Object has special privilegies */ 434#define FLAG_WIZ 1 /* Object has special privilegies */
568 object */ 581 object */
569#define FLAG_NEUTRAL 100 /* monster is from type neutral */ 582#define FLAG_NEUTRAL 100 /* monster is from type neutral */
570#define FLAG_NO_ATTACK 101 /* monster don't attack */ 583#define FLAG_NO_ATTACK 101 /* monster don't attack */
571#define FLAG_NO_DAMAGE 102 /* monster can't be damaged */ 584#define FLAG_NO_DAMAGE 102 /* monster can't be damaged */
572#define FLAG_OBJ_ORIGINAL 103 /* NEVER SET THIS. Item was loaded by 585#define FLAG_OBJ_ORIGINAL 103 /* NEVER SET THIS. Item was loaded by
573 * load_original_map() */ 586 * load_original_map() */
574#define FLAG_OBJ_SAVE_ON_OVL 104 /* this object should be saved on 587#define FLAG_OBJ_SAVE_ON_OVL 104 /* this object should be saved on
575 * the overlay, and is not subject to 588 * the overlay, and is not subject to
576 * decay. */ 589 * decay. */
577#define FLAG_ACTIVATE_ON_PUSH 105 /* connected object is activated when 'pushed' */ 590#define FLAG_ACTIVATE_ON_PUSH 105 /* connected object is activated when 'pushed' */
578#define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */ 591#define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */
579#define FLAG_IS_WATER 107 592#define FLAG_IS_WATER 107
580#define FLAG_CONTENT_ON_GEN 108 593#define FLAG_CONTENT_ON_GEN 108
581#define FLAG_IS_A_TEMPLATE 109 /* Object has no ingame life until instanciated */ 594#define FLAG_IS_A_TEMPLATE 109 /* Object has no ingame life until instanciated */
582#define FLAG_IS_BUILDABLE 110 /* Can build on item */ 595#define FLAG_IS_BUILDABLE 110 /* Can build on item */
583#define FLAG_AFK 111 /* Player is AFK */ 596#define FLAG_DESTROY_ON_DEATH 111 /* Object will be destroyed when env dies */
597#define FLAG_NO_SAVE 112 // item doesn't get saved with map
598
584#define NUM_FLAGS 111 /* Should always be equal to the last 599#define NUM_FLAGS 113 /* Should always be equal to the last
585 * defined flag. If you change this, 600 * defined flag + 1. If you change this,
586 * make sure you update the flag_links 601 * make sure you update the flag_links
587 * in common/loader.l 602 * in common/loader.l
588 */ 603 */
589 604
590/* Values can go up to 127 before the size of the flags array in the 605/* Values can go up to 127 before the size of the flags array in the
591 * object structure needs to be enlarged. 606 * object structure needs to be enlarged.
592 * So there are 18 available flags slots 607 * So there are 18 available flags slots
593 */ 608 */
645 * Add check - if type is 0, don't stop anything from moving 660 * Add check - if type is 0, don't stop anything from moving
646 * onto it. 661 * onto it.
647 * 662 *
648 */ 663 */
649#define OB_TYPE_MOVE_BLOCK(ob1, type) \ 664#define OB_TYPE_MOVE_BLOCK(ob1, type) \
650 ( (type != 0) && (ob1->move_type & type) == ob1->move_type) 665 ((type) && (ob1->move_type & type) == ob1->move_type)
651 666
652 667
653#define SET_GENERATE_TYPE(xyz,va) (xyz)->stats.sp=(va) 668#define SET_GENERATE_TYPE(xyz,va) (xyz)->stats.sp=(va)
654#define GENERATE_TYPE(xyz) ((xyz)->stats.sp) 669#define GENERATE_TYPE(xyz) ((xyz)->stats.sp)
655#define GENERATE_SPEED(xyz) ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */ 670#define GENERATE_SPEED(xyz) ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */
797 /* changing directions */ 812 /* changing directions */
798 /* this is VERTICAL movement */ 813 /* this is VERTICAL movement */
799#define LO4 15 /* bitmasks for upper and lower 4 bits from 8 bit fields */ 814#define LO4 15 /* bitmasks for upper and lower 4 bits from 8 bit fields */
800#define HI4 240 815#define HI4 240
801 816
802/*
803 * Use of the state-variable in player objects:
804 */
805
806#define ST_PLAYING 0
807#define ST_PLAY_AGAIN 1
808#define ST_ROLL_STAT 2
809#define ST_CHANGE_CLASS 3
810#define ST_CONFIRM_QUIT 4
811#define ST_CONFIGURE 5
812#define ST_GET_NAME 6
813#define ST_GET_PASSWORD 7
814#define ST_CONFIRM_PASSWORD 8
815#define ST_GET_PARTY_PASSWORD 10
816
817#define BLANK_FACE_NAME "blank.111" 817#define BLANK_FACE_NAME "blank.x11"
818#define EMPTY_FACE_NAME "empty.111" 818#define EMPTY_FACE_NAME "empty.x11"
819#define DARK_FACE1_NAME "dark1.111" 819#define DARK_FACE1_NAME "dark1.x11"
820#define DARK_FACE2_NAME "dark2.111" 820#define DARK_FACE2_NAME "dark2.x11"
821#define DARK_FACE3_NAME "dark3.111" 821#define DARK_FACE3_NAME "dark3.x11"
822#define SMOOTH_FACE_NAME "default_smoothed.111" 822#define SMOOTH_FACE_NAME "default_smoothed.111"
823 823
824/* 824/*
825 * Defines for the luck/random functions to make things more readable 825 * Defines for the luck/random functions to make things more readable
826 */ 826 */
965#define CAN_APPLY_UNAPPLY 0x10 965#define CAN_APPLY_UNAPPLY 0x10
966#define CAN_APPLY_UNAPPLY_MULT 0x20 966#define CAN_APPLY_UNAPPLY_MULT 0x20
967#define CAN_APPLY_UNAPPLY_CHOICE 0x40 967#define CAN_APPLY_UNAPPLY_CHOICE 0x40
968 968
969/* Cut off point of when an object is put on the active list or not */ 969/* Cut off point of when an object is put on the active list or not */
970#define MIN_ACTIVE_SPEED 0.00001 970#define MIN_ACTIVE_SPEED 1e-5
971 971
972/* 972/*
973 * random() is much better than rand(). If you have random(), use it instead. 973 * random() is much better than rand(). If you have random(), use it instead.
974 * You shouldn't need to change any of this 974 * You shouldn't need to change any of this
975 * 975 *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines