Crossfire Server, Branch 1.12  R12190
Data Structures | Defines | Typedefs | Functions | Variables
define.h File Reference

Core defines: object types, flags, etc. More...

#include <autoconf.h>
Include dependency graph for define.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  typedata
 Link an object type with skill needed to identify, and general name. More...

Defines

#define ALLRUN   6
 Always run never attack good for sim.
#define ALTAR   18
 See Altar.
#define AMULET   39
 See Amulet.
#define AP_APPLY   1
 Item is to be applied.
#define AP_BASIC_FLAGS   15
#define AP_IGNORE_CURSE   32
 Apply/unapply regardless of cursed/damned status.
#define AP_NO_MERGE   16
 Don't try to merge object after (un)applying it.
#define AP_NOPRINT   128
 Don't print messages - caller will do that may be some that still print.
#define AP_NULL   0
 Nothing specific.
#define AP_PRINT   64
 Print what to do, don't actually do it Note this is supported in all the functions.
#define AP_UNAPPLY   2
 Item is to be remvoed.
#define ARMOUR   16
 See Breastplate Armor.
#define ARMOUR_IMPROVER   123
#define ARMOUR_SPEED(xyz)   (xyz)->last_sp
#define ARMOUR_SPELLS(xyz)   (xyz)->gen_sp_armour
#define ARROW   13
 See Projectile.
#define BATTLEGROUND   58
 battleground, by Andreas Vogl
#define BIG_NAME   32
#define BLANK_FACE_NAME   "blank.111"
#define BLINDNESS   49
#define BOOK   8
 See Book.
#define BOOTS   99
 See Boots.
#define BOW   14
 See Shooting Weapon.
#define BRACERS   104
 See Bracers.
#define BUILDER   160
 Generic item builder, see subtypes below.
#define BUTTON   92
 See Button.
#define CAN_APPLY_NEVER   0x1
#define CAN_APPLY_NOT_MASK   0xf
#define CAN_APPLY_RESTRICTION   0x2
#define CAN_APPLY_UNAPPLY   0x10
#define CAN_APPLY_UNAPPLY_CHOICE   0x40
#define CAN_APPLY_UNAPPLY_MULT   0x20
#define CF_HANDLE   93
 See Handle.
#define CHECK_INV   64
 b.t.
#define CIRCLE1   32
 If the upper four bits of move_type / attack_movement are set to this number, the monster will move in a circle until it is attacked, or the enemy field is set, this is good for non-aggressive monsters and NPC.
#define CIRCLE2   48
 Same as CIRCLE1 but a larger circle is used.
#define CLASS   37
 Object for applying character class modifications to someone.
#define CLEAR_FLAG(xyz, p)   ((xyz)->flags[p/32] &= ~(1U<<(p%32)))
#define CLOAK   87
 See Cloak.
#define CLOCK   9
 See Clock.
#define CLOSE_CON   121
 Eneq((at)csd.uu.se): Id for close_container archetype.
#define COMPARE_FLAGS(p, q)
#define CONTAINER   122
 See Container.
#define CONVERTER   103
 See Converter.
#define CORPSE   157
#define CREATOR   42
 See Creator.
#define DEAD_OBJECT   53
#define DEEP_SWAMP   138
 See Swamp.
#define DESCRIBE_ABILITY(retbuf, variable, name)
#define DESCRIBE_ABILITY_SAFE(retbuf, variable, name, len, maxlen)
#define DESCRIBE_PATH(retbuf, variable, name)
#define DESCRIBE_PATH_SAFE(retbuf, variable, name, len, maxlen)
#define DETECTOR   51
 peterm: detector is an object which notices the presense of another object and is triggered like buttons.
#define DIRECTOR   112
 See Director.
#define DIRX(xyz)   freearr_x[(xyz)->direction]
#define DIRY(xyz)   freearr_y[(xyz)->direction]
#define DISEASE   158
 See Disease.
#define DISTATT   1
 Move toward a player if far, but mantain some space, attack from a distance - good for missile users only.
#define DISTHIT   7
 Attack from a distance if hit as recommended by Frank.
#define DOOR   23
 See Door.
#define DRINK   54
#define DUPLICATOR   83
 Duplicator/multiplier object.
#define EARTHWALL   45
#define EMPTY_FACE_NAME   "empty.111"
#define ENCOUNTER   67
 See Floor (Encounter).
#define EVENT_CONNECTOR   116
 Lauwenmark: an invisible object holding a plugin event hook.
#define EXIT   66
 See Exit.
#define EXIT_ALT_X(xyz)   (xyz)->stats.maxhp
#define EXIT_ALT_Y(xyz)   (xyz)->stats.maxsp
#define EXIT_LEVEL(xyz)   (xyz)->stats.food
#define EXIT_PATH(xyz)   (xyz)->slaying
#define EXIT_X(xyz)   (xyz)->stats.hp
#define EXIT_Y(xyz)   (xyz)->stats.sp
#define EXPERIENCE   44
 This is basically obsolete now.
#define F_APPROX   32
 Flag to give a guess of item value.
#define F_BUY   0
 Item is being bought by player.
#define F_IDENTIFIED   8
 Flag to calculate value of identified item.
