--- Anarchangel <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I've been giving some thought to changing the resistance system from a
> simple is_set or not is_set to a number between -100 (meaning take double
> damage) to 100 (meaning immune), and 0 being taking normal damage.  This
> means I could theoretically get rid of immunities altogether.
> 
> The problem is the only way I can think of accomplishing this would be to
> make about 30 entries in mob_index_data (one for each resistance) rather
> than just one as it is currently (res_flags).
> 
> This seems overly messy to me, especially since about 30 thousand mobs
> would be using it and most of them don't even have more than one or two
> resistances.
> 
> Anyone ever done this in an efficient manner?

Certainly.. Firstly, if you intend for both npc's and pc's to have this
information it needs to be specified in the char_data structure, (though you'll
also need it in mob_index_data to copy over to the newly instantiated npc's
char_data instance. As for what sort of method for storing the resistances..
Well ideally you'd want some sort of tree structure similiar to those used in
the C++ set template. That would make for quick lookup of damage modifier
types. However, this may be overkill if most of your characters won't have more
than 2 or 3 modifiers (vulns,resistances). So for simplicity you could go with
a linked list. Then just look up to see if there is a modifier for the damage
type being done, and use damage -= damage * dam_mod->amount/100;


~Kender

=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++: a-- C+++$>++++ UBLS++++$ 
P+++(--)$ L+++>++++ E--- W+>++$ N !o K? w(--) !O 
M- !V PS+ PE(++) Y+ PGP->+ t+ 5 X+() R(+) tv+@ 
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Reply via email to