foundationI_fluffos_v1/
foundationI_fluffos_v1/bin/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/ChangeLog.old/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/Win32/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/compat/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/compat/simuls/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/include/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/clone/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/command/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/data/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/etc/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/include/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/inherit/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/inherit/master/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/log/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/tests/compiler/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/tests/efuns/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/single/tests/operators/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/testsuite/u/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/tmp/
foundationI_fluffos_v1/fluffos-2.9-ds2.12/windows/
foundationI_fluffos_v1/lib/
foundationI_fluffos_v1/lib/cmds/ambassador/
foundationI_fluffos_v1/lib/cmds/database/
foundationI_fluffos_v1/lib/cmds/soul/
foundationI_fluffos_v1/lib/daemon/include/
foundationI_fluffos_v1/lib/daemon/save/
foundationI_fluffos_v1/lib/daemon/services/
foundationI_fluffos_v1/lib/daemon/soul/
foundationI_fluffos_v1/lib/doc/build/
foundationI_fluffos_v1/lib/doc/build/room/
foundationI_fluffos_v1/lib/doc/build/virtual/
foundationI_fluffos_v1/lib/doc/driver/
foundationI_fluffos_v1/lib/doc/efun/
foundationI_fluffos_v1/lib/doc/etc/
foundationI_fluffos_v1/lib/doc/help/creator/
foundationI_fluffos_v1/lib/doc/help/hm/
foundationI_fluffos_v1/lib/doc/help/user/
foundationI_fluffos_v1/lib/doc/lpc/basic/
foundationI_fluffos_v1/lib/doc/lpc/data_types/
foundationI_fluffos_v1/lib/doc/lpc/etc/
foundationI_fluffos_v1/lib/doc/lpc/intermediate/
foundationI_fluffos_v1/lib/doc/lpc/types/
foundationI_fluffos_v1/lib/doc/mudlib/
foundationI_fluffos_v1/lib/doc/mudlib/features/
foundationI_fluffos_v1/lib/domains/Examples/etc/
foundationI_fluffos_v1/lib/domains/Examples/room/
foundationI_fluffos_v1/lib/domains/Examples/virtual/
foundationI_fluffos_v1/lib/domains/Examples/virtual/exaA/
foundationI_fluffos_v1/lib/domains/Examples/virtual/exaB/
foundationI_fluffos_v1/lib/domains/Examples/weapon/
foundationI_fluffos_v1/lib/domains/Standard/
foundationI_fluffos_v1/lib/domains/Standard/pools/
foundationI_fluffos_v1/lib/domains/Standard/std/
foundationI_fluffos_v1/lib/domains/Standard/xtra/
foundationI_fluffos_v1/lib/include/
foundationI_fluffos_v1/lib/news/
foundationI_fluffos_v1/lib/secure/cfg/
foundationI_fluffos_v1/lib/secure/cmds/adm/
foundationI_fluffos_v1/lib/secure/cmds/ambassador/
foundationI_fluffos_v1/lib/secure/cmds/mortal/
foundationI_fluffos_v1/lib/secure/etc/
foundationI_fluffos_v1/lib/secure/etc/approval/
foundationI_fluffos_v1/lib/secure/etc/elections/
foundationI_fluffos_v1/lib/secure/etc/mudlib/
foundationI_fluffos_v1/lib/secure/etc/quests/
foundationI_fluffos_v1/lib/secure/save/daemon/
foundationI_fluffos_v1/lib/secure/save/postal/d/descartes/
foundationI_fluffos_v1/lib/secure/save/users/d/
foundationI_fluffos_v1/lib/secure/std/
foundationI_fluffos_v1/lib/std/obj/
foundationI_fluffos_v1/lib/std/room/
foundationI_fluffos_v1/lib/std/user/
foundationI_fluffos_v1/lib/std/virtual/
foundationI_fluffos_v1/old/
foundationI_fluffos_v1/win32/
//	/std/living/messages.c
//	from the Nightmare mudlib
//	inheritable code for all the nifty messages of motion
//	originally from the TMI distribution mudlib

int peds_gone();

string validate(string str, string *vars) {
    string foo;
    int x, tmp;

    if( !str ) return "";
    for(x=0, tmp = sizeof(vars); x<tmp; x++)
        if(!(sscanf(str, "%s"+vars[x]+"%*s", foo)))
	    return "";
    return str;
}

string query_min() {
    int tmp;
    string str;

    str = (string)this_object()->getenv("MIN");
    str = validate( str, ({ "$N" }) );
    if( str == "" ) str = "$N enters.";
    tmp = peds_gone();
    if(tmp == 1) str = "$N enters with a limp.";
    else if(tmp) str = "$N crawls in.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    return str;
}

string query_mout(string dir) {
    int tmp;
    string str;

    str = (string)this_object()->getenv("MOUT");
    str = validate( str, ({ "$N", "$D" }) );
    if( str == "" ) str = "$N leaves $D.";
    tmp = peds_gone();
    if(tmp == 1) str = "$N limps $D.";
    else if(tmp) str = "$N crawls $D.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    if (dir == "" || dir == 0) return str;
    str = substr( str, "$D", dir );
    return str;
}

string query_mmin() {
    string str;

    str = (string)this_object()->getenv("MMIN");
    str = validate( str, ({ "$N" }) );
    if( str == "" ) str = "$N appears from the shadows.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    return str;
}

string query_mmout() {
    string str;

    str = (string)this_object()->getenv("MMOUT");
    str = validate( str, ({ "$N" }) );
    if( str == "" ) str = "$N fades into the shadows.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    return str;
}

string query_mhome() {
    string str;

    str = (string)this_object()->getenv("MHOME");
    str = validate( str, ({ "$N" }) );
    if( str == "" ) str = "$N heads home.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    return str;
}

string query_mdest(object obj) {
    string str;

    str = (string)this_object()->getenv("MDEST");
    str = validate( str, ({ "$N", "$O" }) );
    if(!str || str == "") str = "$N disintegrates $O";
    str = replace_string(str, "$N", (string)this_object()->query_cap_name());
    if (obj == 0) return str;
    if( obj->query_short() )
        str = substr( str, "$O", (string)obj->query_short() );
    else
        str = substr( str, "$O", "something" );
    return str;
}

string query_mclone(object obj) {
    string str;

	str = (string)this_object()->getenv("MCLONE");
	str = validate( str, ({ "$N", "$O" }) );
	if( str == "" ) str = "$N gets creative and makes $O.";
	str = substr( str, "$N", (string)this_player()->query_cap_name() );
       if (obj == 0) return str;
	if( obj->query_short() )
		str = substr( str, "$O", (string)obj->query_short() );
	else str = substr( str, "$O", "something" );
	return str;
}

string query_mvis() {
    string str;

    str = (string)this_object()->getenv("MVIS");
    str = validate( str, ({ "$N" }) );
    if( str == "" ) str = "$N appears out of the corner of your eye.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    return str;
}

string query_minvis() {
    string str;

    str = (string)this_object()->getenv("MINVIS");
    str = validate( str, ({ "$N" }) );
    if( str == "" ) str = "$N seems to dissapear.";
    str = substr( str, "$N", (string)this_object()->query_cap_name() );
    return str;
}

int peds_gone() {
    string blah;
    string *peds;
    int i, ret, tmp;

    peds = (string *)this_object()->query_severed_limbs();
    if(!peds) return 0;
    for(i=0, tmp = sizeof(peds); i<tmp; i++) {
        ret += sscanf(peds[i], "%sfoot%*s", blah);
        ret += sscanf(peds[i], "%spaw%*s", blah);
    }
    return ret;
}