#define F_NO_BARGAIN   4
 Combine with F_BUY or F_SELL to disable bargaining calc.
#define F_NOT_CURSED   16
 Flag to calculate value of uncursed item.
#define F_SELL   1
 Item is being sold by player.
#define F_SHOP   64
 Consider the effect that the shop that the player is in has.
#define F_TRUE   2
 True value of item, unadjusted.
#define FABS(x)   ((x) < 0 ? -(x) : (x))
 Decstations have trouble with fabs()...
#define FAST_STRCAT(buf__, buf2__)   { memcpy(buf__, buf2__, strlen(buf2__)); buf__ += strlen(buf2__); }
#define FAST_STRNCAT(buf__, buf2__, size__)   { memcpy(buf__, buf2__, size__); buf__ += size__; }
#define FINISH_FASTCAT(buf__)   buf__[0] = '\0';
#define FIREWALL   62
 See Magic Wall.
#define FLAG_ACTIVATE_ON_PUSH   105
 connected object is activated when 'pushed'
#define FLAG_ACTIVATE_ON_RELEASE   106
 connected object is activated when 'released'
#define FLAG_AFK   111
 Player is AFK.
#define FLAG_ALIVE   0
 Object can fight (or be fought)
#define FLAG_ANIMATE   11
 The object looks at archetype for faces.
#define FLAG_APPLIED   5
 Object is ready for use by living.
#define FLAG_AUTO_APPLY   18
 Will be applied when created.
#define FLAG_BEEN_APPLIED   80
 The object has been applied.
#define FLAG_BERSERK   99
 monster will attack closest living object
#define FLAG_BLESSED   112
 Item has a blessing, opposite of cursed/damned.
#define FLAG_BLIND   92
 If set, object cannot see (visually)
#define FLAG_BLOCKSVIEW   35
 Object blocks view.
#define FLAG_CAN_ROLL   22
 Object can be rolled.
#define FLAG_CAN_USE_SKILL   79
 The monster can use skills.
#define FLAG_CAST_SPELL   52
 (Monster) can learn and cast spells
#define FLAG_CHANGING   31
 Changes to other_arch when anim is done.
#define FLAG_CLIENT_ANIM_RANDOM   10
 Client animate this, randomized.
#define FLAG_CLIENT_ANIM_SYNC   9
 Let client animate this, synchronized.
#define FLAG_CLIENT_SENT   98
 THIS IS A DEBUG FLAG ONLY.
#define FLAG_CONFUSED   70
 Will also be unable to cast spells.
#define FLAG_CONTENT_ON_GEN   108
#define FLAG_CURSED   74
 The object is cursed.
#define FLAG_DAMNED   75
 The object is _very_ cursed.
#define FLAG_DIALOG_PARSED   12
 Was the object::msg field parsed? Temporary flag not saved.
#define FLAG_FREED   3
 Object is in the list of free objects.
#define FLAG_FRIENDLY   15
 Will help players.
#define FLAG_GENERATOR   16
 Will generate type ob->stats.food.
#define FLAG_HITBACK   33
 Object will hit back when hit.
#define FLAG_IDENTIFIED   29
 Player knows full info about item.
#define FLAG_INV_LOCKED   86
 Item will not be dropped from inventory.
#define FLAG_IS_A_TEMPLATE   109
 Object has no ingame life until instantiated.
#define FLAG_IS_BUILDABLE   110
 Can build on item.
#define FLAG_IS_CAULDRON   94
 container can make alchemical stuff
#define FLAG_IS_FLOOR   63
 Can't see what's underneath this object.
#define FLAG_IS_HILLY   88
 Item is hilly/mountain terrain.
#define FLAG_IS_LIGHTABLE   43
 object can be lit
#define FLAG_IS_LINKED   73
 The object is linked with other objects.
#define FLAG_IS_THROWN   17
 Object is designed to be thrown.
#define FLAG_IS_TURNABLE   24
 Object can change face with direction.
#define FLAG_IS_USED_UP   28
 When (--food<0) the object will exit.
#define FLAG_IS_WATER   107
#define FLAG_IS_WOODED   87
 Item is wooded terrain.
#define FLAG_KNOWN_BLESSED   113
 Item is known to be blessed.
#define FLAG_KNOWN_CURSED   78
 The object is known to be cursed.
#define FLAG_KNOWN_MAGICAL   77
 The object is known to be magical.
#define FLAG_LIFESAVE   64
 Saves a players' life once, then destr.
#define FLAG_MAKE_INVIS   85
 (Item) gives invisibility when applied
#define FLAG_MONSTER   14
 Will attack players.
#define FLAG_NEUTRAL   100
 monster is from type neutral
#define FLAG_NO_APPLY   62
 Avoids step_on/fly_on to this object.
#define FLAG_NO_ATTACK   101
 monster don't attack
#define FLAG_NO_DAMAGE   102
 monster can't be damaged
#define FLAG_NO_DROP   50
 Object can't be dropped.
#define FLAG_NO_FIX_PLAYER   42
 fix_object() won't be called
#define FLAG_NO_MAGIC   41
 Spells (some) can't pass this object.
#define FLAG_NO_PICK   8
 Object can't be picked up.
