version 1.2 | | version 1.3 |
---|
| | |
/* | | /* |
* static char *rcsid_spells_c = | | * static char *rcsid_spells_c = |
* "$Id: spell_util.c,v 1.2 1999/07/13 06:03:04 cvs Exp $"; | | * "$Id: spell_util.c,v 1.3 1999/08/06 21:29:54 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
if (op->path_denied & s->path) | | if (op->path_denied & s->path) |
return -100; /* shouldn't get here, but ... */ | | return -100; /* shouldn't get here, but ... */ |
val = ((op->path_repelled & s->path)!=0) * -5 + | | val = (op->path_repelled & s->path) ? -5 : 0 |
((op->path_attuned & s->path)!=0) * 5; | | + (op->path_attuned & s->path) ? 5 : 0; |
if (op->level - val < 1) | | if (op->level - val < 1) |
return op->level-1; | | return op->level-1; |
else | | else |
| | |
success = perceive_self(op); | | success = perceive_self(op); |
break; | | break; |
case SP_WOR: | | case SP_WOR: |
success = cast_wor(op); | | success = cast_wor(op,caster); |
break; | | break; |
case SP_INVIS: | | case SP_INVIS: |
case SP_INVIS_UNDEAD: | | case SP_INVIS_UNDEAD: |
| | |
* the casters level (op->level) with the skill level (SK_level(op)) | | * the casters level (op->level) with the skill level (SK_level(op)) |
* instead for when we have compiled with ALLOW_SKILLS - b.t. | | * instead for when we have compiled with ALLOW_SKILLS - b.t. |
*/ | | */ |
| | /* now based on caster's level instead of on op's level and caster's * |
| | * path modifiers. --DAMN */ |
| | |
int SP_level_dam_adjust(object *op, object *caster, int spell_type) | | int SP_level_dam_adjust(object *op, object *caster, int spell_type) |
{ int adj; | | { int adj; |
#ifdef ALLOW_SKILLS | | #ifdef ALLOW_SKILLS |
int level=SK_level(op)+path_level_mod(caster, spell_type); | | int level=SK_level(caster)+path_level_mod(caster, spell_type); |
#else | | #else |
int level=op->level+path_level_mod(caster, spell_type); | | int level=caster->level+path_level_mod(caster, spell_type); |
#endif | | #endif |
| | |
adj=(level-spells[spell_type].level); | | adj=(level-spells[spell_type].level); |
| | |
} | | } |
| | |
/* July 1995 - changed slightly (SK_level) for ALLOW_SKILLS - b.t. */ | | /* July 1995 - changed slightly (SK_level) for ALLOW_SKILLS - b.t. */ |
| | /* now based on caster's level instead of on op's level and caster's * |
| | * path modifiers. --DAMN */ |
int SP_level_strength_adjust(object *op, object *caster, int spell_type) | | int SP_level_strength_adjust(object *op, object *caster, int spell_type) |
{ int adj; | | { int adj; |
#ifdef ALLOW_SKILLS | | #ifdef ALLOW_SKILLS |
int level=SK_level(op)+path_level_mod(caster, spell_type); | | int level=SK_level(caster)+path_level_mod(caster, spell_type); |
#else | | #else |
int level=op->level+path_level_mod(caster, spell_type); | | int level=caster->level+path_level_mod(caster, spell_type); |
#endif | | #endif |
adj= (level-spells[spell_type].level); | | adj= (level-spells[spell_type].level); |
if(adj < 0) adj=0; | | if(adj < 0) adj=0; |