Crossfire Server, Trunk  1.75.0
define.h File Reference
#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...
 

Macros

#define AC_PLAYER_STAT_LIMIT   1
 Limit stats to racial maximum. More...
 
#define AC_PLAYER_STAT_NO_CHANGE   2
 Do not make any stat adjustments. More...
 
#define ALLRUN   6
 Always run, never attack good for sim. More...
 
#define AP_APPLY   1
 Item is to be applied. More...
 
#define AP_BASIC_FLAGS   15
 
#define AP_IGNORE_CURSE   32
 Apply/unapply regardless of cursed/damned status. More...
 
#define AP_NO_MERGE   16
 Don't try to merge object after (un)applying it. More...
 
#define AP_NOPRINT   128
 Don't print messages - caller will do that may be some that still print. More...
 
#define AP_NULL   0
 Nothing specific. More...
 
#define AP_OPEN   3
 Item is a container to be fully opened. More...
 
#define AP_PRINT   64
 Print what to do, don't actually do it Note this is supported in all the functions. More...
 
#define AP_UNAPPLY   2
 Item is to be remvoed. More...
 
#define ARMOUR_SPEED(xyz)   (xyz)->last_sp
 
#define ARMOUR_SPELLS(xyz)   (xyz)->gen_sp_armour
 
#define BIG_NAME   32
 
#define BLANK_FACE_NAME   "blank.111"
 
#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 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. More...
 
#define CIRCLE2   48
 Same as CIRCLE1 but a larger circle is used. More...
 
#define CLEAR_FLAG(xyz, p)   clear_flag(xyz, p)
 
#define DIRX(xyz)   freearr_x[(xyz)->direction]
 
#define DIRY(xyz)   freearr_y[(xyz)->direction]
 
#define DISTATT   1
 Move toward a player if far, but maintain some space, attack from a distance - good for missile users only. More...
 
#define DISTHIT   7
 Attack from a distance if hit as recommended by Frank. More...
 
#define EMPTY_FACE_NAME   "empty.111"
 
#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 FABS(x)   ((x) < 0 ? -(x) : (x))
 Decstations have trouble with fabs()... More...
 
#define FLAG_ACTIVATE_ON_PUSH   105
 connected object is activated when 'pushed' More...
 
#define FLAG_ACTIVATE_ON_RELEASE   106
 connected object is activated when 'released' More...
 
#define FLAG_AFK   111
 Player is AFK. More...
 
#define FLAG_ALIVE   0
 Object can fight (or be fought) More...
 
#define FLAG_ANIMATE   11
 The object looks at archetype for faces. More...
 
#define FLAG_APPLIED   5
 Object is ready for use by living. More...
 
#define FLAG_AUTO_APPLY   18
 Will be applied when created. More...
 
#define FLAG_BEEN_APPLIED   80
 Object was ever applied, for identification purposes. More...
 
#define FLAG_BERSERK   99
 monster will attack closest living object More...
 
#define FLAG_BLESSED   112
 Item has a blessing, opposite of cursed/damned. More...
 
#define FLAG_BLIND   92
 If set, object cannot see (visually) More...
 
#define FLAG_BLOCKSVIEW   35
 Object blocks view. More...
 
#define FLAG_CAN_ROLL   22
 Object can be rolled. More...
 
#define FLAG_CAN_USE_SKILL   79
 The monster can use skills. More...
 
#define FLAG_CAST_SPELL   52
 (Monster) can learn and cast spells More...
 
#define FLAG_CHANGING   31
 Changes to other_arch when anim is done. More...
 
#define FLAG_CLIENT_ANIM_RANDOM   10
 Client animate this, randomized. More...
 
#define FLAG_CLIENT_ANIM_SYNC   9
 Let client animate this, synchronized. More...
 
#define FLAG_CLIENT_SENT   98
 We use it to detect cases were the server is trying to send an upditem when we have not actually sent the item. More...
 
#define FLAG_CONFUSED   70
 Will also be unable to cast spells. More...
 
#define FLAG_CONTENT_ON_GEN   108
 
#define FLAG_CURSED   74
 The object is cursed. More...
 
#define FLAG_DAMNED   75
 The object is very cursed. More...
 
