nightmare4_fluffos_v1/
nightmare4_fluffos_v1/bin/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/ChangeLog.old/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/Win32/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/compat/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/compat/simuls/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/include/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/clone/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/command/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/data/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/etc/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/include/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/inherit/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/inherit/master/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/log/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/compiler/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/efuns/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/operators/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/u/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/tmp/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/windows/
nightmare4_fluffos_v1/lib/cfg/
nightmare4_fluffos_v1/lib/cmds/admins/
nightmare4_fluffos_v1/lib/cmds/common/
nightmare4_fluffos_v1/lib/cmds/creators/include/
nightmare4_fluffos_v1/lib/cmds/creators/include/SCCS/
nightmare4_fluffos_v1/lib/cmds/hm/
nightmare4_fluffos_v1/lib/daemon/services/
nightmare4_fluffos_v1/lib/doc/
nightmare4_fluffos_v1/lib/doc/faq/
nightmare4_fluffos_v1/lib/doc/help/classes/
nightmare4_fluffos_v1/lib/doc/help/creators/
nightmare4_fluffos_v1/lib/doc/help/hm/
nightmare4_fluffos_v1/lib/doc/help/players/
nightmare4_fluffos_v1/lib/doc/help/races/
nightmare4_fluffos_v1/lib/doc/help/religion/
nightmare4_fluffos_v1/lib/doc/mudlib/
nightmare4_fluffos_v1/lib/doc/mudlib/cfg/
nightmare4_fluffos_v1/lib/domains/Ylsrim/
nightmare4_fluffos_v1/lib/domains/Ylsrim/adm/
nightmare4_fluffos_v1/lib/domains/Ylsrim/armour/
nightmare4_fluffos_v1/lib/domains/Ylsrim/fish/
nightmare4_fluffos_v1/lib/domains/Ylsrim/meal/
nightmare4_fluffos_v1/lib/domains/Ylsrim/npc/
nightmare4_fluffos_v1/lib/domains/Ylsrim/virtual/
nightmare4_fluffos_v1/lib/domains/Ylsrim/weapon/
nightmare4_fluffos_v1/lib/domains/Ylsrim/xtra/
nightmare4_fluffos_v1/lib/lib/comp/
nightmare4_fluffos_v1/lib/lib/lvs/
nightmare4_fluffos_v1/lib/lib/std/
nightmare4_fluffos_v1/lib/lib/user/
nightmare4_fluffos_v1/lib/news/
nightmare4_fluffos_v1/lib/obj/
nightmare4_fluffos_v1/lib/obj/include/
nightmare4_fluffos_v1/lib/save/
nightmare4_fluffos_v1/lib/save/kills/a/
nightmare4_fluffos_v1/lib/save/kills/b/
nightmare4_fluffos_v1/lib/save/kills/f/
nightmare4_fluffos_v1/lib/save/kills/m/
nightmare4_fluffos_v1/lib/save/kills/q/
nightmare4_fluffos_v1/lib/save/kills/r/
nightmare4_fluffos_v1/lib/secure/cfg/
nightmare4_fluffos_v1/lib/secure/cfg/classes/
nightmare4_fluffos_v1/lib/secure/cfg/races/SCCS/
nightmare4_fluffos_v1/lib/secure/cmds/creators/include/
nightmare4_fluffos_v1/lib/secure/cmds/players/
nightmare4_fluffos_v1/lib/secure/cmds/players/include/
nightmare4_fluffos_v1/lib/secure/daemon/include/
nightmare4_fluffos_v1/lib/secure/lib/
nightmare4_fluffos_v1/lib/secure/lib/include/
nightmare4_fluffos_v1/lib/secure/lib/net/
nightmare4_fluffos_v1/lib/secure/lib/std/
nightmare4_fluffos_v1/lib/secure/obj/
nightmare4_fluffos_v1/lib/secure/obj/include/
nightmare4_fluffos_v1/lib/secure/save/
nightmare4_fluffos_v1/lib/secure/save/boards/
nightmare4_fluffos_v1/lib/secure/save/votes/
nightmare4_fluffos_v1/lib/spells/
nightmare4_fluffos_v1/lib/verbs/admins/include/
nightmare4_fluffos_v1/lib/verbs/common/
nightmare4_fluffos_v1/lib/verbs/common/include/
nightmare4_fluffos_v1/lib/verbs/creators/
nightmare4_fluffos_v1/lib/verbs/creators/include/
nightmare4_fluffos_v1/lib/verbs/players/include/SCCS/
nightmare4_fluffos_v1/lib/verbs/rooms/
nightmare4_fluffos_v1/lib/verbs/rooms/include/
nightmare4_fluffos_v1/lib/www/
nightmare4_fluffos_v1/old/
nightmare4_fluffos_v1/old/tools/
nightmare4_fluffos_v1/win32/
/*    /cmds/players/wimpy.c
 *    from the Nightmare V Object Library
 *    wimpy NUM
 *    wimpy STR
 *    created by Descartes of Borg 960113
 */

