skylib_fluffos_v3/
skylib_fluffos_v3/bin/
skylib_fluffos_v3/bin/db/
skylib_fluffos_v3/fluffos-2.9-ds2.04/
skylib_fluffos_v3/fluffos-2.9-ds2.04/ChangeLog.old/
skylib_fluffos_v3/fluffos-2.9-ds2.04/Win32/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/simuls/
skylib_fluffos_v3/fluffos-2.9-ds2.04/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/clone/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/command/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/data/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/etc/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/master/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/log/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/compiler/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/efuns/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/operators/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/u/
skylib_fluffos_v3/fluffos-2.9-ds2.04/tmp/
skylib_fluffos_v3/fluffos-2.9-ds2.04/windows/
skylib_fluffos_v3/mudlib/
skylib_fluffos_v3/mudlib/cmds/
skylib_fluffos_v3/mudlib/cmds/admin/
skylib_fluffos_v3/mudlib/cmds/guild-race/
skylib_fluffos_v3/mudlib/cmds/living/broken/
skylib_fluffos_v3/mudlib/cmds/player/group_cmds/
skylib_fluffos_v3/mudlib/cmds/playtester/
skylib_fluffos_v3/mudlib/d/admin/
skylib_fluffos_v3/mudlib/d/admin/room/
skylib_fluffos_v3/mudlib/d/admin/room/we_care/
skylib_fluffos_v3/mudlib/d/admin/save/
skylib_fluffos_v3/mudlib/d/admin/text/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/buildings/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/map/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/roads/
skylib_fluffos_v3/mudlib/d/learning/chars/
skylib_fluffos_v3/mudlib/d/learning/functions/
skylib_fluffos_v3/mudlib/d/learning/handlers/
skylib_fluffos_v3/mudlib/d/learning/help_topics/
skylib_fluffos_v3/mudlib/d/learning/help_topics/npcs/
skylib_fluffos_v3/mudlib/d/learning/help_topics/objects/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/RCS/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/crowd/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/situations/
skylib_fluffos_v3/mudlib/d/learning/save/
skylib_fluffos_v3/mudlib/d/learning/school/
skylib_fluffos_v3/mudlib/d/learning/school/add_sc/
skylib_fluffos_v3/mudlib/d/learning/school/characters/
skylib_fluffos_v3/mudlib/d/learning/school/general/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/basic_commands/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/edtutor/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/unix_tutor/
skylib_fluffos_v3/mudlib/d/learning/school/items/
skylib_fluffos_v3/mudlib/d/learning/school/npc_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/room_basic/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/situations/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/terrain_tutor/
skylib_fluffos_v3/mudlib/d/learning/text/
skylib_fluffos_v3/mudlib/d/liaison/
skylib_fluffos_v3/mudlib/d/mudlib/
skylib_fluffos_v3/mudlib/d/mudlib/changes/
skylib_fluffos_v3/mudlib/d/playtesters/
skylib_fluffos_v3/mudlib/d/playtesters/effects/
skylib_fluffos_v3/mudlib/d/playtesters/handlers/
skylib_fluffos_v3/mudlib/d/playtesters/items/
skylib_fluffos_v3/mudlib/d/sage/
skylib_fluffos_v3/mudlib/doc/
skylib_fluffos_v3/mudlib/doc/creator/
skylib_fluffos_v3/mudlib/doc/driver/
skylib_fluffos_v3/mudlib/doc/driver/efuns/arrays/
skylib_fluffos_v3/mudlib/doc/driver/efuns/buffers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/calls/
skylib_fluffos_v3/mudlib/doc/driver/efuns/compile/
skylib_fluffos_v3/mudlib/doc/driver/efuns/filesystem/
skylib_fluffos_v3/mudlib/doc/driver/efuns/floats/
skylib_fluffos_v3/mudlib/doc/driver/efuns/functions/
skylib_fluffos_v3/mudlib/doc/driver/efuns/general/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mappings/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mixed/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mudlib/
skylib_fluffos_v3/mudlib/doc/driver/efuns/numbers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/parsing/
skylib_fluffos_v3/mudlib/doc/login/
skylib_fluffos_v3/mudlib/doc/lpc/basic_manual/
skylib_fluffos_v3/mudlib/doc/lpc/intermediate/
skylib_fluffos_v3/mudlib/doc/new/add_command/
skylib_fluffos_v3/mudlib/doc/new/events/
skylib_fluffos_v3/mudlib/doc/new/handlers/
skylib_fluffos_v3/mudlib/doc/new/living/race/
skylib_fluffos_v3/mudlib/doc/new/living/spells/
skylib_fluffos_v3/mudlib/doc/new/object/
skylib_fluffos_v3/mudlib/doc/new/player/
skylib_fluffos_v3/mudlib/doc/new/room/guild/
skylib_fluffos_v3/mudlib/doc/new/room/outside/
skylib_fluffos_v3/mudlib/doc/new/room/storeroom/
skylib_fluffos_v3/mudlib/doc/object/
skylib_fluffos_v3/mudlib/doc/playtesters/
skylib_fluffos_v3/mudlib/doc/policy/
skylib_fluffos_v3/mudlib/doc/weapons/
skylib_fluffos_v3/mudlib/global/
skylib_fluffos_v3/mudlib/global/creator/
skylib_fluffos_v3/mudlib/handlers/
skylib_fluffos_v3/mudlib/include/casino/
skylib_fluffos_v3/mudlib/include/cmds/
skylib_fluffos_v3/mudlib/include/effects/
skylib_fluffos_v3/mudlib/include/npc/
skylib_fluffos_v3/mudlib/include/room/
skylib_fluffos_v3/mudlib/include/shops/
skylib_fluffos_v3/mudlib/net/daemon/
skylib_fluffos_v3/mudlib/net/daemon/chars/
skylib_fluffos_v3/mudlib/net/inherit/
skylib_fluffos_v3/mudlib/net/obj/
skylib_fluffos_v3/mudlib/net/obj/BACKUPS/
skylib_fluffos_v3/mudlib/obj/amulets/
skylib_fluffos_v3/mudlib/obj/armours/plate/
skylib_fluffos_v3/mudlib/obj/b_day/
skylib_fluffos_v3/mudlib/obj/clothes/transport/horse/
skylib_fluffos_v3/mudlib/obj/faith/symbols/
skylib_fluffos_v3/mudlib/obj/fungi/
skylib_fluffos_v3/mudlib/obj/gatherables/
skylib_fluffos_v3/mudlib/obj/instruments/
skylib_fluffos_v3/mudlib/obj/media/
skylib_fluffos_v3/mudlib/obj/misc/player_shop/
skylib_fluffos_v3/mudlib/obj/monster/godmother/
skylib_fluffos_v3/mudlib/obj/monster/transport/
skylib_fluffos_v3/mudlib/obj/rings/
skylib_fluffos_v3/mudlib/obj/scabbards/
skylib_fluffos_v3/mudlib/obj/spells/
skylib_fluffos_v3/mudlib/obj/stationery/
skylib_fluffos_v3/mudlib/obj/stationery/envelopes/
skylib_fluffos_v3/mudlib/obj/toys/
skylib_fluffos_v3/mudlib/obj/vessels/
skylib_fluffos_v3/mudlib/obj/weapons/axes/
skylib_fluffos_v3/mudlib/obj/weapons/chains/
skylib_fluffos_v3/mudlib/obj/weapons/maces/BACKUPS/
skylib_fluffos_v3/mudlib/save/autodoc/
skylib_fluffos_v3/mudlib/save/book_handler/
skylib_fluffos_v3/mudlib/save/books/history/calarien/
skylib_fluffos_v3/mudlib/save/mail/
skylib_fluffos_v3/mudlib/save/new_soul/data/
skylib_fluffos_v3/mudlib/save/parcels/
skylib_fluffos_v3/mudlib/save/playerinfo/
skylib_fluffos_v3/mudlib/save/players/d/
skylib_fluffos_v3/mudlib/save/players/s/
skylib_fluffos_v3/mudlib/save/random_names/
skylib_fluffos_v3/mudlib/save/random_names/data/
skylib_fluffos_v3/mudlib/save/terrains/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_desert/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_grassy_field/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_mountain/
skylib_fluffos_v3/mudlib/save/todo_lists/
skylib_fluffos_v3/mudlib/secure/
skylib_fluffos_v3/mudlib/secure/cmds/admin/
skylib_fluffos_v3/mudlib/secure/cmds/lord/
skylib_fluffos_v3/mudlib/secure/config/
skylib_fluffos_v3/mudlib/secure/handlers/autodoc/
skylib_fluffos_v3/mudlib/secure/handlers/intermud/
skylib_fluffos_v3/mudlib/secure/include/global/
skylib_fluffos_v3/mudlib/secure/save/
skylib_fluffos_v3/mudlib/secure/save/handlers/
skylib_fluffos_v3/mudlib/secure/std/
skylib_fluffos_v3/mudlib/secure/std/classes/
skylib_fluffos_v3/mudlib/secure/std/modules/
skylib_fluffos_v3/mudlib/std/creator/
skylib_fluffos_v3/mudlib/std/dom/
skylib_fluffos_v3/mudlib/std/effects/
skylib_fluffos_v3/mudlib/std/effects/external/
skylib_fluffos_v3/mudlib/std/effects/fighting/
skylib_fluffos_v3/mudlib/std/effects/magic/
skylib_fluffos_v3/mudlib/std/effects/magic/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/other/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/priest/
skylib_fluffos_v3/mudlib/std/effects/room/
skylib_fluffos_v3/mudlib/std/environ/
skylib_fluffos_v3/mudlib/std/guilds/
skylib_fluffos_v3/mudlib/std/guilds/old/
skylib_fluffos_v3/mudlib/std/languages/
skylib_fluffos_v3/mudlib/std/liquids/
skylib_fluffos_v3/mudlib/std/npc/
skylib_fluffos_v3/mudlib/std/npc/goals/
skylib_fluffos_v3/mudlib/std/npc/goals/basic/
skylib_fluffos_v3/mudlib/std/npc/goals/misc/
skylib_fluffos_v3/mudlib/std/npc/plans/
skylib_fluffos_v3/mudlib/std/npc/plans/basic/
skylib_fluffos_v3/mudlib/std/npc/types/
skylib_fluffos_v3/mudlib/std/npc/types/helper/
skylib_fluffos_v3/mudlib/std/npcs/
skylib_fluffos_v3/mudlib/std/outsides/
skylib_fluffos_v3/mudlib/std/races/shadows/
skylib_fluffos_v3/mudlib/std/room/basic/BACKUPS/
skylib_fluffos_v3/mudlib/std/room/basic/topography/
skylib_fluffos_v3/mudlib/std/room/controller/
skylib_fluffos_v3/mudlib/std/room/inherit/topography/
skylib_fluffos_v3/mudlib/std/room/topography/area/
skylib_fluffos_v3/mudlib/std/room/topography/iroom/
skylib_fluffos_v3/mudlib/std/room/topography/milestone/
skylib_fluffos_v3/mudlib/std/shadows/curses/
skylib_fluffos_v3/mudlib/std/shadows/disease/
skylib_fluffos_v3/mudlib/std/shadows/fighting/
skylib_fluffos_v3/mudlib/std/shadows/healing/
skylib_fluffos_v3/mudlib/std/shadows/magic/
skylib_fluffos_v3/mudlib/std/shadows/poison/
skylib_fluffos_v3/mudlib/std/shadows/room/
skylib_fluffos_v3/mudlib/std/shops/controllers/
skylib_fluffos_v3/mudlib/std/shops/objs/
skylib_fluffos_v3/mudlib/std/shops/player_shop/
skylib_fluffos_v3/mudlib/std/socket/
skylib_fluffos_v3/mudlib/std/soul/d/
skylib_fluffos_v3/mudlib/std/soul/e/
skylib_fluffos_v3/mudlib/std/soul/i/
skylib_fluffos_v3/mudlib/std/soul/j/
skylib_fluffos_v3/mudlib/std/soul/k/
skylib_fluffos_v3/mudlib/std/soul/l/
skylib_fluffos_v3/mudlib/std/soul/n/
skylib_fluffos_v3/mudlib/std/soul/o/
skylib_fluffos_v3/mudlib/std/soul/q/
skylib_fluffos_v3/mudlib/std/soul/r/
skylib_fluffos_v3/mudlib/std/soul/u/
skylib_fluffos_v3/mudlib/std/soul/v/
skylib_fluffos_v3/mudlib/std/soul/y/
skylib_fluffos_v3/mudlib/std/soul/z/
skylib_fluffos_v3/mudlib/std/stationery/
skylib_fluffos_v3/mudlib/w/
skylib_fluffos_v3/mudlib/w/default/
skylib_fluffos_v3/mudlib/w/default/armour/
skylib_fluffos_v3/mudlib/w/default/clothes/
skylib_fluffos_v3/mudlib/w/default/item/
skylib_fluffos_v3/mudlib/w/default/npc/
skylib_fluffos_v3/mudlib/w/default/room/
skylib_fluffos_v3/mudlib/w/default/weapon/
skylib_fluffos_v3/mudlib/www/
skylib_fluffos_v3/mudlib/www/java/
skylib_fluffos_v3/mudlib/www/secure/
skylib_fluffos_v3/mudlib/www/secure/lpc/advanced/
skylib_fluffos_v3/mudlib/www/secure/lpc/intermediate/
skylib_fluffos_v3/win32/
/**
 * Inheritable for moving room - as ferry, stagecoach etc
 * @author Loriel
 */
