Crossfire Server, Trunk  R20608
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
 

Macros

#define AC_PLAYER_STAT_LIMIT   1 /** Limit stats to racial maximum */
 
#define AC_PLAYER_STAT_NO_CHANGE   2 /** Do not make any stat adjustments */
 
#define ALLRUN   6
 
#define AP_APPLY   1
 
#define AP_BASIC_FLAGS   15
 
#define AP_IGNORE_CURSE   32
 
#define AP_NO_MERGE   16
 
#define AP_NOPRINT   128
 
#define AP_NULL   0
 
#define AP_PRINT   64
 
#define AP_UNAPPLY   2
 
#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
 
#define CIRCLE2   48
 
#define CLEAR_FLAG(xyz, p)   clear_flag(xyz, p)
 
#define COMPARE_FLAGS(p, q)   compare_flags(p, q)
 
#define DIRX(xyz)   freearr_x[(xyz)->direction]
 
#define DIRY(xyz)   freearr_y[(xyz)->direction]
 
#define DISTATT   1
 
#define DISTHIT   7
 
#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))
 
#define FLAG_ACTIVATE_ON_PUSH   105
 
#define FLAG_ACTIVATE_ON_RELEASE   106
 
#define FLAG_AFK   111
 
#define FLAG_ALIVE   0
 
#define FLAG_ANIMATE   11
 
#define FLAG_APPLIED   5
 
#define FLAG_AUTO_APPLY   18
 
#define FLAG_BEEN_APPLIED   80
 
#define FLAG_BERSERK   99
 
#define FLAG_BLESSED   112
 
#define FLAG_BLIND   92
 
#define FLAG_BLOCKSVIEW   35
 
#define FLAG_CAN_ROLL   22
 
#define FLAG_CAN_USE_SKILL   79
 
#define FLAG_CAST_SPELL   52
 
#define FLAG_CHANGING   31
 
#define FLAG_CLIENT_ANIM_RANDOM   10
 
#define FLAG_CLIENT_ANIM_SYNC   9
 
#define FLAG_CLIENT_SENT   98
 
#define FLAG_CONFUSED   70
 
#define FLAG_CONTENT_ON_GEN   108
 
#define FLAG_CURSED   74
 
#define FLAG_DAMNED   75
 
#define FLAG_DIALOG_PARSED   12
 
#define FLAG_FREED   3
 
#define FLAG_FRIENDLY   15
 
#define FLAG_GENERATOR   16
 
#define FLAG_HITBACK   33
 
#define FLAG_IDENTIFIED   29
 
#define FLAG_INV_LOCKED   86
 
#define FLAG_IS_A_TEMPLATE   109
 
#define FLAG_IS_BUILDABLE   110
 
#define FLAG_IS_CAULDRON   94
 
#define FLAG_IS_FLOOR   63
 
#define FLAG_IS_HILLY   88
 
#define FLAG_IS_LIGHTABLE   43
 
#define FLAG_IS_LINKED   73
 
#define FLAG_IS_THROWN   17
 
#define FLAG_IS_TURNABLE   24
 
#define FLAG_IS_USED_UP   28
 
#define FLAG_IS_WATER   107
 
#define FLAG_IS_WOODED   87
 
#define FLAG_KNOWN_BLESSED   113
 
#define FLAG_KNOWN_CURSED   78
 
#define FLAG_KNOWN_MAGICAL   77
 
#define FLAG_LIFESAVE   64
 
#define FLAG_MAKE_INVIS   85
 
#define FLAG_MONSTER   14
 
#define FLAG_NEUTRAL   100
 
#define FLAG_NO_APPLY   62
 
#define FLAG_NO_ATTACK   101
 
#define FLAG_NO_DAMAGE   102
 
#define FLAG_NO_DROP   50
 
#define FLAG_NO_FIX_PLAYER   42
 
#define FLAG_NO_MAGIC   41
 
#define FLAG_NO_PICK   8
 
#define FLAG_NO_SAVE   13
 
#define FLAG_NO_SKILL_IDENT   91
 
#define FLAG_NO_STEAL   96
 
#define FLAG_NO_STRENGTH   65
 
