version 1.84 | | version 1.85 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.84 2004/02/17 00:22:25 mwedel Exp $"; | | * "$Id: spell_util.c,v 1.85 2004/03/23 07:52:32 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
| | |
/* if it is a player casting the spell, and they are really casting it | | /* if it is a player casting the spell, and they are really casting it |
* (vs it coming from a wand, scroll, or whatever else), do some | | * (vs it coming from a wand, scroll, or whatever else), do some |
* checks. If its the wizard, skip the skips - wizards can do special | | * checks. We let monsters do special things - eg, they |
* things. Likewise, we let monsters do special things - eg, they | | |
* don't need the skill, bypass level checks, etc. The monster function | | * don't need the skill, bypass level checks, etc. The monster function |
* should take care of that. | | * should take care of that. |
| | * Remove the wiz check here and move it further down - some spells |
| | * need to have the right skill pointer passed, so we need to |
| | * at least process that code. |
*/ | | */ |
if (op->type == PLAYER && op == caster && !QUERY_FLAG(op, FLAG_WIZ)) { | | if (op->type == PLAYER && op == caster) { |
cast_level = caster_level(caster, spell_ob); | | cast_level = caster_level(caster, spell_ob); |
if (spell_ob->skill) { | | if (spell_ob->skill) { |
skill = find_skill_by_name(op, spell_ob->skill); | | skill = find_skill_by_name(op, spell_ob->skill); |
| | |
spell_ob->skill, spell_ob->name); | | spell_ob->skill, spell_ob->name); |
return 0; | | return 0; |
} | | } |
if (min_casting_level(op, spell_ob) > cast_level) { | | if (min_casting_level(op, spell_ob) > cast_level && !QUERY_FLAG(op, FLAG_WIZ)) { |
new_draw_info(NDI_UNIQUE, 0,op, "You lack enough skill to cast that spell."); | | new_draw_info(NDI_UNIQUE, 0,op, "You lack enough skill to cast that spell."); |
return 0; | | return 0; |
} | | } |
} | | } |
| | /* If the caster is the wiz, they don't ever fail, and don't have |
| | * to have sufficient grace/mana. |
| | */ |
| | if (!QUERY_FLAG(op, FLAG_WIZ)) { |
if (SP_level_spellpoint_cost(caster, spell_ob, SPELL_MANA) && | | if (SP_level_spellpoint_cost(caster, spell_ob, SPELL_MANA) && |
SP_level_spellpoint_cost(caster, spell_ob, SPELL_MANA) > op->stats.sp) { | | SP_level_spellpoint_cost(caster, spell_ob, SPELL_MANA) > op->stats.sp) { |
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."); |
| | |
} | | } |
} | | } |
} | | } |
| | } |
| | |
mflags = get_map_flags(op->map, NULL, op->x, op->y, NULL, NULL); | | mflags = get_map_flags(op->map, NULL, op->x, op->y, NULL, NULL); |
| | |