#define FLAG_DIALOG_PARSED   12
 Was the object::msg field parsed? Temporary flag not saved. More...
 
#define FLAG_FREED   3
 Object is in the list of free objects. More...
 
#define FLAG_FRIENDLY   15
 Will help players. More...
 
#define FLAG_GENERATOR   16
 Will generate type ob->stats.food. More...
 
#define FLAG_HITBACK   33
 Object will hit back when hit. More...
 
#define FLAG_IDENTIFIED   29
 Item is identifiable (e.g. More...
 
#define FLAG_INV_LOCKED   86
 Item will not be dropped from inventory. More...
 
#define FLAG_IS_A_TEMPLATE   109
 Object has no ingame life until instantiated. More...
 
#define FLAG_IS_BUILDABLE   110
 Can build on item. More...
 
#define FLAG_IS_CAULDRON   94
 container can make alchemical stuff More...
 
#define FLAG_IS_FLOOR   63
 Can't see what's underneath this object. More...
 
#define FLAG_IS_HILLY   88
 Item is hilly/mountain terrain. More...
 
#define FLAG_IS_LIGHTABLE   43
 object can be lit More...
 
#define FLAG_IS_LINKED   73
 The object is linked with other objects. More...
 
#define FLAG_IS_THROWN   17
 Object is designed to be thrown. More...
 
#define FLAG_IS_TURNABLE   24
 Object can change face with direction. More...
 
#define FLAG_IS_USED_UP   28
 When (–food<0) the object will exit. More...
 
#define FLAG_IS_WATER   107
 
#define FLAG_IS_WOODED   87
 Item is wooded terrain. More...
 
#define FLAG_KNOWN_BLESSED   113
 Item is known to be blessed. More...
 
#define FLAG_KNOWN_CURSED   78
 The object is known to be cursed. More...
 
#define FLAG_KNOWN_MAGICAL   77
 The object is known to be magical. More...
 
#define FLAG_LIFESAVE   64
 Saves a players' life once, then destr. More...
 
#define FLAG_MAKE_INVIS   85
 (Item) gives invisibility when applied More...
 
#define FLAG_MONSTER   14
 Will attack players. More...
 
#define FLAG_NEUTRAL   100
 monster is from type neutral More...
 
#define FLAG_NO_APPLY   62
 Avoids step_on/fly_on to this object. More...
 
#define FLAG_NO_ATTACK   101
 monster don't attack More...
 
#define FLAG_NO_DAMAGE   102
 monster can't be damaged More...
 
#define FLAG_NO_DROP   50
 Object can't be dropped. More...
 
#define FLAG_NO_FIX_PLAYER   42
 fix_object() won't be called More...
 
#define FLAG_NO_MAGIC   41
 Spells (some) can't pass this object. More...
 
#define FLAG_NO_PICK   8
 Object can't be picked up. More...
 
#define FLAG_NO_SAVE   13
 If set (through plugins), the object is not saved on maps. More...
 
#define FLAG_NO_SKILL_IDENT   91
 If set, item cannot be identified w/ a skill. More...
 
#define FLAG_NO_STEAL   96
 Item can't be stolen. More...
 
#define FLAG_NO_STRENGTH   65
 Strength-bonus not added to wc/dam. More...
 
#define FLAG_OBJ_ORIGINAL   103
 NEVER SET THIS. More...
 
#define FLAG_ONE_HIT   97
 Monster can only hit once before going away (replaces ghosthit) More...
 
#define FLAG_ONLY_ATTACK   69
 NPC will evaporate if there is no enemy. More...
 
#define FLAG_OVERLAY_FLOOR   23
 Object is an overlay floor. More...
 
#define FLAG_PARALYZED   114
 Monster or player is paralyzed. More...
 
#define FLAG_PLAYER_SOLD   20
 Object was sold to a shop by a player. More...
 
#define FLAG_PROBE   25
 Object displays HP information to player. More...
 
#define FLAG_RANDOM_MOVE   68
 NPC will move randomly. More...
 
#define FLAG_READY_BOW   60
 not implemented yet More...
 
#define FLAG_READY_RANGE   59
 (Monster) has a range attack readied... More...
 
#define FLAG_READY_SCROLL   81
 monster has scroll in inv and can use it More...
 
#define FLAG_READY_SKILL   89
 (Monster or Player) has a skill readied More...
 
#define FLAG_READY_WEAPON   90
 (Monster or Player) has a weapon readied More...
 
#define FLAG_REFL_MISSILE   39
 Arrows will reflect from object. More...
 
#define FLAG_REFL_SPELL   40
 Spells (some) will reflect from object. More...
 
#define FLAG_REFLECTING   30
 Object reflects from walls (lightning) More...
 
#define FLAG_REMOVED   2
 Object is not in any map or invenory. More...
 
#define FLAG_RUN_AWAY   45
 Object runs away from nearest player \ but can still attack at a distance. More...
 
#define FLAG_SCARED   37
 Monster is scared (mb player in future) More...
 
#define FLAG_SEE_ANYWHERE   76
 The object will be visible behind walls. More...
 
#define FLAG_SEE_IN_DARK   93
 if set ob not effected by darkness More...
 
#define FLAG_SEE_INVISIBLE   21
 Will see invisible player. More...
 
#define FLAG_SLEEP   66
 NPC is sleeping. More...
 
#define FLAG_SPLITTING   32
 Object splits into stats.food other objs. More...
 
#define FLAG_STAND_STILL   67
 NPC will not (ever) move. More...
 
#define FLAG_STARTEQUIP   34
 Object was given to player at start. More...
 
#define FLAG_STEALTH   71
 Will wake monsters with less range. More...
 
#define FLAG_TEAR_DOWN   44
 at->faces[hp*animations/maxhp] at hit More...
 
#define FLAG_TREASURE   19
 Will generate treasure when applied. More...
 
#define FLAG_UNAGGRESSIVE   38
 Monster doesn't attack players. More...
 
#define FLAG_UNDEAD   36
 Monster is undead. More...
 
#define FLAG_UNIQUE   49
 Item is really unique (UNIQUE_ITEMS) More...
 
#define FLAG_UNPAID   6
 Object hasn't been paid for yet. More...
 
#define FLAG_USE_ARMOUR   56
 (Monster) can wear armour/shield/helmet More...
 
#define FLAG_USE_BOW   55
 (Monster) can apply and fire bows More...
 
#define FLAG_USE_RANGE   54
 (Monster) can apply and use range items More...
 
#define FLAG_USE_RING   58
 (Monster) can use rings, boots, gauntlets, etc More...
 
#define FLAG_USE_SCROLL   53
 (Monster) can read scroll More...
 
#define FLAG_USE_SHIELD   7
 Can this creature use a shield? More...
 
#define FLAG_USE_WEAPON   57
 (Monster) can wield weapons More...
 
#define FLAG_WAS_WIZ   4
 Player was once a wiz. More...
 
#define FLAG_WIZ   1
 Object has special privilegies. More...
 
#define FLAG_WIZCAST   51
 The wizard can cast spells in no-magic area. More...
 
#define FLAG_WIZPASS   72
 The wizard can go through walls. More...
 
#define FLAG_XRAYS   61
 X-ray vision. More...
 
#define FOR_ABOVE_FINISH()
 Finishes FOR_ABOVE_PREPARE(). More...
 
#define FOR_ABOVE_PREPARE(op_, it_)
 Constructs a loop iterating over all objects above an object. More...
 
#define FOR_BELOW_FINISH()
 Finishes FOR_BELOW_PREPARE(). More...
 
#define FOR_BELOW_PREPARE(op_, it_)
 Constructs a loop iterating over all objects below an object. More...
 
#define FOR_INV_FINISH()
 Finishes FOR_INV_PREPARE(). More...
 
#define FOR_INV_PREPARE(op_, it_)
 Constructs a loop iterating over the inventory of an object. More...
 
#define FOR_MAP_FINISH()
 Finishes FOR_MAP_PREPARE(). More...
 
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
 Constructs a loop iterating over all objects of a map tile. More...
 
#define FOR_OB_AND_ABOVE_FINISH()   FOR_OB_FINISH()
 Finishes FOR_OB_AND_ABOVE_PREPARE(). More...
 
#define FOR_OB_AND_ABOVE_PREPARE(op_)   FOR_OB_PREPARE(op_, above, __LINE__)
 Constructs a loop iterating over an object and all objects above it in the same pile. More...
 
#define FOR_OB_AND_BELOW_FINISH()   FOR_OB_FINISH()
 Finishes FOR_OB_AND_BELOW_PREPARE(). More...
 
#define FOR_OB_AND_BELOW_PREPARE(op_)   FOR_OB_PREPARE(op_, below, __LINE__)
 Constructs a loop iterating over an object and all objects below it in the same pile. More...
 
#define FOR_OB_FINISH()
 Finishes FOR_OB_PREPARE(). More...
 
#define FOR_OB_PREPARE(op_, field_, suffix_)   FOR_OB_PREPARE2(op_, field_, suffix_)
 Constructs a loop iterating over a set of objects. More...
 
#define FOR_OB_PREPARE2(op_, field_, suffix_)
 Constructs a loop iterating over a set of objects. More...
 
#define GENERATE_SPEED(xyz)   ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */
 
#define GENERATE_TYPE(xyz)   ((xyz)->stats.sp)
 
#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. More...
 
#define HI4   240
 
#define HITRUN   3
 Run to then hit player then run away cyclicly. More...
 
#define HUGE_BUF   4096
 Used for messages - some can be quite long. More...
 
#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 LO4   15
 bitmasks for upper and lower 4 bits from 8 bit fields More...
 
#define MAX_ANIMATIONS   256
 
#define MAX_BUF   256
 Used for all kinds of things. More...
 
#define MAX_DARKNESS   5
 Maximum map darkness, there is no practical reason to exceed this. More...
 
#define MAX_LIGHT_RADII   4
 Max radii for 'light' object, really large values allow objects that can slow down the game. More...
 
#define MAX_NAME   48
 
#define MAX_WEAPON_ITEM_POWER   100
 Maximum item power an item can have. More...
 
#define MIN_ACTIVE_SPEED   0.00001
 Cut off point of when an object is put on the active list or not. More...
 
#define MIN_STAT   1
 The minimum legal value of any stat. More...
 
#define MOVE_ALL   0x1f
 Mask of all movement types. More...
 
#define MOVE_BLOCK_DEFAULT   MOVE_SWIM
 The normal assumption is that objects are walking/flying. More...
 
#define MOVE_BOAT   0x10
 Boats/sailing. More...
 
#define MOVE_FLY_HIGH   0x4
 High flying object. More...
 
#define MOVE_FLY_LOW   0x2
 Low flying object. More...
 
#define MOVE_FLYING   0x6
 Combo of fly_low and fly_high. More...
 
#define MOVE_SWIM   0x8
 Swimming object. More...
 
#define MOVE_WALK   0x1
 Object walks. More...
 
#define NAME_MAX   255
 NAME_MAX used by random maps may not be defined on pure ansi systems. More...
 
#define NROF_SOUNDS   (23+NROFREALSPELLS) /* Number of sounds */
 
#define NUM_FLAGS   114
 Should always be equal to the last defined flag. More...
 
#define OB_MOVE_BLOCK(ob1, ob2)   ob_move_block(ob1, ob2)
 
#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. More...
 
#define PACEH   64
 The monster will pace back and forth until attacked. More...
 
#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. More...
 
#define PACEV   128
 The monster will pace back and forth until attacked. More...
 
#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. More...
 
#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 ob->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. More...
 
#define PREFER_HIGH   1
 
#define PREFER_LOW   0
 
#define PU_ARMOUR   0x00000800
 
#define PU_ARROW   0x00000100
 
#define PU_BOOTS   0x00001000
 
#define PU_BOW   0x00000080
 
#define PU_CLOAK   0x00004000
 
#define PU_CONTAINER   0x08000000
 
#define PU_CURSED   0x10000000
 
#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_MELEEWEAPON   0x00020000
 
#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)   query_flag(xyz, p)
 
#define RANDO   96
 The monster will go in a random direction until it is stopped by an obstacle, then it chooses another direction. More...
 
#define RANDO2   112
 Constantly move in a different random direction. More...
 
#define RANDOM()   cf_random()
 
#define RUNATT   2
 Run but attack if player catches up to object. More...
 
#define RUSH   5
 Rush toward player blindly, similiar to dumb monster. More...
 
#define SET_FLAG(xyz, p)   set_flag(xyz, p)
 
#define SIZEOFFREE   49
 
#define SIZEOFFREE1   8
 
#define SIZEOFFREE2   24
 
#define SMOOTH_FACE_NAME   "default_smoothed.111"
 
#define SRANDOM(seed)   cf_srandom(seed)
 
#define ST_BD_BUILD   1
 Builds an item. More...
 
#define ST_BD_REMOVE   2
 Removes an item. More...
 
#define ST_CHANGE_CLASS   3
 New character, choosing class. More...
 
#define ST_CHANGE_PASSWORD_CONFIRM   13
 Player is confirming new password. More...
 
#define ST_CHANGE_PASSWORD_NEW   12
 Player is entering new password. More...
 
#define ST_CHANGE_PASSWORD_OLD   11
 Player is entering old password to change password. More...
 
#define ST_CONFIRM_PASSWORD   8
 New character, confirm password. More...
 
#define ST_CONFIRM_QUIT   4
 Player used the 'quit' command, make sure that's ok. More...
 
#define ST_GET_NAME   6
 Player just connected. More...
 
#define ST_GET_PARTY_PASSWORD   10
 Player tried to join a password-protected party. More...
 
#define ST_GET_PASSWORD   7
 Name entered, now for password. More...
 
#define ST_MAT_FLOOR   1
 Floor. More...
 
#define ST_MAT_ITEM   3
 Most other items, including doors & such. More...
 
#define ST_MAT_WALL   2
 Wall. More...
 
#define ST_MAT_WINDOW   4
 Window. More...
 
#define ST_PLAY_AGAIN   1
 Player left through a bed of reality, and can login again. More...
 
#define ST_PLAYING   0
 Usual state. More...
 
#define ST_ROLL_STAT   2
 New character, rolling stats. More...
 
#define VERY_BIG_BUF   1024
 
#define WAIT2   8
 Monster does not try to move towards player if far. More...
 
#define WAITATT   4
 Wait for player to approach then hit, move if hit. More...
 
#define WEAP_BLUD   8
 bludgeoning, club, stick More...
 
#define WEAP_CLEAVE   3
 axe More...
 
#define WEAP_CRUSH   7
 big hammers, flails More...
 
#define WEAP_HIT   0
 the basic More...
 
#define WEAP_PIERCE   2
 arrows, stiletto More...
 
#define WEAP_SLASH   1
 slash More...
 
#define WEAP_SLICE   4
 katana More...
 
#define WEAP_STAB   5
 knife, dagger More...
 
#define WEAP_WHIP   6
 whips n chains More...
 
#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. More...
 

Typedefs

typedef unsigned char MoveType
 Typdef here to define type large enough to hold bitmask of all movement types. More...
 

Enumerations

enum  fatal_error {
  OUT_OF_MEMORY = 0, MAP_ERROR = 1, ARCHTABLE_TOO_SMALL = 2, ARCHETYPE_ISSUE = 3,
  SEE_LAST_ERROR = 4
}
 Fatal variables; used as arguments to fatal(). More...
 

Functions

uint32_t cf_random (void)
 
void cf_srandom (unsigned long seed)
 

Variables

static const int32_t MAX_FOOD = 999
 

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.

Macro Definition Documentation

◆ ARMOUR_SPEED

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

Definition at line 451 of file define.h.

◆ ARMOUR_SPELLS

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

Definition at line 452 of file define.h.

◆ BIG_NAME

#define BIG_NAME   32

Definition at line 42 of file define.h.

◆ BLANK_FACE_NAME

#define BLANK_FACE_NAME   "blank.111"

Definition at line 539 of file define.h.

◆ CLEAR_FLAG

#define CLEAR_FLAG (   xyz,
 
)    clear_flag(xyz, p)