#define FLAG_OBJ_ORIGINAL   103
 
#define FLAG_ONE_HIT   97
 
#define FLAG_ONLY_ATTACK   69
 
#define FLAG_OVERLAY_FLOOR   23
 
#define FLAG_PARALYZED   114
 
#define FLAG_PLAYER_SOLD   20
 
#define FLAG_PROBE   25
 
#define FLAG_RANDOM_MOVE   68
 
#define FLAG_READY_BOW   60
 
#define FLAG_READY_RANGE   59
 
#define FLAG_READY_SCROLL   81
 
#define FLAG_READY_SKILL   89
 
#define FLAG_READY_WEAPON   90
 
#define FLAG_REFL_MISSILE   39
 
#define FLAG_REFL_SPELL   40
 
#define FLAG_REFLECTING   30
 
#define FLAG_REMOVED   2
 
#define FLAG_RUN_AWAY   45
 
#define FLAG_SCARED   37
 
#define FLAG_SEE_ANYWHERE   76
 
#define FLAG_SEE_IN_DARK   93
 
#define FLAG_SEE_INVISIBLE   21
 
#define FLAG_SLEEP   66
 
#define FLAG_SPLITTING   32
 
#define FLAG_STAND_STILL   67
 
#define FLAG_STARTEQUIP   34
 
#define FLAG_STEALTH   71
 
#define FLAG_TEAR_DOWN   44
 
#define FLAG_TREASURE   19
 
#define FLAG_UNAGGRESSIVE   38
 
#define FLAG_UNDEAD   36
 
#define FLAG_UNIQUE   49
 
#define FLAG_UNPAID   6
 
#define FLAG_USE_ARMOUR   56
 
#define FLAG_USE_BOW   55
 
#define FLAG_USE_RANGE   54
 
#define FLAG_USE_RING   58
 
#define FLAG_USE_SCROLL   53
 
#define FLAG_USE_SHIELD   7
 
#define FLAG_USE_WEAPON   57
 
#define FLAG_WAS_WIZ   4
 
#define FLAG_WIZ   1
 
#define FLAG_WIZCAST   51
 
#define FLAG_WIZPASS   72
 
#define FLAG_XRAYS   61
 
#define FOR_ABOVE_FINISH()
 
#define FOR_ABOVE_PREPARE(op_, it_)
 
#define FOR_BELOW_FINISH()
 
#define FOR_BELOW_PREPARE(op_, it_)
 
#define FOR_INV_FINISH()
 
#define FOR_INV_PREPARE(op_, it_)
 
#define FOR_MAP_FINISH()
 
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
 
#define FOR_OB_AND_ABOVE_FINISH()   FOR_OB_FINISH()
 
#define FOR_OB_AND_ABOVE_PREPARE(op_)   FOR_OB_PREPARE(op_, above, __LINE__)
 
#define FOR_OB_AND_BELOW_FINISH()   FOR_OB_FINISH()
 
#define FOR_OB_AND_BELOW_PREPARE(op_)   FOR_OB_PREPARE(op_, below, __LINE__)
 
#define FOR_OB_FINISH()
 
#define FOR_OB_PREPARE(op_, field_, suffix_)   FOR_OB_PREPARE2(op_, field_, suffix_)
 
#define FOR_OB_PREPARE2(op_, field_, suffix_)
 
#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)))
 
#define HI4   240
 
#define HITRUN   3
 
#define HUGE_BUF   4096
 
#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
 
#define MAX_ANIMATIONS   256
 
#define MAX_BUF   256
 
#define MAX_DARKNESS   5
 
#define MAX_LIGHT_RADII   4
 
#define MAX_NAME   48
 
#define MAX_WEAPON_ITEM_POWER   100
 
#define MIN_ACTIVE_SPEED   0.00001
 
#define MIN_STAT   1
 
#define MOVE_ALL   0x1f
 
#define MOVE_BLOCK_DEFAULT   MOVE_SWIM
 
#define MOVE_BOAT   0x10
 
#define MOVE_FLY_HIGH   0x4
 
#define MOVE_FLY_LOW   0x2
 
#define MOVE_FLYING   0x6
 