#include <lib.h>
#include <message_class.h>

inherit LIB_DAEMON;

mixed cmd(string args) {
    int percentage;
    string cmd;

    if( !args || args == "" ) {
	percentage = (int)this_player()->GetWimpy();
	cmd = (string)this_player()->GetWimpyCommand();
	if( !percentage )
	  this_player()->eventPrint("You have wimpy turned off.", MSG_SYSTEM);
	else this_player()->eventPrint("Percentage: " + percentage + "%\n"
				       "Command: " + cmd, MSG_SYSTEM);
	return 1;
    }
    if( args == "0" ) {
	percentage = 0;
	cmd = 0;
    }
    else if( percentage = to_int(args) ) cmd = 0;
    else if( args == "on" ) {
	percentage = 23;
	cmd = 0;
    }
    else if( args == "off" ) {
	percentage = 0;
	cmd = 0;
    }
    else {
	percentage = 0;
	cmd = args;
    }
    if( !cmd ) {
	if( !percentage ) {
	    this_player()->SetWimpy(0);
	    this_player()->eventPrint("Wimpy is now off!  You are so brave!",
				      MSG_SYSTEM);
	    return 1;
	}
	if( percentage > 30 ) {
	    this_player()->eventPrint("You may not set wimpy greater than "
				      "30%.", MSG_SYSTEM);
	    return 1;
	}
	else if( percentage < 1 ) return "That is not a valid percentage!";
	this_player()->SetWimpy(percentage);
	if( percentage > 20 ) {
	    this_player()->eventPrint("What a weenie!  Get some backbone!",
				      MSG_SYSTEM);
	    return 1;
	}
	else if( percentage > 10 ) {
	    this_player()->eventPrint("You are the cautious one!", MSG_SYSTEM);
	    return 1;
	}
	else {
	    this_player()->eventPrint("You are brave, but not foolish!",
				      MSG_SYSTEM);
	    return 1;
	}
    }
    this_player()->SetWimpyCommand(cmd);
    this_player()->eventPrint("You will execute the command: \"" + cmd +
			      "\" next time you wimpy.", MSG_SYSTEM);
    return 1;
}

string GetHelp(string str) {
    return ("Syntax: <wimpy>\n"
	    "        <wimpy on>\n"
	    "        <wimpy off>\n"
	    "        <wimpy PERCENTAGE>\n"
	    "        <wimpy COMMAND>\n\n"
	    "Wimpy is a system that allows you to automatically execute "
	    "a command when your health points get below a certain percentage "
	    "of your maximum health points.  The wimpy command allows you "
	    "to set which command will be used at which percentage.  "
	    "The \"on\" and \"off\" arguments are simply quick ways to "
	    "set the percentage to 23% and 0% respectively.  You cannot "
	    "Set yourself to wimpy at anything greater than 30%.\n"
	    "If you set go and enter commands, for example:\n"
	    "\tgo west\n"
	    "the wimpy system will first try to use that command, and if it "
	    "fails, it will search for an exit in the room to take.  If "
	    "you set another command as your wimpy command, however, other "
	    "than a go or enter, it will not make any attempt to execute "
	    "some other command.\n"
	    "For example, if you issued the command:\n"
	    "\twimpy gate to Mystery Person\n"
	    "so that \"gate to Mystery Person\" was your wimpy command, "
	    "the wimpy system would try to execute that command when you "
	    "wimpy and will not try any other command, even if the gate "
	    "fails (too low on mp, Mystery Person is not online, etc.).\n"
	    "Without any arguments, the wimpy command displays your current "
	    "settings.\n\n"
	    "See also: attack, status");
}