version 1.81 | | version 1.82 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.81 2002/11/26 07:57:17 garbled Exp $"; | | * "$Id: spell_effect.c,v 1.82 2002/12/03 07:40:18 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
* spell_failure() handles the various effects for differing degrees | | * spell_failure() handles the various effects for differing degrees |
* of failure badness. | | * of failure badness. |
*/ | | */ |
/* Might be a better way to do this, but this should work */ | | |
#define ISQRT(val) ((int)sqrt((double) val)) | | |
| | |
void spell_failure(object *op, int failure,int power) | | void spell_failure(object *op, int failure,int power) |
{ | | { |
| | |
tmp->x=op->x;tmp->y=op->y; | | tmp->x=op->x;tmp->y=op->y; |
| | |
/* increase the area of destruction a little for more powerful spells */ | | /* increase the area of destruction a little for more powerful spells */ |
tmp->stats.hp+=ISQRT(power); | | tmp->stats.hp+=isqrt(power); |
| | |
if (power>25) tmp->stats.dam = 25 + ISQRT(power); | | if (power>25) tmp->stats.dam = 25 + isqrt(power); |
else tmp->stats.dam=power; /* nasty recoils! */ | | else tmp->stats.dam=power; /* nasty recoils! */ |
| | |
tmp->stats.maxhp=tmp->count; /*??*/ | | tmp->stats.maxhp=tmp->count; /*??*/ |