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/
/**
 * This class contains information relating to the value and the weight
 * of the object.
 * @author Pinkfish
 */

#include <money.h>
#include <move_failures.h>

#define WATCH_DEFINE "fluff'n'stuff"
#define PRICE_INDEX "/handlers/cpi_handler"

inherit "/std/basic/light";
inherit "/std/basic/move";

nosave int weight;
nosave int value;
nosave mapping value_info;

void check_log_status( object *parray );

void create() {
    weight = 1;
    light::create();
    call_out( "check_log_status", 1, previous_object(-1) );
    value_info = ([ ]);
} /* create() */

/**
 * This method adjusts the weight by the given amount.
 * @param w the amount to change the weight by
 * @see set_weight()
 * @see query_weight()
 */
void adjust_weight(int w) {
    if( environment() )
        environment()->add_weight(w);
    weight += w;
} /* adjust_weight() */

/**
 * This method sets the weight of the object.  One weight unit
 * is 50 grams.
 * <p>
 * When setting the weights of weapons use the following guide:
 * <p>
 * o===================o=====================o================o<br>
 * | Weapon            | Approx. Weight (kg) |  Weight Units  |<br>
 * o===================o=====================o================o<br>
 * | Dagger            |        0.5          |       10       |<br>
 * | War Hammer        |        1.1          |       22       |<br>
 * | Mace              |        1.3          |       26       |<br>
 * | Flail             |        1.5          |       30       |<br>
 * | Pole Axe          |        2.3          |       46       |<br>
 * | Short Sword       |        0.8          |       16       |<br>
 * | Broad Sword       |        1.1          |       22       |<br>
 * | Long Sword        |        1.4          |       28       |<br>
 * | Bastard Sword     |        1.9          |       38       |<br>
 * | Two-handed Sword  |        2.7          |       42       |<br>
 * o===================o=====================o================o<br>
 * @param w the amount to change the weight by
 * @see adjust_weight()
 * @see query_weight()
 */
void set_weight(int w) {
    if( environment() )
        environment()->add_weight( w - weight );
    weight = w;
} /* set_weight() */

/**
 * This method returns the current weight of the object.
 * @return the current weight of the object
 * @see set_weight()
 * @see adjust_weight()
 */
int query_weight() { return weight; }
/**
 * This method returns the current weight of the object. It does basicly
 * the same thing as the previous call.  NB: TO->query_weight()
 * is pretty much the same as query_weight(), except it takes shadows into
 * account.
 * @return the current weight of the object
 * @see set_weight()
 * @see adjust_weight()
 * @see query_weight()
 */
int query_complete_weight() { return (int)TO->query_weight(); }

/**
 * This method changes the value of the object by a certain number of
 * coins.  The coins can be any type.
 * @see /handlers/money_handler->query_total_value()
 * @see adjust_value()
 * @see query_money_array()
 * @see set_value()
 * @return the new value
 */
varargs int adjust_money(mixed amt, string coin) {
    if( pointerp(amt) ) {
        value += (int)MONEY_HAND->query_total_value(amt);
        if( value < 0 )
            value = 0;
        return value;
    }
    amt = (int)MONEY_HAND->query_total_value( ({ coin, amt }) );
    value += amt;
    if( value < 0 )
        value = 0;
    return value;
} /* adjust_money() */

/**
 * This method changes the current value of the object.
 * @param i the amount to change the value by
 * @return the new value of the object
 */
int adjust_value(int i) {
    value += i;
    return value;
} /* adjust_value() */

/**
 * This method returns the value of the object as a money array.  The
 * money array is a list oif coinages followed by a number of coins.
 * Eg: <code>({ "copper", 10, "silver", 12 }).</code>
 * @see /handlers/money_handlers->create_money_array()
 * @see set_value()
 * @see adjust_value()
 * @see adjust_money()
 * @see query_value()
 */
mixed query_money_array() {
    return (mixed)MONEY_HAND->create_money_array(value);
} /* query_money_array() */

/**
 * This method returns the number of coins of a certain
 * type that are in the value of the object.  This is not
 * a good estimate of value or anything, no idea why it is
 * here really.  I am sure I had a good reason
 * at the time :)
 * @param type the type of coin to look for
 * @return the number of coins of that type
 * @see /handlers/money_handlers->create_money_array()
 * @see set_value()
 * @see adjust_value()
 * @see adjust money()
 * @see query_money_array()
 * @see query_value()
 */
int query_money( string type ) {
    int i;
    mixed m_a;

    m_a = (mixed *)MONEY_HAND->create_money_array(value);
    if( ( i = member_array( type, m_a ) ) == -1 )
        return 0;
    return m_a[i+1];
} /* query_money() */

/**
 * This method sets the value of the object.  The actual value in
 * coins and so forth is worked out by the money handler based on the
 * value.
 * @param number the new value of the object
 * @see query_value()
 * @see adjust_value()
 * @see query_money_array()
 */
void set_value( int number ) { value = number; }

/**
 * This method sets the value information for a type of
 * special object.  This is the extra value information associated
 * with the "artifact", "enchantment" or "material" of the object.
 * @param word the type of value information
 * @param number the amount to set it to
 * @see query_value_at()
 * @see remove_value_info()
 * @see set_value()
 */
void set_value_info( string word, int number ) {
    value_info[ word ] = number;
} /* set_value_info */