#define FLAG_NO_SKILL_IDENT   91
 If set, item cannot be identified w/ a skill.
#define FLAG_NO_STEAL   96
 Item can't be stolen.
#define FLAG_NO_STRENGTH   65
 Strength-bonus not added to wc/dam.
#define FLAG_OBJ_ORIGINAL   103
 NEVER SET THIS.
#define FLAG_ONE_HIT   97
 Monster can only hit once before going away (replaces ghosthit)
#define FLAG_ONLY_ATTACK   69
 NPC will evaporate if there is no enemy.
#define FLAG_OVERLAY_FLOOR   23
 Object is an overlay floor.
#define FLAG_PLAYER_SOLD   20
 Object was sold to a shop by a player.
#define FLAG_RANDOM_MOVE   68
 NPC will move randomly.
#define FLAG_READY_BOW   60
 not implemented yet
#define FLAG_READY_RANGE   59
 (Monster) has a range attack readied...
#define FLAG_READY_SCROLL   81
 monster has scroll in inv and can use it
#define FLAG_READY_SKILL   89
 (Monster or Player) has a skill readied
#define FLAG_READY_WEAPON   90
 (Monster or Player) has a weapon readied
#define FLAG_REFL_MISSILE   39
 Arrows will reflect from object.
#define FLAG_REFL_SPELL   40
 Spells (some) will reflect from object.
#define FLAG_REFLECTING   30
 Object reflects from walls (lightning)
#define FLAG_REMOVED   2
 Object is not in any map or invenory.
#define FLAG_RUN_AWAY   45
 Object runs away from nearest player \ but can still attack at a distance.
#define FLAG_SCARED   37
 Monster is scared (mb player in future)
#define FLAG_SEE_ANYWHERE   76
 The object will be visible behind walls.
#define FLAG_SEE_IN_DARK   93
 if set ob not effected by darkness
#define FLAG_SEE_INVISIBLE   21
 Will see invisible player.
#define FLAG_SLEEP   66
 NPC is sleeping.
#define FLAG_SPLITTING   32
 Object splits into stats.food other objs.
#define FLAG_STAND_STILL   67
 NPC will not (ever) move.
#define FLAG_STARTEQUIP   34
 Object was given to player at start.
#define FLAG_STEALTH   71
 Will wake monsters with less range.
#define FLAG_TEAR_DOWN   44
 at->faces[hp*animations/maxhp] at hit
#define FLAG_TREASURE   19
 Will generate treasure when applied.
#define FLAG_UNAGGRESSIVE   38
 Monster doesn't attack players.
#define FLAG_UNDEAD   36
 Monster is undead.
#define FLAG_UNIQUE   49
 Item is really unique (UNIQUE_ITEMS)
#define FLAG_UNPAID   6
 Object hasn't been paid for yet.
#define FLAG_USE_ARMOUR   56
 (Monster) can wear armour/shield/helmet
#define FLAG_USE_BOW   55
 (Monster) can apply and fire bows
#define FLAG_USE_HORN   84
 (Monster) can apply and use horns
#define FLAG_USE_RANGE   54
 (Monster) can apply and use range items
#define FLAG_USE_RING   58
 (Monster) can use rings, boots, gauntlets, etc
#define FLAG_USE_ROD   82
 (Monster) can apply and use rods
#define FLAG_USE_SCROLL   53
 (Monster) can read scroll
#define FLAG_USE_SHIELD   7
 Can this creature use a shield?
#define FLAG_USE_WEAPON   57
 (Monster) can wield weapons
#define FLAG_WAS_WIZ   4
 Player was once a wiz.
#define FLAG_WIZ   1
 Object has special privilegies.
#define FLAG_WIZCAST   51
 The wizard can cast spells in no-magic area.
#define FLAG_WIZPASS   72
 The wizard can go through walls.
#define FLAG_XRAYS   61
 X-ray vision.
#define FLESH   72
 animal 'body parts' -b.t.
#define FLOOR   71
 Floor tile -> native layer 0.
#define FOOD   6
 See Food.
#define FORCE   114
#define GATE   91
 See Gate.
#define GEM   60
 See Jewel.
#define GENERATE_SPEED(xyz)   ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */
#define GENERATE_TYPE(xyz)   ((xyz)->stats.sp)
#define GIRDLE   113
 See Girdle.
#define GLOVES   100
 See Gloves.
#define GOD   50
#define GOLEM   46
#define GRIMREAPER   28
 See Monster (Grimreaper).
#define HAS_RANDOM_ITEMS(op)   (op->randomitems && (!QUERY_FLAG(op, FLAG_IS_A_TEMPLATE)))
 This return TRUE if object has still randomitems which could be expanded.
#define HELMET   34
 See Helmet.
#define HI4   240
#define HITRUN   3
 Run to then hit player then run away cyclicly.
#define HOLE   94 /* When open, objects fall through */
 See Pit.
#define HOLY_ALTAR   56
 See Holy Altar.
#define HORN   35
 See Horn.
#define HUGE_BUF   4096
 Used for messages - some can be quite long.
#define IDENTIFY_ALTAR   139
#define INORGANIC   73
 metals, minerals, dragon scales