/*
 * Uses mapping "destinations" for stops:
 * name = "from" (just a short name to track where we are)
 * destination[name]->to = next stop after 'name'
 * destination[name]->room = full path of room where "ferry" stops
 * destination[name]->room_exit = exit name from room to ferry
 * destination[name]->ferry_exit = exit name from ferry to room
 * destination[name]->transit_time = time travelling from this stop to next
 * destination[name]->wait_time = time waiting at this stop
 * destination[name]->room_leave_msg = message to room as ferry leaves
 * destination[name]->room_arrive_msg = message to room as ferry arrives
 * destination[name]->arrive_fn = fn to call in ferry as it arrives (room as arg)
 * destination[name]->leave_fn = fn to call in ferry as it leaves (room as arg)
 * destination[name]->room_arrive_fn = fn to call in room as ferry arrives
 * destination[name]->room_leave_fn = fn to call in room as ferry leaves
 * destination[name]->ferry_leave_msg = message to ferry as it leaves
 * destination[name]->ferry_arrive_msg = message to ferry as it arrives
 * start_location defines which 'from' the ferry starts from.
 * @changed Added set_carriage_object, query_carriage_object and the
 * @changed loading/unloading of carriage_object - Sandoz 19 April 2001
 * @changed Added exit/enter messages - Sandoz 20 April 2001
 * @changed Added set_movement_messages to set the messages from
 * @changed the actual carriage file - Sandoz 22 April 2001
 * ferry_exit_mess - message to the carriage when player leaves the carriage
 * ferry_move_mess - movement message to the player leaving the carriage
 * ferry_enter_mess - message to the destination room when player exits carriage
 * room_exit_mess - message to the room when player enters the carriage
 * room_move_mess - movement message to the player entering the carriage
 * room_enter_mess - message to the destination room (carriage) when player enters
 * location_prep - the preposition to use in the warning messages
 * @changed Changed to reuse the carriage object in different stops
 * - Sandoz, 31-Aug-2002.
 */

