Re: Swimming, falling, flying and drowning...

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

On Thu, 16 Oct 1997, David Klasinc wrote:

> Now here's the real problem... We will have drowning, flying falling and
> everything... But now, wouldn't flying make swimming obsolete? Why would
> one want to swim if one can fly? :)

Three terrains that need to be coded for in different ways.

        Swim or sink. If there is no down exit, then there is no sinking. If
you can't swim, however, you can't move (except for the sinking). While
underwater you will take damage unless you have AFF_WATERBREATH. I do this
check every 10 seconds in a function I called player_update().
        I supposed that objects with weight > 0 would sink if there is a
down exit, except for corpses, and they would float to the surface, then
decay, then all the stuff would sink back down. :)
        For rising and sinking, check to make sure the appropriate exit
exists, and if it does, make sure that the room that the exit goes to is
Underwater as well. Otherwise, you may end up with a corpse that floats
upwards into the air. :)

        If AFF_FLY or AFF_WATERWALK , then there is no need for swimming at
all. If you don't have those, then you must have the swimming skill. If
you don't have the skill, you can't enter/leave rooms of this terrain
type. If you are in this terrain type when player_update is called, then
your swimming skill is checked. If you fail, you inhale some water,
and take some damage. If you succeed, then you're no worse for the wear.
If you are affected by AFF_WATERBREATH, then your safe as well.

        If you have a boat, AFF_FLY or AFF_WATERWALK, then you're safe. If
not, you're stuck in that room unless you can magically remove yourself
from that room (recall, summon, teleport, etc.). If you don't have a
boat, AFF_FLY, or AFF_WATERWALK, then you will have your swimming skill
checked as per Water/Swimmable terrain type. The difference is that your
skill is cut in half when the swimming skill is checked. This is because
the water requires a boat to enter it, and therefore it is more hazardous.

All of that babbling, is a fairly concise summary of how I do things on
my MUD. Some of you won't care, some will. For what it's worth, there it

Oh... On dropped objects in Water/Swim and Water/NoSwim rooms.... Well...
The objs just sit there. If my players demand absolute realism, I'll
remove all the dragons from the game, chain them to desks and set all
their titles to 'the accountant', and work them too hard for too little
gold. :)

Gorthrak the accountant is here.

John Evans <>

May the source be with you.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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