#define MOVE_SWIM   0x8
 
#define MOVE_WALK   0x1
 
#define NAME_MAX   255
 
#define NROF_SOUNDS   (23+NROFREALSPELLS) /* Number of sounds */
 
#define NUM_FLAGS   114
 
#define OB_MOVE_BLOCK(ob1, ob2)   ((ob1->move_type&ob2->move_block) == ob1->move_type)
 
#define OB_TYPE_MOVE_BLOCK(ob1, type)   ((type != 0) && (ob1->move_type&type) == ob1->move_type)
 
#define PACEH   64
 
#define PACEH2   80
 
#define PACEV   128
 
#define PACEV2   144
 
#define PETMOVE   16
 
#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_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
 
#define RANDO2   112
 
#define RANDOM()   cf_random()
 
#define RUNATT   2
 
#define RUSH   5
 
#define SET_FLAG(xyz, p)   set_flag(xyz, p)
 
#define SET_GENERATE_TYPE(xyz, va)   (xyz)->stats.sp = (va)
 
#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
 
#define ST_BD_REMOVE   2
 
#define ST_CHANGE_CLASS   3
 
#define ST_CHANGE_PASSWORD_CONFIRM   13
 
#define ST_CHANGE_PASSWORD_NEW   12
 
#define ST_CHANGE_PASSWORD_OLD   11
 
#define ST_CONFIRM_PASSWORD   8
 
#define ST_CONFIRM_QUIT   4
 
#define ST_GET_NAME   6
 
#define ST_GET_PARTY_PASSWORD   10
 
#define ST_GET_PASSWORD   7
 
#define ST_MAT_FLOOR   1
 
#define ST_MAT_ITEM   3
 
#define ST_MAT_WALL   2
 
#define ST_MAT_WINDOW   4
 
#define ST_PLAY_AGAIN   1
 
#define ST_PLAYING   0
 
#define ST_ROLL_STAT   2
 
#define VERY_BIG_BUF   1024
 
#define WAIT2   8
 
#define WAITATT   4
 
#define WEAP_BLUD   8
 
#define WEAP_CLEAVE   3
 
#define WEAP_CRUSH   7
 
#define WEAP_HIT   0
 
#define WEAP_PIERCE   2
 
#define WEAP_SLASH   1
 
#define WEAP_SLICE   4
 
#define WEAP_STAB   5
 
#define WEAP_WHIP   6
 
#define WEAPON_SPEED(xyz)   (xyz)->last_sp
 
#define WEIGHT(op)   (op->nrof ? op->weight : op->weight+op->carrying)
 

Typedefs

typedef unsigned char MoveType
 
typedef struct typedata typedata
 

Enumerations

enum  fatal_error {
  OUT_OF_MEMORY = 0, MAP_ERROR = 1, ARCHTABLE_TOO_SMALL = 2, ARCHETYPE_ISSUE = 3,
  SEE_LAST_ERROR = 4
}
 

Functions

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

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

#define AC_PLAYER_STAT_LIMIT   1 /** Limit stats to racial maximum */

Definition at line 632 of file define.h.

Referenced by apply_changes_to_player(), and player_changer_type_process().

#define AC_PLAYER_STAT_NO_CHANGE   2 /** Do not make any stat adjustments */

Definition at line 633 of file define.h.

Referenced by apply_changes_to_player(), and apply_race_and_class().

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

Definition at line 480 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 481 of file define.h.

Referenced by describe_item().

#define BIG_NAME   32

Definition at line 42 of file define.h.

Referenced by get_score(), hiscore_check(), kill_object(), and poison_type_apply().

#define BLANK_FACE_NAME   "blank.111"

Definition at line 591 of file define.h.

Referenced by read_bmap_names().

#define DIRX (   xyz)    freearr_x[(xyz)->direction]
#define DIRY (   xyz)    freearr_y[(xyz)->direction]
#define EMPTY_FACE_NAME   "empty.111"

Definition at line 592 of file define.h.

Referenced by read_bmap_names().

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

Definition at line 459 of file define.h.

Referenced by op_on_battleground().

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

Definition at line 460 of file define.h.

