|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Data Structures | |
| struct | _skill_name_table |
Typedefs | |
| typedef struct _skill_name_table | _skill_name_table |
Functions | |
| static int | change_skill_to_skill (object *who, object *skl) |
| static int | attack_melee_weapon (object *op, int dir) |
| static int | attack_hth (object *pl, int dir, char *string) |
| static int | do_skill_attack (object *tmp, object *op, char *string) |
| static void | find_skill_exp_name (object *pl, object *exp, int idx) |
| int | find_skill_exp_level (object *pl, int item_skill) |
| char * | find_skill_exp_skillname (int item_skill) |
| sint64 | do_skill (object *op, int dir, const char *params) |
| sint64 | calc_skill_exp (object *who, object *op, int level) |
| static void | init_exp_obj () |
| void | init_new_exp_system () |
| void | free_exp_objects () |
| void | dump_skills () |
| int | check_skill_known (object *op, int skillnr) |
| int | lookup_skill_by_name (const char *string) |
| int | check_skill_to_fire (object *who) |
| int | check_skill_to_apply (object *who, object *item) |
| int | init_player_exp (object *pl) |
| void | unlink_skill (object *skillop) |
| void | link_player_skills (object *pl) |
| int | link_player_skill (object *pl, object *skillop) |
| int | learn_skill (object *pl, object *scroll, char *name, int skillnr, int scroll_flag) |
| int | use_skill (object *op, char *string) |
| int | change_skill (object *who, int sk_index) |
| int | skill_attack (object *tmp, object *pl, int dir, char *string) |
| int | SK_level (object *op) |
| object * | SK_skill (object *op) |
| float | get_skill_time (object *op, int skillnr) |
| int | check_skill_action_time (object *op, object *skill) |
Variables | |
| static object * | exp_cat [MAX_EXP_CAT] |
| static int | nrofexpcat = 0 |
| float | stat_exp_mult [MAX_STAT+1] |
| static float | lev_exp [MAXLEVEL+1] |
| static _skill_name_table | skill_name_table [] |
| static int | item_skill_cs_stat [] |
Various skill related functions.
Definition in file skill_util.c.
| typedef struct _skill_name_table _skill_name_table |
Skill category table.
| static int attack_hth | ( | object * | pl, |
| int | dir, | ||
| char * | string | ||
| ) | [static] |
This handles all hand-to-hand attacks.
| pl | Object attacking. |
| dir | Attack direction. |
| string | Describes the attack ("karate-chop", "punch", ...). |
Definition at line 1194 of file skill_util.c.
| static int attack_melee_weapon | ( | object * | op, |
| int | dir | ||
| ) | [static] |
This handles melee weapon attacks -b.t.
| op | Living thing attacking. |
| dir | Attack direction. |
Definition at line 1173 of file skill_util.c.
Calculates amount of experience can be gained for successfull use of a skill.
| who | Player/creature that used the skill. |
| op | Object that was 'defeated'. |
| level | Level of the skill. If -1, will get level of who's chosen skill. |
Definition at line 289 of file skill_util.c.
| int change_skill | ( | object * | who, |
| int | sk_index | ||
| ) |
This changes the object's skill.
| who | Living to change skill for. |
| sk_index | ID of the skill. |
Definition at line 1086 of file skill_util.c.
Like change_skill(), but uses skill object instead of looking for the skill number.
| who | Living to change skill for. |
| skl | Skill object. |
Definition at line 1134 of file skill_util.c.
We check the action timer for a skill.
| op | Player. |
| skill | Skill object. |
Definition at line 1440 of file skill_util.c.
| int check_skill_known | ( | object * | op, |
| int | skillnr | ||
| ) |
Check if object knows the specified skill.
| op | Object we're checking. |
| skillnr | ID of the skill. |
Definition at line 510 of file skill_util.c.
When a player tried to use an object which requires a skill this function is called.
| who | Player object. |
| item | The object to apply. |
Definition at line 642 of file skill_util.c.
| int check_skill_to_fire | ( | object * | who | ) |
Check skill for firing.
| who | Object. |
Definition at line 561 of file skill_util.c.
| sint64 do_skill | ( | object * | op, |
| int | dir, | ||
| const char * | params | ||
| ) |
Main skills use function similar in scope to cast_spell().
We handle all requests for skill use outside of some combat here. We require a separate routine outside of fire() so as to allow monsters to utilize skills.
| op | The object actually using the skill. |
| dir | The direction in which the skill is used. |
| params | String option for the skill. |
Definition at line 185 of file skill_util.c.
We have got an appropriate opponent from either move_player() or skill_attack(). In this part we get on with attacking, take care of messages from the attack and changes in invisible. Returns true if the attack damaged the opponent.
| tmp | Targetted monster. |
| op | What is attacking. |
| string | Describes the attack ("karate-chop", "punch", ...). |
Definition at line 1295 of file skill_util.c.
| void dump_skills | ( | ) |
Dump debugging information about the skills.
Definition at line 484 of file skill_util.c.
| int find_skill_exp_level | ( | object * | pl, |
| int | item_skill | ||
| ) |
Find and return player skill exp level of given index item_skill using CS_STAT_SKILLEXP_xxx
| pl | Player. |
| item_skill | Item skill. |
Definition at line 146 of file skill_util.c.
Find and assign the skill experience stuff.
| pl | Player. |
| exp | Experience object. |
| idx | Index. |
Definition at line 124 of file skill_util.c.
| char* find_skill_exp_skillname | ( | int | item_skill | ) |
Find and return player skill exp level name of given index item_skill.
| item_skill | The skill experience category to look for. |
Definition at line 165 of file skill_util.c.
| void free_exp_objects | ( | ) |
Free all previously initialized experience objects.
Definition at line 466 of file skill_util.c.
| float get_skill_time | ( | object * | op, |
| int | skillnr | ||
| ) |
Returns the amount of time it takes to use a skill.
| op | Player. |
| skillnr | ID of the skill to check. |
Definition at line 1397 of file skill_util.c.
| static void init_exp_obj | ( | ) | [static] |
This routine looks through all the assembled archetypes for experience objects then copies their values into the exp_cat array.
Definition at line 374 of file skill_util.c.
| void init_new_exp_system | ( | ) |
Initialize the experience system.
Definition at line 408 of file skill_util.c.
| int init_player_exp | ( | object * | pl | ) |
Makes various checks and initialization of player experience objects. If things aren't cool then we change them here.
| pl | Player. |
Definition at line 759 of file skill_util.c.
Player is trying to learn a skill. Success is based on Int.
| pl | Player object. |
| scroll | Scroll object the player is learning this from, can be NULL. |
| name | Name of the skill to learn. |
| skillnr | ID of the skill to learn. |
| scroll_flag | Whether we're learning the skill from a scroll. |
| 0 | Player already knows the skill. |
| 1 | The player learns the skill. |
| 2 | Some failure. |
Definition at line 942 of file skill_util.c.
Links a skill to exp object when applied or learned by a player.
| pl | Player. |
| skillop | Skill object. |
Definition at line 907 of file skill_util.c.
| void link_player_skills | ( | object * | pl | ) |
Linking skills with experience objects and creating a linked list of skills for later fast access.
| pl | Player. |
Definition at line 858 of file skill_util.c.
| int lookup_skill_by_name | ( | const char * | string | ) |
Look up a skill by name.
| string | Name of the skill to look for. |
Definition at line 529 of file skill_util.c.
| int SK_level | ( | object * | op | ) |
Get the level of player's chosen skill.
| op | Player. |
Definition at line 1352 of file skill_util.c.
Get pointer to player's chosen skill object.
| op | Player. |
Definition at line 1380 of file skill_util.c.
Core routine for use when we attack using the skills system. There aren't too many changes from before, basically this is a 'wrapper' for the old attack system. In essence, this code handles all skill-based attacks, ie hth, missile and melee weapons should be treated here. If an opponent is already supplied by move_player(), we move right onto do_skill_attack(), otherwise we find if an appropriate opponent exists.
| tmp | Targetted monster. |
| pl | What is attacking. |
| dir | Attack direction. |
| string | Describes the attack ("karate-chop", "punch", ...). |
Definition at line 1237 of file skill_util.c.
| void unlink_skill | ( | object * | skillop | ) |
Removes skill from a player skill list and unlinks the pointer to the exp object.
| skillop | Skill object. |
Definition at line 840 of file skill_util.c.
| int use_skill | ( | object * | op, |
| char * | string | ||
| ) |
Similar to invoke command, it executes the skill in the direction that the user is facing.
| op | Player trying to use a skill. |
| string | Parameter for the skill to use. |
| 0 | Unable to change to the requested skill, or unable to use the skill properly. |
| 1 | Skill correctly used. |
Definition at line 1015 of file skill_util.c.
Array of experience objects in the game.
Definition at line 36 of file skill_util.c.
int item_skill_cs_stat[] [static] |
{
0,
CS_STAT_SKILLEXP_AGILITY,
CS_STAT_SKILLEXP_PERSONAL,
CS_STAT_SKILLEXP_MENTAL,
CS_STAT_SKILLEXP_PHYSIQUE,
CS_STAT_SKILLEXP_MAGIC,
CS_STAT_SKILLEXP_WISDOM
}
Definition at line 103 of file skill_util.c.
float lev_exp[MAXLEVEL+1] [static] |
{
0.0f, 1.0f, 1.11f, 1.75f, 3.2f,
5.5f, 10.0f, 20.0f, 35.25f, 66.1f,
137.0f, 231.58f, 240.00f, 247.62f, 254.55f,
260.87f, 266.67f, 272.00f, 276.92f, 281.48f,
285.71f, 289.66f, 293.33f, 296.77f, 300.00f,
303.03f, 305.88f, 308.57f, 311.11f, 313.51f,
315.79f, 317.95f, 320.00f, 321.95f, 323.81f,
325.58f, 327.27f, 328.89f, 330.43f, 331.91f,
333.33f, 334.69f, 336.00f, 337.25f, 338.46f,
339.62f, 340.74f, 341.82f, 342.86f, 343.86f,
344.83f, 345.76f, 346.67f, 347.54f, 348.39f,
349.21f, 350.00f, 350.77f, 351.52f, 352.24f,
352.94f, 353.62f, 354.29f, 354.93f, 355.56f,
356.16f, 356.76f, 357.33f, 357.89f, 358.44f,
358.97f, 359.49f, 360.00f, 360.49f, 360.98f,
361.45f, 361.90f, 362.35f, 362.79f, 365.22f,
367.64f, 369.04f, 373.44f, 378.84f, 384.22f,
389.59f, 395.96f, 402.32f, 410.67f, 419.01f,
429.35f, 440.68f, 452.00f, 465.32f, 479.63f,
494.93f, 510.23f, 527.52f, 545.81f, 562.09f,
580.37f, 599.64f, 619.91f, 640.17f, 662.43f,
685.68f, 709.93f, 773.17f, 852.41f, 932.65f,
1013.88f, 1104.11f, 1213.35f, 1324.60f, 1431.86f,
1542.13f
}
Used for calculating experience gained in calc_skill_exp().
Definition at line 54 of file skill_util.c.
int nrofexpcat = 0 [static] |
Current number of experience categories in the game.
Definition at line 38 of file skill_util.c.
_skill_name_table skill_name_table[] [static] |
{
{"agility", CS_STAT_SKILLEXP_AGILITY},
{"personality", CS_STAT_SKILLEXP_PERSONAL},
{"mental", CS_STAT_SKILLEXP_MENTAL},
{"physique", CS_STAT_SKILLEXP_PHYSIQUE},
{"magic", CS_STAT_SKILLEXP_MAGIC},
{"wisdom", CS_STAT_SKILLEXP_WISDOM},
{"", -1}
}
Array of the skill categories.
Definition at line 92 of file skill_util.c.
| float stat_exp_mult[MAX_STAT+1] |
{
0.0f, 0.01f, 0.1f, 0.3f, 0.5f,
0.6f, 0.7f, 0.8f, 0.85f, 0.9f,
0.95f, 0.96f, 0.97f, 0.98f, 0.99f,
1.0f, 1.01f, 1.02f, 1.03f, 1.04f,
1.05f, 1.07f, 1.09f, 1.12f, 1.15f,
1.2f, 1.3f, 1.4f, 1.5f, 1.7f,
2.0f
}
Table for stat modification of exp
Definition at line 41 of file skill_util.c.
1.7.4