inherit ROOM_OBJ;

object carriage;

private mapping destinations = ([ ]);
private string start_location;

private int movement_warning_flag;
private int movement_warning_time;
private string arrival_warning;
private string departure_warning;
private string carriage_object;

void arrive( string where );
void depart( string where );
void depart_warning( string where );
void set_movement_warning( int arg );
void set_movement_warning_time( int warn_time );
void set_carriage_object( string path );
int query_movement_warning_time( int wait_time );
int query_movement_warning();
string query_carriage_object();

class destination {
    string to;
    string room;
    string room_exit;
    string ferry_exit;
    int transit_time;
    int wait_time;
    string room_arrive_msg;
    string room_leave_msg;
    string ferry_arrive_msg;
    string ferry_leave_msg;
    string arrive_fn;
    string leave_fn;
    string room_arrive_fn;
    string room_leave_fn;
}

class movemess {
    string ferry_exit_mess;
    string ferry_move_mess;
    string ferry_enter_mess;
    string room_exit_mess;
    string room_move_mess;
    string room_enter_mess;
    string location_prep;
}

#define DESTFN(name) ((class destination)destinations[name])

void create() {
    ::create();

    // Default warnings for Departure and Arrival to on.
    set_movement_warning(1);
    set_movement_warning_time(10);

} /* create() */

