version 1.71 | | version 1.72 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.71 2002/12/01 03:46:25 mwedel Exp $"; | | * "$Id: apply.c,v 1.72 2002/12/12 23:48:10 garbled Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
*/ | | */ |
if (i<NROFATTACKS || | | if (i<NROFATTACKS || |
weapon->stats.hp || /* regeneration */ | | weapon->stats.hp || /* regeneration */ |
weapon->stats.sp || /* sp regeneration */ | | (weapon->stats.sp && weapon->type == WEAPON) || /* sp regeneration */ |
weapon->stats.exp || /* speed */ | | weapon->stats.exp || /* speed */ |
weapon->stats.ac) /* AC - only taifu's I think */ | | weapon->stats.ac) /* AC - only taifu's I think */ |
{ | | { |
| | |
new_draw_info(NDI_UNIQUE, 0, op, "You need to mark a weapon object."); | | new_draw_info(NDI_UNIQUE, 0, op, "You need to mark a weapon object."); |
return 0; | | return 0; |
} | | } |
if (otmp->type!=WEAPON) { | | if (otmp->type != WEAPON && otmp->type != BOW) { |
new_draw_info(NDI_UNIQUE, 0,op,"Marked item is not a weapon"); | | new_draw_info(NDI_UNIQUE, 0,op,"Marked item is not a weapon or bow"); |
return 0; | | return 0; |
} | | } |
new_draw_info(NDI_UNIQUE, 0,op,"Applied weapon builder."); | | new_draw_info(NDI_UNIQUE, 0,op,"Applied weapon builder."); |
| | |
SET_FLAG (who, FLAG_READY_SKILL); | | SET_FLAG (who, FLAG_READY_SKILL); |
break; | | break; |
| | |
| | case BOW: |
| | if (!check_weapon_power(who, op->last_eat)) { |
| | new_draw_info(NDI_UNIQUE, 0, who, |
| | "That item is too powerful for you to use."); |
| | new_draw_info(NDI_UNIQUE, 0, who, "It would consume your soul!."); |
| | if(tmp != NULL) |
| | (void)insert_ob_in_ob(tmp,who); |
| | return 1; |
| | } |
| | if( op->level && (strncmp(op->name,who->name,strlen(who->name)))) { |
| | new_draw_info(NDI_UNIQUE, 0, who, |
| | "The weapon does not recognize you as its owner."); |
| | if(tmp != NULL) |
| | (void)insert_ob_in_ob(tmp,who); |
| | return 1; |
| | } |
| | /*FALLTHROUGH*/ |
case WAND: | | case WAND: |
case ROD: | | case ROD: |
case HORN: | | case HORN: |
case BOW: | | |
/* check for skill, alter player status */ | | /* check for skill, alter player status */ |
SET_FLAG(op, FLAG_APPLIED); | | SET_FLAG(op, FLAG_APPLIED); |
if(!check_skill_to_apply(who,op)) return 1; | | if(!check_skill_to_apply(who,op)) return 1; |
| | |
| | |
if(who->type==PLAYER) { | | if(who->type==PLAYER) { |
if (op->type == BOW) { | | if (op->type == BOW) { |
| | (void)change_abil(who, op); |
new_draw_info_format (NDI_UNIQUE, 0, who, | | new_draw_info_format (NDI_UNIQUE, 0, who, |
"You will now fire %s with %s.", | | "You will now fire %s with %s.", |
op->race ? op->race : "nothing", query_name(op)); | | op->race ? op->race : "nothing", query_name(op)); |