lima-1.0b5/
lima-1.0b5/driver/
lima-1.0b5/driver/ChangeLog.old/
lima-1.0b5/driver/Win32/
lima-1.0b5/driver/compat/
lima-1.0b5/driver/include/
lima-1.0b5/driver/testsuite/
lima-1.0b5/driver/testsuite/clone/
lima-1.0b5/driver/testsuite/command/
lima-1.0b5/driver/testsuite/data/
lima-1.0b5/driver/testsuite/etc/
lima-1.0b5/driver/testsuite/include/
lima-1.0b5/driver/testsuite/inherit/
lima-1.0b5/driver/testsuite/inherit/master/
lima-1.0b5/driver/testsuite/log/
lima-1.0b5/driver/testsuite/single/
lima-1.0b5/driver/testsuite/single/tests/compiler/
lima-1.0b5/driver/testsuite/single/tests/efuns/
lima-1.0b5/driver/testsuite/single/tests/operators/
lima-1.0b5/driver/testsuite/u/
lima-1.0b5/driver/tmp/
lima-1.0b5/etc/
lima-1.0b5/lib/WWW/help/
lima-1.0b5/lib/cmds/
lima-1.0b5/lib/cmds/create/
lima-1.0b5/lib/cmds/player/attic/
lima-1.0b5/lib/contrib/bboard/
lima-1.0b5/lib/contrib/boards/
lima-1.0b5/lib/contrib/marriage/
lima-1.0b5/lib/contrib/roommaker/
lima-1.0b5/lib/contrib/transient_effect/
lima-1.0b5/lib/daemons/channel/
lima-1.0b5/lib/daemons/imud/
lima-1.0b5/lib/data/
lima-1.0b5/lib/data/config/
lima-1.0b5/lib/data/links/
lima-1.0b5/lib/data/news/
lima-1.0b5/lib/data/players/
lima-1.0b5/lib/data/secure/
lima-1.0b5/lib/domains/
lima-1.0b5/lib/domains/std/2.4.5/maze1/
lima-1.0b5/lib/domains/std/2.4.5/npc/
lima-1.0b5/lib/domains/std/2.4.5/post_dir/
lima-1.0b5/lib/domains/std/2.4.5/sub/
lima-1.0b5/lib/domains/std/camera/
lima-1.0b5/lib/domains/std/config/
lima-1.0b5/lib/domains/std/cult/
lima-1.0b5/lib/domains/std/effects/
lima-1.0b5/lib/domains/std/misc/
lima-1.0b5/lib/domains/std/monsters/
lima-1.0b5/lib/domains/std/recorder/
lima-1.0b5/lib/domains/std/rooms/
lima-1.0b5/lib/domains/std/rooms/beach/
lima-1.0b5/lib/domains/std/rooms/labyrinth/
lima-1.0b5/lib/domains/std/school/
lima-1.0b5/lib/domains/std/school/O/
lima-1.0b5/lib/domains/std/spells/
lima-1.0b5/lib/domains/std/spells/stock-mage/
lima-1.0b5/lib/domains/std/spells/stock-priest/
lima-1.0b5/lib/help/
lima-1.0b5/lib/help/admin/
lima-1.0b5/lib/help/hints/General_Questions/
lima-1.0b5/lib/help/hints/Pirate_Quest/
lima-1.0b5/lib/help/player/
lima-1.0b5/lib/help/player/bin/
lima-1.0b5/lib/help/player/quests/
lima-1.0b5/lib/help/wizard/
lima-1.0b5/lib/help/wizard/coding/guilds/
lima-1.0b5/lib/help/wizard/coding/rooms/
lima-1.0b5/lib/help/wizard/lib/daemons/
lima-1.0b5/lib/help/wizard/lib/lfun/
lima-1.0b5/lib/help/wizard/lib/std/
lima-1.0b5/lib/help/wizard/mudos_doc/
lima-1.0b5/lib/help/wizard/mudos_doc/applies/
lima-1.0b5/lib/help/wizard/mudos_doc/applies/interactive/
lima-1.0b5/lib/help/wizard/mudos_doc/applies/parsing/
lima-1.0b5/lib/help/wizard/mudos_doc/concepts/
lima-1.0b5/lib/help/wizard/mudos_doc/driver/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/arrays/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/buffers/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/compile/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/filesystem/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/floats/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/functions/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/general/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/mappings/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/mixed/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/numbers/
lima-1.0b5/lib/help/wizard/mudos_doc/efuns/parsing/
lima-1.0b5/lib/help/wizard/mudos_doc/lpc/constructs/
lima-1.0b5/lib/help/wizard/mudos_doc/lpc/types/
lima-1.0b5/lib/include/driver/
lima-1.0b5/lib/log/
lima-1.0b5/lib/obj/admtool/
lima-1.0b5/lib/obj/admtool/internal/
lima-1.0b5/lib/obj/admtool/mudinfo/
lima-1.0b5/lib/obj/admtool/secure/
lima-1.0b5/lib/obj/secure/
lima-1.0b5/lib/obj/secure/cmd/
lima-1.0b5/lib/obj/secure/mailers/
lima-1.0b5/lib/obj/secure/shell/
lima-1.0b5/lib/obj/secure/shell/classes/
lima-1.0b5/lib/obj/tasktool/
lima-1.0b5/lib/obj/tasktool/internal/
lima-1.0b5/lib/open/
lima-1.0b5/lib/secure/
lima-1.0b5/lib/secure/cgi/
lima-1.0b5/lib/secure/modules/
lima-1.0b5/lib/secure/simul_efun/
lima-1.0b5/lib/std/adversary/
lima-1.0b5/lib/std/adversary/advancement/
lima-1.0b5/lib/std/adversary/armor/
lima-1.0b5/lib/std/adversary/blows/
lima-1.0b5/lib/std/adversary/death/
lima-1.0b5/lib/std/adversary/formula/
lima-1.0b5/lib/std/adversary/health/
lima-1.0b5/lib/std/adversary/pulse/
lima-1.0b5/lib/std/adversary/wield/
lima-1.0b5/lib/std/classes/event_info/
lima-1.0b5/lib/std/container/
lima-1.0b5/lib/std/living/
lima-1.0b5/lib/std/modules/contrib/
lima-1.0b5/lib/std/patterns/
lima-1.0b5/lib/std/race/
lima-1.0b5/lib/std/race/restricted/
lima-1.0b5/lib/std/room/
lima-1.0b5/lib/tmp/
lima-1.0b5/lib/trans/
lima-1.0b5/lib/trans/admincmds/
lima-1.0b5/lib/trans/obj/
lima-1.0b5/lib/wiz/
/* Do not remove the headers from this file! see /USAGE for more info. */

