Re: Implemented dual_wield, need help with messaging dual weapon type via fight.c

From: John Evans (evansj@HI-LINE.NET)
Date: 10/26/97


On Sat, 25 Oct 1997, Tony Skinner wrote:

>         I just implemented dual wield under Circle v3.0 pl11. I basically
> allocated another bit vector to represent the dual wield position then
> incorporated checks within act.item.c to verify no hold and no shield if
> char dual wielding a weapon.
> My problem is now trying to get fight.c code to differentiate between the
> wielded weapon and secondary weapon for displaying the weapon attack
> message (weapon type) and differentiating between the two weapon's
> differing damages.

What I did was chopped hit() into two different functions: npc_hit() and
pc_hit(). I had to do this because mobs can have up to 16 attacks, and
that made it necesary to have two different function calls. :(

Here is a small snippet of my hit() function:

  if (IS_NPC(ch)) {
    for (attack_num = 0; attack_num <= NUM_MOB_ATTACKS; attack_num++) {
      npc_hit(ch, victim, type, attack_num);
    }
  }
  else {
    pc_hit(ch, victim, type, WEAR_WIELD_1);
    if (number(1, 120) <= GET_SKILL(ch, SKILL_DOUBLE_ATTACK))
      pc_hit(ch, victim, type, WEAR_WIELD_1);
    if (number(1, 120) <= GET_SKILL(ch, SKILL_FLORENTINE)) {
      pc_hit(ch, victim, type, WEAR_WIELD_2);
      if (number(1, 120) <= GET_SKILL(ch, SKILL_DOUBLE_ATTACK))
        pc_hit(ch, victim, type, WEAR_WIELD_2);
    }
  }


If they are an NPC, then it loops through all 16 of the mob's attacks and
performs them.

If they are a player, then they get one hit for sure, and a chance (based
on skill) for extra attacks from Florentine and Double Attack.

You may notice that there is no error checking for if they have a weapon
in hand. That check is done inside pc_hit().

Any questions?

John Evans <evansj@hi-line.net>

May the source be with you.


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