server/c_object.c File Reference

#include <global.h>
#include <sproto.h>

Go to the source code of this file.

Functions

objectfind_best_object_match (object *pl, char *params)
int command_uskill (object *pl, char *params)
int command_rskill (object *pl, char *params)
int command_apply (object *op, char *params)
int sack_can_hold (object *pl, object *sack, object *op, int nrof)
static void pick_up_object (object *pl, object *op, object *tmp, int nrof)
void pick_up (object *op, object *alt)
void put_object_in_sack (object *op, object *sack, object *tmp, long nrof)
void drop_object (object *op, object *tmp, long nrof)
void drop (object *op, object *tmp)
int command_dropall (object *op, char *params)
int command_drop (object *op, char *params)
static objectfind_marked_object_rec (object *op, object **marked, uint32 *marked_count)
objectfind_marked_object (object *op)
void examine_living (object *op, object *tmp)
char * long_desc (object *tmp, object *caller)
void examine (object *op, object *tmp)
void inventory (object *op, object *inv)

Detailed Description

Object ID parsing functions

Definition in file c_object.c.


Function Documentation

int command_apply ( object op,
char *  params 
)

Apply an item. Accepts parameters like -a to always apply, and -u to always unapply.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
Always returns 0.

Definition at line 121 of file c_object.c.

int command_drop ( object op,
char *  params 
)

/drop command.

Parameters:
op Player.
params What to drop.
Returns:
0.

Definition at line 1041 of file c_object.c.

int command_dropall ( object op,
char *  params 
)

Command to drop all items that have not been locked.

Parameters:
op Player.
params Optional specifier, like 'armour', 'weapon' and such.
Returns:
0.

Definition at line 906 of file c_object.c.

int command_rskill ( object pl,
char *  params 
)

Ready skill command.

Parameters:
pl Player object.
params Command parameters.
Returns:
1 on success, 0 on failure.

Definition at line 89 of file c_object.c.

int command_uskill ( object pl,
char *  params 
)

Use skill command.

Parameters:
pl Player object.
params Command parameters.
Returns:
1 on success, 0 on failure.

Definition at line 68 of file c_object.c.

void drop ( object op,
object tmp 
)

Drop an item, either on the floor or in a container.

Parameters:
op Who is dropping an item.
tmp What object to drop.

Definition at line 863 of file c_object.c.

void drop_object ( object op,
object tmp,
long  nrof 
)

Drop an object onto the floor.

Parameters:
op Player object.
tmp The object to drop.
nrof Number of items to drop (0 for all).

Definition at line 697 of file c_object.c.

void examine ( object op,
object tmp 
)

Player examines some object.

Parameters:
op Player.
tmp Object to examine.

Definition at line 1351 of file c_object.c.

void examine_living ( object op,
object tmp 
)

Player examines a living object.

Parameters:
op Player.
tmp Object being examined.

Definition at line 1154 of file c_object.c.

object* find_best_object_match ( object pl,
char *  params 
)

Search the inventory of 'pl' for what matches best with params. We use item_matched_string above - this gives us consistent behaviour between many commands.

Parameters:
pl Player object.
params Parameters string.
Returns:
Best match, or NULL if no match.

Definition at line 40 of file c_object.c.

object* find_marked_object ( object op  ) 

Return the object the player has marked.

Parameters:
op Object. Should be a player.
Returns:
Marked object if still valid, NULL otherwise.

Definition at line 1140 of file c_object.c.

static object* find_marked_object_rec ( object op,
object **  marked,
uint32 *  marked_count 
) [static]

Recursive helper function for find_marked_object() to search for marked object in containers.

Parameters:
op Object. Should be a player.
marked Marked object.
marked_count Marked count.
Returns:
The object if found, NULL otherwise.

Definition at line 1090 of file c_object.c.

void inventory ( object op,
object inv 
)

Prints object's inventory.

Parameters:
op Who to print for.
inv If NULL then print op's inventory, else print the inventory of inv.

Definition at line 1877 of file c_object.c.

char* long_desc ( object tmp,
object caller 
)

Long description of an object.

Parameters:
tmp Object to get description of.
caller Caller.
Returns:
The returned description.

Definition at line 1278 of file c_object.c.

void pick_up ( object op,
object alt 
)

Try to pick up an item.

Parameters:
op Object trying to pick up.
alt Optional object op is trying to pick. If NULL, try to pick first item under op.

Definition at line 424 of file c_object.c.

static void pick_up_object ( object pl,
object op,
object tmp,
int  nrof 
) [static]

Pick up object.

Parameters:
pl Object that is picking up the object.
op Object to put tmp into.
tmp Object to pick up.
nrof Number to pick up (0 means all of them).

Definition at line 231 of file c_object.c.

void put_object_in_sack ( object op,
object sack,
object tmp,
long  nrof 
)

Player tries to put object into sack, if nrof is non zero, then nrof objects is tried to put into sack.

Parameters:
op Player object.
sack The sack.
tmp The object to put into sack.
nrof Number of items to put into sack (0 for all).

Definition at line 570 of file c_object.c.

int sack_can_hold ( object pl,
object sack,
object op,
int  nrof 
)

Check if an item op can be put into a sack. If pl exists then tell a player the reason of failure.

Parameters:
pl Player object.
sack The sack.
op The object to check.
nrof Number of objects we want to put in.
Returns:
1 if the object will fit, 0 if it will not.

Definition at line 181 of file c_object.c.


Generated by  doxygen 1.6.2