version 1.87 | | version 1.88 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.87 2004/05/11 06:57:38 mwedel Exp $"; | | * "$Id: spell_util.c,v 1.88 2004/05/14 06:41:27 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
(float)(level-spell->level)/ (float)spell->stats.maxsp))); | | (float)(level-spell->level)/ (float)spell->stats.maxsp))); |
} | | } |
else sp = spell->stats.sp; | | else sp = spell->stats.sp; |
| | |
sp *= PATH_SP_MULT(caster,spell); | | sp *= PATH_SP_MULT(caster,spell); |
| | if (!sp && spell->stats.sp) sp=1; |
| | |
if (spell->stats.grace && spell->stats.maxgrace) { | | if (spell->stats.grace && spell->stats.maxgrace) { |
grace= (int) (spell->stats.grace * | | grace= (int) (spell->stats.grace * |
| | |
(float)(level-spell->level)/ (float)spell->stats.maxgrace))); | | (float)(level-spell->level)/ (float)spell->stats.maxgrace))); |
} | | } |
else grace = spell->stats.grace; | | else grace = spell->stats.grace; |
| | |
grace *= PATH_SP_MULT(caster,spell); | | grace *= PATH_SP_MULT(caster,spell); |
| | if (spell->stats.grace && !grace) grace=1; |
} else { | | } else { |
sp = spell->stats.sp * PATH_SP_MULT(caster,spell); | | sp = spell->stats.sp * PATH_SP_MULT(caster,spell); |
| | if (spell->stats.sp && !sp) sp=1; |
grace = spell->stats.grace * PATH_SP_MULT(caster,spell); | | grace = spell->stats.grace * PATH_SP_MULT(caster,spell); |
| | if (spell->stats.grace && !grace) grace=1; |
} | | } |
if (flags == SPELL_HIGHEST) | | if (flags == SPELL_HIGHEST) |
return MAX(sp, grace); | | return MAX(sp, grace); |