Referenced by op_on_battleground().

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

Definition at line 456 of file define.h.

#define FOR_ABOVE_FINISH ( )
#define FOR_ABOVE_PREPARE (   op_,
  it_ 
)
Value:
do { \
object *it_ = (op_)->above; \
#define FOR_OB_AND_ABOVE_PREPARE(op_)
Definition: define.h:774
struct obj object

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

Referenced by cfapi_object_set_property(), check_altar_sacrifice(), check_trigger(), move_hole(), object_insert_in_ob(), send_changed_object(), and update_button().

#define FOR_BELOW_PREPARE (   op_,
  it_ 
)
Value:
do { \
object *it_ = (op_)->below; \
struct obj object
#define FOR_OB_AND_BELOW_PREPARE(op_)
Definition: define.h:785

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

Referenced by cast_consecrate(), check_item(), check_pick(), command_examine(), command_take(), convert_item(), give_initial_items(), monster_apply_below(), monster_check_pickup(), move_creator(), op_on_battleground(), pray(), and runpickupobject().

#define FOR_INV_FINISH ( )
Value:
} while(0)
#define FOR_OB_AND_BELOW_FINISH()
Definition: define.h:789

Finishes FOR_INV_PREPARE().

Definition at line 712 of file define.h.

Referenced by add_abilities(), adj_stealchance(), alchemy(), alchemy_failure_effect(), apply_auto(), apply_auto_fix(), apply_death_exp_penalty(), attempt_do_alchemy(), attempt_steal(), become_follower(), calc_alch_danger(), cancellation(), cast_bless(), cast_change_ability(), cast_curse(), cast_detection(), cast_identify(), cfapi_object_find_archetype_inside(), check_equipment(), check_inv_recursive(), check_physically_infect(), check_slaying_inventory(), CREMapInformationManager::checkInventory(), clean_object(), command_drop(), command_dropall(), command_empty(), command_rename_item(), content_recipe_value(), cure_disease(), do_auto_apply(), do_execute_event(), do_harvest(), do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), empty_container(), esrv_add_spells(), esrv_get_ob_from_count(), esrv_move_object(), esrv_send_inventory(), esrv_update_spells(), examine(), find_arrow(), find_best_player_hth_skill(), find_better_arrow(), find_key(), find_or_create_connection_for_map(), find_random_spell_in_ob(), find_skill_by_name(), find_skill_by_number(), find_throw_ob(), find_traps(), fix_container_multipart(), fix_object(), follower_has_similar_item(), follower_remove_given_items(), generate_monster_inv(), give_initial_items(), god_examines_priest(), god_removes_curse(), hit_map(), hit_player(), hit_with_one_attacktype(), identify_altar_type_move_on(), inventory(), is_defined_recipe(), is_true_undead(), learn_skill(), link_player_skills(), lookup_spell_by_name(), loot_object(), mark_inventory_as_no_drop(), meditate(), monster_check_apply_all(), monster_choose_random_spell(), monster_find_throw_ob(), monster_talk_to_npc(), monster_use_range(), monster_use_scroll(), monster_use_skill(), move_ob(), numb_ob_inside(), object_copy_with_inv(), object_create_clone(), object_free2(), object_insert_in_ob(), object_sum_weight(), pay_for_amount(), pay_for_item(), pay_from_container(), player_changer_type_process(), polymorph_living(), put_object_in_sack(), query_money(), remove_curse(), remove_special_prayers(), remove_trap(), save_object(), save_throw_object(), sell_item(), shop_mat_type_move_on(), show_matching_spells(), show_skills(), spell_consume_items(), stop_using_item(), subtract_player_exp(), transmute_item_to_flower(), transport_type_apply(), turn_one_transport(), unapply_for_ob(), use_skill(), and write_rune().

