Resistances to Magic

From: S. Mead (meadsh@ECE.ORST.EDU)
Date: 11/07/97


Ok, I am trying to add a system of magic resistance.  Basically all I am
trying to do is add a type flag to each spell, maybe like Fire, Cold,
Electric, and Magic.  These would be types of damage.  Then at the end
of mag_damage ( in magic.c), just before the actual damage I have this:

 /* Check target's resistance to spell type. */
 dam = dam*(GET_RES(victim, type)/100;  /* Replaces the 1/2 dam for a
save */

I am trying to make GET_RES similiar to GET_SAVE, so I add a define for
it in utils.h? and I also add defines for APPLY_RES_FIRE,
APPLY_RES_COLD, and electric and magic in structs.h.  Then in magic.c I
have spells like Resist Fire that are like this:

 case SPELL_RESIST_FIRE:
    af[0].location = APPLY_RES_FIRE;
    af[0].modifier = 25;  /* Effectively reduces damage from fire spells
by 25% */
    af[0].duration = 10;
    accum_duration = TRUE;
    to_vict = "You protected from the element of fire.";
    break;

I also have a case for APPLY_RES_<TYPE> in handler.c for eq
modifications(Ring of Fire Resistance)

Now what I am confused about is the call that fetches the Resistance
type (GET_RES) and how do I declare it in utils.h? GET_SAVE is declared
like this:

#define GET_SAVE(ch, i)
((ch)->char_specials.saved.apply_saving_throw[i])

So for mine it would be: #define GET_RES(ch, i)  (uhhhhhhh?)
Would anyone be so kind as to give me some tips to help me finish this
up?
Thanks! - Shaw


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST