version 1.69 | | version 1.70 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.69 2002/11/13 00:49:47 garbled Exp $"; | | * "$Id: spell_util.c,v 1.70 2002/11/13 05:24:54 garbled Exp $"; |
*/ | | */ |
| | |
| | |
| | |
free(stringarg);stringarg=NULL; | | free(stringarg);stringarg=NULL; |
} | | } |
| | |
#ifdef SPELLPOINT_LEVEL_DEPEND | | if (settings.spellpoint_level_depend == TRUE) |
return success?SP_level_spellpoint_cost(op,caster,type):0; | | return success?SP_level_spellpoint_cost(op,caster,type):0; |
#else | | else |
return success?(s->sp*PATH_SP_MULT(op,s)):0; | | return success?(s->sp*PATH_SP_MULT(op,s)):0; |
#endif | | |
} | | } |
| | |
| | |
| | |
{ | | { |
spell *s=find_spell(spell_type); | | spell *s=find_spell(spell_type); |
int level = casting_level (caster, spell_type); | | int level = casting_level (caster, spell_type); |
#ifdef SPELLPOINT_LEVEL_DEPEND | | |
int sp; | | int sp; |
| | |
| | if (settings.spellpoint_level_depend == TRUE) { |
if(SP_PARAMETERS[spell_type].spl) | | if(SP_PARAMETERS[spell_type].spl) |
sp= (int) (spells[spell_type].sp * | | sp= (int) (spells[spell_type].sp * |
(1.0 + | | (1.0 + (MAX(0, (float)(level-spells[spell_type].level)/ |
(MAX(0, (float)(level-spells[spell_type].level)/ | | |
(float)SP_PARAMETERS[spell_type].spl )))); | | (float)SP_PARAMETERS[spell_type].spl )))); |
else sp= spells[spell_type].sp; | | else |
| | sp= spells[spell_type].sp; |
sp *= PATH_SP_MULT(caster,s); | | sp *= PATH_SP_MULT(caster,s); |
return MIN(sp,(spells[spell_type].sp + 50)); | | return MIN(sp,(spells[spell_type].sp + 50)); |
#else | | } else { |
return s->sp*PATH_SP_MULT(caster,s); | | return s->sp*PATH_SP_MULT(caster,s); |
#endif /* SPELLPOINT_LEVEL_DEPEND */ | | } |
} | | } |
| | |
| | |