[CODE][NEWBIE] Body parts

From: Benjamin Draper (satrycus@DRACHENBURG.DEMON.CO.UK)
Date: 03/08/98


Right, I've just added separate body parts to my MUD. Each body part has
it's own total of hit points. I'm having a problem because I need to
be able to inflict general damage to mobs and players from spells
and things like drowning and exhaustion.

   I know why this piece of code doesn't work, it's cos it's damaging
a player/mob that's dead. I can't think of anything to get round the
way I am doing it. Probably simple, but it is 1am.

Forgive the sloppy coding.

void gen_damage(struct char_data * ch, struct char_data * victim, int
dam,
            int attacktype, int bp_ac)
{
  int bp;

  for (bp = 0; bp < NUM_BODY_PARTS; bp++) {
    if (bp_ac != -1)
      bp_ac = GET_BP_AC(victim, bp);
     else
      bp_ac = 0;

     damage(ch, victim, dam, attacktype, bp, bp_ac);
  }
}

 Basically the main thing is how do I stop it damaging the victim when
the victim is dead? I'm bound to need a 'while' or something, or a check
in damage somewhere. I know it checks to see if you're damaging a
corpse, and I get that up until the last body part is checked. After
that it crashes.

 The MUD is highly modified (really it is) and I'm using Windows95
(curse me).


-> Ben


     +------------------------------------------------------------+
     | 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