Atrinik Server 2.5
Defines | Functions | Variables
server/object.c File Reference
#include <global.h>
#include <skillist.h>
#include <loader.h>

Go to the source code of this file.

Defines

#define NUM_MATERIALS_REAL   NROFMATERIALS * NROFMATERIALS_REAL + 1

Functions

static void remove_ob_inv (object *op)
void init_materials ()
void mark_object_removed (object *ob)
void object_gc ()
static int compare_ob_value_lists_one (const object *wants, const object *has)
static int compare_ob_value_lists (const object *ob1, const object *ob2)
int CAN_MERGE (object *ob1, object *ob2)
objectmerge_ob (object *op, object *top)
signed long sum_weight (object *op)
void add_weight (object *op, sint32 weight)
void sub_weight (object *op, sint32 weight)
objectget_env_recursive (object *op)
objectis_player_inv (object *op)
void dump_object (object *op, StringBuffer *sb)
void dump_object_rec (object *op, StringBuffer *sb)
objectget_owner (object *op)
void clear_owner (object *op)
static void set_owner_simple (object *op, object *owner)
static void set_skill_pointers (object *op, object *chosen_skill, object *exp_obj)
void set_owner (object *op, object *owner)
void copy_owner (object *op, object *clone)
void initialize_object (object *op)
void copy_object (object *op2, object *op, int no_speed)
void copy_object_with_inv (object *src_ob, object *dest_ob)
objectget_object ()
void update_turn_face (object *op)
void update_ob_speed (object *op)
void update_object (object *op, int action)
void drop_ob_inv (object *ob)
void destroy_object (object *ob)
void destruct_ob (object *op)
void remove_ob (object *op)
objectinsert_ob_in_map (object *op, mapstruct *m, object *originator, int flag)
void replace_insert_ob_in_map (char *arch_string, object *op)
objectget_split_ob (object *orig_ob, int nr, char *err, size_t size)
objectdecrease_ob_nr (object *op, uint32 i)
objectinsert_ob_in_ob (object *op, object *where)
int check_walk_on (object *op, object *originator, int flags)
int check_walk_off (object *op, object *originator, int flags)
objectpresent_arch (archetype *at, mapstruct *m, int x, int y)
objectpresent (uint8 type, mapstruct *m, int x, int y)
objectpresent_in_ob (uint8 type, object *op)
objectpresent_arch_in_ob (archetype *at, object *op)
int find_free_spot (archetype *at, object *op, mapstruct *m, int x, int y, int start, int stop)
int find_first_free_spot (archetype *at, object *op, mapstruct *m, int x, int y)
int find_first_free_spot2 (archetype *at, mapstruct *m, int x, int y, int start, int range)
void permute (int *arr, int begin, int end)
void get_search_arr (int *search_arr)
int find_dir_2 (int x, int y)
int absdir (int d)
int dirdiff (int dir1, int dir2)
int get_dir_to_target (object *op, object *target, rv_vector *range_vector)
int can_pick (object *who, object *item)
objectobject_create_clone (object *asrc)
int was_destroyed (object *op, tag_t old_tag)
objectload_object_str (char *obstr)
int auto_apply (object *op)
int can_see_monsterP (mapstruct *m, int x, int y, int dir)
void free_key_values (object *op)
key_valueobject_get_key_link (const object *ob, const char *key)
const char * object_get_value (const object *op, const char *const key)
static int object_set_value_s (object *op, const char *canonical_key, const char *value, int add_key)
int object_set_value (object *op, const char *key, const char *value, int add_key)
void init_object_initializers ()
int item_matched_string (object *pl, object *op, const char *name)
int object_get_gender (object *op)
objectobject_need_esrv_update (object *op)
void object_remove_esrv_update (object *op)

Variables

