Atrinik Client 2.5
Functions | Variables
client/item.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static objectobject_new ()
static objectobjects_alloc (int nrof)
void objects_free (object *op)
objectobject_find_object_inv (object *op, sint32 tag)
objectobject_find_object (object *op, sint32 tag)
objectobject_find (sint32 tag)
void object_remove (object *op)
void object_remove_inventory (object *op)
static void object_add (object *env, object *op, int bflag)
objectobject_create (object *env, sint32 tag, int bflag)
void object_set_values (object *op, const char *name, sint32 weight, uint16 face, int flags, uint16 anim, uint16 animspeed, sint32 nrof, uint8 itype, uint8 stype, uint8 qual, uint8 cond, uint8 skill, uint8 level, uint8 dir)
void toggle_locked (object *op)
void object_send_mark (object *op)
void ready_object (object *op)
void objects_init ()
void update_object (int tag, int loc, const char *name, int weight, int face, int flags, int anim, int animspeed, int nrof, uint8 itype, uint8 stype, uint8 qual, uint8 cond, uint8 skill, uint8 level, uint8 direction, int bflag)
static void animate_object (object *ob)
void animate_objects ()

Variables

static objectfree_objects = NULL

Detailed Description

Object management.

Definition in file item.c.


Function Documentation

static void animate_object ( object ob) [static]

Animate one object.

Parameters:
obThe object to animate.

Definition at line 534 of file item.c.

void animate_objects ( )

Animate all possible objects.

Definition at line 568 of file item.c.

static void object_add ( object env,
object op,
int  bflag 
) [static]

Adds an object to inventory of 'env'.

Parameters:
envWhich object to add to.
opObject to add.
bflagIf 1, the object will be added to the end of the inventory instead of the start.

Definition at line 246 of file item.c.

object* object_create ( object env,
sint32  tag,
int  bflag 
)

Creates a new object and inserts it into 'env'.

Parameters:
envWhich object to insert the created object into. Can be NULL not to insert the created object anywhere.
tagThe object's ID.
bflagIf 1, the object will be added to the end of the inventory instead of the start.
Returns:
The created object.

Definition at line 302 of file item.c.

object* object_find ( sint32  tag)

Attempts to find an object by its tag, wherever it may be.

Parameters:
tagTag to look for.
Returns:
Matching object if found, NULL otherwise.

Definition at line 141 of file item.c.

object* object_find_object ( object op,
sint32  tag 
)

Find an object inside another object by its tag.

Parameters:
opObject to search in.
tagID of the object we're looking for.
Returns:
Matching object if found, NULL otherwise.

Definition at line 115 of file item.c.

object* object_find_object_inv ( object op,
sint32  tag 
)

Find an object inside another object, but not inside inventories.

Parameters:
opObject to search in.
tagID of the object we're looking for.
Returns:
Matching object if found, NULL otherwise.

Definition at line 95 of file item.c.

static object* object_new ( ) [static]

Allocates a new object.

Returns:
The object.

Definition at line 38 of file item.c.

void object_remove ( object op)

Remove an object.

Parameters:
opWhat to remove.

Definition at line 184 of file item.c.

void object_remove_inventory ( object op)

Remove all items in object's inventory.

Parameters:
opThe object to remove inventory of.

Definition at line 227 of file item.c.

void object_send_mark ( object op)

Update the marked object.

Parameters:
opThe object.

Definition at line 429 of file item.c.

void object_set_values ( object op,
const char *  name,
sint32  weight,
uint16  face,
int  flags,
uint16  anim,
uint16  animspeed,
sint32  nrof,
uint8  itype,
uint8  stype,
uint8  qual,
uint8  cond,
uint8  skill,
uint8  level,
uint8  dir 
)

Set object's values.

Parameters:
opObject.

Definition at line 333 of file item.c.

static object* objects_alloc ( int  nrof) [static]

Allocates a list of objects.

Parameters:
nrofHow many objects to allocate.
Returns:
The allocated objects in a list.

Definition at line 54 of file item.c.

void objects_free ( object op)

Frees all objects in a list.

Parameters:
opStart of the list.

Definition at line 74 of file item.c.

void objects_init ( )

Initializes the various objects of cpl structure, freeing them first if necessary.

Definition at line 480 of file item.c.

void ready_object ( object op)

Ready an object for firing.

Parameters:
opObject to ready.

Definition at line 459 of file item.c.

void toggle_locked ( object op)

Toggle the locked status of an object.

Parameters:
opObject.

Definition at line 407 of file item.c.

void update_object ( int  tag,
int  loc,
const char *  name,
int  weight,
int  face,
int  flags,
int  anim,
int  animspeed,
int  nrof,
uint8  itype,
uint8  stype,
uint8  qual,
uint8  cond,
uint8  skill,
uint8  level,
uint8  direction,
int  bflag 
)

Update an object with new attributes.

Parameters:
tagThe object ID to update.
locLocation of the object.

Definition at line 498 of file item.c.


Variable Documentation

object* free_objects = NULL [static]

The list of free (unused) objects

Definition at line 33 of file item.c.