src/magic.c
/*
 * Compute a saving throw.
 * Negative apply's make saving throw better.
 */
Compute a saving throw.
Negative apply's make saving throw better.
Compute a saving throw . Negative apply ' s make saving throw better .
bool saves_spell( int level, CHAR_DATA *victim, int dam_type )
{
    int save;
    save = 50 + ( victim->level - level) * 5 - victim->saving_throw * 2;
    if (IS_AFFECTED(victim,AFF_BERSERK))
	save += victim->level/2;
    switch(check_immune(victim,dam_type))
    {
	case IS_IMMUNE:		return TRUE;
	case IS_RESISTANT:	save += 2;	break;
	case IS_VULNERABLE:	save -= 2;	break;
    }
    if (!IS_NPC(victim) && class_table[victim->class].fMana)
	save = 9 * save / 10;
    save = URANGE( 5, save, 95 );
    return number_percent( ) < save;
}
bool saves_spell ( int level , CHAR_DATA * victim , int dam_type ) { int save ; save = 50 + ( victim -> level - level ) * 5 - victim -> saving_throw * 2 ; if ( IS_AFFECTED ( victim , AFF_BERSERK ) ) save += victim -> level / 2 ; switch ( check_immune ( victim , dam_type ) ) { case IS_IMMUNE : return TRUE ; case IS_RESISTANT : save += 2 ; break ; case IS_VULNERABLE : save -= 2 ; break ; } if ( ! IS_NPC ( victim ) && class_table [ victim -> class ] . fMana ) save = 9 * save / 10 ; save = URANGE ( 5 , save , 95 ) ; return number_percent ( ) < save ; }
Compute a saving throw.
Compute a saving throw .