#define IS_ARMOR(op)
#define IS_ARROW(op)
#define IS_LIVE(op)
#define IS_SHIELD(op)   (op->type == SHIELD)
#define IS_WEAPON(op)   (op->type == ARROW || op->type == BOW || op->type == WEAPON)
#define KEY   24
 See Key.
#define LAMP   82
 Lamp.
#define LIGHTER   75
#define LO4   15
 bitmasks for upper and lower 4 bits from 8 bit fields
#define LOCKED_DOOR   20
 See Locked Door.
#define MAGIC_EAR   29
 See Magic Ear.
#define MAP   22
#define MARKER   55
 inserts an invisible, weightless force into a player with a specified string.
#define MATERIAL   161
 Material for building.
#define MAX(x, y)   ((x) > (y) ? (x) : (y))
#define MAX_ANIMATIONS   256
#define MAX_BUF   256
 Used for all kinds of things.
#define MAX_DARKNESS   5
 Maximum map darkness, there is no practical reason to exceed this.
#define MAX_LIGHT_RADII   4
 Max radii for 'light' object, really large values allow objects that can slow down the game.
#define MAX_NAME   48
#define MAX_STAT   30
 The maximum legal value of any stat.
#define MAX_WEAPON_ITEM_POWER   100
 Maximum item power an item can have.
#define MIN(x, y)   ((x) < (y) ? (x) : (y))
#define MIN_ACTIVE_SPEED   0.00001
 Cut off point of when an object is put on the active list or not.
#define MIN_STAT   1
 The minimum legal value of any stat.
#define MISC_OBJECT   79
 misc.
#define MONEY   36
 See Money.
#define MONSTER   80
 A real, living creature.
#define MOOD_FLOOR   65
 b.t.
#define MOVE_ALL   0x1f
 Mask of all movement types.
#define MOVE_BLOCK_DEFAULT   MOVE_SWIM
 The normal assumption is that objects are walking/flying.
#define MOVE_BOAT   0x10
 Boats/sailing.
#define MOVE_FLY_HIGH   0x4
 High flying object.
#define MOVE_FLY_LOW   0x2
 Low flying object.
#define MOVE_FLYING   0x6
 Combo of fly_low and fly_high.
#define MOVE_SWIM   0x8
 Swimming object.
#define MOVE_WALK   0x1
 Object walks.
#define NAME_MAX   255
 NAME_MAX used by random maps may not be defined on pure ansi systems.
#define NROF_SOUNDS   (23+NROFREALSPELLS) /* Number of sounds */
#define NROFNEWOBJS(xyz)   ((xyz)->stats.food)
#define NUM_FLAGS   113
 Should always be equal to the last defined flag.
#define OB_MOVE_BLOCK(ob1, ob2)   ((ob1->move_type&ob2->move_block) == ob1->move_type)
 Basic macro to see if ob2 blocks ob1 from moving onto this space.
#define OB_TYPE_MOVE_BLOCK(ob1, type)   ((type != 0) && (ob1->move_type&type) == ob1->move_type)
 Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add check - if type is 0, don't stop anything from moving onto it.
#define OBJECT_TYPE_MAX   162
 Update if you add new types.
#define PACEH   64
 The monster will pace back and forth until attacked this is HORIZONTAL movement.
#define PACEH2   80
 The monster will pace as above but the length of the pace area is longer and the monster stops before changing directions this is HORIZONTAL movement.
#define PACEV   128
 The monster will pace back and forth until attacked this is VERTICAL movement.
#define PACEV2   144
 The monster will pace as above but the length of the pace area is longer and the monster stops before changing directions this is VERTICAL movement.
#define PEACEMAKER   59
 Object owned by a player which can convert a monster into a peaceful being incapable of attack.
#define PEDESTAL   17
 See Pedestal.
#define PETMOVE   16
 if the upper four bits of attack_movement are set to this number, the monster follows a player until the owner calls it back or off player followed denoted by 0b->owner the monster will try to attack whatever the player is attacking, and will continue to do so until the calls off the monster - a key command will be inserted to do so
#define PLAYER   1
#define PLAYER_CHANGER   57
#define PLAYERMOVER   40
 See Mover.
#define POISON   7
 See Poison Food.
#define POISONING   105
#define POTION   5
 See Potion.
#define POTION_EFFECT   115
 A force, holding the effect of a potion.
#define POWER_CRYSTAL   156
 See Power Crystal.
#define PREFER_HIGH   1
#define PREFER_LOW   0
#define PREPARE_FASTCAT(buf__)   buf__+strlen(buf__)
#define PU_ALLWEAPON   0x00020000
#define PU_ARMOUR   0x00000800
#define PU_ARROW   0x00000100
#define PU_BOOTS   0x00001000
#define PU_BOW   0x00000080
#define PU_CLOAK   0x00004000
#define PU_DEBUG   0x10000000
#define PU_DRINK   0x00000020
#define PU_FLESH   0x04000000
#define PU_FOOD   0x00000010
#define PU_GLOVES   0x00002000
#define PU_HELMET   0x00000200
#define PU_INHIBIT   0x20000000
#define PU_JEWELS   0x02000000
#define PU_KEY   0x00008000
#define PU_MAGIC_DEVICE   0x00800000
#define PU_MAGICAL   0x00040000
#define PU_MISSILEWEAPON   0x00010000
#define PU_NEWMODE   0x80000000
#define PU_NOT_CURSED   0x01000000
#define PU_NOTHING   0x00000000
#define PU_POTION   0x00080000
#define PU_RATIO   0x0000000F
#define PU_READABLES   0x00400000
#define PU_SHIELD   0x00000400
#define PU_SKILLSCROLL   0x00200000
#define PU_SPELLBOOK   0x00100000
#define PU_STOP   0x40000000
#define PU_VALUABLES   0x00000040
#define QUERY_FLAG(xyz, p)   ((xyz)->flags[p/32]&(1U<<(p%32)))
#define RANDO   96
 The monster will go in a random direction until it is stopped by an obstacle, then it chooses another direction.