/**
 * Set the carriage object to load in the room the carriage is stopped in.
 * @param path The path of the object.
 * @example void set_carriage_object(string path)
 * @changed Created 19-04-2001 Sandoz
 */
void set_carriage_object( string path ) {
    carriage_object = path;
} /* set_carriage_object() */

/**
 * Return the path of the carriage object to load.
 * @return The object the carriage represents itself with.
 */
string query_carriage_object() { return carriage_object; }

/**
 * Set where the ferry/room starts when loaded.
 * @param loc The location to start at.
 * @example void set_start_location(string loc)
 */
void set_start_location(string loc) { start_location = loc; }

/**
 * Adds a destination (or stop) for the ferry.
 * @param name The destination to add.
 * @example void add_destination(string name)
 */
void add_destination( string name ) {
    class destination dest = new ( class destination );
    destinations[name] = dest;
} /* add_destination() */

/**
 * @ignore yes
 */
void destination_check(string name) {
    if( destinations[name] )
        return;
    error("Non-existent destination - " + name + "!\n");
} /* destination_check() */

/**
 * Sets full details of a destination/stop for ferry.
 * @param name The name of the original stop.
 * @param to Next stop after 'name'.
 * @param room Full path of the room where "ferry" stops.
 * @param room_exit Exit name from room to ferry.
 * @param ferry_exit Exit name from ferry to room.
 * @param transit_time Time travelling from this stop to next.
 * @param wait_time Time waiting at this stop.
 * @param ferry_arrive_msg Message to ferry as it arrives.
 * @param ferry_leave_msg Message to ferry as it leaves.
 * @param room_arrive_msg Message to room as ferry arrives.
 * @param room_leave_msg Message to room as ferry leaves.
 * @param arrive_fn Function to call in ferry as it arrives (room as arg).
 * @param leave_fn Function to call in ferry as it leaves (room as arg).
 * @param room_arrive_fn Function to call in room as ferry arrives.
 * @param room_leave_fn Function to call in room as ferry leaves.
 */