Definition at line 370 of file define.h.

◆ DIRX

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

Definition at line 448 of file define.h.

◆ DIRY

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

Definition at line 449 of file define.h.

◆ EMPTY_FACE_NAME

#define EMPTY_FACE_NAME   "empty.111"

Definition at line 540 of file define.h.

◆ EXIT_ALT_X

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

Definition at line 428 of file define.h.

◆ EXIT_ALT_Y

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

Definition at line 429 of file define.h.

◆ EXIT_LEVEL

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

Definition at line 425 of file define.h.

◆ EXIT_PATH

#define EXIT_PATH (   xyz)    (xyz)->slaying

Definition at line 424 of file define.h.

◆ EXIT_X

#define EXIT_X (   xyz)    (xyz)->stats.hp

Definition at line 426 of file define.h.

◆ EXIT_Y

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

Definition at line 427 of file define.h.

◆ FABS

#define FABS (   x)    ((x) < 0 ? -(x) : (x))

Decstations have trouble with fabs()...

Definition at line 22 of file define.h.

◆ FOR_ABOVE_FINISH

#define FOR_ABOVE_FINISH ( )
Value:
} while(0)

Finishes FOR_ABOVE_PREPARE().

Definition at line 678 of file define.h.

◆ FOR_ABOVE_PREPARE