#define RANDO2   112
 Constantly move in a different random direction.
#define RING   70
 See Ring.
#define ROD   3
 See Rod.
#define RUNATT   2
 Tun but attack if player catches up to object.
#define RUNE   154
 See Rune.
#define RUSH   5
 Rush toward player blindly, similiar to dumb monster.
#define SAVEBED   106
 See Savebed.
#define SCROLL   111
 See Scroll.
#define SET_FLAG(xyz, p)   ((xyz)->flags[p/32] |= (1U<<(p%32)))
#define SET_GENERATE_TYPE(xyz, va)   (xyz)->stats.sp = (va)
#define SHIELD   33
 See Shield.
#define SHOP_FLOOR   68
 See Shop Floor.
#define SHOP_INVENTORY   150
 Mark Wedel (mark@pyramid.com) Shop inventories.
#define SHOP_MAT   69
 See Shop Mat.
#define SIGN   98
 See Sign & Magic Mouth.
#define SIZEOFFREE   49
#define SIZEOFFREE1   8
#define SIZEOFFREE2   24
#define SKILL   43
 Also see SKILL_TOOL (74) below.
#define SKILL_TOOL   74
 Allows the use of a skill.
#define SKILLSCROLL   130
 can add a skill to player's inventory -bt.
#define SMOOTH_FACE_NAME   "default_smoothed.111"
#define SPECIAL_KEY   21
 See Special Key.
#define SPELL   101
 See Spell.
#define SPELL_EFFECT   102
#define SPELLBOOK   85
 See Spellbook.
#define SPINNER   90
 See Spinner.
#define ST_BD_BUILD   1
 Builds an item.
#define ST_BD_REMOVE   2
 Removes an item.
#define ST_CHANGE_CLASS   3
 New character, choosing class.
#define ST_CHANGE_PASSWORD_CONFIRM   13
 Player is confirming new password.
#define ST_CHANGE_PASSWORD_NEW   12
 Player is entering new password.
#define ST_CHANGE_PASSWORD_OLD   11
 Player is entering old password to change password.
#define ST_CONFIRM_PASSWORD   8
 New character, confirm password.
#define ST_CONFIRM_QUIT   4
 Player used the 'quit' command, make sure that's ok.
#define ST_GET_NAME   6
 Player just connected.
#define ST_GET_PARTY_PASSWORD   10
 Player tried to join a password-protected party.
#define ST_GET_PASSWORD   7
 Name entered, now for password.
#define ST_MAT_FLOOR   1
 Floor.
#define ST_MAT_ITEM   3
 Most other items, including doors & such.
#define ST_MAT_WALL   2
 Wall.
#define ST_MAT_WINDOW   4
 Window.
#define ST_PLAY_AGAIN   1
 Player left through a bed of reality, and can login again.
#define ST_PLAYING   0
 Usual state.
#define ST_ROLL_STAT   2
 New character, rolling stats.
#define SYMPTOM   159
#define TELEPORTER   41
 See Teleporter.
#define THROWN_OBJ   48
#define TIMED_GATE   26
 See Timed Gate.
#define TRANSPORT   2
 see doc/Developers/objects
#define TRAP   155
 See Trap.
#define TRAPDOOR   95
 See Trapdoor.
#define TREASURE   4
 See Treasure.
#define TRIGGER   27
 See Handle Trigger.
#define TRIGGER_ALTAR   31
 See Altar Trigger.
#define TRIGGER_BUTTON   30
 See Button Trigger.
#define TRIGGER_MARKER   52
 inserts an invisible, weightless force into a player with a specified string WHEN TRIGGERED.
#define TRIGGER_PEDESTAL   32
#define VERY_BIG_BUF   1024
#define WAIT2   8
 Monster does not try to move towards player if far maintains comfortable distance.
#define WAITATT   4
 Wait for player to approach then hit, move if hit.
#define WALL   77
 Wall.
#define WAND   109
 See Wand & Staff.
#define WEAP_BLUD   8
 bludgeoning, club, stick
#define WEAP_CLEAVE   3
 axe
#define WEAP_CRUSH   7
 big hammers, flails
#define WEAP_HIT   0
 the basic
#define WEAP_PIERCE   2
 arrows, stiletto
#define WEAP_SLASH   1
 slash
#define WEAP_SLICE   4
 katana
#define WEAP_STAB   5
 knife, dagger
#define WEAP_WHIP   6
 whips n chains
#define WEAPON   15
 See Weapon.
