tmi2_fluffos_v2/
tmi2_fluffos_v2/bin/
tmi2_fluffos_v2/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/ChangeLog.old/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/Win32/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/simuls/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/clone/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/command/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/data/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/master/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/log/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/compiler/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/efuns/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/operators/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/u/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/tmp/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/windows/
tmi2_fluffos_v2/lib/
tmi2_fluffos_v2/lib/adm/
tmi2_fluffos_v2/lib/adm/daemons/languages/
tmi2_fluffos_v2/lib/adm/daemons/network/I3/
tmi2_fluffos_v2/lib/adm/daemons/virtual/
tmi2_fluffos_v2/lib/adm/daemons/virtual/template/
tmi2_fluffos_v2/lib/adm/news/
tmi2_fluffos_v2/lib/adm/obj/
tmi2_fluffos_v2/lib/adm/obj/master/
tmi2_fluffos_v2/lib/adm/priv/
tmi2_fluffos_v2/lib/adm/shell/
tmi2_fluffos_v2/lib/adm/tmp/
tmi2_fluffos_v2/lib/cmds/
tmi2_fluffos_v2/lib/d/
tmi2_fluffos_v2/lib/d/Conf/
tmi2_fluffos_v2/lib/d/Conf/adm/
tmi2_fluffos_v2/lib/d/Conf/boards/
tmi2_fluffos_v2/lib/d/Conf/cmds/
tmi2_fluffos_v2/lib/d/Conf/data/
tmi2_fluffos_v2/lib/d/Conf/logs/
tmi2_fluffos_v2/lib/d/Conf/obj/
tmi2_fluffos_v2/lib/d/Conf/text/help/
tmi2_fluffos_v2/lib/d/Fooland/adm/
tmi2_fluffos_v2/lib/d/Fooland/data/
tmi2_fluffos_v2/lib/d/Fooland/data/attic/
tmi2_fluffos_v2/lib/d/Fooland/items/
tmi2_fluffos_v2/lib/d/TMI/
tmi2_fluffos_v2/lib/d/TMI/adm/
tmi2_fluffos_v2/lib/d/TMI/boards/
tmi2_fluffos_v2/lib/d/TMI/data/
tmi2_fluffos_v2/lib/d/TMI/rooms/
tmi2_fluffos_v2/lib/d/grid/
tmi2_fluffos_v2/lib/d/grid/adm/
tmi2_fluffos_v2/lib/d/grid/data/
tmi2_fluffos_v2/lib/d/std/
tmi2_fluffos_v2/lib/d/std/adm/
tmi2_fluffos_v2/lib/data/adm/
tmi2_fluffos_v2/lib/data/adm/daemons/
tmi2_fluffos_v2/lib/data/adm/daemons/doc_d/
tmi2_fluffos_v2/lib/data/adm/daemons/emoted/
tmi2_fluffos_v2/lib/data/adm/daemons/network/http/
tmi2_fluffos_v2/lib/data/adm/daemons/network/services/mail_q/
tmi2_fluffos_v2/lib/data/adm/daemons/network/smtp/
tmi2_fluffos_v2/lib/data/adm/daemons/news/archives/
tmi2_fluffos_v2/lib/data/attic/connection/
tmi2_fluffos_v2/lib/data/attic/user/
tmi2_fluffos_v2/lib/data/std/connection/b/
tmi2_fluffos_v2/lib/data/std/connection/l/
tmi2_fluffos_v2/lib/data/std/user/a/
tmi2_fluffos_v2/lib/data/std/user/b/
tmi2_fluffos_v2/lib/data/std/user/d/
tmi2_fluffos_v2/lib/data/std/user/f/
tmi2_fluffos_v2/lib/data/std/user/l/
tmi2_fluffos_v2/lib/data/std/user/x/
tmi2_fluffos_v2/lib/data/u/d/dm/working/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/smtp/
tmi2_fluffos_v2/lib/doc/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/interactive/
tmi2_fluffos_v2/lib/doc/driverdoc/concepts/
tmi2_fluffos_v2/lib/doc/driverdoc/driver/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/arrays/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/buffers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/compile/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/ed/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/filesystem/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/floats/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/functions/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/general/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/mappings/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/numbers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/parsing/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/constructs/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/preprocessor/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/types/
tmi2_fluffos_v2/lib/doc/driverdoc/platforms/
tmi2_fluffos_v2/lib/doc/mudlib/
tmi2_fluffos_v2/lib/ftp/
tmi2_fluffos_v2/lib/include/driver/
tmi2_fluffos_v2/lib/log/
tmi2_fluffos_v2/lib/log/driver/
tmi2_fluffos_v2/lib/obj/net/
tmi2_fluffos_v2/lib/obj/shells/
tmi2_fluffos_v2/lib/obj/tools/
tmi2_fluffos_v2/lib/std/adt/
tmi2_fluffos_v2/lib/std/board/
tmi2_fluffos_v2/lib/std/body/
tmi2_fluffos_v2/lib/std/fun/
tmi2_fluffos_v2/lib/std/living/
tmi2_fluffos_v2/lib/std/object/
tmi2_fluffos_v2/lib/std/shop/
tmi2_fluffos_v2/lib/std/socket/
tmi2_fluffos_v2/lib/std/user/
tmi2_fluffos_v2/lib/std/virtual/
tmi2_fluffos_v2/lib/student/
tmi2_fluffos_v2/lib/student/kalypso/
tmi2_fluffos_v2/lib/student/kalypso/armor/
tmi2_fluffos_v2/lib/student/kalypso/rooms/
tmi2_fluffos_v2/lib/student/kalypso/weapons/
tmi2_fluffos_v2/lib/u/l/leto/
tmi2_fluffos_v2/lib/u/l/leto/cmds/
tmi2_fluffos_v2/lib/www/errors/
tmi2_fluffos_v2/lib/www/gateways/
tmi2_fluffos_v2/lib/www/images/
tmi2_fluffos_v2/old/
tmi2_fluffos_v2/win32/
// vampire.c
// An example monster which reacts to the time of day.
// It has three forms: resting form, vampire form, and bat form. In
// daytime it is in resting form, during which time it lies in its
// coffin. At nighttime it turns into a vampire, except during the full
// moon in which case it turns into a bat.
// Coded by Mobydick, 7-4-93.

#include <daemons.h>
#include <mudlib.h>

#define INSIDE_COFFIN "/d/Fooland/coffin_interior.c"
#define COFFIN "/d/Fooland/coffin.c"
#define COFFIN_ROOM "/d/Fooland/tower2"
#define RESTING 1
#define VAMPIRE 2
#define BAT 3

inherit MONSTER ;

#define FULL_MOON_MSG "The full moon shines brightly down."
#define START_NIGHT_MSG "Twilight fades and the night begins.\n"
#define END_NIGHT_MSG "A faint glow appears in the east.\n"


int state ;

// We need three functions, to change the monster into each of its three
// forms.

void become_resting() {
	set ("short", "a pale corpse") ;
	set ("long", "This is the pale corpse of a tall man with a widow's peak and some odd\ndental work. He is dressed entirely in black.\n") ;
	set ("mass", 7500) ;
	set ("bulk", 750) ;
	set ("capacity", 5000) ;
	set ("max_cap",5000) ;
	set ("volume", 500) ;
	set ("max_vol", 500) ;
	set ("no_attack", 1) ;
	state = RESTING ;
	remove_call_out("move_around") ;
}

void become_vampire() {
	set ("short", "a vampire") ;
	set ("long", "The vampire is dressed all in black and has long sharp fangs. Blood drops\nfrom the corner of his mouth.\n") ;
	set ("mass", 7500) ;
        set ("bulk", 750) ;
        set ("capacity", 5000) ;
        set ("max_cap",5000) ;
        set ("volume", 500) ;
        set ("max_vol", 500) ;
	set ("hit_points", 70) ;
	set ("max_hp",70) ;
	set ("stat/strength", 4) ;
        set ("stat/dexterity", 6) ;
        set_skill("attack", 3, "strength") ;
        set_skill("defense", 8, "dexterity") ;
	set ("armor_class", 2) ;
	set ("attack_strength", 12) ;
	set ("weapon_name", "teeth") ;
	set ("damage", ({ 6,12 }) ) ;
	set_verbs( ({ "bite at" }) ) ;
	set ("no_attack", 0) ;
	state = VAMPIRE ;
	set ("moving", 1) ;
	set ("speed", 12) ;
}

void become_bat() {
	set ("short", "a bat") ;
	set ("long", "This small bat is flying around the room noisily. It seems as though it\nmight be more intelligent than it appears...\n") ;
	set ("mass",50) ;
	set ("bulk", 15) ;
	set ("capacity",30) ;
	set ("max_cap", 30) ;
	set ("volume", 10) ;
	set ("max_vol", 10) ;
	enable_commands() ;
	state = BAT ;
	set("moving",1) ;
	set ("speed",4) ;
}

void create() {

	int hour ;
	string str,foo ;
	object ob ;

	::create() ;
	seteuid(getuid()) ;
// Load up the coffin and coffin interior, if needed.
	ob = find_object_or_load(COFFIN) ;
	ob = find_object_or_load(INSIDE_COFFIN) ;
	WEATHER_D->request_weather_notices(this_object()) ;
	enable_commands() ;
	set ("id", ({ "corpse", "vampire", "bat" }) ) ;
	set_name("vampire") ;
	set("gender", "male") ;
	sscanf(WEATHER_D->query_game_time(),"%d%s",hour,foo) ;
// hour = hour + 10 ;
	if (hour>12 && hour <24) {
		foo = WEATHER_D->query_current_moon_phase() ;
		if (foo==FULL_MOON_MSG) {
			become_bat() ;
		} else {
			become_vampire() ;
		}
		move(COFFIN_ROOM) ;
	} else {
		become_resting() ;
		move(INSIDE_COFFIN) ;
	}
}

void receive_message (string Class, string message) {

	if (message==START_NIGHT_MSG) {
	    move(COFFIN_ROOM) ;
	    if ((string)WEATHER_D->query_current_moon_phase()==FULL_MOON_MSG) {
		become_bat() ;
		write ("The corpse changes into a bat, and flies from the coffin!\n") ;
	    } else {
		become_vampire() ;
		say ("The corpse rises and becomes a vampire!\n") ;
	    }
	}
	if (message==END_NIGHT_MSG) {
	    become_resting() ;
	    if (state==BAT) {
		say ("The bat flies out of the room.\n") ;
	    } else {
		say ("The vampire turns into a bat, and flies away!\n") ;
	    }
	    move(INSIDE_COFFIN) ;
	}
}

// Generally this monster should not clean up. Otherwise the coffin
// will become confused.

int clean_up() {
	return 1 ;
}

// Need this to get an appropriate message printed.

varargs int move_player(mixed dest, string message, string dir) {

	object env ;

	env = environment(this_object()) ;
	if (file_name(env)==COFFIN_ROOM) {
// we only want him to go out the window in this case.
	message = "The vampire turns into a bat, and flies out the window!" ;
	dir = "window" ;
	dest = env->query("exits/window") ;
		env->out_the_window() ;
	}
	::move_player(dest,message,dir) ;
}