|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Defines | |
| #define | ENCUMBRANCE_LIMIT 65.0f |
Functions | |
| void | set_attr_value (living *stats, int attr, sint8 value) |
| void | change_attr_value (living *stats, int attr, sint8 value) |
| sint8 | get_attr_value (living *stats, int attr) |
| void | check_stat_bounds (living *stats) |
| int | change_abil (object *op, object *tmp) |
| void | drain_stat (object *op) |
| void | drain_specific_stat (object *op, int deplete_stats) |
| void | fix_player (object *op) |
| void | fix_monster (object *op) |
| object * | insert_base_info_object (object *op) |
| object * | find_base_info_object (object *op) |
| void | set_mobile_speed (object *op, int idx) |
Variables | |
| int | dam_bonus [MAX_STAT+1] |
| int | thaco_bonus [MAX_STAT+1] |
| static float | con_bonus [MAX_STAT+1] |
| static float | pow_bonus [MAX_STAT+1] |
| static float | wis_bonus [MAX_STAT+1] |
| float | cha_bonus [MAX_STAT+1] |
| float | speed_bonus [MAX_STAT+1] |
| uint32 | weight_limit [MAX_STAT+1] |
| int | learn_spell [MAX_STAT+1] |
| int | cleric_chance [MAX_STAT+1] |
| int | savethrow [MAXLEVEL+1] |
| static const char *const | drain_msg [NUM_STATS] |
| const char *const | restore_msg [NUM_STATS] |
| static const char *const | gain_msg [NUM_STATS] |
| const char *const | lose_msg [NUM_STATS] |
| const char *const | statname [NUM_STATS] |
| const char *const | short_stat_name [NUM_STATS] |
Functions related to attributes, weight, experience, which concern only living things.
Definition in file living.c.
| #define ENCUMBRANCE_LIMIT 65.0f |
Permanently alters an object's stats/flags based on another object.
Like set_attr_value(), but instead the value (which can be negative) is added to the specified stat.
Checking is performed to make sure old value + new value doesn't overflow the stat integer.
| stats | Item to modify. Must not be NULL. |
| attr | Attribute to change. |
| value | Delta (can be positive). |
| void check_stat_bounds | ( | living * | stats | ) |
| void drain_specific_stat | ( | object * | op, |
| int | deplete_stats | ||
| ) |
| void drain_stat | ( | object * | op | ) |
| void fix_monster | ( | object * | op | ) |
Like fix_player(), but for monsters.
| op | The monster. |
| void fix_player | ( | object * | op | ) |
Updates all abilities given by applied objects in the inventory of the given object.
This functions starts from base values (archetype or player object) and then adjusts them according to what the player/monster has equipped.
Note that a player always has stats reset to their initial value.
| op | Object to reset. |
Gets the value of a stat.
| stats | Item from which to get stat. |
| attr | Attribute to get. |
| void set_mobile_speed | ( | object * | op, |
| int | idx | ||
| ) |
| float cha_bonus[MAX_STAT+1] |
{
-0.15f,
-0.10f, -0.08f,-0.05f, -0.03f, -0.02f,
-0.01f, -0.005f, -0.003f, -0.001f, 0.0f,
0.0f, 0.0f, 0.0f, 0.005f, 0.010f,
0.015f, 0.02f, 0.025f, 0.03f, 0.035f,
0.04f, 0.045f, 0.05f, 0.055f, 0.06f,
0.065f, 0.07f, 0.08f, 0.09f, 0.1f
}
Charisma bonus.
As a base value, you get in a shop 20% of the real value of an item.
With a charisma bonus, you can go up to 30% at maximum or 5% at minimum (actually this is 10% minimum, because stats cannot go below 1). For buying, these values are used in reverse. You can buy for 90% at best, or 115% (110%, because stats cannot go below 1) at worst.
| int cleric_chance[MAX_STAT+1] |
float con_bonus[MAX_STAT+1] [static] |
| int dam_bonus[MAX_STAT+1] |
const char* const drain_msg[NUM_STATS] [static] |
{
"Oh no! You are weakened!",
"You're feeling clumsy!",
"You feel less healthy",
"You suddenly begin to lose your memory!",
"Your face gets distorted!",
"Watch out, your mind is going!",
"Your spirit feels drained!"
}
Message when a player is drained of a stat.
const char* const gain_msg[NUM_STATS] [static] |
| int learn_spell[MAX_STAT+1] |
| const char* const lose_msg[NUM_STATS] |
float pow_bonus[MAX_STAT+1] [static] |
| const char* const restore_msg[NUM_STATS] |
{
"You feel your strength return.",
"You feel your agility return.",
"You feel your health return.",
"You feel your wisdom return.",
"You feel your charisma return.",
"You feel your memory return.",
"You feel your spirits return."
}
Message when a player has a stat restored.
| int savethrow[MAXLEVEL+1] |
{
18,
18, 17, 16, 15, 14, 14, 13, 13, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9,
9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6,
6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
}
Probability to avoid something.
| const char* const short_stat_name[NUM_STATS] |
| float speed_bonus[MAX_STAT+1] |
{
-0.4f, -0.4f, -0.3f, -0.3f, -0.2f,
-0.2f, -0.2f, -0.1f, -0.1f, -0.1f,
-0.05f, 0.0, 0.0f, 0.0f, 0.025f, 0.05f,
0.075f, 0.1f, 0.125f, 0.15f, 0.175f, 0.2f,
0.225f, 0.25f, 0.275f, 0.3f,
0.325f, 0.35f, 0.4f, 0.45f, 0.5f
}
Speed bonus. Uses dexterity as its stat.
| const char* const statname[NUM_STATS] |
| int thaco_bonus[MAX_STAT+1] |
| uint32 weight_limit[MAX_STAT+1] |
{
20000,
25000, 30000, 35000, 40000, 50000,
60000, 70000, 80000, 90000, 100000,
110000, 120000, 130000, 140000, 150000,
165000, 180000, 195000, 210000, 225000,
240000, 255000, 270000, 285000, 300000,
325000, 350000, 375000, 400000, 450000
}
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.
float wis_bonus[MAX_STAT+1] [static] |
1.7.4