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

Go to the source code of this file.

Macros

#define AMULET_CHANCE_CURSED   7
 
#define AMULET_CHANCE_DAMNED   10
 
#define AMULET_CHANCE_TABLE   20
 

Functions

static bool amulet_set_bonus_reflect_missiles (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool amulet_set_bonus_reflect_spells (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static int process_treasure_func (object *op, object **ret, int difficulty, treasure_affinity_t *affinity, int flags)
 
 OBJECT_TYPE_INIT_DEFINE (amulet)
 

Variables

static const
process_treasure_table_t 
amulet_treasure_table []
 

Detailed Description

Handles code for amulets.

Author
Alex Tokar

Definition in file amulet.c.

Macro Definition Documentation

#define AMULET_CHANCE_CURSED   7

Chance for the amulet to become cursed - 1/x.

Definition at line 42 of file amulet.c.

#define AMULET_CHANCE_DAMNED   10

Chance for the amulet to become damned, but only if it's already been cursed - 1/x.

Definition at line 47 of file amulet.c.

#define AMULET_CHANCE_TABLE   20

Chance to roll from the amulet table instead of the jewelry one - 1/x.

Definition at line 51 of file amulet.c.

Function Documentation

static bool amulet_set_bonus_reflect_missiles ( object op,
int  difficulty,
treasure_affinity_t *  affinity,
double *  item_power,
int  bonus 
)
static

Function for setting a bonus for the specified bonus type.

Parameters
opObject.
difficultyDifficulty level.
affinityTreasure affinity.
[out]item_powerItem power adjustment.
bonusBonus value.
Returns
Whether a bonus was applied.

Definition at line 55 of file amulet.c.

static bool amulet_set_bonus_reflect_spells ( object op,
int  difficulty,
treasure_affinity_t *  affinity,
double *  item_power,
int  bonus 
)
static

Function for setting a bonus for the specified bonus type.

Parameters
opObject.
difficultyDifficulty level.
affinityTreasure affinity.
[out]item_powerItem power adjustment.
bonusBonus value.
Returns
Whether a bonus was applied.

Definition at line 73 of file amulet.c.

OBJECT_TYPE_INIT_DEFINE ( amulet  )

Initialize the amulet type object methods.

Definition at line 181 of file amulet.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 99 of file amulet.c.

Variable Documentation

const process_treasure_table_t amulet_treasure_table[]
static
Initial value:
= {
}
static bool amulet_set_bonus_reflect_spells(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: amulet.c:73
static bool amulet_set_bonus_reflect_missiles(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: amulet.c:55

The amulet treasure table.

Definition at line 92 of file amulet.c.