/**
 * This method removes the value information for a type of
 * special object.  This is the extra value information associated
 * with the "artifact", "enchantment" or "material" of the object.
 * @param word the type of value information to remove
 * @see query_value_at()
 * @see set_value_info()
 * @see set_value()
 */
void remove_value_info( string word ) {
    map_delete( value_info, word );
} /* remove_value_info() */

/**
 * This method returns the current value of the object.
 * @return the current value of the object
 */
int query_value() { return value; }

/**
 * This method returns the vase value of the object.  This is before
 * any scaling from things like condition occurs.
 * @return the base value
 */
int query_base_value() {
   return value;
} /* query_base_value() */

/**
 * This method returns the information associated for all the special
 * bits of the object.  The value infor maping ihas keys which are
 * the type of value info and the value is the value of it.
 * @return the value info mapping
 * @see set_value_info()
 * @see query_value_at()
 * @see remove_value_info()
 */
mapping query_value_info() { return value_info; }

/**
 * This method figures out how much an object will cost in a certain
 * place.  For instance at a shop that does not handle artifcacts an
 * artifact will be bought and sold cheaply.  The current types
 * of "artifact", "enchantment" and "material" are recognised.
 * A property in the shop of the type "artifact valued" will
 * cause the values of that type to be taken into account.
 * @param place the object to find the value at
 * @return the value in the shop
 * @see query_value()
 * @see set_value_info()
 * @see adjust_value()
 */
int query_value_at( object place ) {
    int total;
    string _key;
    mixed how, _value;

    if( !value_info )
        value_info = ([ ]);

    total = (int)TO->query_value();

    foreach( _key, _value in value_info ) {
      how = (mixed)place->query_property( _key +" valued" );
      if( how ) {
          switch( _key ) {
            case "artifact" :
              total += ( _value * ( how[ 0 ] + how[ 1 ] *
                       (int)TO->query_charges() ) ) / how[ 2 ];
            break;
            case "enchantment" :
              if( TO->query_max_enchant() )
                  total += ( _value * how * (int)TO->query_enchant() ) /
                           (int)TO->query_max_enchant();
            break;
            case "material" :
              total += (int)TO->query_weight() *
                       (int)PRICE_INDEX->query_price(
                       (string)TO->query_material(), how );
            break;
            default :
              total += _value;
          }
      }
    }

    return total;

} /* query_value_at() */

/**
 * This method always returns the most expensive value of an item.
 * This should be used for things like theif quotas and anything which
 * requires the real actual value of an item.
 * @param place the place to find the values in
 */
int query_value_real(string place) {
   int total;
   string _key;
   mixed _value;

   if( !value_info )
       value_info = ([ ]);

   total = (int)TO->query_value();

   foreach( _key, _value in value_info ) {
      switch( _key ) {
        case "artifact" :
          total += ( _value * ( 3 + 1 * (int)TO->query_charges() ) ) / 1;
        break;
        case "enchantment" :
          if( TO->query_max_enchant() )
              total += ( _value * 10 * (int)TO->query_enchant() ) /
                       (int)TO->query_max_enchant();
        break;
        case "material" :
          total += (int)TO->query_weight() *
                   (int)PRICE_INDEX->query_price(
                   (string)TO->query_material(), place );
        break;
        default :
          total += _value;
      }
   }
   return total;
} /* query_value_real() */

/** @ignore yes */
varargs int move( mixed dest, string messin, string messout ) {
  int i, w;
  object from;

  if( stringp(dest) )
      dest = load_object(dest);

  if( !dest )
      return MOVE_INVALID_DEST;

  w = (int)TO->query_complete_weight();

  if( !( dest->add_weight(w) ) )
      return MOVE_TOO_HEAVY;

  from = environment();

  if( ( i = ::move( dest, messin, messout ) ) != MOVE_OK ) {
      dest->add_weight(-w);
      return i;
  }

  if( from )
      from->add_weight(-w);

  if( query_light_needs_inform() ) {
      if( from )
          inform_of_light_level_change( from );
      inform_of_light_level_change( dest );
  }

  return i;

} /* move() */

/** @ignore yes */
void dest_me() {
    if( environment() ) {
        environment()->add_weight( -(int)TO->query_complete_weight() );
        if( query_my_light() )
            adjust_light( -query_my_light() );
    }
    ::dest_me();
} /* dest_me() */

/** @ignore yes */
mixed *stats() {
    string _key;
    mixed tmp, _value;

    tmp = ({ ({ "value", value }) });

    if( !value_info )
        value_info = ([ ]);

    foreach( _key, _value in value_info )
        tmp += ({ ({ "(info) "+ _key, _value }) });

    return light::stats() + tmp;

} /* stats() */

/** @ignore yes */
void check_log_status( object *parray ) {
  if( TO->query_property( WATCH_DEFINE ) && clonep( TO ) &&
      arrayp( parray ) && member_array(
      load_object( "/secure/cmds/creator/cl_one" ), parray ) != -1 ) {
      log_file( "WATCH", "DS: %d TO: %s. TP: %s.\n", time(),
      base_name( TO ), parray[2]->query_name() );
      TO->add_property( "CT", time() );
      user_event( "inform", sprintf( "[Restricted] %s cloned %s.",
                  parray[2]->query_cap_name(),
      base_name( TO ) ), "cheat" );
  }
} /* check_log_status() */