#define WEAPON_IMPROVER   124
#define WEAPON_SPEED(xyz)   (xyz)->last_sp
#define WEIGHT(op)   (op->nrof ? op->weight : op->weight+op->carrying)
 Returns the weight of the given object.
#define OUT_OF_MEMORY   0
 Fatal variables; used as arguments to fatal().
#define MAP_ERROR   1
#define ARCHTABLE_TOO_SMALL   2

Typedefs

typedef unsigned char MoveType
 Typdef here to define type large enough to hold bitmask of all movement types.
typedef struct typedata typedata
 Link an object type with skill needed to identify, and general name.

Functions

static void safe_strcat (char *dest, const char *orig, size_t *curlen, size_t maxlen)
 Simple function we use below to keep adding to the same string but also make sure we don't overwrite that string.

Variables

error Your ANSI C compiler
should be defining 
__STDC__

Detailed Description

Core defines: object types, flags, etc.

This file is really too large. With all the .h files around, this file should be better split between them - things that deal with objects should be in objects.h, things dealing with players in player.h, etc. As it is, everything just seems to be dumped in here.

This file is best viewed with a window width of about 100 character.

Definition in file define.h.


Define Documentation

#define ARCHTABLE_TOO_SMALL   2

Definition at line 96 of file define.h.

Referenced by add_arch().

#define ARMOUR_SPEED (   xyz)    (xyz)->last_sp

Definition at line 738 of file define.h.

Referenced by describe_item(), fix_object(), improve_armour(), and set_abs_magic().

#define ARMOUR_SPELLS (   xyz)    (xyz)->gen_sp_armour

Definition at line 739 of file define.h.

Referenced by describe_item().

#define BIG_NAME   32

Definition at line 88 of file define.h.

Referenced by check_score(), copy_score(), get_score(), kill_object(), and poison_type_apply().

#define BLANK_FACE_NAME   "blank.111"

Definition at line 828 of file define.h.

Referenced by read_bmap_names().

#define DESCRIBE_ABILITY (   retbuf,
  variable,
  name 
)
Value:
if (variable) {                                                \
        int i, j = 0;                                              \
        strcat(retbuf, "(" name ": ");                             \
        for (i = 0; i < NROFATTACKS; i++)                          \
            if (variable&(1<<i)) {                                 \
                if (j)                                             \
                    strcat(retbuf, ", ");                          \
                else                                               \
                    j = 1;                                         \
                strcat(retbuf, attacks[i]);                        \
            }                                                      \
        strcat(retbuf, ")");                                       \
    }

Definition at line 884 of file define.h.

Referenced by dump_gods().

#define DESCRIBE_ABILITY_SAFE (   retbuf,
  variable,
  name,
  len,
  maxlen 
)
Value:
if (variable) {                                                \
        int i, j = 0;                                              \
        safe_strcat(retbuf, "(" name ": ", len, maxlen);           \
        for (i = 0; i < NROFATTACKS; i++)                          \
            if (variable&(1<<i)) {                                 \
                if (j)                                             \
                    safe_strcat(retbuf, ", ", len, maxlen);        \
                else                                               \
                    j = 1;                                         \
                safe_strcat(retbuf, attacks[i], len, maxlen);      \
            }                                                      \
        safe_strcat(retbuf, ")", len, maxlen);                     \
    }

Definition at line 867 of file define.h.

Referenced by describe_item(), and describe_monster().

#define DESCRIBE_PATH (   retbuf,
  variable,
  name 
)
Value:
if (variable) {                                                \
        int i, j = 0;                                              \
        strcat(retbuf, "(" name ": ");                             \
        for (i = 0; i < NRSPELLPATHS; i++)                         \
            if (variable&(1<<i)) {                                 \
                if (j)                                             \
                    strcat(retbuf, ", ");                          \
                else                                               \
                    j = 1;                                         \
                strcat(retbuf, spellpathnames[i]);                 \
            }                                                      \
        strcat(retbuf, ")");                                       \
    }

Definition at line 899 of file define.h.

Referenced by dump_gods().

#define DESCRIBE_PATH_SAFE (   retbuf,
  variable,
  name,
  len,
  maxlen 
)
Value:
if (variable) {                                                \
        int i, j = 0;                                              \
        safe_strcat(retbuf, "(" name ": ", len, maxlen);           \
        for (i = 0; i < NRSPELLPATHS; i++)                         \
            if (variable&(1<<i)) {                                 \
                if (j)                                             \
                    safe_strcat(retbuf, ", ", len, maxlen);        \
                else                                               \
                    j = 1;                                         \
                safe_strcat(retbuf, spellpathnames[i], len, maxlen); \
            }                                                      \
        safe_strcat(retbuf, ")", len, maxlen);                     \
    }

Definition at line 914 of file define.h.

Referenced by describe_item(), describe_monster(), god_info_msg(), and ring_desc().

#define DIRX (   xyz)    freearr_x[(xyz)->direction]

Definition at line 735 of file define.h.

Referenced by common_process_projectile(), fire_bolt(), move_bolt(), move_bullet(), and move_missile().

#define DIRY (   xyz)    freearr_y[(xyz)->direction]

Definition at line 736 of file define.h.

