Atrinik Server  4.0
Macros | Functions
wand.c File Reference
#include <global.h>
#include <object.h>
#include <object_methods.h>
#include "common/process_treasure.h"

Go to the source code of this file.


#define WAND_BASE_CHARGES   13


static int ranged_fire_func (object *op, object *shooter, int dir, double *delay)
static int process_treasure_func (object *op, object **ret, int difficulty, treasure_affinity_t *affinity, int flags)

Detailed Description

Handles code for wands.

Alex Tokar

Definition in file wand.c.

Macro Definition Documentation

#define WAND_BASE_CHARGES   13

Base number of charges a wand will always have.

Definition at line 41 of file wand.c.

Function Documentation


Initialize the wand type object methods.

Definition at line 124 of file wand.c.

static int process_treasure_func ( object op,
object **  ret,
int  difficulty,
treasure_affinity_t *  affinity,
int  flags 

Process generated treasure.

opObject to process.
[out]retIf the function returns OBJECT_METHOD_OK, this variable will contain the processed treasure object, which may be different from 'op' (which may be destroyed). Indeterminate on any other return value.
difficultyDifficulty level.
affinityTreasure affinity.
flagsA combination of GT_xxx flags.
One of Object method return values.
If OBJECT_METHOD_ERROR is returned from this function, it is possible that the original object has been destroyed and thus any further processing should stop.

Definition at line 84 of file wand.c.

static int ranged_fire_func ( object op,
object shooter,
int  dir,
double *  delay 

Used to fire a ranged weapon, eg, a bow firing arrows, throwing weapons/potions, firing wands/rods, etc.

opThe weapon being fired (bow, wand, throwing object).
shooterWho is doing the firing.
dirDirection to fire into.
[out]delayIf non-NULL, will contain delay caused by this action.
One of Object method return values.

Definition at line 44 of file wand.c.