If you actually decide to go through with this snippet...

>   switch (check_immune_material(victim, wield))
>   {
>   case (IS_IMMUNE):
>     immune = TRUE;
>     dam = 0;
>     break;
>   case (IS_RESISTANT):
>     dam -= dam / 3;
>     break;
>   case (IS_VULNERABLE):
>     dam += dam / 2;
>     break;
>   }

This wouldn't exactly work because the material doesn't line up
with a damage type.  It's not quite that simple.  But...

> int check_immune_material(CHAR_DATA * ch, OBJ_DATA * wield)
> {
>   int immune, def;
>   int bit;
> 
>   immune = -1;
>   def = IS_NORMAL;
> 
>   if (str_cmp(wield->material, "iron"))
>       bit = IMM_IRON;
>   else if (str_cmp(wield->material, "silver"))
>     bit = IMM_SILVER;
>   else if (str_cmp(wield->material, "wood"))
>     bit = IMM_WOOD;
>   else
>     return def;

Instead of this you could make a table.  Something like this:
{ material, damage type }
{ "iron", DAM_IRON },
{ "silver", DAM_SILVER },
etc

Then do a search through the table for the object material
matching the table material, and use that table entry for the
damage type.  Then check the immunity for it.  After you do all
that, I could see it working... but the whole aspect of
assigning accurate materials to every object in the game is mind
boggling. :P  Good luck with it if you choose to pursue it.


=====
-Matt Foltz
[Neoterra MUD] telnet://neoterra.is-a-geek.com:4000
[Car Audio Resources homepage] http://www.car-audio.net

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

Reply via email to