version 1.74 | | version 1.75 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.74 2003/01/07 09:39:15 garbled Exp $"; | | * "$Id: apply.c,v 1.75 2003/01/08 08:39:18 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
new_draw_info(NDI_UNIQUE, 0,op,"This weapon has not been prepared."); | | new_draw_info(NDI_UNIQUE, 0,op,"This weapon has not been prepared."); |
return 0; | | return 0; |
} | | } |
if (weapon->level==weapon->last_eat) { | | if (weapon->level==weapon->last_eat && weapon->item_power >=100) { |
new_draw_info(NDI_UNIQUE, 0,op,"This weapon cannot be improved any more."); | | new_draw_info(NDI_UNIQUE, 0,op,"This weapon cannot be improved any more."); |
return 0; | | return 0; |
} | | } |
| | |
new_draw_info_format(NDI_UNIQUE, 0, op, | | new_draw_info_format(NDI_UNIQUE, 0, op, |
"Damage has been increased by 5 to %d", weapon->stats.dam); | | "Damage has been increased by 5 to %d", weapon->stats.dam); |
weapon->last_eat++; | | weapon->last_eat++; |
| | |
weapon->item_power++; | | weapon->item_power++; |
decrease_ob(improver); | | decrease_ob(improver); |
return 1; | | return 1; |
| | |
| | |
if(op->type!=PLAYER) | | if(op->type!=PLAYER) |
return 0; | | return 0; |
if (blocks_magic(op->map,op->x,op->y)) { | | if (get_map_flags(op->map,NULL, op->x,op->y, NULL, NULL) & P_NO_MAGIC) { |
new_draw_info(NDI_UNIQUE, 0,op,"Something blocks the magic of the scroll."); | | new_draw_info(NDI_UNIQUE, 0,op,"Something blocks the magic of the scroll."); |
return 0; | | return 0; |
} | | } |
| | |
* changing of physical area right now. | | * changing of physical area right now. |
*/ | | */ |
| | |
| | /* This code deals with the armour improvment scrolls. |
| | * Change limits on improvement - let players go up to |
| | * +5 no matter what level, but they are limited by item |
| | * power. |
| | * Try to use same improvement code as in the common/treasure.c |
| | * file, so that if you make a +2 full helm, it will be just |
| | * the same as one you find in a shop. |
| | */ |
int improve_armour(object *op, object *improver, object *armour) | | int improve_armour(object *op, object *improver, object *armour) |
{ | | { |
int new_armour; | | object *tmp; |
| | |
new_armour = armour->resist[ATNR_PHYSICAL] + armour->resist[ATNR_PHYSICAL]/25 + op->level/20 + 1; | | |
if (new_armour > 90) | | |
new_armour = 90; | | |
| | |
if (armour->magic >= (op->level / 10 + 1) | | |
|| new_armour > op->level) | | |
{ | | |
int i; | | |
| | |
i = armour->magic * 10; | | |
if (i > new_armour) new_armour=i; | | |
| | |
new_draw_info_format(NDI_UNIQUE, 0,op,"You need to be level %d", new_armour); | | if (armour->magic >= 5) { |
new_draw_info(NDI_UNIQUE, 0,op,"to improve this armour."); | | new_draw_info(NDI_UNIQUE, 0,op,"This armour can not be enchanted any further."); |
return 0; | | return 0; |
} | | } |
| | /* Dealing with random artifact armor is a lot trickier (in terms of value, weight, |
if (new_armour > armour->resist[ATNR_PHYSICAL]) { | | * etc), so take the easy way out and don't worry about it. |
armour->resist[ATNR_PHYSICAL] = new_armour; | | * Note - maybe add scrolls which make the random artifact versions (eg, armour |
armour->weight += armour->weight * 0.05; | | * of gnarg and what not?) |
} else { | | */ |
new_draw_info(NDI_UNIQUE, 0,op,"The armour value of this equipment"); | | if (armour->title) { |
new_draw_info(NDI_UNIQUE, 0,op,"cannot be further improved."); | | new_draw_info(NDI_UNIQUE, 0, op, "This armour will not accept further enchantment."); |
| | return 0; |
} | | } |
| | |
| | /* Split objects if needed. Can't insert tmp until the |
| | * end of this function - otherwise it will just re-merge. |
| | */ |
| | if(armour->nrof > 1) |
| | tmp = get_split_ob(armour,armour->nrof - 1); |
| | else |
| | tmp = NULL; |
| | |
armour->magic++; | | armour->magic++; |
armour->item_power++; | | |
| | ARMOUR_SPEED(armour)=(ARMOUR_SPEED(&armour->arch->clone)*(100+armour->magic*10))/100; |
| | armour->weight = (armour->arch->clone.weight*(100-armour->magic*10))/100; |
| | armour->item_power = get_power_from_ench(armour->arch->clone.item_power + armour->magic); |
| | |
if (op->type == PLAYER) { | | if (op->type == PLAYER) { |
esrv_send_item(op, armour); | | esrv_send_item(op, armour); |
if(QUERY_FLAG(armour, FLAG_APPLIED)) | | if(QUERY_FLAG(armour, FLAG_APPLIED)) |
fix_player(op); | | fix_player(op); |
} | | } |
decrease_ob(improver); | | decrease_ob(improver); |
| | insert_ob_in_ob(tmp, op); |
return 1; | | return 1; |
} | | } |
| | |
| | |
{ | | { |
object *armor; | | object *armor; |
| | |
if (blocks_magic(op->map,op->x,op->y)) { | | if (get_map_flags(op->map,NULL, op->x,op->y,NULL, NULL) & P_NO_MAGIC) { |
new_draw_info(NDI_UNIQUE, 0,op,"Something blocks the magic of the scroll."); | | new_draw_info(NDI_UNIQUE, 0,op,"Something blocks the magic of the scroll."); |
return; | | return; |
} | | } |