Re: Falling through Air Rooms...there IS a better way...

From: si12632 (si12632@ci.uminho.pt)
Date: 07/19/96


>    Anyone have any ideas?  I wouldn't mind working on it and reposting
> any improvements I make to the code.  I think this is a feature a lot of
> people would be interested in getting :)
> 

  Hmmm... There is a better and clean way. But i'm not the right person
to post it. However, here it goes: this is a perfect example of the
usefullness of my event queue, wich i posted a week or so back. Yeah, I know
it's a shameless plug, but it's true.
  Just go ahead and read:

    You define an event fall_event that is issued if a character doesn't have
AFF_FLY and there is no ground beneath. That event will be triggered... hmm...
2 seconds from now. When that time expires, the player is sent to the down
room. In the room bellow, if the player still isn't flying, you issue another
fall_event, this time with delay 1, and so forth.
    This way, the player will have several seconds to cast the spell. Now that
i look at it, maybe 2 seconds is too fast. Actual numbers have to be tested.
    Let's look at a bit of pseudo-code:

   EVENT(fall_event)   // the previous delay is passed through info

     if the player is flying
        exit
     else
       move player down on room
       issue new fall_event, with a shorter delay. 
     endif
 
   Additionaly, instead of exiting if the player is flying, you could slow him
down until he stops. That would be up to you. I believe this is an elegant
way to implement it. I did something similar, when i built a timed DT in a
river. The river would drag the players, but had the possibility to leave the
room. If they were fast they made it, else, they were doomed. :))

   The only problem i see with this solution is that you would have to install
my event queue code first. Opinions any one?

Luis Carvalho, aka Simon @ Implementor's MUD



This archive was generated by hypermail 2b30 : 12/07/00 PST