#define FOR_ABOVE_PREPARE (   op_,
  it_ 
)
Value:
do { \
object *it_ = (op_)->above; \
FOR_OB_AND_ABOVE_PREPARE(it_);

Constructs a loop iterating over all objects above an object.

Parameters
op_the object to iterate over
it_a variable name that holds the inventory objects; a new variable will be declared; modifications do not affect the loop

Definition at line 671 of file define.h.

◆ FOR_BELOW_FINISH

#define FOR_BELOW_FINISH ( )
Value:
} while(0)

Finishes FOR_BELOW_PREPARE().

Definition at line 695 of file define.h.

◆ FOR_BELOW_PREPARE

#define FOR_BELOW_PREPARE (   op_,
  it_ 
)
Value:
do { \
object *it_ = (op_)->below; \
FOR_OB_AND_BELOW_PREPARE(it_);

Constructs a loop iterating over all objects below an object.

Parameters
op_the object to iterate over
it_a variable name that holds the inventory objects; a new variable will be declared; modifications do not affect the loop

Definition at line 688 of file define.h.

◆ FOR_INV_FINISH

#define FOR_INV_FINISH ( )
Value:
} while(0)

Finishes FOR_INV_PREPARE().

Definition at line 661 of file define.h.

◆ FOR_INV_PREPARE

