Atrinik Server  4.0
Data Structures | Macros | Typedefs | Enumerations
global.h File Reference
#include "includes.h"
#include <toolkit/shstr.h>
#include <toolkit/memory.h>
#include <toolkit/stringbuffer.h>
#include <toolkit/socket.h>
#include <toolkit/mempool.h>
#include <face.h>
#include <material.h>
#include <living.h>
#include <map.h>
#include <tod.h>
#include <pathfinder.h>
#include <newserver.h>
#include <skills.h>
#include <party.h>
#include <treasure.h>
#include <commands.h>
#include <race.h>
#include <recipe.h>
#include <spells.h>
#include "random_map.h"
#include "proto.h"

Go to the source code of this file.

Data Structures

struct  linked_char
 
struct  settings_struct
 
struct  shstr_constants
 
struct  cache_struct
 

Macros

#define BANK_SYNTAX_ERROR   -1
 
#define BANK_SUCCESS   0
 
#define BANK_WITHDRAW_HIGH   1
 
#define BANK_WITHDRAW_MISSING   2
 
#define BANK_WITHDRAW_OVERWEIGHT   3
 
#define BANK_DEPOSIT_COPPER   1
 
#define BANK_DEPOSIT_SILVER   2
 
#define BANK_DEPOSIT_GOLD   3
 
#define BANK_DEPOSIT_JADE   4
 
#define BANK_DEPOSIT_MITHRIL   4
 
#define BANK_DEPOSIT_AMBER   4
 
#define POW2(x)   ((x) * (x))
 
#define MAP_INFO_NORMAL   12
 
#define MAP_INFO_ALL   9999
 
#define FREE_AND_COPY_HASH(_sv_, _nv_)
 
#define FREE_AND_ADD_REF_HASH(_sv_, _nv_)
 
#define FREE_AND_CLEAR_HASH(_nv_)
 
#define FREE_ONLY_HASH(_nv_)
 
#define ADD_REF_NOT_NULL_HASH(_nv_)
 
#define FREE_AND_CLEAR_HASH2(_nv_)
 
#define SPAWN_RANDOM_RANGE   10000
 
#define TREASURE_ARTIFACT_CHANCE   -1
 Artifact chance value is not set.
 
#define MIN_MON_RADIUS   2
 
#define MAX_AGGRO_RANGE   9
 
#define MAX_AGGRO_TIME   12
 
#define TILED_NORTH   0
 
#define TILED_EAST   1
 
#define TILED_SOUTH   2
 
#define TILED_WEST   3
 
#define TILED_NORTHEAST   4
 
#define TILED_SOUTHEAST   5
 
#define TILED_SOUTHWEST   6
 
#define TILED_NORTHWEST   7
 
#define TILED_UP   8
 
#define TILED_DOWN   9
 
#define TILED_NUM   10
 
#define TILED_NUM_DIR   8
 
#define EXP_AGILITY   1
 
#define EXP_MENTAL   2
 
#define EXP_MAGICAL   3
 
#define EXP_PERSONAL   4
 
#define EXP_PHYSICAL   5
 
#define EXP_WISDOM   6
 
#define MAXLEVEL   115
 
#define MAX_EXPERIENCE   new_levels[MAXLEVEL]
 
#define move_object(__op, __dir)   move_ob(__op, __dir, __op)
 
#define is_magical(__op_)   QUERY_FLAG(__op_, FLAG_IS_MAGICAL)
 
#define NROF_COMPRESS_METHODS   4
 
#define STRING_SAFE(__string__)   (__string__ ? __string__ : ">NULL<")
 
#define STRING_ARCH_NAME(__arch__)   ((__arch__)->name ? (__arch__)->name : ">NULL<")
 
#define STRING_OBJ_NAME(__ob__)   ((__ob__) && (__ob__)->name ? (__ob__)->name : ">NULL<")
 
#define STRING_OBJ_ARCH_NAME(__ob__)   ((__ob__)->arch ? ((__ob__)->arch->name ? (__ob__)->arch->name : ">NULL<") : ">NULL<")
 
#define STRING_OBJ_SLAYING(__ob__)   ((__ob__)->slaying ? (__ob__)->slaying : ">NULL<")
 
#define SET_ANIMATION(ob, newanim)   (ob)->face = &new_faces[animations[(ob)->animation_id].faces[(newanim)]]
 
#define SET_ANIMATION_STATE(ob)
 
#define GET_ANIM_ID(ob)   (ob->animation_id)
 
#define GET_INV_ANIM_ID(ob)   (ob->inv_animation_id)
 
#define NUM_ANIMATIONS(ob)   (animations[ob->animation_id].num_animations)
 
#define NUM_FACINGS(ob)   (animations[ob->animation_id].facings)
 
#define FREE_AND_NULL_PTR(_xyz_)
 
#define CACHE_FLAG_PYOBJ   1
 
#define CACHE_FLAG_AUTOFREE   2
 
#define CACHE_FLAG_GEVENT   4
 
#define tolower(C)   (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a' : (C))
 
#define MAX_TICKS   (1000000.0 / max_time)
 
#define MAX_TICKS_MULTIPLIER   (MAX_TICKS * max_time_multiplier)
 

