Re: Question regarding NPC Positions

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


On Fri, 5 Dec 1997, Ryan Gasper or Steven Arnold wrote:

> On Thu, 4 Dec 1997, bruce wrote:
>
> > The mob files.
>
>         That sets what their starting position is, but does nothing after
> they are attacked.
>
> > Also, if you use POS_'s how do you handle fighting (cos fighting chars
> > are POS_FIGHTING)? ie, you're flying along and hit a mob, suddenly
> > you're POS_FIGHTING and fall out of the sky.
>
>         Common Sense. Just because your fighting, does not mean your no
> longer flying, as long as after the fight, you revert back to the position
> you were in.

No. The way you have stated that you are coding it, if someone gets in a
fight, their position shifts from POS_FLYING to POS_FIGHTING. That means
that they should plummet from the sky and bounce!

Oh. But you'll say that no people that are fighting will fall because
you'll give them the benefit of doubt and assume that they were flying
before they starting fighting. That means that if I time it right and
keep fighting when the computer checks to see if I am flying, I can get
_way_ up in the air without the benefit of a fly spell.

Like I said from the start, AFF flags is the best way of handling fly.
Check out waterwalk. Is there a POS_WATERWALK? No. There is an affect flag
for it because you are affected by a spell! The same goes with flying.

But what about winged races? Well, to accomodate for those, I made the
following macro (or something similar):

#define IS_FLYING(ch) (IS_AFFECTED((ch), AFF_FLY) || \
                       (GET_RACE((ch)) == RACE_BIRDMAN))

And in my if statements, I use:

if(IS_FLYING(ch)) {
....
}

Simple enough. No bother with positions or fighting the code to make sure
that someone's POS_XXX doesn't get mangled or messed up. Also. What if
the fly spell wears off while someone is fighing? You'll probably have to
write some code to handle that.

All-in-all, AFF_FLY is _much_ better than POS_FLY.


Also,
        You mentioned something about POS_SWIMMING. Why? If they are in
water, assume that they are swimming and go on.

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