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

Go to the source code of this file.

Macros

#define POTION_CHANCE_CURSED   3
 
#define POTION_CHANCE_DAMNED   2
 

Functions

static void potion_apply_spell (object *op, object *applier)
 
static void potion_apply_effects (object *op, object *applier)
 
static int apply_func (object *op, object *applier, int aflags)
 
static int process_treasure_func (object *op, object **ret, int difficulty, treasure_affinity_t *affinity, int flags)
 
 OBJECT_TYPE_INIT_DEFINE (potion)
 

Detailed Description

Handles potion related code.

Author
Alex Tokar

Definition in file potion.c.

Macro Definition Documentation

#define POTION_CHANCE_CURSED   3

Chance for non-spell potions to become cursed - 1/x.

Definition at line 44 of file potion.c.

#define POTION_CHANCE_DAMNED   2

Chance for non-spell potions to become damned instead of just cursed - 1/x.

Definition at line 48 of file potion.c.

Function Documentation

static int apply_func ( object op,
object applier,
int  aflags 
)
static

Applies an object.

Parameters
opThe object to apply.
applierThe object that executes the apply action.
aflagsSpecial (always apply/unapply) flags.

Definition at line 227 of file potion.c.

OBJECT_TYPE_INIT_DEFINE ( potion  )

Initialize the potion type object methods.

Definition at line 334 of file potion.c.

static void potion_apply_effects ( object op,
object applier 
)
static

Apply a potion which copies stat effects to the applier.

Parameters
opPotion.
applierWho is applying the potion.

Definition at line 117 of file potion.c.

static void potion_apply_spell ( object op,
object applier 
)
static

Apply a spell potion.

Parameters
opPotion.
applierWho is applying the potion.

Definition at line 59 of file potion.c.

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

Process generated treasure.

Parameters
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.
Returns
One of Object method return values.
Warning
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 268 of file potion.c.