Re: Fireweapons

From: Tony Robbins [Kupek] (tonyr@NWPACLINK.COM)
Date: 08/26/98


On Wed, 26 Aug 1998, Nick Stout wrote:
> in my pulse violence, to subtract ammo, i have this right before the
> GET_MOB_WAIT:
>

At the top of the function:
  struct obj_data *weapon = NULL;

  if (GET_EQ(ch, WEAR_WIELD))
    weapon = GET_EQ(ch, WEAR_WIELD);

  if (weapon && GET_OBJ_TYPE(weapon) == ITEM_FIREWEAPON)
    GET_OBJ_VAL(weapon, 3)--;

That was just off the top of my head.  By the way, doesn't the function
use something like "wielded" anyway?  Or is that in damage()?  If the
function itself uses "wielded" (which references the character's wielded
weapon), just go ahead and use it instead of another object.

-B.


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