struct mempool_chunkremoved_objects
objectactive_objects
static int static_walk_semaphore = 0
object void_container
static const int reduction_dir [SIZEOFFREE][3]
const char * gender_noun [GENDER_MAX]
const char * gender_subjective [GENDER_MAX]
const char * gender_subjective_upper [GENDER_MAX]
const char * gender_objective [GENDER_MAX]
const char * gender_possessive [GENDER_MAX]
const char * gender_reflexive [GENDER_MAX]
materialtype materials [NROFMATERIALS]
material_real_struct material_real [NUM_MATERIALS_REAL]
int freearr_x [SIZEOFFREE]
int freearr_y [SIZEOFFREE]
int maxfree [SIZEOFFREE]
int freedir [SIZEOFFREE]
const char * object_flag_names [NUM_FLAGS+1]

Detailed Description

Object related code.

Definition in file object.c.


Function Documentation

int absdir ( int  d)

Computes an absolute direction.

Parameters:
dDirection to convert.
Returns:
Number between 1 and 8, which represent the "absolute" direction of a number (it actually takes care of "overflow" in previous calculations of a direction).

Definition at line 3111 of file object.c.

void add_weight ( object op,
sint32  weight 
)

Adds the specified weight to an object, and also updates how much the environment(s) is/are carrying.

Parameters:
opThe object
weightThe weight to add

Definition at line 672 of file object.c.

int auto_apply ( object op)

Process object with FLAG_AUTO_APPLY.

Basically creates treasure for objects like shop floors and treasures.

Parameters:
opThe object to process.
Returns:
1 if a new object was generated, 0 otherwise.

Definition at line 3319 of file object.c.

int CAN_MERGE ( object ob1,
object ob2 
)

Moved this out of define.h and in here, since this is the only file it is used in. Also, make it an inline function for cleaner design.

Examines two objects given to, and returns 1 if they can be merged together.

Check nrof variable before calling this.

Improvements made with merge: Better checking on potion, and also check weight

Note:
This function appears a lot longer than the macro it replaces (mostly for clarity). A decent compiler should hopefully reduce this to the same efficiency.
Parameters:
ob1The first object
ob2The second object
Returns:
1 if the two object can merge, 0 otherwise

Definition at line 438 of file object.c.

int can_pick ( object who,
object item 
)

Finds out if an object can be picked up.

Parameters:
whoWho is trying to pick up. Can be a monster or a player.
itemItem we're trying to pick up.
Returns:
1 if it can be picked up, 0 otherwise.
Note:
This introduces a weight limitation for monsters.

Definition at line 3187 of file object.c.

int can_see_monsterP ( mapstruct m,
int  x,
int  y,
int  dir 
)

Recursive routine to see if we can find a path to a certain point.

Parameters:
mMap we're on
xX coordinate.
yY coordinate.
dirDirection we're going to. Must be less than SIZEOFFREE.
Returns:
1 if we can see a direct way to get it

Definition at line 3421 of file object.c.

int check_walk_off ( object op,
object originator,
int  flags 
)
Todo:
Document.

Definition at line 2706 of file object.c.

int check_walk_on ( object op,
object originator,
int  flags 
)
Todo:
Document.

Definition at line 2617 of file object.c.

void clear_owner ( object op)

Clear pointer to owner of an object, including ownercount.

Parameters:
opThe object to clear the owner for

Definition at line 852 of file object.c.

static int compare_ob_value_lists ( const object ob1,
const object ob2 
) [static]

Compares two object lists.

Parameters:
ob1Object to compare.
ob2Object to compare.
Returns:
1 if ob1 has the same key_values as ob2.

Definition at line 414 of file object.c.

static int compare_ob_value_lists_one ( const object wants,
const object has 
) [static]

Compares value lists.

Parameters:
wantsWhat to search.
hasWhere to search.
Returns:
1 if every key_values in wants has a partner with the same value in has.

Definition at line 385 of file object.c.

void copy_object ( object op2,
object op,
int  no_speed 
)

Copy object first frees everything allocated by the second object, and then copies the contents of the first object into the second object, allocating what needs to be allocated.

Parameters:
op2Object that we copy from.
opObject that we copy to.
no_speedIf set, do not touch the active list.