/* object.c  about 1/2 Rust and 1/2 Nevyn  */
// Modifications:  Peregrin@ZorkMUD (GUE),  Mar '94
// Beek - rewrote the DISCARDED_MESSAGE stuff b/c it was hideously
//      - inefficient.
// Beek --- Added the OFFICIAL "what these vars should contain"
// documentation
// Sep 9 1994
// Rust moved everything into modules.

#include <flags.h>
#include <clean_up.h>

inherit BASE_OBJ;

#ifdef USE_SIZE
inherit __DIR__ "object/size";
#else
# ifdef USE_MASS
inherit __DIR__ "object/mass";
# endif
#endif  //USE_SIZE

#ifdef EVERYTHING_SAVES
inherit M_SAVE;
#endif

inherit __DIR__ "object/light";		/* before non_object */
inherit __DIR__ "object/properties";
inherit __DIR__ "object/move";
inherit __DIR__ "object/visible";
inherit __DIR__ "object/hooks";
inherit __DIR__ "object/msg_recipient";

mapping lpscript_attributes;

//:FUNCTION stat_me
//return some debugging info about the state of the object
string stat_me() 
{
  string result = ::stat_me() +
    "Short: "+short()+"\n";

#ifdef USE_SIZE
  result += "Size: "+query_size()+" Light: " + query_light() + "\n";
#else
# ifdef USE_MASS
  result += "Weight: "+query_mass()+"  Light: " + query_light() + "\n";
# else
  result += "Light: "+query_light() + "\n";
# endif
#endif

  return result;
}

//:FUNCTION setup
// This function is overloaded by area implementors.  Nothing in
// the mudlib proper should override this.  Further, nothing should
// ever go into this function.  This allows an area implementor to
// simply respond to setup() and not worry about inheriting the
// function call.
void setup(mixed array args...)
{
/* Overload me! */
}

//:FUNCTION mudlib_setup
// This function is overloaded by all mudlib objects deriving from
// this class.  They should inherit as necessary.  The intention of
// overriding this instead of create() to is ensure that the mudlib
// initialization completes _before_ the call to the area coder's
// setup() function.  Specifically, the mudlib objects need to
// initialize defaults that will then be changed by the setup() call.
// Note that if the mudlib object overrode create(), then its init
// code would occur _after_ the area coder's setup() and possibly
// blow away some of their settings.
void mudlib_setup(mixed array args...)
{
/* Overload me! */
}

void create(mixed array args...)
{
  base_obj::create();
  configure_set(STD_FLAGS, 0, (: resync_visibility :));

  if ( clonep(this_object()) )
  {
    mudlib_setup(args...);

// Use a call_other to avoid a redeclaration warning, since
// mostly modules that aren't directly inheriting us will define
// this function.
    this_object()->internal_setup(args...);

    setup(args...);
  }
}

/* arbitrate some stuff that was stubbed in BASE_OBJ */
varargs mixed  call_hooks( array args...)
{
  return hooks::call_hooks(args...);
}

int is_visible()
{
  return visible::is_visible();
}

void set_light(int x)
{
  light::set_light(x);
}

//### defeats the purpose, doesn't it?  I think this should default to 
//### failing.  That was what was intended; otherwise it would be named
//### disallow() ...
int allow(string what)
{
  return 1;
}

// by default, if we appear to be useless, we are!
int destruct_if_useless() {
  destruct(this_object());
}

// Be *very* careful about calling functions in other objects from here,
// since that may cause that object to not clean_up() [since this function
// is called in objects that haven't had a function call in a while].
//
// e.g. environment()->anything, like many libs do, is remarkably stupid.
int clean_up(int instances)
{
// If we have an environment, we will be destructed when our environment
// cleans up.  So no need to worry about it ourself.  Note that once
// we have an environment, we can never lose it, so the driver need not
// worry about us any more.
  if ( environment() )
    return NEVER_AGAIN;

// if we are inherited, or have clones around, we don't want to clean up
// as that would cause this program to need to be recompiled later.
// (note: instances is only ever nonzero for blueprints)
// This may change later, though.
// Instances are always coing to be at least one because the blueprint is 
// counted.  -- Tigran
// Actually the 'instances' counter is inaccurate - so check 'children'
// instead -- Loriel
//  if ( instances>1 )
  if(base_name(this_object())[0..1] != "/d")
    return NEVER_AGAIN;
  if(sizeof(children(base_name(this_object())))>1)
    return ASK_AGAIN;

// We don't have an environment.  We appear to be useless!
  return destruct_if_useless();
}

void on_clone( mixed array args... )
{
}

void set_lpscript_attributes(mapping attributes)
{
  if(base_name(previous_object())!=LPSCRIPT_D)
    error("Access violation:  Illegal attempt to set_lpscript_attributes");
      lpscript_attributes=attributes;
}

string array list_lpscript_attributes()
{
  return copy(keys(lpscript_attributes));
}

mapping dump_lpscript_attributes()
{
  return copy(lpscript_attributes);
}
mapping lpscript_attributes() {
  return ([
    "adj" : ({ LPSCRIPT_LIST, "setup", "add_adj" }),
    "id" : ({ LPSCRIPT_LIST, "setup", "add_id" }),
    "primary_adj" : ({ LPSCRIPT_STRING, "setup", "set_adj" }),
    "primary_id" : ({ LPSCRIPT_STRING, "setup", "set_id" }),
    "in_room_desc" : ({ LPSCRIPT_STRING, "setup", "set_in_room_desc" }),
    "long" : ({ LPSCRIPT_STRING, "setup", "set_long" }),
    "flag" : ({ LPSCRIPT_FLAGS }),
    "light" : ({ LPSCRIPT_INT, "setup", "set_light" }),
#ifdef USE_MASS
    "mass" : ({ LPSCRIPT_INT, "setup", "set_mass" }),
    "weight" : ({ LPSCRIPT_INT, "setup", "set_mass" }),
#else
      "mass" : ({ LPSCRIPT_INT, "setup", "set_size" }),
      "weight" : ({ LPSCRIPT_INT, "setup", "set_size" }),
#endif
    ]);
}