version 1.64 | | version 1.65 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.64 2002/07/15 04:57:13 mwedel Exp $"; | | * "$Id: spell_util.c,v 1.65 2002/07/25 06:57:14 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
if( spells[type].onself) dir = 0; | | if( spells[type].onself) dir = 0; |
} | | } |
| | |
if(!(QUERY_FLAG(op, FLAG_WIZ))&& | | if(!(QUERY_FLAG(op, FLAG_WIZ))&& (op->type==PLAYER) && (op->contr->shoottype==range_magic) && |
(op->type==PLAYER)&& | | (item!=spellPotion)&& (!(IS_SUMMON_SPELL(type)&&op->contr->golem!=NULL))) { |
(op->contr->shoottype==range_magic)&& | | if( !spells[type].cleric && op->stats.sp<SP_level_spellpoint_cost(op,caster,type)) { |
(item!=spellPotion)&& | | |
(!(IS_SUMMON_SPELL(type)&&op->contr->golem!=NULL))) | | |
{ | | |
if(!spells[type].cleric&& op->stats.sp<SP_level_spellpoint_cost(op,caster,type)) | | |
{ | | |
new_draw_info(NDI_UNIQUE, 0,op,"You don't have enough mana."); | | new_draw_info(NDI_UNIQUE, 0,op,"You don't have enough mana."); |
return 0; | | return 0; |
} | | } |
if(spells[type].cleric&&op->stats.grace<SP_level_spellpoint_cost(op,caster,type)) | | else if(spells[type].cleric && op->stats.grace<SP_level_spellpoint_cost(op,caster,type)) |
{ | | { |
/* it's possible for grace to go negative */ | | /* it's possible for grace to go negative */ |
/* Fine - let grace go negative, but how negative it is should really | | /* Fine - let grace go negative, but how negative it is should really |
| | |
} | | } |
break; | | break; |
case SP_RUNE_MAGIC: | | case SP_RUNE_MAGIC: |
{ int total_sp_cost, spellinrune; | | case SP_GLYPH: |
spellinrune=look_up_spell_by_name(op,stringarg); | | return cast_generic_rune(op, caster, dir, stringarg, type); |
if(spellinrune!=-1) { | | |
total_sp_cost=SP_level_spellpoint_cost(op,caster,spellinrune) | | |
+spells[spellinrune].sp; | | |
if(op->stats.sp<total_sp_cost) { | | |
new_draw_info(NDI_UNIQUE, 0,op,"Not enough spellpoints."); | | |
#ifdef CASTING_TIME | | |
/* free the spell arg */ | | |
if(stringarg) {free(stringarg);stringarg=NULL; }; | | |
#endif | | |
return 0; | | |
} | | |
success=write_rune(op,dir,spellinrune,caster->level,stringarg); | | |
return (success ? total_sp_cost : 0); | | |
} | | |
#ifdef CASTING_TIME | | |
/* free the spell arg */ | | |
if(stringarg) {free(stringarg);stringarg=NULL; }; | | |
#endif | | |
return 0; | | |
} | | |
break; | | break; |
| | |
case SP_RUNE_MARK: | | case SP_RUNE_MARK: |
if(caster->type == PLAYER) | | if(caster->type == PLAYER) |
success=write_rune(op,dir,0,-2,stringarg); | | success=write_rune(op,dir,0,-2,stringarg); |