version 1.86 | | version 1.87 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.86 2004/04/18 07:59:36 mwedel Exp $"; | | * "$Id: spell_util.c,v 1.87 2004/05/11 06:57:38 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
* parameters to a spell (eg, item to create, information for marking runes, | | * parameters to a spell (eg, item to create, information for marking runes, |
* etc. | | * etc. |
* returns 1 on successful cast, or 0 on error. These values should really | | * returns 1 on successful cast, or 0 on error. These values should really |
* be swapped, so that 0 is sucessful, and non zero is failure, with a code | | * be swapped, so that 0 is successful, and non zero is failure, with a code |
* of what it failed. | | * of what it failed. |
* | | * |
* Note that this function is really a dispatch routine that calls other | | * Note that this function is really a dispatch routine that calls other |
| | |
if (settings.casting_time == TRUE) { | | if (settings.casting_time == TRUE) { |
op->casting_time = -1; | | op->casting_time = -1; |
} | | } |
return(random_roll(1, SP_level_spellpoint_cost(caster,spell_ob, SPELL_GRACE), op, PREFER_LOW)); | | op->stats.grace -= random_roll(1, SP_level_spellpoint_cost(caster,spell_ob, SPELL_GRACE), op, PREFER_LOW); |
| | return 0; |
} else if (spell_ob->stats.sp) { | | } else if (spell_ob->stats.sp) { |
int failure = random_roll(0, 199, op, PREFER_HIGH) - | | int failure = random_roll(0, 199, op, PREFER_HIGH) - |
op->contr->encumbrance +op->level - spell_ob->level +35; | | op->contr->encumbrance +op->level - spell_ob->level +35; |
| | |
SP_level_spellpoint_cost(caster,spell_ob, SPELL_MANA), | | SP_level_spellpoint_cost(caster,spell_ob, SPELL_MANA), |
skill); | | skill); |
op->contr->shoottype = old_shoottype; | | op->contr->shoottype = old_shoottype; |
return(random_roll(0, SP_level_spellpoint_cost(caster,spell_ob, SPELL_MANA), op, PREFER_LOW)); | | op->stats.sp -= random_roll(0, SP_level_spellpoint_cost(caster,spell_ob, SPELL_MANA), op, PREFER_LOW); |
| | return 0; |
} | | } |
} | | } |
} | | } |