mag_damage()

From: Edward J Glamkowski (eglamkowski@angelfire.com)
Date: 11/30/98


Just some random thoughts on the mag_damage() function:

I was adding my druid class and wanted to give them
a bonus vs. fire and electricity (yeah, yeah, standard
AD&D druid :P ) so I made a variable in mag_damage()
called spell_type and made some constants
#define SPELL_TYPE_FIRE  1
#defome SPELL_TYPE_COLD  2
etc.
Then, down where the saving throw is done,

if (IS_DRUID(victim) &&
     (spell_type == SPELL_TYPE_FIRE ||
      spell_type == SPELL_TYPE_ELECTRICITY))
  mod += 2;

Then add a new argument to mag_savingthrow which
is a modifier to the saveing throw die roll (which is
universally useful and I believe should be done in the
stock code  *cough* *Jeremy* *cough* ;)

This also allows for all sorts of resist_XXX spells
and item flags (resist_fire, resist_cold, etc.) which
give a bonus to saving throws against certain types of
attacks.

Another thing I've done is to add a save_type variable
in mag_damage and some constants to which it can be set
based on the spell being cast:
#define SAVE_TYPE_HALF_DAM  1
#define SAVE_TYPE_NO_DAM    2
#define SAVE_TYPE_NO_SAVE   3
#define SAVE_TYPE_THACO     4

and use these to modify how the saving throw is done:
SAVE_TYPE_NO_SAVE doesn't allow a saving throw - all
the damage always gets through no matter what.
SAVE_TYPE_HALF_DAM is the current system - save for
half damage.
SAVE_TYPE_NO_DAM means if they make their saving throw,
they take no damage at all!
SAVE_TYPE_THACO means there is no save, but the caster
has to make a hit roll instead (copied the code
straight from fight.c).


Anybody else done anything interesting with their
mag_damage function?



Angelfire for your free web-based e-mail. http://www.angelfire.com


     +------------------------------------------------------------+
     | 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/15/00 PST