# HG changeset patch
# User John "Elwin" Edwards
# Date 1431113080 14400
# Node ID adfa37e670842b857b49b6cc83565b7cbd5e4427
# Parent  d10fc4a065ac7e84ca38edf2bd2b27cef07db59f
Import Advanced Rogue 7.7 from the Roguelike Restoration Project (r1490)

diff -r d10fc4a065ac -r adfa37e67084 arogue7/LICENSE.TXT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arogue7/LICENSE.TXT	Fri May 08 15:24:40 2015 -0400
@@ -0,0 +1,179 @@
+Copyright (C) 1984, 1985, 1986 Michael Morgan, Ken Dalka and AT&T
+Portions Copyright (C) 1984 Robert D. Kindelberger
+Portions Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
+Portions Copyright (C) 2005 Nicholas J. Kisseberth
+Portions Copyright (C) 1994 David Burren
+All rights reserved.
+
+===========================================================================
+
+Advanced Rogue
+Copyright (C) 1984, 1985, 1986 Michael Morgan, Ken Dalka and AT&T 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name(s) of the author(s) nor the names of other contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+4. The name "Advanced Rogue" and "ARogue" must not be used to endorse or 
+   promote products derived from this software without prior written 
+   permission.
+5. Products derived from this software may not be called "Advanced Rogue" or
+   "ARogue", nor may "Advanced Rogue" or "ARogue appear in their name, 
+   without prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+===========================================================================
+
+Portions of this software are based on the work of Robert D. Kindelberger.
+Used under license:
+
+Super-Rogue
+Copyright (C) 1984 Robert D. Kindelberger
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name(s) of the author(s) nor the names of other contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+4. The name "Super-Rogue" must not be used to endorse or promote products
+   derived from this software without prior written permission.
+5. Products derived from this software may not be called "Super-Rogue",
+   nor may "Super-Rogue" appear in their name, without prior written
+   permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+===========================================================================
+
+Portions of this software are based on the work of Michael Toy, Ken Arnold
+and Glenn Wichman. Used under license:
+
+Rogue: Exploring the Dungeons of Doom
+Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name(s) of the author(s) nor the names of other contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+===========================================================================
+
+Portions of this software (state.c, mdport.c) are based on the work 
+of Nicholas J. Kisseberth. Used under license:
+
+Copyright (C) 2005 Nicholas J. Kisseberth
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name(s) of the author(s) nor the names of other contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+===========================================================================
+
+Portions of this software (xcrypt.c) are based on the work 
+of David Burren. Used under license:
+
+FreeSec: libcrypt
+
+Copyright (C) 1994 David Burren
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name(s) of the author(s) nor the names of other contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff -r d10fc4a065ac -r adfa37e67084 arogue7/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arogue7/Makefile	Fri May 08 15:24:40 2015 -0400
@@ -0,0 +1,193 @@
+#
+# Makefile for rogue
+#
+# Advanced Rogue
+# Copyright (C) 1984, 1985, 1986 Michael Morgan, Ken Dalka and AT&T
+# All rights reserved.
+#
+# Based on "Rogue: Exploring the Dungeons of Doom"
+# Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
+# All rights reserved.
+#
+# See the file LICENSE.TXT for full copyright and licensing information.
+#
+
+#
+# Makefile for rogue
+#
+
+
+DISTNAME=arogue7.7.1
+PROGRAM=arogue77
+
+O=o
+
+HDRS=	rogue.h mach_dep.h network.h
+
+OBJS1 =	vers.$(O) actions.$(O) chase.$(O) command.$(O) daemon.$(O) \
+	daemons.$(O) eat.$(O) effects.$(O) encumb.$(O) fight.$(O) init.$(O) \
+        io.$(O) list.$(O) main.$(O) maze.$(O) mdport.$(O) misc.$(O) \
+        monsters.$(O)
+OBJS2 = move.$(O) new_level.$(O) options.$(O) outside.$(O) pack.$(O) \
+        passages.$(O) player.$(O) potions.$(O) rings.$(O) rip.$(O) rogue.$(O) \
+        rooms.$(O) save.$(O) scrolls.$(O) state.$(O) sticks.$(O) things.$(O) \
+        trader.$(O) util.$(O) weapons.$(O) wear.$(O) wizard.$(O) xcrypt.$(O)
+OBJS  =	$(OBJS1) $(OBJS2)
+
+CFILES=	vers.c actions.c chase.c command.c daemon.c \
+	daemons.c eat.c effects.c encumb.c fight.c init.c \
+        io.c list.c main.c maze.c mdport.c misc.c monsters.c \
+        move.c new_level.c options.c outside.c pack.c \
+	passages.c player.c potions.c rings.c rip.c rogue.c \
+	rooms.c save.c scrolls.c state.c sticks.c things.c \
+	trader.c util.c weapons.c wear.c wizard.c xcrypt.c
+MISC_C=	
+DOCSRC= aguide.mm
+DOCS  = $(PROGRAM).doc $(PROGRAM).html
+MISC  =	Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
+        $(DOCSRC)
+
+CC    = gcc
+ROPTS =
+COPTS = -O3
+CFLAGS= $(COPTS) $(ROPTS) 
+LIBS =	-lcurses
+RM    = rm -f
+
+.SUFFIXES: .obj
+
+.c.obj:
+	$(CC) $(CFLAGS) /c $*.c
+    
+$(PROGRAM): $(HDRS) $(OBJS)
+	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
+    
+clean:
+	$(RM) $(OBJS1)
+	$(RM) $(OBJS2)
+	$(RM) core a.exe a.out a.exe.stackdump $(PROGRAM) $(PROGRAM).exe $(PROGRAM).lck
+	$(RM) $(PROGRAM).tar $(PROGRAM).tar.gz $(PROGRAM).zip 
+    
+dist.src:
+	make clean
+	tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC)
+	gzip -f $(DISTNAME)-src.tar
+
+doc.nroff:
+	tbl aguide.mm | nroff -mm | colcrt - > arogue77.doc
+
+doc.groff:
+	groff -P-c -t -mm -Tascii aguide.mm | sed -e 's/.\x08//g' > arogue77.doc
+	groff -t -mm -Thtml aguide.mm > arogue77.ht
+
+dist.irix:
+	make clean
+	make CC=cc COPTS="-woff 1116 -O3" $(PROGRAM)
+	tar cf $(DISTNAME)-irix.tar $(PROGRAM) LICENSE.TXT $(DOCS)
+	gzip -f $(DISTNAME)-irix.tar
+
+dist.aix:
+	make clean
+	make CC=xlc COPTS="-qmaxmem=16768 -O3 -qstrict" $(PROGRAM)
+	tar cf $(DISTNAME)-aix.tar $(PROGRAM) LICENSE.TXT $(DOCS)
+	gzip -f $(DISTNAME)-aix.tar
+
+dist.linux:
+	make clean
+	make $(PROGRAM)
+	tar cf $(DISTNAME)-linux.tar $(PROGRAM) LICENSE.TXT $(DOCS)
+	gzip -f $(DISTNAME)-linux.tar
+	
+dist.interix:
+	@$(MAKE) clean
+	@$(MAKE) COPTS="-ansi" $(PROGRAM)
+	tar cf $(DISTNAME)-interix.tar $(PROGRAM) LICENSE.TXT $(DOCS)
+	gzip -f $(DISTNAME)-interix.tar
+	
+dist.cygwin:
+	@$(MAKE) --no-print-directory clean
+	@$(MAKE) --no-print-directory $(PROGRAM)
+	tar cf $(DISTNAME)-cygwin.tar $(PROGRAM).exe LICENSE.TXT $(DOCS)
+	gzip -f $(DISTNAME)-cygwin.tar
+
+#
+# Use MINGW32-MAKE to build this target
+#
+dist.mingw32:
+	@$(MAKE) --no-print-directory RM="cmd /c del" clean
+	@$(MAKE) --no-print-directory LIBS="-lpdcurses" $(PROGRAM)
+	cmd /c del $(DISTNAME)-mingw32.zip
+	zip $(DISTNAME)-mingw32.zip $(PROGRAM).exe LICENSE.TXT $(DOCS)
+	
+dist.msys:
+	@$(MAKE) --no-print-directory clean
+	@$(MAKE) --no-print-directory LIBS="-lcurses" $(PROGRAM)
+	tar cf $(DISTNAME)-msys.tar $(PROGRAM).exe LICENSE.TXT $(DOCS)
+	gzip -f $(DISTNAME)-msys.tar
+	
+dist.djgpp:
+	@$(MAKE) --no-print-directory clean
+	@$(MAKE) --no-print-directory LDFLAGS="-L$(DJDIR)/LIB" \
+	LIBS="-lpdcurses" $(PROGRAM)
+	rm -f $(DISTNAME)-djgpp.zip
+	zip $(DISTNAME)-djgpp.zip $(PROGRAM).exe LICENSE.TXT $(DOCS)
+
+#
+# Use NMAKE to build this targer
+#
+dist.win32:
+	@$(MAKE) /NOLOGO O="obj" RM="-del" clean
+	@$(MAKE) /NOLOGO O="obj" CC="CL" \
+	    LIBS="..\pdcurses\pdcurses.lib shfolder.lib user32.lib Advapi32.lib" \
+	    COPTS="-nologo -I..\pdcurses \
+	    -Ox -wd4033 -wd4716" $(PROGRAM)
+	-del $(DISTNAME)-win32.zip
+	zip $(DISTNAME)-win32.zip $(PROGRAM).exe LICENSE.TXT $(DOCS)
+
+
+actions.o:	rogue.h
+chase.o:	rogue.h
+command.o:	rogue.h
+command.o:	mach_dep.h
+daemon.o:	rogue.h
+daemons.o:	rogue.h
+eat.o:		rogue.h
+edit.o:		mach_dep.h
+edit.o:		rogue.h
+effects.o:	rogue.h
+encumb.o:	rogue.h
+fight.o:	rogue.h
+init.o:		rogue.h
+init.o:		mach_dep.h
+io.o:		rogue.h
+list.o:		rogue.h
+main.o:		mach_dep.h
+main.o:		network.h
+main.o:		rogue.h
+maze.o:		rogue.h
+misc.o:		rogue.h
+monsters.o:	rogue.h
+move.o:		rogue.h
+new_level.o:	rogue.h
+options.o:	rogue.h
+outside.o:	rogue.h
+pack.o:		rogue.h
+passages.o:	rogue.h
+player.o:	rogue.h
+potions.o:	rogue.h
+rings.o:	rogue.h
+rip.o:		mach_dep.h
+rip.o:		network.h
+rip.o:		rogue.h
+rogue.o:	rogue.h
+rooms.o:	rogue.h
+save.o:		rogue.h
+save.o:		mach_dep.h
+scrolls.o:	rogue.h
+sticks.o:	rogue.h
+things.o:	rogue.h
+trader.o:	rogue.h
+util.o:		rogue.h
+weapons.o:	rogue.h
+wear.o:		rogue.h
+wizard.o:	rogue.h
diff -r d10fc4a065ac -r adfa37e67084 arogue7/actions.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arogue7/actions.c	Fri May 08 15:24:40 2015 -0400
@@ -0,0 +1,982 @@
+/*
+ * actions.c  -  functions for dealing with monster actions
+ *
+ * Advanced Rogue
+ * Copyright (C) 1984, 1985, 1986 Michael Morgan, Ken Dalka and AT&T
+ * All rights reserved.
+ *
+ * Based on "Rogue: Exploring the Dungeons of Doom"
+ * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
+ * All rights reserved.
+ *
+ * See the file LICENSE.TXT for full copyright and licensing information.
+ */
+
+#include <ctype.h>
+#include <limits.h>
+#include "curses.h"
+#include "rogue.h"
+#define	MAXINT	INT_MAX
+#define	MININT	INT_MIN
+/* 
+ * Did we disrupt a spell? 
+ */
+dsrpt_monster(tp, always, see_him)
+register struct thing *tp;
+bool always, see_him;
+{
+    switch (tp->t_action) {
+    case A_SUMMON:
+    case A_MISSILE:
+    case A_SLOW:
+	tp->t_action = A_NIL; /* Just make the old fellow start over again */
+	tp->t_no_move = movement(tp);
+	tp->t_using = NULL;/* Just to be on the safe side */
+	turn_on(*tp, WASDISRUPTED);
+	if (see_him)
+	    msg("%s's spell has been disrupted.",prname(monster_name(tp),TRUE));
+	/*
+	 * maybe choose something else to do next time since player
+	 * is disrupting us
+	 */
+	tp->t_summon *= 2;
+	tp->t_cast /= 2;
+	return;
+    }
+
+    /* We may want to disrupt other actions, too */
+    if (always) {
+	tp->t_action = A_NIL; /* Just make the old fellow start over again */
+	tp->t_no_move = movement(tp);
+	tp->t_using = NULL;/* Just to be on the safe side */
+    }
+}
+
+dsrpt_player()
+{
+    int which, action;
+    struct linked_list *item;
+    struct object *obj;
+    
+    action = player.t_action;
+    which = player.t_selection;
+
+    switch (action) {
+    case C_CAST: /* Did we disrupt a spell? */
+    case C_PRAY:
+    case C_CHANT:
+    {
+	msg("Your %s was disrupted!", action == C_CAST ? "spell" : "prayer");
+
+	/* Charge him anyway */
+	if (action == C_CAST)
+	    spell_power += magic_spells[which].s_cost;
+	else if (action == C_PRAY)
+	    pray_time += cleric_spells[which].s_cost;
+	else if (action == C_CHANT)
+	    chant_time += druid_spells[which].s_cost;
+    }
+    when C_COUNT: /* counting of gold? */
+    {
+	if (purse > 0) {
+	    msg("Your gold goes flying everywhere!");
+	    do {
+		item = spec_item(GOLD, NULL, NULL, NULL);
+		obj = OBJPTR(item);
+		obj->o_count = min(purse, rnd(10)+1);
+		purse -= obj->o_count;
+		obj->o_pos = hero;
+		fall(item, FALSE);
+	    } while (purse > 0 && rnd(10) != 1);
+	}
+    }
+    when C_EAT:
+	msg("You gag on your food for a moment.");
+	del_pack(player.t_using);
+	
+    when A_PICKUP:
+	msg("You drop what you are picking up!");
+
+    when C_SEARCH:	/* searching for traps and secret doors... */
+	msg("Oww....You decide to stop searching.");
+	count = 0;	/* don't search again */
+
+    when C_SETTRAP:
+	msg("Oww....You can't get a trap set.");
+
+    when A_NIL:
+    default:
+	return;
+    }
+    player.t_no_move = movement(&player); /* disoriented for a while */
+    player.t_action = A_NIL;
+    player.t_selection = 0;
+    player.t_using = NULL;
+}
+
+/*
+ * m_act:
+ *	If the critter isn't doing anything, choose an action for it.
+ *	Otherwise, let it perform its chosen action.
+ */
+
+m_act(tp)
+register struct thing *tp;
+{
+    struct object *obj;
+    bool flee;	/* Are we scared? */
+
+    /* What are we planning to do? */
+    switch (tp->t_action) {
+	default:
+	    /* An unknown action! */
+	    msg("Unknown monster action (%d)", tp->t_action);
+
+	    /* Fall through */
+
+	case A_NIL:
+	    /* If the monster is fairly intelligent and about to die, it
+	     * may turn tail and run.  But if we are a FRIENDLY creature
+	     * in the hero's service, don't run.
+	     */
+	    if (off(*tp, ISFLEE)					&&
+		tp->t_stats.s_hpt < tp->maxstats.s_hpt			&&
+		tp->t_stats.s_hpt < max(10, tp->maxstats.s_hpt/6)	&&
+		(off(*tp, ISFRIENDLY) || tp->t_dest != &hero)		&&
+		rnd(25) < tp->t_stats.s_intel) {
+		    turn_on(*tp, ISFLEE);
+
+		    /* It is okay to turn tail */
+		    tp->t_oldpos = tp->t_pos;
+		}
+
+	    /* Should the monster run away? */
+	    flee = on(*tp, ISFLEE) ||
+		((tp->t_dest == &hero) && on(player, ISINWALL) &&
+		 off(*tp, CANINWALL));
+
+	    m_select(tp, flee);	/* Select an action */
+	    return;
+
+	when A_ATTACK:
+	    /* 
+	     * We're trying to attack the player or monster at t_newpos 
+	     * if the prey moved, do nothing
+	     */
+	    obj = tp->t_using ? OBJPTR(tp->t_using) : NULL;
+	    if (ce(tp->t_newpos, hero)) {
+		attack(tp, obj, FALSE);
+	    }
+	    else if (mvwinch(mw, tp->t_newpos.y, tp->t_newpos.x) &&
+		     step_ok(tp->t_newpos.y, tp->t_newpos.x, FIGHTOK, tp)) {
+		skirmish(tp, &tp->t_newpos, obj, FALSE);
+	    }
+
+	when A_SELL:
+	    /* Is the player still next to us? */
+	    if (ce(tp->t_newpos, hero)) sell(tp);
+
+	    /* The darned player moved away */
+	    else if (off(player, ISBLIND) &&
+		cansee(unc(tp->t_pos)) &&
+		(off(*tp, ISINVIS)     || on(player, CANSEE)) &&
+		(off(*tp, ISSHADOW)    || on(player, CANSEE)) &&
+		(off(*tp, CANSURPRISE) || ISWEARING(R_ALERT)))
+		msg("%s grunts with frustration",prname(monster_name(tp),TRUE));
+
+	when A_MOVE:
+	    /* Let's try to move */
+	    do_chase(tp);
+
+	    /* If t_no_move > 0, we found that we have to fight! */
+	    if (tp->t_no_move > 0) return;
+
+	when A_BREATHE:
+	    /* Breathe on the critter */
+	    m_breathe(tp);
+
+	when A_SLOW:
+	    /* make him move slower */
+	    add_slow();
+	    turn_off(*tp, CANSLOW);
+
+	when A_MISSILE:
+	    /* Start up a magic missile spell */
+	    m_spell(tp);
+
+	when A_SONIC:
+	    /* Let out a sonic blast! */
+	    m_sonic(tp);
+
+	when A_THROW:
+	    /* We're throwing something (like an arrow) */
+	    missile(tp->t_newpos.y, tp->t_newpos.x, tp->t_using, tp);
+
+	when A_SUMMON:
+	    /* We're summoning help */
+	    m_summon(tp);
+
+	when A_USERELIC:
+	    /* Use our relic */
+	    m_use_relic(tp);
+
+	when A_USEWAND:
+	    /* use the wand we have */
+	    m_use_wand(tp);
+    }
+
+    /* No action now */
+    tp->t_action = A_NIL;
+    tp->t_using = NULL;
+}
+
+/*
+ * m_breathe:
+ *	Breathe in the chosen direction.
+ */
+
+m_breathe(tp)
+register struct thing *tp;
+{
+    register int damage;
+    register char *breath;
+
+    damage = tp->t_stats.s_hpt;
+    turn_off(*tp, CANSURPRISE);
+
+    /* Will it breathe at random */
+    if (on(*tp, CANBRANDOM)) {
+	/* Turn off random breath */
+	turn_off(*tp, CANBRANDOM);
+
+	/* Select type of breath */
+	switch (rnd(10)) {
+	    case 0: breath = "acid";
+		    turn_on(*tp, NOACID);
+	    when 1: breath = "flame";
+		    turn_on(*tp, NOFIRE);
+	    when 2: breath = "lightning bolt";
+		    turn_on(*tp, NOBOLT);
+	    when 3: breath = "chlorine gas";
+		    turn_on(*tp, NOGAS);
+	    when 4: breath = "ice";
+		    turn_on(*tp, NOCOLD);
+	    when 5: breath = "nerve gas";
+		    turn_on(*tp, NOPARALYZE);
+	    when 6: breath = "sleeping gas";
+		    turn_on(*tp, NOSLEEP);
+	    when 7: breath = "slow gas";
+		    turn_on(*tp, NOSLOW);
+	    when 8: breath = "confusion gas";
+		    turn_on(*tp, ISCLEAR);
+	    when 9: breath = "fear gas";
+		    turn_on(*tp, NOFEAR);
+	}
+    }
+
+    /* Or can it breathe acid? */
+    else if (on(*tp, CANBACID)) {
+	turn_off(*tp, CANBACID);
+	breath = "acid";
+    }
+
+    /* Or can it breathe fire */
+    else if (on(*tp, CANBFIRE)) {
+	turn_off(*tp, CANBFIRE);
+	breath = "flame";
+    }
+
+    /* Or can it breathe electricity? */
+    else if (on(*tp, CANBBOLT)) {
+	turn_off(*tp, CANBBOLT);
+	breath = "lightning bolt";
+    }
+
+    /* Or can it breathe gas? */
+    else if (on(*tp, CANBGAS)) {
+	turn_off(*tp, CANBGAS);
+	breath = "chlorine gas";
+    }
+
+    /* Or can it breathe ice? */
+    else if (on(*tp, CANBICE)) {
+	turn_off(*tp, CANBICE);
+	breath = "ice";
+    }
+
+    else if (on(*tp, CANBPGAS)) {
+	turn_off(*tp, CANBPGAS);
+	breath = "nerve gas";
+    }
+
+    /* can it breathe sleeping gas */
+    else if (on(*tp, CANBSGAS)) {
+	turn_off(*tp, CANBSGAS);
+	breath = "sleeping gas";
+    }
+
+    /* can it breathe slow gas */
+    else if (on(*tp, CANBSLGAS)) {
+	turn_off(*tp, CANBSLGAS);
+	breath = "slow gas";
+    }
+
+    /* can it breathe confusion gas */
+    else if (on(*tp, CANBCGAS)) {
+	turn_off(*tp, CANBCGAS);
+	breath = "confusion gas";
+    }
+
+    /* can it breathe fear gas */
+    else {
+	turn_off(*tp, CANBFGAS);
+	breath = "fear gas";
+    }
+
+    /* Now breathe -- sets "monst_dead" if it kills someone */
+    shoot_bolt(tp, tp->t_pos, tp->t_newpos, FALSE, 
+		    tp->t_index, breath, damage);
+
+    running = FALSE;
+    if (fight_flush) md_flushinp();
+}
+
+/*
+ * m_select:
+ *	Select an action for the monster.
+ */
+
+m_select(th, flee)
+register struct thing *th;
+register bool flee; /* True if running away or player is inaccessible in wall */
+{
+    register struct room *rer, *ree;	/* room of chaser, room of chasee */
+    int dist = MININT;
+    int mindist = MAXINT, maxdist = MININT;
+    bool rundoor;			/* TRUE means run to a door */
+    char sch;
+    coord *last_door=0,			/* Door we just came from */
+	   this;			/* Temporary destination for chaser */
+
+    rer = roomin(&th->t_pos);	/* Find room of chaser */
+    ree = roomin(th->t_dest);	/* Find room of chasee */
+
+    /* First see if we want to use an ability or weapon */
+    if (m_use_it(th, flee, rer, ree)) return;
+
+    /*
+     * We don't count monsters on doors as inside rooms here because when
+     * a monster is in a room and the player is not in that room, the
+     * monster looks for the best door out.  If we counted doors as part
+     * of the room, the monster would already be on the best door out;
+     * so he would never move.
+     */
+    if ((sch = CCHAR( mvwinch(stdscr, th->t_pos.y, th->t_pos.x) )) == DOOR ||
+	sch == SECRETDOOR || sch == PASSAGE) {
+	rer = NULL;
+    }
+    this = *th->t_dest;
+
+    /*
+     * If we are in a room heading for the player and the player is not
+     * in the room with us, we run to the "best" door.
+     * If we are in a room fleeing from the player, then we run to the
+     * "best" door if he IS in the same room.
+     *
+     * Note:  We don't bother with doors in mazes or if we can walk
+     * through walls.
+     */
+    if (rer != NULL && levtype != MAZELEV && off(*th, CANINWALL)) {
+	if (flee) rundoor = (rer == ree);
+	else rundoor = (rer != ree);
+    }
+    else rundoor = FALSE;
+
+    if (rundoor) {
+	register struct linked_list *exitptr;	/* For looping through exits */
+	coord *exit,				/* A particular door */
+	      *entrance;			/* Place just inside doorway */
+	int exity, exitx;			/* Door's coordinates */
+	char dch='\0';				/* Door character */
+
+	if (th->t_doorgoal)
+	    dch = CCHAR( mvwinch(stdscr, th->t_doorgoal->y, th->t_doorgoal->x) );
+	    
+	/* Do we have a valid goal? */
+	if ((dch == PASSAGE || dch == DOOR) &&  /* A real door */
+	    (!flee || !ce(*th->t_doorgoal, *th->t_dest))) { /* Prey should not
+						             * be at door if
+							     * we are running
+							     * away
+							     */
+	    /* Make sure the player is not in the doorway, either */
+	    entrance = doorway(rer, th->t_doorgoal);
+	    if (!flee || entrance == NULL || !ce(*entrance, *th->t_dest)) {
+		this = *th->t_doorgoal;
+		dist = 0;	/* Indicate that we have our door */
+	    }
+	}
+
+	/* Go through all the doors */
+	else for (exitptr = rer->r_exit; exitptr; exitptr = next(exitptr)) {
+	    exit = DOORPTR(exitptr);
+	    exity = exit->y;
+	    exitx = exit->x;
+
+	    /* Make sure it is a real door */
+	    dch = CCHAR( mvwinch(stdscr, exity, exitx) );
+	    if (dch == PASSAGE || dch == DOOR) {
+		/* Don't count a door if we are fleeing from someone and
+		 * he is standing on it.  Also, don't count it if he is
+		 * standing in the doorway.
+		 */
+		if (flee) {
+		    if (ce(*exit, *th->t_dest)) continue;
+
+		    entrance = doorway(rer, exit);
+		    if (entrance != NULL && ce(*entrance, *th->t_dest))
+			continue;
+		}
+		
+		/* Were we just on this door? */
+		if (ce(*exit, th->t_oldpos)) last_door = exit;
+
+		else {
+		    dist = DISTANCE(th->t_dest->y, th->t_dest->x, exity, exitx);
+
+		    /* If fleeing, we want to maximize distance from door to
+		     * what we flee, and minimize distance from door to us.
+		     */
+		    if (flee)
+		       dist -= DISTANCE(th->t_pos.y, th->t_pos.x, exity, exitx);
+
+		    /* Maximize distance if fleeing, otherwise minimize it */
+		    if ((flee && (dist > maxdist)) ||
+			(!flee && (dist < mindist))) {
+			th->t_doorgoal = exit;	/* Use this door */
+			this = *exit;
+			mindist = maxdist = dist;
+		    }
+		}
+	    }
+	}
+
+	/* Could we not find a door? */
+	if (dist == MININT) {
+	    /* If we were on a door, go ahead and use it */
+	    if (last_door) {
+		th->t_doorgoal = last_door;
+		this = th->t_oldpos;
+		dist = 0;	/* Indicate that we found a door */
+	    }
+	    else th->t_doorgoal = NULL;	/* No more door goal */
+	}
+
+	/* Indicate that we do not want to flee from the door */
+	if (dist != MININT) flee = FALSE;
+    }
+    else th->t_doorgoal = 0;	/* Not going to any door */
+
+    /* Now select someplace to go and start the action */
+    chase(th, &this, rer, ree, flee);
+}
+
+/*
+ * m_sonic:
+ *	The monster is sounding a sonic blast.
+ */
+
+m_sonic(tp)
+register struct thing *tp;
+{
+    register int damage;
+    static struct object blast =
+    {
+	MISSILE, {0, 0}, "", 0, "", "150" , NULL, 0, 0, 0, 0
+    };
+
+    turn_off(*tp, CANSONIC);
+    turn_off(*tp, CANSURPRISE);
+    do_motion(&blast, tp->t_newpos.y, tp->t_newpos.x, tp);
+    damage = 150;
+    if (save(VS_BREATH, &player, -3))
+	damage /= 2;
+    msg ("%s's sonic blast hits you", prname(monster_name(tp), TRUE));
+    if ((pstats.s_hpt -= damage) <= 0)
+	death(tp->t_index);
+
+    running = FALSE;
+    if (fight_flush) md_flushinp();
+    dsrpt_player();
+}
+
+/*
+ * m_spell:
+ *	The monster casts a spell.  Currently this is limited to
+ *	magic missile.
+ */
+m_spell(tp)
+register struct thing *tp;
+{
+    static struct object missile =
+    {
+	MISSILE, {0, 0}, "", 0, "", "0d4 " , NULL, 0, WS_MISSILE, 100, 1
+    };
+
+    sprintf(missile.o_hurldmg, "%dd4", tp->t_stats.s_lvl);
+    do_motion(&missile, tp->t_newpos.y, tp->t_newpos.x, tp);
+    hit_monster(unc(missile.o_pos), &missile, tp);
+    turn_off(*tp, CANMISSILE);
+    turn_off(*tp, CANSURPRISE);
+
+    running = FALSE;
+    if (fight_flush) md_flushinp();
+}
+
+/*
+ * m_summon:
+ *	Summon aid.
+ */
+
+m_summon(tp)
+register struct thing *tp;
+{
+    register char *helpname, *mname;
+    int fail, numsum;
+    register int which, i;
+
+    /* Let's make sure our prey is still here */
+    if (!cansee(unc(tp->t_pos)) || fallpos(&hero, FALSE, 2) == NULL) return;
+
+    /*
+     * Non-uniques can only summon once.  Uniques get fewer
+     * creatures with each successive summoning. Also, the
+     * probability of summoning goes down
+     */
+    if (off(*tp, ISUNIQUE))
+	    turn_off(*tp, CANSUMMON);
+
+    turn_off(*tp, CANSURPRISE);
+    mname = monster_name(tp);
+    helpname = monsters[tp->t_index].m_typesum;
+    which = findmindex(helpname);
+
+    if ((off(*tp, ISINVIS)     || on(player, CANSEE)) &&
+	(off(*tp, ISSHADOW)    || on(player, CANSEE)) &&
+	(off(*tp, CANSURPRISE) || ISWEARING(R_ALERT))) {
+	if (monsters[which].m_normal == FALSE) { /* genocided? */
+	    msg("%s appears dismayed", prname(mname, TRUE));
+	    monsters[tp->t_index].m_numsum = 0;
+	}
+	else {
+	    msg("%s summons %ss for help", prname(mname, TRUE), helpname);
+	}
+    }
+    else {
+	if (monsters[which].m_normal == FALSE) /* genocided? */
+	    monsters[tp->t_index].m_numsum = 0;
+	else {
+	    msg("%ss seem to appear from nowhere!", helpname);
+	}
+    }
+    numsum = monsters[tp->t_index].m_numsum;
+    if (numsum && on(*tp, ISUNIQUE)) {   /* UNIQUEs summon less each time */
+	monsters[tp->t_index].m_numsum--; 
+	tp->t_summon *= 2; /* cut probability in half */
+    }
+
+    /*
+     * try to make all the creatures around player but remember
+     * if unsuccessful
+     */
+    for (i=0, fail=0; i<numsum; i++) {
+	 if (!creat_mons(&player, which, FALSE))
+	     fail++;	/* remember the failures */
+    }
+
+    /*
+     * try once again to make the buggers
+     */
+    for (i=0; i<fail; i++)
+	 creat_mons(tp, which, FALSE);
+    
+    /* Now let the poor fellow see all the trouble */
+    light(&hero);
+    turn_on(*tp, HASSUMMONED);
+}
+
+/*
+ * m_use_it:
+ *	See if the monster (tp) has anything useful it can do
+ *	(ie. an ability or a weapon) other than just move.
+ */
+
+bool
+m_use_it(tp, flee, rer, ree)
+register struct thing *tp;
+bool flee;
+register struct room *rer, *ree;
+{
+    int dist;
+    register coord *ee = tp->t_dest, *er = &tp->t_pos; 
+    coord *shoot_dir;
+    struct linked_list *weapon;
+    struct thing *prey;
+    bool dest_player;	/* Are we after the player? */
+
+    /*
+     * If we are fleeing, there's a chance, depending on our
+     * intelligence, that we'll just run in terror.
+     */
+    if (flee && rnd(25) >= tp->t_stats.s_intel) return(FALSE);
+
+    /*
+     * Make sure that we have a living destination, and record whether
+     * it is the player.
+     */
+    if (ee != NULL) {
+        if (ce(*ee, hero)) {
+	    dest_player = TRUE;
+	    prey = &player;
+	}
+	else {
+	    struct linked_list *item;
+
+	    dest_player = FALSE;
+
+	    /* What is the monster we're chasing? */
+	    item = find_mons(ee->y, ee->x);
+	    if (item != NULL) prey = THINGPTR(item);
+	    else return(FALSE);
+	}
+    }
+    else return(FALSE);
+
+    /*
+     * If we are friendly to the hero, we don't do anything.
+     */
+    if (on(*tp, ISFRIENDLY) && dest_player) return(FALSE);
+
+    /*
+     * Also, for now, if our prey is in a wall, we won't do
+     * anything.  The prey must be in the same room as we are OR
+     * we must have a straight shot at him.  Note that
+     * shoot_dir must get set before rer is checked so
+     * that we get a valid value.
+     */
+    if (on(*prey, ISINWALL) ||
+	((shoot_dir = can_shoot(er, ee)) == NULL &&
+	(rer == NULL || rer != ree)))
+	return(FALSE);
+
+    /*
+     * If we can't see the prey then forget it
+     */
+    if (on(*prey, ISINVIS) && off(*tp, CANSEE))
+	return(FALSE);
+
+    /* How far are we from our prey? */
+    dist = DISTANCE(er->y, er->x, ee->y, ee->x);
+
+    /* 
+     * Shall we summon aid so we don't have to get our hands dirty? 
+     * For now, we will only summon aid against the player.
+     * We'll wait until he's within 2 dots of a missile length.
+     */
+    if (on(*tp, CANSUMMON) && dest_player 			&&
+	dist < (BOLT_LENGTH+2)*(BOLT_LENGTH+2)			&&
+	rnd(tp->t_summon) < tp->t_stats.s_lvl			&&
+	monsters[tp->t_index].m_numsum > 0			&&
+	fallpos(&hero, FALSE, 2) != NULL) {
+	tp->t_action = A_SUMMON;	/* We're going to summon help */
+	tp->t_no_move = movement(tp); /* It takes time! */
+	return(TRUE);
+    }
+
+    /*
+     * If the creature can cast a slow spell and if the prey is within
+     * 2 dots of a missile fire, then see whether we will cast it.
+     * if next to player, lessen chance because we don't like being
+     * disrupted
+     */
+    if (on(*tp, CANSLOW) && dest_player			&& 
+	dist < (BOLT_LENGTH+5)*(BOLT_LENGTH+5)		&&
+	rnd(100) < (dist > 3 ? tp->t_cast : tp->t_cast/2)) {
+	    tp->t_action = A_SLOW;		/* We're going to slow him */
+	    tp->t_no_move = 3 * movement(tp);	/* Takes time! */
+	    debug("casting slow spell!");
+	    return(TRUE);
+    }
+
+    /*
+     * If we have a special magic item, we might use it.  We will restrict
+     * this options to uniques with relics and creatures with wands for now.  
+     * Also check for the quartermaster. Don't want him shooting wands....
+     */
+    if ((on(*tp, ISUNIQUE) || on(*tp, CARRYSTICK)) && 
+	off(*tp, CANSELL) && dest_player	   &&
+	m_use_pack(tp, er, ee, dist, shoot_dir)) {
+	    return(TRUE);
+    }
+
+    /* From now on, we must have a direct shot at the prey */
+    if (shoot_dir == NULL) return(FALSE);
+
+    /* We may use a sonic blast if we can, only on the player */
+    if (on(*tp, CANSONIC)		&& 
+	dest_player			&&
+	(dist < BOLT_LENGTH*2)		&&
+	(rnd(100) < tp->t_breathe)) {
+	tp->t_newpos = *shoot_dir;	/* Save the direction */
+	tp->t_action = A_SONIC;	/* We're going to sonic blast */
+	tp->t_no_move = 2 * movement(tp); /* Takes 2 movement periods */
+    }
+
+    /* If we can breathe, we may do so */
+    else if (on(*tp, CANBREATHE)		&&
+	 (dist < BOLT_LENGTH*BOLT_LENGTH)	&&
+	 (rnd(100) < tp->t_breathe)) {
+	    tp->t_newpos = *shoot_dir;	/* Save the direction */
+	    tp->t_action = A_BREATHE;	/* We're going to breathe */
+	    tp->t_no_move = movement(tp); /* It takes 1 movement period */
+    }
+
+    /* 
+     * We may shoot missiles if we can 
+     * if next to player, lessen chance so we don't get disrupted as often
+     */
+    else if (on(*tp,CANMISSILE) && 
+	     rnd(100) < (dist > 3 ? tp->t_cast : tp->t_cast/2)){
+	    tp->t_newpos = *shoot_dir;	/* Save the direction */
+	    tp->t_action = A_MISSILE;	/* We're going to shoot MM's */
+	    tp->t_no_move = 3 * movement(tp); /* Takes time! */
+    }
+
+    /* 
+     * If we can shoot or throw something, we might do so.
+     * If next to player, then forget it
+     */
+    else if ((on(*tp,CANSHOOT)		|| on(*tp,CARRYWEAPON) || 
+	      on(*tp,CARRYDAGGER)	|| on(*tp, CARRYAXE))		&&
+	      dist > 3							&&
+	      off(*tp, CANSELL)						&&
+	     (weapon = get_hurl(tp))) {
+	    tp->t_newpos = *shoot_dir;	/* Save the direction */
+	    tp->t_action = A_THROW;	/* We're going to throw something */
+	    tp->t_using = weapon;	/* Save our weapon */
+	    tp->t_no_move = 2 * movement(tp); /* Takes 2 movement periods */
+    }
+    
+    /* We couldn't find anything to do */
+    else return(FALSE);
+
+    return(TRUE);
+
+}
+
+/*
+ * runners:
+ *	Make all the awake monsters try to do something.
+ */
+
+runners(segments)
+int segments;    /* Number of segments since last called */
+{
+    register struct linked_list *item;
+    register struct thing *tp;
+    register min_time = 20;	/* Minimum time until a monster can act */
+
+    /*
+     * loop thru the list of running (wandering) monsters and see what
+     * each one will do this time. 
+     *
+     * Note: the special case that one of this buggers kills another.
+     *	     if this happens than we have to see if the monster killed
+     *	     himself or someone else. In case its himself we have to get next
+     *	     one immediately. If it wasn't we have to get next one at very
+     *	     end in case he killed the next one.
+     */
+
+    for (item = mlist; item != NULL; item = next(item))	{
+	tp = THINGPTR(item);
+	turn_on(*tp, ISREADY);
+    }
+
+    for (;;) {
+
+	for (item = mlist; item != NULL; item = next(item)) {
+	    tp = THINGPTR(item);
+
+	    if (on(*tp, ISREADY))
+		break;
+	}
+
+	if (item == NULL)
+	    break;
+
+	turn_off(*tp, ISREADY);
+
+	/* If we are not awake, just skip us */
+	if (off(*tp, ISRUN) && off(*tp, ISHELD)) continue;
+
+	/* See if it's our turn */
+	tp->t_no_move -= segments;
+	if (tp->t_no_move > 0) {
+	    if (tp->t_no_move < min_time) min_time = tp->t_no_move;
+	    continue;
+	}
+
+	/* If we were frozen, we're moving now */
+	if (tp->t_action == A_FREEZE) tp->t_action = A_NIL;
+
+	if (on(*tp, ISHELD)) {
+	    /* Make sure the action and using are nil */
+	    tp->t_action = A_NIL;
+	    tp->t_using = NULL;
+
+	    /* Can we break free? */
+	    if (rnd(tp->t_stats.s_lvl) > 11) {
+		turn_off(*tp, ISHELD);
+		runto(tp, &hero);
+		if (cansee(tp->t_pos.y, tp->t_pos.x))
+		    msg("%s breaks free from the hold spell", 
+			prname(monster_name(tp), TRUE));
+	    }
+
+	    /* Too bad -- try again later */
+	    else tp->t_no_move = movement(tp);
+	}
+
+	/* Heal the creature if it's not in the middle of some action */
+	if (tp->t_action == A_NIL) doctor(tp);
+
+	while (off(*tp,ISELSEWHERE) &&
+	    off(*tp,ISDEAD) &&
+	       tp->t_no_move <= 0 && off(*tp, ISHELD) && on(*tp, ISRUN)) {
+	    /* Let's act (or choose an action if t_action = A_NIL) */
+	    m_act(tp);
+	}
+
+	if (off(*tp,ISELSEWHERE) && off(*tp,ISDEAD)) {
+	    if (tp->t_no_move < min_time) min_time = tp->t_no_move;
+	    if (tp->t_quiet < 0) tp->t_quiet = 0;
+	}
+    }
+    return(min_time);
+}
+
+/*
+ * See if a monster has some magic it can use.  Return TRUE if so.
+ * Only care about relics and wands for now.
+ */
+bool
+m_use_pack(monster, monst_pos, defend_pos, dist, shoot_dir)
+register struct thing *monster;
+register coord *monst_pos, *defend_pos;
+register int dist;
+register coord *shoot_dir;
+{
+    register struct object *obj;
+    register struct linked_list *pitem, *relic, *stick;
+    register int units = -1;
+
+    relic = stick = NULL;
+
+    for (pitem=monster->t_pack; pitem; pitem=next(pitem)) {
+	obj = OBJPTR(pitem);
+	if (obj->o_flags & ISCURSED) continue;
+	if (obj->o_type == RELIC) {
+	    switch (obj->o_which) {
+		case MING_STAFF:
+		    if (shoot_dir != NULL) {
+			units = 2;	/* Use 2 time units */
+			relic = pitem;
+		    }
+
+		when EMORI_CLOAK:
+		    if (obj->o_charges != 0	&& 
+			shoot_dir != NULL) {
+			    units = 2;	/* Use 2 time units */
+			    relic = pitem;
+		    }
+
+		when ASMO_ROD:
+		    /* The bolt must be able to reach the defendant */
+		    if (shoot_dir != NULL			&& 
+			dist < BOLT_LENGTH * BOLT_LENGTH) {
+			units = 2;	/* Use 2 time units */
+			relic = pitem;
+		    }
+
+		when BRIAN_MANDOLIN:
+		    /* The defendant must be the player and within 4 spaces */
+		    if (ce(*defend_pos, hero)		&& 
+			dist < 25			&&
+			player.t_action != A_FREEZE) {
+			units = 4;
+			relic = pitem;
+		    }
+
+		when GERYON_HORN:
+		    /* The defendant must be the player and within 5 spaces */
+		    if (ce(*defend_pos, hero)				     &&
+			dist < 25					     &&
+			(off(player,ISFLEE)|| player.t_dest!=&monster->t_pos)) {
+			units = 3;
+			relic = pitem;
+		    }
+	    }
+	}
+	if (obj->o_type == STICK) {
+	    if (obj->o_charges < 1) continue;
+	    switch(obj->o_which) {
+		case WS_ELECT:
+		case WS_FIRE:
+		case WS_COLD:
+		    /* The bolt must be able to reach the defendant */
+		    if (shoot_dir != NULL			&& 
+			dist < BOLT_LENGTH * BOLT_LENGTH) {
+			    units = 3;
+			    stick = pitem;
+		    }
+
+		when WS_MISSILE:
+		case WS_SLOW_M:
+		case WS_CONFMON:
+		case WS_PARALYZE:
+		case WS_MDEG:
+		case WS_FEAR:
+		    if (shoot_dir != NULL) {
+			units = 3;
+			stick = pitem;
+		    }
+		
+		otherwise:
+		    break;
+	    }
+	}
+    }
+
+    /* use relics in preference to all others */
+    if (relic) debug("chance to use relic = %d%%", monster->t_artifact);
+    if (stick) debug("chance to use stick = %d%%", monster->t_wand);
+    if (relic && rnd(100) < monster->t_artifact)  {
+	monster->t_action = A_USERELIC;
+	pitem = relic;
+    }
+    else if (stick && rnd(100) < monster->t_wand) {
+	/*
+	 * see if the monster will use the wand 
+	 */
+	pitem = stick;
+	monster->t_action = A_USEWAND;
+    }
+    else {
+	return(FALSE);
+    }
+
+    monster->t_no_move = units * movement(monster);
+    monster->t_using = pitem;
+    monster->t_newpos = *shoot_dir;
+    return(TRUE);
+}
diff -r d10fc4a065ac -r adfa37e67084 arogue7/aguide.mm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arogue7/aguide.mm	Fri May 08 15:24:40 2015 -0400
@@ -0,0 +1,799 @@
+.\"
+.\" aguide.mm
+.\"
+.\" Advanced Rogue
+.\" Copyright (C) 1984, 1985, 1986 Michael Morgan, Ken Dalka and AT&T
+.\" All rights reserved.
+.\"
+.\" Based on "Rogue: Exploring the Dungeons of Doom"
+.\" Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
+.\" All rights reserved.
+.\"
+.\" See the file LICENSE.TXT for full copyright and licensing information.
+.\"
+.tr ~
+.nr Pt 1
+.ds HF 3 2 2 2 2 2 2
+.TL
+The Dungeons of Doom
+.AF Toolchest
+.AU " "
+.AS 1
+.P
+Rogue was introduced at the University of California at Berkeley as a
+screen-oriented fantasy game.
+The game had 26 types of monsters that the player could meet while
+exploring a dungeon generated by the computer.
+Scrolls, potions, rings, wands, staves, armor, and weapons helped the
+player to battle these monsters and to gain gold, the basis for scoring.
+.P
+The version of Rogue described in this guide has been expanded to include
+over 110 monsters with many new capabilities.
+Many of the monsters are intelligent, and they, like the player, must avoid
+traps and decide when it is better to fight or to run.
+The player chooses a character class at the beginning of the game which
+defines the player's abilities.
+Experience, rather than gold, decides the player's score.
+.AE
+.MT 4
+.H 1 INTRODUCTION
+Rogue is a screen-oriented fantasy game set in the ever-changing
+\fIDungeons of Doom\fR.
+The game comes complete with monsters, spells, weapons, armor, potions,
+and other magical items.
+The dungeon's geography changes with every game, and although many magical
+items have certain identifiable properties, such as turning the player
+invisible, the physical manifestation of the magic changes each game.
+A red potion, for example, will cause the same reaction throughout
+a given game, but it may be a completely different potion in a new game.
+.P
+Entering the dungeon with only a little food, armor, and a weapon, the player
+must develop a good strategy of when
+to fight, when to run, and how to best use any magical items found
+in the dungeon.
+To make things interesting, the player has a quest to return one of
+several unique artifacts, rumored to lie deep in the dungeon's bowels.
+Returning with this artifact brings great glory and the title of
+\fIComplete Winner\fR.
+But even after finding the artifact, the player may wish to continue
+further to match wits with an \fIarch-devil\fR, \fIdemon prince\fR, or even a 
+\fIdeity\fR found far down in the dungeon.
+Defeating such a creature will gain the player many experience points,
+the basis for scoring in Rogue.
+.P
+It is very difficult to return from the \fIDungeons of Doom\fR.
+Few people ever make it out alive.
+Should this unlikely event occur, the player would be proclaimed a
+complete winner and handsomely rewarded for any booty removed from the
+dungeon.
+.H 1 "CHARACTER CLASSES"
+Before placing the player in the dungeon, the game requests the player
+to select what type of character they would like to be:~ a fighter, a magic user, a cleric, 
+a druid, a thief, a paladin, a ranger, a monk, or an assassin.
+.H 2 "The Fighter"
+A fighter is very strong and will have a high strength rating.
+This great strength gives a fighter the best odds of
+winning a battle with a monster.
+At high experience levels the \fIfighter\fR also gets to attack
+multiple times in a single turn.
+This obviously further increases his chances at winning battles.
+Intrinsic to the fighter class is a robustness which results in
+1 to 12 extra hit points for every new experience
+level.
+.H 2 "The Magician"
+A Magician is able to "cast" spells.
+The number and variety of spells increases as
+the magician gains experience and intelligence.
+Magic users are not as hearty as fighters;
+they receive 1 to 6 extra hit
+points for every new experience level.
+.H 2 "The Cleric"
+A cleric is able to "pray" to his god for help.
+The number and variety of prayers which the gods are willing to grant to
+a cleric increase as the cleric gains experience and wisdom.
+.P
+Because of their religious nature, clerics can also affect the "undead"
+beings, like \fIzombies\fR and \fIghouls\fR, which became monsters after they
+died.
+If an "undead" creature is next to a cleric, the cleric may try
+to turn it and cause it to flee.
+If the cleric is sufficiently powerful relative to the monster,
+the cleric will destroy it.
+This ability increases as the character gains experience levels.
+.P
+Clerics can gain from 1 to 8 extra hit points on
+reaching a new experience level.
+.H 2 "The Druid"
+The druid is a cleric of sorts but worships nature rather than a god.
+The druid is able to "chant" and thereby recieve certain types
+of spells. Most of the chants are targeted more towards the
+elements and nature.
+.P
+Druids gain from 1 to 8 hit points when they gain an experience level.
+.H 2 "The Thief"
+A thief is exceptionally dextrous and has a good chance to
+set a trap or rob a monster.
+.P
+By their nature, thieves can automatically detect all the gold on the
+current level of the dungeon.
+They are also good at detecting hidden traps.
+Because thieves slink along, they are not as likely as other characters
+to wake sleeping monsters.
+If a \fIthief\fR manages to sneak up on a creature without waking it, he
+will get a chance to \fIbackstab\fR the monster. When this is done,
+the damage done by the \fIthief\fR greatly increases based on his experience
+level.
+.P
+Thieves gain from 1 to 6 extra hit points from a new experience level.
+.H 2 "The Paladin"
+The paladin is a type of holy warrior. Somewhat of a cross between a 
+fighter and a cleric. He is able to pray and turn undead as a cleric,
+(but to a lesser degree) but fights as a fighter. He is on the side of
+all that is good and righteous. Therefore he would never attack a 
+creature that would not attack him first. If he does kill a non-violent
+creature inadvertantly he will feel "uneasy" and his god may retaliate
+by making him a mere fighter.
+.P
+Paladins gain 1 to 10 hit points per experience level.
+.H 2 "The Ranger"
+The ranger is somewhat of a cross between a druid and a fighter. He
+too is on the side of righteousness and good. Therefore, the same
+same restrictions apply to his as they do to a paladin. The ranger
+can "chant" and "cast" but to a lesser degree than the druid and
+magician.
+.P
+Rangers gain 1 to 8 hit points per experience level.
+.H 2 "The Monk"
+The Monk is a martial arts expert. He wears no armor but has
+an effective armor class based on his ability to dodge attacks.
+He does not need a weapon in combat for his hands and feet are
+a formidable weapon. His ability to dodge and use his hands
+as weapons increases as he gains in level. 
+.P
+Monks gain 1 to 6 hit points per experience level.
+.H 2 "The Assassin"
+The assassin is a person trained in the art of killing people
+by surprise. He has most of the abilities of the thief except
+the "backstab". Instead, the assassin has the chance to kill
+an opponent outright with one strike. He is also a ruthless
+character and trained in the use of poison. He can recognize
+poison on sight and can coat his weapon with it thereby making
+his next attack an exceptionally lethal one.
+.P
+Assassins gain 1 to 6 hit points per experience level.
+.H 1 "ATTRIBUTES"
+.H 2 "Intelligence"
+Intelligence is the primary attribute associated with casting
+spells. With higher intelligence comes the knowledge of more
+spells, the ability to cast more spells, and faster recovery
+of spells that have been cast.
+.H 2 "Strength"
+This is, of course, the measure of a character's physical strength.
+With higher strength a character can carry more, cause more damage
+when striking, have a better chance to strike an opponent, and
+move about more quickly when carrying a load.
+.H 2 "Wisdom"
+Wisdom is the primary attribute associated with Praying
+to a god. With higher wisdom comes the knowledge of more
+prayers, the ability to pray more often, and faster recovery
+of prayer ability.
+.H 2 "Dexterity"
+Dexterity is a measure of a character's agility. With higher dexterity
+a character is harder to hit, can hit a opponent more easily, and
+can move about more quickly when carrying a load.
+.H 2 Constitution
+Every character has a constitution rating.
+A character with an exceptionally good constitution will gain more than
+the normal amount of hit points associated with the character's class
+when the character reaches a new experience level. Exceptional constitution
+also provides better protection versus poison-based attacks and diseases.
+.H 2 "Charisma"
+Charisma is a measure of a characters looks and general likeableness.
+It effects transactions when trying to purchase things.
+.H 2 "Experience Levels"
+Characters gain experience for killing monsters, stealing from monsters,
+and turning monsters.
+Each character class has a set of thresholds associated with it.
+When a character reaches a threshold, the character attains the next
+experience level.
+This new level brings extra hit points and a greater chance of success
+in performing the abilities associated with the character's class.
+For example, magicians receive new spells, and clerics receive new prayers.
+.P
+.H 2 "Allocating Attributes"
+The player starts with 72 "attribute points" to create a character and
+can distribute them in any manner among the six attributes described
+above.
+When prompting the player for each attribute, the game displays the
+minimum and maximum allowable values for that attribute.
+The player can type a backspace (control-H) to go back and change
+a value; typing an escape (ESC) sets the remaining attributes to
+the maximum value possible given the remaining attribute points.
+.H 1 "THE SCREEN"
+During the normal course of play, the screen consists of three separate
+sections:~ the top line of the terminal, the bottom two lines of the
+terminal, and the remaining middle lines.
+The top line reports actions which occur during the game, the middle
+section depicts the dungeon, and the bottom lines describe the player's
+current condition.
+.H 2 "The Top Line"
+Whenever anything happens to the player, such as finding a scroll or
+hitting or being hit by a monster, a short report of the occurrence
+appears on the top line of the screen.
+When such reports occur quickly, one right after another,
+the game displays the notice followed by the prompt '\(emMore\(em.'~
+After reading this notice, the player can press a space to display
+the next message.
+At such a point, the game ignores all commands until the player presses
+a space.
+.H 2 "The Dungeon Section"
+The large middle section of the screen displays the player's surroundings using
+the following symbols:
+.tr ~~
+.VL 10
+.LI |
+A wall of a room.
+.LI -
+A wall of a room.
+.LI *
+A pile of gold.
+.LI %
+A way to the next level.
+.LI +
+A doorway.
+.LI .
+The floor in a room.
+.LI @
+The player.
+.LI _
+The player, when invisible.
+.LI #
+The floor in a passageway.
+.LI !
+A flask containing a potion.
+.LI ?
+A sealed scroll.
+.LI :
+Some food.
+.LI )
+A weapon.
+.LI \ 
+Solid rock (denoted by a space).
+.LI ]
+Some armor.
+.LI ;
+A miscellaneous magic item
+.LI ,
+An artifact
+.LI =
+A ring.
+.LI /
+A wand or a staff.
+.LI ^
+The entrance to a trading post
+.LI >
+A trapdoor leading to the next level
+.LI {
+An arrow trap
+.LI $
+A sleeping gas trap
+.LI }
+A beartrap
+.LI ~
+A trap that teleports you somewhere else
+.LI \`
+A poison dart trap
+.LI \fR"\fR
+A shimmering magic pool
+.LI \'
+An entrance to a maze
+.LI $
+Any magical item. (During magic detection)
+.LI >
+A blessed magical item. (During magic detection)
+.LI <
+A cursed magical item. (During magic detection)
+.LI A\ letter
+A monster.
+Note that a given letter may signify multiple monsters,
+depending on the level of the dungeon.
+The player can always identify a current monster by using
+the identify command ('\fB/\fR').
+.LE
+.tr ~
+.H 2 "The Status Section"
+The bottom two lines of the screen describe the player's current status.
+The first line gives the player's characteristics:
+.BL
+.LI
+Intelligence (\fBInt\fR)
+.LI
+Strength (\fBStr\fR)
+.LI
+Wisdom (\fBWis\fR)
+.LI
+Dexterity (\fBDxt\fR)
+.LI
+Constitution (\fBConst\fR)
+.LI
+Charisma (\fBChar\fR)
+.LI
+Encumberance (\fBCarry\fR)
+.LE
+.P
+Intelligence, strength, wisdom, dexterity, charisma, and constitution have a 
+normal maximum of 25, but can be higher when augmented by a ring.
+Encumberance is a measurement of how much the player can carry versus
+how much he is currently carrying. The more you carry relative to your
+maximum causes you to use more food.
+.P
+The second status line provides the following information:
+.BL
+.LI
+The current level (\fBLvl\fR) in the dungeon.  This number increases as the
+player goes further down.
+.LI
+The player's current number of hit points (\fBHp\fR), followed in parentheses
+by the player's current maximum number of hit points.
+Hit points express the player's health.
+As a player heals by resting, the player's current hit points gradually
+increase until reaching the current maximum.
+This maximum increases each time a player attains a new experience level.
+If the player's current hit points reach 0, the player dies.
+.LI
+The player's armor class (\fBAc\fR).
+This number describes the amount of protection provided by the armor, cloaks, 
+and/or rings currently worn by the player. 
+It is also affected by high or low dexterity.
+Wearing no armor is equivalent to an armor class of 10.
+The protection level increases as the armor class decreases.
+.LI
+The player's current experience level (\fBExp\fR) followed by the player's
+experience points.
+The player can gain experience points by killing monsters, successfully
+stealing from monsters, and turning monsters.
+When a player gains enough experience points to surpass a threshold that
+depends on the player's character type, the player reaches a new
+experience level.
+A new experience level brings extra hit points and possibly added
+abilities, such as a new spell for a magician or a new prayer for
+a cleric.
+.LI
+A description of the player's character.
+This description depends on the player's character type and experience
+level.
+.LE
+.H 1 COMMANDS
+A player can invoke most Rogue commands by typing a single character.
+Some commands, however, require a direction, in which case the player
+types the command character followed by a directional command.
+Many commands can be prefaced by a number, indicating how many times
+the command should be executed.
+.P
+When the player invokes a command referring to an item in the player's
+pack (such as reading a scroll), the game prompts for the item.
+The player should then type the letter associated with the item, as
+displayed by the \fBinventory\fR command.
+Typing a '*' at this point produces a list of the eligible items.
+.P
+Rogue understands the following commands:~
+.VL 4
+.LI ?
+Preceding a command by a '\fB?\fR' produces a brief explanation of the command.
+The command '\fB?*\fR' gives an explanation of all the commands.
+.LI /
+Preceding a symbol by a '\fB/\fR' identifies the symbol.
+.LI =
+Clarify.
+After typing an '\fB=\fR' sign, the player can use the movement keys to
+position the cursor anywhere on the current level.
+As long as the player can normally see the selected position, Rogue will
+identify whatever is at that space.
+Examples include a \fIsleeping giant rat\fR, a \fIblue potion\fR, and a \fIfood
+ration\fR.
+.LI h
+Move one position to the left.
+.LI j
+Move one position down.
+.LI k
+Move one position up.
+.LI l
+Move one position to the right.
+.LI y
+Move one position to the top left.
+.LI u
+Move one position to the top right.
+.LI b
+Move one position to the bottom left.
+.LI n
+Move one position to the bottom right.
+.LI H
+Run to the left until reaching something interesting.
+.LI J
+Run down until reaching something interesting.
+.LI K
+Run up until reaching something interesting.
+.LI L
+Run to the right until reaching something interesting.
+.LI Y
+Run to the top left until reaching something interesting.
+.LI U
+Run to the top right until reaching something interesting.
+.LI B
+Run to the bottom left until reaching something interesting.
+.LI N
+Run to the bottom right until reaching something interesting.
+.LI t
+This command prompts for an object from the players pack.
+The player then \fBt\fRhrows the object in the specified direction.
+.LI f
+When this command precedes a directional command, the player moves
+in the specified direction until passing something interesting.
+.LI z
+This command prompts for a wand or staff from the player's pack and
+\fBz\fRaps it in the specified direction.
+.LI >
+Go down to the next level.
+.LI <
+Go up to the next level.
+.LI s
+\fBS\fRearch for a secret door or a trap in the circle surrounding the player.
+.LI .
+This command (a dot) causes the player to rest a turn.
+.LI i
+Display an \fBi\fRnventory of the player's pack.
+.LI I
+This command prompts for an item from the player's pack and displays
+the \fBi\fRnventory information for that item.
+.LI q
+\fBQ\fRuaff a potion from the player's pack.
+.LI r
+\fBR\fRead a scroll from the player's pack.
+.LI e
+\fBE\fRat some food from the player's pack.
+.LI w
+\fBW\fRield a weapon from the player's pack.
+.LI W
+\fBW\fRear some armor, ring, or miscellaneous magic item from the player's pack.
+The player can wear a maximum of eight rings.
+.LI T
+\fBT\fRake off whatever the player is wearing.
+.LI ^U
+\fBU\fRse a magic item in the player's pack.
+.LI d
+\fBD\fRrop an item from the player's pack.
+.LI P
+\fBP\fRick up the items currently under the player.
+.LI ^N
+When the player types this command, Rogue prompts for a monster or an item
+from the player's pack and a one-line \fBn\fRame.
+For monsters, the player can use the movement keys to position the cursor
+over the desired monster, and Rogue will use the given \fBn\fRame to refer
+to that monster.
+For items, Rogue gives all similar items (such as all the blue potions)
+the specified \fBn\fRame.
+.LI m
+When the player types this command, Rogue prompts for an item from the
+player's pack and a one-line name.
+Rogue then \fBm\fRarks the specified item with the given name.
+.LI o
+Typing this command causes Rogue to display all the settable \fBo\fRptions.
+The player can then merely examine the options or change any or all of them.
+.LI C
+This command, restricted to magicians and rangers
+produces a listing of the current supply of spells.
+The player can select one of the displayed spells and, if the player's
+energy level is sufficiently high, \fBC\fRast it.
+The more complicated the spell, the more energy it takes.
+.LI c
+This command, restricted to druids and rangers
+produces a listing of the current supply of chants.
+The player can select one of the displayed chants and, if the player's
+energy level is sufficiently high, \fBc\fRhant it.
+The more complicated the spell, the more energy it takes.
+.LI p
+This command, restricted to clerics and paladins,
+produces a listing of the character's known \fBp\fRrayers.
+The player can then offer one of these prayers to the character's deity.
+Deities are not known for favoring characters which continually pray
+to them, and they are most likely to answer the least "ambitious" prayers.
+.LI a
+This command is restricted to clerics and paladins
+must be followed by a directional command.
+If there is an "undead" monster standing next to the player in the
+specified direction, there is a chance the player will \fBa\fRffect the
+monster by causing it to flee or possibly even destroying it.
+.LI *
+Count the gold in the player's pack.
+.LI ^
+This command sets a trap and is limited to thieves and assassins.
+If the character is successful, Rogue prompts the player for a type of trap
+and sets it where the player is standing.
+.LI G
+This command is restricted to thieves and assassins.
+It causes Rogue to display all the gold on the current level.
+.LI D
+\fBD\fRip something into a magic pool.
+.LI ^T
+This command is restricted to thieves and assassins.
+It must be followed by a directional command.
+If there is a monster standing next to the player in the specified direction,
+the player tries to \fBs\fRteal an item from the monster's pack.
+If the player is successful, the monster does not notice anything, but if
+the player is unsuccessful, there is a chance the monster will wake up.
+.LI ^L
+Redraw the screen.
+.LI ^R
+\fBR\fRepeat the last message that was displayed on the top line of the screen.
+.LI ^[
+Typing an escape will usually cause Rogue to cancel the current command.
+.LI v
+Print the current Rogue \fBv\fRersion number.
+.LI !
+Escape to the shell.
+.LI S
+Quit and \fBs\fRave the game for resumption at a later time.
+.LI Q
+\fBQ\fRuit without saving the game.
+.LE
+.H 1 "IMPLICIT COMMANDS"
+There is no "attack" command.
+If a player wishes to attack a monster, the player simply tries to
+move onto the spot where the monster is standing.
+The game then assumes that the player wishes to attack the monster
+with whatever weapon the player is wielding.
+.P
+When the player moves onto an item, the game automatically places the
+object into the player's pack.
+If there is no room left in the pack, the game announces that fact and
+leaves the item on the floor.
+.H 1 TIME
+All actions except for purely bookkeeping commands, such as taking an
+inventory, take time.
+The amount of time varies with the command.
+Swinging a weapon, for example, takes more time than simply moving;
+so a monster could move several spaces in the time it takes the player
+to make one attack.
+The time it takes to swing a weapon also varies based on the bulk of the