Definition at line 1005 of file object.c.

void copy_object_with_inv ( object src_ob,
object dest_ob 
)

Copy an object with an inventory, duplicating the inv too.

Parameters:
src_obObject to copy.
dest_obWhere to copy.

Definition at line 1087 of file object.c.

void copy_owner ( object op,
object clone 
)

Set the owner to clone's current owner and set the skill and experience objects to clone's objects (typically those objects that where the owner's current skill and experience objects at the time when clone's owner was set - not the owner's current skill and experience objects).

Use this function if player created an object (e.g. fire bullet, swarm spell), and this object creates further objects whose kills should be accounted for the player's original skill, even if player has changed skills meanwhile.

Parameters:
opThe object.
cloneThe clone.

Definition at line 935 of file object.c.

object* decrease_ob_nr ( object op,
uint32  i 
)

Decreases a specified number from the amount of an object. If the amount reaches 0, the object is subsequently removed and freed.

This function will send an update to client if op is in a player inventory.

Parameters:
opObject to decrease.
iNumber to remove.
Returns:
'op' if something is left, NULL if the amount reached 0.

Definition at line 2396 of file object.c.

void destroy_object ( object ob)

Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects. This function is called automatically to free unused objects (it is called from return_poolchunk() during garbage collection in object_gc() ).

The object must have been removed by remove_ob() first for this function to succeed.

Parameters:
obThe object to destroy.

Definition at line 1596 of file object.c.

void destruct_ob ( object op)

Drop op's inventory on the floor and remove op from the map.

Used mainly for physical destruction of normal objects and monsters.

Parameters:
opObject to destruct.

Definition at line 1693 of file object.c.

int dirdiff ( int  dir1,
int  dir2 
)

Computes a direction difference.

Parameters:
dir1First direction to compare.
dir2Second direction to compare.
Returns:
How many 45-degrees differences there is between two directions (which are expected to be absolute (see absdir()).

Definition at line 3132 of file object.c.

void drop_ob_inv ( object ob)

Drops the inventory of ob into ob's current environment.

Makes some decisions whether to actually drop or not, and/or to create a corpse for the stuff.

Parameters:
obThe object to drop the inventory for.

Definition at line 1431 of file object.c.

void dump_object ( object op,
StringBuffer sb 
)

Dumps an object.

Parameters:
opObject to dump. Can be NULL.
sbBuffer that will contain object information. Must not be NULL.

Definition at line 765 of file object.c.

void dump_object_rec ( object op,
StringBuffer sb 
)

Dump an object, complete with its inventory.

Parameters:
opObject to dump.
sbBuffer that will contain object information.

Definition at line 791 of file object.c.

int find_dir_2 ( int  x,
int  y 
)

Computes a direction which you should travel to move of x and y.

Parameters:
xDelta.
yDelta.
Returns:
Direction

Definition at line 3044 of file object.c.

int find_first_free_spot ( archetype at,
object op,
mapstruct m,
int  x,
int  y 
)

Works like find_free_spot(), but it will search max number of squares.

It will return the first available spot, not a random choice.

Todo:
Document.

Definition at line 2963 of file object.c.

int find_first_free_spot2 ( archetype at,
mapstruct m,
int  x,
int  y,
int  start,
int  range 
)
Todo:
Document.

Definition at line 2980 of file object.c.

int find_free_spot ( archetype at,
object op,
mapstruct m,
int  x,
int  y,
int  start,
int  stop 
)

Will search for a spot at the given map and coordinates which will be able to contain the given archetype. start and stop specifies how many squares to search (see the freearr_x/y[] definition).

It returns a random choice among the alternatives found. start and stop are where to start relative to the free_arr array (1,9 does all 4 immediate directions). This returns the index into the array of the free spot, -1 if no spot available (dir 0 = x,y)

Note:
This only checks to see if there is space for the head of the object - if it is a multispace object, this should be called for all pieces.
Todo:
Document.

Definition at line 2933 of file object.c.

void free_key_values ( object op)

Zero the key_values on op, decrementing the shared-string refcounts and freeing the links.

Parameters:
opObject to clear.

Definition at line 3457 of file object.c.

int get_dir_to_target ( object op,
object target,
rv_vector range_vector 
)

Get direction from one object to another.

If the first object is a player, this will set the player's facing direction to the returned direction.

Parameters:
opThe first object
targetThe target object
range_vectorRange vector pointer to use
Returns:
The direction

Definition at line 3153 of file object.c.

object* get_env_recursive ( object op)

Utility function.

Parameters:
opObject we want the environment of. Can't be NULL.
Returns:
The outermost environment object for a given object. Will not be NULL.

Definition at line 733 of file object.c.

object* get_object ( )

Grabs an object from the list of unused objects, makes sure it is initialized, and returns it.

If there are no free objects, expand_objects() is called to get more.

Returns:
The new object.

Definition at line 1107 of file object.c.

object* get_owner ( object op)

Returns the object which this object marks as being the owner.

An ID scheme is used to avoid pointing to objects which have been freed and are now reused. If this is detected, the owner is set to NULL, and NULL is returned.

(This scheme should be changed to a refcount scheme in the future)

Parameters:
opThe object to get owner for
Returns:
Owner of the object if any, NULL if no owner

Definition at line 832 of file object.c.

void get_search_arr ( int *  search_arr)

New function to make monster searching more efficient, and effective! This basically returns a randomized array (in the passed pointer) of the spaces to find monsters. In this way, it won't always look for monsters to the north first. However, the size of the array passed covers all the spaces, so within that size, all the spaces within the 3x3 area will be searched, just not in a predictable order.

Parameters:
search_arrArray that will be initialized. Must contain at least SIZEOFFREE elements.

Definition at line 3025 of file object.c.

object* get_split_ob ( object orig_ob,
int  nr,
char *  err,
size_t  size 
)

Splits up ob into two parts. The part which is returned contains nr objects, and the remaining parts contains the rest (or is removed and freed if that number is 0).

Parameters:
orig_obObject from which to split.
nrNumber of elements to split.
errBuffer that will contain failure reason if NULL is returned. Can be NULL.
sizeerr's size.
Returns:
Split object, or NULL on failure.

Definition at line 2327 of file object.c.

void init_materials ( )

Initialize materials from file.

Definition at line 173 of file object.c.

void init_object_initializers ( )

Initialize the table of object initializers.

Definition at line 3663 of file object.c.

void initialize_object ( object op)

Frees everything allocated by an object, and also initializes all variables and flags to default settings.

Parameters:
opThe object

Definition at line 965 of file object.c.

object* insert_ob_in_map ( object op,
mapstruct m,
object originator,
int  flag 
)

This function inserts the object in the two-way linked list which represents what is on a map.

Parameters:
opObject to insert.
mMap to insert into.
originatorWhat caused op to be inserted.
flagCombination of INS_xxx values.
Returns:
NULL if 'op' was destroyed, 'op' otherwise.

Definition at line 1920 of file object.c.

object* insert_ob_in_ob ( object op,
object where 
)

This function inserts the object op in the linked list inside the object environment.

Parameters:
opObject to insert. Must be removed and not NULL. Must not be multipart. May become invalid after return, so use return value of the function.
whereObject to insert into. Must not be NULL. Should be the head part.
Returns:
Pointer to inserted item, which will be different than op if object was merged.

Definition at line 2477 of file object.c.

object* is_player_inv ( object op)

Finds the player carrying an object.

Parameters:
opItem for which we want the carrier (player).
Returns:
The player, or NULL if not in an inventory.

Definition at line 747 of file object.c.

int item_matched_string ( object pl,
object op,
const char *  name 
)

This is a subset of the parse_id command. Basically, name can be a string separated lists of things to match, with certain keywords.

Calling function takes care of what action might need to be done and if it is valid (pickup, drop, etc).

Brief outline of the procedure:

We take apart the name variable into the individual components. cases for 'all' and unpaid are pretty obvious.

Next, we check for a count (either specified in name, or in the player object). If count is 1, make a quick check on the name. If count is >1, we need to make plural name. Return if match.

Last, make a check on the full name.

Parameters:
plPlayer (only needed to set count properly).
opThe item we're trying to match.
nameString we're searching.
Returns:
Non-zero if we have a match. A higher value means a better match. Zero means no match.

Definition at line 3693 of file object.c.

object* load_object_str ( char *  obstr)

Creates an object using a string representing its content.

Parameters:
obstrString to load the object from.
Returns:
The newly created object, NULL on failure.

Definition at line 3297 of file object.c.

void mark_object_removed ( object ob)

Put an object in the list of removal candidates.

If the object has still FLAG_REMOVED set at the end of the server timestep it will be freed.

Parameters:
obThe object.

Definition at line 323 of file object.c.

object* merge_ob ( object op,
object top 
)

This function goes through all objects below and including top, and merges op to the first matching object. If top is NULL, it is calculated.

Parameters:
opThe object
topThe top object
Returns:
Pointer to object if it succeeded in the merge, NULL otherwise

Definition at line 583 of file object.c.

object* object_create_clone ( object asrc)

Create clone from one object to another.

Parameters:
asrcObject to clone.
Returns:
Clone of asrc, including inventory and 'more' body parts.

Definition at line 3228 of file object.c.

void object_gc ( )

Go through all objects in the removed list and free the forgotten ones.

Definition at line 346 of file object.c.

int object_get_gender ( object op)

Get object's gender ID, as defined in Gender IDs..

Parameters:
opObject to get gender ID of.
Returns:
The gender ID.

Definition at line 3932 of file object.c.

key_value* object_get_key_link ( const object ob,
const char *  key 
)

Search for a field by key.

Parameters:
obObject to search in.
keyKey to search. Must be a shared string.
Returns:
The link from the list if ob has a field named key, NULL otherwise.

Definition at line 3494 of file object.c.

const char* object_get_value ( const object op,
const char *const  key 
)

Get an extra value by key.

Parameters:
opObject we're considering.
keyKey of which to retrieve the value. Doesn't need to be a shared string.
Returns:
The value if found, NULL otherwise.
Note:
The returned string is shared.

Definition at line 3516 of file object.c.

object* object_need_esrv_update ( object op)

Figure out whether an object needs to be updated for the player (because it's getting removed, modified, etc).

Parameters:
opObject about to be removed/modified/etc.
Returns:
If NULL, the object doesn't need an update. Otherwise this is the player object to update for.

Definition at line 3952 of file object.c.

void object_remove_esrv_update ( object op)

Remove an object and figure out whether a socket update is necessary.

Parameters:
opWhat to remove.

Definition at line 3979 of file object.c.

int object_set_value ( object op,
const char *  key,
const char *  value,
int  add_key 
)

Updates the key in op to value.

Parameters:
opObject we're considering.
keyKey to set or update. Doesn't need to be a shared string.
valueValue to set. Doesn't need to be a shared string.
add_keyIf 0, will not add the key if it doesn't exist in op.
Returns:
1 if key was updated or added, 0 otherwise.
Note:
This function is merely a wrapper to object_set_value_s() to ensure the key is a shared string.

Definition at line 3640 of file object.c.

static int object_set_value_s ( object op,
const char *  canonical_key,
const char *  value,
int  add_key 
) [static]

Updates or sets a key value.

Parameters:
opObject we're considering.
canonical_keyKey to set or update. Must be a shared string.
valueValue to set. Doesn't need to be a shared string.
add_keyIf 0, will not add the key if it doesn't exist in op.
Returns:
1 if key was updated or added, 0 otherwise.

Definition at line 3546 of file object.c.

void permute ( int *  arr,
int  begin,
int  end 
)

Randomly permutes an array.

Parameters:
arrArray to permute.
beginFirst index to permute.
endSecond index to permute.

Definition at line 3000 of file object.c.

object* present ( uint8  type,
mapstruct m,
int  x,
int  y 
)

Searches for any objects with a matching type at the given map and coordinates.

Parameters:
typeType to find.
mMap.
xX coordinate on map.
yY coordinate on map.
Returns:
First matching object, or NULL if none matches.

Definition at line 2856 of file object.c.

object* present_arch ( archetype at,
mapstruct m,
int  x,
int  y 
)

Searches for any objects with a matching archetype at the given map and coordinates.

Parameters:
atArchetype to look for.
mMap.
xX coordinate on map.
yY coordinate on map.
Returns:
First matching object, or NULL if none matches.

Definition at line 2827 of file object.c.

object* present_arch_in_ob ( archetype at,
object op 
)

Searches for any objects with a matching archetype in the inventory of the given object.

Parameters:
atArchetype to search for.
opWhere to search.
Returns:
First matching object, or NULL if none matches.

Definition at line 2904 of file object.c.

object* present_in_ob ( uint8  type,
object op 
)

Searches for any objects with a matching type variable in the inventory of the given object.

Parameters:
typeType to search for.
opObject to search into.
Returns:
First matching object, or NULL if none matches.

Definition at line 2883 of file object.c.

void remove_ob ( object op)

This function removes the object op from the linked list of objects which it is currently tied to. When this function is done, the object will have no environment. If the object previously had an environment, the x and y coordinates will be updated to the previous environment.

Note:
If you want to remove a lot of items in player's inventory, set FLAG_NO_FIX_PLAYER on the player first and then explicitly call fix_player() on the player.
Parameters:
opObject to remove.

Definition at line 1715 of file object.c.

static void remove_ob_inv ( object op) [static]

Recursively remove the inventory of an object.

Parameters:
opObject.

Definition at line 1893 of file object.c.

void replace_insert_ob_in_map ( char *  arch_string,
object op 
)

This function inserts an object of a specified archetype in the map, but if it finds objects of its own type, it'll remove them first.

Parameters:
arch_stringObject's archetype to insert.
opObject to insert under, supplies coordinates and the map.

Definition at line 2295 of file object.c.

void set_owner ( object op,
object owner 
)

Sets the owner and sets the skill and exp pointers to owner's current skill and experience objects.

Parameters:
opThe object.
ownerThe owner.

Definition at line 906 of file object.c.

static void set_owner_simple ( object op,
object owner 
) [static]

Sets the owner of the first object to the second object.

Also checkpoints a backup id scheme which detects freeing (and reusage) of the owner object.

Parameters:
opThe object to set the owner for
ownerThe owner
See also:
get_owner()

Definition at line 871 of file object.c.

void sub_weight ( object op,
sint32  weight 
)

Recursively (outwards) subtracts a number from the weight of an object (and what is carried by its environment(s)).

Parameters:
opThe object
weightThe weight to subtract

Definition at line 703 of file object.c.

signed long sum_weight ( object op)

Recursive function to calculate the weight an object is carrying.

It goes through in figures out how much containers are carrying, and sums it up.

Parameters:
opThe object to calculate the weight for
Returns:
The calculated weight

Definition at line 628 of file object.c.

void update_ob_speed ( object op)

Updates the speed of an object. If the speed changes from 0 to another value, or vice versa, then add/remove the object from the active list. This function needs to be called whenever the speed of an object changes.

Parameters:
opThe object

Definition at line 1138 of file object.c.

void update_object ( object op,
int  action 
)

Updates the array which represents the map.

It takes into account invisible objects (and represent squares covered by invisible objects by whatever is below them (unless it's another invisible object, etc).

If the object being updated is beneath a player, the below window of that player is updated.

Parameters:
opObject to update
actionHint of what the caller believes need to be done. One of Object update flags values.

Definition at line 1224 of file object.c.

void update_turn_face ( object op)

If an object with the IS_TURNABLE() flag needs to be turned due to the closest player being on the other side, this function can be called to update the face variable, <u>and</u> how it looks on the map.

Parameters:
opThe object to update.

Definition at line 1122 of file object.c.

int was_destroyed ( object op,
tag_t  old_tag 
)

Check if object has been destroyed.

Parameters:
opObject.
old_tagObject's tag.
Returns:
1 if it was destroyed (removed from map, old_tag does not match object's count or it is freed), 0 otherwise.

Definition at line 3288 of file object.c.


Variable Documentation

List of active objects that need to be processed

Definition at line 41 of file object.c.

int freearr_x[SIZEOFFREE]
Initial value:
{
    0, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1,
    0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -3, -3, -3, -3, -3, -3, -2, -1
}

X offset when searching around a spot.

Definition at line 246 of file object.c.

int freearr_y[SIZEOFFREE]
Initial value:
{
    0, -1, -1, 0, 1, 1, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2,
    -3, -3, -3, -3, -2, -1, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -3, -3
}

Y offset when searching around a spot.

Definition at line 253 of file object.c.

int freedir[SIZEOFFREE]
Initial value:
{
    0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 6, 7, 8, 8, 8,
    1, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8, 8, 8
}

Direction we're pointing on this spot.

Definition at line 267 of file object.c.

const char* gender_noun[GENDER_MAX]
Initial value:
{
    "neuter", "male", "female", "hermaphrodite"
}

Gender nouns.

Definition at line 109 of file object.c.

const char* gender_objective[GENDER_MAX]
Initial value:
{
    "it", "him", "her", "it"
}

Objective pronouns.

Definition at line 127 of file object.c.

const char* gender_possessive[GENDER_MAX]
Initial value:
{
    "its", "his", "her", "its"
}

Possessive pronouns.

Definition at line 133 of file object.c.

const char* gender_reflexive[GENDER_MAX]
Initial value:
{
    "itself", "himself", "herself", "itself"
}

Reflexive pronouns.

Definition at line 139 of file object.c.

const char* gender_subjective[GENDER_MAX]
Initial value:
{
    "it", "he", "she", "it"
}

Subjective pronouns.

Definition at line 115 of file object.c.

const char* gender_subjective_upper[GENDER_MAX]
Initial value:
{
    "It", "He", "She", "It"
}

Subjective pronouns, with first letter in uppercase.

Definition at line 121 of file object.c.

material_real_struct material_real[NUM_MATERIALS_REAL]

Real material types. This array is initialized by init_materials().

Definition at line 167 of file object.c.

materialtype materials[NROFMATERIALS]
Initial value:
{
    {"paper"},
    {"metal"},
    {"crystal"},
    {"leather"},
    {"wood"},
    {"organics"},
    {"stone"},
    {"cloth"},
    {"magic material"},
    {"liquid"},
    {"soft metal"},
    {"bone"},
    {"ice"}
}

Material types.

Definition at line 145 of file object.c.

int maxfree[SIZEOFFREE]
Initial value:
{
    0, 9, 10, 13, 14, 17, 18, 21, 22, 25, 26, 27, 30, 31, 32, 33, 36, 37, 39, 39, 42, 43, 44, 45,
    48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49
}

Number of spots around a location, including that location (except for 0)

Definition at line 260 of file object.c.

const char* object_flag_names[NUM_FLAGS+1]

This is a list of pointers that correspond to the FLAG_.. values. This is a simple 1:1 mapping - if FLAG_FRIENDLY is 15, then the 15'th element of this array should match that name.

If an entry is NULL, that is a flag not to be loaded/saved.

See also:
Flag defines

Definition at line 284 of file object.c.

const int reduction_dir[SIZEOFFREE][3] [static]

Basically, this is a table of directions, and what directions one could go to go back to us. Eg, entry 15 below is 4, 14, 16. This basically means that if direction is 15, then it could either go direction 4, 14, or 16 to get back to where we are.

Definition at line 54 of file object.c.

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

Definition at line 38 of file object.c.

Container for objects without real maps or envs

Definition at line 47 of file object.c.