void set_full_details( string name, string to, string room,
                       string room_exit, string ferry_exit,
                       int transit_time, int wait_time,
                       string ferry_arrive_msg, string ferry_leave_msg,
                       string room_arrive_msg, string room_leave_msg,
                       string arrive_fn, string leave_fn,
                       string room_arrive_fn, string room_leave_fn ) {

    destination_check(name);

    DESTFN(name)->to = to;
    DESTFN(name)->room = room;
    DESTFN(name)->room_exit = room_exit;
    DESTFN(name)->ferry_exit = ferry_exit;
    DESTFN(name)->transit_time = transit_time;
    DESTFN(name)->wait_time = wait_time;
    DESTFN(name)->ferry_arrive_msg = ferry_arrive_msg;
    DESTFN(name)->ferry_leave_msg = ferry_leave_msg;
    DESTFN(name)->room_arrive_msg = room_arrive_msg;
    DESTFN(name)->room_leave_msg = room_leave_msg;
    DESTFN(name)->arrive_fn = arrive_fn;
    DESTFN(name)->leave_fn = leave_fn;
    DESTFN(name)->room_arrive_fn = room_arrive_fn;
    DESTFN(name)->room_leave_fn = room_leave_fn;

} /* set_full_destination() */

class movemess return_mess = new(class movemess);

