There should be snippets available already for adding the AFF2 flags to
your mud... I personally went with an unlimited bits system so that I
would never run out of affects and have to add another AFF# set... but 1
way to get around the problem is to stop using affect bits and instead
of assigning bitvectors to players when you need to add an affect, make
the spell (or whatever) into a gsn_value and add that data to the
affect, then check for it with is_affected instead of IS_AFFECTED...
example (and this is off the top of my head, so it's probably got some
syntax errors in it):
/* old way */
/* merc.h */
#define AFF_BLINDNESS (A)
/* magic.c */
AFFECT_DATA *af;
CHAR_DATA *ch;
af.type = skill_lookup("blindness");
af.location = APPLY_HITROLL;
af.modifier = -5;
af.bitvector = AFF_BLINDNESS;
affect_to_char(ch, &af);
/* fight.c */
if ( IS_AFFECTED( ch, AFF_BLINDNESS ) )
{
/* whatever */
}
/* new way */
/* merc.h */
extern sh_int gsn_blindness;
/* db.c */
sh_int gsn_blindness;
/* magic.c */
AFFECT_DATA *af;
CHAR_DATA *ch;
af.type = skill_lookup("blindness"); // or you could probably just use
gsn_blindness here...
af.location = APPLY_HITROLL;
af.modifier = -5;
af.bitvector = 0;
affect_to_char(ch, &af);
/* fight.c */
if ( is_affected(ch, gsn_blindness) )
{
/* whatever */
}
something like that is what I started doing on my own mud before going
to unlimited bits, though I can't remember if that last part is supposed
to be &gsn_blindness in the is_affected check... someone else can
probably elaborate :D
Richard Lindsey.
-----Original Message-----
From: Brittany Dannenberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 11, 2005 10:48 PM
To: [email protected]; [EMAIL PROTECTED]
Subject: adding more aff flags
Hiya,
I guess adding these types of flags are harder than I
thought. I ran out of AFF flags for spells so I added
in AFF2, but there seems to be a bunch of problems
with doing this. First, because I haven't finished
this - spells are overlapping. I have AFF2_SLOW (A),
and AFF_BLINDNESS (A), cast slow, I get blind. The
fact that IS_AFFECTED only looks at aff is one of the
problems, and a few other things. I'm really not the
best programmer, so I don't really know what to do
from here. I added a long aff2; under the long aff; in
race_type in merc.h and that's about it. If anyone has
ever run into this problem before and could get me on
my way that would be wonderful. Thanks a bunch.
Brittany.
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
--
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom