|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Defines | |
| #define | IMPROVE_PREPARE 1 |
| #define | IMPROVE_DAMAGE 2 |
| #define | IMPROVE_WEIGHT 3 |
| #define | IMPROVE_ENCHANT 4 |
| #define | IMPROVE_STR 5 |
| #define | IMPROVE_DEX 6 |
| #define | IMPROVE_CON 7 |
| #define | IMPROVE_WIS 8 |
| #define | IMPROVE_CHA 9 |
| #define | IMPROVE_INT 10 |
| #define | IMPROVE_POW 11 |
Functions | |
| static int | improve_weapon_stat (object *op, object *improver, object *weapon, signed char *stat, int sacrifice_count, char *statname) |
| static int | prepare_weapon (object *op, object *improver, object *weapon) |
| static int | improve_weapon (object *op, object *improver, object *weapon) |
| static void | eat_item (object *op, const char *item) |
| static int | check_item (object *op, const char *item) |
| static int | check_sacrifice (object *op, object *improver) |
| void | apply_weapon_improver (object *op, object *tmp) |
| int | check_weapon_power (object *who, int improvs) |
Handles the code for using weapon improvers.
Definition in file weapon_improver.c.
Apply a weapon improver.
| op | The player object applying the improver. |
| tmp | The weapon improver scroll. |
Definition at line 74 of file weapon_improver.c.
| static int check_item | ( | object * | op, |
| const char * | item | ||
| ) | [static] |
Counts suitable items with specified archetype name. Will not consider unpaid/cursed items.
| op | Object just before the bottom of the pile, others will be checked through object->below. |
| item | What archetype to check for. |
Definition at line 390 of file weapon_improver.c.
Returns how many items of type improver->slaying there are under op.
Will display a message if none found.
| op | Item just below the bottom of the pile. |
| improver | Sacrifice object. |
Definition at line 432 of file weapon_improver.c.
| int check_weapon_power | ( | object * | who, |
| int | improvs | ||
| ) |
This checks to see of the player (who) is sufficient level to use a weapon with improvs improvements (typically last_eat).
We take an int here instead of the object so that the improvement code can pass along the increased value to see if the object is usuable. we return 1 (true) if the player can use the weapon.
| who | The player object. |
| improvs | The improvement value. |
Definition at line 112 of file weapon_improver.c.
| static void eat_item | ( | object * | op, |
| const char * | item | ||
| ) | [static] |
Removes specified item.
| op | Item at the bottom to check. |
| item | Archetype to look for. |
Definition at line 364 of file weapon_improver.c.
Does the dirty job for 'improve weapon' scroll, prepare or add something.
Checks if weapon was prepared, if enough potions on the floor, etc.
We are hiding extra information about the weapon in the level and last_eat numbers for an object. Hopefully this won't break anything?
level == max improve, last_eat == current improve
| op | Player improving. |
| improver | The scroll that was read. |
| weapon | Weapon to improve. |
Definition at line 241 of file weapon_improver.c.
| static int improve_weapon_stat | ( | object * | op, |
| object * | improver, | ||
| object * | weapon, | ||
| signed char * | stat_id, | ||
| int | sacrifice_count, | ||
| char * | stat_name | ||
| ) | [static] |
Actually improves the weapon, and tells the player.
| op | Player improving. |
| improver | Scroll used to improve. |
| weapon | Improved weapon. |
| stat_id | What statistic to improve. |
| sacrifice_count | How much to improve stat by. |
| stat_name | Name of stat to display to player. |
Definition at line 156 of file weapon_improver.c.
This does the prepare weapon scroll.
Checks for sacrifice, and so on. Will inform the player of failures or success.
| op | Player using the scroll. |
| improver | The improvement scroll. |
| weapon | Weapon to improve. |
Definition at line 178 of file weapon_improver.c.
1.7.4