#define FOR_INV_PREPARE (   op_,
  it_ 
)
Value:
do { \
object *it_ = (op_)->inv; \
struct obj object
#define FOR_OB_AND_BELOW_PREPARE(op_)
Definition: define.h:785

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

Referenced by add_abilities(), adj_stealchance(), alchemy(), alchemy_failure_effect(), apply_auto(), apply_auto_fix(), apply_death_exp_penalty(), attempt_do_alchemy(), attempt_steal(), become_follower(), calc_alch_danger(), cancellation(), cast_bless(), cast_change_ability(), cast_curse(), cast_detection(), cast_identify(), cfapi_object_find_archetype_inside(), check_equipment(), check_inv_recursive(), check_physically_infect(), check_slaying_inventory(), CREMapInformationManager::checkInventory(), clean_object(), command_drop(), command_dropall(), command_empty(), command_rename_item(), content_recipe_value(), cure_disease(), do_auto_apply(), do_execute_event(), do_harvest(), do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), empty_container(), esrv_add_spells(), esrv_get_ob_from_count(), esrv_move_object(), esrv_send_inventory(), esrv_update_spells(), examine(), find_arrow(), find_best_player_hth_skill(), find_better_arrow(), find_key(), find_or_create_connection_for_map(), find_random_spell_in_ob(), find_skill_by_name(), find_skill_by_number(), find_throw_ob(), find_traps(), fix_container_multipart(), fix_object(), follower_has_similar_item(), follower_remove_given_items(), generate_monster_inv(), give_initial_items(), god_examines_priest(), god_removes_curse(), hit_map(), hit_player(), hit_with_one_attacktype(), identify_altar_type_move_on(), inventory(), is_defined_recipe(), is_true_undead(), learn_skill(), link_player_skills(), lookup_spell_by_name(), loot_object(), mark_inventory_as_no_drop(), meditate(), monster_check_apply_all(), monster_choose_random_spell(), monster_find_throw_ob(), monster_talk_to_npc(), monster_use_range(), monster_use_scroll(), monster_use_skill(), move_ob(), numb_ob_inside(), object_copy_with_inv(), object_create_clone(), object_free2(), object_insert_in_ob(), object_sum_weight(), pay_for_amount(), pay_for_item(), pay_from_container(), player_changer_type_process(), polymorph_living(), put_object_in_sack(), query_money(), remove_curse(), remove_special_prayers(), remove_trap(), save_object(), save_throw_object(), sell_item(), shop_mat_type_move_on(), show_matching_spells(), show_skills(), spell_consume_items(), stop_using_item(), subtract_player_exp(), transmute_item_to_flower(), transport_type_apply(), turn_one_transport(), unapply_for_ob(), use_skill(), and write_rune().

#define FOR_MAP_FINISH ( )
Value:
} while(0)
#define FOR_OB_AND_ABOVE_FINISH()
Definition: define.h:778

Finishes FOR_MAP_PREPARE().

Definition at line 765 of file define.h.

Referenced by add_exits_to_map(), alchemy(), apply_auto_fix(), apply_builder_floor(), attack_message(), attempt_jump(), blocked_link(), calculate_difficulty(), can_build_over(), cast_cause_disease(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_identify(), cast_raise_dead_spell(), cast_transfer(), check_bullet(), check_infection(), command_style_map_info(), coords_in_shop(), counterspell(), decay_objects(), delete_unique_items(), dispel_rune(), do_auto_apply(), do_exit_map(), do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), door_in_square(), esrv_get_ob_from_count(), find_arch_at(), find_by_name(), find_closest_monster(), find_monster_in_room_recursive(), find_target_for_friendly_spell(), find_traps(), generate_monster(), get_connection_rune(), get_msg_book(), get_wall(), hit_map(), include_map_in_map(), kill_player_not_permadeath(), link_multipart_objects(), load_objects(), map_find_by_archetype(), map_find_by_type(), map_find_dir(), monster_check_doors(), monster_check_earthwalls(), monster_communicate(), monster_find_nearest_living_creature(), monster_npc_call_help(), move_player_attack(), move_player_mover(), nuke_map_region(), obj_count_in_map(), object_decrease_nrof(), object_increase_nrof(), object_insert_in_map(), object_merge_spell(), object_remove(), object_replace_insert_in_map(), ok_to_put_more(), peacemaker_type_process(), pets_get_enemy(), pets_move(), pets_move_golem(), pick_arrow_target(), place_exits(), probe(), CREMapInformationManager::process(), process_map(), reflwall(), remove_adjacent_doors(), remove_marking_runes(), remove_monsters(), remove_trap(), retrofit_joined_wall(), roll_ob(), save_objects(), singing(), skill_attack(), stand_near_hostile(), teleport(), try_fit(), unblock_exits(), update_position(), use_alchemy(), use_oratory(), and write_rune().

