Atrinik Server  4.0
Functions
apply.c File Reference
#include <global.h>
#include <plugin.h>
#include <object.h>
#include <player.h>
#include <object_methods.h>

Go to the source code of this file.

Functions

int manual_apply (object *op, object *tmp, int aflag)
 
int player_apply (object *pl, object *op, int aflag, int quiet)
 
void player_apply_below (object *pl)
 

Detailed Description

Handles objects being applied, and their effect.

Definition in file apply.c.

Function Documentation

int manual_apply ( object op,
object tmp,
int  aflag 
)

Main apply handler.

Checks for unpaid items before applying.

Parameters
op::object causing tmp to be applied.
tmp::object being applied.
aflagSpecial (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special().
Return values
0Player or monster can't apply objects of that type.
1Has been applied, or there was an error applying the object.
2Objects of that type can't be applied if not in inventory.

Definition at line 52 of file apply.c.

int player_apply ( object pl,
object op,
int  aflag,
int  quiet 
)

Living thing is applying an object.

Parameters
pl::object causing op to be applied.
op::object being applied.
aflagSpecial (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special().
quietIf 1, suppresses the "don't know how to apply" and "you must get it first" messages as needed by player_apply_below(). There can still be "but you are floating high above the ground" messages.
Return values
0Player or monster can't apply objects of that type.
1Has been applied, or there was an error applying the object.
2Objects of that type can't be applied if not in inventory.

Definition at line 123 of file apply.c.

void player_apply_below ( object pl)

Attempt to apply the object 'below' the player.

If the player has an open container, we use that for below, otherwise we use the ground.

Parameters
plPlayer.

Definition at line 161 of file apply.c.