[Circle] [CODE] unusual damage bug

From: Nic Suzor (suzor@bluesky.net.au)
Date: 11/08/96


Hi,

i still have the same error; one hit kills anything, even if the hit misses.
i have made a diff of a original fight.c and my modified fight.c, and will
add it to the bottom here. all i have added is a couple of checks for
CAN_MURDER, and a multi attack system.
the code for the multi attacks is Daniel's, and it seemed to work well
before...
im not even really sure that the problem is in fight.c, but it seems the
only logical place it could be, as i have not modified much else...

Thanks in advance

Nic Suzor



--------------------CODE---------------------

the defines are:
#define ATTACKS_PER_ROUND(ch)   \
                        ((number(1, 101) <= GET_SKILL(ch, SKILL_HIT_TWO)) + \
                         (number(1, 101) <= GET_SKILL(ch, SKILL_HIT_THREE))
+ \
                         (number(1, 101) <= GET_SKILL(ch, SKILL_HIT_FOUR)))

#define CAN_MURDER(ch, vict)     ((IS_NPC(ch)) || (IS_NPC(vict)) || \
                                  (PRF_FLAGGED(ch, PRF_PKILL) && \
                                  (PRF_FLAGGED(vict, PRF_PKILL))))


and the diff
*** ../fight.c  Fri Nov  8 17:02:19 1996
--- fight.c     Wed Nov  6 17:10:40 1996
***************
*** 190,200 ****
    if (IS_AFFECTED(ch, AFF_SLEEP))
      affect_from_char(ch, SPELL_SLEEP);
  
!   if (CAN_MURDER(ch, vict)) {
!     FIGHTING(ch) = vict;
!     GET_POS(ch) = POS_FIGHTING;
!   } else  send_to_char("You may not pkill your victim.\r\n", ch);
!     
    if (!pk_allowed)
      check_killer(ch, vict);
  }
--- 190,198 ----
    if (IS_AFFECTED(ch, AFF_SLEEP))
      affect_from_char(ch, SPELL_SLEEP);
  
!   FIGHTING(ch) = vict;
!   GET_POS(ch) = POS_FIGHTING;
! 
    if (!pk_allowed)
      check_killer(ch, vict);
  }
***************
*** 864,870 ****
  {
    struct char_data *ch;
    extern struct index_data *mob_index;
-   int x;
  
    for (ch = combat_list; ch; ch = next_combat_list) {
      next_combat_list = ch->next_fighting;
--- 850,855 ----
***************
*** 891,899 ****
        continue;
      }
  
!     for (x = 0; x <= ATTACKS_PER_ROUND(ch) && FIGHTING(ch); x++)
!       hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
! 
      if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func !=
NULL)
        (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
    }
--- 876,882 ----
        continue;
      }
  
!     hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
      if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func !=
NULL)
        (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
    }




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



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