#define FOR_MAP_PREPARE (   map_,
  mx_,
  my_,
  it_ 
)
Value:
do { \
object *it_ = GET_MAP_OB((map_), (mx_), (my_)); \
#define FOR_OB_AND_ABOVE_PREPARE(op_)
Definition: define.h:774
struct obj object
#define GET_MAP_OB(M, X, Y)
Definition: map.h:172

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

Referenced by add_exits_to_map(), alchemy(), apply_auto_fix(), apply_builder_floor(), attack_message(), attempt_jump(), blocked_link(), calculate_difficulty(), can_build_over(), cast_cause_disease(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_identify(), cast_raise_dead_spell(), cast_transfer(), check_bullet(), check_infection(), command_style_map_info(), coords_in_shop(), counterspell(), decay_objects(), delete_unique_items(), dispel_rune(), do_auto_apply(), do_exit_map(), do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), door_in_square(), esrv_get_ob_from_count(), find_arch_at(), find_by_name(), find_closest_monster(), find_monster_in_room_recursive(), find_target_for_friendly_spell(), find_traps(), generate_monster(), get_connection_rune(), get_msg_book(), get_wall(), hit_map(), include_map_in_map(), kill_player_not_permadeath(), link_multipart_objects(), load_objects(), map_find_by_archetype(), map_find_by_type(), map_find_dir(), monster_check_doors(), monster_check_earthwalls(), monster_communicate(), monster_find_nearest_living_creature(), monster_npc_call_help(), move_player_attack(), move_player_mover(), nuke_map_region(), obj_count_in_map(), object_decrease_nrof(), object_increase_nrof(), object_insert_in_map(), object_merge_spell(), object_remove(), object_replace_insert_in_map(), ok_to_put_more(), peacemaker_type_process(), pets_get_enemy(), pets_move(), pets_move_golem(), pick_arrow_target(), place_exits(), probe(), CREMapInformationManager::process(), process_map(), reflwall(), remove_adjacent_doors(), remove_marking_runes(), remove_monsters(), remove_trap(), retrofit_joined_wall(), roll_ob(), save_objects(), singing(), skill_attack(), stand_near_hostile(), teleport(), try_fit(), unblock_exits(), update_position(), use_alchemy(), use_oratory(), and write_rune().

#define FOR_OB_AND_ABOVE_FINISH ( )    FOR_OB_FINISH()
#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 774 of file define.h.

Referenced by apply_builder_item(), apply_map_builder(), cast_create_town_portal(), object_check_move_on(), object_insert_in_map(), and steal().

#define FOR_OB_AND_BELOW_PREPARE (   op_)    FOR_OB_PREPARE(op_, below, __LINE__)
#define FOR_OB_FINISH ( )
Value:
} \
} while(0)

Finishes FOR_OB_PREPARE().

Definition at line 819 of file define.h.

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

#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;
#define object_was_destroyed(op, old_tag)
Definition: object.h:68
struct obj object
uint32_t tag_t
Definition: object.h:12

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

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

Definition at line 453 of file define.h.

Referenced by generate_monster().

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

Definition at line 452 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 183 of file define.h.

Referenced by apply_auto(), apply_auto_fix(), do_auto_apply(), generate_monster_arch(), generate_monster_inv(), polymorph_living(), and rune_attack().

#define MAX_ANIMATIONS   256

Definition at line 39 of file define.h.

Referenced by init_anim().

#define MAX_BUF   256

Used for all kinds of things

Definition at line 35 of file define.h.

Referenced by account_add_player_cmd(), account_char_load(), account_char_save(), account_login_cmd(), account_new_cmd(), account_password(), accounts_load(), accounts_save(), add_abilities(), add_author(), add_exit_to_item(), add_object_to_socklist(), 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_by_living(), apply_changes_to_player(), apply_check_apply_restrictions(), apply_check_race_restrictions(), apply_container(), apply_race_and_class(), apply_special(), apply_update_ranged_skill(), attack_hth(), attack_message(), attempt_jump(), attempt_steal(), basic_emote(), blind_living(), book_type_apply(), CREMapInformationManager::browseMaps(), 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_spell(), check_login(), check_path(), 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(), content_recipe_value(), convert_newline(), converter_type_move_on(), copy_file(), create_archetype_by_object_name(), create_player_cmd(), create_singularity(), dead_player(), decode_name_password(), delete_character(), describe_god(), display_motd(), display_who_entry(), do_skill(), do_skill_attack(), do_tell(), do_throw(), dragon_ability_gain(), dragon_eat_flesh(), drop_object(), dump_alchemy(), dump_alchemy_costs(), empty_container(), enter_fixed_template_map(), enter_player_savebed(), enter_random_template_map(), enter_unique_map(), esrv_draw_look(), esrv_send_inventory(), esrv_update_item(), esrv_update_stats(), eventListener(), examine(), exit_type_apply(), find_key(), find_player_options(), find_throw_ob(), fire_misc_object(), fix_flesh_item(), fix_walls(), food_type_apply(), forbid_play(), get_string_move_type(), give_artifact_abilities(), god_enchants_weapon(), god_examines_item(), gravestone_text(), help_topics(), hiscore_check(), hiscore_display(), hiscore_load(), hiscore_save(), hit_with_one_attacktype(), i18n_init(), identify_altar_type_move_on(), identify_object_with_skill(), init_anim(), init_artifacts(), init_attackmess(), init_book_archive(), init_clocks(), init_emergency_mappath(), init_experience(), init_formulae(), init_listening_socket(), init_msgfile(), init_races(), init_regions(), init_server(), init_startup(), init_stats(), initPlugins(), inventory(), is_defined_recipe(), key_change_class(), key_confirm_quit(), kill_object(), kill_player(), kill_player_not_permadeath(), kill_player_permadeath(), knowledge_alchemy_attempt(), knowledge_alchemy_detail(), knowledge_god_face(), knowledge_item_can_be_used_alchemy(), knowledge_player_knows(), knowledge_read_player_data(), knowledge_write_player_data(), leave(), lighter_type_apply(), load_archetypes(), load_materials(), load_overlay_map(), load_quests_from_file(), load_settings(), load_table_float(), load_table_int(), load_treasure(), load_treasures(), load_unique_objects(), QuestManager::loadQuestFile(), look_at(), magic_wall(), main(), make_formula_book(), make_list_like(), make_path_to_file(), map_info(), mapfile_load(), mark_item_cmd(), matches_sacrifice(), metaserver2_init(), monster_can_detect_enemy(), monster_communicate(), monster_find_throw_ob(), monster_format_say(), monsterFight(), move_symptom(), new_connection(), new_player_cmd(), nstrtok(), object_matches_string(), output_quests(), parse_regions(), party_form(), party_join(), party_leave(), perceive_self(), pets_summon_golem(), pick_up_object(), player_lvl_adj(), polymorph_melt(), potion_type_apply(), power_crystal_type_apply(), pray(), print_shop_string(), CREMapInformationManager::process(), process_map(), put_object_in_sack(), quest_read_player_data(), quest_write_player_data(), rangetostring(), read_bmap_names(), read_face_data(), read_map_log(), read_smooth(), recharge(), recursive_roll(), remove_directory(), resurrect_player(), sack_can_hold(), save_life(), save_map(), save_player(), save_throw_object(), second_arch_pass(), sell_item(), send_arch_info(), send_file(), send_new_char_info(), send_news(), send_rules(), shop_describe(), shop_pay_unpaid(), show_matching_spells(), show_skills(), singing(), skillscroll_type_apply(), spell_consume_items(), spellbook_type_apply(), START_TEST(), strtoktolin(), 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_readable_list(), write_regions_link(), write_rune(), write_scroll(), write_slaying_info(), write_todclock(), and write_world_info().

#define MAX_DARKNESS   5

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

Definition at line 470 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 466 of file define.h.

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

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