Typedefs

typedef shstr treasure_affinity_t
 
typedef struct linked_char linked_char
 
typedef struct settings_struct settings_struct
 
typedef struct shstr_constants shstr_constants
 
typedef struct cache_struct cache_struct
 

Enumerations

enum  { ALLOWED_CHARS_ACCOUNT, ALLOWED_CHARS_CHARNAME, ALLOWED_CHARS_PASSWORD, ALLOWED_CHARS_NUM }
 

Detailed Description

Global definitions, u/sint8, things like that.

Definition in file global.h.

Macro Definition Documentation

#define FREE_AND_NULL_PTR (   _xyz_)
Value:
{ \
if (_xyz_) \
{ \
efree(_xyz_); \
} \
\
_xyz_ = NULL; \
}

Free and NULL a pointer.

Definition at line 303 of file global.h.

#define GET_ANIM_ID (   ob)    (ob->animation_id)

Get object's animation ID.

Definition at line 294 of file global.h.

#define GET_INV_ANIM_ID (   ob)    (ob->inv_animation_id)

Get object's inventory animation ID.

Definition at line 296 of file global.h.

#define is_magical (   __op_)    QUERY_FLAG(__op_, FLAG_IS_MAGICAL)

Is the object magical?

Definition at line 255 of file global.h.

#define MAX_AGGRO_RANGE   9

If target of mob is out of this range (or stats.Wis if higher).

Definition at line 178 of file global.h.

#define MAX_AGGRO_TIME   12

Until this time - then it skip target

Definition at line 180 of file global.h.

#define MAX_EXPERIENCE   new_levels[MAXLEVEL]

Maximum experience.

Definition at line 224 of file global.h.

#define MAXLEVEL   115

The maximum level.

Definition at line 221 of file global.h.

#define MIN_MON_RADIUS   2

Minimum monster detection radius

Definition at line 176 of file global.h.

#define move_object (   __op,
  __dir 
)    move_ob(__op, __dir, __op)

Move an object.

Definition at line 253 of file global.h.

#define NUM_ANIMATIONS (   ob)    (animations[ob->animation_id].num_animations)

Get the number of possible animations for an object.

Definition at line 298 of file global.h.

#define NUM_FACINGS (   ob)    (animations[ob->animation_id].facings)

Get the number of possible facings for object's animation.

Definition at line 300 of file global.h.

#define SET_ANIMATION (   ob,
  newanim 
)    (ob)->face = &new_faces[animations[(ob)->animation_id].faces[(newanim)]]

Set object's face by its animation ID.

Parameters
obObject.
newanimAnimation ID to set.

Definition at line 282 of file global.h.

#define SET_ANIMATION_STATE (   ob)
Value:
if ((ob)->animation_id && NUM_FACINGS((ob)) && (QUERY_FLAG((ob), FLAG_IS_TURNABLE) || QUERY_FLAG((ob), FLAG_ANIMATE))) \
{ \
SET_ANIMATION((ob), (NUM_ANIMATIONS((ob)) / NUM_FACINGS((ob))) * (QUERY_FLAG((ob), FLAG_IS_TURNABLE) ? (ob)->direction : 0) + (ob)->state); \
}
#define UP_OBJ_FACE
Definition: object.h:537
#define NUM_FACINGS(ob)
Definition: global.h:300
#define FLAG_ANIMATE
Definition: define.h:912
#define SET_ANIMATION(ob, newanim)
Definition: global.h:282
#define FLAG_IS_TURNABLE
Definition: define.h:960
#define QUERY_FLAG(xyz, p)
Definition: define.h:761
void object_update(object *op, int action)
Definition: object.c:1117
#define NUM_ANIMATIONS(ob)
Definition: global.h:298

Set object's animation depending on its number of animations/facings, direction and animation state.

Definition at line 287 of file global.h.

#define STRING_ARCH_NAME (   __arch__)    ((__arch__)->name ? (__arch__)->name : ">NULL<")

Use to get a safe name of arch, even if the arch name is NULL.

Definition at line 262 of file global.h.

#define STRING_OBJ_ARCH_NAME (   __ob__)    ((__ob__)->arch ? ((__ob__)->arch->name ? (__ob__)->arch->name : ">NULL<") : ">NULL<")

Use to get a safe arch name of object, even if the object arch name is NULL.

Definition at line 268 of file global.h.

#define STRING_OBJ_NAME (   __ob__)    ((__ob__) && (__ob__)->name ? (__ob__)->name : ">NULL<")

Use to get a safe name of object, even if the object name is NULL.

Definition at line 264 of file global.h.

#define STRING_OBJ_SLAYING (   __ob__)    ((__ob__)->slaying ? (__ob__)->slaying : ">NULL<")

Use to get a safe slaying value of an object, even if the slaying value is NULL.

Definition at line 273 of file global.h.

#define STRING_SAFE (   __string__)    (__string__ ? __string__ : ">NULL<")

Use to get a safe string, even if the string is NULL.

Definition at line 260 of file global.h.

Typedef Documentation

typedef struct cache_struct cache_struct

One cache entry.

typedef struct linked_char linked_char

Used to link together shared strings.

The server settings.

Constant shared string pointers.