version 1.53 | | version 1.54 |
---|
| | |
/* | | /* |
* static char *rcsid_skill_util_c = | | * static char *rcsid_skill_util_c = |
* "$Id: skill_util.c,v 1.53 2005/07/23 10:06:36 ryo_saeba Exp $"; | | * "$Id: skill_util.c,v 1.54 2005/08/12 08:18:59 ryo_saeba Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
* use the skill, so thus if use of the skill requires a skill | | * use the skill, so thus if use of the skill requires a skill |
* tool, this code will equip it. | | * tool, this code will equip it. |
*/ | | */ |
object *find_skill_by_name(object *who, char *name) | | object *find_skill_by_name(object *who, const char *name) |
{ | | { |
object *skill=NULL, *skill_tool=NULL, *tmp; | | object *skill=NULL, *skill_tool=NULL, *tmp; |
| | |
| | |
* It returns 0 if no skill was used. | | * It returns 0 if no skill was used. |
*/ | | */ |
| | |
int do_skill (object *op, object *part, object *skill, int dir, char *string) { | | int do_skill (object *op, object *part, object *skill, int dir, const char *string) { |
int success=0, exp=0; | | int success=0, exp=0; |
int did_alc = 0; | | int did_alc = 0; |
object *tmp, *next; | | object *tmp, *next; |
| | |
| | |
void show_skills(object *op) { | | void show_skills(object *op) { |
object *tmp=NULL; | | object *tmp=NULL; |
char buf[MAX_BUF], *cp; | | char buf[MAX_BUF]; |
| | const char *cp; |
int i,num_skills_found=0; | | int i,num_skills_found=0; |
static char *periods="........................................"; | | static char *periods="........................................"; |
/* Need to have a pointer and use strdup for qsort to work properly */ | | /* Need to have a pointer and use strdup for qsort to work properly */ |
| | |
* the damage. | | * the damage. |
*/ | | */ |
| | |
static int do_skill_attack(object *tmp, object *op, char *string, object *skill) { | | static int do_skill_attack(object *tmp, object *op, const char *string, object *skill) { |
int success; | | int success; |
| | |
/* For Players only: if there is no ready weapon, and no "attack" skill | | /* For Players only: if there is no ready weapon, and no "attack" skill |
| | |
* Initial implementation by -bt thomas@astro.psu.edu | | * Initial implementation by -bt thomas@astro.psu.edu |
*/ | | */ |
| | |
int skill_attack (object *tmp, object *pl, int dir, char *string, object *skill) { | | int skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill) { |
sint16 tx,ty; | | sint16 tx,ty; |
mapstruct *m; | | mapstruct *m; |
int mflags; | | int mflags; |
| | |
* function skill_attack() we actually attack. | | * function skill_attack() we actually attack. |
*/ | | */ |
| | |
int attack_hth(object *pl, int dir, char *string, object *skill) { | | int attack_hth(object *pl, int dir, const char *string, object *skill) { |
object *enemy=NULL,*weapon; | | object *enemy=NULL,*weapon; |
| | |
if(QUERY_FLAG(pl, FLAG_READY_WEAPON)) | | if(QUERY_FLAG(pl, FLAG_READY_WEAPON)) |
| | |
* weapon type. | | * weapon type. |
*/ | | */ |
| | |
int attack_melee_weapon(object *op, int dir, char *string, object *skill) { | | int attack_melee_weapon(object *op, int dir, const char *string, object *skill) { |
| | |
if(!QUERY_FLAG(op, FLAG_READY_WEAPON)) { | | if(!QUERY_FLAG(op, FLAG_READY_WEAPON)) { |
if(op->type==PLAYER) | | if(op->type==PLAYER) |