Re: [CODE] Affects from Eq'd Objs

From: Daniel Koepke (dkoepke@california.com)
Date: 01/29/97


On Tue, 28 Jan 1997, Leonard Burns IV wrote:

> I'm trying to make it so that when an obj is sheathed you don't get the
> affects/bonus' from it. Its not in act.item.c, I found an affect_modify
> in the handler.c file, any advice on how to do this?

Okay, perform_wear() [act.item.c] calls equip_char() in handler.c,
which calls affect_total() [handler.c] to add up affects from all the
equipment, etc.  Simple fix: change affect_total() to not take account
for items in WEAR_SHEATH.  I would have suggested that you change
equip_char() to not call affect_total() when you're equipping something,
but that wouldn't work right: a. it wouldn't remove the affects from
the WEAR_WIELD position, so there'd be no result; b. the next time it
would remove the affects from the WEAR_WIELD item, but then it would
count WEAR_SHEATH, which would make it the same... :)  So, instead of
changing equip_char(), change affect_total() like...:

  for (i = 0; i < NUM_WEARS; i++) {
    if (GET_EQ(ch, i) && i != WEAR_SHEATH)
      for (j = 0; j < MAX_OBJ_AFFECT; j++)
        affect_modify(ch, GET_EQ(ch, i)->affected[j].location,
                      GET_EQ(ch, i)->affected[j].modifier,
                      GET_EQ(ch, i)->obj_flags.bitvector, FALSE);

... Something ...


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


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