Referenced by common_process_projectile(), fire_bolt(), move_bolt(), move_bullet(), and move_missile().

#define EMPTY_FACE_NAME   "empty.111"

Definition at line 829 of file define.h.

Referenced by read_bmap_names().

#define EXIT_ALT_X (   xyz)    (xyz)->stats.maxhp

Definition at line 702 of file define.h.

Referenced by op_on_battleground().

#define EXIT_ALT_Y (   xyz)    (xyz)->stats.maxsp

Definition at line 703 of file define.h.

Referenced by op_on_battleground().

#define EXIT_LEVEL (   xyz)    (xyz)->stats.food

Definition at line 699 of file define.h.

#define EXIT_PATH (   xyz)    (xyz)->slaying
#define EXIT_X (   xyz)    (xyz)->stats.hp
#define EXIT_Y (   xyz)    (xyz)->stats.sp
#define FABS (   x)    ((x) < 0 ? -(x) : (x))
#define GENERATE_SPEED (   xyz)    ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */

Definition at line 696 of file define.h.

Referenced by generate_monster().

#define GENERATE_TYPE (   xyz)    ((xyz)->stats.sp)

Definition at line 695 of file define.h.

Referenced by calculate_difficulty().

#define HAS_RANDOM_ITEMS (   op)    (op->randomitems && (!QUERY_FLAG(op, FLAG_IS_A_TEMPLATE)))

This return TRUE if object has still randomitems which could be expanded.

Definition at line 433 of file define.h.

Referenced by auto_apply(), do_auto_apply(), fix_auto_apply(), generate_monster_arch(), generate_monster_inv(), polymorph_living(), and rune_attack().

#define HUGE_BUF   4096
#define MAP_ERROR   1

Definition at line 95 of file define.h.

#define MAX (   x,
 
)    ((x) > (y) ? (x) : (y))
#define MAX_ANIMATIONS   256

Definition at line 85 of file define.h.

Referenced by init_anim().

#define MAX_BUF   256

Used for all kinds of things.

Definition at line 81 of file define.h.

Referenced by add_author(), add_exit_to_item(), add_object_to_socklist(), add_score(), add_shop_item(), adjust_sign_msg(), animate_weapon(), apply_anim_suffix(), apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), apply_changes_to_player(), apply_container(), apply_special(), artifact_msg(), attack_hth(), attack_message(), attempt_steal(), basic_emote(), blind_living(), book_type_apply(), calc_alch_danger(), can_pay(), cast_consecrate(), cast_identify(), cast_raise_dead_spell(), cast_spell(), cfapi_map_create_path(), cfapi_object_find_archetype_inside(), cfapi_object_forget_spell(), cfapi_object_set_property(), change_book(), change_exp(), change_spell(), check_login(), check_path(), check_race_restrictions(), check_score(), checkbanned(), checkdm(), choose_cult_monster(), command_addexp(), command_banish(), command_bowmode(), command_cast_spell(), command_cointoss(), command_create(), command_gsay(), command_help(), command_insert_into(), command_loadplugin(), command_mark(), command_me(), command_overlay_reset(), command_party(), command_players(), command_possess(), command_remove(), command_rename_item(), command_search_items(), command_statistics(), command_title(), command_use(), communicate(), compile_info(), content_recipe_value(), convert_newline(), converter_type_move_on(), copy_file(), create_archetype_by_object_name(), create_singularity(), dead_player(), delete_character(), describe_shop(), display_high_score(), display_motd(), display_who_entry(), do_server(), do_skill(), do_skill_attack(), do_skill_ident2(), do_talk_npc(), do_tell(), do_throw(), dragon_ability_gain(), dragon_eat_flesh(), drop_object(), dump_alchemy(), dump_alchemy_costs(), empty_container(), enter_fixed_template_map(), enter_random_template_map(), enter_unique_map(), esrv_draw_look(), esrv_update_item(), esrv_update_stats(), eventListener(), exit_type_apply(), find_key(), find_mon_throw_ob(), find_player(), find_throw_ob(), fire_misc_object(), fix_flesh_item(), fix_walls(), flush_output_element(), food_type_apply(), forbid_play(), form_party(), get_payment(), give_artifact_abilities(), god_enchants_weapon(), god_examines_item(), god_info_msg(), gravestone_text(), help_topics(), hit_with_one_attacktype(), i18n_init(), identify_altar_type_move_on(), init_anim(), init_artifacts(), init_attackmess(), init_book_archive(), init_clocks(), init_emergency_mappath(), init_experience(), init_formulae(), init_msgfile(), init_races(), init_regions(), init_server(), init_startup(), initPlugins(), inventory(), is_defined_recipe(), item_matched_string(), key_change_class(), key_confirm_quit(), kill_object(), kill_player(), leave(), lighter_type_apply(), load_archetypes(), load_materials(), load_original_map(), load_overlay_map(), load_settings(), load_temporary_map(), load_treasure(), load_treasures(), load_unique_objects(), look_at(), magic_wall(), main(), make_formula_book(), make_list_like(), make_path_to_file(), map_info(), mark_item_cmd(), matches_sacrifice(), metaserver2_init(), metaserver2_updates(), metaserver_init(), metaserver_update(), mon_info_msg(), move_symptom(), new_player_cmd(), npc_say(), nstrtok(), open_and_uncompress_file(), parse_regions(), perceive_self(), pick_up_object(), player_apply(), player_lvl_adj(), polymorph_melt(), pray(), print_shop_string(), process_map(), put_object_in_sack(), query_base_name(), rangetostring(), read_bmap_names(), read_face_data(), read_map_log(), read_smooth(), ready_map_name(), receive_party_password(), recharge(), recursive_roll(), remove_directory(), resurrect_player(), sack_can_hold(), save_life(), save_map(), save_player(), second_arch_pass(), sell_item(), send_news(), send_rules(), show_matching_spells(), show_skills(), singing(), skillscroll_type_apply(), SockList_ReadPacket(), spellbook_type_apply(), strtoktolin(), summon_golem(), tailor_god_spell(), transport_type_apply(), treasure_type_apply(), unapply_for_ob(), unapply_special(), use_alchemy(), use_oratory(), verify_player(), write_book_archive(), write_map_log(), write_npc_list(), write_regions_link(), write_rune(), write_scroll(), write_slaying_info(), write_socket_buffer(), Write_To_Socket(), write_todclock(), and write_world_info().

