Atrinik Server 2.5
Data Structures | Defines | Typedefs | Variables
include/object.h File Reference

Go to the source code of this file.

Data Structures

struct  key_value_struct
struct  obj
struct  oblnk
struct  magic_mirror_struct

Defines

#define WEIGHT(op)   (!op->nrof || op->type == CONTAINER ? op->weight + op->carrying : op->weight)
#define WEIGHT_NROF(op, nrof)   ((nrof ? op->weight * (sint32) nrof : op->weight) + op->carrying)
#define MOVE_APPLY_DEFAULT   0
#define MOVE_APPLY_WALK_ON   1
#define MOVE_APPLY_FLY_ON   2
#define MOVE_APPLY_WALK_OFF   4
#define MOVE_APPLY_FLY_OFF   8
#define MOVE_APPLY_MOVE   16
#define MOVE_APPLY_VANISHED   32
#define MOVE_APPLY_SAVING   64
#define CHECK_WALK_OK   0
#define CHECK_WALK_DESTROYED   1
#define CHECK_WALK_MOVED   2
#define free_objectlink_simple(_chunk_)   return_poolchunk((_chunk_), pool_objectlink);
#define CONTR(ob)   ((player *) ((ob)->custom_attrset))
#define LOOK_OBJ(_ob)   (!IS_SYS_INVISIBLE(_ob) && _ob->type != PLAYER)
#define UP_OBJ_INSERT   1
#define UP_OBJ_REMOVE   2
#define UP_OBJ_FLAGS   3
#define UP_OBJ_FACE   4
#define UP_OBJ_FLAGFACE   5
#define UP_OBJ_ALL   6
#define UP_OBJ_LAYER   7
#define OBJECT_VALID(_ob_, _count_)   ((_ob_) && (_ob_)->count == ((tag_t) _count_) && !QUERY_FLAG((_ob_), FLAG_REMOVED) && !OBJECT_FREE(_ob_))
#define OBJECT_ACTIVE(_ob_)   (!QUERY_FLAG((_ob_), FLAG_REMOVED) && !OBJECT_FREE(_ob_))
#define OBJECT_FREE(_ob_)   ((_ob_)->count == 0 && CHUNK_FREE(_ob_))
#define INS_NO_MERGE   0x0001
#define INS_NO_WALK_ON   0x0002
#define INS_TAIL_MARKER   0x0004
#define BEHAVIOR_SPELL_FRIENDLY   1
#define BEHAVIOR_OPEN_DOORS   2
#define decrease_ob(xyz)   decrease_ob_nr(xyz, 1)
#define GENDER_NEUTER   0
#define GENDER_MALE   1
#define GENDER_FEMALE   2
#define GENDER_HERMAPHRODITE   3
#define GENDER_MAX   4
#define CORPSE_INFRAVISION_PERCENT   75
#define HEAD(op)   ((op)->head ? (op)->head : (op))
#define MMIRROR(ob)   ((magic_mirror_struct *) ((ob)->custom_attrset))

Typedefs

typedef struct key_value_struct key_value
typedef struct obj object
typedef struct oblnk objectlink
typedef struct magic_mirror_struct magic_mirror_struct

Variables

objectactive_objects
struct mempool_chunkremoved_objects
const char * gender_noun []
const char * gender_subjective []
const char * gender_subjective_upper []
const char * gender_objective []
const char * gender_possessive []
const char * gender_reflexive []

Detailed Description

Object related structures, core of Atrinik

Definition in file object.h.


Define Documentation

#define CORPSE_INFRAVISION_PERCENT   75

Value in percent of time above which the corpse will be highlighted in infravision mode.

Definition at line 592 of file object.h.

#define decrease_ob (   xyz)    decrease_ob_nr(xyz, 1)

Decrease an object by one.

Definition at line 571 of file object.h.

#define HEAD (   op)    ((op)->head ? (op)->head : (op))

Returns the head part of an object. For single-tile objects returns the object itself.

Parameters:
opThe object.
Returns:
The head object.

Definition at line 599 of file object.h.

#define MMIRROR (   ob)    ((magic_mirror_struct *) ((ob)->custom_attrset))

Returns the magic_mirror_struct that holds the magic mirror's map, x and y. Can be NULL in case of a magic mirror that is only used for zooming or similar effect, and not mirroring.

Definition at line 619 of file object.h.

#define OBJECT_ACTIVE (   _ob_)    (!QUERY_FLAG((_ob_), FLAG_REMOVED) && !OBJECT_FREE(_ob_))

Test the object is not removed nor freed - but no count test

Definition at line 535 of file object.h.

#define OBJECT_FREE (   _ob_)    ((_ob_)->count == 0 && CHUNK_FREE(_ob_))

Test if an object is in the free-list

Definition at line 538 of file object.h.

#define OBJECT_VALID (   _ob_,
  _count_ 
)    ((_ob_) && (_ob_)->count == ((tag_t) _count_) && !QUERY_FLAG((_ob_), FLAG_REMOVED) && !OBJECT_FREE(_ob_))

Macro for the often used object validity test (verify a pointer/count pair)

Definition at line 532 of file object.h.

#define WEIGHT (   op)    (!op->nrof || op->type == CONTAINER ? op->weight + op->carrying : op->weight)

Get the weight of an object. If the object is a container or doesn't have nrof, include the weight it is carrying.

Definition at line 36 of file object.h.


Typedef Documentation

typedef struct key_value_struct key_value

This structure allows any object to have extra fields the Flex loader does not know about.

Structure used for object::custom_attrset of magic mirrors.

typedef struct obj object

Object structure.

typedef struct oblnk objectlink

Used to link together several objects.


Variable Documentation

List of active objects

List of active objects that need to be processed

Definition at line 41 of file object.c.

const char* gender_noun[]

Gender nouns.

Definition at line 109 of file object.c.

const char* gender_objective[]

Objective pronouns.

Definition at line 127 of file object.c.

const char* gender_possessive[]

Possessive pronouns.

Definition at line 133 of file object.c.

const char* gender_reflexive[]

Reflexive pronouns.

Definition at line 139 of file object.c.

const char* gender_subjective[]

Subjective pronouns.

Definition at line 115 of file object.c.

const char* gender_subjective_upper[]

Subjective pronouns, with first letter in uppercase.

Definition at line 121 of file object.c.

List of objects that have been removed during the last server timestep.

Definition at line 38 of file object.c.