Atrinik Server  4.0
Macros | Functions | Variables
ring.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 RING_CHANCE_CURSED   5
 
#define RING_CHANCE_DAMNED   10
 
#define RING_CHANCE_TABLE   3
 
#define RING_CHANCE_EXTRA   4
 

Functions

static bool ring_set_bonus_speed (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_regen_hp (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_regen_sp (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_damage (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_sustenance (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_stat (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus, int stat)
 
static bool ring_set_bonus_stat_str (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_stat_dex (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_stat_con (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_stat_int (object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
 
static bool ring_set_bonus_stat_pow (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 (ring)
 

Variables

static const
process_treasure_table_t 
ring_treasure_table []
 

Detailed Description

Handles code for rings.

Author
Alex Tokar

Definition in file ring.c.

Macro Definition Documentation

#define RING_CHANCE_CURSED   5

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

Definition at line 42 of file ring.c.

#define RING_CHANCE_DAMNED   10

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

Definition at line 47 of file ring.c.

#define RING_CHANCE_EXTRA   4

Chance to roll another bonus on the ring - 1/x.

Definition at line 55 of file ring.c.

#define RING_CHANCE_TABLE   3

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

Definition at line 51 of file ring.c.

Function Documentation

OBJECT_TYPE_INIT_DEFINE ( ring  )

Initialize the ring type object methods.

Definition at line 422 of file ring.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 331 of file ring.c.

static bool ring_set_bonus_damage ( 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 132 of file ring.c.

static bool ring_set_bonus_regen_hp ( 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 76 of file ring.c.

static bool ring_set_bonus_regen_sp ( 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 104 of file ring.c.

static bool ring_set_bonus_speed ( 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 59 of file ring.c.

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

Generic function for setting bonus stats, such as strength, dexterity, etc.

Parameters
opObject.
difficultyDifficulty level.
affinityTreasure affinity.
[out]item_powerItem power adjustment.
bonusBonus value.
statStat ID.
Returns
True on success, false on failure.

Definition at line 201 of file ring.c.

static bool ring_set_bonus_stat_con ( 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 267 of file ring.c.

static bool ring_set_bonus_stat_dex ( 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 251 of file ring.c.

static bool ring_set_bonus_stat_int ( 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 283 of file ring.c.

static bool ring_set_bonus_stat_pow ( 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 299 of file ring.c.

static bool ring_set_bonus_stat_str ( 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 235 of file ring.c.

static bool ring_set_bonus_sustenance ( 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 160 of file ring.c.

Variable Documentation

const process_treasure_table_t ring_treasure_table[]
static
Initial value:
= {
}
static bool ring_set_bonus_damage(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:132
static bool ring_set_bonus_regen_hp(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:76
static bool ring_set_bonus_regen_sp(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:104
static bool ring_set_bonus_stat_con(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:267
static bool ring_set_bonus_stat_dex(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:251
static bool ring_set_bonus_stat_int(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:283
static bool ring_set_bonus_stat_str(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:235
static bool ring_set_bonus_sustenance(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:160
static bool ring_set_bonus_stat_pow(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:299
static bool ring_set_bonus_speed(object *op, int difficulty, treasure_affinity_t *affinity, double *item_power, int bonus)
Definition: ring.c:59

The ring treasure table.

Definition at line 316 of file ring.c.