Referenced by god_enchants_weapon(), and improve_weapon().

#define MIN_ACTIVE_SPEED   0.00001
#define MIN_STAT   1

The minimum legal value of any stat

Definition at line 33 of file define.h.

Referenced by change_abil(), check_race_and_class(), fix_player(), init_stats(), and kill_player_not_permadeath().

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

Referenced by load_dir().

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

Definition at line 156 of file define.h.

#define RANDOM ( )    cf_random()

Definition at line 679 of file define.h.

Referenced by add_abilities(), add_author(), add_npc_to_point(), add_npc_to_random_map(), add_npc_to_zone(), add_npcs_to_map(), alchemy_failure_effect(), artifact_describe(), artifact_msg(), bottom_centered_onion(), bottom_right_centered_onion(), centered_onion(), change_book(), change_luck(), citylife_globalEventListener(), create_all_treasures(), create_one_treasure(), crypt_string(), die_roll(), doorify_layout(), dragon_eat_flesh(), drain_stat(), eventListener(), fill_maze_full(), fill_maze_sparse(), find_doors_in_room_recursive(), find_free_point(), find_in_layout(), find_monster_in_room_recursive(), find_random_spell_in_ob(), find_spot_for_submap(), find_spot_in_room(), find_spot_in_room_recursive(), find_style(), find_transmution_ob(), fire_arch_from_position(), fix_generated_item(), flee_player(), generate_artifact(), generate_random_map(), get_magic(), get_npc(), get_rand_god(), get_random_mon(), get_random_recipe(), get_random_recipelist(), get_randomized_dir(), god_info_msg(), handle_spell_confusion(), hit_player(), keyplace(), kill_player_not_permadeath(), knowledge_alchemy_can_use_item(), knowledge_alchemy_detail(), knowledge_alchemy_summary(), layoutgen(), lock_and_hide_doors(), loot_object(), magic_from_difficulty(), make_doors(), make_formula_book(), make_snake_layout(), make_square_spiral_layout(), map_gen_onion(), map_gen_spiral(), monster_can_detect_enemy(), monster_can_hit(), monster_choose_random_spell(), monster_circ1_move(), monster_circ2_move(), monster_compute_path(), monster_do_living(), monster_move(), monster_move_randomly(), monster_rand_move(), msgfile_msg(), new_text_name(), object_copy(), object_find_free_spot(), object_find_multi_free_spot_around(), object_find_multi_free_spot_within_radius(), object_free2(), permute(), pets_move(), pets_summon_object(), pick_random_object(), place_chest(), place_exits(), place_fountain_with_specials(), place_monsters(), place_special_exit(), place_specials_in_map(), place_treasure(), play_sound_map(), play_sound_player_only(), pop_wall_point(), put_decor(), random_roll(), random_roll64(), resurrect_player(), rndm(), roguelike_layout_gen(), roguelike_link_rooms(), roguelike_make_rooms(), roguelike_place_room(), roll_stat(), roomify_layout(), save_throw_object(), set_abs_magic(), set_ring_bonus(), spellpath_msg(), START_TEST(), swap_random_stats(), tailor_readable_ob(), and teleport().

#define SET_GENERATE_TYPE (   xyz,
  va 
)    (xyz)->stats.sp = (va)

Definition at line 451 of file define.h.

#define SIZEOFFREE1   8
#define SIZEOFFREE2   24

Definition at line 153 of file define.h.

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

#define SMOOTH_FACE_NAME   "default_smoothed.111"

Definition at line 593 of file define.h.

Referenced by read_bmap_names().

#define SRANDOM (   seed)    cf_srandom(seed)

Definition at line 680 of file define.h.

Referenced by generate_random_map(), init(), and test_layout().

#define VERY_BIG_BUF   1024

Definition at line 36 of file define.h.

Referenced by account_char_load(), accounts_load(), command_rename_item(), and examine().

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

Definition at line 482 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 686 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.

Enumeration Type Documentation

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

uint32_t cf_random ( void  )

Definition at line 6 of file cf_random.c.

void cf_srandom ( unsigned long  seed)

Definition at line 16 of file cf_random.c.