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.2 by root, Fri Feb 3 07:25:25 2006 UTC vs.
Revision 1.8 by root, Tue Aug 29 08:01:36 2006 UTC

1/* 1/*
2 * static char *rcsid_define_h = 2 * static char *rcsid_define_h =
3 * "$Id: define.h,v 1.2 2006/02/03 07:25:25 root Exp $"; 3 * "$Id: define.h,v 1.8 2006/08/29 08:01:36 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
118 */ 118 */
119 119
120/* type 0 will be undefined and shows a non valid type information */ 120/* type 0 will be undefined and shows a non valid type information */
121 121
122#define PLAYER 1 122#define PLAYER 1
123/*#define BULLET 2 */ 123#define TRANSPORT 2 /* see doc/Developers/objects */
124#define ROD 3 124#define ROD 3
125#define TREASURE 4 125#define TREASURE 4
126#define POTION 5 126#define POTION 5
127#define FOOD 6 127#define FOOD 6
128#define POISON 7 128#define POISON 7
135#define BOW 14 135#define BOW 14
136#define WEAPON 15 136#define WEAPON 15
137#define ARMOUR 16 137#define ARMOUR 16
138#define PEDESTAL 17 138#define PEDESTAL 17
139#define ALTAR 18 139#define ALTAR 18
140#define CONFUSION 19 140/*#define CONFUSION 19 */
141#define LOCKED_DOOR 20 141#define LOCKED_DOOR 20
142#define SPECIAL_KEY 21 142#define SPECIAL_KEY 21
143#define MAP 22 143#define MAP 22
144#define DOOR 23 144#define DOOR 23
145#define KEY 24 145#define KEY 24
161#define PLAYERMOVER 40 161#define PLAYERMOVER 40
162#define TELEPORTER 41 162#define TELEPORTER 41
163#define CREATOR 42 163#define CREATOR 42
164#define SKILL 43 /* also see SKILL_TOOL (74) below */ 164#define SKILL 43 /* also see SKILL_TOOL (74) below */
165#define EXPERIENCE 44 /* This is basically obsolete now. It used to contain */ 165#define EXPERIENCE 44 /* This is basically obsolete now. It used to contain */
166 /* experience for broad skill categories. This value */ 166 /* experience for broad skill categories. This value */
167 /* is now automatically converteed at load time. */ 167 /* is now automatically converteed at load time. */
168#define EARTHWALL 45 168#define EARTHWALL 45
169#define GOLEM 46 169#define GOLEM 46
170/*#define BOMB 47 */ 170/*#define BOMB 47 */
171#define THROWN_OBJ 48 171#define THROWN_OBJ 48
172#define BLINDNESS 49 172#define BLINDNESS 49
173#define GOD 50 173#define GOD 50
174 174
175#define DETECTOR 51 /* peterm: detector is an object */ 175#define DETECTOR 51 /* peterm: detector is an object */
176 /* which notices the presense of */ 176 /* which notices the presense of */
177 /* another object and is triggered */ 177 /* another object and is triggered */
178 /* like buttons. */ 178 /* like buttons. */
179#define TRIGGER_MARKER 52 /* inserts an invisible, weightless */ 179#define TRIGGER_MARKER 52 /* inserts an invisible, weightless */
180 /* force into a player with a specified string WHEN TRIGGERED. */ 180 /* force into a player with a specified string WHEN TRIGGERED. */
181#define DEAD_OBJECT 53 181#define DEAD_OBJECT 53
182#define DRINK 54 182#define DRINK 54
183#define MARKER 55 /* inserts an invisible, weightless */ 183#define MARKER 55 /* inserts an invisible, weightless */
184 /* force into a player with a specified string. */ 184 /* force into a player with a specified string. */
185#define HOLY_ALTAR 56 185#define HOLY_ALTAR 56
186#define PLAYER_CHANGER 57 186#define PLAYER_CHANGER 57
187#define BATTLEGROUND 58 /* battleground, by Andreas Vogl */ 187#define BATTLEGROUND 58 /* battleground, by Andreas Vogl */
188 188
189#define PEACEMAKER 59 /* Object owned by a player which can convert */ 189#define PEACEMAKER 59 /* Object owned by a player which can convert */
190 /* a monster into a peaceful being incapable of attack. */ 190 /* a monster into a peaceful being incapable of attack. */
191#define GEM 60 191#define GEM 60
192/*#define FIRECHEST 61*/ /* FIRECHEST folded into FIREWALL */ 192/*#define FIRECHEST 61*/ /* FIRECHEST folded into FIREWALL */
193#define FIREWALL 62 193#define FIREWALL 62
194#define ANVIL 63 194#define ANVIL 63
195#define CHECK_INV 64 /* by b.t. thomas@nomad.astro.psu.edu */ 195#define CHECK_INV 64 /* by b.t. thomas@nomad.astro.psu.edu */
196#define MOOD_FLOOR 65 /* by b.t. thomas@nomad.astro.psu.edu 196#define MOOD_FLOOR 65 /* by b.t. thomas@nomad.astro.psu.edu
197 * values of last_sp set how to change: 197 * values of last_sp set how to change:
198 * 0 = furious, all monsters become aggressive 198 * 0 = furious, all monsters become aggressive
199 * 1 = angry, all but friendly become aggressive 199 * 1 = angry, all but friendly become aggressive
200 * 2 = calm, all aggressive monsters calm down 200 * 2 = calm, all aggressive monsters calm down
201 * 3 = sleep, all monsters fall asleep 201 * 3 = sleep, all monsters fall asleep
202 * 4 = charm, monsters become pets */ 202 * 4 = charm, monsters become pets */
203#define EXIT 66 203#define EXIT 66
204#define ENCOUNTER 67 204#define ENCOUNTER 67
205#define SHOP_FLOOR 68 205#define SHOP_FLOOR 68
206#define SHOP_MAT 69 206#define SHOP_MAT 69
207#define RING 70 207#define RING 70
282#define POWER_CRYSTAL 156 282#define POWER_CRYSTAL 156
283#define CORPSE 157 283#define CORPSE 157
284 284
285#define DISEASE 158 285#define DISEASE 158
286#define SYMPTOM 159 286#define SYMPTOM 159
287
288#define BUILDER 160 /* Generic item builder, see subtypes */ 287#define BUILDER 160 /* Generic item builder, see subtypes */
289#define MATERIAL 161 /* Material for building */ 288#define MATERIAL 161 /* Material for building */
290/* #define GPS 162 Ground positionning system, moved to Python plugin */ 289/* #define GPS 162 Ground positionning system, moved to Python plugin */
291#define ITEM_TRANSFORMER 163 /* Transforming one item with another */ 290#define ITEM_TRANSFORMER 163 /* Transforming one item with another */
292#define QUEST 164 /* See below for subtypes */ 291#define QUEST 164 /* See below for subtypes */
292#define SAFE_GROUND 165 /* This is a safe ground, means that neither bombs,
293 potions, alchemy, or magic works here (elmex) */
293/* END TYPE DEFINE */ 294/* END TYPE DEFINE */
295
296#define NUM_SUBTYPES 64 // maximum supported subtype number + 1, can be increased to 256
294 297
295/* Subtypes for BUILDER */ 298/* Subtypes for BUILDER */
296#define ST_BD_BUILD 1 /* Builds an item */ 299#define ST_BD_BUILD 1 /* Builds an item */
297#define ST_BD_REMOVE 2 /* Removes an item */ 300#define ST_BD_REMOVE 2 /* Removes an item */
298 301
418 * flags[2] is 64 to 95 421 * flags[2] is 64 to 95
419 * flags[3] is 96 to 127 422 * flags[3] is 96 to 127
420 */ 423 */
421/* Basic routines to do above */ 424/* Basic routines to do above */
422#define SET_FLAG(xyz, p) \ 425#define SET_FLAG(xyz, p) \
423 ((xyz)->flags[p/32] |= (1U << (p % 32))) 426 ((xyz)->flags[p/32] |= (1U << (p % 32)))
424#define CLEAR_FLAG(xyz, p) \ 427#define CLEAR_FLAG(xyz, p) \
425 ((xyz)->flags[p/32] &= ~(1U << (p % 32))) 428 ((xyz)->flags[p/32] &= ~(1U << (p % 32)))
426#define QUERY_FLAG(xyz, p) \ 429#define QUERY_FLAG(xyz, p) \
427 ((xyz)->flags[p/32] & (1U << (p % 32))) 430 ((xyz)->flags[p/32] & (1U << (p % 32)))
428#define COMPARE_FLAGS(p,q) \ 431#define COMPARE_FLAGS(p,q) \
429 ( \ 432 ( \
430 ((p)->flags[0] == (q)->flags[0]) && \ 433 ((p)->flags[0] == (q)->flags[0]) && \
431 ((p)->flags[1] == (q)->flags[1]) && \ 434 ((p)->flags[1] == (q)->flags[1]) && \
432 ((p)->flags[2] == (q)->flags[2]) && \ 435 ((p)->flags[2] == (q)->flags[2]) && \
433 ((p)->flags[3] == (q)->flags[3]) \ 436 ((p)->flags[3] == (q)->flags[3]) \
434 ) 437 )
435/* convenience macros to determine what kind of things we are dealing with */ 438/* convenience macros to determine what kind of things we are dealing with */
436 439
437#define IS_WEAPON(op) \ 440#define IS_WEAPON(op) \
438 (op->type == ARROW || op->type == BOW || op->type == WEAPON) 441 (op->type == ARROW || op->type == BOW || op->type == WEAPON)
439 442
440#define IS_ARMOR(op) \ 443#define IS_ARMOR(op) \
441 (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || \ 444 (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || \
442 op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || \ 445 op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || \
443 op->type == BRACERS || op->type == GIRDLE) 446 op->type == BRACERS || op->type == GIRDLE)
444 447
445#define IS_LIVE(op) \ 448#define IS_LIVE(op) \
446 ((op->type == PLAYER || QUERY_FLAG(op, FLAG_MONSTER) || \ 449 ((op->type == PLAYER || QUERY_FLAG(op, FLAG_MONSTER) || \
447 (QUERY_FLAG(op, FLAG_ALIVE) && !QUERY_FLAG(op, FLAG_GENERATOR) && \ 450 (QUERY_FLAG(op, FLAG_ALIVE) && !QUERY_FLAG(op, FLAG_GENERATOR) && \
448 !op->type == DOOR)) && (!QUERY_FLAG(op,FLAG_IS_A_TEMPLATE))) 451 !op->type == DOOR)) && (!QUERY_FLAG(op,FLAG_IS_A_TEMPLATE)))
449 452
450#define IS_ARROW(op) \ 453#define IS_ARROW(op) \
451 (op->type==ARROW || \ 454 (op->type==ARROW || \
452 (op->type==SPELL_EFFECT && \ 455 (op->type==SPELL_EFFECT && \
453 (op->subtype == SP_BULLET || op->subtype == SP_MAGIC_MISSILE))) 456 (op->subtype == SP_BULLET || op->subtype == SP_MAGIC_MISSILE)))
454 457
455/* This return TRUE if object has still randomitems which 458/* This return TRUE if object has still randomitems which
456 * could be expanded. 459 * could be expanded.
457 */ 460 */
458#define HAS_RANDOM_ITEMS(op) (op->randomitems && (!QUERY_FLAG(op,FLAG_IS_A_TEMPLATE))) 461#define HAS_RANDOM_ITEMS(op) (op->randomitems && (!QUERY_FLAG(op,FLAG_IS_A_TEMPLATE)))
508#define FLAG_NO_MAGIC 41 /* Spells (some) can't pass this object */ 511#define FLAG_NO_MAGIC 41 /* Spells (some) can't pass this object */
509#define FLAG_NO_FIX_PLAYER 42 /* fix_player() won't be called */ 512#define FLAG_NO_FIX_PLAYER 42 /* fix_player() won't be called */
510#define FLAG_IS_LIGHTABLE 43 /* object can be lit */ 513#define FLAG_IS_LIGHTABLE 43 /* object can be lit */
511#define FLAG_TEAR_DOWN 44 /* at->faces[hp*animations/maxhp] at hit */ 514#define FLAG_TEAR_DOWN 44 /* at->faces[hp*animations/maxhp] at hit */
512#define FLAG_RUN_AWAY 45 /* Object runs away from nearest player \ 515#define FLAG_RUN_AWAY 45 /* Object runs away from nearest player \
513 but can still attack at a distance */ 516 but can still attack at a distance */
514/*#define FLAG_PASS_THRU 46*/ /* Objects with can_pass_thru can pass \ 517/*#define FLAG_PASS_THRU 46*/ /* Objects with can_pass_thru can pass \
515 thru this object as if it wasn't there */ 518 thru this object as if it wasn't there */
516/*#define FLAG_CAN_PASS_THRU 47*/ /* Can pass thru... */ 519/*#define FLAG_CAN_PASS_THRU 47*/ /* Can pass thru... */
517 520
518#define FLAG_PICK_UP 48 /* Can pick up */ 521#define FLAG_PICK_UP 48 /* Can pick up */
519#define FLAG_UNIQUE 49 /* Item is really unique (UNIQUE_ITEMS) */ 522#define FLAG_UNIQUE 49 /* Item is really unique (UNIQUE_ITEMS) */
520#define FLAG_NO_DROP 50 /* Object can't be dropped */ 523#define FLAG_NO_DROP 50 /* Object can't be dropped */
571/*#define FLAG_DUST 95 *//* item is a 'powder', effects throwing */ 574/*#define FLAG_DUST 95 *//* item is a 'powder', effects throwing */
572 575
573/* Start of values in flags[3] */ 576/* Start of values in flags[3] */
574#define FLAG_NO_STEAL 96 /* Item can't be stolen */ 577#define FLAG_NO_STEAL 96 /* Item can't be stolen */
575#define FLAG_ONE_HIT 97 /* Monster can only hit once before going 578#define FLAG_ONE_HIT 97 /* Monster can only hit once before going
576 * away (replaces ghosthit) 579 * away (replaces ghosthit)
577 */ 580 */
578#define FLAG_CLIENT_SENT 98 /* THIS IS A DEBUG FLAG ONLY. We use it to 581#define FLAG_CLIENT_SENT 98 /* THIS IS A DEBUG FLAG ONLY. We use it to
579 * detect cases were the server is trying 582 * detect cases were the server is trying
580 * to send an upditem when we have not 583 * to send an upditem when we have not
581 * actually sent the item. 584 * actually sent the item.
582 */ 585 */
583 586
584#define FLAG_BERSERK 99 /* monster will attack closest living 587#define FLAG_BERSERK 99 /* monster will attack closest living
585 object */ 588 object */
586#define FLAG_NEUTRAL 100 /* monster is from type neutral */ 589#define FLAG_NEUTRAL 100 /* monster is from type neutral */
587#define FLAG_NO_ATTACK 101 /* monster don't attack */ 590#define FLAG_NO_ATTACK 101 /* monster don't attack */
588#define FLAG_NO_DAMAGE 102 /* monster can't be damaged */ 591#define FLAG_NO_DAMAGE 102 /* monster can't be damaged */
589#define FLAG_OBJ_ORIGINAL 103 /* NEVER SET THIS. Item was loaded by 592#define FLAG_OBJ_ORIGINAL 103 /* NEVER SET THIS. Item was loaded by
590 * load_original_map() */ 593 * load_original_map() */
591#define FLAG_OBJ_SAVE_ON_OVL 104 /* this object should be saved on 594#define FLAG_OBJ_SAVE_ON_OVL 104 /* this object should be saved on
592 * the overlay, and is not subject to 595 * the overlay, and is not subject to
593 * decay. */ 596 * decay. */
594#define FLAG_ACTIVATE_ON_PUSH 105 /* connected object is activated when 'pushed' */ 597#define FLAG_ACTIVATE_ON_PUSH 105 /* connected object is activated when 'pushed' */
595#define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */ 598#define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */
596#define FLAG_IS_WATER 107 599#define FLAG_IS_WATER 107
597#define FLAG_CONTENT_ON_GEN 108 600#define FLAG_CONTENT_ON_GEN 108
598#define FLAG_IS_A_TEMPLATE 109 /* Object has no ingame life until instanciated*/ 601#define FLAG_IS_A_TEMPLATE 109 /* Object has no ingame life until instanciated*/
627#define MOVE_WALK 0x1 /* Object walks */ 630#define MOVE_WALK 0x1 /* Object walks */
628#define MOVE_FLY_LOW 0x2 /* Low flying object */ 631#define MOVE_FLY_LOW 0x2 /* Low flying object */
629#define MOVE_FLY_HIGH 0x4 /* High flying object */ 632#define MOVE_FLY_HIGH 0x4 /* High flying object */
630#define MOVE_FLYING 0x6 /* Combo of fly_low and fly_high */ 633#define MOVE_FLYING 0x6 /* Combo of fly_low and fly_high */
631#define MOVE_SWIM 0x8 /* Swimming object */ 634#define MOVE_SWIM 0x8 /* Swimming object */
635#define MOVE_BOAT 0x10 /* Boats/sailing */
632#define MOVE_ALL 0xf /* Mask of all movement types */ 636#define MOVE_ALL 0x1f /* Mask of all movement types */
633 637
634/* the normal assumption is that objects are walking/flying. 638/* the normal assumption is that objects are walking/flying.
635 * So often we don't want to block movement, but still don't want 639 * So often we don't want to block movement, but still don't want
636 * to allow all types (swimming is rather specialized) - I also 640 * to allow all types (swimming is rather specialized) - I also
637 * expect as more movement types show up, this is likely to get 641 * expect as more movement types show up, this is likely to get
697#define EXIT_ALT_X(xyz) (xyz)->stats.maxhp 701#define EXIT_ALT_X(xyz) (xyz)->stats.maxhp
698#define EXIT_ALT_Y(xyz) (xyz)->stats.maxsp 702#define EXIT_ALT_Y(xyz) (xyz)->stats.maxsp
699 703
700/* for use by the lighting code */ 704/* for use by the lighting code */
701#define MAX_LIGHT_RADII 4 /* max radii for 'light' object, really 705#define MAX_LIGHT_RADII 4 /* max radii for 'light' object, really
702 * large values allow objects that can 706 * large values allow objects that can
703 * slow down the game */ 707 * slow down the game */
704#define MAX_DARKNESS 5 /* maximum map darkness, there is no 708#define MAX_DARKNESS 5 /* maximum map darkness, there is no
705 * practical reason to exceed this */ 709 * practical reason to exceed this */
706#define BRIGHTNESS(xyz) (xyz)->glow_radius>MAX_LIGHT_RADII? \ 710#define BRIGHTNESS(xyz) (xyz)->glow_radius>MAX_LIGHT_RADII? \
707 MAX_LIGHT_RADII:(xyz)->glow_radius; 711 MAX_LIGHT_RADII:(xyz)->glow_radius;
708 712
709#define F_BUY 0 713#define F_BUY 0
710#define F_SELL 1 714#define F_SELL 1
711#define F_TRUE 2 /* True value of item, unadjusted */ 715#define F_TRUE 2 /* True value of item, unadjusted */
712#define F_NO_BARGAIN 4 /* combine with F_BUY or F_SELL to disable bargaining calc */ 716#define F_NO_BARGAIN 4 /* combine with F_BUY or F_SELL to disable bargaining calc */
917 921
918 /* Optional flags, for bitwise or with a basic flag */ 922 /* Optional flags, for bitwise or with a basic flag */
919 AP_NO_MERGE = 16, 923 AP_NO_MERGE = 16,
920 AP_IGNORE_CURSE = 32, 924 AP_IGNORE_CURSE = 32,
921 AP_PRINT = 64 /* Print what to do, don't actually do it */ 925 AP_PRINT = 64 /* Print what to do, don't actually do it */
922 /* Note this is supported in all the functions */ 926 /* Note this is supported in all the functions */
923 927
924}; 928};
925 929
926/* Bitmask values for 'can_apply_object()' return values. 930/* Bitmask values for 'can_apply_object()' return values.
927 * the CAN_APPLY_ prefix is to just note what function the 931 * the CAN_APPLY_ prefix is to just note what function the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines