_wimpy.c

tmi2_fluffos_v2/lib/cmds/std/_wimpy.c · 826 B

From the archive tmi2_fluffos_v2.zip

Download the archive   « Back to the archive contents

/*
// The "wimpy" command.
// Coded by Buddha@TMI on 2/16/92
// Modified for 0.9.0 mudlib by Mobydick, 9/19/92
// This file is part of the TMI distribution mudlib.
// Please retain this header if you use it.
*/

#include <mudlib.h>

inherit DAEMON ;

int help();

mixed cmd_wimpy(string arg) {

   int level;

   this_player()->block_attack(2) ;
   if(!arg) {
	write ("Your wimpy is set to: "+(int)previous_object()->query("wimpy")+"%.\n") ;
      return 1;
   }
   if(!sscanf(arg, "%d", level)) {
      help();
      return 1;
   }
	previous_object()->set ("wimpy", level) ;
	write ("Your wimpy is now set to "+arg+"%.\n") ;
   return 1;
}

int help() {
   write("Usage:\nwimpy <number>\n" +
      "Sets the percentage of your total hit points you can lose before you\n" +
      "flee from an attacker.\n") ;
   return 1;
}

Site Stats

Snippets: 1791
Codebases: 571