#define FOR_INV_PREPARE (   op_,
  it_ 
)
Value:
do { \
object *it_ = (op_)->inv; \
FOR_OB_AND_BELOW_PREPARE(it_);

Constructs a loop iterating over the inventory of an object.

Example:

FOR_INV_PREPARE(op, inv)
    LOG(llevInfo, "%s\n", inv->name);
FOR_INV_FINISH();

or

FOR_INV_PREPARE(op, inv) {
    LOG(llevInfo, "%s\n", inv->name);
} FOR_INV_FINISH();
Parameters
op_the object to iterate over
it_a variable name that holds the inventory objects; a new variable will be declared; modifications do not affect the loop

Definition at line 654 of file define.h.

◆ FOR_MAP_FINISH

#define FOR_MAP_FINISH ( )
Value:
} while(0)

Finishes FOR_MAP_PREPARE().

Definition at line 714 of file define.h.

◆ FOR_MAP_PREPARE

#define FOR_MAP_PREPARE (   map_,
  mx_,
  my_,
  it_ 
)
Value:
do { \
object *it_ = GET_MAP_OB((map_), (mx_), (my_)); \
FOR_OB_AND_ABOVE_PREPARE(it_);

Constructs a loop iterating over all objects of a map tile.

Parameters
map_the map to iterate over
mx_the map's x-coordinate to iterate over
my_the map's y-coordinate to iterate over
it_a variable name that holds the inventory objects; a new variable will be declared; modifications do not affect the loop

Definition at line 707 of file define.h.

◆ FOR_OB_AND_ABOVE_FINISH

#define FOR_OB_AND_ABOVE_FINISH ( )    FOR_OB_FINISH()

Finishes FOR_OB_AND_ABOVE_PREPARE().

Definition at line 727 of file define.h.

◆ FOR_OB_AND_ABOVE_PREPARE

#define FOR_OB_AND_ABOVE_PREPARE (   op_)    FOR_OB_PREPARE(op_, above, __LINE__)

Constructs a loop iterating over an object and all objects above it in the same pile.

Parameters
op_the object to start with

Definition at line 723 of file define.h.

◆ FOR_OB_AND_BELOW_FINISH

#define FOR_OB_AND_BELOW_FINISH ( )    FOR_OB_FINISH()

Finishes FOR_OB_AND_BELOW_PREPARE().

Definition at line 738 of file define.h.

◆ FOR_OB_AND_BELOW_PREPARE

#define FOR_OB_AND_BELOW_PREPARE (   op_)    FOR_OB_PREPARE(op_, below, __LINE__)

Constructs a loop iterating over an object and all objects below it in the same pile.

Parameters
op_the object to start with

Definition at line 734 of file define.h.

◆ FOR_OB_FINISH

#define FOR_OB_FINISH ( )
Value:
} \
} while(0)