/**
 * Sets the movement messages for the exits to and from the ferry.
 * @param ferry_exit_mess message to the carriage when player leaves the ferry
 * @param ferry_move_mess movement message to the player leaving the ferry
 * @param ferry_enter_mess message to the destination room when player exits ferry
 * @param room_exit_mess message to the room when player enters the ferry
 * @param room_move_mess movement message to the player entering the ferry
 * @param room_enter_mess message to the destination room (ferry) when player enters
 * @param location_prep the preposition to use in the warning messages
 * @changed Added by Sandoz 22 April 2001
 */
void set_movement_messages( string ferry_exit_mess, string ferry_move_mess,
                            string ferry_enter_mess, string room_exit_mess,
                            string room_move_mess, string room_enter_mess,
                            string location_prep ) {

    return_mess->ferry_exit_mess = ferry_exit_mess;
    return_mess->ferry_move_mess = ferry_move_mess;
    return_mess->ferry_enter_mess = ferry_enter_mess;
    return_mess->room_exit_mess = room_exit_mess;
    return_mess->room_move_mess = room_move_mess;
    return_mess->room_enter_mess = room_enter_mess;
    return_mess->location_prep = location_prep;

} /* set_movement_messages */

/**
 * Sets subsequent stop.
 * @example void set_to(string name, string to)
 */
void set_to(string name, string to) {
    destination_check(name);
    DESTFN(name)->to = to;
} /* set_to() */

/**
 * Sets room where ferry stops.
 * @example void set_room(string name, string to)
 */
void set_room(string name, string room) {
    destination_check(name);
    DESTFN(name)->room = room;
} /* set_dest_room() */

/**
 * Sets exit shown in room when ferry stops.
 * @example void set_room_exit(string name, string room_exit)
 */
void set_room_exit(string name, string room_exit) {
    destination_check(name);
    DESTFN(name)->room_exit = room_exit;
} /* set_room_exit() */

/**
 * Sets exit shown in ferry when ferry stops.
 * @example void set_ferry_exit(string name, string ferry_exit)
 */
void set_ferry_exit(string name, string ferry_exit) {
    destination_check(name);
    DESTFN(name)->ferry_exit = ferry_exit;
} /* set_ferry_exit() */

/**
 * Sets time taken by ferry to next stop.
 * @example void set_transit_time(string name, int transit_time)
 */
void set_transit_time( string name, int transit_time ) {
    destination_check(name);
    DESTFN(name)->transit_time = transit_time;
} /* set_transit_time() */

/**
 * Sets time ferry waits at this stop.
 * @example void set_wait_time(string name, int wait_time)
 */
void set_wait_time( string name, int wait_time ) {
    destination_check(name);
    DESTFN(name)->wait_time = wait_time;
} /* set_wait_time() */

/**
 * Sets message shown in room when ferry arrives.
 * @example void set_room_arrive_msg(string name, string msg)
 */
void set_room_arrive_msg( string name, string msg ) {
    destination_check(name);
    DESTFN(name)->room_arrive_msg = msg;
} /* set_room_arrive_msg() */

/**
 * Sets message shown in room when ferry leaves.
 * @example void set_room_leave_msg(string name, string msg)
 */
void set_room_leave_msg( string name, string msg ) {
    destination_check(name);
    DESTFN(name)->room_leave_msg = msg;
} /* set_room_leave_msg() */

/**
 * Sets message shown in ferry when it arrives.
 * @example void set_ferry_arrive_msg(string name, string msg)
 */
void set_ferry_arrive_msg( string name, string msg ) {
    destination_check(name);
    DESTFN(name)->ferry_arrive_msg = msg;
} /* set_ferry_arrive_msg() */

/**
 * Sets message shown in ferry when it leaves.
 * @example void set_ferry_leave_msg(string name, string msg)
 */
void set_ferry_leave_msg( string name, string msg ) {
    destination_check(name);
    DESTFN(name)->ferry_leave_msg = msg;
} /* set_ferry_leave_msg() */

