Crossfire Server, Branch 1.12  R12190
Data Structures | Defines | Typedefs | Variables
living.h File Reference

Structure containing object statistics. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  liv
 Mostly used by "alive" objects. More...

Defines

#define CHA   4
 Charisma.
#define CON   2
 Constitution.
#define DEX   1
 Dexterity.
#define INT   5
 Intelligence.
#define MAXLEVEL   115
 Maximum level a player can reach.
#define NUM_STATS   7
 Number of statistics.
#define POW   6
 Power.
#define STR   0
 Strength.
#define WIS   3
 Wisdom.

Typedefs

typedef struct liv living
 Mostly used by "alive" objects.

Variables

const char *const attacks [NROFATTACKS]
 Attack type names.
const float cha_bonus [MAX_STAT+1]
 Charisma bonus.
const int cleric_chance [MAX_STAT+1]
 Probability of messing a divine spell.
const int dam_bonus [MAX_STAT+1]
 dam_bonus, thaco_bonus, max_carry, weight limit all are based on strength.
const int dex_bonus [MAX_STAT+1]
 Dexterity bonus.
const int fear_bonus [MAX_STAT+1]
 Bonus for fear resistance for players.
const int learn_spell []
 Probability to learn a spell or skill, based on intelligence or wisdom.
const char *const lose_msg [NUM_STATS]
 Message when a player decreases permanently a stat.
const int max_carry [MAX_STAT+1]
const char *const restore_msg [NUM_STATS]
 Message when a player has a stat restored.
const char *const short_stat_name [NUM_STATS]
 Short name of stats.
const float speed_bonus [MAX_STAT+1]
 speed_bonus, which uses dex as its stat
const char *const statname [NUM_STATS]
 Name of stats.
const int thaco_bonus [MAX_STAT+1]
 THAC0 bonus.
const int turn_bonus [MAX_STAT+1]
 Bonus for spell duration (holyword and turn undead), bonus for resistance to these spells.
const uint32 weight_limit [MAX_STAT+1]
 The absolute most a character can carry - a character can't pick stuff up if it would put him above this limit.

Detailed Description

Structure containing object statistics.

Definition in file living.h.


Define Documentation

#define MAXLEVEL   115

Maximum level a player can reach.

Definition at line 52 of file living.h.


Typedef Documentation

typedef struct liv living

Mostly used by "alive" objects.

Todo:
fix comment, living is used for many things :) also fix comments for fields (should probably be in a separate file).

Variable Documentation

const char* const attacks[NROFATTACKS]

Attack type names.

Definition at line 220 of file living.c.

Referenced by did_make_save_item(), and set_dragon_name().

const float cha_bonus[MAX_STAT+1]

Charisma bonus.

Note:
0.92.7 Changed way charisma works. Values now represent how much more it costs to buy something than to sell it (10, a value of 10 means it is that if it costs 50 gp to buy, you would only get 5 gp when you sell.) Let query_cost do the calculations on how to really do this. Buy keeping it this simple number, it is much easier to know how things will be influenced. A value of '1' means buying and selling is both the same value - any value less than or equal to 1 should not be used. At least as of now, the only place that uses this code is query_cost, in server/shop.c. This bonus is split evenly between buying and selling (ie, if the bonus is 2.0, then items are bought for 1.33 list, and sold at .667 This is figured by diff=(y-1)/(1+y), and for buy, it is 1+diff, for sell it is 1-diff

Definition at line 94 of file living.c.

Referenced by query_cost().

const int cleric_chance[MAX_STAT+1]

Probability of messing a divine spell.

Based on wisdom.

Definition at line 160 of file living.c.

Referenced by cast_spell().

const int dam_bonus[MAX_STAT+1]

dam_bonus, thaco_bonus, max_carry, weight limit all are based on strength.

Definition at line 119 of file living.c.

Referenced by do_throw(), fire_bow(), and fix_object().

const int dex_bonus[MAX_STAT+1]

Dexterity bonus.

Definition at line 104 of file living.c.

Referenced by do_throw(), fire_bow(), and fix_object().

const int fear_bonus[MAX_STAT+1]

Bonus for fear resistance for players.

Definition at line 170 of file living.c.

Referenced by cast_cone().

const int learn_spell[]

Probability to learn a spell or skill, based on intelligence or wisdom.

Definition at line 154 of file living.c.

Referenced by learn_skill(), and spellbook_type_apply().

const char* const lose_msg[NUM_STATS]

Message when a player decreases permanently a stat.

Definition at line 262 of file living.c.

Referenced by change_abil(), and kill_player().

const int max_carry[MAX_STAT+1]

Definition at line 129 of file living.c.

Referenced by do_throw(), and fix_object().

const char* const restore_msg[NUM_STATS]

Message when a player has a stat restored.

Definition at line 240 of file living.c.

Referenced by god_intervention(), and potion_type_apply().

const char* const short_stat_name[NUM_STATS]

Short name of stats.

Definition at line 278 of file living.c.

Referenced by describe_item(), key_roll_stat(), ring_desc(), and swap_stat().

const float speed_bonus[MAX_STAT+1]

speed_bonus, which uses dex as its stat

Definition at line 109 of file living.c.

Referenced by do_throw(), and fix_object().

const char* const statname[NUM_STATS]

Name of stats.

Definition at line 273 of file living.c.

Referenced by perceive_self().

const int thaco_bonus[MAX_STAT+1]

THAC0 bonus.

Definition at line 124 of file living.c.

Referenced by do_throw(), fire_bow(), and fix_object().

const int turn_bonus[MAX_STAT+1]

Bonus for spell duration (holyword and turn undead), bonus for resistance to these spells.

Definition at line 165 of file living.c.

Referenced by cast_cone(), and hit_with_one_attacktype().

The absolute most a character can carry - a character can't pick stuff up if it would put him above this limit.

Value is in grams, so we don't need to do conversion later

These limits are probably overly generous, but being there were no values before, you need to start someplace.

Definition at line 143 of file living.c.

Referenced by do_throw(), esrv_update_stats(), pick_up_object(), and sell_item().