Finishes FOR_OB_PREPARE().

Definition at line 768 of file define.h.

◆ FOR_OB_PREPARE

#define FOR_OB_PREPARE (   op_,
  field_,
  suffix_ 
)    FOR_OB_PREPARE2(op_, field_, suffix_)

Constructs a loop iterating over a set of objects.

This function should not be used directly in client code.

Parameters
op_the object start start with
field_the field that holds the "next" pointer within op_
suffix_a suffix for constructing unique variable names

Definition at line 747 of file define.h.

◆ FOR_OB_PREPARE2

#define FOR_OB_PREPARE2 (   op_,
  field_,
  suffix_ 
)
Value:
do { \
object *next##suffix_ = (op_); \
tag_t next_tag##suffix_ = next##suffix_ == NULL ? 0 : next##suffix_->count;\
while (((op_) = next##suffix_) != NULL) { \
if (object_was_destroyed(next##suffix_, next_tag##suffix_)) {\
break; \
} \
next##suffix_ = next##suffix_->field_; \
next_tag##suffix_ = next##suffix_ == NULL ? 0 : next##suffix_->count;

Constructs a loop iterating over a set of objects.

This function should not be used at all. Use FOR_OB_PREPARE() instead.

Parameters
op_the object start start with
field_the field that holds the "next" pointer within op_
suffix_a suffix for constructing unique variable names

Definition at line 755 of file define.h.

◆ GENERATE_SPEED

#define GENERATE_SPEED (   xyz)    ((xyz)->stats.maxsp) /* if(!RANDOM()%<speed>) */

Definition at line 422 of file define.h.

◆ GENERATE_TYPE

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

Definition at line 421 of file define.h.

◆ HAS_RANDOM_ITEMS

#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 184 of file define.h.

◆ HUGE_BUF

#define HUGE_BUF   4096

Used for messages - some can be quite long.

Definition at line 37 of file define.h.

◆ MAX_ANIMATIONS

#define MAX_ANIMATIONS   256

Definition at line 39 of file define.h.

◆ MAX_BUF

#define MAX_BUF   256

Used for all kinds of things.

Definition at line 35 of file define.h.

◆ MAX_DARKNESS

#define MAX_DARKNESS   5

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

Definition at line 439 of file define.h.

◆ MAX_LIGHT_RADII

#define MAX_LIGHT_RADII   4

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

Definition at line 435 of file define.h.

◆ MAX_NAME

#define MAX_NAME   48

Definition at line 41 of file define.h.

◆ MAX_WEAPON_ITEM_POWER

#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 444 of file define.h.

◆ MIN_ACTIVE_SPEED

#define MIN_ACTIVE_SPEED   0.00001

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

Definition at line 623 of file define.h.

◆ MIN_STAT

#define MIN_STAT   1

The minimum legal value of any stat.

Definition at line 33 of file define.h.

◆ MOVE_BLOCK_DEFAULT

#define MOVE_BLOCK_DEFAULT   MOVE_SWIM

The normal assumption is that objects are walking/flying.

So often we don't want to block movement, but still don't want to allow all types (swimming is rather specialized) - I also expect as more movement types show up, this is likely to get updated. Basically, this is the default for spaces that allow movement - anything but swimming right now. If you really want nothing at all, then can always set move_block to 0

Definition at line 401 of file define.h.

◆ NAME_MAX

#define NAME_MAX   255

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

Definition at line 30 of file define.h.

◆ NROF_SOUNDS

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

Definition at line 157 of file define.h.

◆ OB_MOVE_BLOCK

#define OB_MOVE_BLOCK (   ob1,
  ob2 
)    ob_move_block(ob1, ob2)

Definition at line 410 of file define.h.

◆ OB_TYPE_MOVE_BLOCK

#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.

Definition at line 418 of file define.h.

◆ PREFER_HIGH

#define PREFER_HIGH   1

Definition at line 547 of file define.h.

◆ PREFER_LOW

#define PREFER_LOW   0

Definition at line 548 of file define.h.

◆ QUERY_FLAG

#define QUERY_FLAG (   xyz,
 
)    query_flag(xyz, p)

Definition at line 371 of file define.h.

◆ RANDOM

#define RANDOM ( )    cf_random()

Definition at line 628 of file define.h.

◆ SET_FLAG

#define SET_FLAG (   xyz,
 
)    set_flag(xyz, p)

Definition at line 369 of file define.h.

◆ SIZEOFFREE

#define SIZEOFFREE   49

Definition at line 155 of file define.h.

◆ SIZEOFFREE1

#define SIZEOFFREE1   8

Definition at line 153 of file define.h.

◆ SIZEOFFREE2

#define SIZEOFFREE2   24

Definition at line 154 of file define.h.

◆ SMOOTH_FACE_NAME

#define SMOOTH_FACE_NAME   "default_smoothed.111"

Definition at line 541 of file define.h.

◆ SRANDOM

#define SRANDOM (   seed)    cf_srandom(seed)

Definition at line 629 of file define.h.

◆ VERY_BIG_BUF

#define VERY_BIG_BUF   1024

Definition at line 36 of file define.h.

◆ WEAPON_SPEED

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

Definition at line 453 of file define.h.

◆ WEIGHT

#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 635 of file define.h.

Typedef Documentation

◆ MoveType

typedef unsigned char MoveType

Typdef here to define type large enough to hold bitmask of all movement types.

Make one declaration so easy to update. uint8_t is defined yet, so just use what that would define it at anyways.

Definition at line 409 of file define.h.

Enumeration Type Documentation

◆ fatal_error

Fatal variables; used as arguments to fatal().

Enumerator
OUT_OF_MEMORY 
MAP_ERROR 
ARCHTABLE_TOO_SMALL 
ARCHETYPE_ISSUE 
SEE_LAST_ERROR 

Definition at line 47 of file define.h.

Function Documentation

◆ cf_random()

uint32_t cf_random ( void  )

Definition at line 5 of file cf_random.cpp.

References generator.

Referenced by check_loaded_object(), and ready_map_name().

+ Here is the caller graph for this function:

◆ cf_srandom()

void cf_srandom ( unsigned long  seed)

Definition at line 9 of file cf_random.cpp.

References generator.

Variable Documentation

◆ MAX_FOOD

const int32_t MAX_FOOD = 999
static
object_was_destroyed
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
Definition: object.h:70
GET_MAP_OB
#define GET_MAP_OB(M, X, Y)
Gets the bottom object on a map.
Definition: map.h:173
FOR_OB_AND_ABOVE_FINISH
#define FOR_OB_AND_ABOVE_FINISH()
Finishes FOR_OB_AND_ABOVE_PREPARE().
Definition: define.h:727
FOR_OB_AND_BELOW_FINISH
#define FOR_OB_AND_BELOW_FINISH()
Finishes FOR_OB_AND_BELOW_PREPARE().
Definition: define.h:738
above
Magical Runes Runes are magical inscriptions on the dungeon which cast a spell or detonate when something steps on them Flying objects don t detonate runes Beware ! Runes are invisible most of the time They are only visible occasionally ! There are several runes which are there are some special runes which may only be called with the invoke and people may apply it to read it Maybe useful for mazes ! This rune will not nor is it ordinarily invisible Partial Visibility of they ll be visible only part of the time They have so the higher your the better hidden the runes you make are Examples of whichever way you re facing invoke magic rune transfer as above
Definition: runes-guide.txt:50