/**
 * Sets function called when it arrives.
 * @example void set_arrive_fn(string name, string fn)
 */
void set_arrive_fn( string name, string fn ) {
    destination_check(name);
    DESTFN(name)->arrive_fn = fn;
} /* set_arrive_fn() */

/**
 * Sets function called when it leaves.
 * @example void set_leave_fn(string name, string fn)
 */
void set_leave_fn( string name, string fn ) {
    destination_check(name);
    DESTFN(name)->leave_fn = fn;
} /* set_leave_fn() */

/**
 * Sets function called in room when it arrives.
 * @example void set_room_arrive_fn(string name, string fn)
 */
void set_room_arrive_fn( string name, string fn ) {
    destination_check(name);
    DESTFN(name)->room_arrive_fn = fn;
} /* set_room_arrive_fn() */

/**
 * Sets function called in room when it leaves.
 * @example void set_room_leave_fn(string name, string fn)
 */
void set_room_leave_fn( string name, string fn ) {
    destination_check(name);
    DESTFN(name)->room_leave_fn = fn;
} /* set_room_leave_fn() */

/**
 * Remove call_outs which move the ferry.
 * @example void stop_ferry()
 */
void stop_ferry() {
    remove_call_out("arrive_warning");
    remove_call_out("arrive");
    remove_call_out("depart_warning");
    remove_call_out("depart");
} /* stop_ferry() */

/** @ignore yes */
int wimpy_check( string verb, object thing, string special ) {
    if( member_array("run_away", call_stack(2) ) != -1 )
        return 0;
    return 1;
} /* wimpy_check() */

/** @ignore yes */
void depart( string from ) {
    string def_msg;
    object ob;

    ob = load_object( DESTFN(from)->room );
    ob->remove_exit( DESTFN(from)->room_exit );
    TO->remove_exit( DESTFN(from)->ferry_exit );

    if( carriage && carriage->move(CARRIAGE_OBJ) )
        carriage->dest_me();

    if( query_movement_warning() )
        call_out("arrive_warning",
            query_movement_warning_time(DESTFN(from)->transit_time), from );

    call_out("arrive", DESTFN(from)->transit_time, DESTFN(from)->to );

    def_msg = TO->short()+" has departed for "+DESTFN(from)->to+".";

    tell_room( TO, ( DESTFN(from)->ferry_leave_msg || def_msg )+"\n");
    tell_room( ob, ( DESTFN(from)->room_leave_msg || def_msg )+"\n");

    if( stringp( DESTFN(from)->leave_fn ) &&
        strlen( DESTFN(from)->leave_fn ) )
        call_other( TO, DESTFN(from)->leave_fn, ob );

    if( stringp( DESTFN(from)->room_leave_fn ) &&
        strlen( DESTFN(from)->room_leave_fn ) )
        call_other( ob, DESTFN(from)->room_leave_fn );

} /* depart() */

/** @ignore yes */
void arrive( string at ) {
    string def_msg;
    object ob;

    ob = load_object( DESTFN(at)->room );

    ob->add_exit( DESTFN(at)->room_exit, base_name(TO), "path");

    ob->modify_exit( DESTFN(at)->room_exit, ({"enter mess",
        return_mess->room_enter_mess }) );
    ob->modify_exit( DESTFN(at)->room_exit, ({"exit mess",
        return_mess->room_exit_mess }) );
    ob->modify_exit( DESTFN(at)->room_exit, ({"move mess",
        return_mess->room_move_mess }) );

    ob->modify_exit( DESTFN(at)->room_exit, ({"function",
        (: wimpy_check :) }) );

    TO->add_exit( DESTFN(at)->ferry_exit, DESTFN(at)->room, "path");

    TO->modify_exit( DESTFN(at)->ferry_exit, ({"enter mess",
        return_mess->ferry_enter_mess }) );
    TO->modify_exit( DESTFN(at)->ferry_exit, ({"exit mess",
        return_mess->ferry_exit_mess }) );
    TO->modify_exit( DESTFN(at)->ferry_exit, ({"move mess",
        return_mess->ferry_move_mess }) );

    if( carriage_object ) {
        if( !carriage )
            carriage = clone_object(carriage_object);
        carriage->move(ob);
    }

    if( query_movement_warning() )
        call_out("depart_warning",
            query_movement_warning_time( DESTFN(at)->wait_time ), at );

    call_out("depart", DESTFN(at)->wait_time, at );

    def_msg = TO->short()+" has arrived at "+at+".";

    tell_room( TO, ( DESTFN(at)->ferry_arrive_msg || def_msg )+"\n");
    tell_room( ob, ( DESTFN(at)->room_arrive_msg || def_msg )+"\n");

    if( stringp( DESTFN(at)->arrive_fn ) &&
        strlen( DESTFN(at)->arrive_fn ) )
        call_other( TO, DESTFN(at)->arrive_fn, ob );

    if( stringp( DESTFN(at)->room_arrive_fn ) &&
        strlen( DESTFN(at)->room_arrive_fn ) )
        call_other( ob, DESTFN(at)->room_arrive_fn );

} /* arrive() */