#define MAX_DARKNESS   5

Maximum map darkness, there is no practical reason to exceed this.

Definition at line 713 of file define.h.

Referenced by change_map_light(), and expand_lighted_sight().

#define MAX_LIGHT_RADII   4

Max radii for 'light' object, really large values allow objects that can slow down the game.

Definition at line 709 of file define.h.

Referenced by cast_light(), draw_client_map2(), expand_lighted_sight(), make_object_glow(), and stand_in_light().

#define MAX_NAME   48
#define MAX_STAT   30

The maximum legal value of any stat.

Definition at line 78 of file define.h.

Referenced by attempt_steal(), check_stat_bounds(), command_abil(), do_throw(), and pick_up_object().

#define MAX_WEAPON_ITEM_POWER   100

Maximum item power an item can have.

If changed, check object::item_power for overflow issues.

Definition at line 718 of file define.h.

Referenced by god_enchants_weapon(), and improve_weapon().

#define MIN (   x,
 
)    ((x) < (y) ? (x) : (y))
#define MIN_ACTIVE_SPEED   0.00001

Cut off point of when an object is put on the active list or not.

Definition at line 989 of file define.h.

Referenced by can_merge(), describe_monster(), local_check_loaded_object(), make_object_glow(), move_monster(), move_teleporter(), remove_all_pets(), START_TEST(), stop_item(), summon_object(), and update_ob_speed().

#define MIN_STAT   1

The minimum legal value of any stat.

Definition at line 79 of file define.h.

Referenced by check_stat_bounds().

#define NAME_MAX   255

NAME_MAX used by random maps may not be defined on pure ansi systems.

Definition at line 75 of file define.h.

Referenced by load_dir().

#define NROF_SOUNDS   (23+NROFREALSPELLS) /* Number of sounds */

Definition at line 406 of file define.h.

#define NROFNEWOBJS (   xyz)    ((xyz)->stats.food)

Definition at line 638 of file define.h.

Referenced by change_object(), and hit_player().

#define OUT_OF_MEMORY   0
#define PREFER_HIGH   1
#define PREFER_LOW   0
#define SET_GENERATE_TYPE (   xyz,
  va 
)    (xyz)->stats.sp = (va)

Definition at line 694 of file define.h.

#define SIZEOFFREE   49
#define SIZEOFFREE1   8

Definition at line 402 of file define.h.

Referenced by enter_map(), find_enclosed_spot(), get_search_arr(), and summon_golem().

#define SIZEOFFREE2   24

Definition at line 403 of file define.h.

Referenced by communicate(), enter_map(), and get_search_arr().

#define SMOOTH_FACE_NAME   "default_smoothed.111"

Definition at line 830 of file define.h.

Referenced by read_bmap_names().

#define VERY_BIG_BUF   1024
#define WEAPON_SPEED (   xyz)    (xyz)->last_sp

Definition at line 740 of file define.h.

Referenced by describe_item(), and fix_object().

#define WEIGHT (   op)    (op->nrof ? op->weight : op->weight+op->carrying)

Returns the weight of the given object.

Note: it does not take the number of items (nrof) into account.

Definition at line 1024 of file define.h.

Referenced by add_object_to_socklist(), do_server(), and esrv_update_item().


Typedef Documentation

typedef struct typedata typedata

Link an object type with skill needed to identify, and general name.


Function Documentation

static void safe_strcat ( char *  dest,
const char *  orig,
size_t *  curlen,
size_t  maxlen 
) [inline, static]

Simple function we use below to keep adding to the same string but also make sure we don't overwrite that string.

Parameters:
deststring to append to.
origstring to append.
[out]curlencurrent length of dest. Will be updated by this function.
maxlenmaximum length of dest buffer.

Definition at line 852 of file define.h.

Referenced by god_info_msg(), query_base_name(), query_name(), and query_short_name().

Here is the caller graph for this function:


Variable Documentation

error Your ANSI C compiler should be defining __STDC__

Definition at line 53 of file define.h.