version 1.7 | | version 1.8 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.7 1999/09/17 18:39:56 damn Exp $"; | | * "$Id: apply.c,v 1.8 2000/04/05 04:38:50 cvs Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
Copyright (C) 1994 Mark Wedel | | Copyright (C) 2000 Mark Wedel |
Copyright (C) 1992 Frank Tore Johansen | | Copyright (C) 1992 Frank Tore Johansen |
| | |
This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify |
| | |
along with this program; if not, write to the Free Software | | along with this program; if not, write to the Free Software |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| | |
The author can be reached via e-mail to mark@pyramid.com | | The author can be reached via e-mail to mwedel@scruz.net |
*/ | | */ |
| | |
#include <global.h> | | #include <global.h> |
| | |
* value (magic) of the armour can never be increased beyond | | * value (magic) of the armour can never be increased beyond |
* the level of the character / 10 -- rounding upish, nor may | | * the level of the character / 10 -- rounding upish, nor may |
* the armour value of the piece of equipment exceed either | | * the armour value of the piece of equipment exceed either |
* the users level or 99) | | * the users level or 90) |
*/ | | */ |
| | |
int improve_armour(object *op, object *improver, object *armour) | | int improve_armour(object *op, object *improver, object *armour) |
{ | | { |
int addarm; | | int new_armour; |
| | |
addarm = armour->armour/25 + op->level/20 + 1; | | new_armour = armour->armour + armour->armour/25 + op->level/20 + 1; |
| | if (new_armour > 90) |
| | new_armour = 90; |
| | |
if (armour->magic>=(op->level/10+1) || ((armour->armour + | | if (armour->magic >= (op->level / 10 + 1) |
addarm) >= op->level )) { | | || new_armour > op->level) |
| | { |
new_draw_info(NDI_UNIQUE, 0,op,"You are not yet powerfull enough"); | | new_draw_info(NDI_UNIQUE, 0,op,"You are not yet powerfull enough"); |
new_draw_info(NDI_UNIQUE, 0,op,"to improve this armour."); | | new_draw_info(NDI_UNIQUE, 0,op,"to improve this armour."); |
return 0; | | return 0; |
} | | } |
| | |
if( (armour->armour + addarm) <= 99) { | | if (new_armour > armour->armour) { |
armour->magic++; | | armour->armour = new_armour; |
armour->armour+=addarm; | | |
armour->weight+=armour->weight*0.05; | | armour->weight+=armour->weight*0.05; |
| | } else { |
| | new_draw_info(NDI_UNIQUE, 0,op,"The armour value of this equipment"); |
| | new_draw_info(NDI_UNIQUE, 0,op,"cannot be further improved."); |
| | } |
| | 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)) |
| | |
} | | } |
decrease_ob(improver); | | decrease_ob(improver); |
return 1; | | return 1; |
} else { | | |
armour->magic++; | | |
new_draw_info(NDI_UNIQUE, 0,op,"The armour value of this equipment"); | | |
new_draw_info(NDI_UNIQUE, 0,op,"cannot be further improved."); | | |
decrease_ob(improver); | | |
return 1; | | |
} | | |
| | |
} | | } |
| | |
| | |