/**
 * Control the warning to the arrival/departure room about imminent
 * departures and arrivals.
 * @example void set_movement_warning( int arg )
 * @changed Created 22-02-2001 Rattmanii
 */
void set_movement_warning( int arg ) {
    if( arg )
        movement_warning_flag = 1;
} /* set_movement_warning() */

/**
 * Returns flag to say whether announce to arrival/departure room about
 * imminent departures and arrivals.
 * @return returns wether or not to announce about imminent
 * departures/arrivals
 * @changed Created 22-02-2001 Rattmanii
 */
int query_movement_warning() { return movement_warning_flag; }

/**
 * Control the time that the warning appears to the arrival/departure room.
 * @example void set_movement_warning_time( int warn_time )
 * @changed Created 22-02-2001 Rattmanii
 */
void set_movement_warning_time( int warn_time ) {
    movement_warning_time = warn_time;
} /* set_movement_warning_time() */

/**
 * Get the time that the warning is to appear to the arrival/departure
 * room in a safe format (ie, non negative).
 * @return Returns the warning time
 * @changed Created 22-02-2001 Rattmanii
 */
int query_movement_warning_time( int wait_time ) {
    int warn_time;

    if( ( warn_time = wait_time - movement_warning_time ) < 0 )
        warn_time = 0;

    return warn_time;

} /* set_movement_warning_time() */

/**
 * Send a warning to the departure room that the vehicle is about to depart.
 * @example void depart_warning( string at )
 * @changed Created 22-02-2001 Rattmanii
 * @changed Modified to use the_short() instead of short()
 * - Sandoz 19 April 2001
 * @changed Added a warning to be sent into the vehicle itself
 * - Sandoz 20 April 2001
 */
void depart_warning( string at ) {
    tell_room( load_object( DESTFN(at)->room ), TO->the_short()+" is ready "
        "to depart for "+DESTFN(at)->to+".  All aboard!\n");
    tell_room( TO, TO->the_short()+" is ready to depart for "+
        DESTFN(at)->to+".  This is your last chance to get off "+
        return_mess->location_prep+" "+at+"!\n");
} /* depart_warning() */

/**
 * Send a warning to the destination room that the vehicle is about to arrive.
 * @example void arrive_warning( string from )
 * @changed Created 22-02-2001 Rattmanii
 * @changed Changed to use a_short() instead of short()
 * - Sandoz 19 April 2001
 */
void arrive_warning( string from ) {
    tell_room( load_object( DESTFN(DESTFN(from)->to)->room ),
        TO->a_short()+" is approaching from "+from+".\n");
} /* arrive_warning() */

void dest_me() {
    if( carriage )
        carriage->dest_me();
    ::dest_me();
} /* dest_me() */

/** @ignore yes */
mixed stats() {
    mixed ret;

    ret = ({ });

    if( carriage ) {
        ret += ({ ({"carriage ob" , file_name(carriage) }) });
        if( ENV(carriage) )
            ret += ({ ({"carriage env", file_name(ENV(carriage)) }) });
    }

    return ::stats() + ret;

} /* stats() */