merentha_fluffos_v2/
merentha_fluffos_v2/bin/
merentha_fluffos_v2/fluffos-2.9-ds2.03/
merentha_fluffos_v2/fluffos-2.9-ds2.03/ChangeLog.old/
merentha_fluffos_v2/fluffos-2.9-ds2.03/Win32/
merentha_fluffos_v2/fluffos-2.9-ds2.03/compat/
merentha_fluffos_v2/fluffos-2.9-ds2.03/compat/simuls/
merentha_fluffos_v2/fluffos-2.9-ds2.03/include/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/clone/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/command/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/data/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/etc/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/include/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/inherit/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/inherit/master/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/log/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/single/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/single/tests/compiler/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/single/tests/efuns/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/single/tests/operators/
merentha_fluffos_v2/fluffos-2.9-ds2.03/testsuite/u/
merentha_fluffos_v2/fluffos-2.9-ds2.03/tmp/
merentha_fluffos_v2/fluffos-2.9-ds2.03/windows/
merentha_fluffos_v2/lib/cfg/
merentha_fluffos_v2/lib/cfg/races/
merentha_fluffos_v2/lib/cmds/abilities/
merentha_fluffos_v2/lib/cmds/actions/
merentha_fluffos_v2/lib/cmds/spells/
merentha_fluffos_v2/lib/daemon/include/
merentha_fluffos_v2/lib/daemon/services/
merentha_fluffos_v2/lib/doc/
merentha_fluffos_v2/lib/doc/building/
merentha_fluffos_v2/lib/doc/help/classes/
merentha_fluffos_v2/lib/doc/help/general/
merentha_fluffos_v2/lib/doc/help/races/
merentha_fluffos_v2/lib/doc/help/skills/
merentha_fluffos_v2/lib/doc/help/stats/
merentha_fluffos_v2/lib/doc/man/efuns/
merentha_fluffos_v2/lib/doc/man/lfuns/
merentha_fluffos_v2/lib/doc/news/
merentha_fluffos_v2/lib/doc/old/
merentha_fluffos_v2/lib/doc/old/concepts/
merentha_fluffos_v2/lib/doc/old/lpc/constructs/
merentha_fluffos_v2/lib/doc/old/lpc/types/
merentha_fluffos_v2/lib/domains/ROOMS/
merentha_fluffos_v2/lib/domains/obj/armour/
merentha_fluffos_v2/lib/domains/obj/monsters/
merentha_fluffos_v2/lib/domains/obj/other/
merentha_fluffos_v2/lib/domains/obj/weapons/
merentha_fluffos_v2/lib/realms/petrarch/
merentha_fluffos_v2/lib/save/daemons/
merentha_fluffos_v2/lib/save/rid/
merentha_fluffos_v2/lib/save/users/a/
merentha_fluffos_v2/lib/save/users/p/
merentha_fluffos_v2/lib/save/users/t/
merentha_fluffos_v2/lib/std/login/
merentha_fluffos_v2/lib/std/obj/
merentha_fluffos_v2/win32/
// Petrarch
// Merentha Lib 1.0
// object.c

#include <std.h>
#include "object.h"

inherit CLEANUP;

int __Mass, __Value;
string *__Id=({});
string __Name, __CapName, __Short, __Long;
string __PreventGet;
static mapping __Properties=([]);

void create() {
    ::create();
    __Mass=0;
    __Value=0;
    reset();
}

void init() {
    ::init();
}

void reset() {
    ::reset();
}

void post_move() { }

void set_mass(int i) { __Mass=i; }
int query_mass() { return __Mass; }
int query_total_mass() { return __Mass+this_object()->query_holding_mass(); }

void set_value(int i) { __Value=i; }
int query_value() { return __Value; }

void set_prevent_get(string str) { __PreventGet=str; }
string moveable() { return __PreventGet;}

int move(mixed dest) {
    int move_ok=0;
    object env;
    string tmp;
    if(env=environment()) {
        if(tmp=environment()->release_object(this_object()) || tmp=moveable()) {
            if(this_player())
                message("move", tmp, this_player());
            return 1;
        }
    } 
    if(tmp=dest->receive_object(this_object())) { 
        if(this_player())
            message("move", tmp, this_player());
        return 1;
    }
    dest->add_mass(__Mass);
    move_object(dest);
    post_move();
    return 0;
}

void set_name(string str) {  __Name=str; }
string query_name() { return __Name; }

void set_cap_name(string str) { __CapName=str; }

varargs string query_cap_name(mixed arg){
return (__CapName?__CapName:capitalize(__Name));
}

void set_short(string str) { __Short=str; }
string query_short() { return __Short; }

void set_long(string str) { __Long=str; }
string query_long() { return __Long; }

void set_id(string *arg) { __Id=arg; }
string *query_id() { return __Id; }
int id(string arg) {
    if (!arg || !__Id) return 0;
    return (member_array(arg, __Id) != -1);
}

void set_properties(mapping props) {  __Properties=props; }
void set_property(string prop, mixed val) { __Properties[prop]=val; }
void add_property(string prop, mixed val) { set_property(prop, val); }
void remove_property(string prop) { map_delete(__Properties, prop); }
mapping query_properties() { return __Properties; }
mixed query_property(string prop) { return __Properties[prop]; }