git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@452 c06c8d41-db1a-0410-9941-cceddc491573
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC VIFRP3HZEONFR6PQRYZYM3YUEJOQ7T4F5CZY4MN4YJMB23FMU7XAC UL7XFKMUX3WIU4O2LZANK4ECJ654UZPDBFGNXUEYZYOLKBYBCG6AC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC 22RFWMSJGG26Z2MQEEXGKVTFSTLREHQIG46WYOTMDRKI5YVMRNVAC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC MOT3YZFRY3JG2MH3GN2VD6IY3IJSAXJUXMXS222TXWKRFCENOCDQC MQ62OAMLGJVRW2QIL4PAZRAU6PC52ZVGY2FCOBIY6IWGQIHMU5CAC OWU4HTEMJN5AR27RTHVRRSYFDD2S3UQRYNQJKB7TPCY2NBQUE4YQC /*********************************************************************** File: wpn-misc.h ** Summary: temporary home for weapon f(x) until struct'ed ** Written by: don brodale <dbrodale@bigfootinteractive.com> ** ** Changelog(most recent first): ** ** <00> 12jun2000 dlb created after little thought ***********************************************************************/#ifndef WPNMISC_H#define WPNMISC_H#include "externs.h"/* ************************************************************************ called from: food.h* *********************************************************************** */bool can_cut_meat(unsigned char wclass, unsigned char wtype);/* ************************************************************************ called from: acr - fight - food - item_use - itemname - spells2* *********************************************************************** */char damage_type(unsigned char wclass, unsigned char wtype);// last updated: 10jun2000 {dlb}/* ************************************************************************ called from: describe - fight - item_use* *********************************************************************** */int hands_reqd_for_weapon(unsigned char wclass, unsigned char wtype);// last updated: 10jun2000 {dlb}/* ************************************************************************ called from: dungeon - fight - item_use - randart* *********************************************************************** */bool is_demonic(unsigned char weapon_subtype);// last updated: 10jun2000 {dlb}/* ************************************************************************ called from: dungeon - item_use - mstuff2* *********************************************************************** */unsigned char launched_by(unsigned char weapon_subtype);// last updated: 10jun2000 {dlb}/* ************************************************************************ called from: describe - dungeon - fight - item_use - mstuff2 - randart -* spells2 - spells3* *********************************************************************** */bool launches_things( unsigned char weapon_subtype );// last updated: 10jun2000 {dlb}/* ************************************************************************ called from: describe - fight - files - it_use3 - newgame - spells1* *********************************************************************** */char weapon_skill(unsigned char wclass, unsigned char wtype);#endif
/*********************************************************************** File: wpn-misc.cc ** Summary: temporary home for weapon f(x) until struct'ed ** Written by: don brodale <dbrodale@bigfootinteractive.com> ** ** Changelog(most recent first): ** ** <00> 12jun2000 dlb created after little thought ***********************************************************************/#include "AppHdr.h"#include "wpn-misc.h"#include "externs.h"// all of this will be replaced by a struct and data handlers {dlb}:/**************************************************** ** BEGIN PUBLIC FUNCTIONS ** ****************************************************/char damage_type(unsigned char wclass, unsigned char wtype){char type_damage = DVORP_CRUSHING; // this is the default, btw {dlb}if (wclass == OBJ_WEAPONS){switch (wtype){case WPN_DAGGER:case WPN_DEMON_BLADE:case WPN_DOUBLE_SWORD:case WPN_GREAT_SWORD:case WPN_KATANA:case WPN_KNIFE:case WPN_LONG_SWORD:case WPN_QUICK_BLADE:case WPN_SABRE:case WPN_FALCHION:case WPN_SCIMITAR:case WPN_SCYTHE:case WPN_SHORT_SWORD:case WPN_TRIPLE_SWORD:type_damage = DVORP_SLICING;break;case WPN_DEMON_TRIDENT:case WPN_EVENINGSTAR:case WPN_GIANT_SPIKED_CLUB:case WPN_MORNINGSTAR:case WPN_SPEAR:case WPN_SPIKED_FLAIL:case WPN_TRIDENT:type_damage = DVORP_PIERCING;break;case WPN_WAR_AXE:case WPN_BATTLEAXE:case WPN_BROAD_AXE:case WPN_EXECUTIONERS_AXE:case WPN_GLAIVE:case WPN_HALBERD:case WPN_HAND_AXE:type_damage = DVORP_CHOPPING;break;}}return (type_damage);} // end damage_type()bool can_cut_meat(unsigned char wclass, unsigned char wtype){int type = damage_type( wclass, wtype );if (type == DVORP_CHOPPING || type == DVORP_SLICING)return (true);return (false);}int hands_reqd_for_weapon(unsigned char wclass, unsigned char wtype){int reqd_hands = HANDS_ONE_HANDED;switch (wclass){case OBJ_WEAPONS:switch (wtype){case WPN_HALBERD:case WPN_SCYTHE:case WPN_GLAIVE:case WPN_QUARTERSTAFF:case WPN_BATTLEAXE:case WPN_EXECUTIONERS_AXE:case WPN_GREAT_SWORD:case WPN_TRIPLE_SWORD:case WPN_GREAT_MACE:case WPN_GREAT_FLAIL:case WPN_GIANT_CLUB:case WPN_GIANT_SPIKED_CLUB:reqd_hands = HANDS_TWO_HANDED;break;case WPN_SPEAR:case WPN_TRIDENT:case WPN_DEMON_TRIDENT:case WPN_WAR_AXE:case WPN_BROAD_AXE:case WPN_KATANA:case WPN_DOUBLE_SWORD:reqd_hands = HANDS_ONE_OR_TWO_HANDED;break;}break;case OBJ_STAVES:reqd_hands = HANDS_TWO_HANDED;break;}return (reqd_hands);} // end hands_reqd_for_weapon()bool is_demonic(unsigned char weapon_subtype){switch (weapon_subtype){case WPN_DEMON_BLADE:case WPN_DEMON_WHIP:case WPN_DEMON_TRIDENT:return true;default:return false;}} // end is_demonic()bool launches_things( unsigned char weapon_subtype ){switch (weapon_subtype){case WPN_SLING:case WPN_BOW:case WPN_CROSSBOW:case WPN_HAND_CROSSBOW:case WPN_BLOWGUN:return (true);default:return (false);}} // end launches_things()unsigned char launched_by(unsigned char weapon_subtype){switch (weapon_subtype){case WPN_BLOWGUN:return MI_NEEDLE;case WPN_SLING:return MI_STONE;case WPN_BOW:return MI_ARROW;case WPN_CROSSBOW:return MI_BOLT;case WPN_HAND_CROSSBOW:return MI_DART;default:return MI_EGGPLANT; // lame debugging code :P {dlb}}} // end launched_by()// this function returns the skill that the weapon would use in meleechar weapon_skill(unsigned char wclass, unsigned char wtype){char skill2use = SK_FIGHTING;if (wclass == OBJ_STAVES&& (wtype < STAFF_SMITING || wtype >= STAFF_AIR)){skill2use = SK_STAVES;}else if (wclass != OBJ_WEAPONS)skill2use = SK_FIGHTING;else{switch (wtype){case WPN_CLUB:case WPN_MACE:case WPN_HAMMER:case WPN_ANCUS:case WPN_WHIP:case WPN_FLAIL:case WPN_MORNINGSTAR:case WPN_GIANT_CLUB:case WPN_GIANT_SPIKED_CLUB:case WPN_EVENINGSTAR:case WPN_DEMON_WHIP:case WPN_SPIKED_FLAIL:case WPN_GREAT_FLAIL:case WPN_GREAT_MACE:case WPN_BOW:case WPN_BLOWGUN:case WPN_CROSSBOW:case WPN_HAND_CROSSBOW:skill2use = SK_MACES_FLAILS;break;case WPN_KNIFE:case WPN_DAGGER:case WPN_SHORT_SWORD:case WPN_QUICK_BLADE:case WPN_SABRE:skill2use = SK_SHORT_BLADES;break;case WPN_FALCHION:case WPN_LONG_SWORD:case WPN_SCIMITAR:case WPN_KATANA:case WPN_DOUBLE_SWORD:case WPN_DEMON_BLADE:case WPN_GREAT_SWORD:case WPN_TRIPLE_SWORD:skill2use = SK_LONG_SWORDS;break;case WPN_HAND_AXE:case WPN_WAR_AXE:case WPN_BROAD_AXE:case WPN_BATTLEAXE:case WPN_EXECUTIONERS_AXE:skill2use = SK_AXES;break;case WPN_SPEAR:case WPN_HALBERD:case WPN_GLAIVE:case WPN_SCYTHE:case WPN_TRIDENT:case WPN_DEMON_TRIDENT:skill2use = SK_POLEARMS;break;case WPN_QUARTERSTAFF:skill2use = SK_STAVES;break;}}return (skill2use);} // end weapon_skill()/**************************************************** ** END PUBLIC FUNCTIONS ** ****************************************************/
# Make file for Dungeon Crawl (solaris)APPNAME = crawl# this file contains a list of the libraries.# it will make a variable called OBJECTS that contains all the librariesinclude makefile.objCXX = g++DELETE = rm -fCOPY = cpGROUP = gamesMOVE = mvOS_TYPE = SOLARISCFLAGS = -Wall -Wwrite-strings -Wstrict-prototypes \-Wmissing-prototypes -Wmissing-declarations \-g -D$(OS_TYPE) $(EXTRA_FLAGS)LDFLAGS = -staticMCHMOD = 2755INSTALLDIR = /opt/local/newcrawl/binLIB = -lcursesall: $(APPNAME)install: $(APPNAME)#strip $(APPNAME)$(MOVE) ${INSTALLDIR}/${APPNAME} ${INSTALLDIR}/${APPNAME}.old$(COPY) $(APPNAME) ${INSTALLDIR}chgrp ${GROUP} ${INSTALLDIR}/${APPNAME}chmod ${MCHMOD} ${INSTALLDIR}/$(APPNAME)clean:$(DELETE) *.odistclean:$(DELETE) *.o$(DELETE) bones.*$(DELETE) morgue.txt$(DELETE) scores$(DELETE) $(APPNAME)$(DELETE) *.sav$(DELETE) core$(DELETE) *.0*$(DELETE) *.lab$(APPNAME): $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB)debug: $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB)profile: $(OBJECTS)${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB).cc.o:${CXX} ${CFLAGS} -c $< ${INCLUDE}.h.cc:touch $@OBJECTS += libunix.o## Modified for Crawl Reference by $Author$ on $Date$#
# Make file for Dungeon Crawl (irix)APPNAME = crawl# this file contains a list of the libraries.# it will make a variable called OBJECTS that contains all the librariesinclude makefile.objCXX = CCDELETE = rm -fCOPY = cpOS_TYPE = LINUXCFLAGS = -Wall -D$(OS_TYPE) $(EXTRA_FLAGS)LDFLAGS = -L/usr/libMCHMOD = 711INSTALLDIR = /usr/gamesLIB = -lncurses# Include for LinuxINCLUDES = -I/usr/include/ncursesall: $(APPNAME)%.o: %.cc@echo hello@${CXX} ${CFLAGS} -c $< ${INCLUDE}install: $(APPNAME)$(COPY) $(APPNAME) ${INSTALLDIR}chmod ${MCHMOD} ${INSTALLDIR}/$(APPNAME)clean:$(DELETE) *.odistclean:$(DELETE) *.o$(DELETE) bones.*$(DELETE) morgue.txt$(DELETE) scores$(DELETE) $(APPNAME)$(APPNAME): $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB)strip $(APPNAME)chmod ${MCHMOD} $(APPNAME)debug: $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB)profile: $(OBJECTS)${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB).h.cc:touch $@
# -*- Makefile -*- for Dungeon Crawl (linux)GAME = crawl# this file contains a list of the libraries.# it will make a variable called OBJECTS that contains all the librariesinclude makefile.objCXX = g++DELETE = rm -fCOPY = cpOS_TYPE = LINUX-g -D$(OS_TYPE) $(EXTRA_FLAGS)MCHMOD = 2755LIB = -lncurses# Include for LinuxINCLUDES = -I/usr/include/ncursesall: $(GAME)install: $(GAME)$(COPY) $(GAME) ${INSTALLDIR}chmod ${MCHMOD} ${INSTALLDIR}/$(GAME)clean:$(DELETE) *.odistclean:$(DELETE) *.o$(DELETE) bones.*$(DELETE) morgue.txt$(DELETE) scores$(DELETE) $(GAME)$(DELETE) *.sav$(DELETE) core$(DELETE) *.0*$(DELETE) *.lab$(GAME): $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB)chmod ${MCHMOD} $(GAME)debug: $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB)profile: $(OBJECTS)${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB).cc.o:${CXX} ${CFLAGS} -c $< ${INCLUDE}.h.cc:touch $@# [dshaligram] More common location than /opt/crawl/bin - this is from the# Debian patch.INSTALLDIR = /usr/gamesCFLAGS = -Wall -Wwrite-strings -fsigned-char \OBJECTS += libunix.o## Modified for Crawl Reference by $Author$ on $Date$#
# Makefile for Dungeon Crawl (OS/2 EMX port)# 1998 (C) Alexey Guzeev, aga@russia.crosswinds.net# EMX is covered by GNU GPL# Dungeon Crawl is covered by Crawl GPL# OS/2 is a trademark of IBM Corp.# IBM is a trademark of IBM Corp.# :)# 1. make some directory, like \crawl# 2. make subdirectory for sources, \crawl\src# 3. put crawl sources in \crawl\src directory# 4. make directory \crawl\src current# 5. execute command 'dmake -B -r -f makefile.emx install'# 6. remove \crawl\src subdirectory with all contents# 7. delete \crawl\scoretable.exe - I don't know what it does :)# 8. run \crawl\crawl.exe & enjoy!CC = gccCFLAGS = -Wall -O3 -MMD -Zmt -DUSE_EMXLIBS = -lvideo -lbsdAR = arinclude makefile.objOBJ = $(OBJECTS)all: crawl.exe scoretable.exeinstall: ..\crawl.exe ..\scoretable.execrawl.a: $(OBJS)$(AR) r crawl.a $(OBJS)..\crawl.exe: crawl.exe+copy crawl.exe ..emxbind -s ..\crawl.exe..\scoretable.exe: scoretable.exe+copy scoretable.exe ..emxbind -s ..\scoretable.execlean:+del *.ocrawl.exe: crawl.a libemx.o$(CC) -o crawl.exe crawl.a libemx.o $(LIBS)scoretable.exe: scoretab.o libemx.o$(CC) -o scoretable.exe scoretab.o libemx.o $(LIBS).cc.o:$(CC) $(CFLAGS) -c $*.cc
GAME = crawl# this file contains a list of the libraries.# it will make a variable called OBJECTS that contains all the librariesinclude makefile.objCXX = g++DELETE = rm -fCOPY = cpOS_TYPE = BSDCFLAGS = -Wall -D$(OS_TYPE) $(EXTRA_FLAGS)LDFLAGS = -static -L/usr/libMCHMOD = 711# INSTALLDIR = /usr/gamesINSTALLDIR = /tmp/CRAWLTEST/testdevLIB = -lncursesINCLUDES = -I/usr/include/ncursesall: $(GAME)install: $(GAME)$(COPY) $(GAME) ${INSTALLDIR}chmod ${MCHMOD} ${INSTALLDIR}/$(GAME)clean:$(DELETE) *.odistclean:$(DELETE) *.o$(DELETE) bones.*$(DELETE) morgue.txt$(DELETE) scores$(DELETE) $(GAME)$(DELETE) *.sav$(DELETE) core$(DELETE) *.0*$(DELETE) *.lab$(GAME): $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB)strip $(GAME)chmod ${MCHMOD} $(GAME)debug: $(OBJECTS)${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB)profile: $(OBJECTS)${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB).cc.o:${CXX} ${CFLAGS} -c $< ${INCLUDE}.h.cc:touch $@OBJECTS += libunix.o## Modified for Crawl Reference by $Author$ on $Date$## -*- Makefile -*- for Dungeon Crawl (BSD)
## Makefile for Borland C++ 5.5 free commandline tools#!include makefile.objGAME = ..\crawl.exeall : $(GAME).PHONY : clean.PHONY : debug.PHONY : noopt.PHONY : install.PHONY : wizardclean :$(DEL) *.odebug :noopt :install :wizard :## Borland C++ tools#CC = bcc32LINK = ilink32DEL = del## windows defines, including windows version to make sure code runs on# all windows systems#WIN32DEFINES = WIN32CONSOLE;NEED_SPRINTF;WINVER=0x0400;_WIN32_WINNT=0x0400;__BCPLUSPLUS__## Options#LINKOPTS = -Tpe -ap -c -x /V4.0CFLAGS = -I. -D$(WIN32DEFINES) -4 -a -k- -Oc -OS -Oi -Ov -H- -P -cNICEFLAGS = -w-8004DEBUGFLAGS = -v -y$(GAME) : $(OBJECTS) libw32c.o$(LINK) $(LINKOPTS) c0x32.obj $?, $(GAME),, import32.lib cw32.lib.cc.o:$(CC) $(CFLAGS) $(NICEFLAGS) -o$*.o $<
/** File: libmac.h* Summary: Mac specific routines used by Crawl.* Written by: Jesse Jones** Change History (most recent first):** <2> 5/25/02 JDJ Updated for Mach-O targets* <1> 3/23/99 JDJ Created*/#ifndef LIBMAC_H#define LIBMAC_H#if macintosh#ifdef _BSD_SIZE_T_ // $$$ is there a better way to test for OS X?#define OSX 1#else#define OS9 1#endif#include <fcntl.h>#include <stdlib.h>#include <string.h>#if OSX#include <unistd.h>#endif#define MAC_NUMBER_OF_LINES 30// constantsconst int _NORMALCURSOR = 1;const int _NOCURSOR = 0;// non-ANSI functionsint stricmp(const char* lhs, const char* rhs);char* strlwr(char* str);void itoa(int n, char* buffer, int radix);#if !OSXinline void srandom(unsigned int seed){srand(seed);}int open(const char* path, int openFlags, int permissions);int open(const char* path, int openFlags, int permissions, int mysteryFlags);int close(int desc);int read(int desc, void *buffer, unsigned int bytes);int write(int desc, const void *buffer, unsigned int bytes);int unlink(const char* path);#endif// curses(?) functionsvoid clrscr();void gotoxy(int x, int y);void textcolor(int c);void cprintf(const char* format,...);void window(int x, int y, int lx, int ly);int wherex();int wherey();void putch(char c);int kbhit();char getche();int getch();void getstr(char* buffer, int bufferSize);void textbackground(int c);void _setcursortype(int curstype);// misc functionsvoid delay(int ms);void init_mac();void deinit_mac();#endif // macintosh#endif // LIBMAC_H
/** File: libmac.cc* Summary: Mac specific routines used by Crawl.* Written by: Jesse Jones (jesjones@mindspring.com)////---------------------------------------------------------------void itoa(int value, char* buffer, int radix){ASSERT(buffer != NULL);ASSERT(radix == 10 || radix == 2);if (radix == 10)sprintf(buffer, "%i", value);if (radix == 2){ /* int to "binary string" */unsigned int bitmask = 32768;int ctr = 0;int startflag = 0;while (bitmask){if (value & bitmask){startflag = 1;sprintf(buffer + ctr, "1");}else{if (startflag)sprintf(buffer + ctr, "0");}bitmask = bitmask >> 1;if (startflag)ctr++;}if (!startflag) /* Special case if value == 0 */sprintf((buffer + ctr++), "0");buffer[ctr] = (char) NULL;}}#if __MWERKS__#pragma mark -#endif// ========================================================================// Curses(?) Functions// ========================================================================//---------------------------------------------------------------//// window////---------------------------------------------------------------void window(int x, int y, int lx, int ly){ASSERT(lx == kTermWidth); // window size is hard-codedASSERT(ly == kTermHeight);gotoxy(x, y);}//---------------------------------------------------------------//// clrscr////---------------------------------------------------------------void clrscr(){ASSERT(sApp != NULL);sApp->Clear();}//---------------------------------------------------------------//// textcolor////---------------------------------------------------------------void textcolor(int c){ASSERT(c >= 0);ASSERT(c < 16);ASSERT(sApp != NULL);RGBColor color = ConvertColor(c);sApp->SetForeColor(color);}//---------------------------------------------------------------//// textbackground////---------------------------------------------------------------void textbackground(int c){ASSERT(c >= 0);ASSERT(c < 16);ASSERT(sApp != NULL);RGBColor color = ConvertColor(c);sApp->SetBackColor(color);}//---------------------------------------------------------------//// gotoxy////---------------------------------------------------------------void gotoxy(int x, int y){ASSERT(x >= 1);ASSERT(y >= 1);ASSERT(sApp != NULL);sApp->SetCursor(x - 1, y - 1);}//---------------------------------------------------------------//// wherex////---------------------------------------------------------------int wherex(){ASSERT(sApp != NULL);Point pos = sApp->GetCursor();return pos.h + 1;}//---------------------------------------------------------------//// wherey////---------------------------------------------------------------int wherey(){ASSERT(sApp != NULL);Point pos = sApp->GetCursor();return pos.v + 1;}//---------------------------------------------------------------//// putch////---------------------------------------------------------------void putch(char ch){ASSERT(sApp != NULL);char buffer[2];buffer[0] = ch;buffer[1] = '\0';sApp->SetChar(ch);// sApp->Print(buffer);}//---------------------------------------------------------------//// cprintf////---------------------------------------------------------------void cprintf(const char* format,...){ASSERT(sApp != NULL);char buffer[2048];va_list argp;va_start(argp, format);vsprintf(buffer, format, argp);va_end(argp);sApp->Print(buffer);}//---------------------------------------------------------------//// kbhit////---------------------------------------------------------------int kbhit(){return sApp->PeekChar();}//---------------------------------------------------------------//// getche////---------------------------------------------------------------char getche(){char ch = getch();if (ch != '\r')putch(ch);return ch;}//---------------------------------------------------------------//// getstr////---------------------------------------------------------------void getstr(char* buffer, int bufferSize){ASSERT(buffer != NULL);ASSERT(bufferSize > 1);int index = 0;while (index < bufferSize - 1){char ch = getche();if (ch == '\r')break;else if (ch == '\b' && index > 0)--index;else if (isprint(ch))buffer[index++] = ch;}buffer[index] = '\0';}//---------------------------------------------------------------//// _setcursortype////---------------------------------------------------------------void _setcursortype(int curstype){ASSERT(curstype == _NORMALCURSOR || curstype == _NOCURSOR);ASSERT(sApp != NULL);sApp->ShowCursor(curstype == _NORMALCURSOR);}//---------------------------------------------------------------//// getch////---------------------------------------------------------------int getch(){ASSERT(sApp != NULL);return sApp->GetChar();}#if __MWERKS__#pragma mark -#endif// ========================================================================// Misc Functions// ========================================================================//---------------------------------------------------------------//// delay////---------------------------------------------------------------void delay(int ms){ASSERT(ms >= 0);usleep(1000*ms);}//---------------------------------------------------------------//// init_mac////---------------------------------------------------------------void init_mac(){ASSERT(sApp == NULL);// Read in the color tablesColors = GetCTable(256);if (sColors == NULL){WarnUser("Couldn't load the colour table!");ExitToShell();}// Create the application objectsApp = new CApplication;}//---------------------------------------------------------------//// deinit_mac////---------------------------------------------------------------void deinit_mac(){delete sApp;sApp = NULL;}#endif // macintosh// Converts an integer to a string (after libunix.cc).** Modified for Crawl Reference by $Author$ on $Date$
#ifndef LIBEMX_H#define LIBEMX_H#ifndef __LIBEMX_C__#include <stdlib.h>#include <conio.h>#define itoa _itoa#define _NORMALCURSOR 1#define _NOCURSOR 0void init_emx();void deinit_emx();void _setcursortype(int curstype);void clrscr();void gotoxy(int x, int y);void textcolor(int c);void cprintf (const char *format, ...);void puttext(int x, int y, int lx, int ly, const char *buf);void puttext(int x, int y, int lx, int ly, unsigned const char *buf);void gettext(int x, int y, int lx, int ly, char *buf);void gettext(int x, int y, int lx, int ly, unsigned char *buf);void window(int x, int y, int lx, int ly);int wherex();int wherey();void putch(char c);int kbhit();void delay(int ms);void textbackground(int c);#endif // __LIBEMX_C__#endif
#include <stdio.h>#include <stdarg.h>#include <emx/syscalls.h>#include <sys/video.h>#include "libemx.h"static int cursor_start = 0, cursor_end = 0;static int gx = 0, gy = 0, gxx = 79, gyy = 24;static char buf[4096];void init_emx(){v_init();v_getctype(&cursor_start, &cursor_end);}void deinit_emx(){// nothing to do}void _setcursortype(int curstype){if ( curstype == _NOCURSOR )v_hidecursor();elsev_ctype(cursor_start, cursor_end);}void clrscr(){if ( (gx == 0) && (gy == 0) && (gxx == 79) && (gyy == 24) ){v_clear();v_gotoxy(0, 0);}else{for (int i = gy; i <= gyy; ++i){v_gotoxy(gx, i);v_putn(' ', gxx - gx + 1);}v_gotoxy(gx, gy);}}void gotoxy(int x, int y){v_gotoxy(x - 1 + gx, y - 1 + gy);}void textcolor(int c){v_attrib(c);}static void cprintf_aux(const char *s){char *ptr = buf;while (*s){if ( *s == '\n' ){*ptr = 0;v_puts(buf);int x, y;v_getxy(&x, &y);if ( y != 24 )v_gotoxy(gx, y + 1);elsev_putc('\n');ptr = buf;}else if ( *s != '\r' )*ptr++ = *s;++s;}*ptr = 0;v_puts(buf);}void cprintf(const char *format, ...){va_list argp;char buffer[4096]; // one could hope it's enoughva_start( argp, format );vsprintf(buffer, format, argp);cprintf_aux(buffer);va_end(argp);}void puttext(int x, int y, int lx, int ly, unsigned const char *buf){puttext(x, y, lx, ly, (const char *) buf);}void puttext(int x, int y, int lx, int ly, const char *buf){int count = (lx - x + 1);for (int i = y - 1; i < ly; ++i){v_putline(buf + 2 * count * i, x - 1, i, count);}}void gettext(int x, int y, int lx, int ly, unsigned char *buf){gettext(x, y, lx, ly, (char *) buf);}void gettext(int x, int y, int lx, int ly, char *buf){int count = (lx - x + 1);for (int i = y - 1; i < ly; ++i){v_getline(buf + 2 * count * i, x - 1, i, count);}}void window(int x, int y, int lx, int ly){gx = x - 1;gy = y - 1;gxx = lx - 1;gyy = ly - 1;}int wherex(){int x, y;v_getxy(&x, &y);return x + 1 - gx;}int wherey(){int x, y;v_getxy(&x, &y);return y + 1 - gy;}void putch(char c){v_putc(c);}int kbhit(){return 0;}void delay(int ms){__sleep2(ms);}void textbackground(int c){if ( c != 0 ){fprintf(stderr, "bad background=%d", c);exit(1);}}
/** File: MacString.h* Summary: Wrapper around an immutable CFString.* Written by: Jesse Jones (jesjones@mindspring.com)** Change History (most recent first):** <1> 6/04/02 JDJ Created*/#ifndef MAC_STRING_H#define MAC_STRING_H#if macintosh#include <CoreFoundation/CFBase.h>// ============================================================================// class MacString//! Wrapper around an immutable CFString.// ============================================================================class MacString {//-----------------------------------// Initialization/Destruction//public:~MacString();MacString();MacString(const char* str);MacString(const unsigned char* str);/**< Uses default system encoding. */MacString(CFStringRef str);/**< Bumps the ref count. */MacString(CFMutableStringRef str);/**< Makes a copy. */explicit MacString(int value);MacString(const MacString& str);MacString& operator=(const MacString& rhs);//-----------------------------------// API//public:// ----- Size -----size_t length() const;size_t size() const {return this->length();}bool empty() const {return this->length() == 0;}// ----- Access -----void CopyTo(unsigned char* buffer, CFIndex bytes);operator CFStringRef() const {return mString;}//-----------------------------------// Member Data//private:CFStringRef mString;};#endif // macintosh#endif // MAC_STRING_H
/** File: MacString.cc* Summary: Wrapper around an immutable CFString.* Written by: Jesse Jones (jesjones@mindspring.com)** Change History (most recent first):** <1> 6/04/02 JDJ Created*/#include "AppHdr.h"#include "MacString.h"#if macintosh#include <CoreFoundation/CFString.h>#include "debug.h"// ========================================================================// Internal Functions// ========================================================================//---------------------------------------------------------------//// ThrowIf////---------------------------------------------------------------static void ThrowIf(bool predicate, const std::string& text){if (predicate)throw std::runtime_error(text);}#if __MWERKS__#pragma mark -#endif// ============================================================================// class MacString// ============================================================================//---------------------------------------------------------------//// MacString::~MacString////---------------------------------------------------------------MacString::~MacString(){CFRelease(mString);}//---------------------------------------------------------------//// MacString::MacString ()////---------------------------------------------------------------MacString::MacString(){mString = CFStringCreateWithCharacters(kCFAllocatorSystemDefault, NULL, 0);ThrowIf(mString == NULL, "Couldn't create the CFString");}//---------------------------------------------------------------//// MacString::MacString (unsigned char*)////---------------------------------------------------------------MacString::MacString(const unsigned char* str){ASSERT(str != NULL);CFStringEncoding encoding = CFStringGetSystemEncoding();mString = CFStringCreateWithPascalString(kCFAllocatorSystemDefault, str, encoding);ThrowIf(mString == NULL, "Couldn't create the CFString");}//---------------------------------------------------------------//// MacString::MacString (char*)////---------------------------------------------------------------MacString::MacString(const char* str){ASSERT(str != NULL);CFStringEncoding encoding = CFStringGetSystemEncoding();mString = CFStringCreateWithCString(kCFAllocatorSystemDefault, str, encoding);ThrowIf(mString == NULL, "Couldn't create the CFString");}//---------------------------------------------------------------//// MacString::MacString (CFStringRef)////---------------------------------------------------------------MacString::MacString(CFStringRef str){ASSERT(str != NULL);mString = str;CFRetain(mString);}//---------------------------------------------------------------//// MacString::MacString (CFMutableStringRef)////---------------------------------------------------------------MacString::MacString(CFMutableStringRef str){ASSERT(str != NULL);mString = CFStringCreateCopy(kCFAllocatorSystemDefault, str);ThrowIf(mString == NULL, "Couldn't create the CFString");}//---------------------------------------------------------------//// MacString::MacString (int)////---------------------------------------------------------------MacString::MacString(int value){char buffer[32];sprintf(buffer, "%d", value);CFStringEncoding encoding = CFStringGetSystemEncoding();mString = CFStringCreateWithCString(kCFAllocatorSystemDefault, buffer, encoding);ThrowIf(mString == NULL, "Couldn't create the CFString");}//---------------------------------------------------------------//// MacString::MacString (MacString)////---------------------------------------------------------------MacString::MacString(const MacString& str){mString = str.mString; // immutable so we can refcountCFRetain(mString);}//---------------------------------------------------------------//// MacString::operator= (MacString)////---------------------------------------------------------------MacString& MacString::operator=(const MacString& rhs){if (this != &rhs){CFRelease(mString);mString = rhs.mString; // immutable so we can refcountCFRetain(mString);}return *this;}//---------------------------------------------------------------//// MacString::length////---------------------------------------------------------------size_t MacString::length() const{size_t len = (size_t) CFStringGetLength(mString);return len;}//---------------------------------------------------------------//// MacString::CopyTo////---------------------------------------------------------------void MacString::CopyTo(unsigned char* buffer, CFIndex bytes){ASSERT(buffer != NULL || bytes == 0);bool converted = CFStringGetPascalString(mString, buffer, bytes, CFStringGetSystemEncoding());ThrowIf(!converted, "Couldn't convert the CFString into a Pascal string");}#endif // macintosh
void set_envmap_char( int x, int y, unsigned char chr );void set_envmap_detected_item(int x, int y, bool detected = true);void set_envmap_detected_mons(int x, int y, bool detected = true);bool is_envmap_detected_item(int x, int y);bool is_envmap_detected_mons(int x, int y);void set_terrain_mapped( int x, int y );void set_terrain_seen( int x, int y );bool is_terrain_known( int x, int y );bool is_terrain_seen( int x, int y );void clear_feature_overrides();void add_feature_override(const std::string &text);void clear_cset_overrides();void add_cset_override(char_set_type set, const std::string &overrides);bool see_grid( int grx, int gry );std::string screenshot(bool fullscreen = false);unsigned char get_sightmap_char(int feature);unsigned char get_magicmap_char(int feature);void viewwindow(bool draw_it, bool do_updates);bool find_ray( int sourcex, int sourcey, int targetx, int targety,bool allow_fallback, ray_def& ray );#if defined(WIN32CONSOLE) || defined(DOS)unsigned short dos_brand( unsigned short colour,unsigned brand = CHATTR_REVERSE);
#endif
#define MAP_CHARACTER_MASK 0x00ffstruct feature_def{unsigned short symbol; // symbol used for seen terrainunsigned short magic_symbol; // symbol used for magic-mapped terrainunsigned short colour; // normal in LoS colourunsigned short map_colour; // colour when out of LoS on displayunsigned short seen_colour; // map_colour when is_terrain_seen()bool notable; // gets noted when seenbool seen_effect; // requires special handling when seen};struct feature_override{dungeon_feature_type feat;feature_def override;};static FixedVector< struct feature_def, NUM_FEATURES > Feature;static std::vector<feature_override> Feature_Overrides;
extern void (*viewwindow) (char, bool);unsigned char (*mapch) (unsigned char);unsigned char (*mapch2) (unsigned char);unsigned char mapchar(unsigned char ldfk);unsigned char mapchar2(unsigned char ldfk);unsigned char mapchar3(unsigned char ldfk);unsigned char mapchar4(unsigned char ldfk);
static int display_glyph(int env_glyph);static int item_env_glyph(const item_def &item);
static int get_item_dngn_code(const item_def &item);static void set_show_backup( int ex, int ey );// Applies EC_ colour substitutions and brands.static unsigned fix_colour(unsigned raw_colour);
//---------------------------------------------------------------//// get_ibm_symbol//// Returns the DOS character code and color for everything drawn// with the IBM graphics option.////---------------------------------------------------------------static void get_ibm_symbol(unsigned int object, unsigned short *ch,unsigned short *color)
unsigned get_envmap_char(int x, int y)
// stone in the realm of Zot is coloured the same as rockcase DNGN_STONE_WALL:*color = (player_in_branch( BRANCH_HALL_OF_ZOT ) ? env.rock_colour: LIGHTGREY);*ch = 177;break;
void set_envmap_detected_mons(int x, int y, bool detected){if (detected)env.map[x - 1][y - 1] |= MAP_DETECTED_MONSTER;elseenv.map[x - 1][y - 1] &= ~MAP_DETECTED_MONSTER;}
case DNGN_WAX_WALL:*ch = 177;*color = YELLOW;break; // wax wall/* Anything added here must also be added to the PLAIN_TERMINALviewwindow2 below */
// used to mark dug out areas, unset when terrain is seen or mapped again.void set_terrain_changed( int x, int y ){env.map[x - 1][y - 1] |= MAP_CHANGED_FLAG;}
case DNGN_LAVA:*ch = 247;*color = RED;break;case DNGN_DEEP_WATER:*ch = 247; // this wavy thing also used for water elemental*color = BLUE;break;case DNGN_SHALLOW_WATER:*ch = 247; // this wavy thing also used for water elemental*color = CYAN;break;case DNGN_FLOOR:*color = env.floor_colour;*ch = 249;break;case DNGN_ENTER_HELL:*ch = 239;*color = RED;seen_other_thing(object);break;case DNGN_OPEN_DOOR:*ch = 39;break;case DNGN_BRANCH_STAIRS:*ch = 240;*color = BROWN;break;case DNGN_TRAP_MECHANICAL:*color = LIGHTCYAN;*ch = 94;break;case DNGN_TRAP_MAGICAL:*color = MAGENTA;*ch = 94;break;case DNGN_TRAP_III:*color = LIGHTGREY;*ch = 94;break;
void clear_envmap( void ){for (int i = 0; i < GXM; i++){for (int j = 0; j < GYM; j++){env.map[i][j] = 0;}}}
case DNGN_UNDISCOVERED_TRAP:*ch = 249;*color = env.floor_colour;break;case DNGN_ENTER_SHOP:*ch = 239;*color = YELLOW;seen_other_thing(object);break;// if I change anything above here, must also change magic mapping!case DNGN_ENTER_LABYRINTH:*ch = 239;*color = LIGHTGREY;seen_other_thing(object);break;// not sure why we have "odd" here, but "ladders" are special in// that they all lead to the first staircase of the next level// (and returning from there will take you somewhere different)// ... that's why they're brown... it's a warning -- bwrcase DNGN_ROCK_STAIRS_DOWN:*color = BROWN; // ladder // odd {dlb}case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:*ch = '>';break;case DNGN_ROCK_STAIRS_UP:*color = BROWN; // ladder // odd {dlb}case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:*ch = '<';break;case DNGN_ENTER_DIS:*color = CYAN;*ch = 239;break;case DNGN_ENTER_GEHENNA:*color = RED;*ch = 239;break;case DNGN_ENTER_COCYTUS:*color = LIGHTCYAN;*ch = 239;break;case DNGN_ENTER_TARTARUS:*color = DARKGREY;*ch = 239;break;case DNGN_ENTER_ABYSS:*color = random2(16);*ch = 239;seen_other_thing(object);break;case DNGN_EXIT_ABYSS:*color = random2(16);*ch = 239;break;case DNGN_STONE_ARCH:*color = LIGHTGREY;*ch = 239;break;case DNGN_ENTER_PANDEMONIUM:*color = LIGHTBLUE;*ch = 239;seen_other_thing(object);break;case DNGN_EXIT_PANDEMONIUM:*color = LIGHTBLUE;*ch = 239;break;case DNGN_TRANSIT_PANDEMONIUM:*color = LIGHTGREEN;*ch = 239;break;case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:*color = YELLOW;*ch = '>';seen_staircase(object);break;case DNGN_ENTER_ZOT:*color = MAGENTA;*ch = 239;seen_staircase(object);break;case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:*color = YELLOW;*ch = '<';break;case DNGN_RETURN_FROM_ZOT:*color = MAGENTA;*ch = 239;break;case DNGN_ALTAR_ZIN:*color = WHITE;*ch = 220;seen_altar(GOD_ZIN);break;case DNGN_ALTAR_SHINING_ONE:*color = YELLOW;*ch = 220;seen_altar(GOD_SHINING_ONE);break;case DNGN_ALTAR_KIKUBAAQUDGHA:*color = DARKGREY;*ch = 220;seen_altar(GOD_KIKUBAAQUDGHA);break;case DNGN_ALTAR_YREDELEMNUL:*color = ((one_chance_in(3)) ? RED : DARKGREY);*ch = 220;seen_altar(GOD_YREDELEMNUL);break;case DNGN_ALTAR_XOM:*color = random_colour();*ch = 220;seen_altar(GOD_XOM);break;case DNGN_ALTAR_VEHUMET:*color = LIGHTBLUE;if (one_chance_in(3))*color = LIGHTMAGENTA;if (one_chance_in(3))*color = LIGHTRED;*ch = 220;seen_altar(GOD_VEHUMET);break;case DNGN_ALTAR_OKAWARU:*color = CYAN;*ch = 220;seen_altar(GOD_OKAWARU);break;case DNGN_ALTAR_MAKHLEB:*color = RED;if (one_chance_in(3))*color = LIGHTRED;if (one_chance_in(3))*color = YELLOW;*ch = 220;seen_altar(GOD_MAKHLEB);break;case DNGN_ALTAR_SIF_MUNA:*color = BLUE;*ch = 220;seen_altar(GOD_SIF_MUNA);break;case DNGN_ALTAR_TROG:*color = RED;*ch = 220;seen_altar(GOD_TROG);break;case DNGN_ALTAR_NEMELEX_XOBEH:*color = LIGHTMAGENTA;*ch = 220;seen_altar(GOD_NEMELEX_XOBEH);break;case DNGN_ALTAR_ELYVILON:*color = LIGHTGREY;*ch = 220;seen_altar(GOD_ELYVILON);break;case DNGN_BLUE_FOUNTAIN:*color = BLUE;*ch = 159;break;case DNGN_SPARKLING_FOUNTAIN:*color = LIGHTBLUE;*ch = 159;break;case DNGN_DRY_FOUNTAIN_I:case DNGN_DRY_FOUNTAIN_II:case DNGN_PERMADRY_FOUNTAIN:*color = LIGHTGREY;*ch = 159;break;case 256:*ch = '0';break;case 257:*color = CYAN;*ch = '~';break; /* Invis creature walking through water */case 258:*ch = ')';break; // weapon )case 259:*ch = '[';break; // armour [case 260:*ch = '/';break; // wands, etc.case 261:*ch = '%';break; // foodcase 262:*ch = '+';break; // books +case 263:*ch = '?';break; // scroll ?case 264:*ch = '=';break; // ring = etccase 265:*ch = '!';break; // potions !case 266:*ch = '(';break; // stonescase 267:*ch = '+';break; // book +case 268:*ch = '%';break; // corpses part 1case 269:*ch = '\\';break; // magical stavescase 270:*ch = '}';break; // gemscase 271:*ch = '%';break; // don't know ?case 272:*ch = '$';*color = YELLOW;break; // $ goldcase 273:*ch = '"';break; // amulet
#if defined(WIN32CONSOLE) || defined(DOS) || defined(DOS_TERM)static unsigned colflag2brand(int colflag){switch (colflag){case COLFLAG_ITEM_HEAP:return (Options.heap_brand);case COLFLAG_FRIENDLY_MONSTER:return (Options.friend_brand);case COLFLAG_WILLSTAB:return (Options.stab_brand);case COLFLAG_MAYSTAB:return (Options.may_stab_brand);
//---------------------------------------------------------------//// viewwindow2//// Draws the main window using the extended IBM character set.//// This function should not interfer with the game condition,// unless do_updates is set (ie. stealth checks for visible// monsters).////---------------------------------------------------------------void viewwindow2(char draw_it, bool do_updates)
static unsigned fix_colour(unsigned raw_colour)
const long BUFFER_SIZE = 1550;#ifdef DOS_TERM// DOS functions like gettext() and puttext() can only// work with arrays of characters, not shorts.FixedVector < unsigned char, BUFFER_SIZE > buffy; //[800]; //392];#elseFixedVector < unsigned short, BUFFER_SIZE > buffy; //[800]; //392];
// This order is important - is_element_colour() doesn't want to see the// munged colours returned by dos_brand, so it should always be done// before applying DOS brands.#if defined(WIN32CONSOLE) || defined(DOS) || defined(DOS_TERM)const int colflags = raw_colour & 0xFF00;
item();cloud_grid();monster_grid(do_updates);int bufcount = 0;if (draw_it == 1){_setcursortype(_NOCURSOR);for (count_y = you.y_pos - 8; count_y < you.y_pos + 9; count_y++){bufcount += 16;for (count_x = you.x_pos - 8; count_x < you.x_pos + 9; count_x++){// may be overriden by the code belowcolor = env.show_col[ count_x - you.x_pos + 9 ][ count_y - you.y_pos + 9 ];unsigned int object = env.show[ count_x - you.x_pos + 9 ][ count_y - you.y_pos + 9 ];get_ibm_symbol(object, &ch, &color);if (count_x == you.x_pos && count_y == you.y_pos){ch = your_sign;if (player_is_swimming()){color = (grd[you.x_pos][you.y_pos] == DNGN_DEEP_WATER)? BLUE : CYAN;}else{color = your_colour;}}ASSERT(bufcount + 1 < BUFFER_SIZE);buffy[bufcount] = ch;buffy[bufcount + 1] = color;bufcount += 2;}bufcount += 16;}if (you.level_type != LEVEL_LABYRINTH && you.level_type != LEVEL_ABYSS){bufcount = 0;
#endif
int mapx = count_x + you.x_pos - 9;int mapy = count_y + you.y_pos - 9;if (buffy[bufcount] != 0 && mapx >= 0 && mapx + 1 < GXM&& mapy >= 0 && mapy + 1 < GYM){unsigned short bch = buffy[bufcount];if (mgrd[mapx + 1][mapy + 1] != NON_MONSTER) {const monsters &m = menv[mgrd[mapx + 1][mapy + 1]];if (!mons_is_mimic(m.type)&& mons_char(m.type) == bch){bch |= mons_colour(m.type) << 12;}}env.map[mapx][mapy] = bch;}
static void get_symbol( unsigned int object, unsigned short *ch,unsigned short *colour ){ASSERT( ch != NULL );ASSERT( colour != NULL );
if (Options.clean_map == 1&& show_backup[count_x + 1][count_y + 1] != 0){get_ibm_symbol(show_backup[count_x + 1][count_y + 1],&ch, &color);if (mapx >= 0 && mapx < GXM&& mapy >= 0 && mapy < GYM)env.map[ count_x + you.x_pos - 9 ][ count_y + you.y_pos - 9 ] = ch;}bufcount += 2;}bufcount += 16;}}
if (object < NUM_FEATURES){*ch = Feature[object].symbol;
bufcount = 0;for (count_y = 0; count_y < 17; count_y++){for (count_x = 0; count_x < 33; count_x++){if (count_x + you.x_pos - 17 < 3|| count_y + you.y_pos - 9 < 3|| count_x + you.x_pos - 14 > 77|| count_y + you.y_pos - 9 > 67){ASSERT(bufcount < BUFFER_SIZE);buffy[bufcount] = 0;bufcount++;buffy[bufcount] = 0;bufcount++;continue;}if (count_x >= 8 && count_x <= 24 && count_y >= 0&& count_y <= 16 && buffy[bufcount] != 0){bufcount += 2;continue;}ASSERT(bufcount + 1 < BUFFER_SIZE);buffy[bufcount] = (unsigned char)env.map[ count_x + you.x_pos - 17 ][ count_y + you.y_pos - 9 ];buffy[bufcount + 1] = DARKGREY;if (Options.colour_map){if (env.map[ count_x + you.x_pos - 17 ][ count_y + you.y_pos - 9 ] != 0){buffy[bufcount + 1]= colour_code_map( count_x + you.x_pos - 17,count_y + you.y_pos - 9,Options.item_colour );}}bufcount += 2;}}if (you.berserker){for (count_x = 1; count_x < 1400; count_x += 2){if (buffy[count_x] != DARKGREY)buffy[count_x] = RED;}}if (show_green != BLACK){for (count_x = 1; count_x < 1400; count_x += 2){if (buffy[count_x] != DARKGREY)buffy[count_x] = show_green;}show_green = BLACK;
// Don't clobber with BLACK, because the colour should be already set.if (Feature[object].colour != BLACK)*colour = Feature[object].colour;
if (you.special_wield == SPWLD_SHADOW)show_green = DARKGREY;}
// Note anything we see that's notableif (Feature[object].notable)seen_notable_thing( object );}else{ASSERT( object >= DNGN_START_OF_MONSTERS );*ch = mons_char( object - DNGN_START_OF_MONSTERS );}
// following lines are purely optional.// if used, players will 'jump' move.// Resting will be a LOT faster too.if (you.running == 0 || (you.running < 0 && Options.travel_delay > -1)){for (count_x = 0; count_x < 1120; count_x += 2){ // 1056ch = buffy[count_x];color = buffy[count_x + 1];// ASSERT(color < 16);ASSERT(ch < 255);
return (0);}
short dist = point_distance[x + 1][y + 1];return dist > 0 ? BLUE :dist == PD_EXCLUDED ? LIGHTMAGENTA :dist == PD_EXCLUDED_RADIUS ? RED :dist < 0 ? CYAN :DARKGREY;
short dist = point_distance[x + 1][y + 1];return dist > 0? Options.tc_reachable :dist == PD_EXCLUDED? Options.tc_excluded :dist == PD_EXCLUDED_RADIUS? Options.tc_exclude_circle :dist < 0? Options.tc_dangerous :Options.tc_disconnected;
switch (grid_value){case DNGN_TRAP_MECHANICAL:return (LIGHTCYAN);case DNGN_TRAP_MAGICAL:case DNGN_TRAP_III:return (MAGENTA);case DNGN_ENTER_SHOP:return (YELLOW);case DNGN_ENTER_DIS:return (CYAN);case DNGN_ENTER_HELL:case DNGN_ENTER_GEHENNA:return (RED);case DNGN_ENTER_COCYTUS:return (LIGHTCYAN);case DNGN_ENTER_ABYSS:return random2(16); // so it can be black - is this right? {dlb}case DNGN_ENTER_LABYRINTH:case DNGN_STONE_ARCH:return (LIGHTGREY);
case DNGN_EXIT_PANDEMONIUM:// Exit pandemonium gates won't show up on the map as light blue// unless the character has the "gate to pandemonium" demonspawn// mutation. This is so that the player can't quickly use a// crystal ball to find their way out. -- bwrreturn (you.mutation[MUT_PANDEMONIUM] ? LIGHTBLUE : LIGHTGREEN);
if (feature_colour != DARKGREY)tc = feature_colour;
case DNGN_TRANSIT_PANDEMONIUM:return (LIGHTGREEN);case DNGN_ENTER_ZOT:case DNGN_RETURN_FROM_ZOT:return (MAGENTA);case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:case DNGN_ROCK_STAIRS_DOWN:return (RED);case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:case DNGN_ROCK_STAIRS_UP:return (GREEN);case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:return (LIGHTRED);case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:return (LIGHTBLUE);default:break;}return tc;
return fix_colour(tc);
bool unmapped = (envc & ENVF_DETECTED) != 0;// Discard flags at this point.envc = (unsigned char) envc;const unsigned char &grdc = grd[x + 1][y + 1];if (envc == mapch(grdc) || envc == mapch2(grdc))
unsigned short envc = env.map[x][y] & MAP_CHARACTER_MASK;if (!envc)
show_backup[ monster->x - you.x_pos + 9 ][ monster->y - you.y_pos + 9]= env.show[ monster->x - you.x_pos + 9 ][ monster->y - you.y_pos + 9 ];env.show[monster->x - you.x_pos + 9][monster->y - you.y_pos + 9] = 257;
set_show_backup(ex, ey);env.show[ex][ey] = DNGN_INVIS_EXPOSED;env.show_col[ex][ey] = BLUE;
interrupt_activity( AI_SEE_MONSTER );if (you.running != 0#ifdef CLUA_BINDINGS&& clua.callbooleanfn(true, "ch_stop_run","M", monster)#endif){// Friendly monsters, mimics, or harmless monsters// don't disturb the player's running/resting.//// Doing it this way causes players in run mode 2// to move one square, and in mode 1 to stop. This// means that the character will run one square if// a monster is in sight... we automatically jump// to zero if we're resting. -- bwrif (you.run_x == 0 && you.run_y == 0)stop_running();else if (you.running > 1)you.running--;elsestop_running();}
interrupt_activity( AI_SEE_MONSTER, monster );seen_monster( monster );
env.show_col[monster->x - you.x_pos + 9][monster->y - you.y_pos + 9]|= COLFLAG_MAYSTAB;}#elif defined(WIN32CONSOLE) || defined(DOS)if (Options.friend_brand != CHATTR_NORMAL&& mons_friendly(monster)){// We munge the colours right here for DOS and Windows, because// we know exactly how the colours will be handled, and we don't// want to change both DOS and Windows port code to handle// friend branding.unsigned short &colour =env.show_col[monster->x - you.x_pos + 9][monster->y - you.y_pos + 9];colour = dos_brand(colour, Options.friend_brand);
env.show_col[ex][ey] |= COLFLAG_MAYSTAB;
if (Options.stab_brand != CHATTR_NORMAL&& !mons_is_mimic(monster->type)&& monster->type != MONS_OKLOB_PLANT&& mons_is_stabbable(monster)){unsigned short &colour =env.show_col[monster->x - you.x_pos + 9][monster->y - you.y_pos + 9];colour = dos_brand(colour, Options.stab_brand);}else if (Options.may_stab_brand != CHATTR_NORMAL&& !mons_is_mimic(monster->type)&& monster->type != MONS_OKLOB_PLANT&& mons_maybe_stabbable(monster)){unsigned short &colour =env.show_col[monster->x - you.x_pos + 9][monster->y - you.y_pos + 9];colour = dos_brand(colour, Options.may_stab_brand);}#endif
unsigned short ch, color;if (viewwindow == viewwindow2)get_ibm_symbol(env_glyph, &ch, &color);elseget_non_ibm_symbol(env_glyph, &ch, &color);return ch;
// Must avoid double setting it.// We want the base terrain/item, not the cloud or monster that replaced it.if (!Show_Backup[ex][ey])Show_Backup[ex][ey] = env.show[ex][ey];
#elif defined(WIN32CONSOLE) || defined(DOS)if (eitem.link != NON_ITEM&& Options.heap_brand != CHATTR_NORMAL){// Yes, exact same code as friend-branding.ecol = dos_brand(ecol, Options.heap_brand);}#endifenv.show[count_x - you.x_pos + 9][count_y - you.y_pos + 9] =item_env_glyph( eitem );
env.show[ix][iy] = get_item_dngn_code( eitem );
show_backup[env.cloud[s].x - you.x_pos + 9][env.cloud[s].y - you.y_pos + 9]= env.show[env.cloud[s].x - you.x_pos + 9][env.cloud[s].y - you.y_pos + 9];env.show[env.cloud[s].x - you.x_pos + 9][env.cloud[s].y - you.y_pos + 9] = '#';
const int ex = env.cloud[s].x - you.x_pos + 9;const int ey = env.cloud[s].y - you.y_pos + 9;
void noisy( int loudness, int nois_x, int nois_y )
// Noisy now has a messenging service for giving messages to the// player is appropriate.//// Returns true if the PC heard the noise.bool noisy( int loudness, int nois_x, int nois_y, const char *msg )
/* ========================================================================* brand new LOS code* ========================================================================* The new LOS works via a new (I think) shadow casting algorithm,* plus an esthetic tweak for more pleasing corner illumination. More* detail can be had by contacting its author, Gordon Lipford. */
/* The LOS code now uses raycasting -- haranp */
Cell(){init();};};
unsigned long* los_blockrays = NULL;unsigned long* dead_rays = NULL;std::vector<short> ray_coord_x;std::vector<short> ray_coord_y;std::vector<short> compressed_ray_x;std::vector<short> compressed_ray_y;std::vector<int> raylengths;std::vector<ray_def> fullrays;
// integer math: a 'step' has a value of 10// see if we're within a half step of the max. VERY important// to use 'half step' or else things look really stupid.if (low_max != 0 && low_count + 5 >= low_max && low_count - 5 < low_max)return true;
int wordloc = where / LONGSIZE;int bitloc = where % LONGSIZE;return ((data[wordloc] & (1UL << bitloc)) != 0);}static void set_bit_in_long_array( unsigned long* data, int where ) {int wordloc = where / LONGSIZE;int bitloc = where % LONGSIZE;data[wordloc] |= (1UL << bitloc);}
// the cell arraystatic FixedVector < Cell, MAX_LIGHT_RADIUS + 1 > cells;
const double xtarget = (double)((int)(*accx) + 1);const double ytarget = (double)((int)(*accy) + 1);const double xdistance = xtarget - *accx;const double ydistance = ytarget - *accy;const double distdiff = (xdistance * slope - ydistance);// exact cornerif ( double_is_zero( distdiff ) ) {// move somewhat away from the cornerif ( slope > 1.0 ) {*accx = xtarget + EPSILON_VALUE * 2;*accy = ytarget + EPSILON_VALUE * 2 * slope;}else {*accx = xtarget + EPSILON_VALUE * 2 / slope;*accy = ytarget + EPSILON_VALUE * 2;}return 2;}
// the 'circle' array. For any given row, we won't check higher than// this given cell.static FixedVector < int, MAX_LIGHT_RADIUS + 1 > circle;
double traveldist;int rc = -1;if ( distdiff > 0.0 ) {traveldist = ydistance / slope;rc = 1;}else {traveldist = xdistance;rc = 0;}
int i, j;
// 0 = down-right, 1 = down-left, 2 = up-left, 3 = up-rightint bouncequad[4][3] = {{ 1, 3, 2 }, { 0, 2, 3 }, { 3, 1, 0 }, { 2, 0, 1 }};int oldx = x(), oldy = y();int rc = advance();int newx = x(), newy = y();ASSERT( grid_is_solid(grd[newx][newy]) );if ( double_is_zero(slope) || slope > 100.0 )quadrant = bouncequad[quadrant][2];else if ( rc != 2 )quadrant = bouncequad[quadrant][rc];else{ASSERT( (oldx != newx) && (oldy != newy) );bool blocked_x = grid_is_solid(grd[oldx][newy]);bool blocked_y = grid_is_solid(grd[newx][oldy]);if ( blocked_x && blocked_y )quadrant = bouncequad[quadrant][rc];else if ( blocked_x )quadrant = bouncequad[quadrant][1];elsequadrant = bouncequad[quadrant][0];}advance();}
LR = newLR;// cells should already be initted. calculate the circle array.
int ray_def::advance(){int rc;switch ( quadrant ){case 0:// going down-rightrc = find_next_intercept( &accx, &accy, slope );return rc;case 1:// going down-leftaccx = 100.0 - EPSILON_VALUE/10.0 - accx;rc = find_next_intercept( &accx, &accy, slope );accx = 100.0 - EPSILON_VALUE/10.0 - accx;return rc;case 2:// going up-leftaccx = 100.0 - EPSILON_VALUE/10.0 - accx;accy = 100.0 - EPSILON_VALUE/10.0 - accy;rc = find_next_intercept( &accx, &accy, slope );accx = 100.0 - EPSILON_VALUE/10.0 - accx;accy = 100.0 - EPSILON_VALUE/10.0 - accy;return rc;case 3:// going up-rightaccy = 100.0 - EPSILON_VALUE/10.0 - accy;rc = find_next_intercept( &accx, &accy, slope );accy = 100.0 - EPSILON_VALUE/10.0 - accy;return rc;default:return -1;}}
// note that rows 0 and 1 will always go to infinity.circle[0] = circle[1] = CIRC_MAX;
// Shoot a ray from the given start point (accx, accy) with the given// slope, with a maximum distance (in either x or y coordinate) of// maxrange. Store the visited cells in xpos[] and ypos[], and// return the number of cells visited.static int shoot_ray( double accx, double accy, const double slope,int maxrange, int xpos[], int ypos[] ){int curx, cury;int cellnum;for ( cellnum = 0; true; ++cellnum ){find_next_intercept( &accx, &accy, slope );curx = (int)(accx);cury = (int)(accy);if ( curx > maxrange || cury > maxrange )break;
// for the rest, simply calculate max height based on light rad.for (i = 2; i <= LR; i++)
// work with the new squarexpos[cellnum] = curx;ypos[cellnum] = cury;}return cellnum;}// check if the passed ray has already been createdstatic bool is_duplicate_ray( int len, int xpos[], int ypos[] ){int cur_offset = 0;for ( unsigned int i = 0; i < raylengths.size(); ++i )
// check that Distance (I^2 + J^2) is no more than (R+0.5)^2// this rounding allows for *much* better looking circles.if (i * i + j * j <= LR * LR + LR){circle[i] = j;
if ( ray_coord_x[j + cur_offset] != xpos[j] ||ray_coord_y[j + cur_offset] != ypos[j] )
// got a blocker at row bX, cell bY. do all values// and scale by a factor of 10 for the integer math.int upper;
int cura = starta, curb = startb;int enda = starta + lengtha, endb = startb + lengthb;while ( cura < enda && curb < endb ){if ( ray_coord_x[curb] > ray_coord_x[cura] )return false;if ( ray_coord_y[curb] > ray_coord_y[cura] )return false;if ( ray_coord_x[cura] == ray_coord_x[curb] &&ray_coord_y[cura] == ray_coord_y[curb] )++cura;
return upper;
// return a vector which lists all the nonduped cellrays (by index)static std::vector<int> find_nonduped_cellrays(){// a cellray c in a fullray f is duped if there is a fullray g// such that g contains c and g[:c] is a subset of f[:c]int raynum, cellnum, curidx, testidx, testray, testcell;bool is_duplicate;std::vector<int> result;for (curidx=0, raynum=0;raynum < (int)raylengths.size();curidx += raylengths[raynum++]){for (cellnum = 0; cellnum < raylengths[raynum]; ++cellnum){// is the cellray raynum[cellnum] duplicated?is_duplicate = false;// XXX We should really check everything up to now// completely, and all further rays to see if they're// proper subsets.const int curx = ray_coord_x[curidx + cellnum];const int cury = ray_coord_y[curidx + cellnum];for (testidx = 0, testray = 0; testray < raynum;testidx += raylengths[testray++]){// scan ahead to see if there's an intersectfor ( testcell = 0; testcell < raylengths[raynum]; ++testcell ){const int testx = ray_coord_x[testidx + testcell];const int testy = ray_coord_y[testidx + testcell];// we can short-circuit sometimesif ( testx > curx || testy > cury )break;// bingo!if ( testx == curx && testy == cury ){is_duplicate = is_subset(testidx, curidx,testcell, cellnum);break;}}if ( is_duplicate )break; // no point in checking further rays}if ( !is_duplicate )result.push_back(curidx + cellnum);}}return result;
return (10 * (10 * bX + view)) / (10 * bY - view);
// not duplicate, registerfor ( int i = 0; i < raylen; ++i ){// create the cellraysray_coord_x.push_back(xpos[i]);ray_coord_y.push_back(ypos[i]);}// register the fullrayraylengths.push_back(raylen);ray_def ray;ray.accx = accx;ray.accy = accy;ray.slope = slope;ray.quadrant = 0;fullrays.push_back(ray);return true;
// for easy x,y octant translationstatic int xxcomp[8] = { 1, 0, 0, -1, -1, 0, 0, 1 };static int xycomp[8] = { 0, 1, -1, 0, 0, -1, 1, 0 };static int yxcomp[8] = { 0, 1, 1, 0, 0, -1, -1, 0 };static int yycomp[8] = { 1, 0, 0, 1, -1, 0, 0, -1 };static void los_octant(int o, FixedArray < unsigned int, 19, 19 > &sh,FixedArray < unsigned char, 80, 70 > &gr, int x_p,int y_p)
static void create_blockrays()
int row, cell, top, south;int tx, ty; // translated x, y deltas for this octantunsigned char gv; // grid valuebool row_dark, all_dark;bool blocker, vis_corner;int up_inc, low_inc;
// determine nonduplicated raysstd::vector<int> nondupe_cellrays = find_nonduped_cellrays();const unsigned int num_nondupe_rays = nondupe_cellrays.size();const unsigned int num_nondupe_words =(num_nondupe_rays + LONGSIZE - 1) / LONGSIZE;const unsigned int num_cellrays = ray_coord_x.size();const unsigned int num_words = (num_cellrays + LONGSIZE - 1) / LONGSIZE;
// leave [0,0] alone, because the old LOS code seems to.
// first build all the rays: easier to do blocking calculations thereunsigned long* full_los_blockrays;full_los_blockrays = new unsigned long[num_words * (LOS_MAX_RANGE_X+1) *(LOS_MAX_RANGE_Y+1)];memset((void*)full_los_blockrays, 0, sizeof(unsigned long) * num_words *(LOS_MAX_RANGE_X+1) * (LOS_MAX_RANGE_Y+1));
for (cell = 0; cell <= top; cell++)
}cur_offset += raylengths[ray];}// we've built the basic blockray array; now compress it, keeping// only the nonduplicated cellrays.// allocate and clear memorylos_blockrays = new unsigned long[num_nondupe_words * (LOS_MAX_RANGE_X+1) * (LOS_MAX_RANGE_Y + 1)];memset((void*)los_blockrays, 0, sizeof(unsigned long) * num_nondupe_words *(LOS_MAX_RANGE_X+1) * (LOS_MAX_RANGE_Y+1));// we want to only keep the cellrays from nondupe_cellrays.compressed_ray_x.resize(num_nondupe_rays);compressed_ray_y.resize(num_nondupe_rays);for ( unsigned int i = 0; i < num_nondupe_rays; ++i ){compressed_ray_x[i] = ray_coord_x[nondupe_cellrays[i]];compressed_ray_y[i] = ray_coord_y[nondupe_cellrays[i]];}unsigned long* oldptr = full_los_blockrays;unsigned long* newptr = los_blockrays;for ( int x = 0; x <= LOS_MAX_RANGE_X; ++x ){for ( int y = 0; y <= LOS_MAX_RANGE_Y; ++y )
// translate X,Y co'ord + bounds checktx = row * xxcomp[o] + cell * xycomp[o];ty = row * yxcomp[o] + cell * yycomp[o];
for ( unsigned int i = 0; i < num_nondupe_rays; ++i )if ( get_bit_in_long_array(oldptr, nondupe_cellrays[i]) )set_bit_in_long_array(newptr, i);oldptr += num_words;newptr += num_nondupe_words;}}// we can throw away full_los_blockrays nowdelete [] full_los_blockrays;dead_rays = new unsigned long[num_nondupe_words];#ifdef DEBUG_DIAGNOSTICSmprf( MSGCH_DIAGNOSTICS, "Cellrays: %d Fullrays: %u Compressed: %u",num_cellrays, raylengths.size(), num_nondupe_rays );#endif}static int gcd( int x, int y ){int tmp;while ( y != 0 ){x %= y;tmp = x;x = y;y = tmp;}return x;}
if (x_p + tx < 0 || x_p + tx > 79 || y_p + ty < 0 || y_p + ty > 69)continue;
// Cast all raysvoid raycast(){static bool done_raycast = false;if ( done_raycast )return;// Creating all rays for first quadrant// We have a considerable amount of overkill.done_raycast = true;
// check for all_dark - we've finished the octant but// have yet to fill in '0' for the rest of the sight gridif (all_dark == true){sh[sh_xo + tx][sh_yo + ty] = 0;continue;}
int xangle, yangle;// register perpendiculars FIRST, to make them top choice// when selecting beamsregister_ray( 0.5, 0.5, 1000.0 );register_ray( 0.5, 0.5, 0.0 );
// get grid value.. see if it blocks LOSgv = gr[x_p + tx][y_p + ty];blocker = (gv < MINSEE);
// For a slope of M = y/x, every x we move on the X axis means// that we move y on the y axis. We want to look at the resolution// of x/y: in that case, every step on the X axis means an increase// of 1 in the Y axis at the intercept point. We can assume gcd(x,y)=1,// so we look at steps of 1/y.for ( xangle = 1; xangle <= LOS_MAX_RANGE; ++xangle ) {for ( yangle = 1; yangle <= LOS_MAX_RANGE; ++yangle ) {
// STEP 1 - inherit values from immediate West, if possibleif (cell < row){// check for delayed lightingif (cells[cell].lit_delay){if (!blocker){ // blockers don't light up with lit_delay.if (cells[south].lit){if (cells[south].low_max != 0){cells[cell].lit = false;// steal lower valuescells[cell].low_max = cells[south].low_max;cells[cell].low_count = cells[south].low_count;cells[south].low_count = 0;cells[south].low_max = 0;low_inc = 0; // avoid double-inc.}elsecells[cell].lit = true;}}cells[cell].lit_delay = false;}}else{// initialize new cell.cells[cell].init();
const double slope = ((double)(yangle)) / xangle;const double rslope = ((double)(xangle)) / yangle;for ( int intercept = 0; intercept <= yangle; ++intercept ) {double xstart = ((double)(intercept)) / yangle;if ( intercept == 0 )xstart += EPSILON_VALUE / 10.0;if ( intercept == yangle )xstart -= EPSILON_VALUE / 10.0;// y should be "about to change"register_ray( xstart, 1.0 - EPSILON_VALUE / 10.0, slope );// also draw the identical ray in octant 2register_ray( 1.0 - EPSILON_VALUE / 10.0, xstart, rslope );
// STEP 2 - check for blocker// a dark blocker in shadow's edge will be visibleif (blocker){if (cells[cell].lit || (cell != 0 && cells[south].lit)|| vis_corner){// hack: make 'corners' visiblevis_corner = cells[cell].lit;
// Now create the appropriate blockrays arraycreate_blockrays();}static void set_ray_quadrant( ray_def& ray, int sx, int sy, int tx, int ty ){if ( tx >= sx && ty >= sy )ray.quadrant = 0;else if ( tx < sx && ty >= sy )ray.quadrant = 1;else if ( tx < sx && ty < sy )ray.quadrant = 2;else if ( tx >= sx && ty < sy )ray.quadrant = 3;elsempr("Bad ray quadrant!", MSGCH_DIAGNOSTICS);}
int upper = calcUpper(row, cell);int lower = calcLower(row, cell);
// Find a nonblocked ray from sx, sy to tx, ty. Return false if no// such ray could be found, otherwise return true and fill ray// appropriately.// If allow_fallback is true, fall back to a center-to-center ray// if range is too great or all rays are blocked.bool find_ray( int sourcex, int sourcey, int targetx, int targety,bool allow_fallback, ray_def& ray ){int cellray, inray;const int signx = ((targetx - sourcex >= 0) ? 1 : -1);const int signy = ((targety - sourcey >= 0) ? 1 : -1);const int absx = signx * (targetx - sourcex);const int absy = signy * (targety - sourcey);int cur_offset = 0;for ( unsigned int fullray = 0; fullray < fullrays.size();cur_offset += raylengths[fullray++] ) {
if (upper < cells[cell].up_max || cells[cell].up_max == 0){// new upper shadowcells[cell].up_max = upper;cells[cell].up_count = 0;up_inc = 0;}
for ( cellray = 0; cellray < raylengths[fullray]; ++cellray ){if ( ray_coord_x[cellray + cur_offset] == absx &&ray_coord_y[cellray + cur_offset] == absy ) {
if (lower > cells[cell].low_max || cells[cell].low_max == 0)
// check if we're blocked so farbool blocked = false;for ( inray = 0; inray < cellray; ++inray ) {if (grid_is_solid(grd[sourcex + signx * ray_coord_x[inray + cur_offset]][sourcey + signy * ray_coord_y[inray + cur_offset]]))
cells[cell].visible = false;
// success!ray = fullrays[fullray];if ( sourcex > targetx )ray.accx = 1.0 - ray.accx;if ( sourcey > targety )ray.accy = 1.0 - ray.accy;ray.accx += sourcex;ray.accy += sourcey;set_ray_quadrant(ray, sourcex, sourcey, targetx, targety);return true;
else{cells[cell].visible = false; // special flags for blockers}// STEP 3 - add increments to upper, lower countscells[cell].up_count += up_inc;cells[cell].low_count += low_inc;
}}if ( allow_fallback ) {ray.accx = sourcex + 0.5;ray.accy = sourcey + 0.5;if ( targetx == sourcex )ray.slope = 10000.0;else {ray.slope = targety - sourcey;ray.slope /= targetx - sourcex;if ( ray.slope < 0 )ray.slope = -ray.slope;}set_ray_quadrant(ray, sourcex, sourcey, targetx, targety);return true;}return false;}
// STEP 4 - check south for darkif (south >= 0)if (cells[south].reachedUpper() == true){if (cells[cell].reachedUpper() == false){cells[cell].up_max = cells[south].up_max;cells[cell].up_count = cells[south].up_count;cells[cell].up_count -= cells[south].up_max;}cells[cell].lit = false;cells[cell].visible = false;}
// The rule behind LOS is:// Two cells can see each other if there is any line from some point// of the first to some point of the second ("generous" LOS.)//// We use raycasting. The algorithm:// PRECOMPUTATION:// Create a large bundle of rays and cast them.// Mark, for each one, which cells kill it (and where.)// Also, for each one, note which cells it passes.// ACTUAL LOS:// Unite the ray-killers for the given map; this tells you which rays// are dead.// Look up which cells the surviving rays have, and that's your LOS!// OPTIMIZATIONS:// WLOG, we can assume that we're in a specific quadrant - say the// first quadrant - and just mirror everything after that. We can// likely get away with a single octant, but we don't do that. (To// do...)// Rays are actually split by each cell they pass. So each "ray" only// identifies a single cell, and we can do logical ORs. Once a cell// kills a cellray, it will kill all remaining cellrays of that ray.// Also, rays are checked to see if they are duplicates of each// other. If they are, they're eliminated.// Some cellrays can also be eliminated. In general, a cellray is// unnecessary if there is another cellray with the same coordinates,// and whose path (up to those coordinates) is a subset, not necessarily// proper, of the original path. We still store the original cellrays// fully for beam detection and such.// PERFORMANCE:// With reasonable values we have around 6000 cellrays, meaning// around 600Kb (75 KB) of data. This gets cut down to 700 cellrays// after removing duplicates. That means that we need to do// around 22*100*4 ~ 9,000 memory reads + writes per LOS call on a// 32-bit system. Not too bad.void losight(FixedArray < unsigned int, 19, 19 > &sh,FixedArray < unsigned char, 80, 70 > &gr, int x_p, int y_p){raycast();// go quadrant by quadrantint quadrant_x[4] = { 1, -1, -1, 1 };int quadrant_y[4] = { 1, 1, -1, -1 };
// STEP 5 - nuke lower if south lowerif (south >= 0){if (cells[south].reachedLower()){cells[cell].low_max = cells[south].low_max;cells[cell].low_count = cells[south].low_count;cells[cell].low_count -= cells[south].low_max;cells[south].low_count = cells[south].low_max = 0;}
// clear out shfor ( int i = 0; i < 19; ++i )for ( int j = 0; j < 19; ++j )sh[i][j] = 0;
if (cells[south].low_max != 0|| (cells[south].lit == false&& cells[south].low_max == 0)){cells[cell].low_count = cells[cell].low_max + 10;}}
const unsigned int num_cellrays = compressed_ray_x.size();const unsigned int num_words = (num_cellrays + LONGSIZE - 1) / LONGSIZE;
// now place appropriate value in shif (cells[cell].lit == true|| (blocker == true && cells[cell].visible == true)){sh[sh_xo + tx][sh_yo + ty] = gv;}elsesh[sh_xo + tx][sh_yo + ty] = 0;
// clear out the dead rays arraymemset( (void*)dead_rays, 0, sizeof(unsigned long) * num_words);
if (cells[cell].lit == true)row_dark = false;} // end for - cells
// kill all blocked raysconst unsigned long* inptr = los_blockrays;for ( int xdiff = 0; xdiff <= LOS_MAX_RANGE_X; ++xdiff ) {for (int ydiff = 0; ydiff <= LOS_MAX_RANGE_Y;++ydiff, inptr += num_words ) {const int realx = x_p + xdiff * xmult;const int realy = y_p + ydiff * ymult;
void losight(FixedArray < unsigned int, 19, 19 > &sh,FixedArray < unsigned char, 80, 70 > &gr, int x_p, int y_p){int o;
// if this cell is opaque...if ( grid_is_opaque(gr[realx][realy])) {// then block the appropriate raysfor ( unsigned int i = 0; i < num_words; ++i )dead_rays[i] |= inptr[i];}}}
for (o = 0; o < 8; o++)los_octant(o, sh, gr, x_p, y_p);
// ray calculation done, now work out which cells in this// quadrant are visibleunsigned int rayidx = 0;for ( unsigned int wordloc = 0; wordloc < num_words; ++wordloc ) {const unsigned long curword = dead_rays[wordloc];// Note: the last word may be incompletefor ( unsigned int bitloc = 0; bitloc < LONGSIZE; ++bitloc) {// make the cells seen by this ray at this point visibleif ( ((curword >> bitloc) & 1UL) == 0 ) {// this ray is alive!const int realx = xmult * compressed_ray_x[rayidx];const int realy = ymult * compressed_ray_y[rayidx];// update shadow mapif (x_p + realx >= 0 && x_p + realx < 80 &&y_p + realy >= 0 && y_p + realy < 70 &&realx * realx + realy * realy <= los_radius_squared )sh[sh_xo+realx][sh_yo+realy]=gr[x_p+realx][y_p+realy];}++rayidx;if ( rayidx == num_cellrays )break;}}}
#ifdef USE_CURSES// NOTE: This affects libunix.cc draw state; use this just before setting// textcolour and drawing a character and call set_altcharset(false)// after you're done drawing.//static int cset_adjust(int raw){if (Options.char_set != CSET_ASCII){// switch to alternate char set for 8-bit characters:set_altcharset( raw > 127 );
env.map[i][j] = mapch(grd[i + 1][j + 1]);
{if (!get_envmap_char(i, j))set_envmap_char(i, j, get_magicmap_char(grd[i][j]));// Hack to give demonspawn Pandemonium mutation the ability// to detect exits magically.if ((you.mutation[MUT_PANDEMONIUM] > 1&& grd[i][j] == DNGN_EXIT_PANDEMONIUM)// Wizmode|| map_radius == 1000)set_terrain_seen( i, j );elseset_terrain_mapped( i, j );}
/* mapchars 3 & 4 are for non-ibm char sets */unsigned char mapchar(unsigned char ldfk){unsigned char showed = 0;switch (ldfk){case DNGN_UNSEEN:showed = 0;break;case DNGN_SECRET_DOOR:case DNGN_ROCK_WALL:case DNGN_PERMAROCK_WALL:case DNGN_STONE_WALL:case DNGN_METAL_WALL:case DNGN_GREEN_CRYSTAL_WALL:case DNGN_WAX_WALL:showed = 176;break;case DNGN_CLOSED_DOOR:showed = 206;break;case 20: // orcish idolcase 24: // ???case 25: // ???case DNGN_SILVER_STATUE:case DNGN_GRANITE_STATUE:case DNGN_ORANGE_CRYSTAL_STATUE:showed = '8';break;case DNGN_LAVA_X:case DNGN_WATER_X:case DNGN_LAVA:case DNGN_DEEP_WATER:case DNGN_SHALLOW_WATER:showed = 247;break;case DNGN_FLOOR:case DNGN_UNDISCOVERED_TRAP:showed = 250;break;//case 68: showed = '>'; break; // < (60)case DNGN_OPEN_DOOR:showed = 39;break;//case 72: showed = '<'; break;case DNGN_TRAP_MECHANICAL:case DNGN_TRAP_MAGICAL:case DNGN_TRAP_III:showed = '^';break;case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:case DNGN_ROCK_STAIRS_DOWN:case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:showed = '>';break;case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:case DNGN_ROCK_STAIRS_UP:case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:showed = '<';break;case DNGN_ENTER_HELL:case DNGN_ENTER_LABYRINTH:case DNGN_ENTER_SHOP:case DNGN_ENTER_DIS:case DNGN_ENTER_GEHENNA:case DNGN_ENTER_COCYTUS:case DNGN_ENTER_TARTARUS:case DNGN_ENTER_ABYSS:case DNGN_EXIT_ABYSS:case DNGN_STONE_ARCH:case DNGN_ENTER_PANDEMONIUM:case DNGN_EXIT_PANDEMONIUM:case DNGN_TRANSIT_PANDEMONIUM:case DNGN_ENTER_ZOT:case DNGN_RETURN_FROM_ZOT:showed = 239;break;case DNGN_ALTAR_ZIN:case DNGN_ALTAR_SHINING_ONE:case DNGN_ALTAR_KIKUBAAQUDGHA:case DNGN_ALTAR_YREDELEMNUL:case DNGN_ALTAR_XOM:case DNGN_ALTAR_VEHUMET:case DNGN_ALTAR_OKAWARU:case DNGN_ALTAR_MAKHLEB:case DNGN_ALTAR_SIF_MUNA:case DNGN_ALTAR_TROG:case DNGN_ALTAR_NEMELEX_XOBEH:case DNGN_ALTAR_ELYVILON:showed = 220;break;case DNGN_BLUE_FOUNTAIN:case DNGN_DRY_FOUNTAIN_I:case DNGN_SPARKLING_FOUNTAIN:case DNGN_DRY_FOUNTAIN_II:case DNGN_DRY_FOUNTAIN_III:case DNGN_DRY_FOUNTAIN_IV:case DNGN_DRY_FOUNTAIN_V:case DNGN_DRY_FOUNTAIN_VI:case DNGN_DRY_FOUNTAIN_VII:case DNGN_DRY_FOUNTAIN_VIII:case DNGN_PERMADRY_FOUNTAIN:showed = 159;break;default:showed = 0;break;}return showed;}unsigned char mapchar2(unsigned char ldfk){unsigned char showed = 0;switch (ldfk){case DNGN_UNSEEN:showed = 0;break;case DNGN_SECRET_DOOR:case DNGN_ROCK_WALL:case DNGN_PERMAROCK_WALL:case DNGN_STONE_WALL:case DNGN_METAL_WALL:case DNGN_GREEN_CRYSTAL_WALL:case DNGN_WAX_WALL:showed = 177;break;case DNGN_CLOSED_DOOR:showed = 254;break;//case DNGN_LAVA_X: showed = 247; break; // deprecated? {dlb}//case DNGN_WATER_X: showed = 247; break; // deprecated? {dlb}case 20: // orcish idolcase 24: // ???case 25: // ???case DNGN_SILVER_STATUE:case DNGN_GRANITE_STATUE:case DNGN_ORANGE_CRYSTAL_STATUE:showed = '8';break;case DNGN_LAVA:case DNGN_DEEP_WATER:case DNGN_SHALLOW_WATER:showed = 247;break;case DNGN_FLOOR:case DNGN_UNDISCOVERED_TRAP:showed = 249;break;case 68:showed = '>';break; // <case DNGN_OPEN_DOOR:showed = 39;break;case 72:showed = '<';break; // <case DNGN_TRAP_MECHANICAL:case DNGN_TRAP_MAGICAL:case DNGN_TRAP_III:showed = '^';break;case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:case DNGN_ROCK_STAIRS_DOWN:case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:showed = '>';break;case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:case DNGN_ROCK_STAIRS_UP:case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:showed = '<';break;case DNGN_ENTER_HELL:case DNGN_ENTER_LABYRINTH:case DNGN_ENTER_SHOP:case DNGN_ENTER_DIS:case DNGN_ENTER_GEHENNA:case DNGN_ENTER_COCYTUS:case DNGN_ENTER_TARTARUS:case DNGN_ENTER_ABYSS:case DNGN_EXIT_ABYSS:case DNGN_STONE_ARCH:case DNGN_ENTER_PANDEMONIUM:case DNGN_EXIT_PANDEMONIUM:case DNGN_TRANSIT_PANDEMONIUM:case DNGN_ENTER_ZOT:case DNGN_RETURN_FROM_ZOT:showed = 239;break;case DNGN_ALTAR_ZIN:case DNGN_ALTAR_SHINING_ONE:case DNGN_ALTAR_KIKUBAAQUDGHA:case DNGN_ALTAR_YREDELEMNUL:case DNGN_ALTAR_XOM:case DNGN_ALTAR_VEHUMET:case DNGN_ALTAR_OKAWARU:case DNGN_ALTAR_MAKHLEB:case DNGN_ALTAR_SIF_MUNA:case DNGN_ALTAR_TROG:case DNGN_ALTAR_NEMELEX_XOBEH:case DNGN_ALTAR_ELYVILON:showed = 220;break;
case DNGN_BLUE_FOUNTAIN:case DNGN_DRY_FOUNTAIN_I:case DNGN_SPARKLING_FOUNTAIN:case DNGN_DRY_FOUNTAIN_II:case DNGN_DRY_FOUNTAIN_III:case DNGN_DRY_FOUNTAIN_IV:case DNGN_DRY_FOUNTAIN_V:case DNGN_DRY_FOUNTAIN_VI:case DNGN_DRY_FOUNTAIN_VII:case DNGN_DRY_FOUNTAIN_VIII:case DNGN_PERMADRY_FOUNTAIN:showed = 159;break;default:showed = 0;break;}return showed;}
//---------------------------------------------------------------//// get_non_ibm_symbol//// Returns the character code and color for everything drawn// without the IBM graphics option.////---------------------------------------------------------------void get_non_ibm_symbol(unsigned int object, unsigned short *ch,unsigned short *color)
// check env.show arrayif (grid_distance( grx, gry, you.x_pos, you.y_pos ) < 9){const int ex = grx - you.x_pos + 9;const int ey = gry - you.y_pos + 9;if (env.show[ex][ey])return (true);}return (false);} // end see_grid()static const unsigned char table[ NUM_CSET ][ NUM_DCHAR_TYPES ] =
ASSERT(color != NULL);ASSERT(ch != NULL);
// CSET_ASCII{'#', '*', '.', ',', '\'', '+', '^', '>', '<', // wall, stairs up'_', '\\', '}', '{', '8', '~', '~', // altar, item detect'0', ')', '[', '/', '%', '?', '=', '!', '(', // orb, missile':', '|', '}', '%', '$', '"', '#', // book, cloud},
case DNGN_UNSEEN:*ch = 0;break;
// CSET_DEC - remember: 224-255 are mapped to shifted 96-127{225, 224, 254, ':', '\'', 238, '^', '>', '<', // wall, stairs up251, 182, 167, 187, '8', 171, 168, // altar, item detect'0', ')', '[', '/', '%', '?', '=', '!', '(', // orb, missile'+', '\\', '}', '%', '$', '"', '#', // book, cloud},};
case DNGN_STONE_WALL:if (player_in_branch( BRANCH_HALL_OF_ZOT ))*color = env.rock_colour;
dungeon_char_type dchar_by_name(const std::string &name){const char *dchar_names[] ={"wall", "wall_magic", "floor", "floor_magic", "door_open","door_closed", "trap", "stairs_down", "stairs_up", "altar", "arch","fountain", "wavy", "statue", "invis_exposed", "item_detected","item_orb", "item_weapon", "item_armour", "item_wand", "item_food","item_scroll", "item_ring", "item_potion", "item_missile", "item_book","item_stave", "item_miscellany", "item_corpse", "item_gold","item_amulet", "cloud"};for (unsigned i = 0; i < sizeof(dchar_names) / sizeof(*dchar_names); ++i){if (dchar_names[i] == name)return dungeon_char_type(i);}return (NUM_DCHAR_TYPES);}void clear_cset_overrides(){memset(cset_override, 0, sizeof cset_override);}static unsigned short read_symbol(std::string s){if (s.empty())return (0);if (s.length() == 1)return s[0];if (s[0] == '\\')s = s.substr(1);int feat = atoi(s.c_str());if (feat < 0)feat = 0;return static_cast<unsigned short>(feat);}void add_cset_override(char_set_type set, dungeon_char_type dc,unsigned char symbol){cset_override[set][dc] = symbol;}void add_cset_override(char_set_type set, const std::string &overrides){std::vector<std::string> overs = split_string(",", overrides);for (int i = 0, size = overs.size(); i < size; ++i){std::vector<std::string> mapping = split_string(":", overs[i]);if (mapping.size() != 2)continue;dungeon_char_type dc = dchar_by_name(mapping[0]);if (dc == NUM_DCHAR_TYPES)continue;unsigned char symbol =static_cast<unsigned char>(read_symbol(mapping[1]));if (set == NUM_CSET)for (int c = 0; c < NUM_CSET; ++c)add_cset_override(char_set_type(c), dc, symbol);
case DNGN_GREEN_CRYSTAL_WALL:*ch = '#';*color = GREEN;break;
std::string::size_type spos = text.rfind("{", epos);if (spos == std::string::npos)return;std::string fname = text.substr(0, spos);std::string props = text.substr(spos + 1, epos - spos - 1);std::vector<std::string> iprops = split_string(",", props, true, true);
case DNGN_GRANITE_STATUE:*ch = '8';*color = LIGHTGREY;break;
for (int i = 0, size = feats.size(); i < size; ++i){feature_override fov;fov.feat = feats[i];fov.override.symbol = read_symbol(iprops[0]);fov.override.magic_symbol = read_symbol(iprops[1]);fov.override.colour = str_to_colour(iprops[2], BLACK);fov.override.map_colour = str_to_colour(iprops[3], BLACK);fov.override.seen_colour = str_to_colour(iprops[4], BLACK);
case DNGN_LAVA:*ch = '{';*color = RED;break;
void apply_feature_overrides(){for (int i = 0, size = Feature_Overrides.size(); i < size; ++i){const feature_override &fov = Feature_Overrides[i];const feature_def &ofeat = fov.override;feature_def &feat = Feature[fov.feat];
case DNGN_DEEP_WATER:*ch = '{';// this wavy thing also used for water elemental// note that some monsters which use IBM graphics aren't set// for this function - too tricky for now.*color = BLUE;break;
if (ofeat.symbol)feat.symbol = ofeat.symbol;if (ofeat.magic_symbol)feat.magic_symbol = ofeat.magic_symbol;if (ofeat.colour)feat.colour = ofeat.colour;if (ofeat.map_colour)feat.map_colour = ofeat.map_colour;if (ofeat.seen_colour)feat.seen_colour = ofeat.seen_colour;}}
case DNGN_SHALLOW_WATER:*color = CYAN;*ch = '{';break;
void init_feature_table( void ){for (int i = 0; i < NUM_FEATURES; i++){Feature[i].symbol = 0;Feature[i].colour = BLACK; // means must be set some other wayFeature[i].notable = false;Feature[i].seen_effect = false;Feature[i].magic_symbol = 0; // made equal to symbol if untouchedFeature[i].map_colour = DARKGREY;Feature[i].seen_colour = BLACK; // marks no special seen map handling
case DNGN_ENTER_HELL:*color = RED;*ch = '\\';seen_other_thing(DNGN_ENTER_HELL);break;
case DNGN_ROCK_WALL:case DNGN_PERMAROCK_WALL:Feature[i].symbol = Options.char_table[ DCHAR_WALL ];Feature[i].colour = EC_ROCK;Feature[i].magic_symbol = Options.char_table[ DCHAR_WALL_MAGIC ];break;
case DNGN_TRAP_III:*color = LIGHTGREY;*ch = '^';break;
case DNGN_SECRET_DOOR:// Note: get_secret_door_appearance means this probably isn't usedFeature[i].symbol = Options.char_table[ DCHAR_WALL ];Feature[i].colour = EC_ROCK;Feature[i].magic_symbol = Options.char_table[ DCHAR_WALL_MAGIC ];break;
case DNGN_UNDISCOVERED_TRAP:*color = env.floor_colour;*ch = '.';break;
case DNGN_GREEN_CRYSTAL_WALL:Feature[i].symbol = Options.char_table[ DCHAR_WALL ];Feature[i].colour = GREEN;Feature[i].magic_symbol = Options.char_table[ DCHAR_WALL_MAGIC ];break;
case DNGN_ENTER_SHOP:*color = YELLOW;*ch = '\\';seen_other_thing(DNGN_ENTER_SHOP);break;// if I change anything above here, must also change magic mapping!
case DNGN_ORCISH_IDOL:Feature[i].symbol = Options.char_table[ DCHAR_STATUE ];Feature[i].colour = DARKGREY;break;
case DNGN_ENTER_LABYRINTH:*color = LIGHTGREY;*ch = '\\';seen_other_thing(DNGN_ENTER_LABYRINTH);break;
case DNGN_WAX_WALL:Feature[i].symbol = Options.char_table[ DCHAR_WALL ];Feature[i].colour = YELLOW;Feature[i].magic_symbol = Options.char_table[ DCHAR_WALL_MAGIC ];break; // wax wall
case DNGN_ROCK_STAIRS_DOWN:*color = BROWN; // laddercase DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:*ch = '>';break;
case DNGN_SILVER_STATUE:Feature[i].symbol = Options.char_table[ DCHAR_STATUE ];Feature[i].colour = WHITE;Feature[i].seen_effect = true;break;
case DNGN_ROCK_STAIRS_UP:*color = BROWN; // laddercase DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:*ch = '<';break;
case DNGN_GRANITE_STATUE:Feature[i].symbol = Options.char_table[ DCHAR_STATUE ];Feature[i].colour = LIGHTGREY;break;
case DNGN_ENTER_ABYSS:*color = random2(16);*ch = '\\';seen_other_thing(DNGN_ENTER_ABYSS);break;
case DNGN_FLOOR:Feature[i].symbol = Options.char_table[ DCHAR_FLOOR ];Feature[i].colour = EC_FLOOR;Feature[i].magic_symbol = Options.char_table[ DCHAR_FLOOR_MAGIC ];break;
case DNGN_EXIT_ABYSS:*color = random2(16);*ch = '\\';break;
case DNGN_EXIT_HELL:Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].colour = LIGHTRED;Feature[i].notable = false;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = LIGHTRED;break;
case DNGN_STONE_ARCH:*color = LIGHTGREY;*ch = '\\';break;
case DNGN_ENTER_HELL:Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].colour = RED;Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = RED;break;
case DNGN_ENTER_PANDEMONIUM:*color = LIGHTBLUE;*ch = '\\';seen_other_thing(DNGN_ENTER_PANDEMONIUM);break;
case DNGN_TRAP_MECHANICAL:Feature[i].colour = LIGHTCYAN;Feature[i].symbol = Options.char_table[ DCHAR_TRAP ];Feature[i].map_colour = LIGHTCYAN;break;
case DNGN_TRANSIT_PANDEMONIUM:*color = LIGHTGREEN;*ch = '\\';break; // gate to other part of pandemonium
case DNGN_TRAP_III:Feature[i].colour = LIGHTGREY;Feature[i].symbol = Options.char_table[ DCHAR_TRAP ];Feature[i].map_colour = LIGHTGREY;break;
case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:*color = YELLOW;*ch = '>';seen_staircase(object);break;
case DNGN_UNDISCOVERED_TRAP:Feature[i].symbol = Options.char_table[ DCHAR_FLOOR ];Feature[i].colour = EC_FLOOR;Feature[i].magic_symbol = Options.char_table[ DCHAR_FLOOR_MAGIC ];break;
case DNGN_ENTER_ZOT:*color = MAGENTA;*ch = '\\';seen_staircase(object);break;
case DNGN_ENTER_SHOP:Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].colour = YELLOW;Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = YELLOW;break;
case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:*color = YELLOW;*ch = '<';break;
case DNGN_ENTER_LABYRINTH:Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].colour = CYAN;Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = CYAN;break;
case DNGN_RETURN_FROM_ZOT:*color = MAGENTA;*ch = '\\';break;
case DNGN_ROCK_STAIRS_DOWN:case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:Feature[i].symbol = Options.char_table[ DCHAR_STAIRS_DOWN ];Feature[i].colour = ((i == DNGN_ROCK_STAIRS_DOWN) ? BROWN: LIGHTGREY);Feature[i].map_colour = RED;break;
case DNGN_ALTAR_ZIN:*color = WHITE;*ch = '_';seen_altar(GOD_ZIN);break;
case DNGN_ROCK_STAIRS_UP:case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:Feature[i].symbol = Options.char_table[ DCHAR_STAIRS_UP ];Feature[i].colour = ((i == DNGN_ROCK_STAIRS_UP) ? BROWN: LIGHTGREY);Feature[i].map_colour = GREEN;break;
case DNGN_ALTAR_SHINING_ONE:*color = YELLOW;*ch = '_';seen_altar(GOD_SHINING_ONE);break;
case DNGN_ENTER_DIS:Feature[i].colour = CYAN;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = CYAN;break;
case DNGN_ALTAR_KIKUBAAQUDGHA:*color = DARKGREY;*ch = '_';seen_altar(GOD_KIKUBAAQUDGHA);break;
case DNGN_ENTER_GEHENNA:Feature[i].colour = RED;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = RED;break;
case DNGN_ALTAR_YREDELEMNUL:*color = DARKGREY;if (one_chance_in(3))*color = RED;*ch = '_';seen_altar(GOD_YREDELEMNUL);break;
case DNGN_ENTER_COCYTUS:Feature[i].colour = LIGHTCYAN;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = LIGHTCYAN;break;
case DNGN_ALTAR_XOM:*color = random_colour();*ch = '_';seen_altar(GOD_XOM);break;
case DNGN_ENTER_TARTARUS:Feature[i].colour = DARKGREY;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = DARKGREY;break;
case DNGN_ALTAR_VEHUMET:*color = LIGHTBLUE;if (one_chance_in(3))*color = LIGHTMAGENTA;if (one_chance_in(3))*color = LIGHTRED;*ch = '_';seen_altar(GOD_VEHUMET);break;
case DNGN_ENTER_ABYSS:Feature[i].colour = EC_RANDOM;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = EC_RANDOM;break;
case DNGN_ALTAR_MAKHLEB:*color = RED;if (one_chance_in(3))*color = LIGHTRED;if (one_chance_in(3))*color = YELLOW;*ch = '_';seen_altar(GOD_MAKHLEB);break;
case DNGN_STONE_ARCH:Feature[i].colour = LIGHTGREY;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].map_colour = LIGHTGREY;break;
case DNGN_ALTAR_SIF_MUNA:*color = BLUE;*ch = '_';seen_altar(GOD_SIF_MUNA);break;
case DNGN_ENTER_PANDEMONIUM:Feature[i].colour = LIGHTBLUE;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = LIGHTBLUE;break;
case DNGN_ALTAR_TROG:*color = RED;*ch = '_';seen_altar(GOD_TROG);break;
case DNGN_EXIT_PANDEMONIUM:// Note: has special handling for colouring with mutationFeature[i].colour = LIGHTBLUE;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = LIGHTBLUE;break;
case DNGN_ALTAR_NEMELEX_XOBEH:*color = LIGHTMAGENTA;*ch = '_';seen_altar(GOD_NEMELEX_XOBEH);break;
case DNGN_TRANSIT_PANDEMONIUM:Feature[i].colour = LIGHTGREEN;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = LIGHTGREEN;break;
case DNGN_ALTAR_ELYVILON:*color = LIGHTGREY;*ch = '_';seen_altar(GOD_ELYVILON);break;
case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case DNGN_ENTER_RESERVED_1:case DNGN_ENTER_RESERVED_2:case DNGN_ENTER_RESERVED_3:case DNGN_ENTER_RESERVED_4:Feature[i].colour = YELLOW;Feature[i].symbol = Options.char_table[ DCHAR_STAIRS_DOWN ];Feature[i].notable = true;Feature[i].map_colour = RED;Feature[i].seen_colour = LIGHTRED;break;
case DNGN_BLUE_FOUNTAIN:*color = BLUE;*ch = '}';break;
case DNGN_ENTER_ZOT:Feature[i].colour = MAGENTA;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].notable = true;Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = MAGENTA;break;
case DNGN_SPARKLING_FOUNTAIN:*color = LIGHTBLUE;*ch = '}';break;
case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case DNGN_RETURN_RESERVED_1:case DNGN_RETURN_RESERVED_2:case DNGN_RETURN_RESERVED_3:case DNGN_RETURN_RESERVED_4:Feature[i].colour = YELLOW;Feature[i].symbol = Options.char_table[ DCHAR_STAIRS_UP ];Feature[i].map_colour = BLUE;Feature[i].seen_colour = LIGHTBLUE;break;
case DNGN_DRY_FOUNTAIN_I:case DNGN_DRY_FOUNTAIN_II:case DNGN_PERMADRY_FOUNTAIN:*color = LIGHTGREY;*ch = '}';break;
case DNGN_RETURN_FROM_ZOT:Feature[i].colour = MAGENTA;Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];Feature[i].map_colour = LIGHTGREY;Feature[i].seen_colour = MAGENTA;break;
case 257:*color = CYAN;*ch = '~';break; /* Invis creature walking through water */
case DNGN_ALTAR_SHINING_ONE:Feature[i].colour = YELLOW;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = YELLOW;break;
case 258:*ch = ')';break; // weapon )
case DNGN_ALTAR_KIKUBAAQUDGHA:Feature[i].colour = DARKGREY;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = DARKGREY;break;
case 259:*ch = '[';break; // armour [
case DNGN_ALTAR_YREDELEMNUL:Feature[i].colour = EC_UNHOLY;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = EC_UNHOLY;break;
case 260:*ch = '/';break; // wands, etc.
case DNGN_ALTAR_XOM:Feature[i].colour = EC_RANDOM;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = EC_RANDOM;break;
case 261:*ch = '%';break; // food
case DNGN_ALTAR_VEHUMET:Feature[i].colour = EC_VEHUMET;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = EC_VEHUMET;break;
case 263:*ch = '?';break; // scroll ?
case DNGN_ALTAR_MAKHLEB:Feature[i].colour = EC_FIRE;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = EC_FIRE;break;
case 266:*ch = '(';break; // stones
case DNGN_ALTAR_NEMELEX_XOBEH:Feature[i].colour = LIGHTMAGENTA;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = LIGHTMAGENTA;break;
case 267:*ch = ':';break; // book +
case DNGN_ALTAR_ELYVILON:Feature[i].colour = LIGHTGREY;Feature[i].symbol = Options.char_table[ DCHAR_ALTAR ];Feature[i].notable = true;Feature[i].map_colour = DARKGREY;Feature[i].seen_colour = LIGHTGREY;break;
/*This is the viewwindow function for computers without IBM graphic displays.It is activated by a command line argument, which sets a function pointer.*/void viewwindow3(char draw_it, bool do_updates){int bufcount = 0;FixedVector < unsigned short, 1500 > buffy; //[800]; //392];
case DNGN_ITEM_WAND:Feature[i].symbol = Options.char_table[ DCHAR_ITEM_WAND ];break;
for (count_x = 0; count_x < 18; count_x++){for (count_y = 0; count_y < 18; count_y++){env.show_col[count_x][count_y] = LIGHTGREY;show_backup[count_x][count_y] = 0;}}
case DNGN_ITEM_POTION:Feature[i].symbol = Options.char_table[ DCHAR_ITEM_POTION ];break;
if (player_is_swimming()){color = (grd[you.x_pos][you.y_pos] == DNGN_DEEP_WATER)? BLUE : CYAN;}else{color = your_colour;}}else{unsigned int object = env.show[count_x - you.x_pos + 9][count_y - you.y_pos + 9];
case DNGN_ITEM_CORPSE:Feature[i].symbol = Options.char_table[ DCHAR_ITEM_CORPSE ];break;
if (you.level_type != LEVEL_LABYRINTH&& you.level_type != LEVEL_ABYSS){for (count_y = 0; count_y < 17; count_y++){bufcount += 16;for (count_x = 0; count_x < 17; count_x++){int enx = count_x + you.x_pos - 9,eny = count_y + you.y_pos - 9;if (buffy[bufcount] != 0 && enx >= 0 && eny >= 0&& enx + 1 < GXM && eny + 1 < GYM){unsigned short bch = buffy[bufcount];if (mgrd[enx + 1][eny + 1] != NON_MONSTER) {const monsters &m = menv[ mgrd[enx + 1][eny + 1] ];if (!mons_is_mimic(m.type)&& mons_char(m.type) == bch){bch |= mons_colour(m.type) << 12;}}env.map[enx][eny] = bch;}
for (int i = 0; i < NUM_FEATURES; ++i){if (!Feature[i].magic_symbol)Feature[i].magic_symbol = Feature[i].symbol;
if (Options.clean_map == 1&& show_backup[count_x + 1][count_y + 1] != 0&& enx >= 0&& eny >= 0){get_non_ibm_symbol( show_backup[count_x + 1][count_y + 1],&ch, &color );env.map[enx][eny] = ch;}bufcount += 2;}bufcount += 16;}}
if (Feature[i].seen_colour == BLACK)Feature[i].seen_colour = Feature[i].map_colour;}}static int get_screen_glyph( int x, int y ){const int ex = x - you.x_pos + 9;const int ey = y - you.y_pos + 9;
for (count_y = 0; count_y < 17; count_y++){for (count_x = 0; count_x < 33; count_x++){if (count_x + you.x_pos - 17 < 3|| count_y + you.y_pos - 9 < 3|| count_x + you.x_pos - 14 > (GXM - 3)|| count_y + you.y_pos - 9 > (GYM - 3)){buffy[bufcount] = 0;bufcount++;buffy[bufcount] = 0;bufcount++;continue;}
if (!object)return get_envmap_char(x, y);
buffy[bufcount + 1] = DARKGREY;
// Returns a string containing an ASCII representation of the map. If fullscreen// is set to false, only the viewable area is returned. Leading and trailing// spaces are trimmed from each line. Leading and trailing empty lines are also// snipped.std::string screenshot( bool fullscreen ){UNUSED( fullscreen );
if (Options.colour_map){if (env.map[count_x + you.x_pos - 17][count_y + you.y_pos - 9] != 0){buffy[bufcount + 1]= colour_code_map( count_x + you.x_pos - 17,count_y + you.y_pos - 9,Options.item_colour );}}
const int X_SIZE = VIEW_WIDTH;const int Y_SIZE = VIEW_HEIGHT;
if (you.berserker){for (count_x = 1; count_x < 1400; count_x += 2){if (buffy[count_x] != DARKGREY)buffy[count_x] = RED;}}
init_char_table(CSET_ASCII);init_feature_table();int firstnonspace = -1;int firstpopline = -1;int lastpopline = -1;
show_green = ((you.special_wield == SPWLD_SHADOW) ? DARKGREY: BLACK);}
int ch = (!map_bounds(gx, gy))? 0: (count_x < 8 || count_x > 24)? get_envmap_char(gx, gy): (gx == you.x_pos && gy == you.y_pos)? you.symbol: get_screen_glyph(gx, gy);
// this line is purely optionalif (you.running == 0 || (you.running < 0 && Options.travel_delay > -1)){for (count_x = 0; count_x < 1120; count_x += 2) // 1056
get_symbol( object, &glych, &glycol );ch = glych;}// More mangling to accommodate C strings.if (!ch)ch = ' ';if (ch != ' ')
case DNGN_SECRET_DOOR:case DNGN_ROCK_WALL:case DNGN_PERMAROCK_WALL:case DNGN_STONE_WALL:case DNGN_METAL_WALL:case DNGN_GREEN_CRYSTAL_WALL:case DNGN_WAX_WALL:showed = '*';break;
for (int i = firstpopline; i <= lastpopline; ++i){char *curr = lines[i];
case DNGN_OPEN_DOOR:showed = 39;break; // open door
//---------------------------------------------------------------//// viewwindow -- now unified and rolled into a single pass//// Draws the main window using the character set returned// by get_symbol().//// This function should not interfere with the game condition,// unless do_updates is set (ie. stealth checks for visible// monsters).////---------------------------------------------------------------void viewwindow(bool draw_it, bool do_updates){const int X_SIZE = VIEW_WIDTH;const int Y_SIZE = VIEW_HEIGHT;const int BUFFER_SIZE = 1550;
case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:case DNGN_ROCK_STAIRS_DOWN:case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:showed = '>';break;
for (count_x = 0; count_x < NUM_STATUE_TYPES; count_x++)you.visible_statue[count_x] = 0;
case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:case DNGN_ROCK_STAIRS_UP:case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:showed = '<';break;
for (count_x = 0; count_x < 18; count_x++){for (count_y = 0; count_y < 18; count_y++){env.show_col[count_x][count_y] = LIGHTGREY;Show_Backup[count_x][count_y] = 0;}}
case DNGN_ENTER_HELL:case DNGN_ENTER_LABYRINTH:case DNGN_ENTER_SHOP:case DNGN_ENTER_DIS:case DNGN_ENTER_GEHENNA:case DNGN_ENTER_COCYTUS:case DNGN_ENTER_TARTARUS:case DNGN_ENTER_ABYSS:case DNGN_EXIT_ABYSS:case DNGN_STONE_ARCH:case DNGN_ENTER_PANDEMONIUM:case DNGN_EXIT_PANDEMONIUM:case DNGN_TRANSIT_PANDEMONIUM:case DNGN_ENTER_ZOT:case DNGN_RETURN_FROM_ZOT:showed = '\\';break;
item_grid(); // must be done before cloud and monstercloud_grid();monster_grid( do_updates );
case DNGN_ALTAR_ZIN:case DNGN_ALTAR_SHINING_ONE:case DNGN_ALTAR_KIKUBAAQUDGHA:case DNGN_ALTAR_YREDELEMNUL:case DNGN_ALTAR_XOM:case DNGN_ALTAR_VEHUMET:case DNGN_ALTAR_OKAWARU:case DNGN_ALTAR_MAKHLEB:case DNGN_ALTAR_SIF_MUNA:case DNGN_ALTAR_TROG:case DNGN_ALTAR_NEMELEX_XOBEH:case DNGN_ALTAR_ELYVILON:showed = '_';break;
if (draw_it){_setcursortype(_NOCURSOR);
case DNGN_BLUE_FOUNTAIN:case DNGN_DRY_FOUNTAIN_I:case DNGN_SPARKLING_FOUNTAIN:case DNGN_DRY_FOUNTAIN_II:case DNGN_DRY_FOUNTAIN_III:case DNGN_DRY_FOUNTAIN_IV:case DNGN_DRY_FOUNTAIN_V:case DNGN_DRY_FOUNTAIN_VI:case DNGN_DRY_FOUNTAIN_VII:case DNGN_DRY_FOUNTAIN_VIII:case DNGN_PERMADRY_FOUNTAIN:showed = '}';break;
const bool map = player_in_mappable_area();int bufcount = 0;
unsigned char mapchar4(unsigned char ldfk){unsigned char showed = 0;
if (Options.colour_map)buffy[bufcount + 1] =colour_code_map(gx - 1, gy - 1,Options.item_colour);}else if (gx == you.x_pos && gy == you.y_pos){// player overrides everything in cellbuffy[bufcount] = you.symbol;buffy[bufcount + 1] = you.colour;
switch (ldfk){case DNGN_UNSEEN:showed = 0;break;
if (player_is_swimming()){if (grd[gx][gy] == DNGN_DEEP_WATER)buffy[bufcount + 1] = BLUE;elsebuffy[bufcount + 1] = CYAN;}}else{// Note: env.show is set for grids in LoS// get env coordsconst int ex = gx - you.x_pos + 9;const int ey = gy - you.y_pos + 9;
case DNGN_SECRET_DOOR:case DNGN_ROCK_WALL:case DNGN_PERMAROCK_WALL:case DNGN_STONE_WALL:case DNGN_METAL_WALL:case DNGN_GREEN_CRYSTAL_WALL:case DNGN_WAX_WALL:showed = '#';break;
if (object == DNGN_SECRET_DOOR)object = grid_secret_door_appearance( gx, gy );
case DNGN_FLOOR:case DNGN_UNDISCOVERED_TRAP:showed = '.';break;
if (map){// This section is very tricky because it// duplicates the old code (which was horrid).// if the grid is in LoS env.show was set and// we set the buffer already, so...if (buffy[bufcount] != 0){// ... map that we've seen thisset_envmap_char( gx, gy, buffy[bufcount] );set_terrain_seen( gx, gy );set_envmap_detected_mons(gx, gy, false);set_envmap_detected_item(gx, gy, false);}
case 68:showed = '>'; // <break;
// Check if we're looking to clean_map...// but don't touch the buffer to clean it,// instead we modify the env.map itself so// that the map stays clean as it moves out// of the env.show radius.//// Note: show_backup is 0 on every square which// is inside the env.show radius and doesn't// have a monster or cloud on it, and is equal// to the grid before monsters and clouds were// added otherwise.if (Options.clean_map&& Show_Backup[ex][ey]&& is_terrain_seen( gx, gy )){get_symbol( Show_Backup[ex][ey], &ch, &colour );set_envmap_char( gx, gy, ch );}
case DNGN_OPEN_DOOR:showed = 39;break;
// Now we get to filling in both the unseen// grids in the env.show radius area as// well doing the clean_map. The clean_map// is done by having the env.map set to the// backup character above, and down here we// procede to override that character if it's// out of LoS! If it wasn't, buffy would have// already been set (but we'd still have// clobbered env.map... which is important// to do for when we move away from the area!)if (buffy[bufcount] == 0){// show mapbuffy[bufcount] = get_envmap_char( gx, gy );buffy[bufcount + 1] = DARKGREY;
case 72:showed = '<';break;
if (Options.colour_map)buffy[bufcount + 1] =colour_code_map(gx - 1, gy - 1,Options.item_colour);}}}// alter colour if flashing the characters visionif (flash_colour != BLACK&& buffy[bufcount + 1] != DARKGREY){buffy[bufcount + 1] = flash_colour;}
case DNGN_STONE_STAIRS_DOWN_I:case DNGN_STONE_STAIRS_DOWN_II:case DNGN_STONE_STAIRS_DOWN_III:case DNGN_ROCK_STAIRS_DOWN:case DNGN_ENTER_ORCISH_MINES:case DNGN_ENTER_HIVE:case DNGN_ENTER_LAIR:case DNGN_ENTER_SLIME_PITS:case DNGN_ENTER_VAULTS:case DNGN_ENTER_CRYPT:case DNGN_ENTER_HALL_OF_BLADES:case DNGN_ENTER_TEMPLE:case DNGN_ENTER_SNAKE_PIT:case DNGN_ENTER_ELVEN_HALLS:case DNGN_ENTER_TOMB:case DNGN_ENTER_SWAMP:case 123:case 124:case 125:case 126:showed = '>';break;
// Leaving it this way because short flashes can occur in long ones,// and this simply works without requiring a stack.you.flash_colour = BLACK;#ifdef DOS_TERMputtext( 2, 1, X_SIZE + 1, Y_SIZE, buffy.buffer() );#endif
case DNGN_STONE_STAIRS_UP_I:case DNGN_STONE_STAIRS_UP_II:case DNGN_STONE_STAIRS_UP_III:case DNGN_ROCK_STAIRS_UP:case DNGN_RETURN_FROM_ORCISH_MINES:case DNGN_RETURN_FROM_HIVE:case DNGN_RETURN_FROM_LAIR:case DNGN_RETURN_FROM_SLIME_PITS:case DNGN_RETURN_FROM_VAULTS:case DNGN_RETURN_FROM_CRYPT:case DNGN_RETURN_FROM_HALL_OF_BLADES:case DNGN_RETURN_FROM_TEMPLE:case DNGN_RETURN_FROM_SNAKE_PIT:case DNGN_RETURN_FROM_ELVEN_HALLS:case DNGN_RETURN_FROM_TOMB:case DNGN_RETURN_FROM_SWAMP:case 143:case 144:case 145:case 146:showed = '<';break;
#ifdef PLAIN_TERM// avoiding unneeded draws when runningif (!you.running || (you.running < 0 && Options.travel_delay > -1)){gotoxy( 2, 1 );
case DNGN_ENTER_HELL:case DNGN_ENTER_LABYRINTH:case DNGN_ENTER_SHOP:case DNGN_ENTER_DIS:case DNGN_ENTER_GEHENNA:case DNGN_ENTER_COCYTUS:case DNGN_ENTER_TARTARUS:case DNGN_ENTER_ABYSS:case DNGN_EXIT_ABYSS:case DNGN_STONE_ARCH:case DNGN_ENTER_PANDEMONIUM:case DNGN_EXIT_PANDEMONIUM:case DNGN_TRANSIT_PANDEMONIUM:case DNGN_ENTER_ZOT:case DNGN_RETURN_FROM_ZOT:showed = '\\';break;
bufcount = 0;for (count_y = 0; count_y < Y_SIZE; count_y++){for (count_x = 0; count_x < X_SIZE; count_x++){#ifdef USE_CURSESbuffy[bufcount] = cset_adjust( buffy[bufcount] );#endiftextcolor( buffy[bufcount + 1] );putch( buffy[bufcount] );bufcount += 2;}
case DNGN_ALTAR_ZIN:case DNGN_ALTAR_SHINING_ONE:case DNGN_ALTAR_KIKUBAAQUDGHA:case DNGN_ALTAR_YREDELEMNUL:case DNGN_ALTAR_XOM:case DNGN_ALTAR_VEHUMET:case DNGN_ALTAR_OKAWARU:case DNGN_ALTAR_MAKHLEB:case DNGN_ALTAR_SIF_MUNA:case DNGN_ALTAR_TROG:case DNGN_ALTAR_NEMELEX_XOBEH:case DNGN_ALTAR_ELYVILON:showed = '_';break;
gotoxy( 2, count_y + 2 );}}
case DNGN_BLUE_FOUNTAIN:case DNGN_DRY_FOUNTAIN_I:case DNGN_SPARKLING_FOUNTAIN:case DNGN_DRY_FOUNTAIN_II:case DNGN_DRY_FOUNTAIN_III:case DNGN_DRY_FOUNTAIN_IV:case DNGN_DRY_FOUNTAIN_V:case DNGN_DRY_FOUNTAIN_VI:case DNGN_DRY_FOUNTAIN_VII:case DNGN_DRY_FOUNTAIN_VIII:case DNGN_PERMADRY_FOUNTAIN:showed = '}';break;
#ifdef USE_CURSESset_altcharset( false );#endif
%{#include "AppHdr.h"#include "libutil.h"#include "levcomp.h"int yylex();extern int yylineno;void yyerror(const char *e){fprintf(stderr, "%s:%d: %s\n", lc_desfile.c_str(), yylineno, e);// Bail bail bail.exit(1);}%}%union{int i;const char *text;}%token <i> BRANCHDEF BRANCH DESC DEFAULT%token <i> DEFAULT_DEPTH SYMBOL TAGS%token <i> NAME DEPTH ORIENT PLACE CHANCE FLAGS MONS%token <i> ROOT_DEPTH ENTRY_MSG EXIT_MSG%token <i> ROCK_COLOUR FLOOR_COLOUR%token <i> ENCOMPASS%token <i> NORTH EAST SOUTH WEST%token <i> NORTHEAST SOUTHEAST SOUTHWEST NORTHWEST%token <i> LEVEL END PVAULT PMINIVAULT MONSTERS ENDMONSTERS%token <i> CHARACTER%token <i> NO_HMIRROR NO_VMIRROR NO_ROTATE%token <i> PANDEMONIC%token <i> DASH COMMA QUOTE OPAREN CPAREN%token <i> INTEGER%type <i> orient_name flagname%token <text> STRING MAP_LINE MONSTER_NAME%token <text> IDENTIFIER%%file : definitions { };definitions : /* empty */ {}| definition definitions {};definition : def {}| level {};def : defdepth;defdepth : DEFAULT_DEPTH depth_range{lc_default_depth = lc_range;};level : name metalines map_def metalines{add_parsed_map( lc_map );};name : NAME STRING{lc_map.init();lc_map.depth = lc_default_depth;lc_map.name = $2;};metalines : /* no metadata */| metaline metalines;metaline : place| depth| chance| orientation| flags| mons| symbol| tags;tags : TAGS tagstrings {};tagstrings : /* empty */| STRING tagstrings{lc_map.tags += " ";lc_map.tags += $1;lc_map.tags += " ";};symbol : SYMBOL {}| SYMBOL STRING{lc_map.random_symbols = $2;};mons : MONS {}| MONS mnames {};mnames : mname COMMA mnames| mname;mname : MONSTER_NAME{bool recognised = lc_map.mons.add_mons($1);if (!recognised){char buf[300];snprintf(buf, sizeof buf, "unknown monster '%s'",$1);yyerror(buf);}};place : PLACE STRING{lc_map.place = $2;};depth : DEPTH {}| DEPTH depth_range{lc_map.depth = lc_range;};depth_range : INTEGER DASH INTEGER{lc_range.set($1, $3);}| INTEGER{lc_range.set($1);};chance : CHANCE INTEGER{lc_map.chance = $2;};orientation : ORIENT {}| ORIENT orient_name{lc_map.orient = (map_section_type) $2;};orient_name : ENCOMPASS { $$ = MAP_ENCOMPASS; }| NORTH { $$ = MAP_NORTH; }| EAST { $$ = MAP_EAST; }| SOUTH { $$ = MAP_SOUTH; }| WEST { $$ = MAP_WEST; }| NORTHEAST { $$ = MAP_NORTHEAST; }| SOUTHEAST { $$ = MAP_SOUTHEAST; }| SOUTHWEST { $$ = MAP_SOUTHWEST; }| NORTHWEST { $$ = MAP_NORTHWEST; };flags : FLAGS flagnames {};flagnames : /* empty */| flagname flagnames{switch ($1) {case NO_HMIRROR:lc_map.flags &= ~MAPF_MIRROR_HORIZONTAL;break;case NO_VMIRROR:lc_map.flags &= ~MAPF_MIRROR_VERTICAL;break;case NO_ROTATE:lc_map.flags &= ~MAPF_ROTATE;break;}};flagname : NO_HMIRROR { $$ = NO_HMIRROR; }| NO_VMIRROR { $$ = NO_VMIRROR; }| NO_ROTATE { $$ = NO_ROTATE; };map_def : map_lines;map_lines : map_line| map_line map_lines;map_line : MAP_LINE{lc_map.map.add_line($1);};%%
%{// levcomp.l:// Level compiler lexer for Dungeon Crawl Stone Soup.//// Based loosely on NetHack's lev_comp.l#include "AppHdr.h"#include "levcomp.tab.h"#include <cstring>static bool alloced = false;static void clean(){if (yylval.text && alloced)free( (void*) yylval.text);yylval.text = NULL;alloced = false;}static void settext(){clean();if ((yylval.text = strdup(yytext)))alloced = true;}%}%s MAPDEF%s ARGUMENT%s MNAME%s KEYWORDS%option yylineno%option never-interactiveNSPACE [^\ \t\r\n]%%<MAPDEF>^\s*ENDMAP { BEGIN(INITIAL); }<MAPDEF>^#.*\r?\n ;<MAPDEF>[a-zA-Z_&0-9|$+.@^#()\[\]=<>{}%*\-?]* {settext();return MAP_LINE;}^\s*MAP { BEGIN(MAPDEF); }^\s*#.* ;NAME: { BEGIN(ARGUMENT); return NAME; }default-depth: return DEFAULT_DEPTH;DEPTH: return DEPTH;ORIENT: return ORIENT;PLACE: { BEGIN(ARGUMENT); return PLACE; }CHANCE: return CHANCE;FLAGS: return FLAGS;TAGS: { BEGIN(KEYWORDS); return TAGS; }SYMBOL: { BEGIN(ARGUMENT); return SYMBOL; }MONS: { BEGIN(MNAME); return MONS; }BRANCHDEF: return BRANCH;DEFAULT return DEFAULT;DESC: return DESC;BRANCH: return BRANCH;ROOT_DEPTH: return ROOT_DEPTH;FLOOR_COLOUR: return FLOOR_COLOUR;ROCK_COLOUR: return ROCK_COLOUR;LEVEL return LEVEL;END return END;PVAULT: return PVAULT;PMINIVAULT: return PMINIVAULT;ENTRY_MSG: { BEGIN(ARGUMENT); return ENTRY_MSG; }EXIT_MSG: { BEGIN(ARGUMENT); return EXIT_MSG; }MONSTERS return MONSTERS;ENDMONSTERS return ENDMONSTERS;<KEYWORDS>[A-Za-z_0-9\-]+ {settext();return STRING;}<KEYWORDS>[ \t]+ ;<KEYWORDS>[ \t]*\r?\n { BEGIN(INITIAL); }<MNAME>[^, \t\r\n][^,\r\n]+[^, \t\r\n] {settext();return MONSTER_NAME;}<MNAME>, return COMMA;<MNAME>[ \t]*\r?\n { BEGIN(INITIAL); }<MNAME>[ \t] ;pandemonic return PANDEMONIC;no_hmirror return NO_HMIRROR;no_vmirror return NO_VMIRROR;no_rotate return NO_ROTATE;encompass return ENCOMPASS;north return NORTH;south return SOUTH;east return EAST;west return WEST;northeast return NORTHEAST;northwest return NORTHWEST;southeast return SOUTHEAST;southwest return SOUTHWEST;- return DASH;, return COMMA;[0-9]+ {clean();yylval.i = atoi(yytext);return INTEGER;}<ARGUMENT>{NSPACE}.*{NSPACE} {BEGIN(INITIAL);settext();return STRING;}<ARGUMENT>\r?\n { BEGIN(INITIAL); }[\ \t\r\n]+ ;\( return OPAREN;\) return CPAREN;\" return QUOTE;[a-zA-Z_][a-zA-Z_0-9]+ {settext();return IDENTIFIER;}. return CHARACTER;%%int yywrap(){clean();return 1;}
#include <cstdio>#include <string>#include <vector>#include "mapdef.h"#include "maps.h"extern map_def lc_map;extern level_range lc_range;extern level_range lc_default_depth;extern std::string lc_desfile;void reset_map_parser();
#include "AppHdr.h"#include "levcomp.h"std::string lc_desfile;map_def lc_map;level_range lc_range;level_range lc_default_depth;extern int yylineno;void reset_map_parser(){lc_map.init();lc_range.reset();lc_default_depth.reset();yylineno = 1;}
/* ************************************************************************ Returns the direction to take to move along the shortest path between* (you_x, you_y) and (you.run_x, you.run_y) in (*move_x, *move_y).* If move_x or move_y is NULL, the function explores the map outwards from* (you_x, you_y), populating the coords vector with the coordinates* of every dungeon feature it finds, features closest to the character* (travel distance-wise) coming first in the vector. A 'feature' is defined* as a trap, and any other non-floor, non-water/lava square that the character* can step onto.** ************************************************************************ called from: acr - view* *********************************************************************** */
// Possible values of you.runningenum RUN_MODES{RUN_TRAVEL = -1, // Classic or Plain Old travelRUN_EXPLORE = -2, // Exploring (Ctrl+O)RUN_INTERLEVEL = -3 // Interlevel travel (Ctrl+G)};
/* These are defined in view.cc. BWR says these may become obsolete in next* release? */extern unsigned char (*mapch) (unsigned char);extern unsigned char (*mapch2) (unsigned char);extern unsigned char mapchar(unsigned char ldfk);extern unsigned char mapchar2(unsigned char ldfk);
// (run_x, run_y) destination will no longer be valid on// the new level. Setting run_x to zero forces us to// recalculate our travel target next turn (see previous// if block).you.run_x = you.run_y = 0;
// (running.x, running.y) destination will no longer be// valid on the new level. Setting running.x to zero forces// us to recalculate our travel target next turn (see// previous if block).you.running.x = you.running.y = 0;
command_type direction_to_command( char x, char y ) {if ( x == -1 && y == -1 ) return CMD_MOVE_UP_LEFT;if ( x == -1 && y == 0 ) return CMD_MOVE_LEFT;if ( x == -1 && y == 1 ) return CMD_MOVE_DOWN_LEFT;if ( x == 0 && y == -1 ) return CMD_MOVE_UP;if ( x == 0 && y == 0 ) return CMD_NO_CMD;if ( x == 0 && y == 1 ) return CMD_MOVE_DOWN;if ( x == 1 && y == -1 ) return CMD_MOVE_UP_RIGHT;if ( x == 1 && y == 0 ) return CMD_MOVE_RIGHT;if ( x == 1 && y == 1 ) return CMD_MOVE_DOWN_RIGHT;ASSERT(0);return CMD_NO_CMD;}static void fill_exclude_radius(const coord_def &c){int radius = 0;while (radius * radius < Options.travel_exclude_radius2)radius++;for (int y = c.y - radius; y <= c.y + radius; ++y){for (int x = c.x - radius; x <= c.x + radius; ++x){if (!map_bounds(x, y) || !is_terrain_known(x, y)|| point_distance[x][y])continue;if (is_exclude_root(x, y))point_distance[x][y] = PD_EXCLUDED;else if (is_excluded(x, y))point_distance[x][y] = PD_EXCLUDED_RADIUS;}}}
// Setting run_x and run_y here is evil - this function// should ideally not modify game state in any way.you.run_x = x;you.run_y = y;
// Setting running.x and running.y here is evil - this// function should ideally not modify game state in any way.you.running.x = x;you.running.y = y;
if (features && floodout){for (int i = 0, size = curr_excludes.size(); i < size; ++i){const coord_def &exc = curr_excludes[i];// An exclude - wherever it is - is always a feature.if (std::find(features->begin(), features->end(), exc)== features->end())features->push_back(exc);fill_exclude_radius(exc);}}
int absdungeon_depth(unsigned char branch, int subdepth){int realdepth = subdepth - 1;if (branch >= BRANCH_ORCISH_MINES && branch <= BRANCH_SWAMP)realdepth = subdepth + you.branch_stairs[branch - 10];if (branch >= BRANCH_DIS && branch <= BRANCH_THE_PIT)realdepth = subdepth + 26;return realdepth;}int subdungeon_depth(unsigned char branch, int depth){int curr_subdungeon_level = depth + 1;// maybe last part better expresssed as <= PIT {dlb}if (branch >= BRANCH_DIS && branch <= BRANCH_THE_PIT)curr_subdungeon_level = depth - 26;/* Remember, must add this to the death_string in ouch */if (branch >= BRANCH_ORCISH_MINES && branch <= BRANCH_SWAMP)curr_subdungeon_level = depth- you.branch_stairs[branch - 10];return curr_subdungeon_level;}
return !(you.level_type == LEVEL_LABYRINTH || you.level_type == LEVEL_ABYSS|| you.level_type == LEVEL_PANDEMONIUM);
return (player_in_mappable_area() && you.level_type != LEVEL_PANDEMONIUM);}/////////////////////////////////////////////////////////////////////////////// Shift-running and resting.runrest::runrest(): runmode(0), mp(0), hp(0), x(0), y(0){}// Initialize is only called for resting/shift-running. We should eventually// include travel and wrap it all in.void runrest::initialise(int dir, int mode){// Note HP and MP for reference.hp = you.hp;mp = you.magic_points;if (dir == RDIR_REST){x = 0;y = 0;runmode = mode;}else{ASSERT( dir >= 0 && dir <= 7 );x = Compass[dir].x;y = Compass[dir].y;runmode = mode;// Get the compass point to the left/right of intended travel:const int left = (dir - 1 < 0) ? 7 : (dir - 1);const int right = (dir + 1 > 7) ? 0 : (dir + 1);// Record the direction and starting tile type for later reference:set_run_check( 0, left );set_run_check( 1, dir );set_run_check( 2, right );}if (runmode == RMODE_REST_DURATION)start_delay(DELAY_REST, 1);elsestart_delay(DELAY_RUN, 1);}runrest::operator int () const{return (runmode);}const runrest &runrest::operator = (int newrunmode){runmode = newrunmode;return (*this);
static char base_grid_type( char grid ){// Don't stop for undiscovered traps:if (grid == DNGN_UNDISCOVERED_TRAP)return (DNGN_FLOOR);// Or secret doors (which currently always look like rock walls):if (grid == DNGN_SECRET_DOOR)return (DNGN_ROCK_WALL);return (grid);}void runrest::set_run_check(int index, int dir){run_check[index].dx = Compass[dir].x;run_check[index].dy = Compass[dir].y;const int targ_x = you.x_pos + Compass[dir].x;const int targ_y = you.y_pos + Compass[dir].y;run_check[index].grid = base_grid_type( grd[ targ_x ][ targ_y ] );}bool runrest::check_stop_running(){if (runmode > 0 && runmode != RMODE_START && run_grids_changed()){stop();return (true);}return (false);}// This function creates "equivalence classes" so that undiscovered// traps and secret doors aren't running stopping points.bool runrest::run_grids_changed() const{if (env.cgrid[you.x_pos + x][you.y_pos + y] != EMPTY_CLOUD)return (true);if (mgrd[you.x_pos + x][you.y_pos + y] != NON_MONSTER)return (true);for (int i = 0; i < 3; i++){const int targ_x = you.x_pos + run_check[i].dx;const int targ_y = you.y_pos + run_check[i].dy;const int targ_grid = base_grid_type( grd[ targ_x ][ targ_y ] );if (run_check[i].grid != targ_grid)return (true);}return (false);}void runrest::stop(){bool need_redraw =runmode > 0 || (runmode < 0 && Options.travel_delay == -1);userdef_run_stoprunning_hook();runmode = RMODE_NOT_RUNNING;// Kill the delay; this is fine because it's not possible to stack// run/rest/travel on top of other delays.stop_delay();if (need_redraw)viewwindow(true, false);}bool runrest::is_rest() const{return (runmode > 0 && !x && !y);}void runrest::rundown(){rest();}void runrest::rest(){// stop_running() Lua hooks will never see rest stops.if (runmode > 0)--runmode;}void runrest::clear(){runmode = RMODE_NOT_RUNNING;x = y = 0;mp = hp = 0;}void runrest::check_hp(){if (is_rest() && you.hp == you.hp_max && you.hp > hp)stop();}void runrest::check_mp(){if (is_rest() && you.magic_points == you.max_magic_points&& you.magic_points > mp)stop();}
// FIXME: Switch to 4.1 transforms handling.size_type transform_size(int){const int transform = you.attribute[ATTR_TRANSFORMATION];switch (transform){case TRAN_SPIDER:return SIZE_TINY;case TRAN_ICE_BEAST:return SIZE_LARGE;case TRAN_DRAGON:case TRAN_SERPENT_OF_HELL:return SIZE_HUGE;case TRAN_AIR:return SIZE_MEDIUM;default:return SIZE_CHARACTER;}}
if (!player_is_levitating()&& (grd[you.x_pos][you.y_pos] == DNGN_LAVA|| grd[you.x_pos][you.y_pos] == DNGN_DEEP_WATER|| grd[you.x_pos][you.y_pos] == DNGN_SHALLOW_WATER)){if (you.species == SP_MERFOLK&& grd[you.x_pos][you.y_pos] != DNGN_LAVA){mpr("You dive into the water and return to your normal form.");merfolk_start_swimming();}if (grd[you.x_pos][you.y_pos] != DNGN_SHALLOW_WATER)fall_into_a_pool( true, grd[you.x_pos][you.y_pos] );}
// re-check terrain now that be may no longer be flying.move_player_to_grid( you.x_pos, you.y_pos, false, true, true );
// Used to mark transformations which override species/mutation intrinsics.// If phys_scales is true then we're checking to see if the form keeps// the physical (AC/EV) properties from scales... the special intrinsic// features (resistances, etc) are lost in those forms however.bool transform_changed_physiology( bool phys_scales ){return (you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE&& you.attribute[ATTR_TRANSFORMATION] != TRAN_BLADE_HANDS&& (!phys_scales|| (you.attribute[ATTR_TRANSFORMATION] != TRAN_LICH&& you.attribute[ATTR_TRANSFORMATION] != TRAN_STATUE)));}
missing from a tagged save file. For example, if a developer addsTAG_YOU_NEW_STUFF to the player save file, he would have to provide a
missing from a tagged save file. For example, if a developer addsTAG_YOU_NEW_STUFF to the player save file, he would have to provide a
// size, the # of slots in player inventory, etc. Constants like GXM,// NUM_EQUIP, and NUM_DURATIONS are saved, so the appropriate amount will
// size, the # of slots in player inventory, etc. Constants like GXM,// NUM_EQUIP, and NUM_DURATIONS are saved, so the appropriate amount will
marshallByte(th, menv[i].armour_class);marshallByte(th, menv[i].evasion);marshallByte(th, menv[i].hit_dice);marshallByte(th, menv[i].speed);marshallByte(th, menv[i].speed_increment);marshallByte(th, menv[i].behaviour);marshallByte(th, menv[i].x);marshallByte(th, menv[i].y);marshallByte(th, menv[i].target_x);marshallByte(th, menv[i].target_y);marshallByte(th, menv[i].flags);
const monsters &m = menv[i];marshallByte(th, m.armour_class);marshallByte(th, m.evasion);marshallByte(th, m.hit_dice);marshallByte(th, m.speed);marshallByte(th, m.speed_increment);marshallByte(th, m.behaviour);marshallByte(th, m.x);marshallByte(th, m.y);marshallByte(th, m.target_x);marshallByte(th, m.target_y);marshallByte(th, m.flags);
marshallShort(th, menv[i].type);marshallShort(th, menv[i].hit_points);marshallShort(th, menv[i].max_hit_points);marshallShort(th, menv[i].number);
marshallShort(th, m.type);marshallShort(th, m.hit_points);marshallShort(th, m.max_hit_points);marshallShort(th, m.number);marshallShort(th, m.colour);
// last updated 12may2000 {dlb}/* ************************************************************************ called from: bang - beam - monplace - monstuff - spells1 - spells2 -* spells4 - view* *********************************************************************** */
// last updated 12may2000 {dlb}/* ************************************************************************ called from: ability - command - effects - food - item_use - items -* newgame - ouch - shopping - spell - spl-book - spells1 -* spells3* *********************************************************************** */
int stat_mult( int stat_level, int value, int div = 20, int shift = 3 );int stat_div( int stat_level, int value, int div = 20, int shift = 3 );int skill_bump( int skill );
// last updated 12may2000 {dlb}/* ************************************************************************ called from: ability - acr - command - direct - invent - item_use -* religion - shopping - spell - spl-book - spells3* *********************************************************************** */
// last updated 12may2000 {dlb}/* ************************************************************************ called from: ability - acr - beam - command - decks - debug - effects -* it_use3 - item_use - items - misc - ouch - religion -* spell - spl-book - spells - spells1 - spells2 - spells3 -* spells4* *********************************************************************** */
// last updated 12may2000 {dlb}/* ************************************************************************ called from: ability - acr - command - it_use3 - item_use - items -* misc - ouch - religion - spl-book - spells4* *********************************************************************** */// If safeanswer is nonzero, it should be a lowercase letter.
// last updated 21may2000 {dlb}/* ************************************************************************ called from: fight - monstuff - spells4 - view* *********************************************************************** */
bool in_bounds( int x, int y );bool map_bounds( int x, int y );
// last updated 21may2000 {dlb}/* ************************************************************************ called from: ability - acr - bang - beam - effects - fight - it_use2 -* it_use3 - monstuff - mstuff2 - religion - spell - spells -* spells3 - spells4 - stuff - view* *********************************************************************** */
// last updated 27may2000 {dlb}/* ************************************************************************ called from: dungeon - files - it_use2 - it_use3 - monstuff - mon-util -* mstuff2 - newgame - spells - view* *********************************************************************** */
// last updated 08jun2000 {dlb}/* ************************************************************************ called from: ability - chardump - command - files - invent - item_use -* items - newgame - spl-book - spells0 - spells1* *********************************************************************** */
// last updated 08jun2000 {dlb}/* ************************************************************************ called from: ability - command - food - it_use3 - item_use - items -* spell - spl-book - spells1 - spells3* *********************************************************************** */
// Attempts to make missile weapons nicer to the player by// reducing the extreme variance in damage done.void scale_dice( dice_def &dice, int threshold ){while (dice.size > threshold){dice.num *= 2;// If it's an odd number, lose one; this is more than// compensated by the increase in number of dice.dice.size /= 2;}}
int skill_bump( int skill ){return ((you.skills[skill] < 3) ? you.skills[skill] * 2: you.skills[skill] + 3);}// This gives (default div = 20, shift = 3):// - shift/div% @ stat_level = 0; (default 3/20 = 15%, or 20% at stat 1)// - even (100%) @ stat_level = div - shift; (default 17)// - 1/div% per stat_level (default 1/20 = 5%)int stat_mult( int stat_level, int value, int div, int shift ){return (((stat_level + shift) * value) / ((div > 1) ? div : 1));}// As above but inverted (ie 5x penalty at stat 1)int stat_div( int stat_level, int value, int mult, int shift ){int div = stat_level + shift;if (div < 1)div = 1;return ((mult * value) / div);}
strcpy(info, "Something appears ");strcat(info, (you.species == SP_NAGA || you.species == SP_CENTAUR)? "before you" : "at your feet");strcat(info, "!");
snprintf(info, INFO_SIZE, "Something appears %s!",(you.species == SP_NAGA || you.species == SP_CENTAUR)? "before you" : "at your feet");
// like yesno(), but returns 0 for no, 1 for yes, and -1 for quitint yesnoquit( const char* str, bool safe, int safeanswer, bool clear_after ){unsigned char tmp;interrupt_activity( AI_FORCE_INTERRUPT );while (1){mpr(str, MSGCH_PROMPT);tmp = (unsigned char) getch();if ( tmp == 27 || tmp == 'q' || tmp == 'Q' )return -1;if ((tmp == ' ' || tmp == '\r' || tmp == '\n') && safeanswer)tmp = safeanswer;
// More accurate than distance() given the actual movement geonmetry -- bwr
if (Options.easy_confirm == CONFIRM_ALL_EASY|| tmp == safeanswer|| (Options.easy_confirm == CONFIRM_SAFE_EASY && safe)){tmp = toupper( tmp );}if (clear_after)mesclr();if (tmp == 'N')return 0;else if (tmp == 'Y')return 1;elsempr("[Y]es or [N]o only, please.");}}// More accurate than distance() given the actual movement geometry -- bwr
// Returns true if inside the area the player can move and dig (ie exclusive)bool in_bounds( int x, int y ){return (x > X_BOUND_1 && x < X_BOUND_2&& y > Y_BOUND_1 && y < Y_BOUND_2);}// Returns true if inside the area the player can map (ie inclusive).// Note that terrain features should be in_bounds() leaving an outer// ring of rock to frame the level.bool map_bounds( int x, int y ){return (x >= X_BOUND_1 && x <= X_BOUND_2&& y >= Y_BOUND_1 && y <= Y_BOUND_2);}// Returns a random location in (x_pos, y_pos)... the grid will be// DNGN_FLOOR if clear, and NON_MONSTER if empty. Exclusive tells// if we're using in_bounds() or map_bounds() restriction.void random_in_bounds( int &x_pos, int &y_pos, int terr, bool empty, bool excl ){bool done = false;do{x_pos = X_BOUND_1 + random2( X_WIDTH - 2 * excl ) + 1 * excl;y_pos = Y_BOUND_1 + random2( Y_WIDTH - 2 * excl ) + 1 * excl;
if (terr == DNGN_RANDOM)done = true;else if (terr == grd[x_pos][y_pos])done = true;else if (terr == DNGN_DEEP_WATER && grd[x_pos][y_pos] == DNGN_SHALLOW_WATER)done = true;else if (empty&& mgrd[x_pos][y_pos] != NON_MONSTER&& (x_pos != you.x_pos || y_pos != you.y_pos)){done = true;}}while (!done);}// takes rectangle (x1,y1)-(x2,y2) and shifts it somewhere randomly in boundsvoid random_place_rectangle( int &x1, int &y1, int &x2, int &y2, bool excl ){const unsigned int dx = abs( x2 - x1 );const unsigned int dy = abs( y2 - y1 );x1 = X_BOUND_1 + random2( X_WIDTH - dx - 2 * excl ) + excl;y1 = Y_BOUND_1 + random2( Y_WIDTH - dy - 2 * excl ) + excl;x2 = x1 + dx;y2 = y1 + dy;}// returns true if point (px,py) is in rectangle (rx1, ry1) - (rx2, ry2)bool in_rectangle( int px, int py, int rx1, int ry1, int rx2, int ry2,bool excl ){ASSERT( rx1 < rx2 - 1 && ry1 < ry2 - 1 );if (excl){rx1++;rx2--;ry1++;ry2--;}return (px >= rx1 && px <= rx2 && py >= ry1 && py <= ry2);}// XXX: this can be done better// returns true if rectables a and b overlapbool rectangles_overlap( int ax1, int ay1, int ax2, int ay2,int bx1, int by1, int bx2, int by2,bool excl ){ASSERT( ax1 < ax2 - 1 && ay1 < ay2 - 1 );ASSERT( bx1 < bx2 - 1 && by1 < by2 - 1 );if (excl){ax1++;ax2--;ay1++;ay2--;}return (in_rectangle( ax1, ay1, bx1, by1, bx2, by2, excl )|| in_rectangle( ax1, ay2, bx1, by1, bx2, by2, excl )|| in_rectangle( ax2, ay1, bx1, by1, bx2, by2, excl )|| in_rectangle( ax2, ay2, bx1, by1, bx2, by2, excl ));}
// returns if a colour is one of the special element colours (ie not regular)bool is_element_colour( int col ){// striping any COLFLAGS (just in case)return ((col & 0x007f) >= EC_FIRE);}int element_colour( int element, bool no_random ){// Doing this so that we don't have to do recursion here at all// (these were the only cases which had possible double evaluation):if (element == EC_FLOOR)element = env.floor_colour;else if (element == EC_ROCK)element = env.rock_colour;// pass regular colours through for safety.if (!is_element_colour( element ))return (element);int ret = BLACK;// Setting no_random to true will get the first colour in the cases// below. This is potentially useful for calls to this function// which might want a consistant result.int tmp_rand = (no_random ? 0 : random2(120));switch (element & 0x007f) // strip COLFLAGs just in case{case EC_FIRE:ret = (tmp_rand < 40) ? RED :(tmp_rand < 80) ? YELLOW: LIGHTRED;break;case EC_ICE:ret = (tmp_rand < 40) ? LIGHTBLUE :(tmp_rand < 80) ? BLUE: WHITE;break;case EC_EARTH:ret = (tmp_rand < 60) ? BROWN : LIGHTRED;break;case EC_AIR:ret = (tmp_rand < 60) ? LIGHTGREY : WHITE;break;case EC_ELECTRICITY:ret = (tmp_rand < 40) ? LIGHTCYAN :(tmp_rand < 80) ? LIGHTBLUE: CYAN;break;case EC_POISON:ret = (tmp_rand < 60) ? LIGHTGREEN : GREEN;break;case EC_WATER:ret = (tmp_rand < 60) ? BLUE : CYAN;break;case EC_MAGIC:ret = (tmp_rand < 30) ? LIGHTMAGENTA :(tmp_rand < 60) ? LIGHTBLUE :(tmp_rand < 90) ? MAGENTA: BLUE;break;case EC_MUTAGENIC:case EC_WARP:ret = (tmp_rand < 60) ? LIGHTMAGENTA : MAGENTA;break;case EC_ENCHANT:ret = (tmp_rand < 60) ? LIGHTBLUE : BLUE;break;case EC_HEAL:ret = (tmp_rand < 60) ? LIGHTBLUE : YELLOW;break;case EC_BLOOD:ret = (tmp_rand < 60) ? RED : DARKGREY;break;case EC_DEATH: // assassincase EC_NECRO: // necromancerret = (tmp_rand < 80) ? DARKGREY : MAGENTA;break;case EC_UNHOLY: // ie demonologyret = (tmp_rand < 80) ? DARKGREY : RED;break;case EC_DARK:ret = DARKGREY;break;case EC_HOLY:ret = (tmp_rand < 60) ? YELLOW : WHITE;break;case EC_VEHUMET:ret = (tmp_rand < 40) ? LIGHTRED :(tmp_rand < 80) ? LIGHTMAGENTA: LIGHTBLUE;break;case EC_CRYSTAL:ret = (tmp_rand < 40) ? LIGHTGREY :(tmp_rand < 80) ? GREEN: LIGHTRED;break;case EC_SLIME:ret = (tmp_rand < 40) ? GREEN :(tmp_rand < 80) ? BROWN: LIGHTGREEN;break;case EC_SMOKE:ret = (tmp_rand < 30) ? LIGHTGREY :(tmp_rand < 60) ? DARKGREY :(tmp_rand < 90) ? LIGHTBLUE: MAGENTA;break;case EC_JEWEL:ret = (tmp_rand < 12) ? WHITE :(tmp_rand < 24) ? YELLOW :(tmp_rand < 36) ? LIGHTMAGENTA :(tmp_rand < 48) ? LIGHTRED :(tmp_rand < 60) ? LIGHTGREEN :(tmp_rand < 72) ? LIGHTBLUE :(tmp_rand < 84) ? MAGENTA :(tmp_rand < 96) ? RED :(tmp_rand < 108) ? GREEN: BLUE;break;case EC_ELVEN:ret = (tmp_rand < 40) ? LIGHTGREEN :(tmp_rand < 80) ? GREEN :(tmp_rand < 100) ? LIGHTBLUE: BLUE;break;case EC_DWARVEN:ret = (tmp_rand < 40) ? BROWN :(tmp_rand < 80) ? LIGHTRED :(tmp_rand < 100) ? LIGHTGREY: CYAN;break;case EC_ORCISH:ret = (tmp_rand < 40) ? DARKGREY :(tmp_rand < 80) ? RED :(tmp_rand < 100) ? BROWN: MAGENTA;break;case EC_GILA:ret = (tmp_rand < 30) ? LIGHTMAGENTA :(tmp_rand < 60) ? MAGENTA :(tmp_rand < 90) ? YELLOW :(tmp_rand < 105) ? LIGHTRED: RED;break;case EC_STONE:if (player_in_branch( BRANCH_HALL_OF_ZOT ))ret = env.rock_colour;elseret = LIGHTGREY;break;case EC_RANDOM:ret = 1 + random2(15); // always randombreak;case EC_FLOOR: // should alredy be handledcase EC_ROCK: // should alredy be handleddefault:break;}ASSERT( !is_element_colour( ret ) );return ((ret == BLACK) ? GREEN : ret);}
// Does the equivalent of KILL_RESET on all monsters in LOS. Should only be// applied to new games.void zap_los_monsters(){losight(env.show, grd, you.x_pos, you.y_pos);for (int y = LOS_SY; y <= LOS_EY; ++y){for (int x = LOS_SX; x <= LOS_EX; ++x){if (!in_vlos(x, y))continue;const int gx = view2gridX(x),gy = view2gridY(y);if (!map_bounds(gx, gy))continue;if (gx == you.x_pos && gy == you.y_pos)continue;int imon = mgrd[gx][gy];if (imon == NON_MONSTER || imon == MHITYOU)continue;// If we ever allow starting with a friendly monster,// we'll have to check here.monsters *mon = &menv[imon];#ifdef DEBUG_DIAGNOSTICSchar mname[ITEMNAME_SIZE];moname(mon->type, true, DESC_PLAIN, mname);mprf(MSGCH_DIAGNOSTICS, "Dismissing %s", mname);#endifmonster_die(mon, KILL_DISMISSED, 0);}}}
std::string branch_level_name(unsigned char branch, int sub_depth){int ltype = sub_depth == 0xFF? branch : 0;if (ltype == LEVEL_PANDEMONIUM)return ("Pandemonium");else if (ltype == LEVEL_ABYSS)return ("The Abyss");else if (ltype == LEVEL_LABYRINTH)return ("A Labyrinth");else{char buf[200];const char *s = NULL;*buf = 0;// level_type == LEVEL_DUNGEONif (branch != BRANCH_VESTIBULE_OF_HELL&& branch != BRANCH_ECUMENICAL_TEMPLE&& branch != BRANCH_HALL_OF_BLADES)snprintf(buf, sizeof buf, "Level %d", sub_depth);switch (branch){case BRANCH_MAIN_DUNGEON:s = " of the Dungeon";break;case BRANCH_DIS:s = " of Dis";break;case BRANCH_GEHENNA:s = " of Gehenna";break;case BRANCH_VESTIBULE_OF_HELL:s = "The Vestibule of Hell";break;case BRANCH_COCYTUS:s = " of Cocytus";break;case BRANCH_TARTARUS:s = " of Tartarus";break;case BRANCH_INFERNO:s = " of the Inferno";break;case BRANCH_THE_PIT:s = " of the Pit";break;case BRANCH_ORCISH_MINES:s = " of the Orcish Mines";break;case BRANCH_HIVE:s = " of the Hive";break;case BRANCH_LAIR:s = " of the Lair";break;case BRANCH_SLIME_PITS:s = " of the Slime Pits";break;case BRANCH_VAULTS:s = " of the Vaults";break;case BRANCH_CRYPT:s = " of the Crypt";break;case BRANCH_HALL_OF_BLADES:s = "The Hall of Blades";break;case BRANCH_HALL_OF_ZOT:s = " of the Realm of Zot";break;case BRANCH_ECUMENICAL_TEMPLE:s = "The Ecumenical Temple";break;case BRANCH_SNAKE_PIT:s = " of the Snake Pit";break;case BRANCH_ELVEN_HALLS:s = " of the Elven Halls";break;case BRANCH_TOMB:s = " of the Tomb";break;case BRANCH_SWAMP:s = " of the Swamp";break;}if (s)strncat(buf, s, sizeof(buf) - 1);return (buf);}}std::string branch_level_name(unsigned short packed_place){return branch_level_name(packed_place >> 8, packed_place & 0xFF);}
const char* spelltype_short_name( int which_spelltype ) {switch (which_spelltype){case SPTYP_CONJURATION:return ("Conj");case SPTYP_ENCHANTMENT:return ("Ench");case SPTYP_FIRE:return ("Fire");case SPTYP_ICE:return ("Ice");case SPTYP_TRANSMIGRATION:return ("Tmgr");case SPTYP_NECROMANCY:return ("Necr");case SPTYP_HOLY:return ("Holy");case SPTYP_SUMMONING:return ("Summ");case SPTYP_DIVINATION:return ("Divn");case SPTYP_TRANSLOCATION:return ("Tloc");case SPTYP_POISON:return ("Pois");case SPTYP_EARTH:return ("Erth");case SPTYP_AIR:return ("Air");default:return "Bug";}}
// 35--48 is the spell schoolsgotoxy(51, wherey());int spell_p = calc_spell_power( spell, true );cprintf( (spell_p > 100) ? "Enormous" :(spell_p > 90) ? "Huge" :(spell_p > 80) ? "Massive" :(spell_p > 70) ? "Major" :(spell_p > 60) ? "Impressive" :(spell_p > 50) ? "Reasonable" :(spell_p > 40) ? "Moderate" :(spell_p > 30) ? "Adequate" :(spell_p > 20) ? "Mediocre" :(spell_p > 10) ? "Minor": "Negligible");
static int apply_vehumet_wizardry_boost(int spell, int chance){int wizardry = player_mag_abil(false);int fail_reduce = 100;int wiz_factor = 86;if (you.religion == GOD_VEHUMET&& you.duration[DUR_PRAYER]&& (!player_under_penance() && you.piety >= 50)&& (spell_typematch(spell, SPTYP_CONJURATION)|| spell_typematch(spell, SPTYP_SUMMONING))){// [dshaligram] Fail rate multiplier used to be .5, scaled// back to 60%.fail_reduce = fail_reduce * 60 / 100;}// [dshaligram] Apply wizardry factor here, rather than mixed into the// pre-scaling spell power.while (wizardry-- > 0){fail_reduce = fail_reduce * wiz_factor / 100;wiz_factor += (100 - wiz_factor) / 5;}// Hard cap on fail rate reduction.if (fail_reduce < 40)fail_reduce = 40;return (chance * fail_reduce / 100);}
int power = (you.skills[SK_SPELLCASTING] / 2) + player_mag_abil(false);
// When checking failure rates, wizardry is handled after the various// stepping calulations.int power =(you.skills[SK_SPELLCASTING] / 2)+ (fail_rate_check? 0 : player_mag_abil(false));
enhanced = spell_enhancement( disciplines );
// [dshaligram] Enhancers don't affect fail rates any more, only spell// power. Note that this does not affect Vehumet's boost in castability.if (!fail_rate_check)enhanced = spell_enhancement( disciplines );
// returns true if spell if spell is successfully cast for purposes of// exercising and false otherwise (note: false == less exercise, not none).bool your_spells( int spc2, int powc, bool allow_fail )
// "Utility" spells for the sake of simplicity are currently ones with// enchantments, translocations, or divinations.bool spell_is_utility_spell( int spell_id )
if (!spell_is_utility_spell(spc2))did_god_conduct( DID_SPELL_NONUTILITY, 10 + spell_difficulty(spc2) );if (spell_is_unholy( spc2 ))did_god_conduct( DID_UNHOLY, 10 + spell_difficulty(spc2) );// Linley says: Condensation Shield needs some disadvantages to keep// it from being a no-brainer... this isn't much, but its a start -- bwrif (spell_typematch(spc2, SPTYP_FIRE))expose_player_to_element(BEAM_FIRE, 0);if (spell_typematch( spc2, SPTYP_NECROMANCY )){did_god_conduct( DID_NECROMANCY, 10 + spell_difficulty(spc2) );if (spc2 == SPELL_NECROMUTATION&& (you.religion == GOD_ELYVILON|| you.religion == GOD_SHINING_ONE|| you.religion == GOD_ZIN)){excommunication();}}alert_nearby_monsters();}// returns 1 if spell is successfully cast for purposes of exercising and 0// otherwise (note: false == less exercise, not none). If the player aborts the// spell, returns -1.int your_spells( int spc2, int powc, bool allow_fail ){int dem_hor = 0;int dem_hor2 = 0;struct dist spd;struct bolt beam;// [dshaligram] Any action that depends on the spellcasting attempt to have// succeeded must be performed after the switch()// Added this so that the passed in powc can have meaning -- bwrif (powc == 0)powc = calc_spell_power( spc2, true );
return (false); // XXX: still gets trained!}// Linley says: Condensation Shield needs some disadvantages to keep// it from being a no-brainer... this isn't much, but its a start -- bwrif (you.duration[DUR_CONDENSATION_SHIELD] > 0&& spell_typematch( spc2, SPTYP_FIRE )){mpr( "Your icy shield dissipates!", MSGCH_DURATION );you.duration[DUR_CONDENSATION_SHIELD] = 0;you.redraw_armour_class = 1;
return (-1);
if (spc2 == SPELL_SUMMON_HORRIBLE_THINGS|| spc2 == SPELL_CALL_IMP|| spc2 == SPELL_SUMMON_DEMON|| spc2 == SPELL_DEMONIC_HORDE|| spc2 == SPELL_SUMMON_GREATER_DEMON || spc2 == SPELL_HELLFIRE){naughty(NAUGHTY_UNHOLY, 10 + spell_difficulty(spc2));}if (spell_typematch( spc2, SPTYP_NECROMANCY ))naughty( NAUGHTY_NECROMANCY, 10 + spell_difficulty(spc2) );if (spc2 == SPELL_NECROMUTATION&& (you.religion == GOD_ELYVILON|| you.religion == GOD_SHINING_ONE|| you.religion == GOD_ZIN)){excommunication();}if (you.religion == GOD_SIF_MUNA&& you.piety < 200 && random2(12) <= spell_difficulty(spc2)){gain_piety(1);}
// This is used as a reference level to normalise spell skill training// (for Sif Muna piety). Normalised skill training is worked out as:// norm = actual_amount_trained * species_aptitude / ref_skill. This was// set at 50 in stone_soup 0.1.1 (which is bad).const int ref_skill = 80;
exercise(SK_SPELLCASTING, one_chance_in(3) ? 1: random2(1 + random2(spell_difficulty(spell))));
const int exercise_amount =exercise(SK_SPELLCASTING, one_chance_in(3) ? 1: random2(1 + random2(diff)));exer += exercise_amount;exer_norm += exercise_amount *species_skills(SK_SPELLCASTING, you.species) / ref_skill;
//+ (coinflip() ? 1 : 0) + (skillcount ? 1 : 0));/* ******************************************************************3.02 was:if ( spc && spellsy )exercise(SK_SPELLCASTING, random2(random2(spell_difficulty(spell_ex) + 1) / spellsy)); // + 1);else if ( spc )exercise(SK_SPELLCASTING, random2(random2(spell_difficulty(spell_ex)))); // + 1);****************************************************************** */
if (exer_norm)did_god_conduct( DID_SPELL_PRACTISE, exer_norm );
if (index >= SPELLBOOK_SIZE)goto whatt;if (!is_valid_spell_in_book( book, index ))goto whatt;
if (index >= SPELLBOOK_SIZE ||!is_valid_spell_in_book( book, index )){canned_msg( MSG_HUH );return (false);}
strcpy(info, "This spell is ");strcat(info, (chance >= 80) ? "very" :(chance >= 60) ? "quite" :(chance >= 45) ? "rather" :(chance >= 30) ? "somewhat": "not that");strcat(info, " ");int temp_rand = random2(3);strcat(info, (temp_rand == 0) ? "difficult" :(temp_rand == 1) ? "tricky" :(temp_rand == 2) ? "challenging": "");strcat(info, " to ");
int temp_rand1 = random2(3);int temp_rand2 = random2(4);
temp_rand = random2(4);strcat(info, (temp_rand == 0) ? "memorise" :(temp_rand == 1) ? "commit to memory" :(temp_rand == 2) ? "learn" :(temp_rand == 3) ? "absorb": "");strcat(info, ".");
snprintf(info, INFO_SIZE, "This spell is %s %s to %s.",((chance >= 80) ? "very" :(chance >= 60) ? "quite" :(chance >= 45) ? "rather" :(chance >= 30) ? "somewhat": "not that"),((temp_rand1 == 0) ? "difficult" :(temp_rand1 == 1) ? "tricky" :"challenging"),((temp_rand2 == 0) ? "memorise" :(temp_rand2 == 1) ? "commit to memory" :(temp_rand2 == 2) ? "learn" :"absorb"));
}// Returns a measure of the rod spell power disrupted by a worn shield.int rod_shield_leakage(){const item_def *shield = player_shield();int leakage = 100;if (shield){const int shield_type = shield->sub_type;leakage = shield_type == ARM_BUCKLER? 125 :shield_type == ARM_SHIELD ? 150 :200;// Adjust for shields skill.leakage -= ((leakage - 100) * 5 / 10) * you.skills[SK_SHIELDS] / 27;}return (leakage);
// Exercising the spell skills doesn't make very much sense given// that spell staves are largely intended to supply spells to// non-spellcasters, and they don't use spell skills to determine// power in the same way that spellcasting does. -- bwr//// exercise_spell(specspell, true, true);
if (staff_type == STAFF_STRIKING)mana /= ROD_CHARGE_MULT;
your_spells(specspell, powc, false);
if ((staff_type == STAFF_STRIKING?you.magic_points < mana: you.inv[staff].plus < mana)|| you.experience_level < diff){#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS,"Mana needed: %d, Staff plus: %d, Difficulty: %d, XP: %d",mana, you.inv[staff].plus, diff, you.experience_level);#endifif (you.experience_level < diff)mprf("You need to be at least level %d to use that.", diff);elsemprf("%s have enough magic points.",staff_type == STAFF_STRIKING? "You don't" : "The rod doesn't");// Don't lose a turn for trying to evoke without enough MP - that's// needlessly cruel for an honest error.return (-1);}
dec_mp(spell_mana(specspell));
if (your_spells(specspell, powc, false) == -1)return (-1);// dec_mp(spell_mana(specspell));if (staff_type != STAFF_STRIKING)you.inv[staff].plus -= mana;else {you.magic_points -= mana;you.redraw_magic_points = true;}energy = player_energy();if (energy <= 0 && you.is_undead != US_UNDEAD){food -= 10 * you.skills[SK_EVOCATIONS];if (food < diff * 5)food = diff * 5;make_hungry( food, true );}
case MONS_SILVER_STATUE:case MONS_ORANGE_STATUE:explode = true;blast.ex_size = 2;if (menv[mon].type == MONS_SILVER_STATUE){blast.name = "blast of silver fragments";blast.colour = WHITE;blast.damage.num = 3;}else{blast.name = "blast of orange crystal shards";blast.colour = LIGHTRED;blast.damage.num = 6;}if (player_hurt_monster(mon, roll_dice( blast.damage )))blast.damage.num += 2;break;
return false;}void cast_shuggoth_seed(int powc){struct dist beam;int i;mpr("Sow seed in whom?", MSGCH_PROMPT);direction( beam, DIR_TARGET, TARG_ENEMY );if (!beam.isValid){mpr("You feel a distant frustration.");return;}if (beam.isMe){if (!you.is_undead){you.duration[DUR_INFECTED_SHUGGOTH_SEED] = 10;mpr("A deathly dread twitches in your chest.");}elsempr("You feel a distant frustration.");}i = mgrd[beam.tx][beam.ty];if (i == NON_MONSTER){mpr("You feel a distant frustration.");return;}if (mons_can_host_shuggoth(menv[i].type)){if (random2(powc) > 100)mons_add_ench(&menv[i], ENCH_YOUR_SHUGGOTH_III);elsemons_add_ench(&menv[i], ENCH_YOUR_SHUGGOTH_IV);simple_monster_message(&menv[i], " twitches.");}return;}
// the ideal 'line', and the distance of a test point from two// actual points, one in the 'correct' direction and one in the
// the ideal 'line', and the distance of a test point from two// actual points, one in the 'correct' direction and one in the
// after this point, we're guaranteed to teleport. Turn off auto-butcher.// corpses still get butchered, but at least we don't get a silly message.if (current_delay_action() == DELAY_BUTCHER)stop_delay();
// after this point, we're guaranteed to teleport. Kill the appropriate// delays.
unsigned short flags = env.map[i - 1][j - 1];flags = !flags || (flags & ENVF_DETECTED)?ENVF_DETECTED: 0;env.map[i - 1][j - 1] = '~' | ENVF_DETECT_ITEM | flags;
set_envmap_char(i, j, get_magicmap_char(DNGN_ITEM_DETECTED));set_envmap_detected_item(i, j);
static void fuzz_detect_creatures(int pow, int *fuzz_radius, int *fuzz_chance){#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "dc_fuzz: Power is %d", pow);#endifif (pow < 1)pow = 1;*fuzz_radius = pow >= 50? 1 : 2;// Fuzz chance starts off at 100% and declines to a low of 10% for obscenely// powerful castings (pow caps around the 60 mark).*fuzz_chance = 100 - 90 * (pow - 1) / 59;if (*fuzz_chance < 10)*fuzz_chance = 10;}
static void mark_detected_creature(int gridx, int gridy, const monsters *mon,int fuzz_chance, int fuzz_radius){if (fuzz_radius && fuzz_chance > random2(100)){const int fuzz_diam = 2 * fuzz_radius + 1;int gx, gy;bool found_good = false;for (int itry = 0; itry < 5; ++itry){gx = gridx + random2(fuzz_diam) - fuzz_radius;gy = gridy + random2(fuzz_diam) - fuzz_radius;if (map_bounds(gx, gy) && !grid_is_solid(grd[gx][gy])){found_good = true;break;}}if (found_good){gridx = gx;gridy = gy;}}set_envmap_char(gridx, gridy, mons_char(mon->type));set_envmap_detected_mons(gridx, gridy);}
miscast_effect(SPTYP_TRANSLOCATION, 9, 90, 100, "a distortion effect");
// [dshaligram] At level 7 it's costly enough to experiment// with removing the miscast effect. We may need to revise the spell// to level 8 or 9. XXX.// miscast_effect(SPTYP_TRANSLOCATION,// 9, 90, 100, "a distortion effect");
void cast_chain_lightning( int powc ){struct bolt beam;// initialize beam structurebeam.name = "lightning arc";beam.aux_source = "chain lightning";beam.beam_source = MHITYOU;beam.thrower = KILL_YOU_MISSILE;beam.range = 8;beam.rangeMax = 8;beam.hit = AUTOMATIC_HIT;beam.type = SYM_ZAP;beam.flavour = BEAM_ELECTRICITY;beam.obvious_effect = true;beam.is_beam = false; // since we want to stop at our targetbeam.is_explosion = false;beam.is_tracer = false;int sx, sy;int tx, ty;int i;for (sx = you.x_pos, sy = you.y_pos;powc > 0;powc -= 8 + random2(13), sx = tx, sy = ty){// infinity as far as this spell is concerned// (Range - 1) is used because the distance is randomized and// may be shifted by one.int min_dist = MONSTER_LOS_RANGE - 1;int dist;int count = 0;tx = -1;ty = -1;for (i = 0; i < MAX_MONSTERS; i++){struct monsters *monster = &menv[i];if (monster->type == -1)continue;dist = grid_distance( sx, sy, monster->x, monster->y );// check for the source of this arcif (!dist)continue;// randomize distance (arcs don't care about a couple of feet)dist += (random2(3) - 1);// always ignore targets further than current oneif (dist > min_dist)continue;if (!check_line_of_sight( sx, sy, monster->x, monster->y ))continue;count++;if (dist < min_dist){// switch to looking for closer targets (but not always)if (!one_chance_in(10)){min_dist = dist;tx = monster->x;ty = monster->y;count = 0;}}else if (tx == -1 || one_chance_in( count )){// either first target, or new selected target at min_disttx = monster->x;ty = monster->y;// need to set min_dist for first target caseif (dist < min_dist)min_dist = dist;}}// now check if the player is a target:dist = grid_distance( sx, sy, you.x_pos, you.y_pos );if (dist) // ie player was not the source{// distance randomized (as above)dist += (random2(3) - 1);// select player if only, closest, or randomly selectedif ((tx == -1|| dist < min_dist|| (dist == min_dist && one_chance_in( count + 1 )))&& check_line_of_sight( sx, sy, you.x_pos, you.y_pos )){tx = you.x_pos;ty = you.y_pos;}}const bool see_source = see_grid( sx, sy );const bool see_targ = see_grid( tx, ty );if (tx == -1){if (see_source)mpr( "The lightning grounds out." );break;}// Trying to limit message spamming here so we'll only mention// the thunder when it's out of LoS.if (noisy( 25, sx, sy ) && !see_source)mpr( "You hear a mighty clap of thunder!", MSGCH_SOUND );if (see_source && !see_targ)mpr( "The lightning arcs out of your line of sight!" );else if (!see_source && see_targ)mpr( "The lightning arc suddenly appears!" );if (!see_targ){// It's no longer in the caster's LOS and influence.powc = powc / 2 + 1;}beam.source_x = sx;beam.source_y = sy;beam.target_x = tx;beam.target_y = ty;beam.colour = LIGHTBLUE;beam.damage = calc_dice( 5, 12 + powc * 2 / 3 );// Be kinder to the playerif (tx == you.x_pos && ty == you.y_pos){if (!(beam.damage.num /= 2))beam.damage.num = 1;if ((beam.damage.size /= 2) < 3)beam.damage.size = 3;}fire_beam( beam );}
// Centaurs do have feet and shouldn't get here anyways -- bwrsnprintf( info, INFO_SIZE, "You feel quick%s",(you.species == SP_NAGA) ? "." : " on your feet." );mpr(info);
// [dshaligram] Removed the on-your-feet bit. Sounds odd when you're// levitating, for instance.mpr("You feel quick.");
static const int skill_display_order[] = {SK_FIGHTING, SK_SHORT_BLADES, SK_LONG_SWORDS, SK_AXES,SK_MACES_FLAILS, SK_POLEARMS, SK_STAVES, SK_UNARMED_COMBAT,SK_BLANK_LINE,SK_RANGED_COMBAT, SK_SLINGS, SK_BOWS, SK_CROSSBOWS, SK_DARTS,SK_BLANK_LINE,SK_ARMOUR, SK_DODGING, SK_STEALTH, SK_STABBING, SK_SHIELDS, SK_TRAPS_DOORS,SK_BLANK_LINE,SK_COLUMN_BREAK,SK_SPELLCASTING, SK_CONJURATIONS, SK_ENCHANTMENTS, SK_SUMMONINGS,SK_NECROMANCY, SK_TRANSLOCATIONS, SK_TRANSMIGRATION, SK_DIVINATIONS,SK_FIRE_MAGIC, SK_ICE_MAGIC, SK_AIR_MAGIC, SK_EARTH_MAGIC, SK_POISON_MAGIC,SK_BLANK_LINE,SK_INVOCATIONS, SK_EVOCATIONS,};static const int ndisplayed_skills =sizeof(skill_display_order) / sizeof(*skill_display_order);
cprintf( " (%d)",(((needed * spec_abil) / 100 - you.skill_points[x]) * 10) /(((needed - prev_needed) * spec_abil) / 100) );
if ( percent_done == 100 )--percent_done;if ( percent_done == 0 )++percent_done;if ( !Options.increasing_skill_progress )cprintf( " (%d)", (100 - percent_done) / 10 );elsecprintf( " (%2d%%)", (percent_done / 5) * 5 );
strcpy(info, "Your ");strcat(info, skill_name(exsk));strcat(info, " skill increases!");mpr(info, MSGCH_INTRINSIC_GAIN);
you.skills[exsk]++;take_note(Note(NOTE_GAIN_SKILL, exsk, you.skills[exsk]));if (you.skills[exsk] == 27) {snprintf( info, INFO_SIZE, "You have mastered %s!",skill_name( exsk ) );}else if (you.skills[exsk] == 1) {snprintf( info, INFO_SIZE, "You have gained %s skill!",skill_name( exsk ) );}else {snprintf( info, INFO_SIZE, "Your %s skill increases to level %d!",skill_name( exsk ), you.skills[exsk] );}
static std::string hyphenated_suffix(char prev, char last){std::string s;if (prev > last + 2)s += "</w>-<w>";else if (prev == last + 2)s += (char) (last + 1);if (prev != last)s += prev;return (s);}static std::string purchase_keys(const std::string &s){if (s.empty())return "";std::string list = "<w>" + s.substr(0, 1);char last = s[0];for (int i = 1; i < (int) s.length(); ++i){if (s[i] == s[i - 1] + 1)continue;char prev = s[i - 1];list += hyphenated_suffix(prev, last);list += (last = s[i]);}list += hyphenated_suffix( s[s.length() - 1], last );list += "</w>";return (list);}static void list_shop_keys(const std::string &purchasable){char buf[200];gotoxy(1, 23);
std::string pkeys = purchase_keys(purchasable);if (pkeys.length())pkeys = "[" + pkeys + "] Buy Item";snprintf(buf, sizeof buf,"[<w>x</w>/<w>Esc</w>] Exit [<w>v</w>] Examine Items %s",pkeys.c_str());formatted_string fs = formatted_string::parse_string(buf);fs.cprintf("%*s", get_number_of_cols() - fs.length(), "");fs.display();gotoxy(1, 24);fs = formatted_string::parse_string("[<w>?</w>/<w>*</w>] Inventory ""[<w>\\</w>] Known Items");fs.cprintf("%*s", get_number_of_cols() - fs.length(), "");fs.display();}
if ( fully_identified(mitm[item_got]) &&is_interesting_item(mitm[item_got]) ) {activate_notes(true);char buf[ITEMNAME_SIZE];char buf2[ITEMNAME_SIZE];item_name( mitm[item_got], DESC_NOCAP_A, buf );strcpy(buf2, origin_desc(mitm[item_got]).c_str());take_note(Note(NOTE_ID_ITEM, 0, 0, buf, buf2));activate_notes(false);}
make_name( cshop->keeper_name[0], cshop->keeper_name[1],cshop->keeper_name[2], 3, st_p );
unsigned long seed = static_cast<unsigned long>( cshop->keeper_name[0] )| (static_cast<unsigned long>( cshop->keeper_name[1] ) << 8)| (static_cast<unsigned long>( cshop->keeper_name[1] ) << 16);make_name( seed, false, st_p );
// last updated 24may2000 {dlb}/* ************************************************************************ called from: acr - decks - fight - player - religion - spell* *********************************************************************** */
void dec_penance(int god, int val);
// last updated 24may2000 {dlb}/* ************************************************************************ called from: beam - decks - fight - religion* *********************************************************************** */void done_good(char thing_done, int pgain);// last updated 24may2000 {dlb}/* ************************************************************************ called from: ability - religion* *********************************************************************** */
bool did_god_conduct(int thing_done, int pgain);
// last updated 24may2000 {dlb}/* ************************************************************************ called from: acr - beam - fight - it_use2 - item_use - religion - spell -* spellbook - spells4* *********************************************************************** */void naughty(char type_naughty, int naughtiness);// last updated 24may2000 {dlb}/* ************************************************************************ called from: food* *********************************************************************** */
static int random_undead_servant(int religion){// error trapping {dlb}int thing_called = MONS_PROGRAM_BUG;int temp_rand = random2(100);thing_called = ((temp_rand > 66) ? MONS_WRAITH : // 33%(temp_rand > 52) ? MONS_WIGHT : // 12%(temp_rand > 40) ? MONS_SPECTRAL_WARRIOR : // 16%(temp_rand > 31) ? MONS_ROTTING_HULK : // 9%(temp_rand > 23) ? MONS_SKELETAL_WARRIOR : // 8%(temp_rand > 16) ? MONS_VAMPIRE : // 7%(temp_rand > 10) ? MONS_GHOUL : // 6%(temp_rand > 4) ? MONS_MUMMY // 6%: MONS_FLAYED_GHOST); // 5%return (thing_called);}
//jmf: "good" god will sometimes feed you (a la Nethack)if (you.religion == GOD_ZIN&& you.hunger_state == HS_STARVING&& random2(250) <= you.piety){god_speaks(you.religion, "Your stomach feels content.");set_hunger(6000, true);lose_piety(5 + random2avg(10, 2));inc_gift_timeout(30 + random2avg(10, 2));return;}if (you.religion == GOD_NEMELEX_XOBEH&& random2(200) <= you.piety&& (!you.attribute[ATTR_CARD_TABLE] || one_chance_in(3))&& !you.attribute[ATTR_CARD_COUNTDOWN]&& grd[you.x_pos][you.y_pos] != DNGN_LAVA&& grd[you.x_pos][you.y_pos] != DNGN_DEEP_WATER)
switch (you.religion)
if (!you.attribute[ATTR_CARD_TABLE]){thing_created = items( 1, OBJ_MISCELLANY,MISC_PORTABLE_ALTAR_OF_NEMELEX,true, 1, 250 );if (thing_created != NON_ITEM)you.attribute[ATTR_CARD_TABLE] = 1;}else
case GOD_ZIN://jmf: "good" god will sometimes feed you (a la Nethack)if (you.hunger_state == HS_STARVING&& random2(250) <= you.piety)
if (random2(200) <= you.piety && one_chance_in(4))gift_type = MISC_DECK_OF_SUMMONINGS;if (random2(200) <= you.piety && coinflip())gift_type = MISC_DECK_OF_WONDERS;if (random2(200) <= you.piety && one_chance_in(4))gift_type = MISC_DECK_OF_POWER;thing_created = items( 1, OBJ_MISCELLANY, gift_type,true, 1, 250 );
god_speaks(you.religion, "Your stomach feels content.");set_hunger(6000, true);lose_piety(5 + random2avg(10, 2));inc_gift_timeout(30 + random2avg(10, 2));
move_item_to_grid( &thing_created, you.x_pos, you.y_pos );origin_acquired(mitm[thing_created], you.religion);simple_god_message(" grants you a gift!");more();canned_msg(MSG_SOMETHING_APPEARS);
int thing_created = NON_ITEM;unsigned char gift_type = MISC_DECK_OF_TRICKS;
if ((you.religion == GOD_OKAWARU || you.religion == GOD_TROG)&& you.piety > 130&& random2(you.piety) > 120&& grd[you.x_pos][you.y_pos] != DNGN_LAVA&& grd[you.x_pos][you.y_pos] != DNGN_DEEP_WATER&& one_chance_in(4)){if (you.religion == GOD_TROG|| (you.religion == GOD_OKAWARU && coinflip())){success = acquirement(OBJ_WEAPONS, you.religion);}else{success = acquirement(OBJ_ARMOUR, you.religion);}
if (thing_created != NON_ITEM)you.attribute[ATTR_CARD_TABLE] = 1;}else{if (random2(200) <= you.piety && one_chance_in(4))gift_type = MISC_DECK_OF_SUMMONINGS;if (random2(200) <= you.piety && coinflip())gift_type = MISC_DECK_OF_WONDERS;if (random2(200) <= you.piety && one_chance_in(4))gift_type = MISC_DECK_OF_POWER;
inc_gift_timeout(30 + random2avg(19, 2));}}
if (thing_created != NON_ITEM){move_item_to_grid( &thing_created, you.x_pos, you.y_pos );origin_acquired(mitm[thing_created], you.religion);simple_god_message(" grants you a gift!");more();canned_msg(MSG_SOMETHING_APPEARS);
if (you.religion == GOD_YREDELEMNUL&& random2(you.piety) > 80 && one_chance_in(5)){int thing_called = MONS_PROGRAM_BUG; // error trapping {dlb}
you.attribute[ATTR_CARD_COUNTDOWN] = 10;inc_gift_timeout(5 + random2avg(9, 2));you.num_gifts[you.religion]++;take_note(Note(NOTE_GOD_GIFT, you.religion));}}break;case GOD_OKAWARU:case GOD_TROG:if (you.piety > 130&& random2(you.piety) > 120&& !grid_destroys_items(grd[you.x_pos][you.y_pos])&& one_chance_in(4)){if (you.religion == GOD_TROG|| (you.religion == GOD_OKAWARU && coinflip())){success = acquirement(OBJ_WEAPONS, you.religion);}else{success = acquirement(OBJ_ARMOUR, you.religion);}
temp_rand = random2(100);thing_called = ((temp_rand > 66) ? MONS_WRAITH : // 33%(temp_rand > 52) ? MONS_WIGHT : // 12%(temp_rand > 40) ? MONS_SPECTRAL_WARRIOR : // 16%(temp_rand > 31) ? MONS_ROTTING_HULK : // 9%(temp_rand > 23) ? MONS_SKELETAL_WARRIOR : // 8%(temp_rand > 16) ? MONS_VAMPIRE : // 7%(temp_rand > 10) ? MONS_GHOUL : // 6%(temp_rand > 4) ? MONS_MUMMY // 6%: MONS_FLAYED_GHOST); // 5%
if (success){simple_god_message(" has granted you a gift!");more();
if (create_monster( thing_called, 0, BEH_FRIENDLY,you.x_pos, you.y_pos,you.pet_target, 250 ) != -1){simple_god_message(" grants you an undead servant!");more();inc_gift_timeout(4 + random2avg(7, 2));
inc_gift_timeout(30 + random2avg(19, 2));you.num_gifts[ you.religion ]++;take_note(Note(NOTE_GOD_GIFT, you.religion));}break;
if ((you.religion == GOD_KIKUBAAQUDGHA|| you.religion == GOD_SIF_MUNA|| you.religion == GOD_VEHUMET)&& you.piety > 160 && random2(you.piety) > 100){unsigned int gift = NUM_BOOKS;switch (you.religion)
if (you.religion == GOD_OKAWARU&& you.piety > 80&& random2( you.piety ) > 70&& !grid_destroys_items( grd[you.x_pos][you.y_pos] )&& one_chance_in(8)&& you.skills[ best_skill(SK_SLINGS, SK_RANGED_COMBAT) ] >= 9)
case GOD_KIKUBAAQUDGHA: // gives death booksif (!you.had_book[BOOK_NECROMANCY])gift = BOOK_NECROMANCY;else if (!you.had_book[BOOK_DEATH])gift = BOOK_DEATH;else if (!you.had_book[BOOK_UNLIFE])gift = BOOK_UNLIFE;else if (!you.had_book[BOOK_NECRONOMICON])gift = BOOK_NECRONOMICON;break;
success = acquirement( OBJ_MISSILES, you.religion );if (success){simple_god_message( " has granted you a gift!" );more();
// Vehumet - gives conj/summ. books (higher skill first)case GOD_VEHUMET:if (!you.had_book[BOOK_CONJURATIONS_I])gift = give_first_conjuration_book();else if (!you.had_book[BOOK_POWER])gift = BOOK_POWER;else if (!you.had_book[BOOK_ANNIHILATIONS])gift = BOOK_ANNIHILATIONS; // conj books
}break;
if (you.skills[SK_CONJURATIONS] < you.skills[SK_SUMMONINGS]|| gift == NUM_BOOKS)
case GOD_YREDELEMNUL:if (random2(you.piety) > 80 && one_chance_in(5)){int thing_called = random_undead_servant(GOD_YREDELEMNUL);if (create_monster( thing_called, 0, BEH_FRIENDLY,you.x_pos, you.y_pos,you.pet_target, 250 ) != -1)
if (!you.had_book[BOOK_CALLINGS])gift = BOOK_CALLINGS;else if (!you.had_book[BOOK_SUMMONINGS])gift = BOOK_SUMMONINGS;else if (!you.had_book[BOOK_DEMONOLOGY])gift = BOOK_DEMONOLOGY; // summoning bks
simple_god_message(" grants you an undead servant!");more();inc_gift_timeout(4 + random2avg(7, 2));you.num_gifts[you.religion]++;take_note(Note(NOTE_GOD_GIFT, you.religion));
int thing_created = items(1, OBJ_BOOKS, gift, true, 1, 250);if (thing_created == NON_ITEM)return;
case GOD_KIKUBAAQUDGHA: // gives death booksif (!you.had_book[BOOK_NECROMANCY])gift = BOOK_NECROMANCY;else if (!you.had_book[BOOK_DEATH])gift = BOOK_DEATH;else if (!you.had_book[BOOK_UNLIFE])gift = BOOK_UNLIFE;else if (!you.had_book[BOOK_NECRONOMICON])gift = BOOK_NECRONOMICON;break;
if (thing_created != NON_ITEM)
// Vehumet - gives conj/summ. books (higher skill first)case GOD_VEHUMET:if (!you.had_book[BOOK_CONJURATIONS_I])gift = give_first_conjuration_book();else if (!you.had_book[BOOK_POWER])gift = BOOK_POWER;else if (!you.had_book[BOOK_ANNIHILATIONS])gift = BOOK_ANNIHILATIONS; // conj booksif (you.skills[SK_CONJURATIONS] <you.skills[SK_SUMMONINGS]|| gift == NUM_BOOKS)
success = true;origin_acquired(mitm[thing_created], you.religion);
if (!you.had_book[BOOK_CALLINGS])gift = BOOK_CALLINGS;else if (!you.had_book[BOOK_SUMMONINGS])gift = BOOK_SUMMONINGS;else if (!you.had_book[BOOK_DEMONOLOGY])gift = BOOK_DEMONOLOGY; // summoning bks
// Vehumet gives books less readilyif (you.religion == GOD_VEHUMET && success)inc_gift_timeout(10 + random2(10));} // end of giving book} // end of book gods
if (success){simple_god_message(" has granted you a gift!");more();inc_gift_timeout(40 + random2avg(19, 2));you.num_gifts[ you.religion ]++;take_note(Note(NOTE_GOD_GIFT, you.religion));}// Vehumet gives books less readilyif (you.religion == GOD_VEHUMET && success)inc_gift_timeout(10 + random2(10));} // end of giving book} // end of book godsbreak;}
case GOOD_KILLED_LIVING:
case DID_NECROMANCY:case DID_UNHOLY:case DID_ATTACK_HOLY:switch (you.religion){case GOD_ZIN:case GOD_SHINING_ONE:case GOD_ELYVILON:piety_change = -level;penance = level * ((you.religion == GOD_ZIN) ? 2 : 1);ret = true;break;}break;case DID_STABBING:case DID_POISON:if (you.religion == GOD_SHINING_ONE){ret = true;piety_change = -level;penance = level * 2;}break;case DID_ATTACK_FRIEND:switch (you.religion){case GOD_ZIN:case GOD_SHINING_ONE:case GOD_ELYVILON:case GOD_OKAWARU:piety_change = -level;penance = level * 3;ret = true;break;}break;case DID_FRIEND_DIES:switch (you.religion){case GOD_ELYVILON:penance = level; // healer god cares more about this// fall throughcase GOD_ZIN:case GOD_SHINING_ONE:case GOD_OKAWARU:piety_change = -level;ret = true;break;}break;case DID_DEDICATED_BUTCHERY: // aka field sacrifice
case GOD_ELYVILON:simple_god_message(" did not appreciate that!");naughty(NAUGHTY_ATTACK_HOLY, (you.conf ? 3 : pgain * 3));
case GOD_OKAWARU:simple_god_message(" accepts your kill.");ret = true;if (random2(level + 18) > 3)piety_change = 1;
simple_god_message( " appreciates your killing of a magic user." );if (random2( 5 + pgain ) > 5)gain_piety(1);
// hooking this up, but is it too good?// enjoy it while you can -- bwrsimple_god_message(" appreciates your killing of a magic user.");ret = true;if (random2(level + 10) > 5)piety_change = 1;
case GOOD_HACKED_CORPSE: // NB - pgain is you.experience_level (maybe)
// Note that Angel deaths are special, they are always noticed...// if you or any friendly kills one you'll get the credit or the blame.case DID_ANGEL_KILLED_BY_SERVANT:case DID_KILL_ANGEL:
// case GOD_KIKUBAAQUDGHA:case GOD_OKAWARU:case GOD_MAKHLEB:case GOD_TROG:simple_god_message(" accepts your offering.");if (random2(10 + pgain) > 5)gain_piety(1);
case GOD_ZIN:case GOD_SHINING_ONE:case GOD_ELYVILON:level *= 3;piety_change = -level;penance = level * ((you.religion == GOD_ZIN) ? 2 : 1);ret = true;
// case GOD_ZIN:// case GOD_SHINING_ONE:case GOD_ELYVILON:simple_god_message(" did not appreciate that!");
case GOD_KIKUBAAQUDGHA:case GOD_YREDELEMNUL:case GOD_MAKHLEB:snprintf( info, INFO_SIZE, " accepts your %skill.",(thing_done == DID_KILL_ANGEL) ? "" : "collateral " );simple_god_message( info );
if (random2(pgain + 18) > 5)gain_piety(1);
case DID_UNDEAD_KILLED_BY_SERVANT:switch (you.religion){case GOD_ZIN:case GOD_SHINING_ONE:case GOD_VEHUMET:case GOD_MAKHLEB:simple_god_message(" accepts your collateral kill.");ret = true;if (random2(level + 10) > 5)piety_change = 1;
// Offering at altars is covered in another function.
case DID_SPELL_MEMORISE:if (you.religion == GOD_TROG){penance = level * 10;piety_change = -penance;ret = true;}break;case DID_SPELL_CASTING:if (you.religion == GOD_TROG){piety_change = -level;penance = level * 5;ret = true;}break;case DID_SPELL_PRACTISE:// Like CAST, but for skill advancement.// Level is number of skill points gained... typically 10 * exerise,// but may be more/less if the skill is at 0 (INT adjustment), or// if the PC's pool is low and makes change.if (you.religion == GOD_SIF_MUNA){// Old curve: random2(12) <= spell-level, this is similar,// but faster at low levels (to help ease things for low level// Power averages about (level * 20 / 3) + 10 / 3 now. Also// note that spell skill practise comes just after XP gain, so// magical kills tend to do both at the same time (unlike melee).// This means high level spells probably work pretty much like// they used to (use spell, get piety).piety_change = div_rand_round( level + 10, 80 );#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Spell practise, level: %d, dpiety: %d",level, piety_change);#endifret = true;}break;case DID_CARDS:if (you.religion == GOD_NEMELEX_XOBEH){piety_change = level;ret = true;}break;case DID_STIMULANTS: // unusedcase DID_EAT_MEAT: // unusedcase DID_CREATED_LIFE: // unusedcase DID_DEDICATED_KILL_NATURAL_EVIL: // unusedcase DID_NATURAL_EVIL_KILLED_BY_SERVANT: // unusedcase DID_SPELL_NONUTILITY: // unuseddefault:break;
} // end done_good()
if (piety_change > 0)gain_piety( piety_change );else{const int piety_loss = -piety_change;if (piety_loss){// output guilt message:mprf( "You feel%sguilty.",(piety_loss == 1) ? " a little " :(piety_loss < 5) ? " " :(piety_loss < 10) ? " very ": " extremely " );lose_piety( piety_loss );}if (you.piety < 1)excommunication();else if (penance) // only if still in religion{god_speaks( you.religion,"\"You will pay for your transgression, mortal!\"" );inc_penance( penance );}}#if DEBUG_DIAGNOSTICSif (ret){static const char *conducts[] ={"","Necromancy", "Unholy", "Attack Holy", "Attack Friend","Friend Died", "Stab", "Poison", "Field Sacrifice","Kill Living", "Kill Undead", "Kill Demon", "Kill Natural Evil","Kill Wizard","Kill Priest", "Kill Angel", "Undead Slave Kill Living","Servant Kill Living", "Servant Kill Undead","Servant Kill Demon", "Servant Kill Natural Evil","Servant Kill Angel","Spell Memorise", "Spell Cast", "Spell Practise", "Spell Nonutility","Cards", "Stimulants", "Eat Meat", "Create Life"};
if (you.piety > 199|| (you.piety > 150 && one_chance_in(3))|| (you.piety > 100 && one_chance_in(3)))return;
if (you.religion != GOD_SIF_MUNA){if (you.piety > 199|| (you.piety > 150 && one_chance_in(3))|| (you.piety > 100 && one_chance_in(3)))return;}else{// Sif Muna has a gentler taper off because training because// naturally slower as the player gains in spell skills.if (you.piety > 150 && one_chance_in(5))return;}
// if you currently worship no deity in particular, exit function {dlb}if (you.religion == GOD_NO_GOD)return;
if ( you.piety > 160 && old_piety <= 160 &&(you.religion == GOD_SHINING_ONE || you.religion == GOD_ZIN) &&you.num_gifts[you.religion] == 0 )simple_god_message( " will now bless your weapon at an altar...once.");
switch (you.religion){case GOD_ZIN:switch (type_naughty){case NAUGHTY_NECROMANCY:case NAUGHTY_UNHOLY:case NAUGHTY_ATTACK_HOLY:piety_loss = naughtiness;penance = piety_loss * 2;break;case NAUGHTY_ATTACK_FRIEND:piety_loss = naughtiness;penance = piety_loss * 3;break;case NAUGHTY_FRIEND_DIES:piety_loss = naughtiness;break;case NAUGHTY_BUTCHER:piety_loss = naughtiness;if (one_chance_in(3))penance = piety_loss;break;}break;
} // end gain_piety()
case GOD_SHINING_ONE:switch (type_naughty){case NAUGHTY_NECROMANCY:case NAUGHTY_UNHOLY:case NAUGHTY_ATTACK_HOLY:piety_loss = naughtiness;penance = piety_loss;break;case NAUGHTY_ATTACK_FRIEND:piety_loss = naughtiness;penance = piety_loss * 3;break;case NAUGHTY_FRIEND_DIES:piety_loss = naughtiness;break;case NAUGHTY_BUTCHER:piety_loss = naughtiness;if (one_chance_in(3))penance = piety_loss;break;case NAUGHTY_STABBING:piety_loss = naughtiness;if (one_chance_in(5)) // can be accidental so we're nice herepenance = piety_loss;break;case NAUGHTY_POISON:piety_loss = naughtiness;penance = piety_loss * 2;break;}break;case GOD_ELYVILON:switch (type_naughty){case NAUGHTY_NECROMANCY:case NAUGHTY_UNHOLY:case NAUGHTY_ATTACK_HOLY:piety_loss = naughtiness;penance = piety_loss;break;case NAUGHTY_KILLING:piety_loss = naughtiness;penance = piety_loss * 2;break;case NAUGHTY_ATTACK_FRIEND:piety_loss = naughtiness;penance = piety_loss * 3;break;// Healer god gets a bit more upset since you should have// used your healing powers to save them.case NAUGHTY_FRIEND_DIES:piety_loss = naughtiness;penance = piety_loss;break;case NAUGHTY_BUTCHER:piety_loss = naughtiness;if (one_chance_in(3))penance = piety_loss;break;}break;case GOD_OKAWARU:switch (type_naughty){case NAUGHTY_ATTACK_FRIEND:piety_loss = naughtiness;penance = piety_loss * 3;break;case NAUGHTY_FRIEND_DIES:piety_loss = naughtiness;break;}break;case GOD_TROG:switch (type_naughty){case NAUGHTY_SPELLCASTING:piety_loss = naughtiness;// This penance isn't so bad since its much easier to// gain piety with Trog than the other gods in this function.penance = piety_loss * 10;break;}break;}// exit function early iff piety loss is zero:if (piety_loss < 1)return;// output guilt message:strcpy(info, "You feel");strcat(info, (piety_loss == 1) ? " a little " :(piety_loss < 5) ? " " :(piety_loss < 10) ? " very ": " extremely ");strcat(info, "guilty.");mpr(info);lose_piety(piety_loss);if (you.piety < 1)excommunication();else if (penance) // Don't bother unless we're not kicking them out{//jmf: FIXME: add randomness to following message:god_speaks(you.religion, "\"You will pay for your transgression, mortal!\"");inc_penance(penance);}} // end naughty()
// like Xom, this might actually help the player -- bwr`simple_god_message(" makes you to draw from the Deck of Punishment.",
// like Xom, this might actually help the player -- bwrsimple_god_message(" makes you draw from the Deck of Punishment.",
static bool bless_weapon( int god, int brand, int colour ){const int wpn = get_player_wielded_weapon();// Assuming the type of weapon is correct, we only need to check// to see if it's an artefact we can successfully clobber:if (!is_fixed_artefact( you.inv[wpn] )&& !is_random_artefact( you.inv[wpn] )){you.duration[DUR_WEAPON_BRAND] = 0; // just in caseset_equip_desc( you.inv[wpn], ISFLAG_GLOWING );set_item_ego_type( you.inv[wpn], OBJ_WEAPONS, brand );you.inv[wpn].colour = colour;
you.wield_change = true;you.num_gifts[god]++;take_note(Note(NOTE_GOD_GIFT, you.religion));you.flash_colour = colour;viewwindow( true, false );mprf( MSGCH_GOD, "Your weapon shines brightly!" );simple_god_message( " booms: Use this gift wisely!" );// as currently only Zin and TSO do this is our permabrand effect:holy_word( 100, true );delay(1000);return (true);}return (false);}
if (wpn != -1&& weapon_skill( you.inv[wpn] ) == SK_LONG_SWORDS&& get_weapon_brand( you.inv[wpn] ) != SPWPN_HOLY_WRATH){if (bless_weapon( GOD_SHINING_ONE, SPWPN_HOLY_WRATH, YELLOW )){// convert those demon blades if blessed:if (you.inv[wpn].sub_type == WPN_DEMON_BLADE)you.inv[wpn].sub_type = WPN_BLESSED_BLADE;}}}// Zin blesses maces with disruptionif (you.religion == GOD_ZIN&& !you.num_gifts[GOD_ZIN]&& !player_under_penance()&& you.piety > 160){const int wpn = get_player_wielded_weapon();if (wpn != -1&& (you.inv[wpn].base_type == OBJ_WEAPONS&& (you.inv[wpn].sub_type == WPN_MACE|| you.inv[wpn].sub_type == WPN_GREAT_MACE))&& get_weapon_brand( you.inv[wpn] ) != SPWPN_DISRUPTION){bless_weapon( GOD_ZIN, SPWPN_DISRUPTION, WHITE );}}
/* A Bison parser, made by GNU Bison 2.3. *//* Skeleton interface for Bison's Yacc-like parsers in CCopyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006Free Software Foundation, Inc.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor,Boston, MA 02110-1301, USA. *//* As a special exception, you may create a larger work that containspart or all of the Bison parser skeleton and distribute that workunder terms of your choice, so long as that work isn't itself aparser generator using the skeleton or a modified version thereofas a parser skeleton. Alternatively, if you modify or redistributethe parser skeleton itself, you may (at your option) remove thisspecial exception, which will cause the skeleton and the resultingBison output files to be licensed under the GNU General PublicLicense without this special exception.This special exception was added by the Free Software Foundation inversion 2.2 of Bison. *//* Tokens. */#ifndef YYTOKENTYPE# define YYTOKENTYPE/* Put the tokens into the symbol table, so that GDB and other debuggersknow about them. */enum yytokentype {DEFAULT_DEPTH = 258,SYMBOL = 259,TAGS = 260,NAME = 261,DEPTH = 262,ORIENT = 263,PLACE = 264,CHANCE = 265,FLAGS = 266,MONS = 267,ENCOMPASS = 268,NORTH = 269,EAST = 270,SOUTH = 271,WEST = 272,NORTHEAST = 273,SOUTHEAST = 274,SOUTHWEST = 275,NORTHWEST = 276,BAD_CHARACTER = 277,NO_HMIRROR = 278,NO_VMIRROR = 279,NO_ROTATE = 280,PANDEMONIC = 281,DASH = 282,COMMA = 283,INTEGER = 284,STRING = 285,MAP_LINE = 286,MONSTER_NAME = 287};#endif/* Tokens. */#define DEFAULT_DEPTH 258#define SYMBOL 259#define TAGS 260#define NAME 261#define DEPTH 262#define ORIENT 263#define PLACE 264#define CHANCE 265#define FLAGS 266#define MONS 267#define ENCOMPASS 268#define NORTH 269#define EAST 270#define SOUTH 271#define WEST 272#define NORTHEAST 273#define SOUTHEAST 274#define SOUTHWEST 275#define NORTHWEST 276#define BAD_CHARACTER 277#define NO_HMIRROR 278#define NO_VMIRROR 279#define NO_ROTATE 280#define PANDEMONIC 281#define DASH 282#define COMMA 283#define INTEGER 284#define STRING 285#define MAP_LINE 286#define MONSTER_NAME 287#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLAREDtypedef union YYSTYPE#line 21 "levcomp.ypp"{int i;const char *text;}/* Line 1529 of yacc.c. */#line 118 "levcomp.tab.h"YYSTYPE;# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endifextern YYSTYPE yylval;
/* A Bison parser, made by GNU Bison 2.3. *//* Skeleton implementation for Bison's Yacc-like parsers in CCopyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006Free Software Foundation, Inc.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor,Boston, MA 02110-1301, USA. *//* As a special exception, you may create a larger work that containspart or all of the Bison parser skeleton and distribute that workunder terms of your choice, so long as that work isn't itself aparser generator using the skeleton or a modified version thereofas a parser skeleton. Alternatively, if you modify or redistributethe parser skeleton itself, you may (at your option) remove thisspecial exception, which will cause the skeleton and the resultingBison output files to be licensed under the GNU General PublicLicense without this special exception.This special exception was added by the Free Software Foundation inversion 2.2 of Bison. *//* C LALR(1) parser skeleton written by Richard Stallman, bysimplifying the original so-called "semantic" parser. *//* All symbols defined below should begin with yy or YY, to avoidinfringing on user name space. This should be done even for localvariables, as they might otherwise be expanded by user macros.There are some unavoidable exceptions within include files todefine necessary library symbols; they are noted "INFRINGES ONUSER NAME SPACE" below. *//* Identify Bison output. */#define YYBISON 1/* Bison version. */#define YYBISON_VERSION "2.3"/* Skeleton name. */#define YYSKELETON_NAME "yacc.c"/* Pure parsers. */#define YYPURE 0/* Using locations. */#define YYLSP_NEEDED 0/* Tokens. */#ifndef YYTOKENTYPE# define YYTOKENTYPE/* Put the tokens into the symbol table, so that GDB and other debuggersknow about them. */enum yytokentype {DEFAULT_DEPTH = 258,SYMBOL = 259,TAGS = 260,NAME = 261,DEPTH = 262,ORIENT = 263,PLACE = 264,CHANCE = 265,FLAGS = 266,MONS = 267,ENCOMPASS = 268,NORTH = 269,EAST = 270,SOUTH = 271,WEST = 272,NORTHEAST = 273,SOUTHEAST = 274,SOUTHWEST = 275,NORTHWEST = 276,BAD_CHARACTER = 277,NO_HMIRROR = 278,NO_VMIRROR = 279,NO_ROTATE = 280,PANDEMONIC = 281,DASH = 282,COMMA = 283,INTEGER = 284,STRING = 285,MAP_LINE = 286,MONSTER_NAME = 287};#endif/* Tokens. */#define DEFAULT_DEPTH 258#define SYMBOL 259#define TAGS 260#define NAME 261#define DEPTH 262#define ORIENT 263#define PLACE 264#define CHANCE 265#define FLAGS 266#define MONS 267#define ENCOMPASS 268#define NORTH 269#define EAST 270#define SOUTH 271#define WEST 272#define NORTHEAST 273#define SOUTHEAST 274#define SOUTHWEST 275#define NORTHWEST 276#define BAD_CHARACTER 277#define NO_HMIRROR 278#define NO_VMIRROR 279#define NO_ROTATE 280#define PANDEMONIC 281#define DASH 282#define COMMA 283#define INTEGER 284#define STRING 285#define MAP_LINE 286#define MONSTER_NAME 287/* Copy the first part of user declarations. */#line 1 "levcomp.ypp"#include "AppHdr.h"#include "libutil.h"#include "levcomp.h"int yylex();extern int yylineno;void yyerror(const char *e){fprintf(stderr, "%s:%d: %s\n", lc_desfile.c_str(), yylineno, e);// Bail bail bail.exit(1);}/* Enabling traces. */#ifndef YYDEBUG# define YYDEBUG 0#endif/* Enabling verbose error messages. */#ifdef YYERROR_VERBOSE# undef YYERROR_VERBOSE# define YYERROR_VERBOSE 1#else# define YYERROR_VERBOSE 0#endif/* Enabling the token table. */#ifndef YYTOKEN_TABLE# define YYTOKEN_TABLE 0#endif#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLAREDtypedef union YYSTYPE#line 21 "levcomp.ypp"{int i;const char *text;}/* Line 193 of yacc.c. */#line 184 "levcomp.tab.c"YYSTYPE;# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endif/* Copy the second part of user declarations. *//* Line 216 of yacc.c. */#line 197 "levcomp.tab.c"#ifdef short# undef short#endif#ifdef YYTYPE_UINT8typedef YYTYPE_UINT8 yytype_uint8;#elsetypedef unsigned char yytype_uint8;#endif#ifdef YYTYPE_INT8typedef YYTYPE_INT8 yytype_int8;#elif (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)typedef signed char yytype_int8;#elsetypedef short int yytype_int8;#endif#ifdef YYTYPE_UINT16typedef YYTYPE_UINT16 yytype_uint16;#elsetypedef unsigned short int yytype_uint16;#endif#ifdef YYTYPE_INT16typedef YYTYPE_INT16 yytype_int16;#elsetypedef short int yytype_int16;#endif#ifndef YYSIZE_T# ifdef __SIZE_TYPE__# define YYSIZE_T __SIZE_TYPE__# elif defined size_t# define YYSIZE_T size_t# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)# include <stddef.h> /* INFRINGES ON USER NAME SPACE */# define YYSIZE_T size_t# else# define YYSIZE_T unsigned int# endif#endif#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)#ifndef YY_# if YYENABLE_NLS# if ENABLE_NLS# include <libintl.h> /* INFRINGES ON USER NAME SPACE */# define YY_(msgid) dgettext ("bison-runtime", msgid)# endif# endif# ifndef YY_# define YY_(msgid) msgid# endif#endif/* Suppress unused-variable warnings by "using" E. */#if ! defined lint || defined __GNUC__# define YYUSE(e) ((void) (e))#else# define YYUSE(e) /* empty */#endif/* Identity function, used to suppress warnings about constant conditions. */#ifndef lint# define YYID(n) (n)#else#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static intYYID (int i)#elsestatic intYYID (i)int i;#endif{return i;}#endif#if ! defined yyoverflow || YYERROR_VERBOSE/* The parser invokes alloca or malloc; define the necessary symbols. */# ifdef YYSTACK_USE_ALLOCA# if YYSTACK_USE_ALLOCA# ifdef __GNUC__# define YYSTACK_ALLOC __builtin_alloca# elif defined __BUILTIN_VA_ARG_INCR# include <alloca.h> /* INFRINGES ON USER NAME SPACE */# elif defined _AIX# define YYSTACK_ALLOC __alloca# elif defined _MSC_VER# include <malloc.h> /* INFRINGES ON USER NAME SPACE */# define alloca _alloca# else# define YYSTACK_ALLOC alloca# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# ifndef _STDLIB_H# define _STDLIB_H 1# endif# endif# endif# endif# endif# ifdef YYSTACK_ALLOC/* Pacify GCC's `empty if-body' warning. */# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))# ifndef YYSTACK_ALLOC_MAXIMUM/* The OS might guarantee only one guard page at the bottom of the stack,and a page size can be as small as 4096 bytes. So we cannot safelyinvoke alloca (N) if N exceeds 4096. Use a slightly smaller numberto allow for a few compiler-allocated temporary stack slots. */# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */# endif# else# define YYSTACK_ALLOC YYMALLOC# define YYSTACK_FREE YYFREE# ifndef YYSTACK_ALLOC_MAXIMUM# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM# endif# if (defined __cplusplus && ! defined _STDLIB_H \&& ! ((defined YYMALLOC || defined malloc) \&& (defined YYFREE || defined free)))# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# ifndef _STDLIB_H# define _STDLIB_H 1# endif# endif# ifndef YYMALLOC# define YYMALLOC malloc# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */# endif# endif# ifndef YYFREE# define YYFREE free# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)void free (void *); /* INFRINGES ON USER NAME SPACE */# endif# endif# endif#endif /* ! defined yyoverflow || YYERROR_VERBOSE */#if (! defined yyoverflow \&& (! defined __cplusplus \|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member. */union yyalloc{yytype_int16 yyss;YYSTYPE yyvs;};/* The size of the maximum gap between one aligned stack and the next. */# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each withN elements. */# define YYSTACK_BYTES(N) \((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \+ YYSTACK_GAP_MAXIMUM)/* Copy COUNT objects from FROM to TO. The source and destination donot overlap. */# ifndef YYCOPY# if defined __GNUC__ && 1 < __GNUC__# define YYCOPY(To, From, Count) \__builtin_memcpy (To, From, (Count) * sizeof (*(From)))# else# define YYCOPY(To, From, Count) \do \{ \YYSIZE_T yyi; \for (yyi = 0; yyi < (Count); yyi++) \(To)[yyi] = (From)[yyi]; \} \while (YYID (0))# endif# endif/* Relocate STACK from its old location to the new one. Thelocal variables YYSIZE and YYSTACKSIZE give the old and new number ofelements in the stack, and YYPTR gives the new location of thestack. Advance YYPTR to a properly aligned location for the nextstack. */# define YYSTACK_RELOCATE(Stack) \do \{ \YYSIZE_T yynewbytes; \YYCOPY (&yyptr->Stack, Stack, yysize); \Stack = &yyptr->Stack; \yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \yyptr += yynewbytes / sizeof (*yyptr); \} \while (YYID (0))#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 13/* YYLAST -- Last index in YYTABLE. */#define YYLAST 41/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 33/* YYNNTS -- Number of nonterminals. */#define YYNNTS 28/* YYNRULES -- Number of rules. */#define YYNRULES 57/* YYNRULES -- Number of states. */#define YYNSTATES 70/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 287#define YYTRANSLATE(YYX) \((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const yytype_uint8 yytranslate[] ={0, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 1, 2, 3, 4,5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15, 16, 17, 18, 19, 20, 21, 22, 23, 24,25, 26, 27, 28, 29, 30, 31, 32};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN inYYRHS. */static const yytype_uint8 yyprhs[] ={0, 0, 3, 5, 6, 9, 11, 13, 15, 18,23, 26, 27, 30, 32, 34, 36, 38, 40, 42,44, 46, 49, 50, 53, 55, 58, 60, 63, 67,69, 71, 74, 76, 79, 83, 85, 88, 90, 93,95, 97, 99, 101, 103, 105, 107, 109, 111, 114,115, 118, 120, 122, 124, 126, 128, 131};/* YYRHS -- A `-1'-separated list of the rules' RHS. */static const yytype_int8 yyrhs[] ={34, 0, -1, 35, -1, -1, 36, 35, -1, 37,-1, 39, -1, 38, -1, 3, 51, -1, 40, 41,58, 41, -1, 6, 30, -1, -1, 42, 41, -1,49, -1, 50, -1, 52, -1, 53, -1, 55, -1,46, -1, 45, -1, 43, -1, 5, 44, -1, -1,30, 44, -1, 4, -1, 4, 30, -1, 12, -1,12, 47, -1, 48, 28, 47, -1, 48, -1, 32,-1, 9, 30, -1, 7, -1, 7, 51, -1, 29,27, 29, -1, 29, -1, 10, 29, -1, 8, -1,8, 54, -1, 13, -1, 14, -1, 15, -1, 16,-1, 17, -1, 18, -1, 19, -1, 20, -1, 21,-1, 11, 56, -1, -1, 57, 56, -1, 23, -1,24, -1, 25, -1, 59, -1, 60, -1, 60, 59,-1, 31, -1};/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const yytype_uint8 yyrline[] ={0, 46, 46, 49, 50, 53, 54, 57, 60, 66,72, 80, 81, 84, 85, 86, 87, 88, 89, 90,91, 94, 97, 98, 106, 107, 113, 114, 117, 118,121, 134, 140, 141, 147, 152, 158, 164, 165, 171,172, 173, 174, 175, 176, 177, 178, 179, 182, 185,186, 202, 203, 204, 207, 210, 211, 214};#endif#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.First, the terminals, then, starting at YYNTOKENS, nonterminals. */static const char *const yytname[] ={"$end", "error", "$undefined", "DEFAULT_DEPTH", "SYMBOL", "TAGS","NAME", "DEPTH", "ORIENT", "PLACE", "CHANCE", "FLAGS", "MONS","ENCOMPASS", "NORTH", "EAST", "SOUTH", "WEST", "NORTHEAST", "SOUTHEAST","SOUTHWEST", "NORTHWEST", "BAD_CHARACTER", "NO_HMIRROR", "NO_VMIRROR","NO_ROTATE", "PANDEMONIC", "DASH", "COMMA", "INTEGER", "STRING","MAP_LINE", "MONSTER_NAME", "$accept", "file", "definitions","definition", "def", "defdepth", "level", "name", "metalines","metaline", "tags", "tagstrings", "symbol", "mons", "mnames", "mname","place", "depth", "depth_range", "chance", "orientation", "orient_name","flags", "flagnames", "flagname", "map_def", "map_lines", "map_line", 0};#endif# ifdef YYPRINT/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding totoken YYLEX-NUM. */static const yytype_uint16 yytoknum[] ={0, 256, 257, 258, 259, 260, 261, 262, 263, 264,265, 266, 267, 268, 269, 270, 271, 272, 273, 274,275, 276, 277, 278, 279, 280, 281, 282, 283, 284,285, 286, 287};# endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const yytype_uint8 yyr1[] ={0, 33, 34, 35, 35, 36, 36, 37, 38, 39,40, 41, 41, 42, 42, 42, 42, 42, 42, 42,42, 43, 44, 44, 45, 45, 46, 46, 47, 47,48, 49, 50, 50, 51, 51, 52, 53, 53, 54,54, 54, 54, 54, 54, 54, 54, 54, 55, 56,56, 57, 57, 57, 58, 59, 59, 60};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const yytype_uint8 yyr2[] ={0, 2, 1, 0, 2, 1, 1, 1, 2, 4,2, 0, 2, 1, 1, 1, 1, 1, 1, 1,1, 2, 0, 2, 1, 2, 1, 2, 3, 1,1, 2, 1, 2, 3, 1, 2, 1, 2, 1,1, 1, 1, 1, 1, 1, 1, 1, 2, 0,2, 1, 1, 1, 1, 1, 2, 1};/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in stateSTATE-NUM when YYTABLE doesn't specify something else to do. Zeromeans the default is an error. */static const yytype_uint8 yydefact[] ={3, 0, 0, 0, 2, 3, 5, 7, 6, 11,35, 8, 10, 1, 4, 24, 22, 32, 37, 0,0, 49, 26, 0, 11, 20, 19, 18, 13, 14,15, 16, 17, 0, 25, 22, 21, 33, 39, 40,41, 42, 43, 44, 45, 46, 47, 38, 31, 36,51, 52, 53, 48, 49, 30, 27, 29, 57, 11,54, 55, 12, 34, 23, 50, 0, 9, 56, 28};/* YYDEFGOTO[NTERM-NUM]. */static const yytype_int8 yydefgoto[] ={-1, 3, 4, 5, 6, 7, 8, 9, 23, 24,25, 36, 26, 27, 56, 57, 28, 29, 11, 30,31, 47, 32, 53, 54, 59, 60, 61};/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describingSTATE-NUM. */#define YYPACT_NINF -29static const yytype_int8 yypact[] ={16, -17, -10, 21, -29, 16, -29, -29, -29, 6,-1, -29, -29, -29, -29, -3, -2, -17, -12, 1,3, 0, 2, 5, 6, -29, -29, -29, -29, -29,-29, -29, -29, 4, -29, -2, -29, -29, -29, -29,-29, -29, -29, -29, -29, -29, -29, -29, -29, -29,-29, -29, -29, -29, 0, -29, -29, 9, -29, 6,-29, 5, -29, -29, -29, -29, 2, -29, -29, -29};/* YYPGOTO[NTERM-NUM]. */static const yytype_int8 yypgoto[] ={-29, -29, 24, -29, -29, -29, -29, -29, -24, -29,-29, -5, -29, -29, -28, -29, -29, -29, 22, -29,-29, -29, -29, -14, -29, -29, -20, -29};/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. Ifpositive, shift that token. If negative, reduce the rule whichnumber is the opposite. If zero, do what YYDEFACT says.If YYTABLE_NINF, syntax error. */#define YYTABLE_NINF -1static const yytype_uint8 yytable[] ={62, 38, 39, 40, 41, 42, 43, 44, 45, 46,15, 16, 10, 17, 18, 19, 20, 21, 22, 1,12, 13, 2, 50, 51, 52, 33, 34, 35, 14,64, 48, 49, 63, 55, 67, 58, 66, 69, 37,65, 68};static const yytype_uint8 yycheck[] ={24, 13, 14, 15, 16, 17, 18, 19, 20, 21,4, 5, 29, 7, 8, 9, 10, 11, 12, 3,30, 0, 6, 23, 24, 25, 27, 30, 30, 5,35, 30, 29, 29, 32, 59, 31, 28, 66, 17,54, 61};/* YYSTOS[STATE-NUM] -- The (internal number of the) accessingsymbol of state STATE-NUM. */static const yytype_uint8 yystos[] ={0, 3, 6, 34, 35, 36, 37, 38, 39, 40,29, 51, 30, 0, 35, 4, 5, 7, 8, 9,10, 11, 12, 41, 42, 43, 45, 46, 49, 50,52, 53, 55, 27, 30, 30, 44, 51, 13, 14,15, 16, 17, 18, 19, 20, 21, 54, 30, 29,23, 24, 25, 56, 57, 32, 47, 48, 31, 58,59, 60, 41, 29, 44, 56, 28, 41, 59, 47};#define yyerrok (yyerrstatus = 0)#define yyclearin (yychar = YYEMPTY)#define YYEMPTY (-2)#define YYEOF 0#define YYACCEPT goto yyacceptlab#define YYABORT goto yyabortlab#define YYERROR goto yyerrorlab/* Like YYERROR except do call yyerror. This remains here temporarilyto ease the transition to the new meaning of YYERROR, for GCC.Once GCC version 2 has supplanted version 1, this can go. */#define YYFAIL goto yyerrlab#define YYRECOVERING() (!!yyerrstatus)#define YYBACKUP(Token, Value) \do \if (yychar == YYEMPTY && yylen == 1) \{ \yychar = (Token); \yylval = (Value); \yytoken = YYTRANSLATE (yychar); \YYPOPSTACK (1); \goto yybackup; \} \else \{ \yyerror (YY_("syntax error: cannot back up")); \YYERROR; \} \while (YYID (0))#define YYTERROR 1#define YYERRCODE 256/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].If N is 0, then set CURRENT to the empty location which endsthe previous symbol: RHS[0] (always defined). */#define YYRHSLOC(Rhs, K) ((Rhs)[K])#ifndef YYLLOC_DEFAULT# define YYLLOC_DEFAULT(Current, Rhs, N) \do \if (YYID (N)) \{ \(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \(Current).last_line = YYRHSLOC (Rhs, N).last_line; \(Current).last_column = YYRHSLOC (Rhs, N).last_column; \} \else \{ \(Current).first_line = (Current).last_line = \YYRHSLOC (Rhs, 0).last_line; \(Current).first_column = (Current).last_column = \YYRHSLOC (Rhs, 0).last_column; \} \while (YYID (0))#endif/* YY_LOCATION_PRINT -- Print the location on the stream.This macro was not mandated originally: define only if we knowwe won't break user code: when these are the locations we know. */#ifndef YY_LOCATION_PRINT# if YYLTYPE_IS_TRIVIAL# define YY_LOCATION_PRINT(File, Loc) \fprintf (File, "%d.%d-%d.%d", \(Loc).first_line, (Loc).first_column, \(Loc).last_line, (Loc).last_column)# else# define YY_LOCATION_PRINT(File, Loc) ((void) 0)# endif#endif/* YYLEX -- calling `yylex' with the right arguments. */#ifdef YYLEX_PARAM# define YYLEX yylex (YYLEX_PARAM)#else# define YYLEX yylex ()#endif/* Enable debugging if requested. */#if YYDEBUG# ifndef YYFPRINTF# include <stdio.h> /* INFRINGES ON USER NAME SPACE */# define YYFPRINTF fprintf# endif# define YYDPRINTF(Args) \do { \if (yydebug) \YYFPRINTF Args; \} while (YYID (0))# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \do { \if (yydebug) \{ \YYFPRINTF (stderr, "%s ", Title); \yy_symbol_print (stderr, \Type, Value); \YYFPRINTF (stderr, "\n"); \} \} while (YYID (0))/*--------------------------------.| Print this symbol on YYOUTPUT. |`--------------------------------*//*ARGSUSED*/#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static voidyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)#elsestatic voidyy_symbol_value_print (yyoutput, yytype, yyvaluep)FILE *yyoutput;int yytype;YYSTYPE const * const yyvaluep;#endif{if (!yyvaluep)return;# ifdef YYPRINTif (yytype < YYNTOKENS)YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);# elseYYUSE (yyoutput);# endifswitch (yytype){default:break;}}/*--------------------------------.| Print this symbol on YYOUTPUT. |`--------------------------------*/#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static voidyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)#elsestatic voidyy_symbol_print (yyoutput, yytype, yyvaluep)FILE *yyoutput;int yytype;YYSTYPE const * const yyvaluep;#endif{if (yytype < YYNTOKENS)YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);elseYYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);yy_symbol_value_print (yyoutput, yytype, yyvaluep);YYFPRINTF (yyoutput, ")");}/*------------------------------------------------------------------.| yy_stack_print -- Print the state stack from its BOTTOM up to its || TOP (included). |`------------------------------------------------------------------*/#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static voidyy_stack_print (yytype_int16 *bottom, yytype_int16 *top)#elsestatic voidyy_stack_print (bottom, top)yytype_int16 *bottom;yytype_int16 *top;#endif{YYFPRINTF (stderr, "Stack now");for (; bottom <= top; ++bottom)YYFPRINTF (stderr, " %d", *bottom);YYFPRINTF (stderr, "\n");}# define YY_STACK_PRINT(Bottom, Top) \do { \if (yydebug) \yy_stack_print ((Bottom), (Top)); \} while (YYID (0))/*------------------------------------------------.| Report that the YYRULE is going to be reduced. |`------------------------------------------------*/#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static voidyy_reduce_print (YYSTYPE *yyvsp, int yyrule)#elsestatic voidyy_reduce_print (yyvsp, yyrule)YYSTYPE *yyvsp;int yyrule;#endif{int yynrhs = yyr2[yyrule];int yyi;unsigned long int yylno = yyrline[yyrule];YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",yyrule - 1, yylno);/* The symbols being reduced. */for (yyi = 0; yyi < yynrhs; yyi++){fprintf (stderr, " $%d = ", yyi + 1);yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],&(yyvsp[(yyi + 1) - (yynrhs)]));fprintf (stderr, "\n");}}# define YY_REDUCE_PRINT(Rule) \do { \if (yydebug) \yy_reduce_print (yyvsp, Rule); \} while (YYID (0))/* Nonzero means print parse trace. It is left uninitialized so thatmultiple parsers can coexist. */int yydebug;#else /* !YYDEBUG */# define YYDPRINTF(Args)# define YY_SYMBOL_PRINT(Title, Type, Value, Location)# define YY_STACK_PRINT(Bottom, Top)# define YY_REDUCE_PRINT(Rule)#endif /* !YYDEBUG *//* YYINITDEPTH -- initial size of the parser's stacks. */#ifndef YYINITDEPTH# define YYINITDEPTH 200#endif/* YYMAXDEPTH -- maximum size the stacks can grow to (effective onlyif the built-in stack extension method is used).Do not make this value too large; the results are undefined ifYYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)evaluated with infinite-precision integer arithmetic. */#ifndef YYMAXDEPTH# define YYMAXDEPTH 10000#endif#if YYERROR_VERBOSE# ifndef yystrlen# if defined __GLIBC__ && defined _STRING_H# define yystrlen strlen# else/* Return the length of YYSTR. */#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static YYSIZE_Tyystrlen (const char *yystr)#elsestatic YYSIZE_Tyystrlen (yystr)const char *yystr;#endif{YYSIZE_T yylen;for (yylen = 0; yystr[yylen]; yylen++)continue;return yylen;}# endif# endif# ifndef yystpcpy# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE# define yystpcpy stpcpy# else/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' inYYDEST. */#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static char *yystpcpy (char *yydest, const char *yysrc)#elsestatic char *yystpcpy (yydest, yysrc)char *yydest;const char *yysrc;#endif{char *yyd = yydest;const char *yys = yysrc;while ((*yyd++ = *yys++) != '\0')continue;return yyd - 1;}# endif# endif# ifndef yytnamerr/* Copy to YYRES the contents of YYSTR after stripping away unnecessaryquotes and backslashes, so that it's suitable for yyerror. Theheuristic is that double-quoting is unnecessary unless the stringcontains an apostrophe, a comma, or backslash (other thanbackslash-backslash). YYSTR is taken from yytname. If YYRES isnull, do not copy; instead, return the length of what the resultwould have been. */static YYSIZE_Tyytnamerr (char *yyres, const char *yystr){if (*yystr == '"'){YYSIZE_T yyn = 0;char const *yyp = yystr;for (;;)switch (*++yyp){case '\'':case ',':goto do_not_strip_quotes;case '\\':if (*++yyp != '\\')goto do_not_strip_quotes;/* Fall through. */default:if (yyres)yyres[yyn] = *yyp;yyn++;break;case '"':if (yyres)yyres[yyn] = '\0';return yyn;}do_not_strip_quotes: ;}if (! yyres)return yystrlen (yystr);return yystpcpy (yyres, yystr) - yyres;}# endif/* Copy into YYRESULT an error message about the unexpected tokenYYCHAR while in state YYSTATE. Return the number of bytes copied,including the terminating null byte. If YYRESULT is null, do notcopy anything; just return the number of bytes that would becopied. As a special case, return 0 if an ordinary "syntax error"message will do. Return YYSIZE_MAXIMUM if overflow occurs duringsize calculation. */static YYSIZE_Tyysyntax_error (char *yyresult, int yystate, int yychar){int yyn = yypact[yystate];if (! (YYPACT_NINF < yyn && yyn <= YYLAST))return 0;else{int yytype = YYTRANSLATE (yychar);YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);YYSIZE_T yysize = yysize0;YYSIZE_T yysize1;int yysize_overflow = 0;enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];int yyx;# if 0/* This is so xgettext sees the translatable formats that areconstructed on the fly. */YY_("syntax error, unexpected %s");YY_("syntax error, unexpected %s, expecting %s");YY_("syntax error, unexpected %s, expecting %s or %s");YY_("syntax error, unexpected %s, expecting %s or %s or %s");YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");# endifchar *yyfmt;char const *yyf;static char const yyunexpected[] = "syntax error, unexpected %s";static char const yyexpecting[] = ", expecting %s";static char const yyor[] = " or %s";char yyformat[sizeof yyunexpected+ sizeof yyexpecting - 1+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)* (sizeof yyor - 1))];char const *yyprefix = yyexpecting;/* Start YYX at -YYN if negative to avoid negative indexes inYYCHECK. */int yyxbegin = yyn < 0 ? -yyn : 0;/* Stay within bounds of both yycheck and yytname. */int yychecklim = YYLAST - yyn + 1;int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;int yycount = 1;yyarg[0] = yytname[yytype];yyfmt = yystpcpy (yyformat, yyunexpected);for (yyx = yyxbegin; yyx < yyxend; ++yyx)if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR){if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM){yycount = 1;yysize = yysize0;yyformat[sizeof yyunexpected - 1] = '\0';break;}yyarg[yycount++] = yytname[yyx];yysize1 = yysize + yytnamerr (0, yytname[yyx]);yysize_overflow |= (yysize1 < yysize);yysize = yysize1;yyfmt = yystpcpy (yyfmt, yyprefix);yyprefix = yyor;}yyf = YY_(yyformat);yysize1 = yysize + yystrlen (yyf);yysize_overflow |= (yysize1 < yysize);yysize = yysize1;if (yysize_overflow)return YYSIZE_MAXIMUM;if (yyresult){/* Avoid sprintf, as that infringes on the user's name space.Don't have undefined behavior even if the translationproduced a string with the wrong number of "%s"s. */char *yyp = yyresult;int yyi = 0;while ((*yyp = *yyf) != '\0'){if (*yyp == '%' && yyf[1] == 's' && yyi < yycount){yyp += yytnamerr (yyp, yyarg[yyi++]);yyf += 2;}else{yyp++;yyf++;}}}return yysize;}}#endif /* YYERROR_VERBOSE *//*-----------------------------------------------.| Release the memory associated to this symbol. |`-----------------------------------------------*//*ARGSUSED*/#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)static voidyydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)#elsestatic voidyydestruct (yymsg, yytype, yyvaluep)const char *yymsg;int yytype;YYSTYPE *yyvaluep;#endif{YYUSE (yyvaluep);if (!yymsg)yymsg = "Deleting";YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);switch (yytype){default:break;}}/* Prevent warnings from -Wmissing-prototypes. */#ifdef YYPARSE_PARAM#if defined __STDC__ || defined __cplusplusint yyparse (void *YYPARSE_PARAM);#elseint yyparse ();#endif#else /* ! YYPARSE_PARAM */#if defined __STDC__ || defined __cplusplusint yyparse (void);#elseint yyparse ();#endif#endif /* ! YYPARSE_PARAM *//* The look-ahead symbol. */int yychar;/* The semantic value of the look-ahead symbol. */YYSTYPE yylval;/* Number of syntax errors so far. */int yynerrs;/*----------.| yyparse. |`----------*/#ifdef YYPARSE_PARAM#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)intyyparse (void *YYPARSE_PARAM)#elseintyyparse (YYPARSE_PARAM)void *YYPARSE_PARAM;#endif#else /* ! YYPARSE_PARAM */#if (defined __STDC__ || defined __C99__FUNC__ \|| defined __cplusplus || defined _MSC_VER)intyyparse (void)#elseintyyparse ()#endif#endif{int yystate;int yyn;int yyresult;/* Number of tokens to shift before error messages enabled. */int yyerrstatus;/* Look-ahead token as an internal (translated) token number. */int yytoken = 0;#if YYERROR_VERBOSE/* Buffer for error messages, and its allocated size. */char yymsgbuf[128];char *yymsg = yymsgbuf;YYSIZE_T yymsg_alloc = sizeof yymsgbuf;#endif/* Three stacks and their tools:`yyss': related to states,`yyvs': related to semantic values,`yyls': related to locations.Refer to the stacks thru separate pointers, to allow yyoverflowto reallocate them elsewhere. *//* The state stack. */yytype_int16 yyssa[YYINITDEPTH];yytype_int16 *yyss = yyssa;yytype_int16 *yyssp;/* The semantic value stack. */YYSTYPE yyvsa[YYINITDEPTH];YYSTYPE *yyvs = yyvsa;YYSTYPE *yyvsp;#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))YYSIZE_T yystacksize = YYINITDEPTH;/* The variables used to return semantic value and location from theaction routines. */YYSTYPE yyval;/* The number of symbols on the RHS of the reduced rule.Keep to zero when no symbol should be popped. */int yylen = 0;YYDPRINTF ((stderr, "Starting parse\n"));yystate = 0;yyerrstatus = 0;yynerrs = 0;yychar = YYEMPTY; /* Cause a token to be read. *//* Initialize stack pointers.Waste one element of value and location stackso that they stay on the same level as the state stack.The wasted elements are never initialized. */yyssp = yyss;yyvsp = yyvs;goto yysetstate;/*------------------------------------------------------------.| yynewstate -- Push a new state, which is found in yystate. |`------------------------------------------------------------*/yynewstate:/* In all cases, when you get here, the value and location stackshave just been pushed. So pushing a state here evens the stacks. */yyssp++;yysetstate:*yyssp = yystate;if (yyss + yystacksize - 1 <= yyssp){/* Get the current used size of the three stacks, in elements. */YYSIZE_T yysize = yyssp - yyss + 1;#ifdef yyoverflow{/* Give user a chance to reallocate the stack. Use copies ofthese so that the &'s don't force the real ones intomemory. */YYSTYPE *yyvs1 = yyvs;yytype_int16 *yyss1 = yyss;/* Each stack pointer address is followed by the size of thedata in use in that stack, in bytes. This used to be aconditional around just the two extra args, but that mightbe undefined if yyoverflow is a macro. */yyoverflow (YY_("memory exhausted"),&yyss1, yysize * sizeof (*yyssp),&yyvs1, yysize * sizeof (*yyvsp),&yystacksize);yyss = yyss1;yyvs = yyvs1;}#else /* no yyoverflow */# ifndef YYSTACK_RELOCATEgoto yyexhaustedlab;# else/* Extend the stack our own way. */if (YYMAXDEPTH <= yystacksize)goto yyexhaustedlab;yystacksize *= 2;if (YYMAXDEPTH < yystacksize)yystacksize = YYMAXDEPTH;{yytype_int16 *yyss1 = yyss;union yyalloc *yyptr =(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));if (! yyptr)goto yyexhaustedlab;YYSTACK_RELOCATE (yyss);YYSTACK_RELOCATE (yyvs);# undef YYSTACK_RELOCATEif (yyss1 != yyssa)YYSTACK_FREE (yyss1);}# endif#endif /* no yyoverflow */yyssp = yyss + yysize - 1;yyvsp = yyvs + yysize - 1;YYDPRINTF ((stderr, "Stack size increased to %lu\n",(unsigned long int) yystacksize));if (yyss + yystacksize - 1 <= yyssp)YYABORT;}YYDPRINTF ((stderr, "Entering state %d\n", yystate));goto yybackup;/*-----------.| yybackup. |`-----------*/yybackup:/* Do appropriate processing given the current state. Read alook-ahead token if we need one and don't already have one. *//* First try to decide what to do without reference to look-ahead token. */yyn = yypact[yystate];if (yyn == YYPACT_NINF)goto yydefault;/* Not known => get a look-ahead token if don't already have one. *//* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */if (yychar == YYEMPTY){YYDPRINTF ((stderr, "Reading a token: "));yychar = YYLEX;}if (yychar <= YYEOF){yychar = yytoken = YYEOF;YYDPRINTF ((stderr, "Now at end of input.\n"));}else{yytoken = YYTRANSLATE (yychar);YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);}/* If the proper action on seeing token YYTOKEN is to reduce or todetect an error, take that action. */yyn += yytoken;if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)goto yydefault;yyn = yytable[yyn];if (yyn <= 0){if (yyn == 0 || yyn == YYTABLE_NINF)goto yyerrlab;yyn = -yyn;goto yyreduce;}if (yyn == YYFINAL)YYACCEPT;/* Count tokens shifted since error; after three, turn off errorstatus. */if (yyerrstatus)yyerrstatus--;/* Shift the look-ahead token. */YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);/* Discard the shifted token unless it is eof. */if (yychar != YYEOF)yychar = YYEMPTY;yystate = yyn;*++yyvsp = yylval;goto yynewstate;/*-----------------------------------------------------------.| yydefault -- do the default action for the current state. |`-----------------------------------------------------------*/yydefault:yyn = yydefact[yystate];if (yyn == 0)goto yyerrlab;goto yyreduce;/*-----------------------------.| yyreduce -- Do a reduction. |`-----------------------------*/yyreduce:/* yyn is the number of a rule to reduce with. */yylen = yyr2[yyn];/* If YYLEN is nonzero, implement the default value of the action:`$$ = $1'.Otherwise, the following line sets YYVAL to garbage.This behavior is undocumented and Bisonusers should not rely upon it. Assigning to YYVALunconditionally makes the parser a bit smaller, and it avoids aGCC warning that YYVAL may be used uninitialized. */yyval = yyvsp[1-yylen];YY_REDUCE_PRINT (yyn);switch (yyn){case 2:#line 46 "levcomp.ypp"{ }break;case 3:#line 49 "levcomp.ypp"{}break;case 4:#line 50 "levcomp.ypp"{}break;case 5:#line 53 "levcomp.ypp"{}break;case 6:#line 54 "levcomp.ypp"{}break;case 8:#line 61 "levcomp.ypp"{lc_default_depth = lc_range;}break;case 9:#line 67 "levcomp.ypp"{add_parsed_map( lc_map );}break;case 10:#line 73 "levcomp.ypp"{lc_map.init();lc_map.depth = lc_default_depth;lc_map.name = (yyvsp[(2) - (2)].text);}break;case 21:#line 94 "levcomp.ypp"{}break;case 23:#line 99 "levcomp.ypp"{lc_map.tags += " ";lc_map.tags += (yyvsp[(1) - (2)].text);lc_map.tags += " ";}break;case 24:#line 106 "levcomp.ypp"{}break;case 25:#line 108 "levcomp.ypp"{lc_map.random_symbols = (yyvsp[(2) - (2)].text);}break;case 26:#line 113 "levcomp.ypp"{}break;case 27:#line 114 "levcomp.ypp"{}break;case 30:#line 122 "levcomp.ypp"{bool recognised = lc_map.mons.add_mons((yyvsp[(1) - (1)].text));if (!recognised){char buf[300];snprintf(buf, sizeof buf, "unknown monster '%s'",(yyvsp[(1) - (1)].text));yyerror(buf);}}break;case 31:#line 135 "levcomp.ypp"{lc_map.place = (yyvsp[(2) - (2)].text);}break;case 32:#line 140 "levcomp.ypp"{}break;case 33:#line 142 "levcomp.ypp"{lc_map.depth = lc_range;}break;case 34:#line 148 "levcomp.ypp"{lc_range.set((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].i));}break;case 35:#line 153 "levcomp.ypp"{lc_range.set((yyvsp[(1) - (1)].i));}break;case 36:#line 159 "levcomp.ypp"{lc_map.chance = (yyvsp[(2) - (2)].i);}break;case 37:#line 164 "levcomp.ypp"{}break;case 38:#line 166 "levcomp.ypp"{lc_map.orient = (map_section_type) (yyvsp[(2) - (2)].i);}break;case 39:#line 171 "levcomp.ypp"{ (yyval.i) = MAP_ENCOMPASS; }break;case 40:#line 172 "levcomp.ypp"{ (yyval.i) = MAP_NORTH; }break;case 41:#line 173 "levcomp.ypp"{ (yyval.i) = MAP_EAST; }break;case 42:#line 174 "levcomp.ypp"{ (yyval.i) = MAP_SOUTH; }break;case 43:#line 175 "levcomp.ypp"{ (yyval.i) = MAP_WEST; }break;case 44:#line 176 "levcomp.ypp"{ (yyval.i) = MAP_NORTHEAST; }break;case 45:#line 177 "levcomp.ypp"{ (yyval.i) = MAP_SOUTHEAST; }break;case 46:#line 178 "levcomp.ypp"{ (yyval.i) = MAP_SOUTHWEST; }break;case 47:#line 179 "levcomp.ypp"{ (yyval.i) = MAP_NORTHWEST; }break;case 48:#line 182 "levcomp.ypp"{}break;case 50:#line 187 "levcomp.ypp"{switch ((yyvsp[(1) - (2)].i)) {case NO_HMIRROR:lc_map.flags &= ~MAPF_MIRROR_HORIZONTAL;break;case NO_VMIRROR:lc_map.flags &= ~MAPF_MIRROR_VERTICAL;break;case NO_ROTATE:lc_map.flags &= ~MAPF_ROTATE;break;}}break;case 51:#line 202 "levcomp.ypp"{ (yyval.i) = NO_HMIRROR; }break;case 52:#line 203 "levcomp.ypp"{ (yyval.i) = NO_VMIRROR; }break;case 53:#line 204 "levcomp.ypp"{ (yyval.i) = NO_ROTATE; }break;case 57:#line 215 "levcomp.ypp"{lc_map.map.add_line((yyvsp[(1) - (1)].text));}break;/* Line 1267 of yacc.c. */#line 1692 "levcomp.tab.c"default: break;}YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);YYPOPSTACK (yylen);yylen = 0;YY_STACK_PRINT (yyss, yyssp);*++yyvsp = yyval;/* Now `shift' the result of the reduction. Determine what statethat goes to, based on the state we popped back to and the rulenumber reduced by. */yyn = yyr1[yyn];yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)yystate = yytable[yystate];elseyystate = yydefgoto[yyn - YYNTOKENS];goto yynewstate;/*------------------------------------.| yyerrlab -- here on detecting error |`------------------------------------*/yyerrlab:/* If not already recovering from an error, report this error. */if (!yyerrstatus){++yynerrs;#if ! YYERROR_VERBOSEyyerror (YY_("syntax error"));#else{YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM){YYSIZE_T yyalloc = 2 * yysize;if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))yyalloc = YYSTACK_ALLOC_MAXIMUM;if (yymsg != yymsgbuf)YYSTACK_FREE (yymsg);yymsg = (char *) YYSTACK_ALLOC (yyalloc);if (yymsg)yymsg_alloc = yyalloc;else{yymsg = yymsgbuf;yymsg_alloc = sizeof yymsgbuf;}}if (0 < yysize && yysize <= yymsg_alloc){(void) yysyntax_error (yymsg, yystate, yychar);yyerror (yymsg);}else{yyerror (YY_("syntax error"));if (yysize != 0)goto yyexhaustedlab;}}#endif}if (yyerrstatus == 3){/* If just tried and failed to reuse look-ahead token after anerror, discard it. */if (yychar <= YYEOF){/* Return failure if at end of input. */if (yychar == YYEOF)YYABORT;}else{yydestruct ("Error: discarding",yytoken, &yylval);yychar = YYEMPTY;}}/* Else will try to reuse look-ahead token after shifting the errortoken. */goto yyerrlab1;/*---------------------------------------------------.| yyerrorlab -- error raised explicitly by YYERROR. |`---------------------------------------------------*/yyerrorlab:/* Pacify compilers like GCC when the user code never invokesYYERROR and the label yyerrorlab therefore never appears in usercode. */if (/*CONSTCOND*/ 0)goto yyerrorlab;/* Do not reclaim the symbols of the rule which action triggeredthis YYERROR. */YYPOPSTACK (yylen);yylen = 0;YY_STACK_PRINT (yyss, yyssp);yystate = *yyssp;goto yyerrlab1;/*-------------------------------------------------------------.| yyerrlab1 -- common code for both syntax error and YYERROR. |`-------------------------------------------------------------*/yyerrlab1:yyerrstatus = 3; /* Each real token shifted decrements this. */for (;;){yyn = yypact[yystate];if (yyn != YYPACT_NINF){yyn += YYTERROR;if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR){yyn = yytable[yyn];if (0 < yyn)break;}}/* Pop the current state because it cannot handle the error token. */if (yyssp == yyss)YYABORT;yydestruct ("Error: popping",yystos[yystate], yyvsp);YYPOPSTACK (1);yystate = *yyssp;YY_STACK_PRINT (yyss, yyssp);}if (yyn == YYFINAL)YYACCEPT;*++yyvsp = yylval;/* Shift the error token. */YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);yystate = yyn;goto yynewstate;/*-------------------------------------.| yyacceptlab -- YYACCEPT comes here. |`-------------------------------------*/yyacceptlab:yyresult = 0;goto yyreturn;/*-----------------------------------.| yyabortlab -- YYABORT comes here. |`-----------------------------------*/yyabortlab:yyresult = 1;goto yyreturn;#ifndef yyoverflow/*-------------------------------------------------.| yyexhaustedlab -- memory exhaustion comes here. |`-------------------------------------------------*/yyexhaustedlab:yyerror (YY_("memory exhausted"));yyresult = 2;/* Fall through. */#endifyyreturn:if (yychar != YYEOF && yychar != YYEMPTY)yydestruct ("Cleanup: discarding lookahead",yytoken, &yylval);/* Do not reclaim the symbols of the rule which action triggeredthis YYABORT or YYACCEPT. */YYPOPSTACK (yylen);YY_STACK_PRINT (yyss, yyssp);while (yyssp != yyss){yydestruct ("Cleanup: popping",yystos[*yyssp], yyvsp);YYPOPSTACK (1);}#ifndef yyoverflowif (yyss != yyssa)YYSTACK_FREE (yyss);#endif#if YYERROR_VERBOSEif (yymsg != yymsgbuf)YYSTACK_FREE (yymsg);#endif/* Make sure YYID is used. */return YYID (yyresult);}#line 220 "levcomp.ypp"
#line 2 "levcomp.lex.cc"/* A lexical scanner generated by flex *//* Scanner skeleton version:* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $*/#define FLEX_SCANNER#define YY_FLEX_MAJOR_VERSION 2#define YY_FLEX_MINOR_VERSION 5#include <stdio.h>#include <errno.h>/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */#ifdef c_plusplus#ifndef __cplusplus#define __cplusplus#endif#endif#ifdef __cplusplus#include <stdlib.h>#ifndef _WIN32#include <unistd.h>#endif/* Use prototypes in function declarations. */#define YY_USE_PROTOS/* The "const" storage-class-modifier is valid. */#define YY_USE_CONST#else /* ! __cplusplus */#if __STDC__#define YY_USE_PROTOS#define YY_USE_CONST#endif /* __STDC__ */#endif /* ! __cplusplus */#ifdef __TURBOC__#pragma warn -rch#pragma warn -use#include <io.h>#include <stdlib.h>#define YY_USE_CONST#define YY_USE_PROTOS#endif#ifdef YY_USE_CONST#define yyconst const#else#define yyconst#endif#ifdef YY_USE_PROTOS#define YY_PROTO(proto) proto#else#define YY_PROTO(proto) ()#endif/* Returned upon end-of-file. */#define YY_NULL 0/* Promotes a possibly negative, possibly signed char to an unsigned* integer for use as an array index. If the signed char is negative,* we want to instead treat it as an 8-bit unsigned char, hence the* double cast.*/#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)/* Enter a start condition. This macro really ought to take a parameter,* but we do it the disgusting crufty way forced on us by the ()-less* definition of BEGIN.*/#define BEGIN yy_start = 1 + 2 */* Translate the current start state into a value that can be later handed* to BEGIN to return to the state. The YYSTATE alias is for lex* compatibility.*/#define YY_START ((yy_start - 1) / 2)#define YYSTATE YY_START/* Action number for EOF rule of a given start state. */#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)/* Special action meaning "start processing a new file". */#define YY_NEW_FILE yyrestart( yyin )#define YY_END_OF_BUFFER_CHAR 0/* Size of default input buffer. */#define YY_BUF_SIZE 16384typedef struct yy_buffer_state *YY_BUFFER_STATE;extern int yyleng;extern FILE *yyin, *yyout;#define EOB_ACT_CONTINUE_SCAN 0#define EOB_ACT_END_OF_FILE 1#define EOB_ACT_LAST_MATCH 2/* The funky do-while in the following #define is used to turn the definition* int a single C statement (which needs a semi-colon terminator). This* avoids problems with code like:** if ( condition_holds )* yyless( 5 );* else* do_something_else();** Prior to using the do-while the compiler would get upset at the* "else" because it interpreted the "if" statement as being all* done when it reached the ';' after the yyless() call.*//* Return all but the first 'n' matched characters back to the input stream. */#define yyless(n) \do \{ \/* Undo effects of setting up yytext. */ \*yy_cp = yy_hold_char; \YY_RESTORE_YY_MORE_OFFSET \yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \YY_DO_BEFORE_ACTION; /* set up yytext again */ \} \while ( 0 )#define unput(c) yyunput( c, yytext_ptr )/* The following is because we cannot portably get our hands on size_t* (without autoconf's help, which isn't available because we want* flex-generated scanners to compile on their own).*/typedef unsigned int yy_size_t;struct yy_buffer_state{FILE *yy_input_file;char *yy_ch_buf; /* input buffer */char *yy_buf_pos; /* current position in input buffer *//* Size of input buffer in bytes, not including room for EOB* characters.*/yy_size_t yy_buf_size;/* Number of characters read into yy_ch_buf, not including EOB* characters.*/int yy_n_chars;/* Whether we "own" the buffer - i.e., we know we created it,* and can realloc() it to grow it, and should free() it to* delete it.*/int yy_is_our_buffer;/* Whether this is an "interactive" input source; if so, and* if we're using stdio for input, then we want to use getc()* instead of fread(), to make sure we stop fetching input after* each newline.*/int yy_is_interactive;/* Whether we're considered to be at the beginning of a line.* If so, '^' rules will be active on the next match, otherwise* not.*/int yy_at_bol;/* Whether to try to fill the input buffer when we reach the* end of it.*/int yy_fill_buffer;int yy_buffer_status;#define YY_BUFFER_NEW 0#define YY_BUFFER_NORMAL 1/* When an EOF's been seen but there's still some text to process* then we mark the buffer as YY_EOF_PENDING, to indicate that we* shouldn't try reading from the input source any more. We might* still have a bunch of tokens to match, though, because of* possible backing-up.** When we actually see the EOF, we change the status to "new"* (via yyrestart()), so that the user can continue scanning by* just pointing yyin at a new input file.*/#define YY_BUFFER_EOF_PENDING 2};static YY_BUFFER_STATE yy_current_buffer = 0;/* We provide macros for accessing buffer states in case in the* future we want to put the buffer states in a more general* "scanner state".*/#define YY_CURRENT_BUFFER yy_current_buffer/* yy_hold_char holds the character lost when yytext is formed. */static char yy_hold_char;static int yy_n_chars; /* number of characters read into yy_ch_buf */int yyleng;/* Points to current character in buffer. */static char *yy_c_buf_p = (char *) 0;static int yy_init = 1; /* whether we need to initialize */static int yy_start = 0; /* start state number *//* Flag which is used to allow yywrap()'s to do buffer switches* instead of setting up a fresh yyin. A bit of a hack ...*/static int yy_did_buffer_switch_on_eof;void yyrestart YY_PROTO(( FILE *input_file ));void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));void yy_load_buffer_state YY_PROTO(( void ));YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));static void *yy_flex_alloc YY_PROTO(( yy_size_t ));static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));static void yy_flex_free YY_PROTO(( void * ));#define yy_new_buffer yy_create_buffer#define yy_set_interactive(is_interactive) \{ \if ( ! yy_current_buffer ) \yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \yy_current_buffer->yy_is_interactive = is_interactive; \}#define yy_set_bol(at_bol) \{ \if ( ! yy_current_buffer ) \yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \yy_current_buffer->yy_at_bol = at_bol; \}#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)#define YY_USES_REJECTtypedef unsigned char YY_CHAR;FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;typedef int yy_state_type;extern int yylineno;int yylineno = 1;extern char *yytext;#define yytext_ptr yytextstatic yy_state_type yy_get_previous_state YY_PROTO(( void ));static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));static int yy_get_next_buffer YY_PROTO(( void ));static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));/* Done after the current pattern has been matched and before the* corresponding action - sets up yytext.*/#define YY_DO_BEFORE_ACTION \yytext_ptr = yy_bp; \yyleng = (int) (yy_cp - yy_bp); \yy_hold_char = *yy_cp; \*yy_cp = '\0'; \yy_c_buf_p = yy_cp;#define YY_NUM_RULES 43#define YY_END_OF_BUFFER 44static yyconst short int yy_acclist[944] ={ 0,3, 3, 44, 42, 43, 41, 42, 43, 41, 43,37, 42, 43, 36, 42, 43, 38, 42, 43, 42,43, 42, 43, 42, 43, 42, 43, 42, 43, 42,43, 42, 43, 42, 43, 42, 43, 42, 43, 42,43, 42, 43, 42, 43, 42, 43, 42, 43, 5,42, 43, 42, 43, 42, 43, 3, 42, 43, 3,36, 42, 43, 3, 38, 42, 43, 3, 42, 43,3, 42, 43, 3, 42, 43, 3, 42, 43, 3,42, 43, 3, 42, 43, 3, 42, 43, 3, 42,43, 3, 42, 43, 3, 42, 43, 3, 42, 43,3, 42, 43, 3, 42, 43, 3, 42, 43, 3,42, 43, 3, 42, 43, 3, 5, 42, 43, 3,42, 43, 3, 42, 43, 42, 43, 40, 41, 43,41, 42, 43, 37, 42, 43, 36, 42, 43, 38,42, 43, 42, 43, 42, 43, 42, 43, 42, 43,42, 43, 42, 43, 42, 43, 42, 43, 42, 43,42, 43, 42, 43, 42, 43, 42, 43, 42, 43,42, 43, 5, 42, 43, 42, 43, 42, 43, 42,43, 22, 41, 42, 43, 21, 41, 43, 41, 42,43, 20, 37, 42, 43, 36, 42, 43, 38, 42,43, 42, 43, 42, 43, 42, 43, 42, 43, 42,43, 42, 43, 42, 43, 42, 43, 42, 43, 42,43, 42, 43, 42, 43, 42, 43, 42, 43, 42,43, 5, 42, 43, 42, 43, 42, 43, 17, 41,42, 43, 18, 41, 43, 41, 42, 43, 16, 36,42, 43, 16, 38, 42, 43, 16, 42, 43, 16,42, 43, 16, 42, 43, 16, 42, 43, 16, 42,43, 16, 42, 43, 16, 42, 43, 16, 42, 43,16, 42, 43, 16, 42, 43, 16, 42, 43, 16,42, 43, 16, 42, 43, 16, 42, 43, 16, 42,43, 16, 42, 43, 16, 42, 43, 16, 42, 43,41, 38, 5, 5, 3, 3, 38, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 5, 2, 5, 3, 5, 3,3, 5, 3, 39, 40, 41, 38, 39, 39, 39,39, 39, 39, 39, 39, 39, 39, 39, 39, 39,39, 39, 39, 39, 5, 39, 5, 39, 5, 39,39, 41, 21, 41, 41, 38, 5, 5, 17, 41,18, 41, 41, 16, 16, 38, 16, 16, 16, 16,16, 16, 16, 16, 16, 16, 16, 16, 16, 16,16, 16, 16, 16, 4, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 4, 3, 5, 39, 39, 39,39, 39, 39, 39, 39, 39, 39, 39, 39, 39,39, 39, 39, 39, 4, 39, 19, 19, 38, 19,19, 19, 19, 19, 19, 19, 19, 19, 19, 19,19, 19, 19, 19, 19, 19, 5, 19, 4, 19,5, 19, 19, 16, 16, 16, 16, 16, 16, 16,16, 16, 16, 16, 16, 16, 16, 16, 16, 16,4, 16, 30, 31, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 30, 3, 3, 3,3, 3, 3, 3, 3, 31, 39, 39, 39, 39,39, 39, 39, 39, 39, 39, 30, 39, 39, 39,39, 39, 39, 39, 39, 31, 39, 19, 19, 19,19, 19, 19, 19, 19, 19, 19, 19, 30, 19,19, 19, 19, 19, 19, 19, 19, 31, 16, 16,16, 16, 16, 16, 16, 16, 16, 16, 16, 30,16, 16, 16, 16, 16, 16, 16, 16, 31, 15,6, 13, 28, 29, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 28, 3, 3,29, 39, 39, 39, 15, 39, 6, 39, 39, 39,39, 13, 39, 39, 39, 39, 39, 39, 28, 39,39, 29, 39, 19, 19, 19, 15, 19, 6, 19,19, 19, 19, 13, 19, 19, 19, 19, 19, 19,19, 28, 19, 19, 29, 16, 16, 16, 16, 16,16, 16, 16, 16, 16, 16, 16, 28, 16, 16,29, 8, 12, 10, 3, 1, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 39,8, 39, 12, 39, 39, 10, 39, 39, 39, 39,39, 39, 39, 39, 39, 39, 39, 39, 19, 8,19, 12, 19, 19, 10, 19, 19, 19, 19, 19,19, 19, 19, 19, 19, 19, 19, 16, 16, 16,16, 16, 16, 16, 16, 16, 16, 16, 16, 16,11, 9, 14, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 11, 39, 9, 39, 14, 39, 39,39, 39, 39, 39, 39, 39, 39, 39, 39, 11,19, 9, 19, 14, 19, 19, 19, 19, 19, 19,19, 19, 19, 19, 19, 16, 16, 16, 16, 16,16, 16, 16, 16, 16, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 39, 39, 39, 39, 39,39, 39, 39, 39, 39, 19, 19, 19, 19, 19,19, 19, 19, 19, 19, 16, 16, 16, 16, 16,16, 16, 16, 16, 16, 27, 26, 32, 33, 34,35, 3, 3, 27, 3, 3, 26, 3, 3, 32,3, 33, 3, 3, 34, 3, 35, 39, 27, 39,39, 26, 39, 39, 32, 39, 33, 39, 39, 34,39, 35, 39, 19, 19, 27, 19, 19, 26, 19,19, 32, 19, 33, 19, 19, 34, 19, 35, 16,16, 27, 16, 16, 26, 16, 16, 32, 16, 33,16, 16, 34, 16, 35, 24, 25, 23, 3, 3,24, 3, 25, 3, 23, 39, 24, 39, 25, 39,23, 39, 19, 19, 24, 19, 25, 19, 23, 16,16, 24, 16, 25, 16, 23, 3, 39, 19, 16,3, 39, 19, 16, 3, 39, 19, 16, 7, 7,39, 7, 19} ;static yyconst short int yy_accept[798] ={ 0,1, 1, 1, 2, 3, 3, 3, 3, 3, 3,3, 4, 6, 9, 11, 14, 17, 20, 22, 24,26, 28, 30, 32, 34, 36, 38, 40, 42, 44,46, 48, 50, 53, 55, 57, 60, 64, 68, 71,74, 77, 80, 83, 86, 89, 92, 95, 98, 101,104, 107, 110, 113, 116, 120, 123, 126, 128, 131,134, 137, 140, 143, 145, 147, 149, 151, 153, 155,157, 159, 161, 163, 165, 167, 169, 171, 173, 176,178, 180, 182, 186, 189, 192, 196, 199, 202, 204,206, 208, 210, 212, 214, 216, 218, 220, 222, 224,226, 228, 230, 232, 235, 237, 239, 243, 246, 249,253, 257, 260, 263, 266, 269, 272, 275, 278, 281,284, 287, 290, 293, 296, 299, 302, 305, 308, 311,312, 313, 313, 313, 313, 313, 313, 313, 313, 313,313, 313, 313, 313, 313, 313, 313, 313, 314, 314,315, 315, 316, 318, 319, 320, 321, 322, 323, 324,325, 326, 327, 328, 329, 330, 331, 332, 333, 334,335, 336, 337, 338, 340, 341, 343, 344, 345, 345,347, 349, 350, 351, 352, 353, 354, 355, 356, 357,358, 359, 360, 361, 362, 363, 364, 365, 367, 368,369, 371, 372, 372, 373, 375, 376, 377, 377, 377,377, 377, 377, 377, 377, 377, 377, 377, 377, 377,377, 377, 377, 377, 378, 378, 379, 379, 381, 383,384, 385, 387, 388, 389, 390, 391, 392, 393, 394,395, 396, 397, 398, 399, 400, 401, 402, 403, 404,405, 405, 405, 405, 405, 405, 405, 405, 405, 405,405, 405, 405, 405, 405, 405, 405, 405, 406, 407,408, 409, 410, 411, 412, 413, 414, 415, 416, 417,418, 419, 420, 421, 422, 423, 424, 426, 428, 429,430, 431, 432, 433, 434, 435, 436, 437, 438, 439,440, 441, 442, 443, 444, 445, 447, 448, 450, 451,452, 453, 454, 455, 456, 457, 458, 459, 460, 461,462, 463, 464, 465, 466, 467, 469, 471, 473, 474,475, 476, 477, 478, 479, 480, 481, 482, 483, 484,485, 486, 487, 488, 489, 490, 491, 493, 493, 493,493, 493, 493, 493, 493, 493, 493, 493, 494, 494,494, 494, 494, 494, 494, 494, 495, 496, 497, 498,499, 500, 501, 502, 503, 504, 505, 506, 508, 509,510, 511, 512, 513, 514, 515, 517, 518, 519, 520,521, 522, 523, 524, 525, 526, 527, 529, 530, 531,532, 533, 534, 535, 536, 538, 539, 540, 541, 542,543, 544, 545, 546, 547, 548, 550, 551, 552, 553,554, 555, 556, 557, 559, 560, 561, 562, 563, 564,565, 566, 567, 568, 569, 571, 572, 573, 574, 575,576, 577, 578, 580, 580, 580, 580, 581, 582, 582,582, 582, 583, 583, 583, 583, 583, 583, 584, 584,585, 586, 587, 588, 589, 590, 591, 592, 593, 594,595, 596, 597, 599, 600, 602, 603, 604, 605, 607,609, 610, 611, 612, 614, 615, 616, 617, 618, 619,621, 622, 624, 625, 626, 627, 629, 631, 632, 633,634, 636, 637, 638, 639, 640, 641, 643, 644, 646,647, 648, 649, 650, 651, 652, 653, 654, 655, 656,657, 659, 660, 662, 662, 663, 664, 664, 665, 665,665, 665, 665, 665, 665, 665, 665, 665, 665, 665,666, 668, 669, 670, 671, 672, 673, 674, 675, 676,677, 678, 679, 680, 681, 683, 685, 686, 688, 689,690, 691, 692, 693, 694, 695, 696, 697, 698, 699,700, 702, 704, 705, 707, 708, 709, 710, 711, 712,713, 714, 715, 716, 717, 718, 719, 720, 721, 722,723, 724, 725, 726, 727, 728, 729, 730, 731, 732,733, 734, 734, 734, 734, 734, 734, 734, 734, 734,734, 734, 735, 736, 737, 738, 739, 740, 741, 742,743, 744, 746, 748, 750, 751, 752, 753, 754, 755,756, 757, 758, 759, 760, 762, 764, 766, 767, 768,769, 770, 771, 772, 773, 774, 775, 776, 777, 778,779, 780, 781, 782, 783, 784, 785, 786, 786, 786,786, 786, 786, 786, 786, 786, 786, 786, 787, 788,789, 790, 791, 792, 793, 794, 795, 796, 797, 798,799, 800, 801, 802, 803, 804, 805, 806, 807, 808,809, 810, 811, 812, 813, 814, 815, 816, 817, 818,819, 820, 821, 822, 823, 824, 825, 826, 826, 827,827, 828, 828, 829, 830, 830, 831, 832, 833, 835,836, 838, 839, 841, 843, 844, 846, 848, 849, 851,852, 854, 855, 857, 859, 860, 862, 864, 865, 867,868, 870, 871, 873, 875, 876, 878, 880, 881, 883,884, 886, 887, 889, 891, 892, 894, 896, 896, 897,898, 899, 900, 902, 904, 906, 907, 909, 911, 913,914, 916, 918, 920, 921, 923, 925, 927, 927, 928,929, 930, 931, 931, 932, 933, 934, 935, 935, 936,937, 938, 939, 940, 942, 944, 944} ;static yyconst int yy_ec[256] ={ 0,1, 1, 1, 1, 1, 1, 1, 1, 2, 3,1, 1, 4, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 2, 1, 1, 5, 6, 6, 6, 1, 6,6, 6, 6, 7, 8, 6, 1, 9, 9, 9,9, 9, 9, 9, 9, 9, 9, 10, 1, 6,6, 6, 6, 6, 11, 12, 13, 14, 15, 16,17, 18, 19, 20, 20, 21, 22, 23, 24, 25,20, 26, 27, 28, 20, 20, 20, 20, 29, 20,6, 1, 6, 6, 30, 1, 31, 20, 32, 33,34, 35, 20, 36, 37, 20, 20, 38, 39, 40,41, 42, 20, 43, 44, 45, 46, 47, 48, 20,20, 20, 6, 6, 6, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1} ;static yyconst int yy_meta[49] ={ 0,1, 1, 2, 3, 4, 4, 3, 5, 5, 1,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5} ;static yyconst short int yy_base[809] ={ 0,0, 44, 88, 132, 176, 220, 264, 308, 352, 396,1529, 1530, 48, 51, 1530, 1530, 1519, 1509, 1511, 1504,1500, 1512, 1496, 1500, 1491, 1508, 1484, 25, 1476, 1485,1474, 1480, 0, 46, 397, 0, 0, 1504, 1494, 1496,1487, 1488, 1484, 1496, 1480, 1484, 1475, 1492, 1468, 27,1460, 1469, 1458, 1464, 70, 51, 398, 57, 79, 82,74, 136, 137, 140, 141, 145, 146, 149, 224, 153,225, 157, 228, 403, 404, 229, 407, 312, 160, 232,408, 0, 169, 235, 242, 1530, 0, 1488, 1478, 1480,1473, 1469, 1481, 1465, 1469, 1460, 1477, 1453, 29, 1445,1454, 1443, 1449, 244, 141, 409, 255, 315, 318, 0,1473, 0, 1463, 1465, 1458, 1454, 1466, 1450, 1454, 1445,1462, 1438, 209, 1430, 1439, 1428, 1434, 304, 410, 321,1458, 1455, 1440, 1453, 1440, 1440, 1442, 1449, 1437, 1441,1422, 1412, 1423, 296, 1414, 1407, 1408, 0, 1426, 0,411, 0, 1441, 1438, 1423, 1433, 1435, 1422, 1422, 1424,1431, 1419, 1423, 1404, 1394, 1405, 297, 1396, 1389, 1390,60, 1530, 249, 331, 1408, 341, 412, 165, 259, 417,327, 420, 421, 424, 455, 425, 456, 459, 460, 463,464, 428, 469, 472, 477, 481, 482, 345, 485, 486,489, 490, 1430, 494, 501, 504, 335, 498, 508, 510,512, 233, 511, 514, 516, 520, 402, 475, 518, 521,522, 526, 527, 537, 529, 538, 541, 545, 553, 556,0, 1422, 1419, 1404, 1417, 1404, 1404, 1406, 1413, 1401,1405, 1386, 1376, 1387, 522, 1378, 1371, 1372, 1390, 531,1391, 1385, 1395, 1384, 1395, 1394, 1395, 1395, 1379, 1374,1359, 1362, 527, 1357, 1368, 1355, 1354, 1530, 1375, 1369,1374, 1378, 1367, 1378, 1377, 1378, 1378, 1362, 1357, 1342,1345, 530, 1340, 1351, 1338, 1337, 0, 577, 565, 578,587, 588, 592, 593, 596, 599, 608, 612, 615, 616,619, 620, 623, 624, 627, 628, 1379, 559, 530, 574,631, 442, 584, 632, 66, 581, 611, 637, 634, 603,635, 638, 640, 639, 643, 647, 1378, 657, 648, 1356,1350, 1360, 1349, 1360, 1359, 1360, 1360, 1344, 1339, 1324,1327, 627, 1322, 1333, 1320, 1319, 0, 1350, 1344, 1334,1350, 1349, 1335, 1342, 1332, 1345, 1308, 1530, 1314, 1313,1310, 1311, 1313, 1314, 1311, 1530, 1333, 1327, 1333, 1316,1332, 1331, 1317, 1324, 1314, 1327, 1290, 0, 1296, 1295,1292, 1293, 1295, 1296, 1293, 0, 673, 683, 687, 692,693, 696, 702, 703, 706, 707, 711, 716, 719, 720,724, 728, 731, 732, 727, 735, 723, 740, 736, 737,644, 678, 688, 741, 738, 1326, 742, 743, 747, 748,750, 755, 754, 1325, 1313, 1307, 1297, 1313, 1312, 1298,1305, 1295, 1308, 1271, 0, 1277, 1276, 1273, 1274, 1276,1277, 1274, 0, 1294, 1298, 1297, 1530, 1530, 1278, 1295,1283, 1530, 1265, 1260, 1264, 1255, 1262, 725, 1259, 726,1282, 1286, 1270, 1284, 1265, 1282, 1270, 1252, 1247, 1251,1242, 1249, 728, 1246, 732, 768, 767, 789, 790, 793,794, 798, 799, 802, 803, 807, 808, 811, 814, 819,815, 823, 822, 824, 826, 1282, 1281, 812, 828, 827,1280, 830, 831, 829, 833, 837, 841, 840, 842, 1266,1270, 1269, 1250, 1267, 1255, 1237, 1232, 1236, 1227, 1234,812, 1231, 813, 1259, 1530, 1530, 1258, 1530, 1257, 1221,1234, 1221, 1232, 1219, 1230, 1226, 1218, 1227, 1223, 1246,0, 1245, 1244, 1208, 1221, 1208, 1219, 1206, 1217, 1213,1205, 1214, 1210, 848, 860, 861, 878, 868, 881, 882,890, 891, 894, 895, 898, 899, 902, 905, 906, 867,1241, 1240, 903, 1239, 909, 879, 650, 656, 885, 910,913, 912, 915, 916, 918, 1230, 1229, 1228, 1192, 1205,1192, 1203, 1190, 1201, 1197, 1189, 1198, 1194, 1530, 1530,1530, 1219, 1182, 1182, 1179, 1180, 1178, 1177, 1180, 1175,1174, 1209, 1172, 1172, 1169, 1170, 1168, 1167, 1170, 1165,1164, 924, 928, 933, 937, 946, 953, 947, 956, 957,960, 963, 964, 967, 1205, 1204, 1203, 239, 929, 920,940, 952, 968, 970, 973, 972, 974, 1196, 1159, 1159,1156, 1157, 1155, 1154, 1157, 1152, 1151, 1161, 1149, 1151,1157, 1149, 1144, 1143, 1150, 1141, 1140, 1151, 1139, 1141,1144, 1133, 1128, 1123, 1121, 1109, 1108, 976, 975, 979,987, 982, 996, 1003, 1013, 1020, 1023, 752, 985, 991,992, 995, 986, 1000, 1026, 1004, 1008, 1115, 1099, 1090,1094, 1086, 1080, 1079, 1086, 1077, 1076, 1086, 1530, 1076,1530, 1075, 1530, 1530, 1085, 1530, 1530, 1082, 0, 1072,0, 1071, 0, 0, 1081, 0, 0, 1033, 1036, 1040,1050, 1053, 1054, 1057, 1058, 1062, 1067, 1041, 1110, 1031,1109, 1037, 1107, 1106, 1044, 1105, 1104, 1071, 0, 1061,0, 1060, 0, 0, 1070, 0, 0, 1057, 1530, 1530,1530, 1036, 0, 0, 0, 1068, 1075, 1080, 1083, 1049,1032, 980, 921, 817, 0, 0, 0, 810, 734, 1084,1028, 733, 739, 640, 1090, 1045, 400, 423, 340, 1091,1087, 165, 1530, 1096, 161, 1530, 1129, 1131, 1136, 1141,1146, 1151, 1156, 82, 1161, 1166, 1171, 1176} ;static yyconst short int yy_def[809] ={ 0,796, 1, 796, 3, 796, 5, 796, 7, 796, 9,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 797, 796, 796, 798, 798, 798, 798, 798,798, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 798, 798, 798, 799, 798, 798, 800, 796, 796,800, 800, 800, 800, 800, 800, 800, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 800, 801, 800,800, 802, 796, 796, 796, 796, 802, 802, 802, 802,802, 802, 802, 802, 802, 802, 802, 802, 802, 802,802, 802, 802, 803, 802, 802, 796, 796, 796, 804,804, 804, 804, 804, 804, 804, 804, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 804, 804, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 797, 796, 797,796, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 798, 798, 798, 798, 798, 798, 798, 798, 798,805, 796, 805, 799, 798, 806, 798, 800, 800, 796,800, 800, 800, 800, 800, 800, 800, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 801, 801, 800,801, 800, 807, 796, 796, 796, 807, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 807, 807, 807,807, 807, 807, 808, 807, 808, 807, 796, 796, 796,804, 804, 804, 804, 804, 804, 804, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 804, 804, 804,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 798, 798,798, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 798, 798, 798, 798, 798, 798, 806, 800, 800,800, 800, 800, 800, 800, 800, 800, 800, 800, 800,800, 800, 800, 800, 800, 800, 807, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 807, 807, 807,807, 807, 807, 807, 807, 808, 807, 808, 807, 804,804, 804, 804, 804, 804, 804, 804, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 798, 798, 798, 798,798, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 798, 798, 798, 798, 798, 800, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 800, 800, 800,800, 800, 800, 800, 800, 807, 807, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 807, 807, 807,807, 807, 807, 807, 804, 804, 804, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 804, 804, 804,804, 804, 804, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,798, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 798, 798, 798, 798, 800, 800, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 800, 800, 800,800, 800, 807, 807, 807, 807, 807, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 807, 807, 804,804, 804, 804, 804, 804, 804, 804, 804, 804, 804,804, 804, 804, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 798,798, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 798, 798, 800, 800, 800, 800, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 800, 800, 807,807, 807, 807, 807, 807, 807, 807, 807, 807, 807,807, 807, 807, 807, 807, 804, 804, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 804, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 798, 798, 798, 798, 798, 798, 798, 798, 798,798, 800, 800, 800, 800, 800, 800, 800, 800, 800,800, 800, 800, 800, 807, 807, 807, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 798, 798, 798,798, 798, 798, 798, 798, 798, 798, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 798, 798, 798,798, 798, 798, 798, 798, 798, 798, 800, 800, 800,800, 800, 800, 800, 800, 800, 800, 807, 807, 807,807, 807, 807, 807, 807, 807, 807, 804, 804, 804,804, 804, 804, 804, 804, 804, 804, 796, 796, 796,796, 798, 798, 798, 798, 800, 800, 800, 800, 807,807, 807, 807, 804, 804, 804, 804, 796, 798, 800,807, 804, 796, 798, 800, 807, 804, 796, 798, 800,807, 804, 796, 800, 807, 0, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796} ;static yyconst short int yy_nxt[1579] ={ 0,12, 13, 14, 13, 12, 12, 15, 16, 17, 12,12, 12, 18, 19, 12, 20, 12, 12, 12, 12,12, 21, 22, 23, 24, 12, 25, 26, 12, 12,12, 12, 27, 28, 12, 12, 12, 12, 12, 29,12, 30, 12, 31, 12, 12, 12, 32, 33, 130,130, 130, 130, 130, 130, 142, 149, 165, 179, 218,179, 175, 172, 173, 143, 34, 166, 203, 219, 135,171, 171, 172, 173, 158, 179, 171, 179, 412, 171,130, 130, 130, 130, 180, 130, 231, 35, 12, 13,14, 13, 36, 36, 15, 37, 38, 12, 36, 36,39, 40, 41, 42, 36, 36, 36, 36, 36, 43,44, 45, 46, 36, 47, 48, 36, 36, 36, 36,49, 50, 36, 36, 36, 36, 36, 51, 36, 52,36, 53, 36, 36, 36, 54, 55, 179, 179, 179,179, 179, 179, 179, 179, 181, 179, 179, 179, 179,179, 225, 179, 56, 179, 183, 179, 182, 179, 186,179, 199, 203, 199, 211, 184, 179, 190, 179, 185,204, 205, 206, 188, 793, 57, 58, 13, 59, 60,58, 58, 61, 62, 63, 58, 58, 58, 64, 65,58, 66, 58, 58, 58, 58, 58, 67, 68, 69,70, 58, 71, 72, 58, 58, 58, 58, 73, 74,58, 58, 58, 58, 58, 75, 58, 76, 58, 77,58, 58, 58, 78, 79, 179, 179, 179, 179, 179,179, 179, 179, 179, 203, 179, 130, 130, 130, 243,203, 80, 200, 130, 205, 130, 688, 148, 244, 187,148, 172, 173, 189, 313, 185, 228, 229, 230, 195,179, 191, 179, 81, 82, 83, 84, 85, 82, 82,86, 87, 88, 82, 82, 82, 89, 90, 82, 91,82, 82, 82, 82, 82, 92, 93, 94, 95, 82,96, 97, 82, 82, 82, 82, 98, 99, 82, 82,82, 82, 82, 100, 82, 101, 82, 102, 82, 82,82, 103, 104, 179, 249, 179, 130, 130, 130, 130,229, 130, 130, 130, 130, 263, 282, 236, 179, 105,179, 171, 171, 172, 173, 181, 203, 171, 264, 283,171, 148, 148, 308, 148, 197, 199, 148, 199, 793,148, 106, 12, 107, 108, 109, 12, 12, 15, 110,111, 12, 112, 112, 113, 114, 112, 115, 112, 112,112, 112, 112, 116, 117, 118, 119, 112, 120, 121,112, 112, 112, 112, 122, 123, 112, 112, 112, 112,112, 124, 112, 125, 112, 126, 112, 112, 112, 127,33, 150, 176, 203, 179, 179, 179, 179, 179, 179,179, 179, 201, 226, 150, 150, 176, 128, 130, 130,130, 179, 179, 179, 179, 179, 179, 179, 179, 179,289, 179, 793, 192, 291, 792, 318, 146, 169, 129,151, 177, 193, 203, 194, 290, 293, 196, 196, 222,247, 202, 227, 250, 151, 177, 179, 179, 179, 179,179, 179, 179, 179, 179, 179, 179, 179, 409, 295,179, 299, 179, 179, 294, 179, 203, 292, 179, 297,179, 296, 179, 179, 179, 179, 199, 179, 199, 179,199, 179, 199, 179, 201, 204, 205, 206, 298, 203,300, 301, 130, 130, 130, 130, 205, 130, 309, 203,306, 203, 203, 203, 302, 203, 303, 203, 319, 203,311, 203, 203, 203, 315, 305, 304, 203, 203, 314,203, 203, 310, 202, 312, 150, 317, 316, 224, 224,148, 148, 203, 148, 148, 328, 228, 229, 230, 320,321, 342, 406, 327, 130, 130, 130, 130, 229, 130,203, 323, 360, 322, 343, 380, 179, 308, 179, 361,325, 324, 381, 362, 250, 203, 382, 148, 148, 179,148, 179, 203, 148, 329, 203, 148, 387, 179, 179,179, 179, 413, 179, 179, 179, 179, 179, 410, 179,179, 407, 179, 389, 203, 388, 391, 392, 393, 179,394, 179, 203, 179, 390, 179, 179, 179, 179, 179,179, 179, 179, 179, 179, 179, 179, 179, 179, 179,179, 179, 203, 203, 395, 203, 203, 414, 203, 203,203, 203, 396, 417, 203, 203, 411, 408, 224, 203,148, 203, 328, 148, 399, 403, 398, 203, 224, 397,148, 400, 437, 148, 402, 401, 498, 415, 404, 438,418, 405, 422, 439, 179, 789, 179, 419, 416, 203,639, 420, 421, 423, 179, 476, 179, 424, 179, 203,179, 329, 499, 179, 179, 179, 179, 179, 640, 179,477, 479, 480, 179, 179, 179, 179, 179, 179, 179,179, 500, 179, 478, 179, 484, 482, 179, 481, 179,179, 179, 179, 179, 203, 179, 483, 179, 179, 179,179, 179, 179, 179, 179, 179, 203, 203, 203, 203,494, 203, 203, 203, 203, 496, 497, 493, 203, 203,501, 203, 485, 203, 486, 203, 203, 487, 535, 538,488, 549, 489, 490, 491, 552, 495, 492, 179, 179,179, 179, 536, 539, 788, 550, 555, 787, 784, 553,503, 504, 554, 502, 738, 507, 506, 505, 508, 509,179, 179, 179, 179, 179, 179, 179, 179, 556, 179,179, 179, 179, 179, 179, 179, 179, 558, 179, 179,179, 179, 179, 203, 179, 179, 179, 179, 179, 559,179, 557, 179, 203, 179, 203, 179, 203, 203, 203,203, 203, 203, 571, 203, 572, 570, 574, 203, 573,560, 203, 203, 203, 562, 594, 597, 575, 561, 179,564, 179, 565, 567, 783, 563, 568, 622, 782, 595,598, 179, 179, 179, 179, 578, 566, 576, 203, 179,569, 179, 577, 580, 581, 584, 635, 579, 583, 179,203, 179, 179, 179, 179, 179, 203, 623, 582, 585,624, 179, 179, 179, 179, 179, 179, 179, 179, 179,179, 179, 179, 179, 203, 179, 179, 179, 179, 179,203, 203, 636, 203, 203, 641, 203, 203, 637, 203,626, 203, 203, 638, 628, 179, 625, 179, 630, 179,203, 179, 631, 627, 179, 633, 179, 629, 179, 634,179, 203, 632, 643, 678, 644, 646, 179, 179, 179,179, 647, 642, 203, 179, 645, 179, 179, 179, 179,179, 179, 690, 179, 179, 179, 179, 179, 179, 203,179, 203, 689, 203, 203, 203, 179, 179, 179, 179,179, 203, 179, 179, 691, 179, 203, 203, 179, 679,179, 681, 203, 203, 692, 680, 203, 179, 682, 179,683, 203, 685, 684, 179, 203, 179, 686, 728, 203,687, 693, 695, 694, 179, 696, 179, 697, 729, 730,731, 179, 732, 179, 179, 741, 179, 203, 739, 203,743, 740, 203, 203, 179, 742, 179, 179, 203, 179,733, 179, 203, 179, 744, 203, 203, 734, 746, 735,203, 179, 747, 179, 179, 179, 179, 179, 179, 179,179, 179, 745, 179, 736, 179, 766, 737, 179, 179,179, 179, 786, 771, 770, 773, 179, 779, 179, 772,791, 179, 767, 179, 179, 179, 179, 179, 203, 769,781, 179, 179, 179, 179, 768, 795, 179, 778, 179,794, 777, 776, 775, 774, 203, 203, 203, 203, 780,203, 203, 765, 764, 763, 762, 761, 760, 759, 758,757, 756, 755, 754, 753, 790, 752, 751, 785, 148,750, 148, 148, 148, 152, 152, 174, 174, 174, 174,174, 178, 749, 178, 178, 178, 198, 748, 198, 198,198, 203, 727, 726, 203, 203, 224, 725, 224, 224,224, 171, 171, 171, 171, 171, 288, 724, 288, 288,288, 307, 723, 722, 307, 307, 326, 721, 326, 326,326, 720, 719, 718, 717, 716, 715, 714, 713, 712,711, 710, 709, 708, 707, 706, 705, 704, 703, 702,701, 700, 699, 698, 203, 203, 203, 677, 676, 675,674, 673, 672, 671, 670, 669, 668, 667, 666, 665,664, 663, 662, 661, 660, 659, 658, 657, 656, 655,654, 653, 652, 651, 650, 649, 648, 601, 600, 599,203, 203, 203, 621, 620, 619, 618, 617, 616, 615,614, 613, 612, 601, 600, 599, 611, 610, 609, 608,607, 606, 605, 604, 603, 602, 601, 600, 599, 596,593, 592, 591, 590, 589, 588, 528, 587, 526, 525,586, 203, 203, 203, 551, 548, 547, 546, 545, 544,543, 528, 542, 526, 541, 525, 540, 537, 534, 533,532, 531, 530, 529, 528, 527, 526, 525, 524, 523,522, 521, 520, 519, 518, 517, 516, 452, 515, 514,513, 448, 447, 512, 511, 510, 203, 203, 475, 474,473, 472, 471, 470, 469, 468, 452, 467, 466, 465,448, 447, 464, 463, 462, 461, 460, 459, 458, 457,456, 455, 454, 453, 452, 451, 450, 449, 448, 447,446, 445, 444, 443, 442, 441, 440, 436, 435, 434,433, 432, 431, 430, 429, 428, 427, 426, 425, 203,203, 386, 385, 384, 383, 379, 378, 377, 376, 375,374, 373, 372, 371, 370, 369, 368, 367, 366, 365,364, 363, 359, 358, 357, 356, 355, 354, 353, 352,351, 350, 349, 348, 347, 346, 345, 344, 341, 340,339, 338, 337, 336, 335, 334, 333, 332, 331, 330,232, 203, 287, 286, 285, 284, 281, 280, 279, 278,277, 276, 275, 274, 273, 272, 271, 270, 269, 153,268, 267, 266, 265, 262, 261, 260, 259, 258, 257,256, 255, 254, 253, 252, 251, 131, 248, 247, 246,245, 242, 241, 240, 239, 238, 237, 236, 235, 234,233, 232, 223, 222, 221, 220, 217, 216, 215, 214,213, 212, 211, 210, 209, 208, 207, 170, 169, 168,167, 164, 163, 162, 161, 160, 159, 158, 157, 156,155, 154, 153, 147, 146, 145, 144, 141, 140, 139,138, 137, 136, 135, 134, 133, 132, 131, 796, 11,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796} ;static yyconst short int yy_chk[1579] ={ 0,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 2, 13,13, 13, 14, 14, 14, 28, 34, 50, 58, 99,58, 56, 171, 171, 28, 2, 50, 315, 99, 34,55, 55, 55, 55, 56, 61, 55, 61, 315, 55,59, 59, 59, 60, 60, 60, 804, 2, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 3, 3, 3, 3,3, 3, 3, 3, 3, 3, 4, 62, 63, 62,63, 64, 65, 64, 65, 63, 66, 67, 66, 67,68, 105, 68, 4, 70, 65, 70, 64, 72, 68,72, 79, 795, 79, 105, 66, 178, 72, 178, 67,83, 83, 83, 70, 792, 4, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,5, 5, 5, 5, 6, 69, 71, 69, 71, 73,76, 73, 76, 80, 212, 80, 84, 84, 84, 123,638, 6, 80, 85, 85, 85, 638, 104, 123, 69,104, 173, 173, 71, 212, 80, 107, 107, 107, 76,179, 73, 179, 6, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 7, 7, 7, 7, 7, 7, 7, 7,7, 7, 8, 78, 128, 78, 108, 108, 108, 109,109, 109, 130, 130, 130, 144, 167, 128, 181, 8,181, 174, 174, 174, 174, 181, 207, 174, 144, 167,174, 176, 176, 207, 176, 78, 198, 176, 198, 789,176, 8, 9, 9, 9, 9, 9, 9, 9, 9,9, 9, 9, 9, 9, 9, 9, 9, 9, 9,9, 9, 9, 9, 9, 9, 9, 9, 9, 9,9, 9, 9, 9, 9, 9, 9, 9, 9, 9,9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 35, 57, 217, 74, 75, 74, 75, 77, 81,77, 81, 81, 106, 129, 151, 177, 10, 180, 180,180, 182, 183, 182, 183, 184, 186, 184, 186, 192,182, 192, 788, 74, 184, 787, 217, 35, 57, 10,35, 57, 74, 312, 75, 183, 186, 77, 81, 106,129, 81, 106, 129, 151, 177, 185, 187, 185, 187,188, 189, 188, 189, 190, 191, 190, 191, 312, 188,193, 192, 193, 194, 187, 194, 218, 185, 195, 190,195, 189, 196, 197, 196, 197, 199, 200, 199, 200,201, 202, 201, 202, 202, 204, 204, 204, 191, 208,193, 194, 205, 205, 205, 206, 206, 206, 208, 209,200, 210, 213, 211, 194, 214, 195, 215, 218, 219,210, 216, 220, 221, 214, 197, 196, 222, 223, 213,225, 309, 209, 202, 211, 250, 216, 215, 224, 226,224, 226, 227, 224, 226, 227, 228, 228, 228, 219,220, 245, 309, 225, 229, 229, 229, 230, 230, 230,308, 221, 263, 220, 245, 282, 289, 308, 289, 263,223, 222, 282, 263, 250, 310, 282, 288, 288, 290,288, 290, 316, 288, 227, 313, 288, 289, 291, 292,291, 292, 316, 293, 294, 293, 294, 295, 313, 295,296, 310, 296, 291, 320, 290, 293, 294, 295, 297,296, 297, 317, 298, 292, 298, 299, 300, 299, 300,301, 302, 301, 302, 303, 304, 303, 304, 305, 306,305, 306, 311, 314, 297, 319, 321, 317, 318, 322,324, 323, 298, 320, 325, 411, 314, 311, 326, 329,326, 577, 329, 326, 301, 303, 300, 578, 328, 299,328, 301, 342, 328, 302, 301, 411, 318, 304, 342,321, 305, 323, 342, 387, 784, 387, 321, 319, 412,577, 321, 322, 324, 388, 387, 388, 325, 389, 413,389, 329, 412, 390, 391, 390, 391, 392, 578, 392,388, 390, 391, 393, 394, 393, 394, 395, 396, 395,396, 413, 397, 389, 397, 395, 393, 398, 392, 398,399, 400, 399, 400, 407, 401, 394, 401, 405, 402,405, 402, 403, 404, 403, 404, 406, 409, 410, 415,407, 408, 414, 417, 418, 409, 410, 406, 419, 420,414, 421, 396, 688, 398, 423, 422, 399, 458, 460,400, 473, 401, 402, 403, 475, 408, 404, 477, 476,477, 476, 458, 460, 783, 473, 477, 782, 779, 475,417, 418, 476, 415, 688, 421, 420, 419, 422, 423,478, 479, 478, 479, 480, 481, 480, 481, 478, 482,483, 482, 483, 484, 485, 484, 485, 482, 486, 487,486, 487, 488, 498, 488, 489, 491, 489, 491, 483,490, 481, 490, 493, 492, 494, 492, 495, 500, 499,504, 502, 503, 494, 505, 495, 493, 499, 506, 498,485, 508, 507, 509, 487, 521, 523, 500, 486, 554,489, 554, 490, 491, 778, 488, 492, 554, 774, 521,523, 555, 556, 555, 556, 504, 490, 502, 570, 558,492, 558, 503, 506, 507, 509, 570, 505, 508, 557,576, 557, 559, 560, 559, 560, 579, 557, 507, 509,559, 561, 562, 561, 562, 563, 564, 563, 564, 565,566, 565, 566, 567, 573, 567, 568, 569, 568, 569,575, 580, 573, 582, 581, 579, 583, 584, 575, 585,561, 640, 773, 576, 563, 622, 560, 622, 565, 623,639, 623, 566, 562, 624, 568, 624, 564, 625, 569,625, 641, 567, 581, 625, 582, 584, 626, 628, 626,628, 585, 580, 642, 627, 583, 627, 629, 630, 629,630, 631, 640, 631, 632, 633, 632, 633, 634, 643,634, 644, 639, 646, 645, 647, 679, 678, 679, 678,680, 772, 680, 682, 641, 682, 689, 693, 681, 626,681, 628, 690, 691, 642, 627, 692, 683, 629, 683,630, 694, 632, 631, 684, 696, 684, 633, 678, 697,634, 643, 645, 644, 685, 646, 685, 647, 679, 680,681, 686, 682, 686, 687, 691, 687, 695, 689, 781,693, 690, 740, 771, 728, 692, 728, 729, 742, 729,683, 730, 738, 730, 694, 745, 786, 684, 696, 685,770, 731, 697, 731, 732, 733, 732, 733, 734, 735,734, 735, 695, 736, 686, 736, 728, 687, 737, 766,737, 766, 781, 740, 738, 745, 767, 762, 767, 742,786, 768, 730, 768, 769, 780, 769, 780, 791, 735,770, 785, 790, 785, 790, 732, 791, 794, 758, 794,790, 755, 752, 750, 748, 747, 746, 744, 743, 766,741, 739, 725, 722, 720, 718, 715, 712, 710, 708,707, 706, 705, 704, 703, 785, 702, 701, 780, 797,700, 797, 797, 797, 798, 798, 799, 799, 799, 799,799, 800, 699, 800, 800, 800, 801, 698, 801, 801,801, 802, 677, 676, 802, 802, 803, 675, 803, 803,803, 805, 805, 805, 805, 805, 806, 674, 806, 806,806, 807, 673, 672, 807, 807, 808, 671, 808, 808,808, 670, 669, 668, 667, 666, 665, 664, 663, 662,661, 660, 659, 658, 657, 656, 655, 654, 653, 652,651, 650, 649, 648, 637, 636, 635, 621, 620, 619,618, 617, 616, 615, 614, 613, 612, 611, 610, 609,608, 607, 606, 605, 604, 603, 602, 598, 597, 596,595, 594, 593, 592, 591, 590, 589, 588, 587, 586,574, 572, 571, 553, 552, 551, 550, 549, 548, 547,546, 545, 544, 543, 542, 540, 539, 538, 537, 536,535, 534, 533, 532, 531, 530, 529, 527, 524, 522,520, 519, 518, 517, 516, 515, 514, 513, 512, 511,510, 501, 497, 496, 474, 472, 471, 470, 469, 468,467, 466, 465, 464, 463, 462, 461, 459, 457, 456,455, 454, 453, 451, 450, 449, 446, 445, 444, 442,441, 440, 439, 438, 437, 436, 434, 433, 432, 431,430, 429, 428, 427, 426, 425, 424, 416, 385, 384,383, 382, 381, 380, 379, 377, 376, 375, 374, 373,372, 371, 370, 369, 368, 367, 365, 364, 363, 362,361, 360, 359, 357, 356, 355, 354, 353, 352, 351,350, 349, 348, 346, 345, 344, 343, 341, 340, 339,338, 337, 336, 335, 334, 333, 332, 331, 330, 327,307, 286, 285, 284, 283, 281, 280, 279, 278, 277,276, 275, 274, 273, 272, 271, 270, 269, 267, 266,265, 264, 262, 261, 260, 259, 258, 257, 256, 255,254, 253, 252, 251, 249, 248, 247, 246, 244, 243,242, 241, 240, 239, 238, 237, 236, 235, 234, 233,232, 203, 175, 170, 169, 168, 166, 165, 164, 163,162, 161, 160, 159, 158, 157, 156, 155, 154, 153,149, 147, 146, 145, 143, 142, 141, 140, 139, 138,137, 136, 135, 134, 133, 132, 131, 127, 126, 125,124, 122, 121, 120, 119, 118, 117, 116, 115, 114,113, 111, 103, 102, 101, 100, 98, 97, 96, 95,94, 93, 92, 91, 90, 89, 88, 54, 53, 52,51, 49, 48, 47, 46, 45, 44, 43, 42, 41,40, 39, 38, 32, 31, 30, 29, 27, 26, 25,24, 23, 22, 21, 20, 19, 18, 17, 11, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796, 796, 796,796, 796, 796, 796, 796, 796, 796, 796} ;static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;static char *yy_full_match;static int yy_lp;#define REJECT \{ \*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \yy_cp = yy_full_match; /* restore poss. backed-over text */ \++yy_lp; \goto find_rule; \}#define yymore() yymore_used_but_not_detected#define YY_MORE_ADJ 0#define YY_RESTORE_YY_MORE_OFFSETchar *yytext;#line 1 "levcomp.lpp"#define INITIAL 0#line 2 "levcomp.lpp"// levcomp.l:// Level compiler lexer for Dungeon Crawl Stone Soup.//// Based loosely on NetHack's lev_comp.l#include "AppHdr.h"#include "levcomp.tab.h"#include <cstring>static bool alloced = false;static void clean(){if (yylval.text && alloced)free( (void*) yylval.text);yylval.text = NULL;alloced = false;}static void settext(){clean();if ((yylval.text = strdup(yytext)))alloced = true;}#define MAPDEF 1#define ARGUMENT 2#define MNAME 3#define KEYWORDS 4#define YY_NEVER_INTERACTIVE 1#line 1130 "levcomp.lex.cc"/* Macros after this point can all be overridden by user definitions in* section 1.*/#ifndef YY_SKIP_YYWRAP#ifdef __cplusplusextern "C" int yywrap YY_PROTO(( void ));#elseextern int yywrap YY_PROTO(( void ));#endif#endif#ifndef YY_NO_UNPUTstatic void yyunput YY_PROTO(( int c, char *buf_ptr ));#endif#ifndef yytext_ptrstatic void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));#endif#ifdef YY_NEED_STRLENstatic int yy_flex_strlen YY_PROTO(( yyconst char * ));#endif#ifndef YY_NO_INPUT#ifdef __cplusplusstatic int yyinput YY_PROTO(( void ));#elsestatic int input YY_PROTO(( void ));#endif#endif#if YY_STACK_USEDstatic int yy_start_stack_ptr = 0;static int yy_start_stack_depth = 0;static int *yy_start_stack = 0;#ifndef YY_NO_PUSH_STATEstatic void yy_push_state YY_PROTO(( int new_state ));#endif#ifndef YY_NO_POP_STATEstatic void yy_pop_state YY_PROTO(( void ));#endif#ifndef YY_NO_TOP_STATEstatic int yy_top_state YY_PROTO(( void ));#endif#else#define YY_NO_PUSH_STATE 1#define YY_NO_POP_STATE 1#define YY_NO_TOP_STATE 1#endif#ifdef YY_MALLOC_DECLYY_MALLOC_DECL#else#if __STDC__#ifndef __cplusplus#include <stdlib.h>#endif#else/* Just try to get by without declaring the routines. This will fail* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)* or sizeof(void*) != sizeof(int).*/#endif#endif/* Amount of stuff to slurp up with each read. */#ifndef YY_READ_BUF_SIZE#define YY_READ_BUF_SIZE 8192#endif/* Copy whatever the last rule matched to the standard output. */#ifndef ECHO/* This used to be an fputs(), but since the string might contain NUL's,* we now use fwrite().*/#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )#endif/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,* is returned in "result".*/#ifndef YY_INPUT#define YY_INPUT(buf,result,max_size) \if ( yy_current_buffer->yy_is_interactive ) \{ \int c = '*', n; \for ( n = 0; n < max_size && \(c = getc( yyin )) != EOF && c != '\n'; ++n ) \buf[n] = (char) c; \if ( c == '\n' ) \buf[n++] = (char) c; \if ( c == EOF && ferror( yyin ) ) \YY_FATAL_ERROR( "input in flex scanner failed" ); \result = n; \} \else \{ \errno=0; \while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \{ \if( errno != EINTR) \{ \YY_FATAL_ERROR( "input in flex scanner failed" ); \break; \} \errno=0; \clearerr(yyin); \} \}#endif/* No semi-colon after return; correct usage is to write "yyterminate();" -* we don't want an extra ';' after the "return" because that will cause* some compilers to complain about unreachable statements.*/#ifndef yyterminate#define yyterminate() return YY_NULL#endif/* Number of entries by which start-condition stack grows. */#ifndef YY_START_STACK_INCR#define YY_START_STACK_INCR 25#endif/* Report a fatal error. */#ifndef YY_FATAL_ERROR#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )#endif/* Default declaration of generated scanner - a define so the user can* easily add parameters.*/#ifndef YY_DECL#define YY_DECL int yylex YY_PROTO(( void ))#endif/* Code executed at the beginning of each rule, after yytext and yyleng* have been set up.*/#ifndef YY_USER_ACTION#define YY_USER_ACTION#endif/* Code executed at the end of each rule. */#ifndef YY_BREAK#define YY_BREAK break;#endif#define YY_RULE_SETUP \if ( yyleng > 0 ) \yy_current_buffer->yy_at_bol = \(yytext[yyleng - 1] == '\n'); \YY_USER_ACTIONYY_DECL{register yy_state_type yy_current_state;register char *yy_cp, *yy_bp;register int yy_act;#line 41 "levcomp.lpp"#line 1298 "levcomp.lex.cc"if ( yy_init ){yy_init = 0;#ifdef YY_USER_INITYY_USER_INIT;#endifif ( ! yy_start )yy_start = 1; /* first start state */if ( ! yyin )yyin = stdin;if ( ! yyout )yyout = stdout;if ( ! yy_current_buffer )yy_current_buffer =yy_create_buffer( yyin, YY_BUF_SIZE );yy_load_buffer_state();}while ( 1 ) /* loops until end-of-file is reached */{yy_cp = yy_c_buf_p;/* Support of yytext. */*yy_cp = yy_hold_char;/* yy_bp points to the position in yy_ch_buf of the start of* the current run.*/yy_bp = yy_cp;yy_current_state = yy_start;yy_current_state += YY_AT_BOL();yy_state_ptr = yy_state_buf;*yy_state_ptr++ = yy_current_state;yy_match:do{register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ){yy_current_state = (int) yy_def[yy_current_state];if ( yy_current_state >= 797 )yy_c = yy_meta[(unsigned int) yy_c];}yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];*yy_state_ptr++ = yy_current_state;++yy_cp;}while ( yy_base[yy_current_state] != 1530 );yy_find_action:yy_current_state = *--yy_state_ptr;yy_lp = yy_accept[yy_current_state];find_rule: /* we branch to this label when backing up */for ( ; ; ) /* until we find what rule we matched */{if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ){yy_act = yy_acclist[yy_lp];{yy_full_match = yy_cp;break;}}--yy_cp;yy_current_state = *--yy_state_ptr;yy_lp = yy_accept[yy_current_state];}YY_DO_BEFORE_ACTION;if ( yy_act != YY_END_OF_BUFFER ){int yyl;for ( yyl = 0; yyl < yyleng; ++yyl )if ( yytext[yyl] == '\n' )++yylineno;}do_action: /* This label is used only to access EOF actions. */switch ( yy_act ){ /* beginning of action switch */case 1:YY_RULE_SETUP#line 43 "levcomp.lpp"{ BEGIN(INITIAL); }YY_BREAKcase 2:YY_RULE_SETUP#line 45 "levcomp.lpp";YY_BREAKcase 3:YY_RULE_SETUP#line 47 "levcomp.lpp"{settext();return MAP_LINE;}YY_BREAKcase 4:YY_RULE_SETUP#line 52 "levcomp.lpp"{ BEGIN(MAPDEF); }YY_BREAKcase 5:YY_RULE_SETUP#line 54 "levcomp.lpp";YY_BREAKcase 6:YY_RULE_SETUP#line 56 "levcomp.lpp"{ BEGIN(ARGUMENT); return NAME; }YY_BREAKcase 7:YY_RULE_SETUP#line 57 "levcomp.lpp"return DEFAULT_DEPTH;YY_BREAKcase 8:YY_RULE_SETUP#line 58 "levcomp.lpp"return DEPTH;YY_BREAKcase 9:YY_RULE_SETUP#line 59 "levcomp.lpp"return ORIENT;YY_BREAKcase 10:YY_RULE_SETUP#line 60 "levcomp.lpp"{ BEGIN(ARGUMENT); return PLACE; }YY_BREAKcase 11:YY_RULE_SETUP#line 61 "levcomp.lpp"return CHANCE;YY_BREAKcase 12:YY_RULE_SETUP#line 62 "levcomp.lpp"return FLAGS;YY_BREAKcase 13:YY_RULE_SETUP#line 63 "levcomp.lpp"{ BEGIN(KEYWORDS); return TAGS; }YY_BREAKcase 14:YY_RULE_SETUP#line 64 "levcomp.lpp"{ BEGIN(ARGUMENT); return SYMBOL; }YY_BREAKcase 15:YY_RULE_SETUP#line 65 "levcomp.lpp"{ BEGIN(MNAME); return MONS; }YY_BREAKcase 16:YY_RULE_SETUP#line 67 "levcomp.lpp"{settext();return STRING;}YY_BREAKcase 17:YY_RULE_SETUP#line 72 "levcomp.lpp";YY_BREAKcase 18:YY_RULE_SETUP#line 73 "levcomp.lpp"{ BEGIN(INITIAL); }YY_BREAKcase 19:YY_RULE_SETUP#line 75 "levcomp.lpp"{settext();return MONSTER_NAME;}YY_BREAKcase 20:YY_RULE_SETUP#line 80 "levcomp.lpp"return COMMA;YY_BREAKcase 21:YY_RULE_SETUP#line 81 "levcomp.lpp"{ BEGIN(INITIAL); }YY_BREAKcase 22:YY_RULE_SETUP#line 82 "levcomp.lpp";YY_BREAKcase 23:YY_RULE_SETUP#line 84 "levcomp.lpp"return PANDEMONIC;YY_BREAKcase 24:YY_RULE_SETUP#line 85 "levcomp.lpp"return NO_HMIRROR;YY_BREAKcase 25:YY_RULE_SETUP#line 86 "levcomp.lpp"return NO_VMIRROR;YY_BREAKcase 26:YY_RULE_SETUP#line 87 "levcomp.lpp"return NO_ROTATE;YY_BREAKcase 27:YY_RULE_SETUP#line 89 "levcomp.lpp"return ENCOMPASS;YY_BREAKcase 28:YY_RULE_SETUP#line 90 "levcomp.lpp"return NORTH;YY_BREAKcase 29:YY_RULE_SETUP#line 91 "levcomp.lpp"return SOUTH;YY_BREAKcase 30:YY_RULE_SETUP#line 92 "levcomp.lpp"return EAST;YY_BREAKcase 31:YY_RULE_SETUP#line 93 "levcomp.lpp"return WEST;YY_BREAKcase 32:YY_RULE_SETUP#line 94 "levcomp.lpp"return NORTHEAST;YY_BREAKcase 33:YY_RULE_SETUP#line 95 "levcomp.lpp"return NORTHWEST;YY_BREAKcase 34:YY_RULE_SETUP#line 96 "levcomp.lpp"return SOUTHEAST;YY_BREAKcase 35:YY_RULE_SETUP#line 97 "levcomp.lpp"return SOUTHWEST;YY_BREAKcase 36:YY_RULE_SETUP#line 99 "levcomp.lpp"return DASH;YY_BREAKcase 37:YY_RULE_SETUP#line 100 "levcomp.lpp"return COMMA;YY_BREAKcase 38:YY_RULE_SETUP#line 102 "levcomp.lpp"{clean();yylval.i = atoi(yytext);return INTEGER;}YY_BREAKcase 39:YY_RULE_SETUP#line 108 "levcomp.lpp"{BEGIN(INITIAL);settext();return STRING;}YY_BREAKcase 40:YY_RULE_SETUP#line 114 "levcomp.lpp"{ BEGIN(INITIAL); }YY_BREAKcase 41:YY_RULE_SETUP#line 116 "levcomp.lpp";YY_BREAKcase 42:YY_RULE_SETUP#line 118 "levcomp.lpp"return BAD_CHARACTER;YY_BREAKcase 43:YY_RULE_SETUP#line 120 "levcomp.lpp"ECHO;YY_BREAK#line 1622 "levcomp.lex.cc"case YY_STATE_EOF(INITIAL):case YY_STATE_EOF(MAPDEF):case YY_STATE_EOF(ARGUMENT):case YY_STATE_EOF(MNAME):case YY_STATE_EOF(KEYWORDS):yyterminate();case YY_END_OF_BUFFER:{/* Amount of text matched not including the EOB char. */int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;/* Undo the effects of YY_DO_BEFORE_ACTION. */*yy_cp = yy_hold_char;YY_RESTORE_YY_MORE_OFFSETif ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ){/* We're scanning a new file or input source. It's* possible that this happened because the user* just pointed yyin at a new source and called* yylex(). If so, then we have to assure* consistency between yy_current_buffer and our* globals. Here is the right place to do so, because* this is the first action (other than possibly a* back-up) that will match for the new input source.*/yy_n_chars = yy_current_buffer->yy_n_chars;yy_current_buffer->yy_input_file = yyin;yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;}/* Note that here we test for yy_c_buf_p "<=" to the position* of the first EOB in the buffer, since yy_c_buf_p will* already have been incremented past the NUL character* (since all states make transitions on EOB to the* end-of-buffer state). Contrast this with the test* in input().*/if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ){ /* This was really a NUL. */yy_state_type yy_next_state;yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;yy_current_state = yy_get_previous_state();/* Okay, we're now positioned to make the NUL* transition. We couldn't have* yy_get_previous_state() go ahead and do it* for us because it doesn't know how to deal* with the possibility of jamming (and we don't* want to build jamming into it because then it* will run more slowly).*/yy_next_state = yy_try_NUL_trans( yy_current_state );yy_bp = yytext_ptr + YY_MORE_ADJ;if ( yy_next_state ){/* Consume the NUL. */yy_cp = ++yy_c_buf_p;yy_current_state = yy_next_state;goto yy_match;}else{yy_cp = yy_c_buf_p;goto yy_find_action;}}else switch ( yy_get_next_buffer() ){case EOB_ACT_END_OF_FILE:{yy_did_buffer_switch_on_eof = 0;if ( yywrap() ){/* Note: because we've taken care in* yy_get_next_buffer() to have set up* yytext, we can now set up* yy_c_buf_p so that if some total* hoser (like flex itself) wants to* call the scanner after we return the* YY_NULL, it'll still work - another* YY_NULL will get returned.*/yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;yy_act = YY_STATE_EOF(YY_START);goto do_action;}else{if ( ! yy_did_buffer_switch_on_eof )YY_NEW_FILE;}break;}case EOB_ACT_CONTINUE_SCAN:yy_c_buf_p =yytext_ptr + yy_amount_of_matched_text;yy_current_state = yy_get_previous_state();yy_cp = yy_c_buf_p;yy_bp = yytext_ptr + YY_MORE_ADJ;goto yy_match;case EOB_ACT_LAST_MATCH:yy_c_buf_p =&yy_current_buffer->yy_ch_buf[yy_n_chars];yy_current_state = yy_get_previous_state();yy_cp = yy_c_buf_p;yy_bp = yytext_ptr + YY_MORE_ADJ;goto yy_find_action;}break;}default:YY_FATAL_ERROR("fatal flex scanner internal error--no action found" );} /* end of action switch */} /* end of scanning one token */} /* end of yylex *//* yy_get_next_buffer - try to read in a new buffer** Returns a code representing an action:* EOB_ACT_LAST_MATCH -* EOB_ACT_CONTINUE_SCAN - continue scanning from current position* EOB_ACT_END_OF_FILE - end of file*/static int yy_get_next_buffer(){register char *dest = yy_current_buffer->yy_ch_buf;register char *source = yytext_ptr;register int number_to_move, i;int ret_val;if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed" );if ( yy_current_buffer->yy_fill_buffer == 0 ){ /* Don't try to fill the buffer, so this is an EOF. */if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ){/* We matched a single character, the EOB, so* treat this as a final EOF.*/return EOB_ACT_END_OF_FILE;}else{/* We matched some text prior to the EOB, first* process it.*/return EOB_ACT_LAST_MATCH;}}/* Try to read more data. *//* First move last chars to start of buffer. */number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;for ( i = 0; i < number_to_move; ++i )*(dest++) = *(source++);if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )/* don't do the read, it's not guaranteed to return an EOF,* just force an EOF*/yy_current_buffer->yy_n_chars = yy_n_chars = 0;else{int num_to_read =yy_current_buffer->yy_buf_size - number_to_move - 1;while ( num_to_read <= 0 ){ /* Not enough room in the buffer - grow it. */#ifdef YY_USES_REJECTYY_FATAL_ERROR("input buffer overflow, can't enlarge buffer because scanner uses REJECT" );#else/* just a shorter name for the current buffer */YY_BUFFER_STATE b = yy_current_buffer;int yy_c_buf_p_offset =(int) (yy_c_buf_p - b->yy_ch_buf);if ( b->yy_is_our_buffer ){int new_size = b->yy_buf_size * 2;if ( new_size <= 0 )b->yy_buf_size += b->yy_buf_size / 8;elseb->yy_buf_size *= 2;b->yy_ch_buf = (char *)/* Include room in for 2 EOB chars. */yy_flex_realloc( (void *) b->yy_ch_buf,b->yy_buf_size + 2 );}else/* Can't grow it, we don't own it. */b->yy_ch_buf = 0;if ( ! b->yy_ch_buf )YY_FATAL_ERROR("fatal error - scanner input buffer overflow" );yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];num_to_read = yy_current_buffer->yy_buf_size -number_to_move - 1;#endif}if ( num_to_read > YY_READ_BUF_SIZE )num_to_read = YY_READ_BUF_SIZE;/* Read in more data. */YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),yy_n_chars, num_to_read );yy_current_buffer->yy_n_chars = yy_n_chars;}if ( yy_n_chars == 0 ){if ( number_to_move == YY_MORE_ADJ ){ret_val = EOB_ACT_END_OF_FILE;yyrestart( yyin );}else{ret_val = EOB_ACT_LAST_MATCH;yy_current_buffer->yy_buffer_status =YY_BUFFER_EOF_PENDING;}}elseret_val = EOB_ACT_CONTINUE_SCAN;yy_n_chars += number_to_move;yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;yytext_ptr = &yy_current_buffer->yy_ch_buf[0];return ret_val;}/* yy_get_previous_state - get the state just before the EOB char was reached */static yy_state_type yy_get_previous_state(){register yy_state_type yy_current_state;register char *yy_cp;yy_current_state = yy_start;yy_current_state += YY_AT_BOL();yy_state_ptr = yy_state_buf;*yy_state_ptr++ = yy_current_state;for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ){register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ){yy_current_state = (int) yy_def[yy_current_state];if ( yy_current_state >= 797 )yy_c = yy_meta[(unsigned int) yy_c];}yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];*yy_state_ptr++ = yy_current_state;}return yy_current_state;}/* yy_try_NUL_trans - try to make a transition on the NUL character** synopsis* next_state = yy_try_NUL_trans( current_state );*/#ifdef YY_USE_PROTOSstatic yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )#elsestatic yy_state_type yy_try_NUL_trans( yy_current_state )yy_state_type yy_current_state;#endif{register int yy_is_jam;register YY_CHAR yy_c = 1;while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ){yy_current_state = (int) yy_def[yy_current_state];if ( yy_current_state >= 797 )yy_c = yy_meta[(unsigned int) yy_c];}yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];yy_is_jam = (yy_current_state == 796);if ( ! yy_is_jam )*yy_state_ptr++ = yy_current_state;return yy_is_jam ? 0 : yy_current_state;}#ifndef YY_NO_UNPUT#ifdef YY_USE_PROTOSstatic void yyunput( int c, register char *yy_bp )#elsestatic void yyunput( c, yy_bp )int c;register char *yy_bp;#endif{register char *yy_cp = yy_c_buf_p;/* undo effects of setting up yytext */*yy_cp = yy_hold_char;if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ){ /* need to shift things up to make room *//* +2 for EOB chars. */register int number_to_move = yy_n_chars + 2;register char *dest = &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];register char *source =&yy_current_buffer->yy_ch_buf[number_to_move];while ( source > yy_current_buffer->yy_ch_buf )*--dest = *--source;yy_cp += (int) (dest - source);yy_bp += (int) (dest - source);yy_current_buffer->yy_n_chars =yy_n_chars = yy_current_buffer->yy_buf_size;if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )YY_FATAL_ERROR( "flex scanner push-back overflow" );}*--yy_cp = (char) c;if ( c == '\n' )--yylineno;yytext_ptr = yy_bp;yy_hold_char = *yy_cp;yy_c_buf_p = yy_cp;}#endif /* ifndef YY_NO_UNPUT */#ifdef __cplusplusstatic int yyinput()#elsestatic int input()#endif{int c;*yy_c_buf_p = yy_hold_char;if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ){/* yy_c_buf_p now points to the character we want to return.* If this occurs *before* the EOB characters, then it's a* valid NUL; if not, then we've hit the end of the buffer.*/if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )/* This was really a NUL. */*yy_c_buf_p = '\0';else{ /* need more input */int offset = yy_c_buf_p - yytext_ptr;++yy_c_buf_p;switch ( yy_get_next_buffer() ){case EOB_ACT_LAST_MATCH:/* This happens because yy_g_n_b()* sees that we've accumulated a* token and flags that we need to* try matching the token before* proceeding. But for input(),* there's no matching to consider.* So convert the EOB_ACT_LAST_MATCH* to EOB_ACT_END_OF_FILE.*//* Reset buffer status. */yyrestart( yyin );/* fall through */case EOB_ACT_END_OF_FILE:{if ( yywrap() )return EOF;if ( ! yy_did_buffer_switch_on_eof )YY_NEW_FILE;#ifdef __cplusplusreturn yyinput();#elsereturn input();#endif}case EOB_ACT_CONTINUE_SCAN:yy_c_buf_p = yytext_ptr + offset;break;}}}c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */*yy_c_buf_p = '\0'; /* preserve yytext */yy_hold_char = *++yy_c_buf_p;yy_current_buffer->yy_at_bol = (c == '\n');if ( yy_current_buffer->yy_at_bol )++yylineno;return c;}#ifdef YY_USE_PROTOSvoid yyrestart( FILE *input_file )#elsevoid yyrestart( input_file )FILE *input_file;#endif{if ( ! yy_current_buffer )yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );yy_init_buffer( yy_current_buffer, input_file );yy_load_buffer_state();}#ifdef YY_USE_PROTOSvoid yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )#elsevoid yy_switch_to_buffer( new_buffer )YY_BUFFER_STATE new_buffer;#endif{if ( yy_current_buffer == new_buffer )return;if ( yy_current_buffer ){/* Flush out information for old buffer. */*yy_c_buf_p = yy_hold_char;yy_current_buffer->yy_buf_pos = yy_c_buf_p;yy_current_buffer->yy_n_chars = yy_n_chars;}yy_current_buffer = new_buffer;yy_load_buffer_state();/* We don't actually know whether we did this switch during* EOF (yywrap()) processing, but the only time this flag* is looked at is after yywrap() is called, so it's safe* to go ahead and always set it.*/yy_did_buffer_switch_on_eof = 1;}#ifdef YY_USE_PROTOSvoid yy_load_buffer_state( void )#elsevoid yy_load_buffer_state()#endif{yy_n_chars = yy_current_buffer->yy_n_chars;yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;yyin = yy_current_buffer->yy_input_file;yy_hold_char = *yy_c_buf_p;}#ifdef YY_USE_PROTOSYY_BUFFER_STATE yy_create_buffer( FILE *file, int size )#elseYY_BUFFER_STATE yy_create_buffer( file, size )FILE *file;int size;#endif{YY_BUFFER_STATE b;b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );if ( ! b )YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );b->yy_buf_size = size;/* yy_ch_buf has to be 2 characters longer than the size given because* we need to put in 2 end-of-buffer characters.*/b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );if ( ! b->yy_ch_buf )YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );b->yy_is_our_buffer = 1;yy_init_buffer( b, file );return b;}#ifdef YY_USE_PROTOSvoid yy_delete_buffer( YY_BUFFER_STATE b )#elsevoid yy_delete_buffer( b )YY_BUFFER_STATE b;#endif{if ( ! b )return;if ( b == yy_current_buffer )yy_current_buffer = (YY_BUFFER_STATE) 0;if ( b->yy_is_our_buffer )yy_flex_free( (void *) b->yy_ch_buf );yy_flex_free( (void *) b );}#ifndef _WIN32#include <unistd.h>#else#ifndef YY_ALWAYS_INTERACTIVE#ifndef YY_NEVER_INTERACTIVEextern int isatty YY_PROTO(( int ));#endif#endif#endif#ifdef YY_USE_PROTOSvoid yy_init_buffer( YY_BUFFER_STATE b, FILE *file )#elsevoid yy_init_buffer( b, file )YY_BUFFER_STATE b;FILE *file;#endif{yy_flush_buffer( b );b->yy_input_file = file;b->yy_fill_buffer = 1;#if YY_ALWAYS_INTERACTIVEb->yy_is_interactive = 1;#else#if YY_NEVER_INTERACTIVEb->yy_is_interactive = 0;#elseb->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;#endif#endif}#ifdef YY_USE_PROTOSvoid yy_flush_buffer( YY_BUFFER_STATE b )#elsevoid yy_flush_buffer( b )YY_BUFFER_STATE b;#endif{if ( ! b )return;b->yy_n_chars = 0;/* We always need two end-of-buffer characters. The first causes* a transition to the end-of-buffer state. The second causes* a jam in that state.*/b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;b->yy_buf_pos = &b->yy_ch_buf[0];b->yy_at_bol = 1;b->yy_buffer_status = YY_BUFFER_NEW;if ( b == yy_current_buffer )yy_load_buffer_state();}#ifndef YY_NO_SCAN_BUFFER#ifdef YY_USE_PROTOSYY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )#elseYY_BUFFER_STATE yy_scan_buffer( base, size )char *base;yy_size_t size;#endif{YY_BUFFER_STATE b;if ( size < 2 ||base[size-2] != YY_END_OF_BUFFER_CHAR ||base[size-1] != YY_END_OF_BUFFER_CHAR )/* They forgot to leave room for the EOB's. */return 0;b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );if ( ! b )YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */b->yy_buf_pos = b->yy_ch_buf = base;b->yy_is_our_buffer = 0;b->yy_input_file = 0;b->yy_n_chars = b->yy_buf_size;b->yy_is_interactive = 0;b->yy_at_bol = 1;b->yy_fill_buffer = 0;b->yy_buffer_status = YY_BUFFER_NEW;yy_switch_to_buffer( b );return b;}#endif#ifndef YY_NO_SCAN_STRING#ifdef YY_USE_PROTOSYY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )#elseYY_BUFFER_STATE yy_scan_string( yy_str )yyconst char *yy_str;#endif{int len;for ( len = 0; yy_str[len]; ++len );return yy_scan_bytes( yy_str, len );}#endif#ifndef YY_NO_SCAN_BYTES#ifdef YY_USE_PROTOSYY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )#elseYY_BUFFER_STATE yy_scan_bytes( bytes, len )yyconst char *bytes;int len;#endif{YY_BUFFER_STATE b;char *buf;yy_size_t n;int i;/* Get memory for full buffer, including space for trailing EOB's. */n = len + 2;buf = (char *) yy_flex_alloc( n );if ( ! buf )YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );for ( i = 0; i < len; ++i )buf[i] = bytes[i];buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;b = yy_scan_buffer( buf, n );if ( ! b )YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );/* It's okay to grow etc. this buffer, and we should throw it* away when we're done.*/b->yy_is_our_buffer = 1;return b;}#endif#ifndef YY_NO_PUSH_STATE#ifdef YY_USE_PROTOSstatic void yy_push_state( int new_state )#elsestatic void yy_push_state( new_state )int new_state;#endif{if ( yy_start_stack_ptr >= yy_start_stack_depth ){yy_size_t new_size;yy_start_stack_depth += YY_START_STACK_INCR;new_size = yy_start_stack_depth * sizeof( int );if ( ! yy_start_stack )yy_start_stack = (int *) yy_flex_alloc( new_size );elseyy_start_stack = (int *) yy_flex_realloc((void *) yy_start_stack, new_size );if ( ! yy_start_stack )YY_FATAL_ERROR("out of memory expanding start-condition stack" );}yy_start_stack[yy_start_stack_ptr++] = YY_START;BEGIN(new_state);}#endif#ifndef YY_NO_POP_STATEstatic void yy_pop_state(){if ( --yy_start_stack_ptr < 0 )YY_FATAL_ERROR( "start-condition stack underflow" );BEGIN(yy_start_stack[yy_start_stack_ptr]);}#endif#ifndef YY_NO_TOP_STATEstatic int yy_top_state(){return yy_start_stack[yy_start_stack_ptr - 1];}#endif#ifndef YY_EXIT_FAILURE#define YY_EXIT_FAILURE 2#endif#ifdef YY_USE_PROTOSstatic void yy_fatal_error( yyconst char msg[] )#elsestatic void yy_fatal_error( msg )char msg[];#endif{(void) fprintf( stderr, "%s\n", msg );exit( YY_EXIT_FAILURE );}/* Redefine yyless() so it works in section 3 code. */#undef yyless#define yyless(n) \do \{ \/* Undo effects of setting up yytext. */ \yytext[yyleng] = yy_hold_char; \yy_c_buf_p = yytext + n; \yy_hold_char = *yy_c_buf_p; \*yy_c_buf_p = '\0'; \yyleng = n; \} \while ( 0 )/* Internal utility routines. */#ifndef yytext_ptr#ifdef YY_USE_PROTOSstatic void yy_flex_strncpy( char *s1, yyconst char *s2, int n )#elsestatic void yy_flex_strncpy( s1, s2, n )char *s1;yyconst char *s2;int n;#endif{register int i;for ( i = 0; i < n; ++i )s1[i] = s2[i];}#endif#ifdef YY_NEED_STRLEN#ifdef YY_USE_PROTOSstatic int yy_flex_strlen( yyconst char *s )#elsestatic int yy_flex_strlen( s )yyconst char *s;#endif{register int n;for ( n = 0; s[n]; ++n );return n;}#endif#ifdef YY_USE_PROTOSstatic void *yy_flex_alloc( yy_size_t size )#elsestatic void *yy_flex_alloc( size )yy_size_t size;#endif{return (void *) malloc( size );}#ifdef YY_USE_PROTOSstatic void *yy_flex_realloc( void *ptr, yy_size_t size )#elsestatic void *yy_flex_realloc( ptr, size )void *ptr;yy_size_t size;#endif{/* The cast to (char *) in the following accommodates both* implementations that use char* generic pointers, and those* that use void* generic pointers. It works with the latter* because both ANSI C and C++ allow castless assignment from* any pointer type to void*, and deal with argument conversions* as though doing an assignment.*/return (void *) realloc( (char *) ptr, size );}#ifdef YY_USE_PROTOSstatic void yy_flex_free( void *ptr )#elsestatic void yy_flex_free( ptr )void *ptr;#endif{free( ptr );}#if YY_MAINint main(){yylex();return 0;}#endif#line 120 "levcomp.lpp"int yywrap(){clean();return 1;}
int player_res_acid(bool consider_unidentified_gear = true);int player_acid_resist_factor();int player_res_torment(bool calc_unid = true);bool player_res_corrosion(bool calc_unid = true);bool player_item_conserve(bool calc_unid = true);int player_mental_clarity(bool calc_unid = true);
//void priest_spells(int priest_pass[10], char religious); // see actual function for reasoning here {dlb}
// Use this function whenever the player enters (or lands and thus re-enters)// a grid.//// stepped - normal walking moves// allow_shift - allowed to scramble in any direction out of lava/water// force - ignore safety checks, move must happen (traps, lava/water).bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,bool force ){ASSERT( in_bounds( x, y ) );int id;// assuming that entering the same square means coming from above (levitate)const bool from_above = (you.x_pos == x && you.y_pos == y);const int old_grid = (from_above) ? static_cast<int>(DNGN_FLOOR): grd[you.x_pos][you.y_pos];const int new_grid = grd[x][y];// really must be clearASSERT( !grid_is_solid( new_grid ) );// if (grid_is_solid( new_grid ))// return (false);// better not be an unsubmerged monster either:ASSERT( mgrd[x][y] == NON_MONSTER|| mons_is_submerged( &menv[ mgrd[x][y] ] ));// if (mgrd[x][y] != NON_MONSTER && !mons_is_submerged( &menv[ mgrd[x][y] ] ))// return (false);// if we're walking along, give a chance to avoid trapif (stepped&& !force&& new_grid == DNGN_UNDISCOVERED_TRAP){const int skill = 4 + you.skills[SK_TRAPS_DOORS]+ you.mutation[MUT_ACUTE_VISION]- 2 * you.mutation[MUT_BLURRY_VISION];if (random2( skill ) > 6){mprf( MSGCH_WARN,"Wait a moment, %s! Do you really want to step there?",you.your_name );more();exercise( SK_TRAPS_DOORS, 3 );you.turn_is_over = false;id = trap_at_xy( x, y );if (id != -1)grd[x][y] = trap_category( env.trap[id].type );return (false);}}// only consider terrain if player is not levitatingif (!player_is_levitating()){// XXX: at some point we're going to need to fix the swimming// code to handle burden states.if (new_grid == DNGN_LAVA|| (new_grid == DNGN_DEEP_WATER && you.species != SP_MERFOLK)){// lava and dangerous deep water (ie not merfolk)int entry_x = (stepped) ? you.x_pos : x;int entry_y = (stepped) ? you.y_pos : y;if (stepped && !force && !you.conf){bool okay = yesno( "Do you really want to step there?",false, 'n' );if (!okay){canned_msg(MSG_OK);return (false);}}// have to move now so fall_into_a_pool will workyou.x_pos = x;you.y_pos = y;viewwindow( true, false );// if true, we were shifted and so we're done.if (fall_into_a_pool( entry_x, entry_y, allow_shift, new_grid ))return (true);}else if (new_grid == DNGN_SHALLOW_WATER || new_grid == DNGN_DEEP_WATER){// safer water effectsif (you.species == SP_MERFOLK){if (old_grid != DNGN_SHALLOW_WATER&& old_grid != DNGN_DEEP_WATER){if (stepped)mpr("Your legs become a tail as you enter the water.");elsempr("Your legs become a tail as you dive into the water.");merfolk_start_swimming();}}else{ASSERT( new_grid != DNGN_DEEP_WATER );if (!stepped)noisy(SL_SPLASH, you.x_pos, you.y_pos, "Splash!");you.time_taken *= 13 + random2(8);you.time_taken /= 10;if (old_grid != DNGN_SHALLOW_WATER){mprf( "You %s the shallow water.",(stepped ? "enter" : "fall into") );mpr("Moving in this stuff is going to be slow.");if (you.invis)mpr( "... and don't expect to remain undetected." );}}}}// move the player to locationyou.x_pos = x;you.y_pos = y;viewwindow( true, false );// Other Effects:// clouds -- do we need this? (always seems to double up with acr.cc call)// if (is_cloud( you.x_pos, you.y_pos ))// in_a_cloud();// icy shield goes down over lavaif (new_grid == DNGN_LAVA)expose_player_to_element( BEAM_LAVA );// traps go off:if (new_grid >= DNGN_TRAP_MECHANICAL && new_grid <= DNGN_UNDISCOVERED_TRAP){id = trap_at_xy( you.x_pos, you.y_pos );if (id != -1){bool trap_known = true;if (new_grid == DNGN_UNDISCOVERED_TRAP){trap_known = false;const int type = trap_category( env.trap[id].type );grd[you.x_pos][you.y_pos] = type;set_envmap_char(you.x_pos, you.y_pos, get_sightmap_char(type));}// not easy to blink onto a trap without setting it off:if (!stepped)trap_known = false;if (!player_is_levitating()|| trap_category( env.trap[id].type ) != DNGN_TRAP_MECHANICAL){handle_traps(env.trap[id].type, id, trap_known);}}}return (true);}bool player_in_mappable_area( void ){return (you.level_type != LEVEL_LABYRINTH && you.level_type != LEVEL_ABYSS);}
// Returns the item in the given equipment slot, NULL if the slot is empty.// eq must be in [EQ_WEAPON, EQ_AMULET], or bad things will happen.item_def *player_slot_item(equipment_type eq){ASSERT(eq >= EQ_WEAPON && eq <= EQ_AMULET);const int item = you.equip[eq];return (item == -1? NULL : &you.inv[item]);}// Returns the item in the player's weapon slot.item_def *player_weapon(){return player_slot_item(EQ_WEAPON);}bool player_weapon_wielded(){const int wpn = you.equip[EQ_WEAPON];if (wpn == -1)return (false);if (you.inv[wpn].base_type != OBJ_WEAPONS&& you.inv[wpn].base_type != OBJ_STAVES){return (false);}// FIXME: This needs to go in eventually./*// should never have a bad "shape" weapon in handASSERT( check_weapon_shape( you.inv[wpn], false ) );if (!check_weapon_wieldable_size( you.inv[wpn], player_size() ))return (false);*/return (true);}// Returns the you.inv[] index of our wielded weapon or -1 (no item, not wield)int get_player_wielded_item(){return (you.equip[EQ_WEAPON]);}int get_player_wielded_weapon(){return (player_weapon_wielded()? get_player_wielded_item() : -1);}
}int player_res_acid(bool consider_unidentified_gear){int res = 0;if (!transform_changed_physiology()){if (you.species == SP_GOLDEN_DRACONIAN&& you.experience_level >= 7)res += 2;res += you.mutation[MUT_YELLOW_SCALES] * 2 / 3;}if (wearing_amulet(AMU_RESIST_CORROSION, consider_unidentified_gear))res++;return (res);
// Returns a factor X such that post-resistance acid damage can be calculated// as pre_resist_damage * X / 100.int player_acid_resist_factor(){int res = player_res_acid();int factor = 100;if (res == 1)factor = 50;else if (res == 2)factor = 34;else if (res > 2){factor = 30;while (res-- > 2 && factor >= 20)factor = factor * 90 / 100;}return (factor);}
// Does the player resist asphyxiation?bool player_res_asphyx(){// The undead are immune to asphyxiation, or so we'll assume.if (you.is_undead)return (true);switch (you.attribute[ATTR_TRANSFORMATION]){case TRAN_LICH:case TRAN_STATUE:case TRAN_SERPENT_OF_HELL:case TRAN_AIR:return (true);}return (false);}bool player_control_teleport(bool calc_unid) {return ( you.duration[DUR_CONTROL_TELEPORT] ||player_equip(EQ_RINGS, RING_TELEPORT_CONTROL, calc_unid) ||you.mutation[MUT_TELEPORT_CONTROL] );}int player_res_torment(bool){return (you.is_undead || you.mutation[MUT_TORMENT_RESISTANCE]);}
&& (cmp_helmet_type( you.inv[ item ], THELM_CAP )|| cmp_helmet_type( you.inv[ item ], THELM_WIZARD_HAT )|| cmp_helmet_type( you.inv[ item ], THELM_SPECIAL )))
&& (get_helmet_type(you.inv[ item ]) == THELM_CAP|| get_helmet_type(you.inv[ item ]) == THELM_WIZARD_HAT|| get_helmet_type(you.inv[ item ]) == THELM_SPECIAL))
}// psize defaults to PSIZE_TORSO, which checks the part of the body// that wears armour and wields weapons (which is different for some hybrids).// base defaults to "false", meaning consider our current size, not our// natural one.size_type player_size( int psize, bool base ){size_type ret = (base) ? SIZE_CHARACTER : transform_size( psize );if (ret == SIZE_CHARACTER){// transformation has size of character's species:switch (you.species){case SP_OGRE:case SP_OGRE_MAGE:case SP_TROLL:ret = SIZE_LARGE;break;case SP_NAGA:// Most of their body is on the ground giving them a low profile.if (psize == PSIZE_TORSO || psize == PSIZE_PROFILE)ret = SIZE_MEDIUM;elseret = SIZE_BIG;break;case SP_CENTAUR:ret = (psize == PSIZE_TORSO) ? SIZE_MEDIUM : SIZE_BIG;break;case SP_SPRIGGAN:ret = SIZE_LITTLE;break;case SP_HALFLING:case SP_GNOME:case SP_KOBOLD:ret = SIZE_SMALL;break;default:ret = SIZE_MEDIUM;break;}}return (ret);
int move_cost = (player_speed() * player_movement_speed()) / 10;if ( you.slow )move_cost *= 2;const bool water = player_in_water();const bool swim = player_is_swimming();const bool lev = player_is_levitating();const bool fly = (lev && you.duration[DUR_CONTROLLED_FLIGHT]);const bool swift = (you.duration[DUR_SWIFTNESS] > 0);snprintf( info, INFO_SIZE,"Your %s speed is %s%s%s.",// order is important for these:(swim) ? "swimming" :(water) ? "wading" :(fly) ? "flying" :(lev) ? "levitating": "movement",(water && !swim) ? "uncertain and " :(!water && swift) ? "aided by the wind" : "",(!water && swift) ? ((move_cost >= 10) ? ", but still ": " and "): "",(move_cost < 8) ? "very quick" :(move_cost < 10) ? "quick" :(move_cost == 10) ? "average" :(move_cost < 13) ? "slow": "very slow" );mpr(info);// XXX Assumes no hand-and-a-half bonus. Oh well.const int to_hit = calc_your_to_hit( calc_heavy_armour_penalty(false),false, false, false ) * 2;// Messages based largely on percentage chance of missing the// average EV 10 humanoid, and very agile EV 30 (pretty much// max EV for monsters currently).//// "awkward" - need lucky hit (less than EV)// "difficult" - worse than 2 in 3// "hard" - worse than fair chancesnprintf( info, INFO_SIZE,"%s in your current equipment.",(to_hit < 1) ? "You are completely incapable of fighting" :(to_hit < 5) ? "Hitting even clumsy monsters is extremely awkward" :(to_hit < 10) ? "Hitting average monsters is awkward" :(to_hit < 15) ? "Hitting average monsters is difficult" :(to_hit < 20) ? "Hitting average monsters is hard" :(to_hit < 30) ? "Very agile monsters are a bit awkward to hit" :(to_hit < 45) ? "Very agile monsters are a bit difficult to hit" :(to_hit < 60) ? "Very agile monsters are a bit hard to hit" :(to_hit < 100) ? "You feel comfortable with your ability to fight": "You feel confident with your ability to fight" );#if DEBUG_DIAGNOSTICSchar str_pass[INFO_SIZE];snprintf( str_pass, INFO_SIZE, " (%d)", to_hit );strncat( info, str_pass, INFO_SIZE );#endifmpr(info);// character evaluates their ability to sneak around:const int ustealth = check_stealth();// XXX: made these values up, probably could be better.snprintf( info, INFO_SIZE, "You feel %sstealthy.",(ustealth < 10) ? "extremely un" :(ustealth < 20) ? "very un" :(ustealth < 30) ? "un" :(ustealth < 50) ? "fairly " :(ustealth < 80) ? "" :(ustealth < 120) ? "quite " :(ustealth < 160) ? "very " :(ustealth < 200) ? "extremely ": "incredibly " );#if DEBUG_DIAGNOSTICSsnprintf( str_pass, INFO_SIZE, " (%d)", ustealth );strncat( info, str_pass, INFO_SIZE );#endifmpr( info );
bool player_res_corrosion(bool calc_unid){return (player_equip(EQ_AMULET, AMU_RESIST_CORROSION, calc_unid)|| player_equip_ego_type(EQ_CLOAK, SPARM_PRESERVATION));}bool player_item_conserve(bool calc_unid){return (player_equip(EQ_AMULET, AMU_CONSERVATION, calc_unid)|| player_equip_ego_type(EQ_CLOAK, SPARM_PRESERVATION));}
you.hp -= hp_loss;if (!fatal && you.hp < 1)you.hp = 1;
// If it's not fatal, use ouch() so that notes can be taken. If it IS// fatal, somebody else is doing the bookkeeping, and we don't want to mess// with that.if (!fatal && aux)ouch(hp_loss, -1, KILLED_BY_SOMETHING, aux);elseyou.hp -= hp_loss;
}/* ******************************************************************// this function is solely called by a commented out portion of// player::level_change() and is a bit outta whack with the// current codebase - probably should be struck as well 19may2000 {dlb}void priest_spells( int priest_pass[10], char religious ){switch ( religious ){case GOD_ZIN:priest_pass[1] = SPELL_LESSER_HEALING;priest_pass[2] = SPELL_REPEL_UNDEAD;priest_pass[3] = SPELL_HEAL_OTHER;priest_pass[4] = SPELL_PURIFICATION;priest_pass[5] = SPELL_GREATER_HEALING;priest_pass[6] = SPELL_SMITING;priest_pass[7] = SPELL_HOLY_WORD;priest_pass[8] = SPELL_REMOVE_CURSE;priest_pass[9] = SPELL_GUARDIAN;break;case GOD_SHINING_ONE:priest_pass[1] = SPELL_REPEL_UNDEAD;priest_pass[2] = SPELL_LESSER_HEALING;priest_pass[3] = SPELL_HEAL_OTHER;priest_pass[4] = SPELL_PURIFICATION;priest_pass[5] = SPELL_ABJURATION_II;priest_pass[6] = SPELL_THUNDERBOLT;priest_pass[7] = SPELL_SHINING_LIGHT;priest_pass[8] = SPELL_SUMMON_DAEVA;priest_pass[9] = SPELL_FLAME_OF_CLEANSING;break;case GOD_ELYVILON:priest_pass[1] = SPELL_LESSER_HEALING;priest_pass[2] = SPELL_HEAL_OTHER;priest_pass[3] = SPELL_PURIFICATION;priest_pass[4] = 93; // restore abilitiespriest_pass[5] = SPELL_GREATER_HEALING;priest_pass[6] = 94; // another healing spellpriest_pass[7] = 95; // something elsepriest_pass[8] = -1; //priest_pass[9] = -1; //break;}
}
your_name[0] = 0;berserk_penalty = 0;berserker = 0;conf = 0;confusing_touch = 0;deaths_door = 0;disease = 0;elapsed_time = 0;exhausted = 0;haste = 0;invis = 0;levitation = 0;might = 0;paralysis = 0;poison = 0;rotting = 0;fire_shield = 0;slow = 0;special_wield = SPWLD_NONE;sure_blade = 0;synch_time = 0;base_hp = 5000;base_hp2 = 5000;base_magic_points = 5000;base_magic_points2 = 5000;
void perform_activity(){switch (you.activity)
magic_points_regeneration = 0;strength = 0;max_strength = 0;intel = 0;max_intel = 0;dex = 0;max_dex = 0;experience = 0;experience_level = 1;max_level = 1;char_class = JOB_UNKNOWN;hunger = 6000;hunger_state = HS_SATIATED;gold = 0;// speed = 10; // 0.75; // unusedburden = 0;burden_state = BS_UNENCUMBERED;spell_no = 0;your_level = 0;level_type = LEVEL_DUNGEON;where_are_you = BRANCH_MAIN_DUNGEON;char_direction = DIR_DESCENDING;prev_targ = MHITNOT;pet_target = MHITNOT;x_pos = 0;y_pos = 0;running.clear();travel_x = 0;travel_y = 0;religion = GOD_NO_GOD;piety = 0;gift_timeout = 0;for (int i = 0; i < MAX_NUM_GODS; i++)
#ifdef CLUA_BINDINGSstatic const char *activity_interrupt_name(ACT_INTERRUPT ai){switch (ai)
ghost.name[0] = 0;for (int i = 0; i < NUM_GHOST_VALUES; i++)ghost.values[i] = 0;for (int i = EQ_WEAPON; i < NUM_EQUIP; i++)equip[i] = -1;for (int i = 0; i < 25; i++)spells[i] = SPELL_NO_SPELL;for (int i = 0; i < 52; i++)
case AI_FORCE_INTERRUPT: return "force";case AI_KEYPRESS: return "keypress";case AI_FULL_HP: return "full_hp";case AI_FULL_MP: return "full_mp";case AI_STATUE: return "statue";case AI_HUNGRY: return "hungry";case AI_MESSAGE: return "message";case AI_HP_LOSS: return "hp_loss";case AI_BURDEN_CHANGE: return "burden";case AI_STAT_CHANGE: return "stat";case AI_SEE_MONSTER: return "monster";case AI_TELEPORT: return "teleport";default: return "unknown";
spell_letter_table[i] = -1;ability_letter_table[i] = ABIL_NON_ABILITY;
static bool userdef_interrupt_activity( ACT_INTERRUPT ai,const activity_interrupt_t &at ){#ifdef CLUA_BINDINGSlua_State *ls = clua.state();if (!ls || ai == AI_FORCE_INTERRUPT)
for (int i = 0; i < 50; i++)unique_items[i] = UNIQ_NOT_EXISTS;for (int i = 0; i < NO_UNRANDARTS; i++)set_unrandart_exist(i, 0);for (int i = 0; i < 50; i++)
bool ran = clua.callfn("c_interrupt_activity", "1:ssA",act_name, interrupt_name, &at);if (ran){// If the function returned nil, we want to cease processing.if (lua_isnil(ls, -1)){lua_pop(ls, 1);return false;}
skill_cost_level = 1;total_skill_points = 0;
kill_activity();
inv[i].quantity = 0;inv[i].base_type = OBJ_WEAPONS;inv[i].sub_type = WPN_CLUB;inv[i].plus = 0;inv[i].plus2 = 0;inv[i].special = 0;inv[i].colour = 0;set_ident_flags( inv[i], ISFLAG_IDENT_MASK );inv[i].x = -1;inv[i].y = -1;inv[i].link = i;
if (!userdef_interrupt_activity(ai, at) || !you.activity){if (you.activity == ACT_RUNNING || you.activity == ACT_TRAVELING)you.activity = ACT_NONE;return;}if (!ai || (Options.activity_interrupts[ you.activity ] & ai)) {kill_activity();}
char st_prn[20];itoa(experience_level, st_prn, 10);desc += st_prn;desc += " ";desc += species_name(species, experience_level);desc += " ";desc += class_name;
void seen_notable_thing( int which_thing ){// Don't record in temporary terrainif (you.level_type != LEVEL_DUNGEON)return;const god_type god = grid_altar_god(which_thing);if (god != GOD_NO_GOD)seen_altar( god );else if (grid_is_branch_stairs( which_thing ))seen_staircase( which_thing );elseseen_other_thing( which_thing );}
mpr( "The acid burns!" );ouch( dam, 0, KILLED_BY_ACID );
const int post_res_dam = dam * player_acid_resist_factor() / 100;if (post_res_dam > 0){mpr( "The acid burns!" );if (post_res_dam < dam)canned_msg(MSG_YOU_RESIST);ouch( post_res_dam, 0, KILLED_BY_ACID );}
unsigned char burnc;unsigned char burn2;unsigned char burn_no = 0;
switch (flavour){case BEAM_FIRE:case BEAM_LAVA:case BEAM_NAPALM:case BEAM_HELLFIRE:target_class = OBJ_SCROLLS;break;case BEAM_COLD:case BEAM_FRAG:target_class = OBJ_POTIONS;break;
for (burnc = 0; burnc < ENDOFPACK; burnc++)
return (target_class);}// XXX: These expose functions could use being reworked into a real system...// the usage and implementation is currently very hacky.// Handles the destruction of inventory items from the elements.static void expose_invent_to_element( beam_type flavour, int strength ){int i, j;int num_dest = 0;const int target_class = get_target_class( flavour );if (target_class == OBJ_UNASSIGNED)return;// Currently we test against each stack (and item in the stack)// independantly at strength%... perhaps we don't want that either// because it makes the system very fair and removes the protection// factor of junk (which might be more desirable for game play).for (i = 0; i < ENDOFPACK; i++)
if (target_class == OBJ_SCROLLS)mpr("A scroll you are carrying catches fire!");else if (target_class == OBJ_POTIONS)mpr("A potion you are carrying freezes and shatters!");else if (target_class == OBJ_FOOD)mpr("Some of your food is covered with spores!");
switch (target_class){case OBJ_SCROLLS:snprintf( info, INFO_SIZE, "%s you are carrying %s fire!",(num_dest > 1) ? "Some of the scrolls" : "A scroll",(num_dest > 1) ? "catch" : "catches" );break;case OBJ_POTIONS:snprintf( info, INFO_SIZE, "%s you are carrying %s and %s!",(num_dest > 1) ? "Some of the potions" : "A potion",(num_dest > 1) ? "freeze" : "freezes",(num_dest > 1) ? "shatter" : "shatters" );break;case OBJ_FOOD:snprintf( info, INFO_SIZE, "Some of your food is covered with spores!" );break;default:snprintf( info, INFO_SIZE, "%s you are carrying %s destroyed!",(num_dest > 1) ? "Some items" : "An item",(num_dest > 1) ? "were" : "was" );break;}mpr( info ); // XXX: should this be in a channel?
else if (burn_no > 1)
}// Handle side-effects for exposure to element other than damage.// This function exists because some code calculates its own damage// instead of using check_resists and we want to isolate all the special// code they keep having to do... namely condensation shield checks,// you really can't expect this function to even be called for much else.//// This function now calls expose_invent_to_element if strength > 0.//// XXX: this function is far from perfect and a work in progress.void expose_player_to_element( beam_type flavour, int strength ){// Note that BEAM_TELEPORT is sent here when the player// blinks or teleports.if (flavour == BEAM_FIRE || flavour == BEAM_LAVA|| flavour == BEAM_HELLFIRE || flavour == BEAM_FRAG|| flavour == BEAM_TELEPORT || flavour == BEAM_NAPALM|| flavour == BEAM_STEAM)
if (target_class == OBJ_SCROLLS)mpr("Some of the scrolls you are carrying catch fire!");else if (target_class == OBJ_POTIONS)mpr("Some of the potions you are carrying freeze and shatter!");else if (target_class == OBJ_FOOD)mpr("Some of your food is covered with spores!");
if (you.duration[DUR_CONDENSATION_SHIELD] > 0){mprf(MSGCH_DURATION, "Your icy shield dissipates!");you.duration[DUR_CONDENSATION_SHIELD] = 0;you.redraw_armour_class = true;}
// do points first.long points = you.gold;points += (you.experience * 7) / 10;//if (death_type == KILLED_BY_WINNING) points += points / 2;//if (death_type == KILLED_BY_LEAVING) points += points / 10;// these now handled by giving player the value of their inventorychar temp_id[4][50];
struct scorefile_entry se;// Score file entry version://// 4.0 - original versioned entry// 4.1 - added real_time and num_turn fields// 4.2 - stats and god infose.version = 4;se.release = 2;strncpy( se.name, you.your_name, kNameLen );se.name[ kNameLen - 1 ] = '\0';#ifdef MULTIUSERse.uid = (int) getuid();#elsese.uid = 0;#endifFixedVector< int, NUM_RUNE_TYPES > rune_array;se.num_runes = 0;se.num_diff_runes = 0;for (int i = 0; i < NUM_RUNE_TYPES; i++)rune_array[i] = 0;// Calculate value of pack and runes when character leaves dungeonif (death_type == KILLED_BY_LEAVING || death_type == KILLED_BY_WINNING){for (d = 0; d < ENDOFPACK; d++){if (is_valid_item( you.inv[d] )){points += item_value( you.inv[d], temp_id, true );if (you.inv[d].base_type == OBJ_MISCELLANY&& you.inv[d].sub_type == MISC_RUNE_OF_ZOT){if (rune_array[ you.inv[d].plus ] == 0)se.num_diff_runes++;se.num_runes += you.inv[d].quantity;rune_array[ you.inv[d].plus ] += you.inv[d].quantity;}}}// Bonus for exploring different areas, not for collecting a// huge stack of demonic runes in Pandemonium (gold value// is enough for those). -- bwrif (se.num_diff_runes >= 3)points += ((se.num_diff_runes + 2) * (se.num_diff_runes + 2) * 1000);}// Players will have a hard time getting 1/10 of this (see XP cap):if (points > 99999999)points = 99999999;se.points = points;se.race = you.species;se.cls = you.char_class;// strcpy(se.race_class_name, "");se.race_class_name[0] = '\0';se.lvl = you.experience_level;se.best_skill = best_skill( SK_FIGHTING, NUM_SKILLS - 1, 99 );se.best_skill_lvl = you.skills[ se.best_skill ];se.death_type = death_type;// for death by monster// Set the default aux data value...// If aux is passed in (ie for a trap), we'll default to that.if (aux == NULL)se.auxkilldata[0] = '\0';else{strncpy( se.auxkilldata, aux, ITEMNAME_SIZE );se.auxkilldata[ ITEMNAME_SIZE - 1 ] = '\0';}if ((death_type == KILLED_BY_MONSTER || death_type == KILLED_BY_BEAM)&& death_source >= 0 && death_source < MAX_MONSTERS){struct monsters *monster = &menv[death_source];if (monster->type > 0 || monster->type <= NUM_MONSTERS){se.death_source = monster->type;se.mon_num = monster->number;// Previously the weapon was only used for dancing weapons,// but now we pass it in as a string through the scorefile// entry to be appended in hiscores_format_single in long or// medium scorefile formats.// It still isn't used in monam for anything but flying weapons// thoughif (death_type == KILLED_BY_MONSTER&& monster->inv[MSLOT_WEAPON] != NON_ITEM){#if HISCORE_WEAPON_DETAILset_ident_flags( mitm[monster->inv[MSLOT_WEAPON]],ISFLAG_IDENT_MASK );#else// changing this to ignore the pluses to keep it shortunset_ident_flags( mitm[monster->inv[MSLOT_WEAPON]],ISFLAG_IDENT_MASK );set_ident_flags( mitm[monster->inv[MSLOT_WEAPON]],ISFLAG_KNOW_TYPE );// clear "runed" description text to make shorter yetset_equip_desc( mitm[monster->inv[MSLOT_WEAPON]], 0 );#endif// Setting this is redundant for dancing weapons, however// we do care about the above indentification. -- bwrif (monster->type != MONS_DANCING_WEAPON){it_name( monster->inv[MSLOT_WEAPON], DESC_NOCAP_A, info );strncpy( se.auxkilldata, info, ITEMNAME_SIZE );se.auxkilldata[ ITEMNAME_SIZE - 1 ] = '\0';}}strcpy( info,monam( monster->number, monster->type, true, DESC_NOCAP_A,monster->inv[MSLOT_WEAPON] ) );strncpy( se.death_source_name, info, 40 );se.death_source_name[39] = '\0';}}else{se.death_source = death_source;se.mon_num = 0;se.death_source_name[0] = '\0';}se.damage = dam;se.final_hp = you.hp;se.final_max_hp = you.hp_max;se.final_max_max_hp = you.hp_max + player_rotted();se.str = you.strength;se.intel = you.intel;se.dex = you.dex;se.god = you.religion;if (you.religion != GOD_NO_GOD){se.piety = you.piety;se.penance = you.penance[you.religion];}// main dungeon: level is simply levelse.dlvl = you.your_level + 1;switch (you.where_are_you){case BRANCH_ORCISH_MINES:case BRANCH_HIVE:case BRANCH_LAIR:case BRANCH_SLIME_PITS:case BRANCH_VAULTS:case BRANCH_CRYPT:case BRANCH_HALL_OF_BLADES:case BRANCH_HALL_OF_ZOT:case BRANCH_ECUMENICAL_TEMPLE:case BRANCH_SNAKE_PIT:case BRANCH_ELVEN_HALLS:case BRANCH_TOMB:case BRANCH_SWAMP:se.dlvl = you.your_level - you.branch_stairs[you.where_are_you - 10];break;case BRANCH_DIS:case BRANCH_GEHENNA:case BRANCH_VESTIBULE_OF_HELL:case BRANCH_COCYTUS:case BRANCH_TARTARUS:case BRANCH_INFERNO:case BRANCH_THE_PIT:se.dlvl = you.your_level - 26;break;}se.branch = you.where_are_you; // no adjustments necessary.se.level_type = you.level_type; // pandemonium, labyrinth, dungeon..se.birth_time = you.birth_time; // start time of gamese.death_time = time( NULL ); // end time of gameif (you.real_time != -1)se.real_time = you.real_time + (se.death_time - you.start_time);elsese.real_time = -1;se.num_turns = you.num_turns;#ifdef WIZARDse.wiz_mode = (you.wizard ? 1 : 0);#elsese.wiz_mode = 0;#endif
scorefile_entry se(dam, death_source, death_type, aux);
#ifdef SAVE_DIR_PATHsnprintf( info, INFO_SIZE, SAVE_DIR_PATH "%s%d", you.your_name, (int) getuid());#elsestrncpy(info, you.your_name, kFileNameLen);info[kFileNameLen] = '\0';
std::string basename = get_savedir_filename( you.your_name, "", "" );const char* suffixes[] = {#ifdef CLUA_BINDINGS".lua",
std::string basefile = del_file;strcat(del_file, ".sav");unlink(del_file);// Delete record of stashes, kills, travel cache and lua save.unlink( (basefile + ".st").c_str() );unlink( (basefile + ".kil").c_str() );unlink( (basefile + ".tc").c_str() );#ifdef CLUA_BINDINGSunlink( (basefile + ".lua").c_str() );#endif
for ( i = 0; i < num_suffixes; ++i ) {std::string tmpname = basename + suffixes[i];unlink( tmpname.c_str() );}
/** File: notes.cc* Summary: Notetaking stuff* Written by: Haran Pilpel** Change History (most recent first):** <1> -/--/-- PH Created*/#ifndef NOTES_H#define NOTES_H#include <string>#include <vector>#include <stdio.h>enum NOTE_TYPES {NOTE_HP_CHANGE = 0, /* needs: new hp, max hp */NOTE_MAXHP_CHANGE, /* needs: new maxhp */NOTE_MP_CHANGE, /* needs: new mp, max mp */NOTE_MAXMP_CHANGE, /* needs: new maxmp */NOTE_XP_LEVEL_CHANGE, /* needs: new xplevel */NOTE_DUNGEON_LEVEL_CHANGE, /* needs: branch, subdepth */NOTE_LEARN_SPELL, /* needs: spell idx */NOTE_GET_GOD, /* needs: god id */NOTE_GOD_GIFT, /* needs: god id */NOTE_GOD_POWER, /* needs: god id, idx */NOTE_GET_MUTATION, /* needs: mutation idx */NOTE_LOSE_MUTATION, /* needs: mutation idx */NOTE_ID_ITEM, /* needs: item name (string) *//* NOT HOOKED YET */NOTE_GET_ITEM, /* needs: item name (string) */NOTE_GAIN_SKILL, /* needs: skill id, level */NOTE_SEEN_MONSTER, /* needs: monster name (string) */NOTE_KILL_MONSTER, /* needs: monster name (string) */NOTE_POLY_MONSTER, /* needs: monster name (string) */NOTE_USER_NOTE, /* needs: description string */NOTE_MESSAGE, /* needs: message string */NOTE_LOSE_GOD, /* needs: god id */NOTE_NUM_TYPES};struct Note {Note();Note( NOTE_TYPES t, int f = 0, int s = 0, const char* n = 0,const char* d = 0);NOTE_TYPES type;int first, second;long turn;unsigned short packed_place;std::string name;std::string desc;void load( FILE* fp );void save( FILE* fp ) const;};extern std::vector<Note> note_list;std::string describe_note( const Note& note );void activate_notes( bool active );bool notes_are_active();void take_note( const Note& note );void save_notes( FILE* fp );void load_notes( FILE* fp );void make_user_note();#endif
/** Modified for Crawl Reference by $Author$ on $Date$*/#include <vector>#include "AppHdr.h"#include "notes.h"#include "files.h"#include "Kills.h"#include "message.h"#include "misc.h"#include "mon-pick.h"#include "mutation.h"#include "religion.h"#include "skills2.h"#include "spl-util.h"#define NOTES_VERSION_NUMBER 1001std::vector<Note> note_list;/* I can't believe I'm writing code this bad */static int real_god_power( int religion, int idx ) {switch ( religion ) {case GOD_NO_GOD:case GOD_XOM:case GOD_NEMELEX_XOBEH:return -1;case GOD_ZIN:case GOD_SHINING_ONE:case GOD_YREDELEMNUL:case GOD_MAKHLEB:case GOD_ELYVILON:return idx;case GOD_KIKUBAAQUDGHA:if ( idx < 3 )return idx;if ( idx == 3 )return -1;return idx-1;case GOD_VEHUMET:return ( idx > 3 ? -1 : idx );case GOD_OKAWARU:if ( idx < 2 )return idx;if ( idx == 2 || idx == 3 )return -1;return idx - 2;case GOD_SIF_MUNA:if ( idx == 2 || idx == 4 ) return -1;if ( idx < 2 ) return idx;if ( idx == 3 ) return 2;case GOD_TROG:if ( idx == 2 || idx == 4 ) return -1;if ( idx < 2 ) return idx;if ( idx == 3 ) return idx-1;default:return -1;}}static bool is_noteworthy_skill_level( int level ) {unsigned i;for ( i = 0; i < Options.note_skill_levels.size(); ++i )if ( level == Options.note_skill_levels[i] )return true;return false;}static bool is_highest_skill( int skill ) {for ( int i = 0; i < NUM_SKILLS; ++i ) {if ( i == skill )continue;if ( you.skills[i] >= you.skills[skill] )return false;}return true;}static bool is_noteworthy_hp( int hp, int maxhp ) {return (hp > 0 && Options.note_hp_percent &&hp <= (maxhp * Options.note_hp_percent) / 100);}static int dungeon_branch_depth( unsigned char branch ) {if ( branch > BRANCH_CAVERNS ) // last branchreturn -1;switch ( branch ) {case BRANCH_MAIN_DUNGEON:return 27;case BRANCH_DIS:case BRANCH_GEHENNA:case BRANCH_COCYTUS:case BRANCH_TARTARUS:return 7;case BRANCH_VESTIBULE_OF_HELL:return 1;case BRANCH_INFERNO:case BRANCH_THE_PIT:return -1;default:return branch_depth( branch - 10 );}}static bool is_noteworthy_dlevel( unsigned short place ) {unsigned const char branch = (unsigned char) ((place >> 8) & 0xFF);const int lev = (place & 0xFF);/* Special levels (Abyss, etc.) are always interesting */if ( lev == 0xFF )return true;if ( lev == dungeon_branch_depth(branch) ||(branch == BRANCH_MAIN_DUNGEON && (lev % 5) == 0) ||(branch != BRANCH_MAIN_DUNGEON && lev == 1) )return true;return false;}/* Is a note worth taking?This function assumes that game state has not changed sincethe note was taken, e.g. you.* is valid.*/static bool is_noteworthy( const Note& note ) {/* always noteworthy */if ( note.type == NOTE_XP_LEVEL_CHANGE ||note.type == NOTE_GET_GOD ||note.type == NOTE_GOD_GIFT ||note.type == NOTE_GET_MUTATION ||note.type == NOTE_LOSE_MUTATION ||note.type == NOTE_SEEN_MONSTER ||note.type == NOTE_KILL_MONSTER ||note.type == NOTE_POLY_MONSTER ||note.type == NOTE_USER_NOTE ||note.type == NOTE_MESSAGE ||note.type == NOTE_LOSE_GOD )return true;/* never noteworthy, hooked up for fun or future use */if ( note.type == NOTE_GET_ITEM ||note.type == NOTE_MP_CHANGE ||note.type == NOTE_MAXHP_CHANGE ||note.type == NOTE_MAXMP_CHANGE )return false;/* god powers might be noteworthy if it's an actual power */if ( note.type == NOTE_GOD_POWER &&real_god_power(note.first, note.second) == -1 )return false;/* hp noteworthiness is handled in its own function */if ( note.type == NOTE_HP_CHANGE &&!is_noteworthy_hp(note.first, note.second) )return false;/* skills are noteworthy if in the skill value list or ifit's a new maximal skill (depending on options) */if ( note.type == NOTE_GAIN_SKILL ) {if ( is_noteworthy_skill_level(note.second) )return true;if ( Options.note_skill_max && is_highest_skill(note.first) )return true;return false;}if ( note.type == NOTE_DUNGEON_LEVEL_CHANGE &&!is_noteworthy_dlevel(note.packed_place) )return false;/* Learning a spell is always noteworthy if note_all_spells is set */if ( note.type == NOTE_LEARN_SPELL && Options.note_all_spells )return true;for ( unsigned i = 0; i < note_list.size(); ++i ) {if ( note_list[i].type != note.type )continue;const Note& rnote( note_list[i] );switch ( note.type ) {case NOTE_DUNGEON_LEVEL_CHANGE:if ( rnote.packed_place == note.packed_place )return false;break;case NOTE_LEARN_SPELL:if (spell_difficulty(rnote.first) >= spell_difficulty(note.first))return false;break;case NOTE_GOD_POWER:if ( rnote.first == note.first && rnote.second == note.second )return false;break;case NOTE_ID_ITEM:/* re-id'ing an item, e.g. second copy of book, isn'tnoteworthy */if ( rnote.name == note.name )return false;break;case NOTE_HP_CHANGE:/* not if we have a recent warning */if ( (note.turn - rnote.turn < 5) &&/* unless we've lost half our HP since then */(note.first * 2 >= rnote.first) )return false;break;default:mpr("Buggy note passed: unknown note type");// Return now, rather than give a "Buggy note passed" message// for each note of the matching type in the note list.return true;}}return true;}const char* number_to_ordinal( int number ) {const char* ordinals[5] = { "first", "second", "third", "fourth","fifth" };if ( number < 1)return "[unknown ordinal (too small)]";if ( number > 5 )return "[unknown ordinal (too big)]";return ordinals[number-1];}std::string describe_note( const Note& note ) {char buf[200], buf2[50];switch ( note.type ) {case NOTE_HP_CHANGE:// [ds] Shortened HP change note from "Had X hitpoints" to accommodate// the cause for the loss of hitpoints.snprintf(buf, sizeof buf, "HP: %d/%d [%s]",note.first, note.second, note.name.c_str());break;case NOTE_MP_CHANGE:snprintf(buf, sizeof buf, "Mana: %d/%d", note.first, note.second);break;case NOTE_MAXHP_CHANGE:snprintf(buf, sizeof buf, "Reached %d max hit points", note.first);break;case NOTE_MAXMP_CHANGE:snprintf(buf, sizeof buf, "Reached %d max mana", note.first);break;case NOTE_XP_LEVEL_CHANGE:snprintf(buf, sizeof buf, "Reached XP level %d. %s", note.first,note.name.c_str());break;case NOTE_DUNGEON_LEVEL_CHANGE:snprintf(buf, sizeof buf, "Entered %s",place_name(note.packed_place, true, true).c_str());break;case NOTE_LEARN_SPELL:snprintf(buf, sizeof buf, "Learned a level %d spell: %s",spell_difficulty(note.first), spell_title(note.first));break;case NOTE_GET_GOD:snprintf(buf, sizeof buf, "Became a worshipper of %s",god_name(note.first, true));break;case NOTE_LOSE_GOD:snprintf(buf, sizeof buf, "Fell from the grace of %s",god_name(note.first));break;case NOTE_GOD_GIFT:snprintf(buf, sizeof buf, "Received a gift from %s",god_name(note.first));break;case NOTE_ID_ITEM:if (note.desc.length() > 0)snprintf(buf, sizeof buf, "Identified %s (%s)", note.name.c_str(),note.desc.c_str());elsesnprintf(buf, sizeof buf, "Identified %s", note.name.c_str());break;case NOTE_GET_ITEM:snprintf(buf, sizeof buf, "Got %s", note.name.c_str());break;case NOTE_GAIN_SKILL:snprintf(buf, sizeof buf, "Reached skill %d in %s",note.second, skill_name(note.first));break;case NOTE_SEEN_MONSTER:snprintf(buf, sizeof buf, "Noticed %s", note.name.c_str() );break;case NOTE_KILL_MONSTER:snprintf(buf, sizeof buf, "Defeated %s", note.name.c_str());break;case NOTE_POLY_MONSTER:snprintf(buf, sizeof buf, "%s changed form", note.name.c_str() );break;case NOTE_GOD_POWER:snprintf(buf, sizeof buf, "Acquired %s's %s power",god_name(note.first),number_to_ordinal(real_god_power(note.first, note.second)+1));break;case NOTE_GET_MUTATION:snprintf(buf, sizeof buf, "Gained mutation: %s",mutation_name(note.first, note.second == 0 ? 1 : note.second));break;case NOTE_LOSE_MUTATION:snprintf(buf, sizeof buf, "Lost mutation: %s",mutation_name(note.first,note.second == 3 ? 3 : note.second+1));break;case NOTE_USER_NOTE:snprintf(buf, sizeof buf, "%s", note.name.c_str());break;case NOTE_MESSAGE:snprintf(buf, sizeof buf, "%s", note.name.c_str());break;default:snprintf(buf, sizeof buf, "Buggy note description: unknown note type");break;}snprintf(buf2, sizeof buf2, "| %5ld | ", note.turn );std::string placename = short_place_name(note.packed_place);while ( placename.length() < 7 )placename += ' ';return std::string(buf2) + placename + std::string(" | ") +std::string(buf);}Note::Note() {turn = you.num_turns;packed_place = get_packed_place();}Note::Note( NOTE_TYPES t, int f, int s, const char* n, const char* d ) :type(t), first(f), second(s) {if (n)name = std::string(n);if (d)desc = std::string(d);turn = you.num_turns;packed_place = get_packed_place();}void Note::save( FILE* fp ) const {writeLong( fp, type );writeLong( fp, turn );writeShort( fp, packed_place );writeLong( fp, first );writeLong( fp, second );writeString( fp, name );writeString( fp, desc );}void Note::load( FILE* fp ) {type = (NOTE_TYPES)(readLong( fp ));turn = readLong( fp );packed_place = readShort( fp );first = readLong( fp );second = readLong( fp );name = readString( fp );desc = readString( fp );}bool notes_active = false;bool notes_are_active() {return notes_active;}void take_note( const Note& note ) {if ( notes_active && is_noteworthy( note ) )note_list.push_back( note );}void activate_notes( bool active ) {notes_active = active;}void save_notes( FILE* fp ) {writeLong( fp, NOTES_VERSION_NUMBER );writeLong( fp, note_list.size() );for ( unsigned i = 0; i < note_list.size(); ++i )note_list[i].save(fp);}void load_notes( FILE* fp ) {if ( readLong(fp) != NOTES_VERSION_NUMBER )return;const long num_notes = readLong(fp);for ( long i = 0; i < num_notes; ++i ) {Note new_note;new_note.load(fp);note_list.push_back(new_note);}}void make_user_note() {mpr("Enter note: ", MSGCH_PROMPT);char buf[400];bool validline = !cancelable_get_line(buf, sizeof(buf));if ( !validline || (!*buf) )return;Note unote(NOTE_USER_NOTE);unote.name = std::string(buf);take_note(unote);}
char zip_buff[kFileNameLen];strcpy(zip_buff, name_buff);strcat(zip_buff, PACKAGE_SUFFIX);// Create save dir namestrcpy(char_fil, name_buff);strcat(char_fil, ".sav");handle = fopen(zip_buff, "rb+");
#ifdef LOAD_UNPACKAGE_CMDstd::string zipname = basename + PACKAGE_SUFFIX;handle = fopen(zipname.c_str(), "rb+");
else{#ifdef DO_ANTICHEAT_CHECKS// Simple security patch -- must have zip file otherwise invalidate// the character. Right now this just renames the .sav file to// .bak, allowing anyone with the appropriate permissions to// fix a character in the case of a bug. This could be changed// to unlinking the file(s) which would remove the character.strcat(name_buff, ".bak");rename(char_fil, name_buff);
if (coinflip())desc %= PDC_NCOLOURS;nature = PQUAL(desc);colour = PCOLOUR(desc);// nature and colour correspond to primary and secondary// in itemname.cc; this check ensures clear potions don't// get odd qualifiers.} while ((colour == PDC_CLEAR && nature > PDQ_VISCOUS)|| desc == PDESCS(PDC_CLEAR)|| desc == PDESCQ(PDQ_GLUGGY, PDC_WHITE));return (unsigned char) desc;}
// before we get into the inventory init, set light radius based// on species vision. currently, all species see out to 8 squares.
// before we get into the inventory init, set light radius based// on species vision. currently, all species see out to 8 squares.
static void choose_book( item_def& book, int firstbook, int numbooks ){int keyin = 0;clrscr();book.base_type = OBJ_BOOKS;book.quantity = 1;book.plus = 0;book.special = 1;book.colour = CYAN;// using the fact that CONJ_I and MINOR_MAGIC_I are both// fire books, CONJ_II and MINOR_MAGIC_II are both ice booksif ( Options.book && Options.book <= numbooks ){book.sub_type = firstbook + Options.book - 1;ng_book = Options.book;return;}if ( Options.prev_book > numbooks && Options.prev_book != SBT_RANDOM )Options.prev_book = SBT_NO_SELECTION;if ( !Options.random_pick ){textcolor( CYAN );cprintf(EOL " You have a choice of books:" EOL);textcolor( LIGHTGREY );for (int i=0; i < numbooks; ++i){char buf[ITEMNAME_SIZE];book.sub_type = firstbook + i;item_name( book, DESC_PLAIN, buf );cprintf("%c - %s" EOL, 'a' + i, buf);}textcolor(BROWN);cprintf(EOL "? - Random" );if ( Options.prev_book != SBT_NO_SELECTION ) {cprintf("; Enter - %s",Options.prev_book == SBT_FIRE ? "Fire" :Options.prev_book == SBT_COLD ? "Cold" :Options.prev_book == SBT_SUMM ? "Summoning" :Options.prev_book == SBT_RANDOM ? "Random" :"Buggy Book");}cprintf(EOL);do{textcolor( CYAN );cprintf(EOL "Which book? ");textcolor( LIGHTGREY );keyin = get_ch();} while (keyin != '?' &&((keyin != '\r' && keyin != '\n') ||Options.prev_book == SBT_NO_SELECTION ) &&(keyin < 'a' || keyin > ('a' + numbooks)));if ( keyin == '\r' || keyin == '\n' ){if ( Options.prev_book == SBT_RANDOM )keyin = '?';elsekeyin = ('a' + Options.prev_book - 1);}}if (Options.random_pick || Options.book == SBT_RANDOM || keyin == '?')ng_book = SBT_RANDOM;elseng_book = keyin - 'a' + 1;if ( Options.random_pick || keyin == '?' )keyin = random2(numbooks) + 'a';book.sub_type = firstbook + keyin - 'a';}
unsigned char i = 0; // loop variableyou.birth_time = time( NULL );you.real_time = 0;you.num_turns = 0;#ifdef WIZARDyou.wizard = (Options.wiz_mode == WIZ_YES) ? true : false;#elseyou.wizard = false;#endifyou.activity = ACT_NONE;you.berserk_penalty = 0;you.berserker = 0;you.conf = 0;you.confusing_touch = 0;you.deaths_door = 0;you.disease = 0;you.elapsed_time = 0;you.exhausted = 0;you.haste = 0;you.invis = 0;you.levitation = 0;you.might = 0;you.paralysis = 0;you.poison = 0;you.rotting = 0;you.fire_shield = 0;you.slow = 0;you.special_wield = SPWLD_NONE;you.sure_blade = 0;you.synch_time = 0;you.base_hp = 5000;you.base_hp2 = 5000;you.base_magic_points = 5000;you.base_magic_points2 = 5000;you.magic_points_regeneration = 0;you.strength = 0;you.max_strength = 0;you.intel = 0;you.max_intel = 0;you.dex = 0;you.max_dex = 0;you.experience = 0;you.experience_level = 1;you.max_level = 1;you.char_class = JOB_UNKNOWN;you.hunger = 6000;you.hunger_state = HS_SATIATED;you.gold = 0;// you.speed = 10; // 0.75; // unusedyou.burden = 0;you.burden_state = BS_UNENCUMBERED;you.spell_no = 0;you.your_level = 0;you.level_type = LEVEL_DUNGEON;you.where_are_you = BRANCH_MAIN_DUNGEON;you.char_direction = DIR_DESCENDING;you.prev_targ = MHITNOT;you.pet_target = MHITNOT;you.x_pos = 0;you.y_pos = 0;you.running = 0;you.run_x = 0;you.run_y = 0;you.travel_x = 0;you.travel_y = 0;for (i = 0; i < 3; i++){you.run_check[i].grid = 0;you.run_check[i].dx = 0;you.run_check[i].dy = 0;}you.religion = GOD_NO_GOD;you.piety = 0;you.gift_timeout = 0;for (i = 0; i < MAX_NUM_GODS; i++){you.penance[i] = 0;you.worshipped[i] = 0;}ghost.name[0] = '\0';for (i = 0; i < NUM_GHOST_VALUES; i++)ghost.values[i] = 0;for (i = EQ_WEAPON; i < NUM_EQUIP; i++)you.equip[i] = -1;for (i = 0; i < 25; i++)you.spells[i] = SPELL_NO_SPELL;for (i = 0; i < 52; i++){you.spell_letter_table[i] = -1;you.ability_letter_table[i] = ABIL_NON_ABILITY;}for (i = 0; i < 100; i++)you.mutation[i] = 0;for (i = 0; i < 100; i++)you.demon_pow[i] = 0;for (i = 0; i < 50; i++)you.had_book[i] = 0;for (i = 0; i < 50; i++)you.unique_items[i] = UNIQ_NOT_EXISTS;for (i = 0; i < NO_UNRANDARTS; i++)set_unrandart_exist(i, 0);for (i = 0; i < 50; i++){you.skills[i] = 0;you.skill_points[i] = 0;you.skill_order[i] = MAX_SKILL_ORDER;you.practise_skill[i] = 1;}you.skill_cost_level = 1;you.total_skill_points = 0;for (i = 0; i < 30; i++)you.attribute[i] = 0;for (i = 0; i < ENDOFPACK; i++){you.inv[i].quantity = 0;you.inv[i].base_type = OBJ_WEAPONS;you.inv[i].sub_type = WPN_CLUB;you.inv[i].plus = 0;you.inv[i].plus2 = 0;you.inv[i].special = 0;you.inv[i].colour = 0;set_ident_flags( you.inv[i], ISFLAG_IDENT_MASK );you.inv[i].x = -1;you.inv[i].y = -1;you.inv[i].link = i;}for (i = 0; i < NUM_DURATIONS; i++)you.duration[i] = 0;
you.init();
/* **********************************************// this does not work just yet ... {dlb}:cprintf(EOL "Hello, ");if ( you.your_name[0] != '\0' ){cprintf(you.your_name); // better be less than 31 characters :P {dlb}// of course, invalid names will appear {dlb}cprintf(", ");}********************************************** */
cprintf(EOL "Please consult crawl.txt for instructions and legal details."EOL);
cprintf(EOL"Please consult crawl_manual.txt for instructions and legal details."EOL);bool init_found = init_file_location.find("not found") == std::string::npos;if (!init_found)textcolor( LIGHTRED );elsetextcolor( LIGHTGREY );cprintf("Init file %s%s" EOL,init_found? "read: " : "",init_file_location.c_str());
static void show_name_prompt(int where, bool blankOK,const std::vector<player> &existing_chars,slider_menu &menu){gotoxy(1, where);textcolor( CYAN );if (blankOK){if (Options.prev_name.length() && Options.remember_name)cprintf(EOL "Press <Enter> for \"%s\"." EOL,Options.prev_name.c_str());elsecprintf(EOL"Press <Enter> to answer this after race and ""class are chosen." EOL);}
void enterPlayerName(bool blankOK)
if (!existing_chars.empty()){const int name_x = wherex(), name_y = wherey();menu.set_limits(name_y + 3, get_number_of_lines());menu.display();gotoxy(name_x, name_y);}textcolor( LIGHTGREY );}static void preprocess_character_name(char *name, bool blankOK){if (!*name && blankOK && Options.prev_name.length() &&Options.remember_name){strncpy(name, Options.prev_name.c_str(), kNameLen);name[kNameLen - 1] = 0;}// '.', '?' and '*' are blanked.if (!name[1] && (*name == '.' ||*name == '*' ||*name == '?'))*name = 0;}static bool is_good_name(char *name, bool blankOK){preprocess_character_name(name, blankOK);// verification begins here {dlb}:if (you.your_name[0] == 0){if (blankOK)return (true);cprintf(EOL "That's a silly name!" EOL);return (false);}// if MULTIUSER is defined, userid will be tacked onto the end// of each character's files, making bones a valid player name.#ifndef MULTIUSER// this would cause big probs with ghosts// what would? {dlb}// ... having the name "bones" of course! The problem comes from// the fact that bones files would have the exact same filename// as level files for a character named "bones". -- bwrif (stricmp(you.your_name, "bones") == 0){cprintf(EOL "That's a silly name!" EOL);return (false);}#endifreturn (verifyPlayerName());}static int newname_keyfilter(int &ch)
// temporary 'til copyover to you.your_name {dlb}// made this rediculously long so that the game doesn't// crash if a really really long name is entered (argh). {gdl}char name_entered[200];
if (ch == CK_DOWN || ch == CK_PGDN || ch == '\t')return -1;return 1;}
// anything to avoid goto statements {dlb}bool acceptable_name = false;bool first_time = true;
static bool read_player_name(char *name,int len,const std::vector<player> &existing,slider_menu &menu){const int name_x = wherex(), name_y = wherey();int (*keyfilter)(int &) = newname_keyfilter;if (existing.empty())keyfilter = NULL;
// prompt for a new name if current one unsatisfactory {dlb}:if (!acceptable_name)
gotoxy(name_x, name_y);if (name_x <= 80)cprintf("%-*s", 80 - name_x + 1, "");gotoxy(name_x, name_y);int ret = reader.read_line(false);if (!ret)return (true);if (ret == CK_ESCAPE)return (false);if (ret != CK_ESCAPE && existing.size())
if (Options.prev_name.length() && Options.remember_name)cprintf(EOL "Press <Enter> for \"%s\"." EOL,Options.prev_name.c_str());elsecprintf(EOL"Press <Enter> to answer this after race and ""class are chosen." EOL);
const player &p = *static_cast<player*>( sel->data );strncpy(name, p.your_name, kNameLen);name[kNameLen - 1] = 0;return (true);
cprintf(EOL "What is your name today? ");textcolor( LIGHTGREY );get_input_line( name_entered, sizeof( name_entered ) );strncpy( you.your_name, name_entered, kNameLen );you.your_name[ kNameLen - 1 ] = '\0';}
void enterPlayerName(bool blankOK){int prompt_start = wherey();bool ask_name = true;char *name = you.your_name;std::vector<player> existing_chars;slider_menu char_menu;
if (!*you.your_name && blankOK && Options.prev_name.length() &&Options.remember_name){strncpy(you.your_name, Options.prev_name.c_str(), kNameLen);you.your_name[kNameLen - 1] = 0;}
if (you.your_name[0] != 0)ask_name = false;if (blankOK){existing_chars = find_saved_characters();
// '.', '?' and '*' are blanked.if (!you.your_name[1] && (*you.your_name == '.' ||*you.your_name == '*' ||*you.your_name == '?'))
MenuEntry *title = new MenuEntry("Or choose an existing character:");title->colour = LIGHTCYAN;char_menu.set_title( title );for (int i = 0, size = existing_chars.size(); i < size; ++i)
*you.your_name = 0;}// verification begins here {dlb}:if (you.your_name[0] == '\0'){if (blankOK)return;
std::string desc = " " + existing_chars[i].short_desc();if ((int) desc.length() >= get_number_of_cols())desc = desc.substr(0, get_number_of_cols() - 1);
// if SAVE_DIR_PATH is defined, userid will be tacked onto the end// of each character's files, making bones a valid player name.#ifndef SAVE_DIR_PATH// this would cause big probs with ghosts// what would? {dlb}// ... having the name "bones" of course! The problem comes from// the fact that bones files would have the exact same filename// as level files for a character named "bones". -- bwrelse if (stricmp(you.your_name, "bones") == 0)
do{// prompt for a new name if current one unsatisfactory {dlb}:if (ask_name)
int wpn_skill = SK_FIGHTING; // prefered weapon typeint wpn_skill_size = 0; // level of skill in prefered weapon typeint num_wpn_skills = 0; // used to choose prefered weapon
int wpn_skill = SK_FIGHTING; // preferred weapon typeint wpn_skill_size = 0; // level of skill in preferred weapon typeint num_wpn_skills = 0; // used to choose preferred weapon
you.inv[2].base_type = OBJ_BOOKS;you.inv[2].sub_type = BOOK_MINOR_MAGIC_I + random2(3);you.inv[2].quantity = 1;you.inv[2].plus = 0; // = 127you.inv[2].special = 1;you.inv[2].colour = CYAN;
choose_book( you.inv[2], BOOK_MINOR_MAGIC_I, 3 );
you.inv[2].base_type = OBJ_BOOKS;you.inv[2].sub_type = give_first_conjuration_book();you.inv[2].plus = 0;
if ( you.char_class == JOB_CONJURER )choose_book( you.inv[2], BOOK_CONJURATIONS_I, 2 );else{you.inv[2].base_type = OBJ_BOOKS;// subtype will always be overriddenyou.inv[2].plus = 0;}
case SP_SPRIGGAN:cprintf("You can see invisible." EOL);cprintf("You cover the ground extremely quickly." EOL);j += 2;break;case SP_CENTAUR:if (!you.mutation[MUT_FAST])cprintf("You cover the ground quickly." EOL);elsecprintf("You cover the ground extremely quickly." EOL);j++;break;
j++;
switch ( you.mutation[MUT_CLAWS] ) {case 0:cprintf("You have claws for hands." EOL);break;case 1:cprintf("You have sharp claws for hands." EOL);break;case 2:cprintf("You have very sharp claws for hands." EOL);break;case 3:// literally truecprintf("Your claws are sharper than steel." EOL);break;default:break;}j += 2;
if (you.equip[EQ_HELMET] != -1&& you.inv[you.equip[EQ_HELMET]].plus2 > 1)
if (you.equip[EQ_HELMET] != -1 &&(get_helmet_type(you.inv[you.equip[EQ_HELMET]]) == THELM_CAP ||get_helmet_type(you.inv[you.equip[EQ_HELMET]]) == THELM_WIZARD_HAT))
case MS_SUMMON_MUSHROOMS: // Summon swarms of icky crawling fungi.if (!mons_friendly(monster) && monsterNearby&& monster_abjuration(1, true) > 0 && coinflip()){monster_abjuration( monster->hit_dice * 10, false );return;}sumcount2 = 1 + random2(2) + random2( monster->hit_dice / 4 + 1 );duration = ENCH_ABJ_II + monster->hit_dice / 5;if (duration > ENCH_ABJ_VI)duration = ENCH_ABJ_VI;for (int i = 0; i < sumcount2; ++i)create_monster(MONS_WANDERING_MUSHROOM, duration,SAME_ATTITUDE(monster),monster->x, monster->y,monster->foe,250);return;
// Journey -- Added in Summon Lizards and Draconiancase MS_SUMMON_LIZARDS:if (!mons_friendly( monster ) && !monsterNearby &&monster_abjuration( 1, true ) > 0 && coinflip()){monster_abjuration( monster->hit_dice * 10, false );return;}sumcount2 = 1 + random2(3) + random2( monster->hit_dice / 5 + 1 );duration = ENCH_ABJ_II + monster->hit_dice / 10;if (duration > ENCH_ABJ_VI)duration = ENCH_ABJ_VI;for (sumcount = 0; sumcount < sumcount2; sumcount++){create_monster( rand_dragon( DRAGON_LIZARD ), duration,SAME_ATTITUDE(monster),monster->x, monster->y, monster->foe, 250 );}break;
pbolt.thrower = theBeam.thrown;pbolt.aux_source = NULL;strcpy( pbolt.beam_name, theBeam.name.c_str() );pbolt.isBeam = theBeam.isBeam;
pbolt.thrower = theBeam.thrower;pbolt.aux_source.clear();pbolt.name = theBeam.name;pbolt.is_beam = theBeam.is_beam;
monster->number = get_mimic_colour( monster );
monster->colour = get_mimic_colour( monster );}if (!silent){if (was_seen)simple_monster_message(monster, " reappears nearby!");elsesimple_monster_message(monster, " appears out of thin air!");
pbolt.aux_source = "blast of cold";
pbolt.aux_source = "blast of icy breath";break;case MONS_RED_DRACONIAN:pbolt.name += "'s searing breath";#ifdef DEBUG_DIAGNOSTICSmprf( MSGCH_DIAGNOSTICS, "bolt name: '%s'", pbolt.name.c_str() );#endifpbolt.flavour = BEAM_FIRE;pbolt.colour = RED;pbolt.aux_source = "blast of searing breath";scaling = 65;
// now, if a monster is, for some reason, throwing something really// stupid, it will have baseHit of 0 and damage of 0. Ah well.
// now, if a monster is, for some reason, throwing something really// stupid, it will have baseHit of 0 and damage of 0. Ah well.
beam.hit = 7 + random2(power) / 80;beam.isBeam = true;
beam.hit = 8 + power / 20;beam.is_beam = true;break;case MS_POISON_ARROW:beam.name = "poison arrow";beam.damage = dice_def( 4, 5 + power / 12 );beam.colour = LIGHTGREEN;beam.type = SYM_MISSILE;beam.thrower = KILL_MON;beam.flavour = BEAM_POISON_ARROW;beam.hit = 14 + power / 25;beam.range = beam.rangeMax = 8;
case MS_MIASMA: // death drakebeam.name = "foul vapour";beam.damage = dice_def( 3, 5 + power / 24 );beam.colour = DARKGREY;beam.type = SYM_ZAP;beam.thrower = KILL_MON;beam.flavour = BEAM_MIASMA;beam.hit = 12 + power / 20;beam.is_beam = true;beam.is_big_cloud = true;beam.range = beam.rangeMax = 8;break;
beam.thrown = KILL_MON_MISSILE;beam.isBeam = true;
beam.thrower = KILL_MON_MISSILE;beam.is_beam = true;break;case MS_BLINK_OTHER:beam.name = "0";beam.type = 0;beam.flavour = BEAM_BLINK;beam.thrower = KILL_MON;beam.is_beam = true;beam.is_enchant = true;beam.range = 8;beam.rangeMax = 8;
bool silver_statue_effects(monsters *mons){if ((mons_player_visible(mons) || one_chance_in(3))&& !one_chance_in(3)){char wc[30];weird_colours( random2(256), wc );snprintf(info, INFO_SIZE, "'s eyes glow %s.", wc);simple_monster_message(mons, info, MSGCH_WARN);create_monster( summon_any_demon((coinflip() ? DEMON_COMMON: DEMON_LESSER)),ENCH_ABJ_V, BEH_HOSTILE,you.x_pos, you.y_pos,MHITYOU, 250 );return (true);}return (false);}bool orange_statue_effects(monsters *mons){if ((mons_player_visible(mons) || one_chance_in(3))&& !one_chance_in(3)){mpr("A hostile presence attacks your mind!", MSGCH_WARN);miscast_effect( SPTYP_DIVINATION, random2(15), random2(150), 100,"an orange crystal statue" );return (true);}return (false);}
if (mons_holiness(monster->type) == MH_UNDEAD)done_good(GOOD_KILLED_UNDEAD, monster->hit_dice);if (mons_holiness(monster->type) == MH_DEMONIC)done_good(GOOD_KILLED_DEMON, monster->hit_dice);
if (mons_holiness(monster) == MH_UNDEAD)did_god_conduct(DID_DEDICATED_KILL_UNDEAD,monster->hit_dice);
if (mons_flag(monster->type, M_PRIEST))done_good(GOOD_KILLED_PRIEST, monster->hit_dice);}else if (mons_holiness(monster->type) == MH_HOLY){done_good(GOOD_KILLED_ANGEL_I, monster->hit_dice);
if (mons_class_flag(monster->type, M_PRIEST))did_god_conduct(DID_DEDICATED_KILL_PRIEST,monster->hit_dice);
if (mons_holiness(monster->type) == MH_NATURAL)done_good(GOOD_SLAVES_KILL_LIVING, monster->hit_dice);elsedone_good(GOOD_SERVANTS_KILL, monster->hit_dice);
if (targ_holy == MH_NATURAL)notice |=did_god_conduct(DID_LIVING_KILLED_BY_UNDEAD_SLAVE,monster->hit_dice);
done_good(GOOD_SERVANTS_KILL, monster->hit_dice);
// Yes, we are splitting undead pets from the others// as a way to focus Necomancy vs Summoning (ignoring// Summon Wraith here)... at least we're being nice and// putting the natural creature Summons together with// the Demon ones. Note that Vehumet gets a free// pass here since those followers are assumed to// come from Summoning spells... the others are// from invocations (Zin, TSO, Makh, Kiku). -- bwr
/* Vehumet - only for non-undead servants (codingconvenience, no real reason except that Vehumetprefers demons) */if (you.magic_points < you.max_magic_points)
notice |= did_god_conduct( DID_LIVING_KILLED_BY_SERVANT,monster->hit_dice );if (mons_class_flag( monster->type, M_EVIL ))
else if (targ_holy == MH_DEMONIC){notice |= did_god_conduct( DID_DEMON_KILLED_BY_SERVANT,monster->hit_dice );}else if (targ_holy == MH_UNDEAD){notice |= did_god_conduct( DID_UNDEAD_KILLED_BY_SERVANT,monster->hit_dice );}}// Angel kills are always noticed.if (targ_holy == MH_HOLY){notice |= did_god_conduct( DID_ANGEL_KILLED_BY_SERVANT,monster->hit_dice );}if (you.religion == GOD_VEHUMET&& notice&& (!player_under_penance() && random2(you.piety) >= 30)){/* Vehumet - only for non-undead servants (codingconvenience, no real reason except that Vehumetprefers demons) */if (you.magic_points < you.max_magic_points){mpr("You feel your power returning.");inc_mp( 1 + random2(monster->hit_dice / 2), false );}
if ( MONST_INTERESTING(monster) ||// XXX yucky hackmonster->type == MONS_PLAYER_GHOST ||monster->type == MONS_PANDEMONIUM_DEMON ) {/* make a note of it */char namebuf[ITEMNAME_SIZE];if ( monster->type == MONS_PLAYER_GHOST ) {snprintf( namebuf, sizeof(namebuf), "the ghost of %s",ghost.name );}else if ( monster->type == MONS_PANDEMONIUM_DEMON ) {strncpy( namebuf, ghost.name, sizeof(namebuf) );}elsemoname(monster->type, true, DESC_NOCAP_A, namebuf);take_note(Note(NOTE_KILL_MONSTER, monster->type, 0, namebuf));}
if (mons_holiness( new_mclass ) != mons_holiness( monster->type )|| mons_flag( new_mclass, M_NO_EXP_GAIN ) // not helpless|| new_mclass == mons_charclass( monster->type ) // must be different
if (mons_class_holiness( new_mclass ) != mons_holiness( monster )|| mons_class_flag( new_mclass, M_NO_EXP_GAIN ) // not helpless|| new_mclass == mons_species( monster->type ) // must be different
}/* Not fair to instakill a monster like this --order of evaluation of inner conditional important */if (current_tile == DNGN_LAVA || current_tile == DNGN_DEEP_WATER){if (!mons_class_flies(new_mclass)|| monster_habitat(new_mclass) != current_tile){return (false);}
// not fair to strand a water monster on dry land, either. :)if (monster_habitat(new_mclass) == DNGN_DEEP_WATER&& current_tile != DNGN_DEEP_WATER&& current_tile != DNGN_SHALLOW_WATER){return (false);}// and putting lava monsters on non-lava sqaures is a no-no, tooif (monster_habitat(new_mclass) == DNGN_LAVA && current_tile != DNGN_LAVA)return (false);return (true);
// Determine if the monster is happy on current tilereturn (monster_habitable_grid(new_mclass, current_tile));
// valid targets are always base classestargetc = mons_charclass( targetc );
// valid targets are always base classes ([ds] which is unfortunate// in that well-populated monster classes will dominate polymorphs)targetc = mons_species( targetc );
// If old monster is visible to the player, and is interesting,// then note why the interesting monster went away.if (player_monster_visible(monster) && mons_near(monster)&& MONST_INTERESTING(monster)) {char namebuf[ITEMNAME_SIZE];moname(monster->type, true, DESC_NOCAP_A, namebuf);take_note(Note(NOTE_POLY_MONSTER, monster->type, 0, namebuf));}
bool ret = false;const int habitat = monster_habitat( monster->type );if (mons_flies( monster )){// flying monsters don't careret = true;}else if (mons_flag( monster->type, M_AMPHIBIOUS )&& (targ == DNGN_DEEP_WATER || targ == DNGN_SHALLOW_WATER)){// Amphibious creatures are "land" by default in mon-data,// we allow them to swim here. -- bwrret = true;}else if (monster->type == MONS_WATER_ELEMENTAL && targ >= DNGN_DEEP_WATER){// water elementals can crawl out over the landret = true;}else if (habitat == DNGN_FLOOR&& (targ >= DNGN_FLOOR || targ == DNGN_SHALLOW_WATER)){// FLOOR habitat monster going to a non-bad placeret = true;}else if (habitat == DNGN_DEEP_WATER&& (targ == DNGN_DEEP_WATER || targ == DNGN_SHALLOW_WATER)){// Water monster to waterret = true;}else if (habitat == DNGN_LAVA && targ == DNGN_LAVA){// Lava monster to lavaret = true;}return (ret);
return (monster_habitable_grid(monster, targ));
// immobility logic stolen from later on in handle_monster().. argh! --gdlbool isMobile = !(mon->type == MONS_OKLOB_PLANT|| mon->type == MONS_CURSE_SKULL|| (mon->type >= MONS_CURSE_TOE&& mon->type <= MONS_POTION_MIMIC));
bool isMobile = !mons_is_stationary(mon);
&& mons_holiness(monster->type) != MH_UNDEAD&& mons_holiness(monster->type) != MH_NONLIVING&& mons_holiness(monster->type) != MH_PLANT)
&& mons_holiness(monster) != MH_UNDEAD&& mons_holiness(monster) != MH_NONLIVING&& mons_holiness(monster) != MH_PLANT)
if (mons_genus( monster->type ) == MONS_DRACONIAN){switch (draco_subspecies( monster )){case MONS_BLACK_DRACONIAN:draco_breath = MS_LIGHTNING_BOLT;break;case MONS_PALE_DRACONIAN:draco_breath = MS_STEAM_BALL;break;case MONS_GREEN_DRACONIAN:draco_breath = MS_POISON_BLAST;break;case MONS_PURPLE_DRACONIAN:draco_breath = MS_ORB_ENERGY;break;case MONS_MOTTLED_DRACONIAN:draco_breath = MS_STICKY_FLAME;break;case MONS_DRACONIAN:case MONS_YELLOW_DRACONIAN: // already handled as abilitycase MONS_RED_DRACONIAN: // already handled as abilitycase MONS_WHITE_DRACONIAN: // already handled as abilitydefault:break;}if (draco_breath != MS_NO_SPELL){// [ds] Check line-of-fire here. It won't happen elsewhere.bolt beem;setup_mons_cast(monster, beem, draco_breath);fire_tracer(monster, beem);if (!mons_should_fire(beem))draco_breath = MS_NO_SPELL;}}return (draco_breath);}static bool is_emergency_spell(const monster_spells &msp, int spell){// If the emergency spell appears early, it's probably not a dedicated// escape spell.for (int i = 0; i < 5; ++i)if (msp[i] == spell)return (false);return (msp[5] == spell);}
int hspell_pass[6] = { MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL,MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL };int msecc = ((monster->type == MONS_HELLION) ? MST_BURNING_DEVIL :(monster->type == MONS_PANDEMONIUM_DEMON) ? MST_GHOST: monster->number);mons_spell_list( msecc, hspell_pass );
monster_spells hspell_pass = monster->spells;
}// If there's otherwise no ranged attack use the breath weapon.// The breath weapon is also occasionally used.if (draco_breath != MS_NO_SPELL&& (spell_cast == MS_NO_SPELL|| (!is_emergency_spell(hspell_pass, spell_cast)&& one_chance_in(4)))){spell_cast = draco_breath;finalAnswer = true;
//---------------------------------------------------------------//// handle_monsters//// This is the routine that controls monster AI.////---------------------------------------------------------------void handle_monsters(void)
static void handle_monster_move(int i, monsters *monster)
if (you.slow > 0){monster->speed_increment += (monster->speed * you.time_taken) / 10;}
if (monster->type == MONS_GLOWING_SHAPESHIFTER)mons_add_ench( monster, ENCH_GLOWING_SHAPESHIFTER );// otherwise there are potential problems with summoningsif (monster->type == MONS_SHAPESHIFTER)mons_add_ench( monster, ENCH_SHAPESHIFTER );// We reset batty monsters from wander to seek here, instead// of in handle_behaviour() since that will be called with// every single movement, and we want these monsters to// hit and run. -- bwrif (monster->foe != MHITNOT&& monster->behaviour == BEH_WANDER&& testbits( monster->flags, MF_BATTY )){monster->behaviour = BEH_SEEK;}
// Handle enchantments and clouds on nonmoving monsters:if (monster->speed == 0){if (env.cgrid[monster->x][monster->y] != EMPTY_CLOUD&& !mons_has_ench( monster, ENCH_SUBMERGED )){mons_in_cloud( monster );}
while (monster->speed_increment >= 80){ // The continues & breaks are WRT this.if (monster->type != -1 && monster->hit_points < 1)break;
// memory is decremented here for a reason -- we only want it// decrementing once per monster "move"if (monster->foe_memory > 0)monster->foe_memory--;
if (env.cgrid[monster->x][monster->y] != EMPTY_CLOUD){if (mons_has_ench( monster, ENCH_SUBMERGED ))break;
// We reset batty monsters from wander to seek here, instead// of in handle_behaviour() since that will be called with// every single movement, and we want these monsters to// hit and run. -- bwrif (monster->foe != MHITNOT&& monster->behaviour == BEH_WANDER&& testbits( monster->flags, MF_BATTY ))
if (monster->type == -1)
if (env.cgrid[monster->x][monster->y] != EMPTY_CLOUD){if (mons_has_ench( monster, ENCH_SUBMERGED ))break;
// submerging monsters will hide from cloudsif (monster_can_submerge(monster->type, grd[monster->x][monster->y])&& env.cgrid[monster->x][monster->y] != EMPTY_CLOUD){mons_add_ench( monster, ENCH_SUBMERGED );}
mons_in_cloud(monster);
|| (monster->type == MONS_FIRE_ELEMENTAL&& (grd[monster->x][monster->y] == DNGN_LAVA|| env.cgrid[monster->x][monster->y] == CLOUD_FIRE|| env.cgrid[monster->x][monster->y] == CLOUD_FIRE_MON))|| (monster->type == MONS_WATER_ELEMENTAL&& (grd[monster->x][monster->y] == DNGN_SHALLOW_WATER|| grd[monster->x][monster->y] == DNGN_DEEP_WATER))
// submerging monsters will hide from cloudsconst int habitat = monster_habitat( monster->type );if (habitat != DNGN_FLOOR&& habitat == grd[monster->x][monster->y]&& env.cgrid[monster->x][monster->y] != EMPTY_CLOUD){mons_add_ench( monster, ENCH_SUBMERGED );}
if (monster->type == MONS_ZOMBIE_SMALL|| monster->type == MONS_ZOMBIE_LARGE|| monster->type == MONS_SIMULACRUM_SMALL|| monster->type == MONS_SIMULACRUM_LARGE|| monster->type == MONS_SKELETON_SMALL|| monster->type == MONS_SKELETON_LARGE){monster->max_hit_points = monster->hit_points;}
// regenerate:if (monster_descriptor(monster->type, MDSC_REGENERATES)
if (igrd[monster->x][monster->y] != NON_ITEM&& (mons_itemuse(monster->type) == MONUSE_WEAPONS_ARMOUR|| mons_itemuse(monster->type) == MONUSE_EATS_ITEMS|| monster->type == MONS_NECROPHAGE|| monster->type == MONS_GHOUL)){if (handle_pickup(monster))continue;}
|| (monster->type == MONS_FIRE_ELEMENTAL&& (grd[monster->x][monster->y] == DNGN_LAVA|| env.cgrid[monster->x][monster->y] == CLOUD_FIRE|| env.cgrid[monster->x][monster->y] == CLOUD_FIRE_MON))
// calculates mmov_x, mmov_y based on monster target.handle_movement(monster);
|| (monster->type == MONS_AIR_ELEMENTAL&& env.cgrid[monster->x][monster->y] == EMPTY_CLOUD&& one_chance_in(3))
if (mons_has_ench( monster, ENCH_CONFUSION )|| (monster->type == MONS_AIR_ELEMENTAL&& mons_has_ench( monster, ENCH_SUBMERGED ))){mmov_x = random2(3) - 1;mmov_y = random2(3) - 1;
if (monster->type == MONS_ZOMBIE_SMALL|| monster->type == MONS_ZOMBIE_LARGE|| monster->type == MONS_SIMULACRUM_SMALL|| monster->type == MONS_SIMULACRUM_LARGE|| monster->type == MONS_SKELETON_SMALL|| monster->type == MONS_SKELETON_LARGE){monster->max_hit_points = monster->hit_points;}
if (mgrd[monster->x + mmov_x][monster->y + mmov_y] != NON_MONSTER&& (mmov_x != 0 || mmov_y != 0)){mmov_x = 0;mmov_y = 0;
if (igrd[monster->x][monster->y] != NON_ITEM&& (mons_itemuse(monster->type) == MONUSE_WEAPONS_ARMOUR|| mons_itemuse(monster->type) == MONUSE_EATS_ITEMS|| monster->type == MONS_NECROPHAGE|| monster->type == MONS_GHOUL))
if (monsters_fight(i, mgrd[monster->x + mmov_x][monster->y + mmov_y]))
if (mons_has_ench( monster, ENCH_CONFUSION )|| (monster->type == MONS_AIR_ELEMENTAL&& mons_has_ench( monster, ENCH_SUBMERGED ))){mmov_x = random2(3) - 1;mmov_y = random2(3) - 1;
beem.target_x = monster->target_x;beem.target_y = monster->target_y;
// bounds check: don't let confused monsters try to run// off the mapif (monster->target_x + mmov_x < 0|| monster->target_x + mmov_x >= GXM){mmov_x = 0;}
if (monster->behaviour != BEH_SLEEP&& monster->behaviour != BEH_WANDER){// prevents unfriendlies from nuking you from offscreen.// How nice!if (mons_friendly(monster) || mons_near(monster)){if (handle_special_ability(monster, beem))continue;
if (monsters_fight(i, mgrd[monster->x + mmov_x][monster->y + mmov_y])){brkk = true;}}
// shapeshifters don't get spellsif (!mons_has_ench( monster, ENCH_GLOWING_SHAPESHIFTER,ENCH_SHAPESHIFTER )|| !mons_class_flag( monster->type, M_ACTUAL_SPELLS )){if (handle_spell(monster, beem))continue;
if (monster->behaviour != BEH_SLEEP&& monster->behaviour != BEH_WANDER)
// see if we move into (and fight) an unfriendly monsterint targmon = mgrd[monster->x + mmov_x][monster->y + mmov_y];if (targmon != NON_MONSTER&& targmon != i&& !mons_aligned(i, targmon)){// figure out if they fightif (monsters_fight(i, targmon)){if (testbits(monster->flags, MF_BATTY))
// prevents unfriendlies from nuking you from offscreen.// How nice!if (mons_friendly(monster) || mons_near(monster)){if (handle_special_ability(monster, beem))continue;if (handle_potion(monster, beem))continue;if (handle_scroll(monster))continue;
monster->behaviour = BEH_WANDER;monster->target_x = 10 + random2(GXM - 10);monster->target_y = 10 + random2(GYM - 10);// monster->speed_increment -= monster->speed;}
// shapeshifters don't get spellsif (!mons_has_ench( monster, ENCH_GLOWING_SHAPESHIFTER,ENCH_SHAPESHIFTER )|| !mons_flag( monster->type, M_ACTUAL_SPELLS )){if (handle_spell(monster, beem))continue;}
mmov_x = 0;mmov_y = 0;brkk = true;}}
// figure out if they fightif (monsters_fight(i, targmon)){if (testbits(monster->flags, MF_BATTY)){monster->behaviour = BEH_WANDER;monster->target_x = 10 + random2(GXM - 10);monster->target_y = 10 + random2(GYM - 10);// monster->speed_increment -= monster->speed;}mmov_x = 0;mmov_y = 0;brkk = true;}
monster->behaviour = BEH_WANDER;monster->target_x = 10 + random2(GXM - 10);monster->target_y = 10 + random2(GYM - 10);
if (monster->x + mmov_x == you.x_pos&& monster->y + mmov_y == you.y_pos){bool isFriendly = mons_friendly(monster);bool attacked = false;
// detach monster from the grid first, so it// doesn't get hit by its own explosion (GDL)mgrd[monster->x][monster->y] = NON_MONSTER;
spore_goes_pop(monster);monster_cleanup(monster);continue;}
// reevaluate behaviour, since the monster's// surroundings have changed (it may have moved,// or died for that matter. Don't bother for// dead monsters. :)if (monster->type != -1)handle_behaviour(monster);
if (monster->type == -1 || monster->type == MONS_OKLOB_PLANT|| monster->type == MONS_CURSE_SKULL|| (monster->type >= MONS_CURSE_TOE&& monster->type <= MONS_POTION_MIMIC)){continue;}
if (monster->type != -1 && monster->hit_points < 1){if (monster->type == MONS_GIANT_SPORE|| monster->type == MONS_BALL_LIGHTNING){// detach monster from the grid first, so it// doesn't get hit by its own explosion (GDL)mgrd[monster->x][monster->y] = NON_MONSTER;
// reevaluate behaviour, since the monster's// surroundings have changed (it may have moved,// or died for that matter. Don't bother for// dead monsters. :)if (monster->type != -1)handle_behaviour(monster);
//---------------------------------------------------------------//// handle_monsters//// This is the routine that controls monster AI.////---------------------------------------------------------------void handle_monsters(void){// Keep track of monsters that have already moved and don't allow// them to move again.memset(immobile_monster, 0, sizeof immobile_monster);
if (monster->type != -1 && monster->hit_points < 1){if (monster->type == MONS_GIANT_SPORE|| monster->type == MONS_BALL_LIGHTNING){// detach monster from the grid first, so it// doesn't get hit by its own explosion (GDL)mgrd[monster->x][monster->y] = NON_MONSTER;
if (monster->type == -1 || immobile_monster[i])continue;
spore_goes_pop( monster );monster_cleanup( monster );continue;}else{monster_die( monster, KILL_MISC, 0 );}}} // end of if (mons_class != -1)
const int mx = monster->x,my = monster->y;handle_monster_move(i, monster);if (!invalid_monster(monster)&& (monster->x != mx || monster->y != my))immobile_monster[i] = true;
static void jelly_grows(monsters *monster){if (!silenced(you.x_pos, you.y_pos)&& !silenced(monster->x, monster->y)){strcpy(info, "You hear a");if (!mons_near(monster))strcat(info, " distant");strcat(info, " slurping noise.");mpr(info, MSGCH_SOUND);}monster->hit_points += 5;// note here, that this makes jellies "grow" {dlb}:if (monster->hit_points > monster->max_hit_points)monster->max_hit_points = monster->hit_points;if (mons_class_flag( monster->type, M_SPLITS )){// and here is where the jelly might divide {dlb}const int reqd = (monster->hit_dice < 6) ? 50: monster->hit_dice * 8;if (monster->hit_points >= reqd)jelly_divide(monster);}}static bool mons_can_displace(const monsters *mpusher, const monsters *mpushee){if (invalid_monster(mpusher) || invalid_monster(mpushee))return (false);const int ipushee = monster_index(mpushee);if (ipushee < 0 || ipushee >= MAX_MONSTERS)return (false);if (immobile_monster[ipushee])return (false);// Confused monsters can't be pushed past, sleeping monsters// can't push. Note that sleeping monsters can't be pushed// past, either, but they may be woken up by a crowd trying to// elbow past them, and the wake-up check happens downstream.if (mons_is_confused(mpusher) || mons_is_confused(mpushee)|| mons_is_paralysed(mpusher) || mons_is_paralysed(mpushee)|| mons_is_sleeping(mpusher))return (false);// Batty monsters are unpushableif (mons_is_batty(mpusher) || mons_is_batty(mpushee))return (false);if (!monster_shover(mpusher))return (false);if (!monster_senior(mpusher, mpushee))return (false);return (true);}static bool monster_swaps_places( monsters *mon, int mx, int my ){if (!mx && !my)return (false);int targmon = mgrd[mon->x + mx][mon->y + my];if (targmon == MHITNOT || targmon == MHITYOU)return (false);
monsters *m2 = &menv[targmon];if (!mons_can_displace(mon, m2))return (false);if (mons_is_sleeping(m2)){if (one_chance_in(2)){#ifdef DEBUG_DIAGNOSTICSchar mname[ITEMNAME_SIZE];moname(m2->type, true, DESC_PLAIN, mname);mprf(MSGCH_DIAGNOSTICS,"Alerting monster %s at (%d,%d)", mname, m2->x, m2->y);#endifbehaviour_event( m2, ME_ALERT, MHITNOT );}return (false);}// Check that both monsters will be happy at their proposed new locations.const int cx = mon->x, cy = mon->y,nx = mon->x + mx, ny = mon->y + my;if (!habitat_okay(mon, grd[nx][ny])|| !habitat_okay(m2, grd[cx][cy]))return (false);// Okay, do the swap!#ifdef DEBUG_DIAGNOSTICSchar mname[ITEMNAME_SIZE];moname(mon->type, true, DESC_PLAIN, mname);mprf(MSGCH_DIAGNOSTICS,"Swap: %s (%d,%d)->(%d,%d) (%d;%d)",mname, mon->x, mon->y, nx, ny, mon->speed_increment, mon->speed);#endifmon->x = nx;mon->y = ny;mgrd[nx][ny] = monster_index(mon);#ifdef DEBUG_DIAGNOSTICSmoname(m2->type, true, DESC_PLAIN, mname);mprf(MSGCH_DIAGNOSTICS,"Swap: %s (%d,%d)->(%d,%d) (%d;%d)",mname, m2->x, m2->y, cx, cy, mon->speed_increment, mon->speed);#endifm2->x = cx;m2->y = cy;const int m2i = monster_index(m2);ASSERT(m2i >= 0 && m2i < MAX_MONSTERS);mgrd[cx][cy] = m2i;immobile_monster[m2i] = true;mons_trap(mon);mons_trap(m2);return (false);}
int target_grid = grd[targ_x][targ_y];const int targ_cloud = env.cgrid[ targ_x ][ targ_y ];const int curr_cloud = env.cgrid[ monster->x ][ monster->y ];
// [ds] Bounds check was after grd[targ_x][targ_y] which would// trigger an ASSERT. Moved it up.
int target_grid = grd[targ_x][targ_y];const int targ_cloud_num = env.cgrid[ targ_x ][ targ_y ];const int targ_cloud_type =targ_cloud_num == EMPTY_CLOUD? CLOUD_NONE: env.cloud[targ_cloud_num].type;const int curr_cloud_num = env.cgrid[ monster->x ][ monster->y ];const int curr_cloud_type =curr_cloud_num == EMPTY_CLOUD? CLOUD_NONE: env.cloud[curr_cloud_num].type;
|| targ_cloud == CLOUD_FIRE|| targ_cloud == CLOUD_FIRE_MON|| targ_cloud == CLOUD_STEAM|| targ_cloud == CLOUD_STEAM_MON))
|| targ_cloud_type == CLOUD_FIRE|| targ_cloud_type == CLOUD_FIRE_MON|| targ_cloud_type == CLOUD_STEAM|| targ_cloud_type == CLOUD_STEAM_MON))
if (mons_aligned(monster_index(monster), mgrd[targ_x][targ_y]))
const int thismonster = monster_index(monster),targmonster = mgrd[targ_x][targ_y];if (mons_aligned(thismonster, targmonster)&& targmonster != MHITNOT&& targmonster != MHITYOU&& !mons_can_displace(monster, &menv[targmonster]))
if (!silenced(you.x_pos, you.y_pos)&& !silenced(monster->x, monster->y)){strcpy(info, "You hear a");if (!mons_near(monster))strcat(info, " distant");strcat(info, " slurping noise.");mpr(info);}monster->hit_points += 5;// note here, that this makes jellies "grow" {dlb}:if (monster->hit_points > monster->max_hit_points)monster->max_hit_points = monster->hit_points;if (mons_flag( monster->type, M_SPLITS )){// and here is where the jelly might divide {dlb}const int reqd = (monster->hit_dice < 6) ? 50: monster->hit_dice * 8;if (monster->hit_points >= reqd)jelly_divide(monster);}
jelly_grows(monster);
// now, if a monster can't move in its intended direction, try// either side. If they're both good, move in whichever dir
// now, if a monster can't move in its intended direction, try// either side. If they're both good, move in whichever dir
monsters_fight(monster_index(monster), targmon);
if (mons_aligned(monster_index(monster), targmon))monster_swaps_places(monster, mmov_x, mmov_y);elsemonsters_fight(monster_index(monster), targmon);// If the monster swapped places, the work's already done.
void seen_monster(struct monsters *monster){if ( monster->flags & MF_SEEN )return;// First time we've seen this particular monstermonster->flags |= MF_SEEN;if ( MONST_INTERESTING(monster) &&monster->type != MONS_PANDEMONIUM_DEMON &&monster->type != MONS_PLAYER_GHOST ){char namebuf[ITEMNAME_SIZE];moname(monster->type, true, DESC_NOCAP_A, namebuf);take_note(Note(NOTE_SEEN_MONSTER, monster->type, 0, namebuf));}}//---------------------------------------------------------------//// shift_monster//// Moves a monster to approximately (x,y) and returns true// if monster was moved.////---------------------------------------------------------------bool shift_monster( struct monsters *mon, int x, int y ){bool found_move = false;int i, j;int tx, ty;int nx = 0, ny = 0;int count = 0;if (x == 0 && y == 0){// try and find a random floor space some distance awayfor (i = 0; i < 50; i++){tx = 5 + random2( GXM - 10 );ty = 5 + random2( GYM - 10 );int dist = grid_distance(x, y, tx, ty);if (grd[tx][ty] == DNGN_FLOOR && dist > 10)break;}if (i == 50)return (false);}for (i = -1; i <= 1; i++){for (j = -1; j <= 1; j++){tx = x + i;ty = y + j;if (tx < 5 || tx > GXM - 5 || ty < 5 || ty > GXM - 5)continue;// won't drop on anything but vanilla floor right nowif (grd[tx][ty] != DNGN_FLOOR)continue;if (mgrd[tx][ty] != NON_MONSTER)continue;if (tx == you.x_pos && ty == you.y_pos)continue;count++;if (one_chance_in(count)){nx = tx;ny = ty;found_move = true;}}}if (found_move){const int mon_index = mgrd[mon->x][mon->y];mgrd[mon->x][mon->y] = NON_MONSTER;mgrd[nx][ny] = mon_index;mon->x = nx;mon->y = ny;}return (found_move);}
monster_type rand_dragon( dragon_class_type type );/* ************************************************************************ called from: monplace monstuff* *********************************************************************** */void mark_interesting_monst(struct monsters* monster,char behaviour = BEH_SLEEP);bool grid_compatible(int grid_wanted, int actual_grid, bool generation = false);bool monster_habitable_grid(int monster_class, int actual_grid,bool flies = false);bool monster_habitable_grid(const monsters *m, int actual_grid);bool monster_floundering(const monsters *m);bool monster_can_submerge(int monster_class, int grid);
// Returns whether actual_grid is compatible with grid_wanted for monster// movement (or for monster generation, if generation is true).bool grid_compatible(int grid_wanted, int actual_grid, bool generation){// XXX What in Xom's name is DNGN_WATER_STUCK? It looks like an artificial// device to slow down fiery monsters flying over water.if (grid_wanted == DNGN_FLOOR)return actual_grid >= DNGN_FLOOR|| (!generation&& actual_grid == DNGN_SHALLOW_WATER);return (grid_wanted == actual_grid|| (grid_wanted == DNGN_DEEP_WATER&& (actual_grid == DNGN_SHALLOW_WATER|| actual_grid == DNGN_BLUE_FOUNTAIN)));}// Can this monster happily on actual_grid?//// If you have an actual monster, use this instead of the overloaded function// that uses only the monster class to make decisions.bool monster_habitable_grid(const monsters *m, int actual_grid){return (monster_habitable_grid(m->type, actual_grid, mons_flies(m)));}// Can monsters of class monster_class live happily on actual_grid? Use flies// == true to pretend the monster can fly.//// [dshaligram] We're trying to harmonise the checks from various places into// one check, so we no longer care if a water elemental springs into existence// on dry land, because they're supposed to be able to move onto dry land// anyway.bool monster_habitable_grid(int monster_class, int actual_grid, bool flies){const int preferred_habitat = monster_habitat(monster_class);return (grid_compatible(preferred_habitat, actual_grid)// [dshaligram] Flying creatures are all DNGN_FLOOR, so we// only have to check for the additional valid grids of deep// water and lava.|| ((flies || mons_class_flies(monster_class))&& (actual_grid == DNGN_LAVA|| actual_grid == DNGN_DEEP_WATER))// Amphibious critters are happy in the water.|| (mons_class_flag(monster_class, M_AMPHIBIOUS)&& grid_compatible(DNGN_DEEP_WATER, actual_grid))// And water elementals are native to the water but happy on land// as well.|| (monster_class == MONS_WATER_ELEMENTAL&& grid_compatible(DNGN_FLOOR, actual_grid)));}// Returns true if the monster is floundering in water and susceptible to// extra damage from water-natives.bool monster_floundering(const monsters *m){const int grid = grd[m->x][m->y];return ((grid == DNGN_DEEP_WATER || grid == DNGN_SHALLOW_WATER)// Can't use monster_habitable_grid because that'll return true// for non-water monsters in shallow water.&& monster_habitat(m->type) != DNGN_DEEP_WATER&& !mons_class_flag(m->type, M_AMPHIBIOUS)&& !mons_flies(m));}
// Returns true if the monster can submerge in the given gridbool monster_can_submerge(int monster_class, int grid){switch (monster_class){case MONS_BIG_FISH:case MONS_GIANT_GOLDFISH:case MONS_ELECTRICAL_EEL:case MONS_JELLYFISH:case MONS_WATER_ELEMENTAL:case MONS_SWAMP_WORM:return (grid == DNGN_DEEP_WATER || grid == DNGN_BLUE_FOUNTAIN);case MONS_LAVA_WORM:case MONS_LAVA_FISH:case MONS_LAVA_SNAKE:case MONS_SALAMANDER:return (grid == DNGN_LAVA);default:return (false);}}
// now, forget about banding if the first placement failed, or there's too// many monsters already, or we successfully placed by stairs
// now, forget about banding if the first placement failed, or there's too// many monsters already, or we successfully placed by stairs
if ((mon_type == MONS_BIG_FISH|| mon_type == MONS_GIANT_GOLDFISH|| mon_type == MONS_ELECTRICAL_EEL|| mon_type == MONS_JELLYFISH|| mon_type == MONS_WATER_ELEMENTAL|| mon_type == MONS_SWAMP_WORM)&& grd[fx][fy] == DNGN_DEEP_WATER&& !one_chance_in(5)){
if (monster_can_submerge(mon_type, grd[fx][fy])&& !one_chance_in(5))
break;// Journey -- Added Draconian Packscase MONS_WHITE_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_MOTTLED_DRACONIAN:case MONS_YELLOW_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_GREEN_DRACONIAN:case MONS_PALE_DRACONIAN:if (power > 18 && one_chance_in(3)){band = BAND_DRACONIAN;band_size = random_range(2, 4);}
case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_KNIGHT:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_SHIFTER:if (power > 20){band = BAND_DRACONIAN;band_size = random_range(3, 6);}break;
break;case BAND_DRACONIAN:{temp_rand = random2( (power < 24) ? 24 : 37 );mon_type =((temp_rand > 35) ? MONS_DRACONIAN_CALLER : // 1 in 34(temp_rand > 33) ? MONS_DRACONIAN_KNIGHT : // 2 in 34(temp_rand > 31) ? MONS_DRACONIAN_MONK : // 2 in 34(temp_rand > 29) ? MONS_DRACONIAN_SHIFTER : // 2 in 34(temp_rand > 27) ? MONS_DRACONIAN_ANNIHILATOR :// 2 in 34(temp_rand > 25) ? MONS_DRACONIAN_SCORCHER : // 2 in 34(temp_rand > 23) ? MONS_DRACONIAN_ZEALOT : // 2 in 34(temp_rand > 20) ? MONS_YELLOW_DRACONIAN : // 3 in 34(temp_rand > 17) ? MONS_GREEN_DRACONIAN : // 3 in 34(temp_rand > 14) ? MONS_BLACK_DRACONIAN : // 3 in 34(temp_rand > 11) ? MONS_WHITE_DRACONIAN : // 3 in 34(temp_rand > 8) ? MONS_PALE_DRACONIAN : // 3 in 34(temp_rand > 5) ? MONS_PURPLE_DRACONIAN : // 3 in 34(temp_rand > 2) ? MONS_MOTTLED_DRACONIAN : // 3 in 34MONS_RED_DRACONIAN ); // 3 in 34
}static int ood_limit() {return Options.ood_interesting;}void mark_interesting_monst(struct monsters* monster, char behaviour){bool interesting = false;// Unique monsters are always interstingif ( mons_is_unique(monster->type) )interesting = true;// If it's never going to attack us, then not interestingelse if (behaviour == BEH_FRIENDLY || behaviour == BEH_GOD_GIFT)interesting = false;// Don't waste time on moname() if user isn't using this optionelse if ( Options.note_monsters.size() > 0 ){char namebuf[ITEMNAME_SIZE];moname(monster->type, true, DESC_NOCAP_A, namebuf);std::string iname = namebuf;for (unsigned i = 0; i < Options.note_monsters.size(); ++i) {if (Options.note_monsters[i].matches(iname)) {interesting = true;break;}}}else if ( you.where_are_you == BRANCH_MAIN_DUNGEON &&you.level_type == LEVEL_DUNGEON &&mons_level(monster->type) >= you.your_level + ood_limit() &&mons_level(monster->type) < 99 &&!(monster->type >= MONS_EARTH_ELEMENTAL &&monster->type <= MONS_AIR_ELEMENTAL) )interesting = true;if ( interesting )monster->flags |= MF_INTERESTING;
if (empty_surrounds( cr_x, cr_y, spcw, true, empty ))
if (empty_surrounds( x, y, spcw, 2, true, empty )){pos.x = empty[0];pos.y = empty[1];}return (pos);}int create_monster( int cls, int dur, int beha, int cr_x, int cr_y,int hitting, int zsec, bool permit_bands ){int summd = -1;coord_def pos = find_newmons_square(cls, cr_x, cr_y);if (pos.x != -1 && pos.y != -1)
// get the drawbacks, not the benefits...// (to prevent demon-scumming)if ( (you.religion == GOD_ZIN ||you.religion == GOD_SHINING_ONE ||you.religion == GOD_ELYVILON) &&mons_is_unholy(creation) ){creation->attitude = ATT_HOSTILE;creation->behaviour = BEH_HOSTILE;beha = BEH_HOSTILE;if ( see_grid(cr_x, cr_y) )mpr("The monster is enraged by your holy aura!");}
monster_type rand_dragon( dragon_class_type type ){monster_type summoned = MONS_PROGRAM_BUG;int temp_rand;switch (type){case DRAGON_LIZARD:temp_rand = random2(100);summoned = ((temp_rand > 85) ? MONS_GIANT_GECKO :(temp_rand > 59) ? MONS_GIANT_LIZARD :(temp_rand > 34) ? MONS_GIANT_IGUANA :(temp_rand > 22) ? MONS_GILA_MONSTER :(temp_rand > 11) ? MONS_KOMODO_DRAGON :(temp_rand > 8) ? MONS_FIREDRAKE :(temp_rand > 2) ? MONS_SWAMP_DRAKE: MONS_DEATH_DRAKE );break;case DRAGON_DRACONIAN:temp_rand = random2(70);summoned = ((temp_rand > 60) ? MONS_YELLOW_DRACONIAN :(temp_rand > 50) ? MONS_BLACK_DRACONIAN :(temp_rand > 40) ? MONS_PALE_DRACONIAN :(temp_rand > 30) ? MONS_GREEN_DRACONIAN :(temp_rand > 20) ? MONS_PURPLE_DRACONIAN :(temp_rand > 10) ? MONS_RED_DRACONIAN: MONS_WHITE_DRACONIAN);break;case DRAGON_DRAGON:temp_rand = random2(90);summoned = ((temp_rand > 80) ? MONS_MOTTLED_DRAGON :(temp_rand > 70) ? MONS_LINDWURM :(temp_rand > 60) ? MONS_STORM_DRAGON :(temp_rand > 50) ? MONS_MOTTLED_DRAGON :(temp_rand > 40) ? MONS_STEAM_DRAGON :(temp_rand > 30) ? MONS_DRAGON :(temp_rand > 20) ? MONS_ICE_DRAGON :(temp_rand > 10) ? MONS_SWAMP_DRAGON: MONS_SHADOW_DRAGON);break;default:break;}return (summoned);}
// ****remember***** must make an hardcopy of this sometime#if defined(macintosh) || defined(__IBMCPP__) || defined(SOLARIS) || defined(__BCPLUSPLUS__)#define PACKED#else#ifndef PACKED#define PACKED __attribute__ ((packed))#endif#endif
// leaves no skeleton? ("blob" monsters?)// if weight=0 or zombie_size=0, this is always true#define M_NO_FLAGS 0 // clear#define M_NO_SKELETON (1<<0)// resistances#define M_RES_ELEC (1<<1)#define M_RES_POISON (1<<2)#define M_RES_FIRE (1<<3)#define M_RES_HELLFIRE (1<<4)#define M_RES_COLD (1<<5)// invisible#define M_INVIS (1<<6) // is created with invis enchantment set, and never runs out// vulnerabilities//#define M_ED_ELEC (1<<6) // never used#define M_ED_POISON (1<<7) // ??? - - This flag is now (2.50) set for insects (LRH)#define M_ED_FIRE (1<<8)#define M_ED_COLD (1<<9)#define M_SPELLCASTER (1<<10) // any non-physical-attack powers#define M_FLIES (1<<11) // will crash to ground if paralysed (wings)#define M_LEVITATE (1<<12) // not if this is set#define M_SEE_INVIS (1<<13)// killing this beast only gives 10 experience (makes sense for plants/fungi)#define M_NO_EXP_GAIN (1<<14) // must do this manually#define M_SPEAKS (1<<15)//jmf: M_SPELLCASTER was taken ... :-b#define M_ACTUAL_SPELLS (1<<16) // monster is a wizard#define M_PRIEST (1<<17) // monster is a priest of Brian's Orc God (BOG)#define M_COLD_BLOOD (1<<18)#define M_WARM_BLOOD (1<<19)#define M_CONFUSED (1<<20) // monster is perma-confused#define M_SPLITS (1<<21) // monster is perma-confused#define M_AMPHIBIOUS (1<<22) // monster can swim in water//jmf: it'd be nice if these next two were implimented ...#define M_ON_FIRE (1<<29) // flag for Hellion-like colour shift#define M_FROZEN (1<<30) // flag for ice-like colour shift
// last updated 12may2000 {dlb}/* ************************************************************************ called from: dungeon - fight - monstuff - spells4* *********************************************************************** */int mons_charclass(int mcls);
bool mons_is_confused(const monsters *m);bool mons_is_fleeing(const monsters *m);bool mons_is_sleeping(const monsters *m);bool mons_is_batty(const monsters *m);bool mons_is_evil( const monsters *mon );bool mons_is_unholy( const monsters *mon );bool mons_has_lifeforce( const monsters *mon );monster_type mons_genus( int mc );monster_type mons_species( int mc );
bool check_mons_resist_magic( struct monsters *monster, int pow );
bool check_mons_resist_magic( const monsters *monster, int pow );bool mons_class_is_stationary(int monsclass);bool mons_is_stationary(const monsters *mons);bool mons_is_submerged( struct monsters *mon );
bool invalid_monster(const monsters *mons);bool invalid_monster_class(int mclass);bool monster_shover(const monsters *m);bool mons_is_paralysed(const monsters *m);bool monster_senior(const monsters *first, const monsters *second);monster_type draco_subspecies( const monsters *mon );monster_type random_monster_at_grid(int x, int y);monster_type random_monster_at_grid(int grid);monster_type get_monster_by_name(std::string name, bool exact = false);
enum habitat_type{// Flying monsters will appear in all categoriesHT_NORMAL, // Normal crittersHT_SHALLOW_WATER, // Union of normal + waterHT_DEEP_WATER, // Water crittersHT_LAVA, // Lava crittersNUM_HABITATS};static bool initialized_randmons = false;static std::vector<int> monsters_by_habitat[NUM_HABITATS];
void mons_init(FixedVector < unsigned short, 1000 > &colour)
habitat_type grid2habitat(int grid){switch (grid){case DNGN_DEEP_WATER:return (HT_DEEP_WATER);case DNGN_SHALLOW_WATER:return (HT_SHALLOW_WATER);case DNGN_LAVA:return (HT_LAVA);default:return (HT_NORMAL);}}int habitat2grid(habitat_type ht){switch (ht){case HT_DEEP_WATER:return (DNGN_DEEP_WATER);case HT_SHALLOW_WATER:return (DNGN_SHALLOW_WATER);case HT_LAVA:return (DNGN_LAVA);case HT_NORMAL:default:return (DNGN_FLOOR);}}static void initialize_randmons(){for (int i = 0; i < NUM_HABITATS; ++i){int grid = habitat2grid( habitat_type(i) );for (int m = 0; m < NUM_MONSTERS; ++m){if (invalid_monster_class(m))continue;if (monster_habitable_grid(m, grid))monsters_by_habitat[i].push_back(m);}}initialized_randmons = true;}monster_type random_monster_at_grid(int x, int y){return (random_monster_at_grid(grd[x][y]));}monster_type random_monster_at_grid(int grid){if (!initialized_randmons)initialize_randmons();const habitat_type ht = grid2habitat(grid);const std::vector<int> &valid_mons = monsters_by_habitat[ht];ASSERT(!valid_mons.empty());return valid_mons.empty()? MONS_PROGRAM_BUG: monster_type(valid_mons[ random2(valid_mons.size()) ]);}monster_type get_monster_by_name(std::string name, bool exact){lowercase(name);monster_type mon = MONS_PROGRAM_BUG;for (unsigned i = 0; i < sizeof(mondata) / sizeof(*mondata); ++i){std::string candidate = mondata[i].name;lowercase(candidate);const int mtype = mondata[i].mc;if (exact){if (name == candidate)return monster_type(mtype);continue;}const std::string::size_type match = candidate.find(name);if (match == std::string::npos)continue;mon = monster_type(mtype);// we prefer prefixes over partial matchesif (match == 0)break;}return (mon);}void init_monsters(FixedVector < unsigned short, 1000 > &colour)
int mons_flag(int mc, int bf)
unsigned long get_mons_resists(const monsters *mon){unsigned long resists = get_mons_class_resists(mon->type);if (mons_genus(mon->type) == MONS_DRACONIAN&& mon->type != MONS_DRACONIAN){monster_type draco_species = draco_subspecies(mon);if (draco_species != mon->type)resists |= get_mons_class_resists(draco_species);}return (resists);}unsigned long mons_resist(const monsters *mon, unsigned long flags){return (get_mons_resists(mon) & flags);}bool mons_class_flag(int mc, int bf)
bool mons_class_is_stationary(int type){return (type == MONS_OKLOB_PLANT|| type == MONS_PLANT|| type == MONS_FUNGUS|| type == MONS_CURSE_SKULL|| mons_is_statue(type)|| mons_is_mimic(type));}bool mons_is_stationary(const monsters *mons){return (mons_class_is_stationary(mons->type));}bool invalid_monster(const monsters *mons){return (!mons || mons->type == -1);}bool invalid_monster_class(int mclass){return (mclass < 0|| mclass >= NUM_MONSTERS|| mon_entry[mclass] == -1|| mon_entry[mclass] == MONS_PROGRAM_BUG);}bool mons_is_statue(int mc){return (mc == MONS_ORANGE_STATUE || mc == MONS_SILVER_STATUE);}
if (mc <= MONS_PROGRAM_BUG|| (mc >= MONS_NAGA_MAGE && mc <= MONS_ROYAL_JELLY)|| (mc >= MONS_ANCIENT_LICH&& (mc != MONS_PLAYER_GHOST && mc != MONS_PANDEMONIUM_DEMON))){return (false);}return (true);
return (mons_class_flag(mc, M_UNIQUE));
if (mons_holiness( mon->type ) == MH_UNDEAD|| mons_holiness( mon->type ) == MH_DEMONIC|| mons_holiness( mon->type ) == MH_NONLIVING|| mons_holiness( mon->type ) == MH_PLANT|| mon->type == MONS_SHADOW_DRAGON)
if (mons_holiness(mon) == MH_UNDEAD|| mons_holiness(mon) == MH_DEMONIC|| mons_holiness(mon) == MH_NONLIVING|| mons_holiness(mon) == MH_PLANT|| mon->type == MONS_SHADOW_DRAGON|| mon->type == MONS_DEATH_DRAKE)
bool mons_is_evil( const monsters *mon ){return (mons_class_flag( mon->type, M_EVIL ));}bool mons_is_unholy( const monsters *mon ){const mon_holy_type holy = mons_holiness( mon );return (holy == MH_UNDEAD || holy == MH_DEMONIC);}bool mons_has_lifeforce( const monsters *mon ){const int holy = mons_holiness( mon );return (holy == MH_NATURAL || holy == MH_PLANT);// && !mons_has_ench( mon, ENCH_PETRIFY ));}
const int msecc = ((mclass == MONS_HELLION) ? MST_BURNING_DEVIL :(mclass == MONS_PANDEMONIUM_DEMON) ? MST_GHOST: monster->number);int hspell_pass[6] = { MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL,MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL };mons_spell_list( msecc, hspell_pass );
const monster_spells &hspell_pass = monster->spells;
// I *KNOW* this can easily be done in a loopsplist[0] = mspell_list[x][1]; // bolt spellsplist[1] = mspell_list[x][2]; // enchantmentsplist[2] = mspell_list[x][3]; // self_enchsplist[3] = mspell_list[x][4]; // miscsplist[4] = mspell_list[x][5]; // misc2splist[5] = mspell_list[x][6]; // emergency
for (x = 0; x < 6; x++)mon->spells[x] = MS_NO_SPELL;
for (x = 0; x < 6; x++)splist[x] = ghost.values[ GVAL_SPELL_1 + x ];
for (y = 0; y < NUM_MONSTER_SPELL_SLOTS; y++){mon->spells[y] = ghost.values[ GVAL_SPELL_1 + y ];#if DEBUG_DIAGNOSTICSmprf( MSGCH_DIAGNOSTICS, "spell #%d: %d", y, mon->spells[y] );#endif}
} // end mons_spell_list()
else{// this needs to be rewritten a la the monsterseek rewrite {dlb}:for (x = 0; x < NUM_MSTYPES; x++){if (mspell_list[x][0] == book)break;}if (x < NUM_MSTYPES){for (y = 0; y < 6; y++)mon->spells[y] = mspell_list[x][y + 1];}}}
int m2_class = menv[k].type;int m2_HD, m2_hp, m2_hp_max, m2_AC, m2_ev, m2_speed;int m2_sec = menv[k].number;struct monsterentry *m = seekmonster(&m2_class);
int mcls = mons.type;int hd, hp, hp_max, ac, ev, speed;int monnumber = mons.number;const monsterentry *m = seekmonster(mcls);int col = mons_class_colour(mons.type);int spells = MST_NO_SPELLS;
switch (m2_class){case MONS_ABOMINATION_SMALL:m2_HD = 4 + random2(4);m2_AC = 3 + random2(7);m2_ev = 7 + random2(6);m2_speed = 7 + random2avg(9, 2);
case MONS_ABOMINATION_SMALL:hd = 4 + random2(4);ac = 3 + random2(7);ev = 7 + random2(6);speed = 7 + random2avg(9, 2);
case MONS_ABOMINATION_LARGE:m2_HD = 8 + random2(4);m2_AC = 5 + random2avg(9, 2);m2_ev = 3 + random2(5);m2_speed = 6 + random2avg(7, 2);
case MONS_ABOMINATION_LARGE:hd = 8 + random2(4);ac = 5 + random2avg(9, 2);ev = 3 + random2(5);speed = 6 + random2avg(7, 2);
case MONS_DEEP_ELF_FIGHTER:case MONS_DEEP_ELF_KNIGHT:case MONS_DEEP_ELF_SOLDIER:case MONS_ORC_WIZARD:m2_sec = MST_ORC_WIZARD_I + random2(3);break;
case MONS_DEEP_ELF_FIGHTER:case MONS_DEEP_ELF_KNIGHT:case MONS_DEEP_ELF_SOLDIER:case MONS_ORC_WIZARD:spells = MST_ORC_WIZARD_I + random2(3);break;
case MONS_WIZARD:case MONS_OGRE_MAGE:case MONS_EROLCHA:case MONS_DEEP_ELF_MAGE:m2_sec = MST_WIZARD_I + random2(5);break;
case MONS_WIZARD:case MONS_OGRE_MAGE:case MONS_EROLCHA:case MONS_DEEP_ELF_MAGE:spells = MST_WIZARD_I + random2(5);break;
m2_sec = (temp_rand >= 5 ? LIGHTRED : // 2/7temp_rand >= 3 ? LIGHTMAGENTA : // 2/7temp_rand == 2 ? RED : // 1/7temp_rand == 1 ? MAGENTA // 1/7: YELLOW); // 1/7break;
col = (temp_rand >= 5 ? LIGHTRED : // 2/7temp_rand >= 3 ? LIGHTMAGENTA : // 2/7temp_rand == 2 ? RED : // 1/7temp_rand == 1 ? MAGENTA // 1/7: YELLOW); // 1/7break;
case MONS_HUMAN:case MONS_ELF:// these are supposed to only be created by polymorphm2_HD += random2(10);m2_AC += random2(5);m2_ev += random2(5);break;
case MONS_DRACONIAN:// these are supposed to only be created by polymorphhd += random2(10);ac += random2(5);ev += random2(5);
break;case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_SHIFTER:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_SCORCHER:{// Professional draconians still have a base draconian type.// White draconians will never be draconian scorchers, but// apart from that, anything goes.domonnumber = MONS_BLACK_DRACONIAN + random2(8);while (monnumber == MONS_WHITE_DRACONIAN&& mcls == MONS_DRACONIAN_SCORCHER);break;
case MONS_DRACONIAN_KNIGHT:{temp_rand = random2(10);// hell knight, death knight, chaos knight...if (temp_rand < 6)spells = (coinflip() ? MST_HELL_KNIGHT_I : MST_HELL_KNIGHT_II);else if (temp_rand < 9)spells = (coinflip() ? MST_NECROMANCER_I : MST_NECROMANCER_II);elsespells = (coinflip() ? MST_DEEP_ELF_CONJURER_I: MST_DEEP_ELF_CONJURER_II);monnumber = MONS_BLACK_DRACONIAN + random2(8);break;}case MONS_HUMAN:case MONS_ELF:// these are supposed to only be created by polymorphhd += random2(10);ac += random2(5);ev += random2(5);break;
menv[k].hit_dice = m2_HD;menv[k].hit_points = m2_hp;menv[k].max_hit_points = m2_hp_max;menv[k].armour_class = m2_AC;menv[k].evasion = m2_ev;menv[k].speed = m2_speed;menv[k].speed_increment = 70;menv[k].number = m2_sec;menv[k].flags = 0;
mons.hit_dice = hd;mons.hit_points = hp;mons.max_hit_points = hp_max;mons.armour_class = ac;mons.evasion = ev;mons.speed = speed;mons.speed_increment = 70;mons.number = monnumber;mons.flags = 0;mons.colour = col;mons_load_spells( &mons, spells );
switch (mons_num){default: break;case MONS_BLACK_DRACONIAN: strcat(gmo_n, "black "); break;case MONS_MOTTLED_DRACONIAN: strcat(gmo_n, "mottled "); break;case MONS_YELLOW_DRACONIAN: strcat(gmo_n, "yellow "); break;case MONS_GREEN_DRACONIAN: strcat(gmo_n, "green "); break;case MONS_PURPLE_DRACONIAN: strcat(gmo_n, "purple "); break;case MONS_RED_DRACONIAN: strcat(gmo_n, "red "); break;case MONS_WHITE_DRACONIAN: strcat(gmo_n, "white "); break;case MONS_PALE_DRACONIAN: strcat(gmo_n, "pale "); break;}moname( mons, vis, DESC_PLAIN, gmo_n2 );strcat( gmo_n, gmo_n2 );break;
// Make sure oklob plants are never highlighted. That'll defeat the// point of making them look like normal plants.return (!mons_flag(m->type, M_NO_EXP_GAIN)&& m->type != MONS_OKLOB_PLANT&& !mons_friendly(m)&& m->behaviour == BEH_SLEEP);
// FIXME, switch to 4.1's MF_SUBMERGED system which is much cleaner.return (mons_has_ench( mon, ENCH_SUBMERGED ));
return (!mons_flag(m->type, M_NO_EXP_GAIN)&& m->type != MONS_OKLOB_PLANT&& !mons_friendly(m)&& ((m->foe != MHITYOU && !testbits(m->flags, MF_BATTY))|| (mons_has_ench(m, ENCH_CONFUSION) &&!mons_flag(m->type, M_CONFUSED))|| m->behaviour == BEH_FLEE));
// maybe this should be 70return (m->speed_increment <= 60);
int x = 0;while (x < mondatasize){if (mondata[x].mc == mc)return &mondata[x];x++;}ASSERT(false);return seekmonster(MONS_PROGRAM_BUG); // see the disasters coming if there is no 250?} // end seekmonster()****************************************************************** *//* ******************************************************************// only used once, and internal to this file, to boot {dlb}:// These are easy to implement here. The difficult (dull!) work of converting// the data structures is finally finished now!inline char *mons_name( int mc )
bool mons_looks_stabbable(const monsters *m)
return smc->name;} // end mons_name()****************************************************************** */
// Make sure oklob plants are never highlighted. That'll defeat the// point of making them look like normal plants.return (!mons_class_flag(m->type, M_NO_EXP_GAIN)&& m->type != MONS_OKLOB_PLANT&& !mons_is_mimic(m->type)&& !mons_is_statue(m->type)&& !mons_friendly(m)&& mons_is_sleeping(m));}
/*****************************************************************Used to determine whether or not a monster should fire a beam (MUST becalled _after_ fire_tracer() for meaningful result.
bool mons_looks_distracted(const monsters *m){return (!mons_class_flag(m->type, M_NO_EXP_GAIN)&& m->type != MONS_OKLOB_PLANT&& !mons_is_mimic(m->type)&& !mons_is_statue(m->type)&& !mons_friendly(m)&& ((m->foe != MHITYOU && !mons_is_batty(m))|| mons_is_confused(m)|| mons_is_fleeing(m)));}
const int msecc = ((mclass == MONS_HELLION) ? MST_BURNING_DEVIL :(mclass == MONS_PANDEMONIUM_DEMON) ? MST_GHOST: mon->number);int hspell_pass[6] = { MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL,MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL };mons_spell_list( msecc, hspell_pass );for (int i = 0; i < 6; i++)
for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; i++)
}/** Checks if the monster can use smiting/torment to attack without unimpeded* LOS to the player.*/static bool mons_can_smite(const monsters *monster){if (monster->type == MONS_FIEND)return (true);const monster_spells &hspell_pass = monster->spells;for (unsigned i = 0; i < hspell_pass.size(); ++i)if (hspell_pass[i] == MS_TORMENT || hspell_pass[i] == MS_SMITE)return (true);return (false);}/** Determines if a monster is smart and pushy enough to displace other monsters.* A shover should not cause damage to the shovee by displacing it, so monsters* that trail clouds of badness are ineligible. The shover should also benefit* from shoving, so monsters that can smite/torment are ineligible.** (Smiters would be eligible for shoving when fleeing if the AI allowed for* smart monsters to flee.)*/bool monster_shover(const monsters *m){const monsterentry *me = seekmonster(m->type);if (!me)return (false);// Efreet and fire elementals are disqualified because they leave behind// clouds of flame. Rotting devils trail clouds of miasma.if (m->type == MONS_EFREET || m->type == MONS_FIRE_ELEMENTAL|| m->type == MONS_ROTTING_DEVIL|| m->type == MONS_CURSE_TOE)return (false);// Smiters profit from staying back and smiting.if (mons_can_smite(m))return (false);int mchar = me->showchar;// Somewhat arbitrary: giants and dragons are too big to get past anything,// beetles are too dumb (arguable), dancing weapons can't communicate, eyes// aren't pushers and shovers, zombies are zombies. Worms and elementals// are on the list because all 'w' are currently unrelated.return (mchar != 'C' && mchar != 'B' && mchar != '(' && mchar != 'D'&& mchar != 'G' && mchar != 'Z' && mchar != 'z'&& mchar != 'w' && mchar != '#');}// Returns true if m1 and m2 are related, and m1 is higher up the totem pole// than m2. The criteria for being related are somewhat loose, as you can see// below.bool monster_senior(const monsters *m1, const monsters *m2){const monsterentry *me1 = seekmonster(m1->type),*me2 = seekmonster(m2->type);if (!me1 || !me2)return (false);int mchar1 = me1->showchar,mchar2 = me2->showchar;// If both are demons, the smaller number is the nastier demon.if (isdigit(mchar1) && isdigit(mchar2))return (mchar1 < mchar2);// &s are the evillest demons of all, well apart from Geryon, who really// profits from *not* pushing past beasts.if (mchar1 == '&' && isdigit(mchar2) && m1->type != MONS_GERYON)return (m1->hit_dice > m2->hit_dice);// Skeletal warriors can push past zombies large and small.if (m1->type == MONS_SKELETAL_WARRIOR && (mchar2 == 'z' || mchar2 == 'Z'))return (m1->hit_dice > m2->hit_dice);if (m1->type == MONS_QUEEN_BEE&& (m2->type == MONS_KILLER_BEE|| m2->type == MONS_KILLER_BEE_LARVA))return (true);if (m1->type == MONS_KILLER_BEE && m2->type == MONS_KILLER_BEE_LARVA)return (true);// Special-case gnolls so they can't get past (hob)goblinsif (m1->type == MONS_GNOLL && m2->type != MONS_GNOLL)return (false);return (mchar1 == mchar2 && m1->hit_dice > m2->hit_dice);
{ MST_DEATH_DRAKE,MS_MIASMA,MS_MIASMA,MS_NO_SPELL,MS_MIASMA,MS_MIASMA,MS_NO_SPELL },{ MST_DRAC_SCORCHER,MS_FIRE_BOLT,MS_STICKY_FLAME,MS_NO_SPELL,MS_FIREBALL,MS_HELLFIRE,MS_HELLFIRE_BURST },{ MST_DRAC_CALLER,MS_NO_SPELL,MS_SUMMON_LIZARDS,MS_SUMMON_LIZARDS,MS_NO_SPELL,MS_NO_SPELL,MS_SUMMON_LIZARDS },{ MST_DRAC_SHIFTER,MS_NO_SPELL,MS_BLINK_OTHER,MS_BLINK,MS_NO_SPELL,MS_BLINK_OTHER,MS_CONTROLLED_BLINK },// Curse toe menu should be kept full, because otherwise the toe spends// too much time crawling around.{ MST_CURSE_TOE,MS_SUMMON_UNDEAD,MS_SUMMON_MUSHROOMS, // fungal themeMS_SUMMON_MUSHROOMS,MS_TORMENT,MS_SUMMON_UNDEAD,MS_TORMENT },
int branch_stair(int branch){switch (branch){case BRANCH_ORCISH_MINES: return STAIRS_ORCISH_MINES;case BRANCH_HIVE: return STAIRS_HIVE;case BRANCH_LAIR: return STAIRS_LAIR;case BRANCH_SLIME_PITS: return STAIRS_SLIME_PITS;case BRANCH_VAULTS: return STAIRS_VAULTS;case BRANCH_CRYPT: return STAIRS_CRYPT;case BRANCH_HALL_OF_BLADES: return STAIRS_HALL_OF_BLADES;case BRANCH_HALL_OF_ZOT: return STAIRS_HALL_OF_ZOT;case BRANCH_ECUMENICAL_TEMPLE: return STAIRS_ECUMENICAL_TEMPLE;case BRANCH_SNAKE_PIT: return STAIRS_SNAKE_PIT;case BRANCH_ELVEN_HALLS: return STAIRS_ELVEN_HALLS;case BRANCH_TOMB: return STAIRS_TOMB;case BRANCH_SWAMP: return STAIRS_SWAMP;default:return -1;}}
case MONS_DEEP_ELF_ANNIHILATOR:case MONS_DEEP_ELF_DEATH_MAGE:case MONS_DEEP_ELF_DEMONOLOGIST:case MONS_DEEP_ELF_HIGH_PRIEST:case MONS_DEEP_ELF_SORCERER:
case MONS_MOTTLED_DRACONIAN:case MONS_YELLOW_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_WHITE_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_PALE_DRACONIAN:case MONS_GREEN_DRACONIAN:case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_KNIGHT:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_SHIFTER:
case MONS_MOTTLED_DRACONIAN:case MONS_YELLOW_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_WHITE_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_PALE_DRACONIAN:case MONS_GREEN_DRACONIAN:return 18;case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_KNIGHT:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_SHIFTER:return 16;
static int mons_caverns_level( int mcls ){int mlev = you.branch_stairs[STAIRS_CAVERNS] + 1;switch (mcls){case MONS_YELLOW_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_WHITE_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_PALE_DRACONIAN:case MONS_GREEN_DRACONIAN:case MONS_MOTTLED_DRACONIAN:mlev++;break;case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_KNIGHT:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_SHIFTER:mlev += 3;break;default:mlev += 99;break;}
return (mlev);}static int mons_caverns_rare( int mcls ){switch (mcls){case MONS_YELLOW_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_WHITE_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_PALE_DRACONIAN:case MONS_GREEN_DRACONIAN:case MONS_MOTTLED_DRACONIAN:case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_KNIGHT:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_SHIFTER:return (500);default:return (0);}}
M_RES_POISON | M_RES_HELLFIRE | M_ED_COLD | M_FLIES | M_SEE_INVIS | M_SPEAKS,0, 13, MONS_IMP, MH_DEMONIC, -9,
M_FLIES | M_SEE_INVIS | M_SPEAKS | M_EVIL | M_SPECIAL_ABILITY,MR_RES_POISON | MR_RES_HELLFIRE | MR_VUL_COLD,0, 13, MONS_IMP, MONS_IMP, MH_DEMONIC, -9,
M_RES_POISON | M_RES_FIRE | M_ED_COLD | M_RES_ELEC | M_LEVITATE | M_CONFUSED,0, 5, MONS_FIRE_VORTEX, MH_NONLIVING, 5000,
M_LEVITATE | M_CONFUSED,MR_RES_POISON | MR_RES_FIRE | MR_VUL_COLD | MR_RES_ELEC,0, 5, MONS_FIRE_VORTEX, MONS_FIRE_VORTEX, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_RES_FIRE | M_ED_COLD | M_FLIES, //jmf: warm blood?2200, 12, MONS_DRAGON, MH_NATURAL, -4,
M_FLIES | M_SPECIAL_ABILITY, //jmf: warm blood?MR_RES_POISON | MR_RES_FIRE | MR_VUL_COLD,2200, 12, MONS_DRAGON, MONS_DRAGON, MH_NATURAL, -4,
M_RES_POISON | M_RES_COLD | M_RES_ELEC | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS,0, 16, MONS_LICH, MH_UNDEAD, -11,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_COLD | MR_RES_ELEC,0, 16, MONS_LICH, MONS_LICH, MH_UNDEAD, -11,
M_RES_POISON | M_SPELLCASTER | M_SEE_INVIS | M_ACTUAL_SPELLS | M_WARM_BLOOD,350, 10, MONS_GUARDIAN_NAGA, MH_NATURAL, -6,
M_SPELLCASTER | M_SEE_INVIS | M_ACTUAL_SPELLS | M_WARM_BLOOD,MR_RES_POISON,350, 10, MONS_NAGA, MONS_GUARDIAN_NAGA, MH_NATURAL, -6,
M_RES_POISON | M_ED_FIRE | M_RES_COLD | M_LEVITATE | M_SEE_INVIS,0, 10, MONS_FREEZING_WRAITH, MH_UNDEAD, -4,
M_LEVITATE | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_VUL_FIRE | MR_RES_COLD,0, 10, MONS_WRAITH, MONS_FREEZING_WRAITH, MH_UNDEAD, -4,
M_NO_SKELETON | M_RES_POISON | M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS,900, 13, MONS_GREAT_ORB_OF_EYES, MH_NATURAL, 5000,
M_NO_SKELETON | M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS,MR_RES_POISON,900, 13, MONS_GIANT_EYEBALL, MONS_GREAT_ORB_OF_EYES, MH_NATURAL, MAG_IMMUNE,
MONS_HELLION, '3', BLACK, "hellion",M_RES_POISON | M_RES_HELLFIRE | M_ED_COLD | M_SPELLCASTER | M_ON_FIRE,0, 11, MONS_HELLION, MH_DEMONIC, -7,
MONS_HELLION, '3', EC_FIRE, "hellion",M_SPELLCASTER | M_EVIL,MR_RES_POISON | MR_RES_HELLFIRE | MR_VUL_COLD,0, 11, MONS_HELLION, MONS_HELLION, MH_DEMONIC, -7,
M_RES_FIRE | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_ACTUAL_SPELLS | M_WARM_BLOOD,600, 12, MONS_ORC, MH_NATURAL, -3,
M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_ACTUAL_SPELLS | M_WARM_BLOOD | M_EVIL,MR_RES_FIRE,600, 12, MONS_ORC, MONS_ORC, MH_NATURAL, -3,
M_RES_HELLFIRE | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_PRIEST | M_WARM_BLOOD,600, 10, MONS_ORC, MH_NATURAL, -4,
M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_PRIEST | M_WARM_BLOOD | M_EVIL,MR_RES_HELLFIRE,600, 10, MONS_ORC, MONS_ORC, MH_NATURAL, -4,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_SEE_INVIS,0, 10, MONS_CLAY_GOLEM, MH_NONLIVING, 5000,
M_SEE_INVIS,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_CLAY_GOLEM, MONS_CLAY_GOLEM, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_SEE_INVIS,0, 10, MONS_IRON_GOLEM, MH_NONLIVING, 5000,
M_SEE_INVIS,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_CLAY_GOLEM, MONS_IRON_GOLEM, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_SEE_INVIS,0, 10, MONS_CRYSTAL_GOLEM, MH_NONLIVING, 5000,
M_SEE_INVIS,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_CLAY_GOLEM, MONS_CRYSTAL_GOLEM, MH_NONLIVING, MAG_IMMUNE,
MONS_MOTTLED_DRAGON, 'd', LIGHTMAGENTA, "mottled dragon",M_RES_POISON | M_RES_FIRE | M_SPELLCASTER | M_FLIES,1100, 10, MONS_MOTTLED_DRAGON, MH_NATURAL, -3,
MONS_MOTTLED_DRAGON, 'D', RED, "mottled dragon",M_SPELLCASTER | M_FLIES,MR_RES_POISON | MR_RES_FIRE,1100, 10, MONS_DRAGON, MONS_MOTTLED_DRAGON, MH_NATURAL, -3,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC,0, 10, MONS_EARTH_ELEMENTAL, MH_NONLIVING, 5000,
M_NO_FLAGS,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_EARTH_ELEMENTAL, MONS_EARTH_ELEMENTAL, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_RES_HELLFIRE | M_ED_COLD | M_RES_ELEC | M_FLIES,0, 10, MONS_FIRE_ELEMENTAL, MH_NONLIVING, 5000,
M_FLIES,MR_RES_POISON | MR_RES_HELLFIRE | MR_VUL_COLD | MR_RES_ELEC,0, 10, MONS_EARTH_ELEMENTAL, MONS_FIRE_ELEMENTAL, MH_NONLIVING, MAG_IMMUNE,
M_RES_ELEC | M_RES_POISON | M_LEVITATE | M_SEE_INVIS | M_FLIES,0, 5, MONS_AIR_ELEMENTAL, MH_NONLIVING, 5000,
M_LEVITATE | M_SEE_INVIS | M_FLIES,MR_RES_ELEC | MR_RES_POISON,0, 5, MONS_EARTH_ELEMENTAL, MONS_AIR_ELEMENTAL, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_ED_FIRE | M_RES_COLD | M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_FROZEN,0, 10, MONS_ICE_FIEND, MH_DEMONIC, -12,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_FROZEN | M_EVIL,MR_RES_POISON | MR_VUL_FIRE | MR_RES_COLD,0, 10, MONS_FIEND, MONS_ICE_FIEND, MH_DEMONIC, -12,
M_RES_POISON | M_RES_COLD | M_RES_ELEC | M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS,0, 10, MONS_SHADOW_FIEND, MH_DEMONIC, -13,
M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_FIEND, MONS_SHADOW_FIEND, MH_DEMONIC, -13,
M_RES_ELEC | M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_LEVITATE,0, 17, MONS_INSUBSTANTIAL_WISP, MH_NONLIVING, 5000,
M_LEVITATE | M_SPECIAL_ABILITY,MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD,0, 17, MONS_INSUBSTANTIAL_WISP, MONS_INSUBSTANTIAL_WISP, MH_NONLIVING, MAG_IMMUNE,
M_RES_ELEC | M_RES_POISON | M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS | M_INVIS | M_CONFUSED,0, 21, MONS_VAPOUR, MH_NONLIVING, 5000,
M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS | M_INVIS | M_CONFUSED,MR_RES_ELEC | MR_RES_POISON,0, 21, MONS_VAPOUR, MONS_VAPOUR, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_RES_HELLFIRE | M_RES_COLD | M_RES_ELEC | M_LEVITATE,0, 10, MONS_DANCING_WEAPON, MH_NONLIVING, 5000,
M_LEVITATE,MR_RES_POISON | MR_RES_HELLFIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_DANCING_WEAPON, MONS_DANCING_WEAPON, MH_NONLIVING, MAG_IMMUNE,
M_RES_ELEC | M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_SPELLCASTER | M_FLIES | M_SEE_INVIS,3000, 17, MONS_GOLDEN_DRAGON, MH_NATURAL, -8,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS,MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD,3000, 17, MONS_DRAGON, MONS_GOLDEN_DRAGON, MH_NATURAL, -8,
MONS_SWAMP_DRAKE, 'd', BROWN, "swamp drake",M_SPELLCASTER | M_FLIES | M_RES_POISON,900, 11, MONS_SWAMP_DRAKE, MH_NATURAL, -3,{ 11, 0, 0, 0 },
MONS_SWAMP_DRAKE, 'l', BROWN, "swamp drake",M_SPELLCASTER | M_FLIES | M_EVIL,MR_RES_POISON,900, 11, MONS_DRAGON, MONS_SWAMP_DRAKE, MH_NATURAL, -3,{ 14, 0, 0, 0 },
M_RES_ELEC | M_RES_POISON | M_RES_COLD | M_SPELLCASTER | M_FLIES | M_SEE_INVIS,0, 12, MONS_YNOXINUL, MH_DEMONIC, -6,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_EVIL,MR_RES_ELEC | MR_RES_POISON | MR_RES_COLD,0, 12, MONS_YNOXINUL, MONS_YNOXINUL, MH_DEMONIC, -6,
M_SPELLCASTER | M_RES_ELEC | M_RES_FIRE | M_RES_COLD | M_RES_POISON | M_SEE_INVIS,0, 14, MONS_EXECUTIONER, MH_DEMONIC, -9,
M_SPELLCASTER | M_SEE_INVIS | M_EVIL,MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD | MR_RES_POISON,0, 14, MONS_EXECUTIONER, MONS_EXECUTIONER, MH_DEMONIC, -9,
M_RES_POISON | M_SPELLCASTER | M_ED_FIRE | M_RES_COLD | M_RES_ELEC | M_FLIES | M_SEE_INVIS,0, 14, MONS_BLUE_DEATH, MH_DEMONIC, -9,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_VUL_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 14, MONS_BLUE_DEATH, MONS_BLUE_DEATH, MH_DEMONIC, -9,
M_RES_POISON | M_RES_HELLFIRE | M_ED_COLD | M_SPELLCASTER | M_FLIES | M_SEE_INVIS,0, 14, MONS_BALRUG, MH_DEMONIC, -9,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_HELLFIRE | MR_VUL_COLD,0, 14, MONS_BALRUG, MONS_BALRUG, MH_DEMONIC, -9,
M_RES_POISON | M_RES_ELEC | M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS,0, 14, MONS_CACODEMON, MH_DEMONIC, -9,
M_SPELLCASTER | M_LEVITATE | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_ELEC,0, 14, MONS_CACODEMON, MONS_CACODEMON, MH_DEMONIC, -9,
M_RES_ELEC | M_RES_POISON | M_RES_COLD | M_RES_FIRE | M_SEE_INVIS,0, 12, MONS_DEMONIC_CRAWLER, MH_DEMONIC, -6,
M_SEE_INVIS | M_EVIL,MR_RES_ELEC | MR_RES_POISON | MR_RES_COLD | MR_RES_FIRE,0, 12, MONS_DEMONIC_CRAWLER, MONS_DEMONIC_CRAWLER, MH_DEMONIC, -6,
M_RES_ELEC | M_RES_POISON | M_ED_COLD | M_RES_HELLFIRE | M_SEE_INVIS | M_LEVITATE,0, 14, MONS_SUN_DEMON, MH_DEMONIC, -6,
M_SEE_INVIS | M_LEVITATE | M_EVIL,MR_RES_ELEC | MR_RES_POISON | MR_VUL_COLD | MR_RES_HELLFIRE,0, 14, MONS_SUN_DEMON, MONS_SUN_DEMON, MH_DEMONIC, -6,
M_RES_POISON | M_RES_COLD | M_RES_FIRE | M_RES_ELEC | M_SEE_INVIS | M_INVIS,0, 12, MONS_LOROCYPROCA, MH_DEMONIC, -7,
M_SEE_INVIS | M_INVIS | M_EVIL,MR_RES_POISON | MR_RES_COLD | MR_RES_FIRE | MR_RES_ELEC,0, 12, MONS_LOROCYPROCA, MONS_LOROCYPROCA, MH_DEMONIC, -7,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_LEVITATE | M_CONFUSED,0, 5, MONS_SPATIAL_VORTEX, MH_NONLIVING, 5000,
M_LEVITATE | M_CONFUSED,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 5, MONS_FIRE_VORTEX, MONS_SPATIAL_VORTEX, MH_NONLIVING, MAG_IMMUNE,
M_RES_POISON | M_RES_HELLFIRE | M_RES_COLD | M_FLIES | M_SEE_INVIS | M_RES_ELEC,0, 18, MONS_PIT_FIEND, MH_DEMONIC, -12,
M_FLIES | M_SEE_INVIS | M_EVIL | M_SPECIAL_ABILITY,MR_RES_POISON | MR_RES_HELLFIRE | MR_RES_COLD | MR_RES_ELEC,0, 18, MONS_FIEND, MONS_PIT_FIEND, MH_DEMONIC, -12,
M_RES_ELEC | M_RES_POISON | M_RES_FIRE | M_SEE_INVIS | M_SPELLCASTER | M_SPEAKS,0, 25, MONS_MNOLEG, MH_DEMONIC, 5000,
M_SEE_INVIS | M_SPELLCASTER | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE,0, 25, MONS_MNOLEG, MONS_MNOLEG, MH_DEMONIC, MAG_IMMUNE,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_LEVITATE | M_SEE_INVIS | M_SPELLCASTER | M_SPEAKS,0, 25, MONS_LOM_LOBON, MH_DEMONIC, 5000,
M_LEVITATE | M_SEE_INVIS | M_SPELLCASTER | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 25, MONS_LOM_LOBON, MONS_LOM_LOBON, MH_DEMONIC, MAG_IMMUNE,
M_RES_ELEC | M_RES_POISON | M_RES_HELLFIRE | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS,0, 25, MONS_CEREBOV, MH_DEMONIC, -6,
M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_ELEC | MR_RES_POISON | MR_RES_HELLFIRE,0, 25, MONS_CEREBOV, MONS_CEREBOV, MH_DEMONIC, -6,
M_RES_POISON | M_RES_COLD | M_RES_ELEC | M_LEVITATE | M_SEE_INVIS | M_SPELLCASTER | M_SPEAKS,0, 25, MONS_GLOORX_VLOQ, MH_DEMONIC, -14,
M_LEVITATE | M_SEE_INVIS | M_SPELLCASTER | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_POISON | MR_RES_COLD | MR_RES_ELEC,0, 25, MONS_GLOORX_VLOQ, MONS_GLOORX_VLOQ, MH_DEMONIC, -14,
M_RES_POISON | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD,750, 13, MONS_NAGA, MH_NATURAL, -6,{ 5, 0, 0, 0 },
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD,MR_RES_POISON,750, 13, MONS_NAGA, MONS_NAGA, MH_NATURAL, -6,{ 10, 0, 0, 0 },
M_RES_POISON | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD,750, 12, MONS_NAGA, MH_NATURAL, -6,{ 11, 0, 0, 0 },
M_SPELLCASTER | M_SEE_INVIS | M_WARM_BLOOD,MR_RES_POISON,750, 12, MONS_NAGA, MONS_NAGA, MH_NATURAL, -6,{ 20, 0, 0, 0 },
M_RES_POISON | M_RES_COLD | M_ED_FIRE | M_RES_ELEC | M_NO_SKELETON | M_SEE_INVIS,0, 11, MONS_AZURE_JELLY, MH_NATURAL, -4,
M_NO_SKELETON | M_SEE_INVIS,MR_RES_POISON | MR_RES_COLD | MR_VUL_FIRE | MR_RES_ELEC | MR_RES_ASPHYX,0, 11, MONS_JELLY, MONS_AZURE_JELLY, MH_NATURAL, -4,
M_RES_ELEC | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD | M_SPEAKS,0, 20, MONS_OGRE, MH_NATURAL, -7,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD| M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_ELEC,0, 20, MONS_OGRE, MONS_OGRE, MH_NATURAL, -7,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_EVIL | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_EVIL | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_RES_ELEC | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_UNIQUE,MR_RES_ELEC,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPEAKS | M_SEE_INVIS | M_RES_POISON | M_RES_FIRE | M_ED_COLD | M_FLIES,0, 20, MONS_DRAGON, MH_NATURAL, -7,
M_SPEAKS | M_SEE_INVIS | M_FLIES | M_SPECIAL_ABILITY | M_UNIQUE,MR_RES_POISON | MR_RES_FIRE | MR_VUL_COLD,0, 20, MONS_DRAGON, MONS_DRAGON, MH_NATURAL, -7,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_EVIL | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_EVIL | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD | M_SEE_INVIS,0, 20, MONS_HUMAN, MH_NATURAL, -5,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SPEAKS | M_WARM_BLOOD| M_SEE_INVIS | M_UNIQUE,MR_NO_FLAGS,0, 20, MONS_HUMAN, MONS_HUMAN, MH_NATURAL, -5,
M_RES_POISON | M_RES_COLD | M_RES_ELEC | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_SPEAKS,0, 23, MONS_LICH, MH_UNDEAD, -11,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_SPEAKS | M_EVIL| M_UNIQUE,MR_RES_POISON | MR_RES_COLD | MR_RES_ELEC,0, 23, MONS_LICH, MONS_LICH, MH_UNDEAD, -11,
M_RES_ELEC | M_RES_POISON | M_RES_HELLFIRE | M_RES_COLD | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS,0, 25, MONS_DISPATER, MH_DEMONIC, -10,
M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_ELEC | MR_RES_POISON | MR_RES_HELLFIRE | MR_RES_COLD,0, 25, MONS_DISPATER, MONS_DISPATER, MH_DEMONIC, -10,
M_RES_ELEC | M_RES_POISON | M_RES_HELLFIRE | M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_SPEAKS,0, 25, MONS_ASMODEUS, MH_DEMONIC, -12,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_ELEC | MR_RES_POISON | MR_RES_HELLFIRE,0, 25, MONS_ASMODEUS, MONS_ASMODEUS, MH_DEMONIC, -12,
M_RES_ELEC | M_RES_POISON | M_RES_COLD | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS,0, 25, MONS_ERESHKIGAL, MH_DEMONIC, -10,
M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS | M_EVIL | M_UNIQUE,MR_RES_ELEC | MR_RES_POISON | MR_RES_COLD,0, 25, MONS_ERESHKIGAL, MONS_ERESHKIGAL, MH_DEMONIC, -10,
M_RES_POISON | M_RES_COLD | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_RES_FIRE | M_RES_ELEC,0, 20, MONS_LICH, MH_UNDEAD, -14,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_COLD | MR_RES_FIRE | MR_RES_ELEC,0, 20, MONS_LICH, MONS_LICH, MH_UNDEAD, -14,
M_RES_ELEC | M_RES_POISON | M_RES_HELLFIRE | M_RES_COLD | M_LEVITATE | M_SPELLCASTER | M_SEE_INVIS,0, 50, MONS_CURSE_SKULL, MH_UNDEAD, 5000,
M_LEVITATE | M_SPELLCASTER | M_SEE_INVIS | M_EVIL,MR_RES_ELEC | MR_RES_POISON | MR_RES_HELLFIRE | MR_RES_COLD,0, 50, MONS_LICH, MONS_CURSE_SKULL, MH_UNDEAD, MAG_IMMUNE,
M_RES_POISON | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD,750, 10, MONS_NAGA, MH_NATURAL, 5000,{ 18, 0, 0, 0 },
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_WARM_BLOOD,MR_RES_POISON,750, 10, MONS_NAGA, MONS_NAGA, MH_NATURAL, MAG_IMMUNE,{ 24, 0, 0, 0 },
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_SEE_INVIS,0, 12, MONS_SKELETAL_DRAGON, MH_UNDEAD, -4,
M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 12, MONS_SKELETAL_WARRIOR, MONS_SKELETAL_DRAGON, MH_UNDEAD, -4,
M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_RES_ELEC | M_SEE_INVIS | M_AMPHIBIOUS,0, 10, MONS_TENTACLED_MONSTROSITY, MH_NATURAL, -5,
M_SEE_INVIS | M_AMPHIBIOUS,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_TENTACLED_MONSTROSITY, MONS_TENTACLED_MONSTROSITY, MH_NATURAL, -5,
M_RES_POISON | M_RES_COLD | M_RES_ELEC | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS,0, 20, MONS_MUMMY, MH_UNDEAD, 5000,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_COLD | MR_RES_ELEC,0, 20, MONS_MUMMY, MONS_MUMMY, MH_UNDEAD, MAG_IMMUNE,
M_RES_POISON | M_RES_COLD | M_RES_ELEC | M_SPELLCASTER | M_PRIEST | M_SEE_INVIS,0, 16, MONS_MUMMY, MH_UNDEAD, 5000,
M_SPELLCASTER | M_PRIEST | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_COLD | MR_RES_ELEC,0, 16, MONS_MUMMY, MONS_MUMMY, MH_UNDEAD, MAG_IMMUNE,
},{ // Base draconian -- for use like MONS_HUMAN, MONS_ELF although we// now store the draconian subspecies in the high byte of mon->number// for those listed as species MONS_DRACONIAN.MONS_DRACONIAN, 'd', BROWN, "draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -1,{ 15, 0, 0, 0 },{ 3, 6, 4, 0 },7, 8, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_BLACK_DRACONIAN, 'd', DARKGREY, "black draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_RES_ELEC,900, 10, MONS_DRACONIAN, MONS_BLACK_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 10, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_YELLOW_DRACONIAN, 'd', YELLOW, "yellow draconian",M_FLIES | M_HUMANOID | M_COLD_BLOOD | M_SPECIAL_ABILITY,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_YELLOW_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 10, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_PALE_DRACONIAN, 'd', LIGHTGREY, "pale draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_RES_FIRE,900, 10, MONS_DRACONIAN, MONS_PALE_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 14, 12, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_GREEN_DRACONIAN, 'd', LIGHTGREEN, "green draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_RES_POISON,900, 10, MONS_DRACONIAN, MONS_GREEN_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 10, 10, 10, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_PURPLE_DRACONIAN, 'd', MAGENTA, "purple draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_PURPLE_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },8, 10, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_RED_DRACONIAN, 'd', RED, "red draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD | M_SPECIAL_ABILITY,MR_RES_FIRE,900, 10, MONS_DRACONIAN, MONS_RED_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 10, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT
{MONS_WHITE_DRACONIAN, 'd', WHITE, "white draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD | M_SPECIAL_ABILITY,MR_RES_COLD,900, 10, MONS_DRACONIAN, MONS_WHITE_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 10, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_MOTTLED_DRACONIAN, 'd', LIGHTMAGENTA, "mottled draconian",M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_RES_FIRE,900, 10, MONS_DRACONIAN, MONS_MOTTLED_DRACONIAN, MH_NATURAL, -2,{ 20, 0, 0, 0 },{ 14, 5, 4, 0 },9, 10, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},
MONS_DRACONIAN_CALLER, 'd', BROWN, "draconian caller",M_SPELLCASTER | M_ACTUAL_SPELLS | M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -3,{ 20, 0, 0, 0 },{ 16, 4, 3, 0 },9, 10, 10, 10, MST_DRAC_CALLER, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_DRACONIAN_MONK, 'd', BLUE, "draconian monk",M_FIGHTER | M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -3,{ 35, 20, 15, 0 },{ 16, 6, 3, 0 },6, 20, 10, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_DRACONIAN_ZEALOT, 'd', LIGHTBLUE, "draconian zealot",M_SPELLCASTER | M_HUMANOID | M_PRIEST | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -3,{ 15, 0, 0, 0 },{ 16, 4, 2, 0 },12, 10, 10, 10, MST_DEEP_ELF_HIGH_PRIEST, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_DRACONIAN_SHIFTER, 'd', LIGHTCYAN, "draconian shifter",M_SPELLCASTER | M_ACTUAL_SPELLS | M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -4,{ 15, 0, 0, 0 },{ 16, 4, 4, 0 },8, 16, 10, 10, MST_DRAC_SHIFTER, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_DRACONIAN_ANNIHILATOR, 'd', GREEN, "draconian annihilator",M_SPELLCASTER | M_ACTUAL_SPELLS | M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -4,{ 15, 0, 0, 0 },{ 16, 4, 2, 0 },8, 10, 10, 10, MST_DEEP_ELF_ANNIHILATOR, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_DRACONIAN_KNIGHT, 'd', CYAN, "draconian knight",M_SPELLCASTER | M_HUMANOID | M_FIGHTER | M_FLIES | M_COLD_BLOOD,MR_NO_FLAGS,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -4,{ 15, 0, 0, 0 },{ 16, 6, 4, 0 },12, 12, 10, 6, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{MONS_DRACONIAN_SCORCHER, 'd', LIGHTRED, "draconian scorcher",M_SPELLCASTER | M_ACTUAL_SPELLS | M_HUMANOID | M_FLIES | M_COLD_BLOOD,MR_RES_FIRE | MR_RES_HELLFIRE,900, 10, MONS_DRACONIAN, MONS_DRACONIAN, MH_NATURAL, -4,{ 15, 0, 0, 0 },{ 16, 4, 2, 0 },8, 12, 10, 10, MST_DRAC_SCORCHER, CE_CONTAMINATED, Z_SMALL, S_ROAR, I_HIGH,MONUSE_STARTING_EQUIPMENT},{
M_RES_FIRE | M_RES_COLD | M_RES_POISON | M_SEE_INVIS | M_SPEAKS | M_WARM_BLOOD,0, 15, MONS_KILLER_KLOWN, MH_NATURAL, 5000,
M_SEE_INVIS | M_SPEAKS | M_WARM_BLOOD | M_SPECIAL_ABILITY,MR_RES_FIRE | MR_RES_COLD | MR_RES_POISON,0, 15, MONS_HUMAN, MONS_KILLER_KLOWN, MH_NATURAL, MAG_IMMUNE,
M_SPELLCASTER | M_RES_ELEC | M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_SEE_INVIS,0, 10, MONS_ELECTRIC_GOLEM, MH_NONLIVING, 5000,
M_SPELLCASTER | M_SEE_INVIS,MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD,0, 10, MONS_CLAY_GOLEM, MONS_ELECTRIC_GOLEM, MH_NONLIVING, MAG_IMMUNE,
M_FLIES | M_RES_ELEC | M_CONFUSED | M_SPELLCASTER,0, 20, MONS_BALL_LIGHTNING, MH_NONLIVING, 5000,
M_FLIES | M_CONFUSED | M_SPELLCASTER | M_SPECIAL_ABILITY,MR_RES_ELEC,0, 20, MONS_BALL_LIGHTNING, MONS_BALL_LIGHTNING, MH_NONLIVING, MAG_IMMUNE,
M_SPELLCASTER | M_FLIES | M_RES_ELEC | M_RES_FIRE | M_RES_COLD | M_RES_POISON | M_SEE_INVIS,0, 10, MONS_ORB_OF_FIRE, MH_NONLIVING, 5000,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS,MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD | MR_RES_POISON,0, 10, MONS_ORB_OF_FIRE, MONS_ORB_OF_FIRE, MH_NONLIVING, MAG_IMMUNE,
MONS_CURSE_TOE, 'z', DARKGREY, "curse toe",M_RES_ELEC | M_RES_POISON | M_RES_HELLFIRE | M_RES_COLD | M_LEVITATE | M_SPELLCASTER | M_SEE_INVIS,0, 60, MONS_CURSE_TOE, MH_UNDEAD, 5000,
MONS_CURSE_TOE, 'z', YELLOW, "curse toe",M_LEVITATE | M_SPELLCASTER | M_SEE_INVIS | M_EVIL,MR_RES_ELEC | MR_RES_POISON | MR_RES_HELLFIRE | MR_RES_COLD,0, 60, MONS_LICH, MONS_CURSE_TOE, MH_UNDEAD, MAG_IMMUNE,
M_NO_SKELETON | M_RES_POISON | M_RES_ELEC | M_RES_FIRE | M_RES_COLD,0, 13, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON,MR_RES_POISON | MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD,0, 13, MONS_GOLD_MIMIC, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON | M_RES_POISON | M_RES_ELEC | M_RES_FIRE | M_RES_COLD,0, 13, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON,MR_RES_POISON | MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD,0, 13, MONS_GOLD_MIMIC, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON | M_RES_POISON | M_RES_ELEC | M_RES_FIRE | M_RES_COLD,0, 13, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON,MR_RES_POISON | MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD,0, 13, MONS_GOLD_MIMIC, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON | M_RES_POISON | M_RES_ELEC | M_RES_FIRE | M_RES_COLD,0, 13, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON,MR_RES_POISON | MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD,0, 13, MONS_GOLD_MIMIC, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON | M_RES_POISON | M_RES_ELEC | M_RES_FIRE | M_RES_COLD,0, 13, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_NO_SKELETON,MR_RES_POISON | MR_RES_ELEC | MR_RES_FIRE | MR_RES_COLD,0, 13, MONS_GOLD_MIMIC, MONS_GOLD_MIMIC, MH_NONLIVING, -3,
M_SPELLCASTER | M_RES_POISON | M_RES_HELLFIRE | M_FLIES | M_SEE_INVIS,0, 18, MONS_SERPENT_OF_HELL, MH_DEMONIC, -13,
M_SPELLCASTER | M_FLIES | M_SEE_INVIS | M_EVIL,MR_RES_POISON | MR_RES_HELLFIRE,0, 18, MONS_SERPENT_OF_HELL, MONS_SERPENT_OF_HELL, MH_DEMONIC, -13,
M_SPELLCASTER | M_RES_POISON | M_RES_COLD | M_ACTUAL_SPELLS,0, 10, MONS_SKELETAL_WARRIOR, MH_UNDEAD, -7,
M_SPELLCASTER | M_ACTUAL_SPELLS | M_EVIL,MR_RES_POISON | MR_RES_COLD,0, 10, MONS_SKELETAL_WARRIOR, MONS_SKELETAL_WARRIOR, MH_UNDEAD, -7,
M_RES_POISON | M_SPEAKS | M_SPELLCASTER | M_ACTUAL_SPELLS | M_FLIES,0, 15, MONS_PLAYER_GHOST, MH_UNDEAD, -5,
M_SPEAKS | M_SPELLCASTER | M_ACTUAL_SPELLS | M_FLIES | M_UNIQUE,MR_RES_POISON,0, 15, MONS_PHANTOM, MONS_PLAYER_GHOST, MH_UNDEAD, -5,
M_NO_SKELETON | M_RES_ELEC | M_RES_POISON | M_RES_FIRE | M_RES_COLD | M_SEE_INVIS,1000, 10, MONS_SHUGGOTH, MH_DEMONIC, 300,
M_NO_SKELETON | M_SEE_INVIS,MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD,1000, 10, MONS_SHUGGOTH, MONS_SHUGGOTH, MH_DEMONIC, 300,
MONUSE_NOTHING},{MONS_ORANGE_STATUE, '8', LIGHTRED, "orange crystal statue",M_SPECIAL_ABILITY,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_CLAY_GOLEM, MONS_ORANGE_STATUE, MH_NONLIVING, MAG_IMMUNE,{ 0, 0, 0, 0 },{ 3, 50, 30, 120 },30, 3, 10, 7, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_HIGH,MONUSE_NOTHING},{MONS_SILVER_STATUE, '8', WHITE, "silver statue",M_SPECIAL_ABILITY,MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,0, 10, MONS_CLAY_GOLEM, MONS_SILVER_STATUE, MH_NONLIVING, MAG_IMMUNE,{ 0, 0, 0, 0 },{ 3, 50, 0, 120 },30, 3, 10, 7, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_HIGH,
bool grid_is_wall(int grid);bool grid_is_opaque(int grid);bool grid_is_solid(int grid);bool grid_is_water(int grid);god_type grid_altar_god( unsigned char grid );bool grid_is_branch_stairs( unsigned char grid );int grid_secret_door_appearance( int gx, int gy );bool grid_destroys_items( int grid );const char *grid_item_destruction_message( unsigned char grid );void curare_hits_player(int agent, int degree);bool i_feel_safe();//////////////////////////////////////////////////////////////////////// Places and names//unsigned short get_packed_place();unsigned short get_packed_place( unsigned char branch, int subdepth,char level_type );
// Prepositional form of branch level name. For example, "in the// Abyss" or "on level 3 of the Main Dungeon".std::string prep_branch_level_name(unsigned short packed_place);std::string prep_branch_level_name();// Get displayable depth in the current branch, given the absolute// depth.int subdungeon_depth(unsigned char branch, int depth);// Get absolute depth given the displayable depth in the branch.int absdungeon_depth(unsigned char branch, int subdepth);//////////////////////////////////////////////////////////////////////
bool grid_is_wall( int grid ){return (grid == DNGN_ROCK_WALL|| grid == DNGN_STONE_WALL|| grid == DNGN_METAL_WALL|| grid == DNGN_GREEN_CRYSTAL_WALL|| grid == DNGN_WAX_WALL|| grid == DNGN_PERMAROCK_WALL);}bool grid_is_opaque( int grid ){return (grid < MINSEE && grid != DNGN_ORCISH_IDOL);}bool grid_is_solid( int grid ){return (grid < MINMOVE);}bool grid_is_water( int grid ){return (grid == DNGN_SHALLOW_WATER || grid == DNGN_DEEP_WATER);}bool grid_destroys_items( int grid ){return (grid == DNGN_LAVA || grid == DNGN_DEEP_WATER);}// returns 0 is grid is not an altar, else it returns the GOD_* typegod_type grid_altar_god( unsigned char grid ){if (grid >= DNGN_ALTAR_ZIN && grid <= DNGN_ALTAR_ELYVILON)return (static_cast<god_type>( grid - DNGN_ALTAR_ZIN + 1 ));return (GOD_NO_GOD);}bool grid_is_branch_stairs( unsigned char grid ){return ((grid >= DNGN_ENTER_ORCISH_MINES && grid <= DNGN_ENTER_RESERVED_4)|| (grid >= DNGN_ENTER_DIS && grid <= DNGN_ENTER_TARTARUS));}int grid_secret_door_appearance( int gx, int gy ){int ret = DNGN_FLOOR;for (int dx = -1; dx <= 1; dx++){for (int dy = -1; dy <= 1; dy++){// only considering orthogonal gridsif ((abs(dx) + abs(dy)) % 2 == 0)continue;const int targ = grd[gx + dx][gy + dy];if (!grid_is_wall( targ ))continue;if (ret == DNGN_FLOOR)ret = targ;else if (ret != targ)ret = ((ret < targ) ? ret : targ);}}return ((ret == DNGN_FLOOR) ? DNGN_ROCK_WALL: ret);}const char *grid_item_destruction_message( unsigned char grid ){return grid == DNGN_DEEP_WATER? "You hear a splash.": grid == DNGN_LAVA ? "You hear a sizzling splash.": "You hear an empty echo.";}
if (you.species == SP_PALE_DRACONIAN && you.experience_level > 5){mpr("It doesn't seem to affect you.");return;}if (player_equip( EQ_BODY_ARMOUR, ARM_STEAM_DRAGON_ARMOUR ))
if (player_res_steam() > 0)
if (!player_res_asphyx()){int hurted = roll_dice(2, 6);// Note that the hurtage is halved by poison resistance.if (res_poison)hurted /= 2;if (hurted){mpr("You feel difficulty breathing.");ouch( hurted, agent, KILLED_BY_CURARE, "curare-induced apnoea" );}potion_effect(POT_SLOWING, 2 + random2(4 + degree));}}
if (you.level_type == LEVEL_LABYRINTH || you.level_type == LEVEL_ABYSS|| you.level_type == LEVEL_PANDEMONIUM)
// When going downstairs into a special level, delete any previous// instances of itif (you.level_type == LEVEL_LABYRINTH ||you.level_type == LEVEL_ABYSS ||you.level_type == LEVEL_PANDEMONIUM)
char glorpstr[kFileNameSize];char del_file[kFileNameSize];int sysg;#ifdef SAVE_DIR_PATHsnprintf( glorpstr, sizeof(glorpstr),SAVE_DIR_PATH "%s%d", you.your_name, (int) getuid() );#elsestrncpy(glorpstr, you.your_name, kFileNameLen);// glorpstr [strlen(glorpstr)] = 0;// This is broken. Length is not valid yet! We have to check if we got// a trailing NULL; if not, write one:/* is name 6 chars or more? */if (strlen(you.your_name) > kFileNameLen - 1)glorpstr[kFileNameLen] = '\0';#endifstrcpy(del_file, glorpstr);strcat(del_file, ".lab");#ifdef DOSstrupr(del_file);#endifsysg = unlink(del_file);
std::string lname = make_filename(you.your_name, you.your_level,you.where_are_you,true, false );
escape = true;
{// back out the way we came in, if possibleif (grid_distance( you.x_pos, you.y_pos, entry_x, entry_y ) == 1&& (entry_x != empty[0] || entry_y != empty[1])){escape = true;empty[0] = entry_x;empty[1] = entry_y;}else // zero or two or more squares away, with no way back{escape = false;}}
bool i_feel_safe(){/* This is probably unnecessary, but I'm not sure thatyou're always at least 9 away from a wall */int ystart = you.y_pos - 9, xstart = you.x_pos - 9;int yend = you.y_pos + 9, xend = you.x_pos + 9;if ( xstart < 0 ) xstart = 0;if ( ystart < 0 ) ystart = 0;if ( xend >= GXM ) xend = 0;if ( ystart >= GYM ) yend = 0;/* statue check */if (you.visible_statue[STATUE_SILVER] ||you.visible_statue[STATUE_ORANGE_CRYSTAL] )return false;/* monster check */for ( int y = ystart; y < yend; ++y ) {for ( int x = xstart; x < xend; ++x ) {/* if you can see a nonfriendly monster then you feelunsafe */if ( see_grid(x,y) ) {const unsigned char targ_monst = mgrd[x][y];if ( targ_monst != NON_MONSTER ) {struct monsters *mon = &menv[targ_monst];if ( !mons_friendly(mon) &&player_monster_visible(mon) &&!mons_is_mimic(mon->type) &&(!Options.safe_zero_exp ||!mons_class_flag( mon->type, M_NO_EXP_GAIN ))) {return false;}}}}}return true;}// Do not attempt to use level_id if level_type != LEVEL_DUNGEONstd::string short_place_name(level_id id){return short_place_name(get_packed_place(id.branch, id.depth, LEVEL_DUNGEON));}unsigned short get_packed_place( unsigned char branch, int subdepth,char level_type ){unsigned short place = (unsigned short)( (branch << 8) | (subdepth & 0xFF) );if (level_type == LEVEL_ABYSS || level_type == LEVEL_PANDEMONIUM|| level_type == LEVEL_LABYRINTH)place = (unsigned short) ( (level_type << 8) | 0xFF );return place;}unsigned short get_packed_place(){return get_packed_place( you.where_are_you,subdungeon_depth(you.where_are_you, you.your_level),you.level_type );}std::string place_name( unsigned short place, bool long_name,bool include_number ) {unsigned char branch = (unsigned char) ((place >> 8) & 0xFF);int lev = place & 0xFF;std::string result;if (lev == 0xFF){switch (branch){case LEVEL_ABYSS:return ( long_name ? "The Abyss" : "Abyss" );case LEVEL_PANDEMONIUM:return ( long_name ? "Pandemonium" : "Pan" );case LEVEL_LABYRINTH:return ( long_name ? "a Labyrinth" : "Lab" );default:return ( long_name ? "Buggy Badlands" : "Bug" );}}else{switch (branch){case BRANCH_VESTIBULE_OF_HELL:return ( long_name ? "The Vestibule of Hell" : "Hell" );case BRANCH_HALL_OF_BLADES:return ( long_name ? "The Hall of Blades" : "Blade" );case BRANCH_ECUMENICAL_TEMPLE:return ( long_name ? "The Ecumenical Temple" : "Temple" );case BRANCH_DIS:result = ( long_name ? "The Iron City of Dis" : "Dis");break;case BRANCH_GEHENNA:result = ( long_name ? "Gehenna" : "Geh" );break;case BRANCH_COCYTUS:result = ( long_name ? "Cocytus" : "Coc" );break;case BRANCH_TARTARUS:result = ( long_name ? "Tartarus" : "Tar" );break;case BRANCH_ORCISH_MINES:result = ( long_name ? "The Orcish Mines" : "Orc" );break;case BRANCH_HIVE:result = ( long_name ? "The Hive" : "Hive" );break;case BRANCH_LAIR:result = ( long_name ? "The Lair" : "Lair" );break;case BRANCH_SLIME_PITS:result = ( long_name ? "The Slime Pits" : "Slime" );break;case BRANCH_VAULTS:result = ( long_name ? "The Vaults" : "Vault" );break;case BRANCH_CRYPT:result = ( long_name ? "The Crypt" : "Crypt" );break;case BRANCH_HALL_OF_ZOT:result = ( long_name ? "The Hall of Zot" : "Zot" );break;case BRANCH_SNAKE_PIT:result = ( long_name ? "The Snake Pit" : "Snake" );break;case BRANCH_ELVEN_HALLS:result = ( long_name ? "The Elven Halls" : "Elf" );break;case BRANCH_TOMB:result = ( long_name ? "The Tomb" : "Tomb" );break;case BRANCH_SWAMP:result = ( long_name ? "The Swamp" : "Swamp" );break;default:result = ( long_name ? "The Dungeon" : "D" );break;}}if ( include_number ) {char buf[200];if ( long_name ) {// decapitalize 'the'if ( result.find("The") == 0 )result[0] = 't';snprintf( buf, sizeof buf, "Level %d of %s",lev, result.c_str() );}else if (lev) {snprintf( buf, sizeof buf, "%s:%d",result.c_str(), lev );}else {snprintf( buf, sizeof buf, "%s:$",result.c_str() );}result = buf;}return result;}// Takes a packed 'place' and returns a compact stringified place name.// XXX: This is done in several other places; a unified function to// describe places would be nice.std::string short_place_name(unsigned short place){return place_name( place, false, true );}// Prepositional form of branch level name. For example, "in the// Abyss" or "on level 3 of the Main Dungeon".std::string prep_branch_level_name(unsigned short packed_place){std::string place = place_name( packed_place, true, true );if (place.length() && place != "Pandemonium")place[0] = tolower(place[0]);return (place.find("level") == 0?"on " + place: "in " + place);}// Use current branch and depthstd::string prep_branch_level_name(){return prep_branch_level_name( get_packed_place() );}int absdungeon_depth(unsigned char branch, int subdepth){int realdepth = subdepth - 1;if (branch >= BRANCH_ORCISH_MINES && branch <= BRANCH_SWAMP)realdepth = subdepth + you.branch_stairs[branch - 10];if (branch >= BRANCH_DIS && branch <= BRANCH_THE_PIT)realdepth = subdepth + 26;return realdepth;}int subdungeon_depth(unsigned char branch, int depth){int curr_subdungeon_level = depth + 1;if (branch >= BRANCH_DIS && branch <= BRANCH_THE_PIT)curr_subdungeon_level = depth - 26;if (branch >= BRANCH_ORCISH_MINES && branch <= BRANCH_SWAMP)curr_subdungeon_level = depth- you.branch_stairs[branch - 10];return curr_subdungeon_level;}
,svn**/.svn/*.*
static void do_message_print( int channel, int param,const char *format, va_list argp ){char buff[200];vsnprintf( buff, sizeof( buff ), format, argp );buff[199] = 0;mpr(buff, channel, param);}void mprf( int channel, const char *format, ... ){va_list argp;va_start( argp, format );do_message_print( channel, 0, format, argp );va_end( argp );}void mprf( const char *format, ... ){va_list argp;va_start( argp, format );do_message_print( MSGCH_PLAIN, 0, format, argp );va_end( argp );}
char info2[80];
char mbuf[400];size_t i = 0;const int stepsize = get_number_of_cols() - 1;const size_t msglen = strlen(inf);const int lookback_size = (stepsize < 12 ? 0 : 12);// if a message is exactly STEPSIZE characters long,// it should precisely fit in one line. The printing is thus// from I to I + STEPSIZE - 1. Stop when I reaches MSGLEN.while ( i < msglen || i == 0 ){strncpy( mbuf, inf + i, stepsize );mbuf[stepsize] = 0;// did the message break?if ( i + stepsize < msglen ){// yes, find a nicer place to break it.int lookback, where = 0;for ( lookback = 0; lookback < lookback_size; ++lookback ){where = stepsize - 1 - lookback;if ( where >= 0 && isspace(mbuf[where]) )// aha!break;}
if ( lookback != lookback_size ){// found a good spot to breakmbuf[where] = 0;i += where + 1; // skip past the space!}elsei += stepsize;}elsei += stepsize;base_mpr( mbuf, channel, param );}}static void base_mpr(const char *inf, int channel, int param){if (suppress_messages)return;
class formatted_string{public:formatted_string() : ops() { }formatted_string(const std::string &s, bool init_style = false);operator std::string() const;void display(int start = 0, int end = -1) const;std::string tostring(int start = 0, int end = -1) const;void cprintf(const char *s, ...);void cprintf(const std::string &s);void gotoxy(int x, int y);void movexy(int delta_x, int delta_y);void textcolor(int color);void clear();std::string::size_type length() const;const formatted_string &operator += (const formatted_string &other);public:static formatted_string parse_string(const std::string &s,bool eol_ends_format = true,bool (*process_tag)(const std::string &tag) = NULL );
private:enum fs_op_type{FSOP_COLOUR,FSOP_CURSOR,FSOP_TEXT};static int get_colour(const std::string &tag);private:struct fs_op{fs_op_type type;int x, y;bool relative;std::string text;fs_op(int color): type(FSOP_COLOUR), x(color), y(-1), relative(false), text(){}fs_op(int cx, int cy, bool rel = false): type(FSOP_CURSOR), x(cx), y(cy), relative(rel), text(){}fs_op(const std::string &s): type(FSOP_TEXT), x(-1), y(-1), relative(false), text(s){}operator fs_op_type () const{return type;}void display() const;};std::vector<fs_op> ops;};
MF_NOSELECT = 0, // No selection is permittedMF_SINGLESELECT = 1, // Select just one itemMF_MULTISELECT = 2, // Select multiple itemsMF_NO_SELECT_QTY = 4, // Disallow partial selectionsMF_ANYPRINTABLE = 8, // Any printable character is valid, and// closes the menu.MF_SELECT_ANY_PAGE = 16, // Allow selections to occur on any page.
MF_NOSELECT = 0x0000, // No selection is permittedMF_SINGLESELECT = 0x0001, // Select just one itemMF_MULTISELECT = 0x0002, // Select multiple itemsMF_NO_SELECT_QTY = 0x0004, // Disallow partial selectionsMF_ANYPRINTABLE = 0x0008, // Any printable character is valid, and// closes the menu.MF_SELECT_BY_PAGE = 0x0010, // Allow selections to occur only on// currently visible page.
void do_menu( std::vector<MenuEntry*> *selected );virtual void draw_select_count( int count );void draw_item( int index ) const;
protected:void do_menu();virtual void draw_select_count(int count, bool force = false);virtual void draw_item( int index ) const;virtual void draw_item(int index, const MenuEntry *me) const;virtual void draw_stock_item(int index, const MenuEntry *me) const;
void draw_menu( std::vector<MenuEntry*> *selected );bool page_down();bool line_down();bool page_up();bool line_up();
virtual void write_title();virtual void draw_menu();virtual bool page_down();virtual bool line_down();virtual bool page_up();virtual bool line_up();virtual int pre_process(int key);virtual int post_process(int key);bool in_page(int index) const;
};// Uses a sliding selector rather than hotkeyed selection.class slider_menu : public Menu{public:// Multiselect would be awkward to implement.slider_menu(int flags = MF_SINGLESELECT);void display();std::vector<MenuEntry *> show();void set_search(const std::string &search);void set_limits(int starty, int endy);const MenuEntry *selected_entry() const;protected:int item_colour(int index, const MenuEntry *me) const;void draw_stock_item(int index, const MenuEntry *me) const;void draw_menu();void new_selection(int nsel);bool move_selection(int nsel);bool page_down();bool line_down();bool page_up();bool line_up();bool is_set(int flag) const;void select_items( int key, int qty );bool fix_entry();bool process_key( int keyin );int post_process(int key);void select_search(const std::string &search);protected:formatted_string less;int starty, endy;int selected;std::string search;};// This is only tangentially related to menus, but what the heck.// Note, column margins start on 1, not 0.class column_composer{public:// Number of columns and left margins for 2nd, 3rd, ... nth column.column_composer(int ncols, ...);void clear();void add_formatted(int ncol,const std::string &tagged_text,bool add_separator = true,bool eol_ends_format = true,bool (*text_filter)(const std::string &tag) = NULL,int margin = -1);std::vector<formatted_string> formatted_lines() const;void set_pagesize(int pagesize);private:struct column;void compose_formatted_column(const std::vector<formatted_string> &lines,int start_col,int margin);void strip_blank_lines(std::vector<formatted_string> &) const;private:struct column{int margin;int lines;column(int marg = 1) : margin(marg), lines(0) { }};int ncols, pagesize;std::vector<column> columns;std::vector<formatted_string> flines;
// Lose lines for the title + room for more.pagesize = get_number_of_lines() - 2;
// Lose lines for the title + room for -more- line.pagesize = get_number_of_lines() - !!title - 1;if (max_pagesize > 0 && pagesize > max_pagesize)pagesize = max_pagesize;
case CK_ENTER:return false;case CK_ESCAPE:sel->clear();lastch = keyin;return false;case ' ': case CK_PGDN: case '>': case '\'':nav = true;repaint = page_down();if (!repaint && flags && !is_set(MF_EASY_EXIT)){repaint = first_entry != 0;first_entry = 0;}break;case CK_PGUP: case '<': case ';':nav = true;repaint = page_up();break;case CK_UP:nav = true;repaint = line_up();break;case CK_DOWN:nav = true;repaint = line_down();break;default:lastch = keyin;
case 0:return true;case CK_ENTER:return false;case CK_ESCAPE:sel.clear();lastch = keyin;return false;case ' ': case CK_PGDN: case '>': case '\'':nav = true;repaint = page_down();if (!repaint && !is_set(MF_EASY_EXIT) && !is_set(MF_NOWRAP)){repaint = first_entry != 0;first_entry = 0;}break;case CK_PGUP: case '<': case ';':nav = true;repaint = page_up();break;case CK_UP:nav = true;repaint = line_up();break;case CK_DOWN:nav = true;repaint = line_down();break;default:keyin = post_process(keyin);lastch = keyin;
if (!is_set(MF_NO_SELECT_QTY) && isdigit( keyin )){if (num > 999)num = -1;num = (num == -1)? keyin - '0' :num * 10 + keyin - '0';}select_items( keyin, num );get_selected( sel );if (sel->size() == 1 && (flags & MF_SINGLESELECT))return false;draw_select_count( sel->size() );
if (!is_set(MF_NO_SELECT_QTY) && isdigit( keyin )){if (num > 999)num = -1;num = (num == -1)? keyin - '0' :num * 10 + keyin - '0';}select_items( keyin, num );get_selected( &sel );if (sel.size() == 1 && (flags & MF_SINGLESELECT))return false;draw_select_count( sel.size() );
}/////////////////////////////////////////////////////////////////// slider_menuslider_menu::slider_menu(int fl): Menu(fl), less(), starty(1), endy(get_number_of_lines()),selected(0), search(){less.textcolor(DARKGREY);less.cprintf("<---- More");more.clear();more.textcolor(DARKGREY);more.cprintf("More ---->");}void slider_menu::set_search(const std::string &s){search = s;}void slider_menu::set_limits(int y1, int y2){starty = y1;endy = y2;}void slider_menu::select_search(const std::string &s){std::string srch = s;tolower_string(srch);for (int i = 0, size = items.size(); i < size; ++i){std::string text = items[i]->get_text();tolower_string(text);std::string::size_type found = text.find(srch);if (found != std::string::npos&& found == text.find_first_not_of(" ")){move_selection(i);break;}}}int slider_menu::post_process(int key){select_search( search += key );return (key);}bool slider_menu::process_key(int key){// Some of this key processing should really be in a user-passed-in function// If we ever need to use slider_menu elsewhere, we should factor it out.if (key == CK_ESCAPE || key == '\t'){int old = selected;selected = -1;draw_item(old);sel.clear();search.clear();lastch = key;return (false);}if (selected == 0 &&(key == CK_UP || key == CK_PGUP || key == '<' || key == ';') &&Menu::is_set(MF_EASY_EXIT)){int old = selected;selected = -1;draw_item(old);search.clear();return (false);}return Menu::process_key(key);}void slider_menu::display(){// We lose two lines for each of the --More promptspagesize = endy - starty - 1 - !!title;selected = -1;draw_menu();}std::vector<MenuEntry *> slider_menu::show(){cursor_control coff(false);sel.clear();// We lose two lines for each of the --More promptspagesize = endy - starty - 1 - !!title;if (selected == -1)selected = 0;select_search(search);do_menu();if (selected >= 0 && selected <= (int) items.size())sel.push_back(items[selected]);return (sel);}const MenuEntry *slider_menu::selected_entry() const{if (selected >= 0 && selected <= (int) items.size())return (items[selected]);return (NULL);}void slider_menu::draw_stock_item(int index, const MenuEntry *me) const{Menu::draw_stock_item(index, me);cprintf("%-*s", get_number_of_cols() - wherex() + 1, "");}int slider_menu::item_colour(int index, const MenuEntry *me) const{int colour = Menu::item_colour(index, me);if (index == selected && selected != -1){#if defined(WIN32CONSOLE) || defined(DOS)colour = dos_brand(colour, CHATTR_REVERSE);#elsecolour |= COLFLAG_REVERSE;#endif}return (colour);}void slider_menu::draw_menu(){gotoxy(1, starty);write_title();y_offset = starty + !!title + 1;int end = first_entry + pagesize;if (end > (int) items.size()) end = items.size();// We're using get_number_of_cols() - 1 because we want to avoid line wrap// on DOS (the conio.h functions go batshit if that happens).gotoxy(1, y_offset - 1);if (first_entry > 0)less.display();else{textattr(LIGHTGREY);cprintf("%-*s", get_number_of_cols() - 1, "");}for (int i = first_entry; i < end; ++i)draw_item( i );textattr(LIGHTGREY);for (int i = end; i < first_entry + pagesize; ++i){gotoxy(1, y_offset + i - first_entry);cprintf("%-*s", get_number_of_cols() - 1, "");}gotoxy( 1, y_offset + pagesize );if (end < (int) items.size() || is_set(MF_ALWAYS_SHOW_MORE))more.display();else{textattr(LIGHTGREY);cprintf("%-*s", get_number_of_cols() - 1, "");}}void slider_menu::select_items(int, int){// Ignored.}bool slider_menu::is_set(int flag) const{if (flag == MF_EASY_EXIT)return (false);return Menu::is_set(flag);}bool slider_menu::fix_entry(){if (selected < 0 || selected >= (int) items.size())return (false);const int oldfirst = first_entry;if (selected < first_entry)first_entry = selected;else if (selected >= first_entry + pagesize){first_entry = selected - pagesize + 1;if (first_entry < 0)first_entry = 0;}return (first_entry != oldfirst);}void slider_menu::new_selection(int nsel){if (nsel < 0)nsel = 0;if (nsel >= (int) items.size())nsel = items.size() - 1;const int old = selected;selected = nsel;if (old != selected && nsel >= first_entry && nsel < first_entry + pagesize){draw_item(old);draw_item(selected);}}bool slider_menu::move_selection(int nsel){new_selection(nsel);return fix_entry();}bool slider_menu::page_down(){search.clear();return move_selection( selected + pagesize );}bool slider_menu::page_up(){search.clear();return move_selection( selected - pagesize );}bool slider_menu::line_down(){search.clear();return move_selection( selected + 1 );}bool slider_menu::line_up(){search.clear();return move_selection( selected - 1 );
}////////////////////////////////////////////////////////////////////// formatted_string//formatted_string::formatted_string(const std::string &s, bool init_style): ops(){if (init_style)ops.push_back(LIGHTGREY);ops.push_back(s);}int formatted_string::get_colour(const std::string &tag){if (tag == "h")return (YELLOW);if (tag == "w")return (WHITE);const int colour = str_to_colour(tag);return (colour != -1? colour : LIGHTGREY);}formatted_string formatted_string::parse_string(const std::string &s,bool eol_ends_format,bool (*process)(const std::string &tag)){// FIXME This is a lame mess, just good enough for the task on hand// (keyboard help).formatted_string fs;std::string::size_type tag = std::string::npos;std::string::size_type length = s.length();std::string currs;int curr_colour = LIGHTGREY;bool masked = false;for (tag = 0; tag < length; ++tag){bool invert_colour = false;std::string::size_type endpos = std::string::npos;if (s[tag] != '<' || tag >= length - 2){if (!masked)currs += s[tag];continue;}// Is this a << escape?if (s[tag + 1] == '<'){if (!masked)currs += s[tag];tag++;continue;}endpos = s.find('>', tag + 1);// No closing >?if (endpos == std::string::npos){if (!masked)currs += s[tag];continue;}std::string tagtext = s.substr(tag + 1, endpos - tag - 1);if (tagtext.empty() || tagtext == "/"){if (!masked)currs += s[tag];continue;}if (tagtext[0] == '/'){invert_colour = true;tagtext = tagtext.substr(1);tag++;}if (tagtext[0] == '?'){if (tagtext.length() == 1)masked = false;else if (process && !process(tagtext.substr(1)))masked = true;tag += tagtext.length() + 1;continue;}const int new_colour = invert_colour? LIGHTGREY : get_colour(tagtext);if (new_colour != curr_colour){fs.cprintf(currs);currs.clear();fs.textcolor( curr_colour = new_colour );}tag += tagtext.length() + 1;}if (currs.length())fs.cprintf(currs);if (eol_ends_format && curr_colour != LIGHTGREY)fs.textcolor(LIGHTGREY);return (fs);}formatted_string::operator std::string() const{std::string s;for (unsigned i = 0, size = ops.size(); i < size; ++i){if (ops[i] == FSOP_TEXT)s += ops[i].text;}return (s);}const formatted_string &formatted_string::operator += (const formatted_string &other){ops.insert(ops.end(), other.ops.begin(), other.ops.end());return (*this);}std::string::size_type formatted_string::length() const{// Just add up the individual string lengths.std::string::size_type len = 0;for (unsigned i = 0, size = ops.size(); i < size; ++i)if (ops[i] == FSOP_TEXT)len += ops[i].text.length();return (len);}inline void cap(int &i, int max){if (i < 0 && -i <= max)i += max;if (i >= max)i = max - 1;if (i < 0)i = 0;}std::string formatted_string::tostring(int s, int e) const{std::string st;int size = ops.size();cap(s, size);cap(e, size);for (int i = s; i <= e && i < size; ++i){if (ops[i] == FSOP_TEXT)st += ops[i].text;}return st;}void formatted_string::display(int s, int e) const{int size = ops.size();if (!size)return ;cap(s, size);cap(e, size);for (int i = s; i <= e && i < size; ++i)ops[i].display();}void formatted_string::gotoxy(int x, int y){ops.push_back( fs_op(x, y) );}void formatted_string::movexy(int x, int y){ops.push_back( fs_op(x, y, true) );}void formatted_string::textcolor(int color){ops.push_back(color);}void formatted_string::clear(){ops.clear();}void formatted_string::cprintf(const char *s, ...){char buf[1000];va_list args;va_start(args, s);vsnprintf(buf, sizeof buf, s, args);va_end(args);cprintf(std::string(buf));}void formatted_string::cprintf(const std::string &s){ops.push_back(s);}void formatted_string::fs_op::display() const{switch (type){case FSOP_CURSOR:{int cx = x, cy = y;if (relative){cx += wherex();cy += wherey();}else{if (cx == -1)cx = wherex();if (cy == -1)cy = wherey();}::gotoxy(cx, cy);break;}case FSOP_COLOUR:::textattr(x);break;case FSOP_TEXT:::cprintf("%s", text.c_str());break;}}///////////////////////////////////////////////////////////////////////// column_composercolumn_composer::column_composer(int cols, ...): ncols(cols), pagesize(0), columns(){ASSERT(cols > 0);va_list args;va_start(args, cols);columns.push_back( column(1) );int lastcol = 1;for (int i = 1; i < cols; ++i){int nextcol = va_arg(args, int);ASSERT(nextcol > lastcol);lastcol = nextcol;columns.push_back( column(nextcol) );}va_end(args);}void column_composer::set_pagesize(int ps){pagesize = ps;}void column_composer::clear(){flines.clear();}void column_composer::add_formatted(int ncol,const std::string &s,bool add_separator,bool eol_ends_format,bool (*tfilt)(const std::string &),int margin){ASSERT(ncol >= 0 && ncol < (int) columns.size());column &col = columns[ncol];std::vector<std::string> segs = split_string("\n", s, false, true);std::vector<formatted_string> newlines;// Add a blank line if necessary. Blank lines will not// be added at page boundaries.if (add_separator && col.lines && !segs.empty()&& (!pagesize || col.lines % pagesize))newlines.push_back(formatted_string());for (unsigned i = 0, size = segs.size(); i < size; ++i){newlines.push_back(formatted_string::parse_string(segs[i],eol_ends_format,tfilt));}strip_blank_lines(newlines);compose_formatted_column(newlines,col.lines,margin == -1? col.margin : margin);col.lines += newlines.size();strip_blank_lines(flines);}std::vector<formatted_string> column_composer::formatted_lines() const{return (flines);
void column_composer::strip_blank_lines(std::vector<formatted_string> &fs) const{for (int i = fs.size() - 1; i >= 0; --i){if (fs[i].length() == 0)fs.erase( fs.begin() + i );elsebreak;}}void column_composer::compose_formatted_column(const std::vector<formatted_string> &lines,int startline,int margin){if (flines.size() < startline + lines.size())flines.resize(startline + lines.size());for (unsigned i = 0, size = lines.size(); i < size; ++i){int f = i + startline;if (margin > 1){int xdelta = margin - flines[f].length() - 1;if (xdelta > 0)flines[f].cprintf("%-*s", xdelta, "");}flines[f] += lines[i];}}
// last updated 12may2000 {dlb}/* ************************************************************************ called from: dungeon* *********************************************************************** */char vault_main(char vgrid[81][81], FixedVector<int, 7>& mons_array, int vault_force, int many_many);
vault_placement(): x(-1), y(-1), width(0), height(0), map(NULL){}};
int random_map_for_place(const std::string &place, bool mini = false);int find_map_named(const std::string &name);int random_map_for_depth(int depth, bool want_minivault = false);int random_map_for_tag(const std::string &tag);void add_parsed_map(const map_def &md);void read_maps();
static char vault_1(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_2(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_3(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_4(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_5(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_6(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_7(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_8(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_9(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vault_10(char vgrid[81][81], FixedVector<int, 7>& mons_array);
static int write_vault(const map_def &mdef, map_type mt,FixedVector<int,7> &marray,vault_placement &);static int apply_vault_definition(const map_def &def,map_type map,FixedVector<int,7> &marray,vault_placement &);
static char antaeus(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char asmodeus(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char beehive(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char box_level(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char castle_dis(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char elf_hall(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char ereshkigal(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char farm_and_country(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char fort_yaktaur(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char hall_of_Zot(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char hall_of_blades(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char gloorx_vloq(char vgrid[81][81], FixedVector<int, 7>& mons_array);//static char mollusc(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char my_map(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char mnoleg(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char cerebov(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char orc_temple(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char lom_lobon(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char slime_pit(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char snake_pit(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char swamp(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char temple(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char tomb_1(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char tomb_2(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char tomb_3(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vaults_vault(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char vestibule_map(char vgrid[81][81], FixedVector<int, 7>& mons_array);
static char minivault_1(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_2(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_3(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_4(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_5(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_6(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_7(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_8(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_9(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_10(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_11(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_12(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_13(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_14(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_15(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_16(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_17(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_18(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_19(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_20(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_21(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_22(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_23(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_24(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_25(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_26(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_27(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_28(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_29(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_30(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_31(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_32(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_33(char vgrid[81][81], FixedVector<int, 7>& mons_array);
static std::vector<map_def> vdefs;
//jmf: originals and slim wrappers to fit into don's non-switchstatic char minivault_34(char vgrid[81][81], FixedVector<int, 7>& mons_array, bool orientation);static char minivault_35(char vgrid[81][81], FixedVector<int, 7>& mons_array, bool orientation);static char minivault_34_a(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_34_b(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_35_a(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char minivault_35_b(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_1(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_2(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_3(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_4(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_5(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_6(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_7(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_8(char vgrid[81][81], FixedVector<int, 7>& mons_array);static char rand_demon_9(char vgrid[81][81], FixedVector<int, 7>& mons_array);
int which_vault = 0;unsigned char vx, vy;char (*fnc_vault) (char[81][81], FixedVector<int, 7>&) = 0;// first, fill in entirely with walls and null-terminate {dlb}:for (vx = 0; vx < 80; vx++)
// first, fill in entirely with walls and null-terminate {dlb}:for (int vx = 0; vx < MAP_SIDE; vx++)
// next, select an appropriate vault to place {dlb}:for (;;){which_vault = ( (vault_force == 100) ? random2(14) : vault_force );// endless loops result if forced vault cannot pass these tests {dlb}:if ( which_vault == 9 ){// if ( many_many > 23 || many_many > 12 )if (many_many > 12)break;}else if (which_vault == 11 || which_vault == 12){if (many_many > 20)break;}elsebreak;}// then, determine which drawing routine to use {dlb}:fnc_vault = ( (which_vault == 0) ? vault_1 :(which_vault == 1) ? vault_2 :(which_vault == 2) ? vault_3 :(which_vault == 3) ? vault_4 :(which_vault == 4) ? vault_5 :(which_vault == 5) ? vault_6 :(which_vault == 6) ? vault_7 :(which_vault == 7) ? vault_8 :(which_vault == 8) ? vault_9 :(which_vault == 9) ? ( (many_many > 23) ? my_map : orc_temple ) :(which_vault == 10) ? vault_10 :(which_vault == 11) ? farm_and_country :(which_vault == 12) ? fort_yaktaur :(which_vault == 13) ? box_level :// the hell vaults:(which_vault == 50) ? vestibule_map :(which_vault == 51) ? castle_dis :(which_vault == 52) ? asmodeus :(which_vault == 53) ? antaeus :(which_vault == 54) ? ereshkigal :// the pandemonium big demonlord vaults:(which_vault == 60) ? mnoleg : // was nemelex(which_vault == 61) ? lom_lobon : // was sif muna(which_vault == 62) ? cerebov : // was okawaru(which_vault == 63) ? gloorx_vloq : // was kikubaaqudgha//(which_vault == 64) ? mollusc :(which_vault == 80) ? beehive :(which_vault == 81) ? slime_pit :(which_vault == 82) ? vaults_vault :(which_vault == 83) ? hall_of_blades :(which_vault == 84) ? hall_of_Zot :(which_vault == 85) ? temple :(which_vault == 86) ? snake_pit :(which_vault == 87) ? elf_hall :(which_vault == 88) ? tomb_1 :(which_vault == 89) ? tomb_2 :(which_vault == 90) ? tomb_3 :(which_vault == 91) ? swamp :(which_vault == 200) ? minivault_1 :(which_vault == 201) ? minivault_2 :(which_vault == 202) ? minivault_3 :(which_vault == 203) ? minivault_4 :(which_vault == 204) ? minivault_5 :(which_vault == 205) ? ( (many_many > 15) ? minivault_6 : minivault_1 ) :(which_vault == 206) ? ( (many_many > 10) ? minivault_7 : minivault_2 ) :(which_vault == 207) ? ( (many_many > 15) ? minivault_8 : minivault_3 ) :(which_vault == 208) ? ( (many_many > 15) ? minivault_9 : minivault_4 ) :(which_vault == 209) ? minivault_10 :(which_vault == 210) ? minivault_11 :(which_vault == 211) ? minivault_12 :(which_vault == 212) ? minivault_13 :(which_vault == 213) ? minivault_14 :(which_vault == 214) ? minivault_15 :(which_vault == 215) ? minivault_16 :(which_vault == 216) ? minivault_17 :(which_vault == 217) ? minivault_18 :(which_vault == 218) ? minivault_19 :(which_vault == 219) ? minivault_20 :(which_vault == 220) ? minivault_21 :(which_vault == 221) ? minivault_22 :(which_vault == 222) ? minivault_23 :(which_vault == 223) ? minivault_24 :(which_vault == 224) ? minivault_25 :(which_vault == 225) ? minivault_26 :(which_vault == 226) ? minivault_27 :(which_vault == 227) ? minivault_28 :(which_vault == 228) ? minivault_29 :(which_vault == 229) ? minivault_30 :(which_vault == 230) ? minivault_31 :(which_vault == 231) ? minivault_32 :(which_vault == 232) ? minivault_33 :(which_vault == 233) ? minivault_34_a :(which_vault == 234) ? minivault_34_b :(which_vault == 235) ? minivault_35_a :(which_vault == 236) ? minivault_35_b :(which_vault == 300) ? rand_demon_1 :(which_vault == 301) ? rand_demon_2 :(which_vault == 302) ? rand_demon_3 :(which_vault == 303) ? rand_demon_4 :(which_vault == 304) ? rand_demon_5 :(which_vault == 305) ? rand_demon_6 :(which_vault == 306) ? rand_demon_7 :(which_vault == 307) ? rand_demon_8 :(which_vault == 308) ? rand_demon_9: 0 ); // yep, NULL -- original behaviour {dlb}
/* ********************* END PUBLIC FUNCTIONS ******************** *//*key:x - DNGN_ROCK_WALLX - DNGN_PERMAROCK_WALL -> should always be undiggable! -- bwrc - DNGN_STONE_WALLv - DNGN_METAL_WALLb - DNGN_GREEN_CRYSTAL_WALLa - DNGN_WAX_WALL. - DNGN_FLOOR+ - DNGN_CLOSED_DOOR= - DNGN_SECRET_DOOR@ - entry point - must be on outside and on a particular side - see templatesw - waterl - lava>< - extra stairs - you can leave level by these but will never be placed on them from another level}{ - stairs 82/86 - You must be able to reach these from each other)( - stairs 83/87][ - stairs 84/88I - orcish idol (does nothing)^ - random trapA - Vestibule gateway (opened by Horn). Can also be put on other levels for colour, where it won't do anything.B - Altar. These are assigned specific types (eg of Zin etc) in dungeon.cc, in order.C - Random Altar.F - Typically a Granite Statue, but may be Orange or Silver (1 in 100)G - Granite statue (does nothing)H - orange crystal statue (attacks mind)S - Silver statue (summons demons). Avoid using (rare).T - Water fountainU - Magic fountainV - Permenantly dry fountainStatues can't be walked over and are only destroyed by disintegration$ - gold% - normal item* - higher level item (good)| - acquirement-level item (almost guaranteed excellent)O - place an appropriate rune hereP - maybe place a rune here (50%)R - honeycomb (2/3) or royal jelly (1/3)Z - the Orb of Zot0 - normal monster9 - +5 depth monster8 - (+2) * 2 depth monster (aargh!). Can get golden dragons and titans this way.1-7 - monster array monsterused to allocate specific monsters for a vault.is filled with RANDOM_MONSTER if monster not specifiednote that a lot of the vaults are in there mainly to add some interest to thescenery, and are not the lethal treasure-fests you find in Angband(not that there's anything wrong with that)Guidelines for creating new vault maps:Basically you can just let your creativity run wild. You do not haveto place all of the stairs unless the level is full screen, in whichcase you must place all except the extra stairs (> and <). The <> stairscan be put anywhere and in any quantities but do not have to be there. Anyof the other stairs which are not present in the vault will be randomlyplaced outside it. Also generally try to avoid rooms with no exit.You can use the templates below to build vaults, and remember to return thesame number (this number is used in builder2.cc to determine where on the mapthe vault is located). The entry point '@' must be present (exceptfull-screen vaults where it must not) and be on the same side of the vaultas it is on the template, but can be anywhere along that side.You'll have to tell me the level range in which you want the vault to appear,so that I can code it into the vault management function. Unless you'veplaced specific monster types this will probably be unnecessary.I think that's all. Have fun!ps - remember to add one to the monster array value when placing monsterson each map (it is 1-7, not 0-6) {dlb}*/static char vault_1(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // my first vaultstrcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxx....x........x........x.................................xxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxx|=8...x........+........x......x....x1...x2...x2...x3...x...xxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxx|x....x........x........x....................................xxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxx+xxx+xxxxxxxxxxxxxx..................................xxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxx.......x.................+...................................8xxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxx.......x.................x..................................xxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxx.......+........3........xx+xx................................xxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxx.......x.................x...x..x....x1...x2...x2...x3...x...xxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxx.......x.................x...x.............................xxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxx.........................x.S.x...xxxxxx..................|||||xxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxx....xxxxxxxxxxxxxxxxxx...x...x......xxxxxx..................||xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxx....x...$$$$x****.999x...x...x.........xxxxxx.................xxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxx....+...$$$$x****....x...x...+............xxxxxx.........8....xxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxx....x...$$$$x****....+...x...x...............xxxxxx...........xxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxx....x...$$$$x****....x...x999x..................xxxxxx........xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxx....xxxxxxxxxxxxxxxxxx...x...xxx...................xxxxxx.....xxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxx.........................x...xxxxxx...................xxxxxx..xxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxxxx+xxxxxxxx+xxxxxxx+xxxx...xxxxxx+xxxxxxxx+xxxxxxxx+xxxxxxx=xxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx....1....x...2...x...3...x...x....3....x....2...x......1......xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_SHAPESHIFTER;mons_array[1] = MONS_SHAPESHIFTER;mons_array[2] = MONS_GLOWING_SHAPESHIFTER;return MAP_NORTH;}static char vault_2(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // cell vaultUNUSED( mons_array );strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxcccccccccccccccccccccccccccccccc");strcpy(vgrid[7], "xxxxxxxxccw......^......w......^......wc");strcpy(vgrid[8], "xxxxxxxxcc.ccccccccccccc.ccccccccccccc.c");strcpy(vgrid[9], "xxxxxxxxcc.c....c.c....c.c....c.c....c.c");strcpy(vgrid[10], "xxxxxxxxcc.c.8..+.c....c.c....+.c..9.c.c");strcpy(vgrid[11], "xxxxxxxxcc.c....c.+..9.c.c.9..c.+....c.c");strcpy(vgrid[12], "xxxxxxxxcc.c....c.c....c.c....c.c....c.c");strcpy(vgrid[13], "xxxxxxxxcc.cccccc.cccccc.cccccc.cccccc.c");strcpy(vgrid[14], "xxxxxxxxcc^c....c.c....c.c....c.c....c.c");strcpy(vgrid[15], "xxxxxxxxcc.c....c.c....c.c....+.c....c.c");strcpy(vgrid[16], "xxxxxxxxcc.c8...+.+..8.c.c.8..c.+....c.c");strcpy(vgrid[17], "xxxxxxxxcc.c....c.c....c.c....c.c....c.c");strcpy(vgrid[18], "xxxxxxxxcc.cccccc.cccccc.cccccc.cccccc.c");strcpy(vgrid[19], "xxxxxxxxcc.c....c.c....c.c....c.c....c.c");strcpy(vgrid[20], "xxxxxxxxcc.c....+.c....c.c.0..c.c....c.c");strcpy(vgrid[21], "xxxxxxxxcc.c..9.c.+.8..c^c....+.+.0..c.c");strcpy(vgrid[22], "xxxxxxxxcc.c....c.c....c.c....c.c....c.c");strcpy(vgrid[23], "xxxxxxxxcc.cccccc.cccccc.cccccc.cccccc.c");strcpy(vgrid[24], "xxxxxxxxcc.c....c.c....c.c....c.c....c.c");strcpy(vgrid[25], "xxxxxxxxcc.c.0..+.+.0..c.c....+.+....c.c");strcpy(vgrid[26], "xxxxxxxxcc.c....c.c....c.c.0..c.c.8..c.c");strcpy(vgrid[27], "xxxxxxxxcc.cccccc.c....c.c....c.cccccc.c");strcpy(vgrid[28], "xxxxxxxxcc.c....c.cccccc.cccccc.c....c^c");strcpy(vgrid[29], "xxxxxxxxcc.c....c.c....c.c..9.+.+....c.c");strcpy(vgrid[30], "xxxxxxxxcc.c.0..+.+....c.c9...c.c.0..c.c");strcpy(vgrid[31], "xxxxxxxxcc.c....c.c.8..c.c....c.c....c.c");strcpy(vgrid[32], "xxxxxxxxcc.cccccc^cccccc.cccccc^cccccc.c");strcpy(vgrid[33], "xxxxxxxxccw.......Twwwwc.cwwwwT.......wc");strcpy(vgrid[34], "xxxxxxxxcccccccccccccccc.ccccccccccccccc");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxxxxxc@cxxxxxxxxxxxxxx");return MAP_NORTHWEST;}static char vault_3(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // little maze vaultUNUSED( mons_array );for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[9], "x900x..............x..........xxxxxxxxxx");strcat(vgrid[10], "x999x.xxxxxxxxxxxx.x.xxxxxxxx.xxxxxxxxxx");strcat(vgrid[11], "x000x.x............x.x......x.xxxxxxxxxx");strcat(vgrid[12], "xx.xx.xxxxxxxxxxxxxx.x.xxxx.x.xxxxxxxxxx");strcat(vgrid[13], "xx.x..............xx.x.88|x.x.xxxxxxxxxx");strcat(vgrid[14], "xx.x.x.xxxxxxxxxx.xx.xxxxxx.x.xxxxxxxxxx");strcat(vgrid[15], "xx.x.x.x........x...........x.xxxxxxxxxx");strcat(vgrid[16], "xx.x.x.x.xxxxxx.xxxxxxxxxxxxx.xxxxxxxxxx");strcat(vgrid[17], "xx.xxx.x.x$$$$x...............xxxxxxxxxx");strcat(vgrid[18], "xx.....x.x$$$$x.xxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[19], "xxxxxxxx.x$$$$x...............xxxxxxxxxx");strcat(vgrid[20], "x........x$$$$x.xxxxxxxxxxxxx.xxxxxxxxxx");strcat(vgrid[21], "x.xxxxxx.xxxx.x.............x.xxxxxxxxxx");strcat(vgrid[22], "x.xxxxxx.xxxx.xxxxxxxxxxxxx.x.xxxxxxxxxx");strcat(vgrid[23], "x.x.......xxx.x...........x.x.xxxxxxxxxx");strcat(vgrid[24], "x.x.xxxxx.....x.x.xxxxx...x.x.xxxxxxxxxx");strcat(vgrid[25], "x.x.x999xxxxxxx.x.x***x...x.x.xxxxxxxxxx");strcat(vgrid[26], "x.x.x889........x.x|||xxxxx.x.xxxxxxxxxx");strcat(vgrid[27], "x.x.x899x.xxxxx.x.x***xxxxx.x.xxxxxxxxxx");strcat(vgrid[28], "x.x.xxxxx.xxxxx.x.xx.xxxxxx.x.xxxxxxxxxx");strcat(vgrid[29], "x.x..........xx.x.xx........x.xxxxxxxxxx");strcat(vgrid[30], "x.xxxxxxx.xx.xx.x.xxxxx.xxxxx.xxxxxxxxxx");strcat(vgrid[31], "x.xxx000x.xx.xx.x.x$$$x.xxxxx.xxxxxxxxxx");strcat(vgrid[32], "x|||x000x.x$$$x.x.x$$$x%%x%%%.xxxxxxxxxx");strcat(vgrid[33], "x|||x000..x$8$x.x.x$$$x%%x%8%xxxxxxxxxxx");strcat(vgrid[34], "x|||xxxxxxx$$$x.x..$$$xxxx%%%xxxxxxxxxxx");strcat(vgrid[35], "xxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxx");return MAP_NORTHEAST;}static char vault_4(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // thingy vaultUNUSED( mons_array );for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxxxxxxxxxxxxxxxx^xxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxxxxxxxx......0...0......xxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxxxx.......................xxx");strcpy(vgrid[46], "xxxxxxxxxxxxxx.........0...0.........xxx");strcpy(vgrid[47], "xxxxxxxxxxxxx8......0.........0......8xx");strcpy(vgrid[48], "xxxxxxxxxxxxxx.........0...0.........xxx");strcpy(vgrid[49], "xxxxxxxxxxxxxx.......................xxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxx........0...0........xxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxxxxxx...........xxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxx...............xxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxx8.................8xxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxx.............xxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxx999xxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");return MAP_SOUTHWEST;}static char vault_5(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // hourglass vaultUNUSED( mons_array );for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[36], "xxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[37], "xxxxxx.................xxxxxxxxxxxxxxxxx");strcat(vgrid[38], "xxxxx...................xxxxxxxxxxxxxxxx");strcat(vgrid[39], "xxxxx...................xxxxxxxxxxxxxxxx");strcat(vgrid[40], "xxxxxx.................xxxxxxxxxxxxxxxxx");strcat(vgrid[41], "xxxxxx.................xxxxxxxxxxxxxxxxx");strcat(vgrid[42], "xxxxxx.................xxxxxxxxxxxxxxxxx");strcat(vgrid[43], "xxxxxxx...............xxxxxxxxxxxxxxxxxx");strcat(vgrid[44], "xxxxxxx...............xxxxxxxxxxxxxxxxxx");strcat(vgrid[45], "xxxxxxxx.............xxxxxxxxxxxxxxxxxxx");strcat(vgrid[46], "xxxxxxxxx.....8.....xxxxxxxxxxxxxxxxxxxx");strcat(vgrid[47], "xxxxxxxxxx...999...xxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[48], "xxxxxxxxxxxx00000xxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[49], "xxxxxxxxxxxxx===xxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[50], "xxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[51], "xxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[52], "xxxxxxxxx...........xxxxxxxxxxxxxxxxxxxx");strcat(vgrid[53], "xxxxxxxx......|......xxxxxxxxxxxxxxxxxxx");strcat(vgrid[54], "xxxxxxx...............xxxxxxxxxxxxxxxxxx");strcat(vgrid[55], "xxxxxxx...............xxxxxxxxxxxxxxxxxx");strcat(vgrid[56], "xxxxxx........$........xxxxxxxxxxxxxxxxx");strcat(vgrid[57], "xxxxxx.......$$$.......xxxxxxxxxxxxxxxxx");strcat(vgrid[58], "xxxxxx....$$$$$$$$$....xxxxxxxxxxxxxxxxx");strcat(vgrid[59], "xxxxx$$$$$$$$$$$$$$$$$$$xxxxxxxxxxxxxxxx");strcat(vgrid[60], "xxxxx$$$$$$$$$$$$$$$$$$$xxxxxxxxxxxxxxxx");strcat(vgrid[61], "xxxxxx$$$$$$$$$$$$$$$$$xxxxxxxxxxxxxxxxx");strcat(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");return MAP_SOUTHEAST;}static char vault_6(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // a more Angbandy vaultUNUSED( mons_array );for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[6], "ccccccccccccccccccccccccccccccccxxxxxxxx");strcat(vgrid[7], "c*******cc..9...cc.+8c0c*c.c*c8cxxxxxxxx");strcat(vgrid[8], "c******cc..cc..cc..cc0c.c.c.c8ccxxxxxxxx");strcat(vgrid[9], "c*****cc..cc..cc..cc.c$c.c.c8c.cxxxxxxxx");strcat(vgrid[10], "c****cc9.cc..cc8.cc|c.c|c.c*c0ccxxxxxxxx");strcat(vgrid[11], "c***cc..cc..cc..cc.c.c.c.c.c.c$cxxxxxxxx");strcat(vgrid[12], "c**cc..cc8.cc..cc.c*c.c.c.c.c.ccxxxxxxxx");strcat(vgrid[13], "c+cc9.cc..cc..cc.c.c.c.c*c.c.c.cxxxxxxxx");strcat(vgrid[14], "c^c..cc..cc..cc.c$c.c.c.c.c.c*ccxxxxxxxx");strcat(vgrid[15], "c...cc..cc..cc.c.c.c9c$c.c.c.c9cxxxxxxxx");strcat(vgrid[16], "c..cc..cc..cc$c.c.c*c.c.c.c9c9ccxxxxxxxx");strcat(vgrid[17], "c.cc..cc..cc.c.c|c.c.c.c.c$c.c9cxxxxxxxx");strcat(vgrid[18], "ccc..cc..cc.c.c.c.c.c.c.c.c.cc+cxxxxxxxx");strcat(vgrid[19], "cc..cc..cc.c*c.c.c.c.c.c$c.cc..cxxxxxxxx");strcat(vgrid[20], "c0.cc..cc.c.c.c.c8c.c*c.c.cc0.ccxxxxxxxx");strcat(vgrid[21], "c.cc..cc*c.c.c.c.c$c.c.c.cc..cccxxxxxxxx");strcat(vgrid[22], "c^c..cc.c.c9c.c.c.c.c.c.cc..cc.cxxxxxxxx");strcat(vgrid[23], "c0..cc$c.c.c*c0c.c.c.c.cc..cc.0cxxxxxxxx");strcat(vgrid[24], "c..cc.c.c9c.c.c.c$c.c.cc.9cc...cxxxxxxxx");strcat(vgrid[25], "c.cc9c.c.c.c.c.c.c.c.cc..cc..c^cxxxxxxxx");strcat(vgrid[26], "ccc.c.c$c.c.c.c.c.c$cc..cc..cc^cxxxxxxxx");strcat(vgrid[27], "cc$c.c.c.c.c$c.c0c.cc..cc..cc..cxxxxxxxx");strcat(vgrid[28], "c.c.c.c.c.c.c.c.c.cc9.cc..cc..ccxxxxxxxx");strcat(vgrid[29], "cc.c8c.c.c$c.c.c.cc..cc..cc0.cccxxxxxxxx");strcat(vgrid[30], "c.c$c.c$c0c.c.c.cc..cc..cc..cc$cxxxxxxxx");strcat(vgrid[31], "cc.c.c.c.c.c*c.cc..cc..cc..cc$$cxxxxxxxx");strcat(vgrid[32], "c.c.c.c.c.c.c.cc..cc0.cc..cc$$$cxxxxxxxx");strcat(vgrid[33], "cc.c.c.c.c.c$cc..cc..cc..cc$$$$cxxxxxxxx");strcat(vgrid[34], "c.c.c.c.c.c.cc.8.^..cc....+$$$$cxxxxxxxx");strcat(vgrid[35], "cccc@cccccccccccccccccccccccccccxxxxxxxx");return MAP_NORTHEAST;}static char vault_7(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // four-leaf vaultUNUSED( mons_array );strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxx.........^..^.........xxxxx");strcpy(vgrid[8], "xxxxxxxxxxxx...xxxxxxxx..xxxxxxxx...xxxx");strcpy(vgrid[9], "xxxxxxxxxxx...xxxxxxxxx..xxxxxxxxx...xxx");strcpy(vgrid[10], "xxxxxxxxxx...xx$*....xx..xx....$$xx...xx");strcpy(vgrid[11], "xxxxxxxxx...xx$*$....xx..xx....$*$xx...x");strcpy(vgrid[12], "xxxxxxxxx..xx*$*$....xx..xx....*$$$xx..x");strcpy(vgrid[13], "xxxxxxxxx..xx$$$.00..xx..xx..00.*$*xx..x");strcpy(vgrid[14], "xxxxxxxxx..xx....09..xx..xx..90....xx..x");strcpy(vgrid[15], "xxxxxxxxx..xx......+xx....xx+......xx..x");strcpy(vgrid[16], "xxxxxxxxx..xx......x^......^x......xx..x");strcpy(vgrid[17], "xxxxxxxxx..xxxxxxxxx........xxxxxxxxx..x");strcpy(vgrid[18], "xxxxxxxxx..xxxxxxxx..........xxxxxxxx..x");strcpy(vgrid[19], "xxxxxxxxx..............TT..............x");strcpy(vgrid[20], "xxxxxxxxx..............TT..............x");strcpy(vgrid[21], "xxxxxxxxx..xxxxxxxx..........xxxxxxxx..x");strcpy(vgrid[22], "xxxxxxxxx..xxxxxxxxx........xxxxxxxxx..x");strcpy(vgrid[23], "xxxxxxxxx..xx......x^......^x......xx..x");strcpy(vgrid[24], "xxxxxxxxx..xx......+xx....xx+......xx..x");strcpy(vgrid[25], "xxxxxxxxx..xx....09..xx..xx..90....xx..x");strcpy(vgrid[26], "xxxxxxxxx..xx$$*.00..xx..xx..00.*$$xx..x");strcpy(vgrid[27], "xxxxxxxxx..xx*$*$....xx..xx....*$$*xx..x");strcpy(vgrid[28], "xxxxxxxxx...xx*$*....xx..xx....$$$xx...x");strcpy(vgrid[29], "xxxxxxxxxx...xx*$....xx..xx....*$xx...xx");strcpy(vgrid[30], "xxxxxxxxxxx...xxxxxxxxx..xxxxxxxxx...xxx");strcpy(vgrid[31], "xxxxxxxxxxxx...xxxxxxxx..xxxxxxxx...xxxx");strcpy(vgrid[32], "xxxxxxxxxxxxx..^................^..xxxxx");strcpy(vgrid[33], "xxxxxxxxxxxxxxxxxxxxxxx^^xxxxxxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxxxxxxxxxxxxx++xxxxxxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxx");return MAP_NORTHWEST;}static char vault_8(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // cross vaultUNUSED( mons_array );strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxx............xxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxx..................xxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxx......................xxxxx");strcpy(vgrid[10], "xxxxxxxxxxxx..........w..w..........xxxx");strcpy(vgrid[11], "xxxxxxxxxxx........wwww++wwww........xxx");strcpy(vgrid[12], "xxxxxxxxxxx......wwwvvv^^vvvwww......xxx");strcpy(vgrid[13], "xxxxxxxxxx......wwwwv.9..9.vwwww......xx");strcpy(vgrid[14], "xxxxxxxxxx.....wwwwwv......vwwwww.....xx");strcpy(vgrid[15], "xxxxxxxxxx....wwwwwvv......vvwwwww....xx");strcpy(vgrid[16], "xxxxxxxxx....wwwwwvv........vvwwwww....x");strcpy(vgrid[17], "xxxxxxxxx....wwvvvv....vv....vvvvww....x");strcpy(vgrid[18], "xxxxxxxxx...wwwv......vvvv......vwww...x");strcpy(vgrid[19], "xxxxxxxxx...wwwv....vv8vv8vv....vwww...x");strcpy(vgrid[20], "xxxxxxxxx..wwwwv...vvvv||vvvv...vwwww..x");strcpy(vgrid[21], "xxxxxxxxx^^wwwwv...vvvv||vvvv...vwwww^^x");strcpy(vgrid[22], "xxxxxxxxx..wwwwv....vv8vv8vv....vwwww..x");strcpy(vgrid[23], "xxxxxxxxx...wwwv......vvvv......vwww...x");strcpy(vgrid[24], "xxxxxxxxx...wwwvvvv....vv....vvvvwww...x");strcpy(vgrid[25], "xxxxxxxxx....wwwwwvv........vvwwwww....x");strcpy(vgrid[26], "xxxxxxxxxx...wwwwwwvv......vvwwwwww...xx");strcpy(vgrid[27], "xxxxxxxxxx....wwwwwwv......vwwwwww....xx");strcpy(vgrid[28], "xxxxxxxxxx.....wwwwwv......vwwwww.....xx");strcpy(vgrid[29], "xxxxxxxxxxx.....wwwwvvvvvvvvwwww.....xxx");strcpy(vgrid[30], "xxxxxxxxxxx.......wwwwwwwwwwww.......xxx");strcpy(vgrid[31], "xxxxxxxxxxxx.........wwwwww.........xxxx");strcpy(vgrid[32], "xxxxxxxxxxxxx.........^..^.........xxxxx");strcpy(vgrid[33], "xxxxxxxxxxxxxxx.......x++x.......xxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxxxxxxxx...xx..xx...xxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxxxx..@.xxxxxxxxxxxxxx");return MAP_NORTHWEST;}static char vault_9(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // another thingy vaultUNUSED( mons_array );for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[36], "xxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[37], "xxxxxxxxxxxxxxx^xxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[38], "xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[39], "xx.....^...............^.....xxxxxxxxxxx");strcat(vgrid[40], "x..bb..xxxxxxxxxxxxxxxxx..bb..xxxxxxxxxx");strcat(vgrid[41], "x..b...xxxxxxxxxxxxxxxxx...b..xxxxxxxxxx");strcat(vgrid[42], "x...b..xxxxbbbbbbbbbxxxx..b...xxxxxxxxxx");strcat(vgrid[43], "x..bb..xxbbb.......bbbxx..bb..xxxxxxxxxx");strcat(vgrid[44], "x......xxb....9.9....bxx......xxxxxxxxxx");strcat(vgrid[45], "x..bb..xbb..%$$$$$%..bbx..bb..xxxxxxxxxx");strcat(vgrid[46], "x...b..xb..0%$***$%0..bx..b...xxxxxxxxxx");strcat(vgrid[47], "x..b...xb..0%$*H*$%0..bx...b..xxxxxxxxxx");strcat(vgrid[48], "x...b..xb..0%$***$%0..bx..b...xxxxxxxxxx");strcat(vgrid[49], "x..b...xb...%$$$$$%...bx...b..xxxxxxxxxx");strcat(vgrid[50], "x...b..xbb.900000009.bbx..b...xxxxxxxxxx");strcat(vgrid[51], "x..b...xxb...........bxx...b..xxxxxxxxxx");strcat(vgrid[52], "x..bb..xxbbb..9.9..bbbxx..bb..xxxxxxxxxx");strcat(vgrid[53], "x......xxxxbbbb.bbbbxxxx......xxxxxxxxxx");strcat(vgrid[54], "x..bb..xxxxxxxb=bxxxxxxx..bb..xxxxxxxxxx");strcat(vgrid[55], "x..b...xxxxxxxx=xxxxxxxx...b..xxxxxxxxxx");strcat(vgrid[56], "x...b..xxxxxxxx^xxxxxxxx..b...xxxxxxxxxx");strcat(vgrid[57], "x..b....xxxxxxx=xxxxxxx....b..xxxxxxxxxx");strcat(vgrid[58], "x...b...^.............^...b...xxxxxxxxxx");strcat(vgrid[59], "x..b....xxxxxxxxxxxxxxx....b..xxxxxxxxxx");strcat(vgrid[60], "x..bb..xxxxxxxxxxxxxxxxx..bb..xxxxxxxxxx");strcat(vgrid[61], "xx....xxxxxxxxxxxxxxxxxxx....xxxxxxxxxxx");strcat(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");return MAP_SOUTHEAST;}static char vault_10(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // impenetrable vaultUNUSED( mons_array );for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[36], "..............@................xxxxxxxxx");strcat(vgrid[37], "...............................xxxxxxxxx");strcat(vgrid[38], "...............................xxxxxxxxx");strcat(vgrid[39], "...............................xxxxxxxxx");strcat(vgrid[40], "...............................xxxxxxxxx");strcat(vgrid[41], ".....cccccccccccccccc..........xxxxxxxxx");strcat(vgrid[42], ".....c[^...........9cc.........xxxxxxxxx");strcat(vgrid[43], ".....c^xxxxx=xxxxxx..cc........xxxxxxxxx");strcat(vgrid[44], ".....c.x9..^^^...9xx..cc.......xxxxxxxxx");strcat(vgrid[45], ".....c.x.xxx=xxxx..xx..cc......xxxxxxxxx");strcat(vgrid[46], ".....c.x^x$$$$$$xx..xx.9c......xxxxxxxxx");strcat(vgrid[47], ".....c.=^=$*|||*$xx..xx.c......xxxxxxxxx");strcat(vgrid[48], ".....c.x^xx$*|||*$xx.9x.c......xxxxxxxxx");strcat(vgrid[49], ".....c.x9.xx$*|||*$xx^x.c......xxxxxxxxx");strcat(vgrid[50], ".....c.xx..xx$*|||*$=^=.c......xxxxxxxxx");strcat(vgrid[51], ".....c9.xx..xx$$$$$$x^x.c......xxxxxxxxx");strcat(vgrid[52], ".....cc..xx..xxxx=xxx.x.c......xxxxxxxxx");strcat(vgrid[53], "......cc..xx9...^^^..9x.c......xxxxxxxxx");strcat(vgrid[54], ".......cc..xxxxxx=xxxxx^c......xxxxxxxxx");strcat(vgrid[55], "........cc9...........^]c......xxxxxxxxx");strcat(vgrid[56], ".........cccccccccccccccc......xxxxxxxxx");strcat(vgrid[57], "...............................xxxxxxxxx");strcat(vgrid[58], "...............................xxxxxxxxx");strcat(vgrid[59], "...............................xxxxxxxxx");strcat(vgrid[60], "...............................xxxxxxxxx");strcat(vgrid[61], "...............................xxxxxxxxx");strcat(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");return MAP_SOUTHEAST;}static char orc_temple(char vgrid[81][81], FixedVector<int, 7>& mons_array){for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxxxxxxxxxxxx4.4xxxxxxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx**..........x414x..........**xx");strcpy(vgrid[41], "xxxxxxxxx**..........x4.4x..........**xx");strcpy(vgrid[42], "xxxxxxxxx............+...+....4.......xx");strcpy(vgrid[43], "xxxxxxxxx....4..4....x...x............xx");strcpy(vgrid[44], "xxxxxxxxx............x...x.......4....xx");strcpy(vgrid[45], "xxxxxxxxx............xx.xx............xx");strcpy(vgrid[46], "xxxxxxxxx...4......xxxx+xxxx......6...xx");strcpy(vgrid[47], "xxxxxxxxx........xxx.......xxx........xx");strcpy(vgrid[48], "xxxxxxxxxxx...xxxx..2.....2..xxxx...xxxx");strcpy(vgrid[49], "xxxxxxxxxxxx+xxxx.............xxxx+xxxxx");strcpy(vgrid[50], "xxxxxxxxxxx...xxx.............xxx...xxxx");strcpy(vgrid[51], "xxxxxxxxx......x...............x......xx");strcpy(vgrid[52], "xxxxxxxxx..4...x...2...I...2...x...5..xx");strcpy(vgrid[53], "xxxxxxxxx......x...............x......xx");strcpy(vgrid[54], "xxxxxxxxx...4..xx.............xx..5...xx");strcpy(vgrid[55], "xxxxxxxxx$......x....2...2....x......$xx");strcpy(vgrid[56], "xxxxxxxxx$6..5..xx.....3.....xx.5...7$xx");strcpy(vgrid[57], "xxxxxxxxx$$$.....xxx.......xxx.....$$$xx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_ORC_WARLORD;mons_array[1] = MONS_ORC_PRIEST;mons_array[2] = MONS_ORC_HIGH_PRIEST;mons_array[3] = MONS_ORC_WARRIOR;mons_array[4] = MONS_ORC_WIZARD;mons_array[5] = MONS_ORC_KNIGHT;mons_array[6] = MONS_ORC_SORCERER;return MAP_SOUTHWEST;}static char my_map(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // by Matthew Ludivicofor (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxx.@.xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxx..........................xx");strcpy(vgrid[39], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xx");strcpy(vgrid[40], "xxxxxxxxx.^^..........................xx");strcpy(vgrid[41], "xxxxxxxxxx.^^xx+xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxx.^...11....xxxxxxxx..xxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxxx..x.1..6..xxx........xx..xxx");strcpy(vgrid[44], "xxxxxxxxxxxxx.xxxxxxxxx...vvvvv...x...xx");strcpy(vgrid[45], "xxxxxxxxx6..1...x.........+1..v.......xx");strcpy(vgrid[46], "xxxxxxxxx..1....x.........vvvvv........x");strcpy(vgrid[47], "xxxxxxxxx..5...xx......................x");strcpy(vgrid[48], "xxxxxxxxxxxxxx^++...........vvvvvvv....x");strcpy(vgrid[49], "xxxxxxxxxxxxxx^xx...xx=xx...vv$%$vvvvv.x");strcpy(vgrid[50], "xxxxxxxxxxxxxx^x...xxv1vxx...vvv*2...v.x");strcpy(vgrid[51], "xxxxxxxxxxxxxx^x..vvvv7.vvvv...vv.vv+v^x");strcpy(vgrid[52], "xxxxxxxxx..xxx^..vvvb....bvvv...vvv^...x");strcpy(vgrid[53], "xxxxxxxxx%%.xx..vvvvb....bvvvv.......xxx");strcpy(vgrid[54], "xxxxxxxxxx.....vvbbb......bbbvv.....xxxx");strcpy(vgrid[55], "xxxxxxxxxxx....vvb....66....bvvxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxvvvb..llllll..bvvvxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxvvvvvvvvb..ll45ll..bvvvvvvvvxxx");strcpy(vgrid[58], "xxxxxxxxxccc***+== .l3.2.l..cccccccccxxx");strcpy(vgrid[59], "xxxxxxxxxccc+cccbb....ll....c..$$$$+$*cx");strcpy(vgrid[60], "xxxxxxxxxcc|||cbb...3llll2...cc%*%*c$|cx");strcpy(vgrid[61], "xxxxxxxxxcccccccbbbbbbbbbbbccccccccccccx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_HELL_HOUND;mons_array[1] = MONS_NECROMANCER;mons_array[2] = MONS_WIZARD;mons_array[3] = MONS_ORANGE_DEMON;mons_array[4] = MONS_ROTTING_DEVIL;mons_array[5] = MONS_HELL_KNIGHT;mons_array[6] = MONS_GREAT_ORB_OF_EYES;return MAP_SOUTHWEST;}static char farm_and_country(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // by Matthew Ludivico (mll6@lehigh.edu)for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxx..........................................xxxxxxxx}.xxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxx............xxxxxx....xxx.......xx...........xxxx..]xxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxx***x...........xxx..xxx............xxxx...........xx..xxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxx|*$=...xx.xxxxxxx....xxxxxxxxxx......xx................xxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxx....xxxxxxxx......3..xxx.................x..........xxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxx......x........x......xx.........w...................xxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxx)......xx...xxx.....xxx......x........www3....3.............xxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxx=xxxxxxxxxxx...xxxxxxxxx..xxx.....wwwww....%%%.............xxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxx......xxx.......xx.xxxx.x...xxxxxxxwwwwwww..5%%%..........xx.xxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxx.........x..xxxxxxxx.....x........3wwwwwwwww..%%%........xxx..xxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxx....5...xx..x.xxxxx.....xxx........wwwwwwwww..%%%..........xx.xxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxx.....xxx..xx..xx........xxxxxxxxxwwwwwwwww..............xxx.xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxx........x..x...............xx..xxxxwwwwwwwwwwwwww............xxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxx.............................x.....xxwwwwww3wwwwww............xxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxx...x...........5.....7...............ww.......ww.....44....xxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxwxx..xx.....622...2.26...6.2...22.6...62..2..226ww.....44xx...xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxwwxxxx......2....2.22....2..2...2.2.......22...2ww....xxxx..xxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxwwwwxxx......2...2.2.2...2.22..2.22...22.2.2..22ww.....xxx....xxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxwwwwwx....4..2...2...........22...277..2..2.2.22ww...........xxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxwwwwwxx....42..2....22.4..2..2...2.4..2.22..22.2ww............xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.wwwwwwwwwwwww..2.........xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxwwwwwxx.....62....2.26...62.2.2..26...6...22..26..............xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxwwwww.........................................................xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxwwwwwxx....222.2.22..2.7.......7..............................xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxwwwww...........ccccccc+ccccccc...ccc......cc+ccc...xxxxx.....xxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxwwwwwxx.........c$$*.c$$5$+.5.c...+5c......c%%%%c......xxx3...xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxwwwwwx....2.....c$.c+cccccc.%.c...ccc......c%%%%c....xxxxx....xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxwwwwwx..........c..c..........c............cccccc......xxx....xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxwwxxxxxxx.......ccccc+ccccccccc.........................xx....xxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxwxx.....xxxx........c...c.................2...................xxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxx.........xxxx...........2....xxxx...........................xxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxx..............xxxx..........xxxx..x...........................xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxx.................xxxxx++xxxxx.....xx............xx...x........xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx.....................c..c..........xxxxx..........xxxxx.......xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxx.......cccc..........c..c...cccc......xxx...........x.........xxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxx.......c..c..........c++c...c..c........xxx.........x.........xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxx.......c..c..........c..c...c..c..........xxx.................xxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxx....cccc++cccccccccccc++ccccc..ccccccc......xxx...............xxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxx....c..........1.....................c........xxx.............xxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxx.cccc.....w....w....%1.....w.....%...c..........xxx...........xxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxx.c1.+....www..www..%%%....www...%%%1.c...........xxxxxxxxx....xxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxx.cccc.....w....w....%......w.....%...c..................xxx...xxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxx....c.......5........................c....................xxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxx....ccc....%%%%%....cccccccccccccccccc........................xxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxx......cc...........cc.........................................xxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxx.......cccccc+cccccc..........................................xxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxx........cc.......cc...........................................xxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxx.........cc.....cc.....................cccccccccccccccccccccccxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxx..........ccc+ccc......................c......vvv.............xxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxx..........ccc.c........................c......v5+...vvvvv.....xxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxx..........ccc.c........................c......vvv...v.5.v.....xxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxccccccccccccc.ccc......................c............v..5v.....xxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxx..........c.....cccccccccccccccccccccccccccc..........vv+vv...xxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxx..........c............................+................5111..xxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxx..........c.{([.c......................+................5.....xxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_DEATH_YAK;mons_array[1] = MONS_PLANT;mons_array[2] = MONS_GRIFFON;mons_array[3] = MONS_KILLER_BEE;mons_array[4] = MONS_OGRE;mons_array[5] = MONS_OKLOB_PLANT;mons_array[6] = MONS_WANDERING_MUSHROOM;return MAP_ENCOMPASS;}static char fort_yaktaur(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // by Matthew Ludivico (mll6@lehigh.edu)for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[36], ".........@....wwwwwwwwwwwwwwwwwxxxxxxxxx");strcat(vgrid[37], ".ccccc.......ww....wwww....wwwwxxxxxxxxx");strcat(vgrid[38], ".c$c%c......ww.ccccccccc.......xxxxxxxxx");strcat(vgrid[39], ".c+c+c......ww.c.%$....ccccccccxxxxxxxxx");strcat(vgrid[40], ".c...+......ww.c*.115..c$$+|*|cxxxxxxxxx");strcat(vgrid[41], ".c1..c.....ww..c...55+ccc+cxx=cxxxxxxxxx");strcat(vgrid[42], ".ccccc.....ww..ccccccc....c|=*cxxxxxxxxx");strcat(vgrid[43], "............ww.......c5...cxx=cxxxxxxxxx");strcat(vgrid[44], "....6.ccccc.ww.w...2.+51..c|1.cxxxxxxxxx"); // last 1 here was 7strcat(vgrid[45], "....63+...c..wwww..21+51..c2.2cxxxxxxxxx");strcat(vgrid[46], "....6.ccccc..wwwwww..c5...cc+ccxxxxxxxxx");strcat(vgrid[47], "............wwwwwww..c........cxxxxxxxxx");strcat(vgrid[48], "............wwwwwww..ccccccccccxxxxxxxxx");strcat(vgrid[49], "...........ww1w..www...........xxxxxxxxx");strcat(vgrid[50], ".......566.www.....www.........xxxxxxxxx");strcat(vgrid[51], ".........1ww....ccccc..........xxxxxxxxx");strcat(vgrid[52], ".....566.w......+...c..........xxxxxxxxx");strcat(vgrid[53], ".........www....ccccc..........xxxxxxxxx");strcat(vgrid[54], "...........ww............wwwwwwxxxxxxxxx");strcat(vgrid[55], ".......3....wwwww......www.....xxxxxxxxx");strcat(vgrid[56], "......666.......ww...www.......xxxxxxxxx");strcat(vgrid[57], ".....cc+cc.......wwwww.........xxxxxxxxx");strcat(vgrid[58], ".....c...c.....................xxxxxxxxx");strcat(vgrid[59], ".....ccccc.....................xxxxxxxxx");strcat(vgrid[60], "...............................xxxxxxxxx");strcat(vgrid[61], "...............................xxxxxxxxx");strcat(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_YAKTAUR;mons_array[1] = MONS_DEATH_YAK;mons_array[2] = MONS_MINOTAUR;mons_array[3] = RANDOM_MONSTER;mons_array[4] = MONS_YAK;mons_array[5] = MONS_GNOLL;mons_array[6] = RANDOM_MONSTER;return MAP_SOUTHEAST;}static char box_level(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // by John SavardUNUSED( mons_array );strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxx.................xx.............x...................^.........xxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxx.................xx...xxxxxx....x.xxxxxxx.xxxxxxxxxxxxxxxxxxx.xxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxx.................xx...xx.0......x.x........x......x.........x.xxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxx..$..............xx...xx........x.x........x.....%x.x..*..xxx.xxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxx......................xx........x.x........x.xxxxxx.x.....x...xxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxx......................xx....%...x.x........x.x......xxxxxxx.x.xxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxx.................xx...xx........x.x........x.x.xxxxxx.......x.xxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxx.................xx...xx........x.x..{.....x.x..............x.xxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxx.............0...xx...xxxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxx.................xx...........................................xxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxx}x.........................>=........xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxx..................x...xxx.x.xxx+xxxxxxxxxxxxxxxx+xxxxx........xxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxx..xxxxxxxxxxxxxx..x...xxx.x.x0...x..0..............0.x........xxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxx..x............x..x...xxx.x.x....x...................x........xxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxx....xxxxxxxxx..x..x...xxx.x.x....x...................x......8*xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxx..x.x....0..x..x..x...xxx...x...%x...................x......*|xxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxx..x.x..........x..x...xxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxx..x.x*......x..x..x..........x...........0...x...%............xxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxx..x.xxxxxxxxx..x..=..........x.xxxxxxxxxxxxx.x................xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx..x......0.....xxxxxxx.......x.x...x...x...x.x................xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxx..xxxxxxxxxxxxxxxxxxxx..0....x...x.x.x.x.x.x.x......0.........xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx..........^.........xx.......x.x.x.x.x.x.x...+................xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxcccccccccccccccccc..xx.......x.x$x...x...xxxxx................xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxc...........9....c..xx.......x.x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxc......c............xx.......x.x.x...x..0.....................xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxc.....|c............xx.......x.x.x.x.x........................xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxc...........9....c..xx.......x.x...x.x........................xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxcccccccccccccccccc..xx.......x.xxxxx.x........................xxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxx....................xx.......x.x.....=....................*...xxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxx....................xx.......x.x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......x.x.x...........................(xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx.x$x..xxxx.xxxxxxxxxxxxxxxxxxxx.xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx...............................x.x..x.......................x.xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.x..x.xxxxxxxxxxxxx.........x.xxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxx.............)xxx................x..x.xxxxxxxxxxxxx.........x.xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxx..............xxx.xxxxxxxxxxxxxxxx..x.xxxxxxxxxxxxx.........x.xxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxx..............xxx...................x.x...........xxxxx+xxxxx.xxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x..$........x.........x.xxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxx......9.......xxxxxxxxxxxxxxxxxxxxxxx.x...........x........%x.xxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x.0.........x0........x.xxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x.......$...x.........x.xxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x...........xxxxxxxxxxx.xxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxx.x...........xxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.............x...........xxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxx.xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.xxxxxxx=xxxxxx.xxxxxx.xxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxx.....xx.................xxxxxxxxxxx.......x........x.....x....xxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxx....0xx.................xxxxxxxxxxx.%.....x.0......x...0.x....xxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxx.....xx.9...............xxxxxxxxxxx.......x........x.%...x..$.xxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxx.....xx.................xxxxxxxxxxx.......x........x.....x....xxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxx.....xx.................xxxxxxxxxxx.......x........x.....x..0.xxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxx....0xx.................xxxxxxxxxxx.......x$.......x.....x....xxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxx]....xx................*xxxxxxxxxxx......[x........x.....x$...xxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");return MAP_ENCOMPASS;}static char vestibule_map(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // this is the vestibulestrcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxvvvvvvvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..v.....v..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....v.....v.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx........v.....v........xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxxxxx..........v..A..v..........xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxxxxxxx............v.....v............xxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxxxxxx.............v.....v.............xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxxxx..............vvv+vvv..............xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxxxxxx.....................................xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxxxxxxxxx.......................................xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxxxxxxxxxx.........................................xxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxxx.............................................xxxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxxxxx...............................................xxxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxxx.................................................xxxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxxx...................................................xxxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxxx.......................................................xxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxxx.......................................................xxxxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxxx.........................................................xxxxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxxx............................{............................xxxxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxxx.........................................................xxxxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxx...l.l.....................................................xxxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxx..l.l.l.l..................................................xxxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxx.l.l.l.l.l.................................................xxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxx.l.l.l.l.l...................................................xxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxl.l.l.l.l.l..................................................xxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxx.l.l.l.A.l.l.................}1].............................=Axxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxl.l.l.l.l.l.l.................)..............................xxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxx.l.l.l.l.l.l.................................................xxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxx.l.l.l.l.l.l...............................................xxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxx..l.l.l.l..................................................xxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxx.....l.l...................................................xxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxxx......................[...........(......................xxxxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxxx.........................................................xxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxx.........................................................xxxxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxxx.......................................................xxxxxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxxx.......................................................xxxxxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxxxxxxx...................................................xxxxxxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxxxxxxx....................wwwww........................xxxxxxxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxxxxxxx..................wwwwwwww.....................xxxxxxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxxxx..............wwwwwwwwwwwww..................xxxxxxxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxxxx...........w..wwww..wwwww..w...............xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxx..........w...ww.....ww..wwwww...........xxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxxxx.........ww......ww....wwwwwwwww.......xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxxxx.........ww....wwww...wwwwwwwwww.....xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxx.........ww....ww....wwwwwwwwwww...xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxx........wwww.......wwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxx......wwwwwww....wwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxx...wwwwwwwwwwAwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_GERYON;mons_array[1] = RANDOM_MONSTER;mons_array[2] = RANDOM_MONSTER;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;}static char castle_dis(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // Dispater's castle - rest of level filled up with plan_4 (irregular city)strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxv..............................................................vxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxv..vvvvvvvvv........................................vvvvvvvvv..vxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxv..v3.....|v........................................v|.....2v..vxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxv..v.vv+vvvv.v.v.v.v.v.v.v.v.v..v.v.v.v.v.v.v.v.v.v.vvvv+vv.v..vxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxv..v.v.....vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.....v.v..vxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxv..v|v.....+$$v$$+$$v||vvvvvvvvvvvvvvvvv$$$$v4.4.v$$v.....v|v..vxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxv..vvvv+vvvv$$+$$v$$+||v...............v$$$$+.4.4+$$v+vv+vvvv..vxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxv....vv.vvvvvvvvvvvvvvvv.v..v..v..v..v.v$$$$v4.4.v$$+||v.vv5...vxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxv...vvv................v...............vvvvvvvvvvvvvvvvv.vvv...vxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxv...5vv................+...............+.................vv....vxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxv...vvv+vvvvvvvvvvvvvvvv.v..v..v..v..v.vvvvvvvvvvvvvvvvv.vvv...vxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxv....vv..v.+$$$$$v.....v...............vvvvvvvvvvvvvvvvv.vv5...vxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxv...vvv..v.v$$$$$v.....v...............vv|$|$|vv|$|$|$vv.vvv...vxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxv...5vv..v.vvvvvvv.....vvvvv.......vvvvvv$|$|$++$|$|$|vv.vv....vxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxv...vvv..v...............v.vvvv+vvvvvvvvvvvvvvvvvvvvv+vv.vvv...vxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxv....vvv+v..........vvvvv.4vvv...vvvvvvvvvvvvvvvvvvvv+vv.vv5...vxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxv...vvv..v.v..v..v....2vvv+vv5...5vvvvvvv.4.4.vv.4.4.4vv.vvv...vxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxv...5vv.................vv|vvv...vvvvv.++4.4.4++4.4.4.vv.vv....vxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxv...vvv.................1vOvv5...5vvvv.vvvvvvvvvvvvvvvvv.vvv...vxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxv....vv.................vv|vvv...vvvvv.vvvvvvvvvvvvvvvvv.vv5...vxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxv...vvv.v..v..v..v....3vvv+vv5...5vvvv...................vvv...vxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxv...5vv.............vvvvv.4vvv...vvvvvvvvvvvvvvvvvvvvvvv.vv....vxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxv..vvvv+vvvv.............v.vv5...5vvvvvvvvvvvvvvvvvvvvvv+vvvv..vxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxv..v|v.....vvvvvvvvvvvvvvvvvvv...vvvvvvvvvvvvvvvvvvvv.....v|v..vxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxv..v.v.....vvvvvvvvvvvvvvvvvvvv+vvvvvvvvvvvvvvvvvvvvv.....v.v..vxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxv..v.vv+vvvv5.............5.........5..............5vvvv+vv.v..vxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxv..v2.....|v........................................v|.....3v..vxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxv..vvvvvvvvv........................................vvvvvvvvv..vxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxv............................{.[.(.............................vxxxxxxxx");mons_array[0] = MONS_DISPATER;mons_array[1] = MONS_FIEND;mons_array[2] = MONS_ICE_FIEND;mons_array[3] = MONS_IRON_DEVIL;mons_array[4] = MONS_METAL_GARGOYLE;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_NORTH_DIS;}static char asmodeus(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxx....xxxxxxxxxxxxxxx.xxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxx..xxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxx....xxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxx...xxx................................xxxxxx....xxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxx.x.xxxxx.........................................xxx....xxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxx....xx.....................4......................xx...xxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxx......x......................llllllllllllll.........x..xxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxx..xx..................lllllllllllllllllllllllll........xxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxx...xxx....0..........llllllllllllllllllllllllll........xx...xxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxx....xxx.............llllllllllllllllllllllllllll..............xxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxx....xx...........lllllllllllllllllllllllllllll...............xxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxx..............llllllllllllllllllllllllllllll...2..xx...0...xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxx...........lllllllllllllllllll.......llllll......xx......xxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxx.......llllllllllllllllll............llllll.............xxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxxxx......lllllllll..........4.........4.lllllll..........xxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxx...xx...ll3lllll......4...................llllllll......x.xxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxx.......lllll.l................................llll.......xxxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxx..4..llllll...cccccccc+c+c+c+c+c+c+c+c+c+c....lll......xxxxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxx..lllllll..4.c.....c....................c....llll.....xxxxxxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxx...llllll.....c.V.V.+....0.....3.....0...c.....llll....x..xxxxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx...llllll...l..c.....c....................c....lllll........xxxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxx...lllll..ll..c..5..cccccccccccccccccccccc.4..llllll........xxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx...lllll..llll.c.....c...............c....c....lllllll.......xxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxx...lllll..llll.c.V.V.c.......0.......c....c....lllllll.......xxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxx...lllll..lll.c.....+...............+....c...lllllll........xxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxxx..lllll...ll.cccccccccc....0.......c....c...llllllll........xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxx...lllll..4...c|$$||$$|c............c.0..c...llllllll........xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxx...lllll.......c$$$$$$$$cccccccccccccc....c...lllllll.........xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxx...lllll.......c$$|2|$$|c..0.........+....c...lllllll........xxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxx.lllllll......c|$$$$$$$c........9...c....c....llllllll.....xxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxx.lllllll......c$|$|$$|$c+ccccccccccccccccc....lllllll......xxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxx..llllll......cccccccc+c.....9.......c.........llllll......x.xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxx..lllllll.....c$$$$$$+3c.....8...3...c.....4...llllll........xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxx..llllllll....c$$$$$$c.c.....9.......c..ll....llllll.........xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxx...llllll..4..c$$2$$$c.ccccccccccccc+c.lll...lllllll...0....xxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxx..llllll.....c$$$$$$c..+............c.ll...lllllll..........xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxx..llllllll...ccccccccc+cccccccccccccc.....lllllll...........xxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxxx..llllllll.........cc..........cc........lllllll.......x..xxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxxx.llllllllll.......ccc.........cc......lllllllll.......xxxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxx....lllllllllll...4...cc.....2.2.cc....llllllllll.4.......xxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxx....4.lllllllllllll....cccccccc+cccc..lllllllllll.....xx....xxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxx.....llllllllllllll...cccccccc+cccc..llllllllll......xx....xxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxx.....lllllllllllllll..cc......cc...lllllllllll...........xxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxx.....llllllllllllll...ccO1....cc.4..lllllllll...........xxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxx.....lllllllllllll...cc......cc....lllllllll.......xx.xxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxx.......llllllllllll..cccccccccc...lllllllll........xxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxx.........llllllllllllll.cccccccccc.lllllllllll.......xxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxx....0...llllllllllllll............lllllllll....0....xxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxx.......4.lllllllllllllll..4....lllllllll...........xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxx..........llllllllllllll....lllllll....4.....x........xxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxx...xx.........lllllllllllllllll...................xx{xxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxx..xx................lllllll.....................xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxx.........xxx.................xxxxxx......xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxx....xxxxxxxx...xxx......xxxxxxxxxx.......xxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxx(xxxxxxxxxxxx[xxxxx...xxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_ASMODEUS;mons_array[1] = MONS_FIEND;mons_array[2] = MONS_BALRUG;mons_array[3] = MONS_MOLTEN_GARGOYLE;mons_array[4] = MONS_SERPENT_OF_HELL;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;}static char antaeus(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // bottom of Cocytus. This needs workstrcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx........................xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxx..........................xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxxxxxxx................................xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxxxxxx....cccccccccccc..cccccccccccc....xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxxxx....ccccccccccccc2.ccccccccccccc....xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxxxxxx....cc..........................cc....xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxxxxxxxxx....cc............................cc....xxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwwwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwwwwwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwwwwwwwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxxxxx....cc...ww.......3..........3.......ww...cc....xxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxxx....cc...ww............................ww...cc....xxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxxx....cc...ww....cccccccccccccccccccccc....ww...cc....xxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxxx....cc...ww....cccccccccccccccccccccccc....ww...cc....xxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxxx....cc...ww....cc......................cc....ww...cc....xxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxx....cc...ww....cc...T................T...cc....ww...cc....xxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxx....cc...ww....cc..........wwwwww..........cc....ww...cc....xxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxx....cc...ww....cc.......wwwwwwwwwwwwww.......cc....ww...cc....xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx....cc...ww...cc.....wwwwwwwwwwwwwwwwwwww.....cc...ww...cc....xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxx....cc..www..cc....wwwwwwwwwccccccwwwwwwwww....cc..www..cc....xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx....cc..www.cc....wwwwwwwwccc2O12cccwwwwwwww....cc.www..cc....xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxx....cc..www.cc...wwwwwwwwcc2+....+2ccwwwwwwww...cc.www..cc....xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxx....cc..www.cc...wwwwwwwwcc+cc++cc+ccwwwwwwww...cc.www..cc....xxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxx....cc..www..c..wwwwwwwwwc|||c..c$$$cwwwwwwwww..c..www..cc....xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxx....cc..wwww.c.wwwwwwwwwwc|||c..c$$$cwwwwwwwwww.c.wwww..cc....xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxx....cc..wwww.c.wwwwwwwwwwcc||c..c$$ccwwwwwwwwww.c.wwww..cc....xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxx....cc..wwww.c.wwwwwwwwwwwcccc++ccccwwwwwwwwwww.c.wwww..cc....xxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxx....cc..www..c..wwwwwwwwwwwwww..wwwwwwwwwwwwww..c..www..cc....xxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxx....cc..www.cc...wwwwwwwwwwwwwwwwwwwwwwwwwwww...cc.www..cc....xxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxx....cc..www.cc....wwwwwwwwwwwwwwwwwwwwwwwwwww...cc.www..cc....xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxx....cc..www.cc....wwwwwwwwwwwwwwwwwwwwwwwwww....cc.www..cc....xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx....cc..www..cc....wwwwwwwwwwwwwwwwwwwwwwww....cc..www..cc....xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxx....cc...ww...cc.....wwwwwwwwwwwwwwwwwwww.....cc...ww...cc....xxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxx....cc...ww....cc.......wwwwwwwwwwwwww.......cc....ww...cc....xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxx....cc...ww....cc..........wwwwww..........cc....ww...cc....xxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxx....cc...ww....cc...T................T...cc....ww...cc....xxxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxx....cc...ww....cc......................cc....ww...cc....xxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxxxxx....cc...ww....ccccccccccc..ccccccccccc....ww...cc....xxxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxxxxxxx....cc...ww....cccccccccc2.cccccccccc....ww...cc....xxxxxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxxxxxxx....cc...ww............................ww...cc....xxxxxxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxxxxxxx....cc...ww..........................ww...cc....xxxxxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwww..wwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwww..wwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwww..wwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxxxx....cc............................cc....xxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxxxx....cc..........................cc....xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxx....cccccccccccccccccccccccccccc....xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxx....cccccccccccccccccccccccccc....xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxx................................xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxx..........{.(.[...........xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_ANTAEUS;mons_array[1] = MONS_ICE_FIEND;mons_array[2] = MONS_ICE_DRAGON;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;}static char ereshkigal(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // Tartarus// note that the tomb on the right isn't supposed to have any doorsstrcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxx.................cccc..........ccc............................xxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxx.............ccccc..cccc.....ccc.cccc.........................xxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxx...........ccc.........ccccccc.....cc.........................xxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxx.........ccc.......2............V..cc.........................xxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxx........cc4........................cc...........xxxxxxxx......xxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxx........cc44xxx==xxx...............cc..........xx......xx.....xxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxx........ccxxx......xxx.......ccc++ccc.........xx........xx....xxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxx........cxx..........xxx.....ccc44ccc.........x..........x....xxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxx........cx............xx....cccc44cc.........xx..........xx...xxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxx.......ccx.G........G.xxx7ccc..c44c..........x.....|......x...xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxx.......cxx............xxxcc..................x......7.....x...xxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxx......ccx..............xxc...................xx..........xx...xxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxx......ccx..G........G..xxc..x.........x.......x..........x....xxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxx......ccx..............xcc....................xx........xx....xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxx.......cxx............xxc......................xx......xx.....xxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxx.......ccx.F........F.xcc.......................xxxxxxxx......xxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxx........cx............xc......................................xxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxx........cxx....17....xxc....x.........x.......................xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx........ccxxx......xxxcc......................................xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxx........cccc=xxxxxx=cccc......................................xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx........cc||cccccccc||cc......................................xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxx.........cc||||O|||||cc.......................................xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxx..........cccccccccccc......x.........x............V..........xxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxx...........................................xx$$$$xxx|||||xx...xxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxx.......V........V...........x.........x....xx$$$$xxx|||||xx...xxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxx...........................................xx44444xx22222xx...xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx.......xxxxxxxxx+xxxxxxxxx.................xx44444xx22222xx...xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxx.......x3.2..........3...x..x.........x..xxxxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxx.......x.x.x.x.x.x.x.x.x.x.................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxx.......x...2.3..4..5..4..x......................=.......xxx...xxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxx.......xx.x.x.x.x.x.x.x.xx......................=.......xxx...xxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxx.......x..65..3..6.6...5.x.................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxx.......x.x.x.x.x.x.x.x.x.x..x.........x..xxxxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxx.......x...4...3.....4...x.................xx.....xx555555x...xxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxx.......xx=xxxxx.x.xxxxxxxx.................xx.....xx555555x...xxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxx.......x$$$$$$x.25.x$$$||x.................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxx.......x$x$$x$xx.x.x$x$x|x.................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxx.......x||||||x.556=$$$||x..x.........x....xx$$xx56565xx$|x...xxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxx.......xxxxxxxxxxxxxxxxxxx.................xx$$xx65656xx|7x...xxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxx........(...........................................[.........xxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxx..............................{...............................xxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_ERESHKIGAL;mons_array[1] = MONS_NECROPHAGE;mons_array[2] = MONS_WRAITH;mons_array[3] = MONS_SHADOW;mons_array[4] = MONS_ZOMBIE_SMALL;mons_array[5] = MONS_SKELETON_SMALL;mons_array[6] = MONS_SHADOW_FIEND;return MAP_ENCOMPASS;}static char mnoleg(char vgrid[81][81], FixedVector<int, 7>& mons_array){for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[7], "x.................2............xxxxxxxxx");strcat(vgrid[8], "x.....2........................xxxxxxxxx");strcat(vgrid[9], "x..cccccccc...ccccccc..ccccccc.xxxxxxxxx");strcat(vgrid[10], "x..ccccccccc.2.ccccccc..cccccc.xxxxxxxxx");strcat(vgrid[11], "x..cccccccccc...ccccccc..ccccc.xxxxxxxxx");strcat(vgrid[12], "x..ccccccccccc.1.ccccccc..cccc.xxxxxxxxx");strcat(vgrid[13], "x2.cccccccccc.2..Occccccc2.ccc.xxxxxxxxx");strcat(vgrid[14], "x..ccccccccc.....ccccccccc..cc.xxxxxxxxx");strcat(vgrid[15], "x..cccccccc...c...ccccccccc..c.xxxxxxxxx");strcat(vgrid[16], "x..ccccccc...ccc...ccccccccc...xxxxxxxxx");strcat(vgrid[17], "x..cccccc...ccccc...ccccccccc..xxxxxxxxx");strcat(vgrid[18], "x..ccccc...ccccccc...ccccccccc.xxxxxxxxx");strcat(vgrid[19], "x..cccc...ccccccccc...ccccccc..xxxxxxxxx");strcat(vgrid[20], "x..ccc.2.ccccccccccc.2.ccccc...xxxxxxxxx");strcat(vgrid[21], "x..cc.....ccccccccccc...ccc....xxxxxxxxx");strcat(vgrid[22], "x..c...c...ccccccccccc...c.2...xxxxxxxxx");strcat(vgrid[23], "x.....ccc.2.ccccccccccc......c.xxxxxxxxx");strcat(vgrid[24], "x....ccccc...ccccccccccc....cc.xxxxxxxxx");strcat(vgrid[25], "x.2.ccccccc...ccccccccccc..ccc.xxxxxxxxx");strcat(vgrid[26], "x.................2.......cccc.xxxxxxxxx");strcat(vgrid[27], "x...c..ccccccc.ccccccc...ccccc.xxxxxxxxx");strcat(vgrid[28], "x..ccc......2c.c2cccc...cccccc.xxxxxxxxx");strcat(vgrid[29], "x.ccccc..ccc.c.c2ccc.2.ccccccc.xxxxxxxxx");strcat(vgrid[30], "x.cccccc..cc.c.c.cc...cccccccc.xxxxxxxxx");strcat(vgrid[31], "x.ccccccc..c.c.c.c...ccccccccc.xxxxxxxxx");strcat(vgrid[32], "x.cccccccc...c.c....cccccccccc.xxxxxxxxx");strcat(vgrid[33], "x.ccccccccc..c.c...ccccccccccc.xxxxxxxxx");strcat(vgrid[34], "x..............................xxxxxxxxx");strcat(vgrid[35], "xxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_MNOLEG;mons_array[1] = MONS_NEQOXEC;mons_array[2] = RANDOM_MONSTER;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_NORTHEAST;}static char lom_lobon(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwww.......wwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwbbbwwwwwww.......wwwwwwwxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxwwwwwwwwwwwwbbbbbbbbbbbwwwwww.........wwwwwwxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxwwwwwwwwwwwwbbbbwwwwwwwwwbbbbwwwwww.........wwwwwwxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxwwwwwwwbbbbbbbbwwwwwwwwwwwwwwwbbbwwwww...........wwwwwxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxwwwwwbbbb......bbbwwwwwwwwwwww...bbwwwww.............wwwxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxwwwbbb...........bbbwwwwww........bbwwwww.............wwxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxwwwbb...............bbwwww..........bwwwwww.............wwxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxwwbb........1O.......bbww...........bbwwww..............wwxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxwwwb...................bw......2......bwww.....U....2.....wwxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxwwbb...................bb.............bww.................wwxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxwwbb..3................bbb............bbw..............4..wwxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxwwbbb...................b.b............4....................wwxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxwwbwbb.................bb.......U......4..........U..........wxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxwwbwwbb...............bb..b............bbw..............4.....xxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxwwbbwwbbb...........bbb..bb............bwww...................xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxwwwbwwwwb..b..2..bbbb....b.............bwww...................xxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxwwbwwww...bbbbbbb.......bw.....3.....bbwwww...U.....3.......xxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxwwbbww.................bbww........wwbwwwww.................xxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxxwwwbbw................bbwwwww....wwwbbwwww..................xxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxxwwwwbb...4...U........bwwwwwwwwwwwwbbwww....................xxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxxxwwwwbbb...........bbbbbwwwwwwwwwbbbwww....................xxxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxxxwwwwwwbbbb.....bbbbwwwbbbbwwwbbbbwwww....................xxxxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxxxwwwwwwwwwbbbbbbbwwwwwwwwwbbbbbwwwww......4.....4........xxxxxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww......................xxxxxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwww.......................xxxxxxxxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwww........................xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxxxxxxxxxxxxxxxwwwwwww......................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...@.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_LOM_LOBON;mons_array[1] = MONS_GIANT_ORANGE_BRAIN;mons_array[2] = MONS_RAKSHASA;mons_array[3] = MONS_WIZARD;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_NORTH;}static char cerebov(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // you might not want to teleport too much on this level -// unless you can reliably teleport away again.for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[7], "...............................xxxxxxxxx");strcat(vgrid[8], ".............vvvvv.............xxxxxxxxx");strcat(vgrid[9], ".............v$$$v.............xxxxxxxxx");strcat(vgrid[10], ".............v|||v.............xxxxxxxxx");strcat(vgrid[11], ".............v$$$v.............xxxxxxxxx");strcat(vgrid[12], ".vvvvv...vvvvvvvvvvvvv...vvvvv.xxxxxxxxx");strcat(vgrid[13], ".v|$|vvvvv...........vvvvv$|$v.xxxxxxxxx");strcat(vgrid[14], ".v$|$v.....vvvvvvvvv.....v|$|v.xxxxxxxxx");strcat(vgrid[15], ".v|$|v.vvvvvvvvOvvvvvvvv.v$|$v.xxxxxxxxx");strcat(vgrid[16], ".vvvvv.vvvvvv..3..vvvvvv.vvvvv.xxxxxxxxx");strcat(vgrid[17], "...v...vv.....vvv.....vv...v...xxxxxxxxx");strcat(vgrid[18], "...v.vvvv....vv1vv....vvvv.v...xxxxxxxxx");strcat(vgrid[19], "...v.vv......v...v......vv.v...xxxxxxxxx");strcat(vgrid[20], "...v.vvvv.............vvvv.v...xxxxxxxxx");strcat(vgrid[21], "...v...vv..2.......2..vv...v...xxxxxxxxx");strcat(vgrid[22], ".vvvvv.vv..2.......2..vv.vvvvv.xxxxxxxxx");strcat(vgrid[23], ".v|$|v.vv.............vv.v$|$v.xxxxxxxxx");strcat(vgrid[24], ".v|$|v.vv...vv...vv...vv.v$|$v.xxxxxxxxx");strcat(vgrid[25], ".v|$|v.vv...vv+++vv...vv.v$|$v.xxxxxxxxx");strcat(vgrid[26], ".vvvvv.vvvvvvv...vvvvvvv.vvvvv.xxxxxxxxx");strcat(vgrid[27], "....v..vvvvvvv...vvvvvvv..v....xxxxxxxxx");strcat(vgrid[28], "....vv...................vv....xxxxxxxxx");strcat(vgrid[29], ".....vv.vvvvv..2..vvvvv.vv.....xxxxxxxxx");strcat(vgrid[30], "......vvv|||v.....v$$$vvv......xxxxxxxxx");strcat(vgrid[31], "........v|$|vv...vv$|$v........xxxxxxxxx");strcat(vgrid[32], "........v|||v.....v$$$v........xxxxxxxxx");strcat(vgrid[33], "........vvvvv.....vvvvv........xxxxxxxxx");strcat(vgrid[34], "...............................xxxxxxxxx");strcat(vgrid[35], "...............@...............xxxxxxxxx");mons_array[0] = MONS_CEREBOV;mons_array[1] = MONS_BALRUG;mons_array[2] = MONS_PIT_FIEND;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_NORTHEAST;}static char gloorx_vloq(char vgrid[81][81], FixedVector<int, 7>& mons_array){for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxxxxxxxxxxxxxx@.xxxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxx..............................x");strcpy(vgrid[38], "xxxxxxxxx..............................x");strcpy(vgrid[39], "xxxxxxxxx..............................x");strcpy(vgrid[40], "xxxxxxxxx.x.x.x.x.x.x.x..x.x.x.x.x.x.x.x");strcpy(vgrid[41], "xxxxxxxxx..............................x");strcpy(vgrid[42], "xxxxxxxxx.x.xxxx=xxxxxxxxxxxx=xxxxxx.x.x");strcpy(vgrid[43], "xxxxxxxxx...xx....................xx...x");strcpy(vgrid[44], "xxxxxxxxx.x.x..ccccc..4..4..ccccc..x.x.x");strcpy(vgrid[45], "xxxxxxxxx...x.cc.3............3.cc.x...x");strcpy(vgrid[46], "xxxxxxxxx.x.x.c..ccccc.cc.ccccc..c.x.x.x");strcpy(vgrid[47], "xxxxxxxxx...x.c.cc.....cc.....cc.c.x...x");strcpy(vgrid[48], "xxxxxxxxx.x.x.c.c.2...cccc...2.c.c.x.x.x");strcpy(vgrid[49], "xxxxxxxxx...x...c...ccc..ccc...c...=...x");strcpy(vgrid[50], "xxxxxxxxx.x.x.3.....2..1O..2.....3.x.x.x");strcpy(vgrid[51], "xxxxxxxxx...=...c...ccc..ccc...c...x...x");strcpy(vgrid[52], "xxxxxxxxx.x.x.c.c.2...cccc...2.c.c.x.x.x");strcpy(vgrid[53], "xxxxxxxxx...x.c.cc.....cc.....cc.c.x...x");strcpy(vgrid[54], "xxxxxxxxx.x.x.c..ccccc.cc.ccccc..c.x.x.x");strcpy(vgrid[55], "xxxxxxxxx...x.cc.3............3.cc.x...x");strcpy(vgrid[56], "xxxxxxxxx.x.x..ccccc..4..4..ccccc..=.x.x");strcpy(vgrid[57], "xxxxxxxxx...xx....................xx...x");strcpy(vgrid[58], "xxxxxxxxx.x.xxxx=xxxx=xxxxxxxx=xxxxx.x.x");strcpy(vgrid[59], "xxxxxxxxx..............................x");strcpy(vgrid[60], "xxxxxxxxx.x.x.x.x.x.x.x..x.x.x.x.x.x.x.x");strcpy(vgrid[61], "xxxxxxxxx..............................x");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_GLOORX_VLOQ;mons_array[1] = MONS_EXECUTIONER;mons_array[2] = MONS_DEMONIC_CRAWLER;mons_array[3] = MONS_SHADOW_DEMON;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_SOUTHWEST;}static char beehive(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaaRaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxaaaaaaaaaaRa2aaR1RaaRa2aaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxaaaaaaaaaaRa2a3R3aRaRaRaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxxxaaaaRaRaRaaa3aaa3aRa.a.aaaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxaaaaaaRa.aRa2a2a2a2aRaRa.a.a3aaaaaaaaaaaaaaxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxx4aaaaaaaaa.aaRaRaa2aa2aaRaaa.aa3a33aaaaaaaaaa.44xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxx.4aaaaaaa.222a3a.aaaRaaa.aaa.R3aa3a3aaaaaaaa.....4xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxx....aaaaaaa.aRa.a3aRaRa.a3a.a.a.a.aRa2aaaaaa....xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxx...aaaaaa3a3a.a.a.a3aRa2aRa3a.a.aRaRa.aaaaa...xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxx...aa2aRa3a3a3aRa.a3a.a.a.a.a.a.a.a3a.aaa...xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxx...aaa.a.a.a2a.aaa.aRaRa2a.a2a3a.a2aaaa..T..xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxx.....a2a.a2a.aRaaaaa3a.a.aaa3a3a3a3a.a.........xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxx.4...aaRRaa.a2a.a3a3a3a.aaa.a.aRa.a.aa..4.......xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxx......a.a.aaa.a3a.a.a.a.aaa2a.a2a.a.aRaa.....4...xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxx.....aa3a2aaa.a.a.a3a3a3a3aRaaa.a2a.a2aa........xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxx...aaaa.a2aRa.a.a2aaa.a.a.a.aaa.a.aaaa.....xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxxxx..aaa.a.a.a.a.a.a.aaa2a.a3a2a.a2aaa.....xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxxxxxx.aaaa3a.a2aRa.a.aaaRa.a.aa.a.aaa....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxxxxxxx...aaaaRa.a3a3a.a.a.aaa.aa.aa....4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxxxxx........aa.a2a.a.aaa2aa.aa.aaa....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxxxxx....4.....a.a2a2a.a2a.a2a.......4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxxx.............a.a.a.a.a.a.....4....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxx..............4..a.a.a......4...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxx.................a.a.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxx........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxx.....4...T............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxx.......................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxxx.........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxx.................T.........xxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxx.......4.....................xxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxxx..............xx...............xxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxxx............xxxxx........4......xxxx..4....xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxx..T..........xxx................xxxxx...T.xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxx............xxx........T.........xxx........xxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxx....4........xx....................x..........xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxx...............x.x...xxx...............xx.xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxx.........4...........xxx..................xxxxxxxxxxxxxxxxxxaaaaaxxxxx");strcpy(vgrid[47], "xxxxxxxxx.....4.....................4......4...........4...xxxxxxxxxxaa5a5aaxxxx");strcpy(vgrid[48], "xxxxxxxxx.................................................wwwwwwwwxxxa5*|*5axxxx");strcpy(vgrid[49], "xxxxxxxxx............x...x...T.....xxxx.................wwwwwwwwwwwwxaa*|*aaxxxx");strcpy(vgrid[50], "xxxxxxxxxx.........xx.............xxxxx................wwwwwwwwwwwwwwxaa5aaxxxxx");strcpy(vgrid[51], "xxxxxxxxxxx.......x..................xxx....4..........wwwwwwwwwwwwwwwxa5axxxxxx");strcpy(vgrid[52], "xxxxxxxxxxx.....xxx...4...........................xxxx.4wwwwwwwwwwwwwwwa=axxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxx..xxx.............xx....(.........xxxxxxxx....wwwwwwwwwwwwwwaaxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxx.............xxxx..................xxxx......wwwwwwwwwwxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxx....{..}..xxxxxx..]......xxx...........4.wwwwwwwwwwwwxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxx........xxx........xxxxxx....4....wwwwwwwwwwwwwwxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxxx..[.xxx........xxx)....wwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_QUEEN_BEE;mons_array[1] = MONS_KILLER_BEE;mons_array[2] = MONS_KILLER_BEE_LARVA;mons_array[3] = MONS_PLANT;mons_array[4] = MONS_YELLOW_WASP;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;}static char vaults_vault(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // last level of the vaults -- dungeon.cc will change all these 'x'sstrcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxx..x.........................x....xxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxx..x.xxxxxxxxxxx..xxxxxxxxxx.x....xxxxx.................xxxxx..xxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxx..x.x*.*.*.*.*x..x........x.x....xxx..........8..........xxx..xxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxx..x.x.*.*.*.*.x..x........x.x....xxx.....................xxx..xxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxx..x.x*.*.*.*.*x..x...||...x.x....xx......9........9.......xx..xxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxx..x.x.*.*.*.*.x..x...||...x.x....xx.......................xx..xxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxx..x.x*.*.*.*.*x..x...||...x.x....xx......xxxxxxxxxxx......xx..xxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxx..x.x.*.*.*.*.x..x........x.x....xx......x.........x......xx..xxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxx..x.x*.*.*.*.*+..+........x.x....xx....xxx..........xx....xx..xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxx..x.x.*.*.*.*.xxxxxxxxxxxxx.x....xx.9..x....xxxxx....x..8.xx..xxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxx..x.xxxxxxxxxxx9998.........x....xx....x...xx$$$xx...x....xx..xxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxx..x...........899xxxxxxxxxx.x....xx....x..xx$***$xx..x....xx..xxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxx..x.xxxxxxxxxxx99x........x.x....xx....x..x$$*|*$$x..x....xx..xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxx..x.x.....|...x88x.$$$$$$.x.x....xx..8.x..xx$***$xx..x....xx..xxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxx..x.x.|..|..|.x..x.$$$$$$.x.x....xx....x....x$$$xx...x..9.xx..xxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxx..x.x.........x..x.$$$$$$.x.x....xx....xxx..xxxxx..xxx....xx..xxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxx..x.x.|..|..|.x..x.$$$$$$.x.x....xx......x.........x......xx..xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx..x.x.........x..x.$$$$$$.x.x....xx......xxxxxxxxxxx......xx..xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxx..x.x|..|..|..x..x.$$$$$$.x.x....xxx.....................xxx..xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx..x.x.........x..+........x.x....xxx......9.........9....xxx..xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxx..x.xxxxxxxxx+x..xxxxxxxxxx.xx.11....xx................xxxxx..xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxx..x...........x..x...........x1111...xxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxx..1....1..xxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxx..........................xx1..(}..1..........................xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxx...........................11.[..{.11.........................xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxx............................1..])..1..........................xxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxx.............................1....1...........................xxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx.....1111..x.xxx.xxxxxxxxxxxxxxxxxx..xxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.....11..........................x..xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxx..x.x.x.x.x.x.x.x|x.x.x.x.x................................x..xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx..xx.x|x.x.x.x.x.x.x.x.x.x.x.....x.........................x..xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxx..x.x.x.x.x.x.x.x9x.x.x.x.x.x..........8..........9........x..xxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x..9......................x..xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxx..x.x.x.x.x.x.x.x.x.x|x.x.x.x....x.........................x..xxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxx..xx.x8x.x.x|x.x.x.x.x.x.x.xx....x..............9...9......x..xxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxx..x.x.x.x.x9x.x.x.x.x.x.x.x.x...........8..................x..xxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x..9......................x..xxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxx..x.x.x.x.x.x.x.x.x|x.x9x.x.x....x.........................x..xxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x...................9.....x..xxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxx..x.x.x9x.x.x.x.x.x.x.x.x.x.x....x....9......8.............x..xxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxx..xx.x.x.x.x.x.x9x.x.x.x.x.xx....x.........................x..xxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxx..x.x.x.x.x.x.x.x.x.x.x.x.x.x....x.........................x..xxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x.......9......9..........x..xxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxx..x.x.x.x.x.x.x.x.x.x8x.x.x.x....x.....................8...x..xxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxx..xx.x8x.x.x.x.x.x.x.x.x.x.xx....x.....................||.|x..xxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxx..x.x|x.x.x.x.x.x.x|x.x.x.x.x....x.....................|...x..xxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxx..xx.x.x.x.x.x.x8x.x.x.x.x.xx....x......8..................x..xxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxx..x.x.x.x.x.x.x.x.x.x.x.x.x.x....x..........8..8...8.....||x..xxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxx..xO.x.x.x.x.x.x.x.x.x.x|x.xx....x.....................|.||x..xxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
mons_array[0] = MONS_VAULT_GUARD;mons_array[1] = RANDOM_MONSTER;mons_array[2] = RANDOM_MONSTER;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;}static char snake_pit(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // Hey, this looks a bit like a face ...for (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxxxxxxxxxxxxxx..@.xxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxxxxxxxxxx.............xxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxxxx....x.............x..xxxxx");strcpy(vgrid[39], "xxxxxxxxxxxx....2.x.............x.2..xxx");strcpy(vgrid[40], "xxxxxxxxxxx.....2.x....x.....x..x..3.xxx");strcpy(vgrid[41], "xxxxxxxxxxx.....22x.............xx.2..xx");strcpy(vgrid[42], "xxxxxxxxxxx.......xx..x........xx..3..xx");strcpy(vgrid[43], "xxxxxxxxxx.....x23.xx....T...xxx.44...xx");strcpy(vgrid[44], "xxxxxxxxxx......4.4.x.........x.333....x");strcpy(vgrid[45], "xxxxxxxxxx......3.x4...x.......4x4.....x");strcpy(vgrid[46], "xxxxxxxxxx.......3.......x.............x");strcpy(vgrid[47], "xxxxxxxxxx..c......3.........x.......c.x");strcpy(vgrid[48], "xxxxxxxxx...cc...................3..cc.x");strcpy(vgrid[49], "xxxxxxxxx...cc..........4.4.........cc.x");strcpy(vgrid[50], "xxxxxxxxx...cc...3...x........2.....cc.x");strcpy(vgrid[51], "xxxxxxxxx...cc.........1...1.......cc..x");strcpy(vgrid[52], "xxxxxxxxxx..cc.....1.....1.....1..ccc.xx");strcpy(vgrid[53], "xxxxxxxxxx...ccc..................cc..xx");strcpy(vgrid[54], "xxxxxxxxxx....cccc....3333333.....cc..xx");strcpy(vgrid[55], "xxxxxxxxxx.....ccccccc...........cc...xx");strcpy(vgrid[56], "xxxxxxxxxx........cccccccO...ccccc....xx");strcpy(vgrid[57], "xxxxxxxxxxx........cccccccccccccc....xxx");strcpy(vgrid[58], "xxxxxxxxxxx.........cccccccccccc.....xxx");strcpy(vgrid[59], "xxxxxxxxxxxxx.......................xxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxx..................xxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxx.......xxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_GREATER_NAGA;mons_array[1] = MONS_NAGA;mons_array[2] = MONS_NAGA_MAGE;mons_array[3] = MONS_NAGA_WARRIOR;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_SOUTHWEST;}static char elf_hall(char vgrid[81][81], FixedVector<int, 7>& mons_array)
static int write_vault(const map_def &mdef, map_type map,FixedVector<int, 7> &marray,vault_placement &place)
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxcccccccccccccccccxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxcc*|*|*|**|||||c$ccxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxcc*$*|*|*|*|||||c$$ccxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxcc*$|*$***$$|||||c|$$ccxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxcc*$*|**ccccccccccc$$$$ccx");strcpy(vgrid[12], "xxxxxxxxxxxxxxc*|*$*$ccc.....2..c+$|$$cx");strcpy(vgrid[13], "xxxxxxxxxxxxxxc$*$*ccc...........c$$$$cx");strcpy(vgrid[14], "xxxxxxxxxxxxxxc||**cc...5.......4cc$|$cx");strcpy(vgrid[15], "xxxxxxxxxxxxxxc*$$cc........3..ccccccccx");strcpy(vgrid[16], "xxxxxxxxxxxxxxc$+ccc.....2....cc.....5cx");strcpy(vgrid[17], "xxxxxxxxxxxxxxc$c....5.......cc.......cx");strcpy(vgrid[18], "xxxxxxxxxxxxxxccc......5....cc..2....ccx");strcpy(vgrid[19], "xxxxxxxxxxxxxxxxc..........cc.......ccxx");strcpy(vgrid[20], "xxxxxxxxxxxxxxxcc..1..U..........4..ccxx");strcpy(vgrid[21], "xxxxxxxxxxxxxxcc.....................ccx");strcpy(vgrid[22], "xxxxxxxxxxxxxxc...........3...........cx");strcpy(vgrid[23], "xxxxxxxxxxxxxxc.......2.......3.......cx");strcpy(vgrid[24], "xxxxxxxxxxxxxxc..2................2..5cx");strcpy(vgrid[25], "xxxxxxxxxxxxxxc......x.........x......cx");strcpy(vgrid[26], "xxxxxxxxxxxxxxc.....xx.........xx.....cx");strcpy(vgrid[27], "xxxxxxxxxxxxxxc2...xxx....1....xxx.4..cx");strcpy(vgrid[28], "xxxxxxxxxxxxxxc..xxxx...........xxxx..cx");strcpy(vgrid[29], "xxxxxxxxxxxxxxc.xxx.....cc.cc.....xxx.cx");strcpy(vgrid[30], "xxxxxxxxxxxxxxc.x.....cccc.cccc.....x.cx");strcpy(vgrid[31], "xxxxxxxxxxxxxxc.3...cccxxc.cxxccc.3...cx");strcpy(vgrid[32], "xxxxxxxxxxxxxxc...cccxxxxc.cxxxxccc...cx");strcpy(vgrid[33], "xxxxxxxxxxxxxxc.cccxxxxxxc.cxxxxxxccc.cx");strcpy(vgrid[34], "xxxxxxxxxxxxxxcccxxxxxxxxc.cxxxxxxxxcccx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxx");
place.map = &mdef;
mons_array[0] = MONS_DEEP_ELF_HIGH_PRIEST;mons_array[1] = MONS_DEEP_ELF_DEMONOLOGIST;mons_array[2] = MONS_DEEP_ELF_ANNIHILATOR;mons_array[3] = MONS_DEEP_ELF_SORCERER;mons_array[4] = MONS_DEEP_ELF_DEATH_MAGE;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;
// Copy the map so we can monkey with it.map_def def = mdef;resolve_map(def);
// Slime pit take is reduced pending an increase in difficulty// of this subdungeon. -- bwrstatic char slime_pit(char vgrid[81][81], FixedVector<int, 7>& mons_array)
// Mirror the map if appropriate, resolve substitutable symbols (?),static void resolve_map(map_def &map)
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx....................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx......................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxxxxxxxxx..........................x.xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxxxxxxx.............................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxxxxxxxxx.................................xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxxxxxxxxxxxxx..................................xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxxxxxxxxxxxxx....(................................xxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxxxxxxx......................................xxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxxxxx..........................................xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxxxxxxxx..........................................xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxxxxx............................................xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxxxxxx............................................xxxxxxxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxxxx.....................ccc..ccc............]......xxxxxxxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxxxxxx...................cccc2ccccc...................xxxxxxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxxxxx...................cc*cc..cc*cc....................xxxxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxxxxx..................cc***cc4c***cc..................xxxxxxxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxxxxx..................cc*|*cc..cc*|*cc..................xxxxxxxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxxxxx.................cc*|P|*c4cc*|P|*cc.................xxxxxxxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxxxxx.................cc**|*cc..cc*|**cc....................xxxxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxxxx..................ccc**c|cc4c|c**ccc...................xxxxxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxxxx..................cccccccc..cccccccc....................xxxxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxxx...................c.4.c.4.1..4.c.4.c.....................xxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxxx...................2.c.4.c..3.c.4.c.2.....................xxxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxxx..........)........cccccccc..cccccccc.....................xxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxx...................ccc**c|cc4c|c**ccc.....................xxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxx....................cc**|*cc..cc*|**cc....................xxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxx....................cc*|P|*c4cc*|P|*cc....................xxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxx.....................cc*|*cc..cc*|*cc....................xxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxx.....................cc***cc4c***cc.....................xxxxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxx.....................cc*cc..cc*cc......................xxxxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxxxxx.....................cccc2ccccc......................xxxxxxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxxxxxx.....................ccc..ccc.......................xxxxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxxxxx...........................................[.........xxxxxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxxxx......................................................xxxxxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxxxx..............................................xxxxx...xxxxxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxxxx...........................................xxxxxxxx.xxxxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxxxxxx..........................................xxxxxxxxx.xxxxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxxxxxxxxx........................................xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxxxxxxxx.........................................xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxxxxxxxxx.......................................xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxxxxxxx......................................xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxxxxxx......................................xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxxxx.....................................xxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxxxxx.............................}......xxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxxxxxx.................................xxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxxxx...........{........xxx..xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_ROYAL_JELLY;mons_array[1] = MONS_ACID_BLOB;mons_array[2] = MONS_GREAT_ORB_OF_EYES;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;
if (coinflip())map.vmirror();
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxccc....cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.....cccxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxcc......cc...cc...cc...cc...cc...cc...cc...cc...cc...cc.......ccxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxc..........c..............c..............c..............c......cxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxc.........ccc............ccc............ccc............ccc.....cxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxc........ccccc..........ccccc..........ccccc..........ccccc....cxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxc.........ccc............ccc............ccc...........ccccc....cxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxc..........c..............c..............c.............ccc.....cxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxc......................................................ccc.....cxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxc.......................................................c......cxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxc.......................................................c......cxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxc......................................................ccc.....cxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxc..........c..............c..............c.............ccc.....cxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxc.........ccc............ccc............ccc...........ccccc....cxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxc........ccccc..........ccccc..........ccccc..........ccccc....cxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxc.........ccc............ccc............ccc............ccc.....cxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxc..........c..............c..............c..............c......cxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxc..............................................................cxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxc.......cc...cc...cc...cc...cc...cc...cc...cc...cc...cc.......ccxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxcc.....cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.....cccxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxccc...ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxcccc.............................cccccccccccccccccccccccccccccccxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxcccccccccccccccccccccccccccccc.@.cccccccccccccccccccccccccccccccxxxxxxxx");mons_array[0] = MONS_DANCING_WEAPON;mons_array[1] = RANDOM_MONSTER;mons_array[2] = RANDOM_MONSTER;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_NORTH;
if (ndx < marray.size())marray[ndx++] = mid;}
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxcccc..............ccccxxxxxxxxxxxxxxxxxcccc............ccccxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxcc....................cccxxxxxxxxxxxxxccc..................ccxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxcc...........3...........ccxxxxxxxxxxxcc...........3.........ccxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxc..8......................cXXXXXXXXXXXc....................8..cxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxc...................8.....XXX...1...XXX....8..................cxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxcc........................XX..1...1..XX......................ccxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxcc.......................X1.........1X.....................ccxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxcc.....4....2..............1..Z..1............2....4.....ccxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxcc.......................X1.........1X.....................ccxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxcc........................XX..1...1..XX......................ccxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxc...................8.....XXX...1...XXX....8..................cxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxc...8.....................cXXXXXXXXXXXc...................8...cxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxcc..........8............ccccccccccccccc..........8..........ccxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxcc....................ccccccccccccccccccc..................ccxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxcc................ccccccccccccccccccccccccc..............ccxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxxccF111FcccccccccccccccccccccccccccccccccccccccccccF111Fccxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxxcc................^^1.ccccccccccccccccc.1^^..............ccxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxcc.................cc1...ccccccccccccc...1cc...............ccxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxcc.............8.....ccc...ccccccccccc...ccc...8.............ccxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxc....8................ccc...............ccc...........8...8...cxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxc.......8.....8...8...cxcc.............ccxc...................cxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxc.....................cxxc.............cxxc.......8...........cxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxc.....................cxxcc.1...1...1.ccxxc............8....8.cxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxc.......8....8.....8..cxxxc...........cxxxc....8..............cxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxc.....................cxxcc...........ccxxc..........8........cxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxcc...5...............ccxxc.............cxxcc..............8..ccxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxxcc........8........ccxxcc.............ccxxcc....8....5.....ccxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxcc...............ccxxxc...............cxxxcc.............ccxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxcccccccccccccccccxxxxcccccccc@ccccccccxxxxcccccccccccccccxxxxxxxxxxx");mons_array[0] = MONS_ORB_GUARDIAN;mons_array[1] = MONS_KILLER_KLOWN;mons_array[2] = MONS_ELECTRIC_GOLEM;mons_array[3] = MONS_ORB_OF_FIRE;mons_array[4] = MONS_ANCIENT_LICH;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;
const map_lines &ml = def.map;const int orient = def.orient;const int width = ml.width();const int height = ml.height();
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxcc............<............cxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxcc...........................cxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxxcc.............................cxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxxxxxcc...............................cxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxxxxcc.................................cxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxxcc...................................cxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxxxxcc.....................................cxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxxxxxxxcc.......................................cxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxxxxxxxxcc.........................................cxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxcc...........................................cxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxcc.............................................cxxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxxxcc...............................................cxxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxcc.................................................cxxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxcc...................................................cxxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxcc..........................B..........................cxxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxcc.......................................................cxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxcc.....................B.............B.....................cxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxcc...........................................................cxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxc.................B.........................B.................cxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxc..............................T..............................cxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxc..............B...............................B..............cxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxc(....................T.................T....................{cxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxc.............................................................cxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxc................B...........................B................cxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxcc...........................................................ccxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxcc............................T............................ccxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxxcc.......................................................ccxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxxxxcc.....................................................ccxxxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxxxxcc...................................................ccxxxxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxxxxcc.................................................ccxxxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxcc...............B................B..............ccxxxxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxcc.............................................ccxxxxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxcc.....................B.....................ccxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxcc.........................................ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxcc.......................................ccxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxcc.....................................ccxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxcc...................................ccxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxcc.................................ccxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxcc...............................ccxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxcc.............................ccxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxcc...........................ccxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxcc............[............ccxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
// Handle maps aligned along cardinals that are smaller than// the corresponding map dimension.if ((orient == MAP_NORTH || orient == MAP_SOUTH|| orient == MAP_ENCOMPASS)&& width < GXM)startx = (GXM - width) / 2;
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxx(.............................[..............................{xxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxx..........ccccccccccccccccccccccccccccccccccccccccccc.........xxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxx..........ccccccccccccccccccccccccccccccccccccccccccc.........xxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxx..........cc..........................^............cc.........xxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxx..........cc.........^....................^........cc.........xxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxx..........cc..ccccccccccccccccccccccccccccccccccc..cc.........xxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxx..........cc..c....^....^..c................c.^)c..cc.........xxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxx..........cc..c..ccccccccc.c..3.............c.^.c..cc.........xxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxx..........cc..c..c222c111c.c...............5c..^c..cc.........xxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxx..........cc..c..c2c222c.^.c......2.........+cccc..cc.........xxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxx..........cc..c..ccccccccccc..........3......5..c.^cc.........xxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxx..........cc..c.................................c..cc.........xxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxx..........cc..c..........................3......c..cc.........xxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxx..........cc^.cccccccccccccc.......2............c..cc.........xxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxx..........cc..c............c....................c..cc.........xxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxx..........cc..c............c.................3..c..cc.........xxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxx..........cc..c..cccccccc..c..........2.........c^5cc.........xxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxx..........cc..c..c.^.c11c..c....................c..cc.........xxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxx..........cc..c..c.c.c11c..c...3................c..cc.........xxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxx..........cc..c..c^c.11cc..c..............2.....c..cc.........xxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxx..........cc..c..c.cccccc..c.......2............c..cc.........xxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxx..........cc..c..c..^..^...c.................2..c..cc.........xxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxx..........cc5^c..ccccccccccc....................c..cc.........xxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxx..........cc..c.................................c..cc.........xxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxx..........cc..c.................................c..cc.........xxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxx..........cc..cccccccccccccc..^.^..cccccccccccccc..cc.........xxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxx..........cc..c...........ccc+++++ccc........^..c.^cc.........xxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxx..........cc..c.^.....^...cc.2...2.cc......^....c..cc.........xxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxx..........cc..c..ccccccc..cc.F...F.cc..ccccccc..c..cc.........xxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxx..........cc..c..cc.322c..cc.......cc..c22..cc..c..cc.........xxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxx..........cc..c..c].c22c..cc.......cc..c22c.}c^.c..cc.........xxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxx..........cc..c..cccc..c.^cc.G...G.cc..c3.cccc..c..cc.........xxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxx..........cc..c.....^..c..cc.......cc.^c........c..cc.........xxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxx..........cc..c........c..cc.......cc..c....^...c..cc.........xxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxx..........cc^.cccccccccc..cc.G...G.cc..cccccccccc.^cc.........xxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxx..........cc......^.......cc.......cc..........^...cc.........xxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxx..........cc...........^..cc.......cc.....^........cc.........xxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxx..........cccccccccccccccccc.G...G.cccccccccccccccccc.........xxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxx..........cccccccccccccccccc.......cccccccccccccccccc.........xxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxx.............................G...G............................xxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxx...........................4.......4..........................xxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxx...........................4..V.V..4..........................xxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxx...........................4.......4..........................xxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxx..............................................................xxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_MUMMY;mons_array[1] = MONS_GUARDIAN_MUMMY;mons_array[2] = MONS_MUMMY_PRIEST;mons_array[3] = MONS_SPHINX;mons_array[4] = MONS_GREATER_MUMMY;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;
place.x = startx;place.y = starty;place.width = width;place.height = height;
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxxxxcc{...c......c.....3....c........c.......ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxxxxxxxxcc....c.....^c^........^c......2^c.......ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxxxxxxxxxxcc....c...2.^+..2.....2^+^..2....+.......ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxxxxcc.3.^c^.....c^.........c^2.....^c^......ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxxxxxcc...^+^.....c..........c........c...2...ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxxxxxxxxccccc+ccccccccccccccccccccccccccccccc....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxxxxxxxcc..^.c.............................c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxxxxxxxxcc....c.............................c..3.ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxxxxxxxxxcc....c..ccc4.................4ccc..c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxxxxxxxxxxcc....c..ccc...................ccc..c..2.ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxxxxxxxxxxcc....c..ccc.........1.........ccc..c)..}ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxxxxxxxxxxcc.3..c..ccc.....2.......2.....ccc..cccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxxxxxxxxxxxcc....c.............................c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxxxxxxxxxxxcc....c.............................c^2..ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxxxxxxxxxxxcc....c........c...........c........+....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxxxxxxxxxxxcc]...c.............................c^2..ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxxxxxxxxxxxccccccc.....3........(........3.....c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxxxxxxxxxxxcc....c.............................c.^.^ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxxxxxxxxxxxcc...^c........c...........c........ccc+cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxxxxxxxxxxxcc....+.............................c..^.ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxxxxxxxxxcc...^c.............................c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxcc....c..ccc.....2.......2.....ccc..c..2.ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxxxxxxxxxxccccccc..ccc.........1.........ccc..c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxxxxxxxxxxcc....c..ccc...................ccc..c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxxxxxxxxxcc...^+..ccc4.................4ccc..c2...ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxxxxxxxxxcc....c.............................c....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxxxxxxxxxxxccccccc.............................c..2.ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxxxxxxxxxxxcc....c.............................ccc+cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxxxxxxxxxxcc....+cccc+ccccccccccccccc+ccccccccc.^.^ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxxxxxxxxxxcc.1.^^.c.^..c............c^.......c.3...ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxxxxxxxxxxcc...2..c.1..c.....1.1....c.....2..c.....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxxxxxxxxxcc......c....c..1......1.^c..2.....c...2.ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxxxxxxxxxxxcc..3...c.1..c...1...1..1^+........c.....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxxxxxxxxxxxxcc......c....c[...........c.......3c.....ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
apply_monsters(def, marray);apply_vault_grid(def, map, place);
mons_array[0] = MONS_MUMMY;mons_array[1] = MONS_GUARDIAN_MUMMY;mons_array[2] = MONS_MUMMY_PRIEST;mons_array[3] = MONS_GREATER_MUMMY;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_ENCOMPASS;
int orient = def.orient;if (orient == MAP_NONE)orient = MAP_NORTH;return (orient);
strcpy(vgrid[0], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[1], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[2], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[3], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[4], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[5], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[6], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[7], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[8], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[9], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[10], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[11], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[12], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[13], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[14], "xxxxxxxxxxxxxxxxxxxccccccc.............................cccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[15], "xxxxxxxxxxxxxxxxxxxcccc...............cccccc..............ccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[16], "xxxxxxxxxxxxxxxxxxxccc...............cccccccc..............cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[17], "xxxxxxxxxxxxxxxxxxxccc.......4......ccccO4cccc......4......cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[18], "xxxxxxxxxxxxxxxxxxxccc............cccc......cccc...........cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[19], "xxxxxxxxxxxxxxxxxxxcc............cccc........cccc...........ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[20], "xxxxxxxxxxxxxxxxxxxcc............cccc........cccc...........ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[21], "xxxxxxxxxxxxxxxxxxxcc...........cccc..444444..cccc..........ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[22], "xxxxxxxxxxxxxxxxxxxcc.......................................ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[23], "xxxxxxxxxxxxxxxxxxxcc.......................................ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[24], "xxxxxxxxxxxxxxxxxxxcc.................222222................ccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[25], "xxxxxxxxxxxxxxxxxxxccc................223322...............cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[26], "xxxxxxxxxxxxxxxxxxxccc...3............223322............3..cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[27], "xxxxxxxxxxxxxxxxxxxcccc...............222222..............ccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[28], "xxxxxxxxxxxxxxxxxxxcccc....2..........................2...ccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[29], "xxxxxxxxxxxxxxxxxxxcccccc....2......................2....cccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[30], "xxxxxxxxxxxxxxxxxxxcccccccc............................cccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[31], "xxxxxxxxxxxxxxxxxxxccccccccc+ccc..................ccc+ccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[32], "xxxxxxxxxxxxxxxxxxxcccccccc....cc................cc....cccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[33], "xxxxxxxxxxxxxxxxxxxcccccc.......cc22222222222222cc......$cccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[34], "xxxxxxxxxxxxxxxxxxxcccc....^.....cc............cc..^.....$ccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[35], "xxxxxxxxxxxxxxxxxxxcccc.^.........cc..........cc.....^.^.$ccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[36], "xxxxxxxxxxxxxxxxxxxccc$...^...^..^.cc........cc..........$$cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[37], "xxxxxxxxxxxxxxxxxxxccc$$$...........cc222222cc.^........$$$cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[38], "xxxxxxxxxxxxxxxxxxxccc|$$$...........c......c.....^...$$$$$cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[39], "xxxxxxxxxxxxxxxxxxxccc||$$$$...^.....c......c^......$$$$$$$cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[40], "xxxxxxxxxxxxxxxxxxxccc|||||$$.....^..c......c......$$$$$$$$cccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[41], "xxxxxxxxxxxxxxxxxxxcccc|||||$........c......c...^.$$$$$$$$ccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[42], "xxxxxxxxxxxxxxxxxxxccccc||||$$..^....c......c.....$$$$$$$cccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[43], "xxxxxxxxxxxxxxxxxxxcccccc||||$.......c......c.....$$$$$$ccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[44], "xxxxxxxxxxxxxxxxxxxccccccc|||$$....^.c......c.^.^$$$$$$cccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[45], "xxxxxxxxxxxxxxxxxxxcccccccc|||$^....cc..{...cc...$$$$$ccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[46], "xxxxxxxxxxxxxxxxxxxccccccccc||$.....cc...(..cc..$$$$$cccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[47], "xxxxxxxxxxxxxxxxxxxcccccccccc|$...cccc..[...cccc$$$$ccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[48], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[49], "xxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxx");strcpy(vgrid[50], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[51], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[52], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[53], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[54], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcpy(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
int mapindex = -1;int rollsize = 0;
mons_array[0] = MONS_MUMMY;mons_array[1] = MONS_GUARDIAN_MUMMY;mons_array[2] = MONS_MUMMY_PRIEST;mons_array[3] = MONS_GREATER_MUMMY;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;
for (unsigned i = 0, size = vdefs.size(); i < size; ++i){// We also accept tagged levels here.if (vdefs[i].place == place&& vdefs[i].is_minivault() == want_minivault){rollsize += vdefs[i].chance;
static char swamp(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // NB - most of the 'x's here will be set to water in dungeon.ccfor (unsigned char i = 0; i < 81; i++)strcpy(vgrid[i], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[36], "xxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[37], "xxxxxxxxxxx2xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[38], "xxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[39], "xxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[40], "xxxxxxxxxx2x.xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[41], "xxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[42], "xxxxxxxxxcc.ccxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[43], "xxxxxxxxcc...ccxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[44], "xxxxxxxcc3.2..ccxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[45], "xxxxxxcc.1.3.2.ccxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[46], "xxxxxccc....1.1cccxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[47], "xxxxxcc.1.32....ccxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[48], "xxxxxcc...3..1.3ccxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[49], "xxxxxcc2.1.3..2.ccxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[50], "xxxxxccc33..1..cccxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[51], "xxxxxxcccc3O3ccccxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[52], "xxxxxxxcccccccccxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[53], "xxxxxxxxcccccccxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[54], "xxxxxxxxxxcccxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[55], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[56], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[57], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[58], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[59], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[60], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[61], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[62], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[63], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[64], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[65], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[66], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[67], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[68], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");strcat(vgrid[69], "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");mons_array[0] = MONS_SWAMP_DRAGON;mons_array[1] = MONS_SWAMP_DRAKE;mons_array[2] = MONS_HYDRA;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;mons_array[6] = RANDOM_MONSTER;return MAP_SOUTHEAST;
return (mapindex);
strcpy(vgrid[0], "............");strcpy(vgrid[1], "..xxxx=xxx..");strcpy(vgrid[2], ".xx..x...xx.");strcpy(vgrid[3], ".x....x...x.");strcpy(vgrid[4], ".x...x....x.");strcpy(vgrid[5], ".xx.x*x.x.=.");strcpy(vgrid[6], ".=.x.x*x.xx.");strcpy(vgrid[7], ".x....x...x.");strcpy(vgrid[8], ".x...x....x.");strcpy(vgrid[9], ".xx...x..xx.");strcpy(vgrid[10], "..xxx=xxxx..");strcpy(vgrid[11], "............");
#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Looking for map named \"%s\"", name.c_str());#endiffor (unsigned i = 0, size = vdefs.size(); i < size; ++i)if (vdefs[i].name == name)return (i);
UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "..xxxx.xxxx.");strcpy(vgrid[2], "..xx.....xx.");strcpy(vgrid[3], "..x.......x.");strcpy(vgrid[4], "..x.......x.");strcpy(vgrid[5], "......C.....");strcpy(vgrid[6], "..x.......x.");strcpy(vgrid[7], "..x.......x.");strcpy(vgrid[8], "..xx.....xx.");strcpy(vgrid[9], "..xxxx.xxxx.");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}
int mapindex = -1;int rollsize = 0;
static char minivault_3(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );
for (unsigned i = 0, size = vdefs.size(); i < size; ++i)if (vdefs[i].depth.contains(depth)// Tagged levels cannot be selected by depth. This is// the only thing preventing Pandemonium demon vaults from// showing up in the main dungeon.&& vdefs[i].tags.empty()&& vdefs[i].is_minivault() == want_minivault){rollsize += vdefs[i].chance;
strcpy(vgrid[0], "............");strcpy(vgrid[1], ".cccccccccc.");strcpy(vgrid[2], ".cccccccccc.");strcpy(vgrid[3], ".cBcBcBcBcc.");strcpy(vgrid[4], ".G.c.c.c.Bc.");strcpy(vgrid[5], ".........Bc.");strcpy(vgrid[6], ".........Bc.");strcpy(vgrid[7], ".G.c.c.c.Bc.");strcpy(vgrid[8], ".cBcBcBcBcc.");strcpy(vgrid[9], ".cccccccccc.");strcpy(vgrid[10], ".cccccccccc.");strcpy(vgrid[11], "............");
if (rollsize && random2(rollsize) < vdefs[i].chance)mapindex = i;}
strcpy(vgrid[0], "............");strcpy(vgrid[1], "....xwxx....");strcpy(vgrid[2], "..xxxwwxwx..");strcpy(vgrid[3], "..xwwwwwwx..");strcpy(vgrid[4], ".xwwxwwxwxx.");strcpy(vgrid[5], ".xwwwwwwwwx.");strcpy(vgrid[6], ".xwwxwwwxww.");strcpy(vgrid[7], ".xxwwwwwwxx.");strcpy(vgrid[8], "..wwwwxwwx..");strcpy(vgrid[9], "..xxxwwxxw..");strcpy(vgrid[10], "....xxww....");strcpy(vgrid[11], "............");return MAP_NORTH;}
for (unsigned i = 0, size = vdefs.size(); i < size; ++i){if (vdefs[i].has_tag(tag)){rollsize += vdefs[i].chance;
strcpy(vgrid[0], "............");strcpy(vgrid[1], ".x.xxxxxxxx.");strcpy(vgrid[2], ".x.x......x.");strcpy(vgrid[3], ".x.x.xxxx.x.");strcpy(vgrid[4], ".x.x.x**x.x.");strcpy(vgrid[5], ".x.x.x**x.x.");strcpy(vgrid[6], ".x.x.xx.x.x.");strcpy(vgrid[7], ".x.x....x.x.");strcpy(vgrid[8], ".x.xxxxxx.x.");strcpy(vgrid[9], ".x........x.");strcpy(vgrid[10], ".xxxxxxxxxx.");strcpy(vgrid[11], "............");
#ifdef DEBUG_DIAGNOSTICSif (mapindex != -1)mprf(MSGCH_DIAGNOSTICS, "Found map %s tagged '%s'",vdefs[mapindex].name.c_str(), tag.c_str());elsemprf(MSGCH_DIAGNOSTICS, "No map for tag '%s'", tag.c_str());#endif
static char minivault_6(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // Wizard's laboratorystrcpy(vgrid[0], "............");strcpy(vgrid[1], ".ccccccc+cc.");strcpy(vgrid[2], ".c........c.");strcpy(vgrid[3], ".c........c.");strcpy(vgrid[4], ".c..1.....c.");strcpy(vgrid[5], ".c........c.");strcpy(vgrid[6], ".cc+ccccccc.");strcpy(vgrid[7], ".c***c3232c.");strcpy(vgrid[8], ".c|**+2223c.");strcpy(vgrid[9], ".c||*c3322c.");strcpy(vgrid[10], ".cccccccccc.");strcpy(vgrid[11], "............");mons_array[0] = MONS_WIZARD;mons_array[1] = MONS_ABOMINATION_SMALL;mons_array[2] = MONS_ABOMINATION_LARGE;return MAP_NORTH;}static char minivault_7(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // beehive minivaultstrcpy(vgrid[0], "............");strcpy(vgrid[1], "....aaaa....");strcpy(vgrid[2], "..a2a2aaaa..");strcpy(vgrid[3], "..aaRa3a2a..");strcpy(vgrid[4], ".aa2aRa2aaa.");strcpy(vgrid[5], ".a3aRa1aRa2.");strcpy(vgrid[6], ".aa3aRaRa2a.");strcpy(vgrid[7], ".aaa2a2a3aa.");strcpy(vgrid[8], "..a3aRa2aa..");strcpy(vgrid[9], "...aa2aa2a..");strcpy(vgrid[10], "....aaaa....");strcpy(vgrid[11], "............");mons_array[0] = MONS_QUEEN_BEE;mons_array[1] = MONS_KILLER_BEE;mons_array[2] = MONS_KILLER_BEE_LARVA;return MAP_NORTH;}static char minivault_8(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondstrcpy(vgrid[0], "x.x.x.x.x.x.");strcpy(vgrid[1], ".c.c.c.c.c.x");strcpy(vgrid[2], "x...l1l...c.");strcpy(vgrid[3], ".c.llllll..x");strcpy(vgrid[4], "x.lllllll1c.");strcpy(vgrid[5], ".c.llFGll..x");strcpy(vgrid[6], "x..llGFll.c.");strcpy(vgrid[7], ".c1lllllll.x");strcpy(vgrid[8], "x..llllll.c.");strcpy(vgrid[9], ".c...l1l...x");strcpy(vgrid[10], "x.c.c.c.c.c.");strcpy(vgrid[11], ".x.x.x.x.x.x");mons_array[0] = MONS_MOLTEN_GARGOYLE;return MAP_NORTH;}static char minivault_9(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // evil zooUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".==========.");strcpy(vgrid[2], ".==========.");strcpy(vgrid[3], ".==========.");strcpy(vgrid[4], ".===8888===.");strcpy(vgrid[5], ".===8998===.");strcpy(vgrid[6], ".===8998===.");strcpy(vgrid[7], ".===8888===.");strcpy(vgrid[8], ".==========.");strcpy(vgrid[9], ".==========.");strcpy(vgrid[10], ".==========.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_10(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxx..xxxx.");strcpy(vgrid[2], ".x**x..x**x.");strcpy(vgrid[3], ".x**+..+**x.");strcpy(vgrid[4], ".xx+x..x+xx.");strcpy(vgrid[5], "............");strcpy(vgrid[6], "............");strcpy(vgrid[7], ".xx+x..x+xx.");strcpy(vgrid[8], ".x**+..+**x.");strcpy(vgrid[9], ".x**x..x**x.");strcpy(vgrid[10], ".xxxx..xxxx.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_11(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // multicoloured onionUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".+xxxxxxxx+.");strcpy(vgrid[2], ".x........x.");strcpy(vgrid[3], ".x.+cccc+.x.");strcpy(vgrid[4], ".x.c....c.x.");strcpy(vgrid[5], ".x.c.bb.c.x.");strcpy(vgrid[6], ".x.c.bb.c.x.");strcpy(vgrid[7], ".x.c....c.x.");strcpy(vgrid[8], ".x.+cccc+.x.");strcpy(vgrid[9], ".x........x.");strcpy(vgrid[10], ".+xxxxxxxx+.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_12(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // closed box minivaultUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxxxxxxxx.");strcpy(vgrid[2], ".x>9$9$9$<x.");strcpy(vgrid[3], ".x.$9$9$.$x.");strcpy(vgrid[4], ".x$.****$.x.");strcpy(vgrid[5], ".x.$*||*.$x.");strcpy(vgrid[6], ".x$.*||*$.x.");strcpy(vgrid[7], ".x.$****.$x.");strcpy(vgrid[8], ".x$9$9$9$.x.");strcpy(vgrid[9], ".x<$9$9$9>x.");strcpy(vgrid[10], ".xxxxxxxxxx.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_13(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // little trap spiralUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxxxxxxxx.");strcpy(vgrid[2], ".=.^x..=.9x.");strcpy(vgrid[3], ".x.$=.^x..x.");strcpy(vgrid[4], ".xxxxxxxx=x.");strcpy(vgrid[5], ".x.8+|0x8.x.");strcpy(vgrid[6], ".x8$x.|x..x.");strcpy(vgrid[7], ".xx=xxxx=xx.");strcpy(vgrid[8], ".x.9=^.x..x.");strcpy(vgrid[9], ".x..x.^=9.x.");strcpy(vgrid[10], ".xxxxxxxxxx.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_14(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // water crossUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".wwwww.wwww.");strcpy(vgrid[2], ".wwwww.wwww.");strcpy(vgrid[3], ".wwwww.wwww.");strcpy(vgrid[4], ".wwwww.wwww.");strcpy(vgrid[5], ".......wwww.");strcpy(vgrid[6], ".wwww.......");strcpy(vgrid[7], ".wwww.wwwww.");strcpy(vgrid[8], ".wwww.wwwww.");strcpy(vgrid[9], ".wwww.wwwww.");strcpy(vgrid[10], ".wwww.wwwww.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_15(char vgrid[81][81], FixedVector<int, 7>& mons_array) /* lava pond */{UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "....lll.....");strcpy(vgrid[3], "...vvlvv....");strcpy(vgrid[4], "..lv|*|vl...");strcpy(vgrid[5], "..ll*S*ll...");strcpy(vgrid[6], "..lv|*|vl...");strcpy(vgrid[7], "...vvlvv....");strcpy(vgrid[8], "....lll.....");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return 1;}static char minivault_16(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], "............");strcpy(vgrid[6], "......S.....");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_17(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], ".....F......");strcpy(vgrid[6], "............");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_18(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], ".....H......");strcpy(vgrid[6], "............");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_19(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xx......xx.");strcpy(vgrid[2], ".xxx....xxx.");strcpy(vgrid[3], "..xxx..xxx..");strcpy(vgrid[4], "...xxxxxx...");strcpy(vgrid[5], "....xxxx....");strcpy(vgrid[6], "....xxxx....");strcpy(vgrid[7], "...xxxxxx...");strcpy(vgrid[8], "..xxx..xxx..");strcpy(vgrid[9], ".xxx....xxx.");strcpy(vgrid[10], ".xx......xx.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_20(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxx..xxxx.");strcpy(vgrid[2], ".x........x.");strcpy(vgrid[3], ".x..xxxx..x.");strcpy(vgrid[4], ".x.x....x.x.");strcpy(vgrid[5], "...x.x9.x...");strcpy(vgrid[6], "...x.9x.x...");strcpy(vgrid[7], ".x.x....x.x.");strcpy(vgrid[8], ".x..xxxx..x.");strcpy(vgrid[9], ".x........x.");strcpy(vgrid[10], ".xxxx..xxxx.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_21(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".^xxxxxxxx^.");strcpy(vgrid[2], ".x........x.");strcpy(vgrid[3], ".x.cccccc.x.");strcpy(vgrid[4], ".x.c|..<c.x.");strcpy(vgrid[5], ".x.c.**.c.x.");strcpy(vgrid[6], ".x.c.**.c.x.");strcpy(vgrid[7], ".x.c>..|c.x.");strcpy(vgrid[8], ".x.cccccc.x.");strcpy(vgrid[9], ".x........x.");strcpy(vgrid[10], ".^xxxxxxxx^.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_22(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".....xx.....");strcpy(vgrid[2], "...xxxxxx...");strcpy(vgrid[3], "..x^x..x^x..");strcpy(vgrid[4], "..xx.xx.xx..");strcpy(vgrid[5], ".xx.x$$x.xx.");strcpy(vgrid[6], ".xx.x$$x.xx.");strcpy(vgrid[7], "..xx.xx.xx..");strcpy(vgrid[8], "..x^x..x^x..");strcpy(vgrid[9], "...xxxxxx...");strcpy(vgrid[10], ".....xx.....");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_23(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "x.x.x.x.x.x.");strcpy(vgrid[1], ".x.x.x.x.x.x");strcpy(vgrid[2], "x.x.x.x.x.x.");strcpy(vgrid[3], ".x.x.x.x.x.x");strcpy(vgrid[4], "x.x.x.x.x.x.");strcpy(vgrid[5], ".x.x.x.x.x.x");strcpy(vgrid[6], "x.x.x.x.x.x.");strcpy(vgrid[7], ".x.x.x.x.x.x");strcpy(vgrid[8], "x.x.x.x.x.x.");strcpy(vgrid[9], ".x.x.x.x.x.x");strcpy(vgrid[10], "x.x.x.x.x.x.");strcpy(vgrid[11], ".x.x.x.x.x.x");return MAP_NORTH;}static char minivault_24(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "....xxxx....");strcpy(vgrid[2], "....xxxx....");strcpy(vgrid[3], "....xxxx....");strcpy(vgrid[4], ".xxxx.x.xxx.");strcpy(vgrid[5], ".xxx.x.xxxx.");strcpy(vgrid[6], ".xxxx.x.xxx.");strcpy(vgrid[7], ".xxx.x.xxxx.");strcpy(vgrid[8], "....xxxx....");strcpy(vgrid[9], "....xxxx....");strcpy(vgrid[10], "....xxxx....");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_25(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xx+xxxxxxx.");strcpy(vgrid[2], ".x........x.");strcpy(vgrid[3], ".x........+.");strcpy(vgrid[4], ".x........x.");strcpy(vgrid[5], ".x........x.");strcpy(vgrid[6], ".x........x.");strcpy(vgrid[7], ".x........x.");strcpy(vgrid[8], ".+........x.");strcpy(vgrid[9], ".x........x.");strcpy(vgrid[10], ".xxxxxxx+xx.");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_26(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "c..........c");strcpy(vgrid[1], ".c...cc...c.");strcpy(vgrid[2], "..c..cc..c..");strcpy(vgrid[3], "...c....c...");strcpy(vgrid[4], "....c..c....");strcpy(vgrid[5], ".cc..cc..cc.");strcpy(vgrid[6], ".cc..cc..cc.");strcpy(vgrid[7], "....c..c....");strcpy(vgrid[8], "...c....c...");strcpy(vgrid[9], "..c..cc..c..");strcpy(vgrid[10], ".c...cc...c.");strcpy(vgrid[11], "c..........c");return MAP_NORTH;}static char minivault_27(char vgrid[81][81], FixedVector<int, 7>& mons_array){UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".x.xxxxxxxx.");strcpy(vgrid[2], ".x........x.");strcpy(vgrid[3], ".xxxxxxxx.x.");strcpy(vgrid[4], ".x........x.");strcpy(vgrid[5], ".x.xxxxxxxx.");strcpy(vgrid[6], ".x........x.");strcpy(vgrid[7], ".xxxxxxxx.x.");strcpy(vgrid[8], ".x........x.");strcpy(vgrid[9], ".x.xxxxxxxx.");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_28(char vgrid[81][81], FixedVector<int, 7>& mons_array)
static void parse_maps(const std::string &s)
UNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxx.xxxx..");strcpy(vgrid[2], ".x.......x..");strcpy(vgrid[3], ".x..999..x..");strcpy(vgrid[4], ".x.9...9.x..");strcpy(vgrid[5], "...9.I.9....");strcpy(vgrid[6], ".x.9...9.x..");strcpy(vgrid[7], ".x..999..x..");strcpy(vgrid[8], ".x.......x..");strcpy(vgrid[9], ".xxxx.xxxx..");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_29(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], ".3......3...");strcpy(vgrid[1], "...x.xx.x.2.");strcpy(vgrid[2], ".xxx2xxxxx..");strcpy(vgrid[3], ".xxxx42xxx2.");strcpy(vgrid[4], ".2xx243432x3");strcpy(vgrid[5], ".xx421424xx.");strcpy(vgrid[6], "3xx423242x..");strcpy(vgrid[7], ".x2x3243xxx.");strcpy(vgrid[8], ".x2xx42422x.");strcpy(vgrid[9], "..xxxxxxxx2.");strcpy(vgrid[10], "...x2xxxx3..");strcpy(vgrid[11], ".3.......33.");mons_array[0] = MONS_QUEEN_ANT;mons_array[1] = MONS_SOLDIER_ANT;mons_array[2] = MONS_GIANT_ANT;mons_array[3] = MONS_ANT_LARVA;return MAP_NORTH;}static char minivault_30(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], ".....T......");strcpy(vgrid[6], "............");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_31(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], ".....T......");strcpy(vgrid[6], "............");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_32(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], ".....U......");strcpy(vgrid[6], "............");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_33(char vgrid[81][81], FixedVector<int, 7>& mons_array){ // lava pondUNUSED( mons_array );strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "............");strcpy(vgrid[3], "............");strcpy(vgrid[4], "............");strcpy(vgrid[5], ".....V......");strcpy(vgrid[6], "............");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], "............");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");return MAP_NORTH;}static char minivault_34(char vgrid[81][81], FixedVector<int, 7>& mons_array, bool orientation){//jmf: multi-god temple thingUNUSED( mons_array );int i, di;if ( orientation ){i = 0;di = +1;}else{i = 11;di = -1;}for (int c=0; c <= 11; c++, i += di)
FILE *dat = fopen(s.c_str(), "r");if (!dat)
strcpy(vgrid[i], "............");strcpy(vgrid[i], ".=xxxxxxxx=.");strcpy(vgrid[i], ".x9......9x.");strcpy(vgrid[i], ".xT......Tx.");strcpy(vgrid[i], ".x..C..C..x.");strcpy(vgrid[i], ".xT......Tx.");strcpy(vgrid[i], ".xxxxxxxxxx.");strcpy(vgrid[i], ".xxx$$$$xxx.");strcpy(vgrid[i], ".xx8....8xx.");strcpy(vgrid[i], "..xx....xx..");strcpy(vgrid[i], "...xG..Gx...");strcpy(vgrid[i], "............");
fprintf(stderr, "Failed to open %s for reading: %d\n", s.c_str(),errno);exit(1);
static char minivault_34_a(char vgrid[81][81], FixedVector<int, 7>& mons_array){return minivault_34(vgrid, mons_array, true);}static char minivault_34_b(char vgrid[81][81], FixedVector<int, 7>& mons_array){return minivault_34(vgrid, mons_array, false);}static char minivault_35(char vgrid[81][81], FixedVector<int, 7>& mons_array, bool orientation){UNUSED( mons_array );//jmf: another multi-god temple thingint i, di;if (orientation){i = 0;di = +1;}else{i = 11;di = -1;}
reset_map_parser();
for (int c=0; c <= 11; c++, i += di){strcpy(vgrid[i], "............");strcpy(vgrid[i], "..vvvvvvvv..");strcpy(vgrid[i], ".vv......vv.");strcpy(vgrid[i], ".v..x..x..v.");strcpy(vgrid[i], ".v.Cx..xC.v.");strcpy(vgrid[i], ".v..x..x..v.");strcpy(vgrid[i], ".vT8x..x8Tv.");strcpy(vgrid[i], ".vvvx==xvvv.");strcpy(vgrid[i], "...Gx99xG...");strcpy(vgrid[i], "...+*99*+...");strcpy(vgrid[i], "...GxxxxG...");strcpy(vgrid[i], "............");}
extern int yyparse(void);extern FILE *yyin;yyin = dat;
static char minivault_35_a(char vgrid[81][81], FixedVector<int, 7>& mons_array){return minivault_35(vgrid, mons_array, true);}static char minivault_35_b(char vgrid[81][81], FixedVector<int, 7>& mons_array){return minivault_35(vgrid, mons_array, false);}static char rand_demon_1(char vgrid[81][81], FixedVector<int, 7>& mons_array)
void read_maps()
strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xx.xx.x.xx.");strcpy(vgrid[2], "..x.x..x.x..");strcpy(vgrid[3], "..x.x..x.x..");strcpy(vgrid[4], "..x.x..x.x..");strcpy(vgrid[5], "..x.x..x.x..");strcpy(vgrid[6], "..x.x1.x.x..");strcpy(vgrid[7], "..x.x..x.x..");strcpy(vgrid[8], "..x.x..x.x..");strcpy(vgrid[9], "..x.x..x.x..");strcpy(vgrid[10], ".xx.x.xx.xx.");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = RANDOM_MONSTER;mons_array[2] = RANDOM_MONSTER;mons_array[3] = RANDOM_MONSTER;mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;return MAP_NORTH;
parse_maps( lc_desfile = datafile_path( "splev.des" ) );parse_maps( lc_desfile = datafile_path( "vaults.des" ) );
strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxxxxxx3x.");strcpy(vgrid[2], ".3.....xx.x.");strcpy(vgrid[3], ".xxxxxx4x.x.");strcpy(vgrid[4], ".xx4x..xx.x.");strcpy(vgrid[5], ".x.x.22.x.x.");strcpy(vgrid[6], ".x.x.12.x.x.");strcpy(vgrid[7], ".x.xx..x4xx.");strcpy(vgrid[8], ".x.x4xxxxxx.");strcpy(vgrid[9], ".x.xx.....3.");strcpy(vgrid[10], ".x3xxxxxxxx.");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(DEMON_GREATER);mons_array[2] = summon_any_demon(DEMON_COMMON);mons_array[3] = summon_any_demon(DEMON_COMMON);mons_array[4] = RANDOM_MONSTER;mons_array[5] = RANDOM_MONSTER;return MAP_NORTH;}static char rand_demon_3(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "............");strcpy(vgrid[1], ".x.x.x3x.x..");strcpy(vgrid[2], "..x.x3x3x.x.");strcpy(vgrid[3], ".x.x.x2x.x..");strcpy(vgrid[4], "..x3x2x2x3x.");strcpy(vgrid[5], ".x3x2x1x2x3.");strcpy(vgrid[6], "..x3x2x2x3x.");strcpy(vgrid[7], ".x.x.x2x3x..");strcpy(vgrid[8], "..x.x3x3x.x.");strcpy(vgrid[9], ".x.x.x3x.x..");strcpy(vgrid[10], "..x.x.x.x.x.");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(DEMON_COMMON);mons_array[2] = summon_any_demon(DEMON_COMMON);return MAP_NORTH;}static char rand_demon_4(char vgrid[81][81], FixedVector<int, 7>& mons_array){//jmf: all 3s below were 1s -- may have been bugstrcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxxxxxxx..");strcpy(vgrid[2], ".x$=*=3=|x..");strcpy(vgrid[3], ".xxxxxxx=x..");strcpy(vgrid[4], ".x2=3=2x|x..");strcpy(vgrid[5], ".x=xxxxx=x..");strcpy(vgrid[6], ".x3=*x1=Px..");strcpy(vgrid[7], ".x=x=xxxxx..");strcpy(vgrid[8], ".x*x2=3=2=..");strcpy(vgrid[9], ".xxxxxxxxx..");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(random2(3));mons_array[2] = summon_any_demon(random2(3));return MAP_NORTH;
map.fixup();vdefs.push_back( map );
strcpy(vgrid[0], "............");strcpy(vgrid[1], "...xxxxxx...");strcpy(vgrid[2], "..xx....xx..");strcpy(vgrid[3], ".xx......xx.");strcpy(vgrid[4], ".x..3232..x.");strcpy(vgrid[5], ".x..2|P3..x.");strcpy(vgrid[6], ".x..3P|2..x.");strcpy(vgrid[7], ".x..2123..x.");strcpy(vgrid[8], ".xx......xx.");strcpy(vgrid[9], "..xx....xx..");strcpy(vgrid[10], "...xxxxxx...");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(random2(3));mons_array[2] = summon_any_demon(random2(3));return MAP_NORTH;}static char rand_demon_6(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "............");strcpy(vgrid[1], "............");strcpy(vgrid[2], "......2.....");strcpy(vgrid[3], "............");strcpy(vgrid[4], ".3..........");strcpy(vgrid[5], "..........2.");strcpy(vgrid[6], ".....1......");strcpy(vgrid[7], "............");strcpy(vgrid[8], "............");strcpy(vgrid[9], ".2.......3..");strcpy(vgrid[10], "............");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(random2(3));mons_array[2] = summon_any_demon(random2(3));return MAP_NORTH;}static char rand_demon_7(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxx....xxx.");strcpy(vgrid[2], ".x|xx=xxx|x.");strcpy(vgrid[3], ".xx=....=xx.");strcpy(vgrid[4], "..x.x==x.x..");strcpy(vgrid[5], "..x.=12=.=..");strcpy(vgrid[6], "..=.=23=.x..");strcpy(vgrid[7], "..x.x==x.x..");strcpy(vgrid[8], ".xx=....=xx.");strcpy(vgrid[9], ".x|xxx=xx|x.");strcpy(vgrid[10], ".xxx....xxx.");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(random2(3));mons_array[2] = summon_any_demon(DEMON_GREATER);return MAP_NORTH;}static char rand_demon_8(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "............");strcpy(vgrid[1], "....xxxxxxx.");strcpy(vgrid[2], "..xxx....1x.");strcpy(vgrid[3], ".xx..2....x.");strcpy(vgrid[4], ".x........x.");strcpy(vgrid[5], ".xx.......x.");strcpy(vgrid[6], "..xx33..2.x.");strcpy(vgrid[7], "....33...xx.");strcpy(vgrid[8], ".....x...x..");strcpy(vgrid[9], "..F..xx.xx..");strcpy(vgrid[10], "......xxx...");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(DEMON_GREATER);mons_array[2] = summon_any_demon(random2(3));return MAP_NORTH;}static char rand_demon_9(char vgrid[81][81], FixedVector<int, 7>& mons_array){strcpy(vgrid[0], "............");strcpy(vgrid[1], ".xxxxxxxxxx.");strcpy(vgrid[2], ".x2=3=3=3xx.");strcpy(vgrid[3], ".x=xxxxxx2x.");strcpy(vgrid[4], ".x3x^^^^x=x.");strcpy(vgrid[5], ".x=x^P^^x2x.");strcpy(vgrid[6], ".x3x^^1^x=x.");strcpy(vgrid[7], ".x=x^^^^x3x.");strcpy(vgrid[8], ".x2xxxx=x=x.");strcpy(vgrid[9], ".xx2=2=3x3x.");strcpy(vgrid[10], ".xxxxxxxx=x.");strcpy(vgrid[11], "............");mons_array[0] = MONS_PANDEMONIUM_DEMON;mons_array[1] = summon_any_demon(random2(3));mons_array[2] = summon_any_demon(DEMON_GREATER);return MAP_NORTH;}
/** mapdef.h:* Header for map structures used by the level compiler.** NOTE: When we refer to map, this could be a full map, filling an entire* level or a minivault that occupies just a portion of the level.*/#ifndef __MAPDEF_H__#define __MAPDEF_H__#include <string>#include <vector>#include "enum.h"enum map_flags {MAPF_PANDEMONIUM_VAULT = 0x01, // A pandemonium minivault.MAPF_MIRROR_VERTICAL = 0x10, // The map may be mirrored verticallyMAPF_MIRROR_HORIZONTAL = 0x20, // may be mirrored horizontally.MAPF_ROTATE = 0x40 // may be rotated};class level_range {public:int shallowest, deepest;public:level_range(int s = -1, int d = -1);void set(int s, int d = -1);void reset();bool contains(int depth) const;bool valid() const;int span() const;};class map_lines {public:map_lines();// NULL-terminated list of map lines.map_lines(int nlines, ...);void add_line(const std::string &s);void set_orientation(const std::string &s);int width() const;int height() const;void resolve(const std::string &fillins);// Make all lines the same length.void normalise(char fillc = 'x');// Rotate 90 degrees either clockwise or anticlockwisevoid rotate(bool clockwise);void hmirror();void vmirror();void clear();const std::vector<std::string> &get_lines() const;private:void resolve(std::string &s, const std::string &fill);private:std::vector<std::string> lines;int map_width;};class mons_list {public:mons_list(int nids, ...);mons_list();void clear();const std::vector<int> &get_ids() const;// Returns false if the monster is unrecognised.bool add_mons(const std::string &s);private:int mons_by_name(std::string name) const;private:std::vector<int> mons_ids;};// Not providing a constructor to make life easy for C-style initialisation.class map_def {public:std::string name;std::string tags;std::string place;level_range depth;map_section_type orient;int chance;long flags;map_lines map;mons_list mons;std::string random_symbols;public:void init();void hmirror();void vmirror();void rotate(bool clockwise);void normalise();void resolve();void fixup();bool is_minivault() const;bool has_tag(const std::string &tag) const;};class monster_chance {public:int mclass;int level;int rarity;};class level_def {public:// The range of levels to which this def applies.level_range range;// Can be empty, in which case the default colours are applied.std::string floor_colour, rock_colour;std::string tags;// The probability of requesting a random vault.int p_vault;// The probability of requesting a random minivault.int p_minivault;// If non-empty, any upstair will go straight to this level.std::string upstair_targ, downstair_targ;std::vector<monster_chance> monsters;};class dungeon_def {public:std::string idstr;int id;std::string short_desc, full_desc;std::vector<level_def> level_specs;public:const level_def &specs(int subdepth);};std::string escape_string(std::string in, const std::string &toesc,const std::string &escapewith);#endif
#include <cstdarg>#include <cstdio>#include <cctype>#include "AppHdr.h"#include "libutil.h"#include "mapdef.h"#include "mon-util.h"#include "stuff.h"///////////////////////////////////////////////// level_range//level_range::level_range(int s, int d): shallowest(), deepest(){set(s, d);}void level_range::set(int s, int d){shallowest = s;deepest = d;if (deepest == -1)deepest = shallowest;}void level_range::reset(){deepest = shallowest = -1;}bool level_range::contains(int x) const{// [ds] The level ranges used by the game are zero-based, adjust for that.++x;return (x >= shallowest && x <= deepest);}bool level_range::valid() const{return (shallowest > 0 && deepest >= shallowest);}int level_range::span() const{return (deepest - shallowest);}///////////////////////////////////////////////// map_lines//map_lines::map_lines() : lines(), map_width(0){}map_lines::map_lines(int nlines, ...) : lines(), map_width(0){va_list args;va_start(args, nlines);for (int i = 0; i < nlines; ++i)add_line( va_arg(args, const char *) );va_end(args);}const std::vector<std::string> &map_lines::get_lines() const{return (lines);}void map_lines::add_line(const std::string &s){lines.push_back(s);if ((int) s.length() > map_width)map_width = s.length();}int map_lines::width() const{return map_width;}int map_lines::height() const{return lines.size();}void map_lines::clear(){lines.clear();map_width = 0;}void map_lines::resolve(std::string &s, const std::string &fill){std::string::size_type pos;while ((pos = s.find('?')) != std::string::npos)s[pos] = fill[ random2(fill.length()) ];}void map_lines::resolve(const std::string &fillins){if (fillins.empty() || fillins.find('?') != std::string::npos)return;for (int i = 0, size = lines.size(); i < size; ++i)resolve(lines[i], fillins);}void map_lines::normalise(char fillch){for (int i = 0, size = lines.size(); i < size; ++i){std::string &s = lines[i];if ((int) s.length() < map_width)s += std::string( map_width - s.length(), fillch );}}// Should never be attempted if the map has a defined orientation, or if one// of the dimensions is greater than the lesser of GXM,GYM.void map_lines::rotate(bool clockwise){std::vector<std::string> newlines;// normalise() first for convenience.normalise();const int xs = clockwise? 0 : map_width - 1,xe = clockwise? map_width : -1,xi = clockwise? 1 : -1;const int ys = clockwise? (int) lines.size() - 1 : 0,ye = clockwise? -1 : (int) lines.size(),yi = clockwise? -1 : 1;for (int i = xs; i != xe; i += xi){std::string line;for (int j = ys; j != ye; j += yi)line += lines[j][i];newlines.push_back(line);}map_width = lines.size();lines = newlines;}void map_lines::vmirror(){const int size = lines.size();const int midpoint = size / 2;for (int i = 0; i < midpoint; ++i){std::string temp = lines[i];lines[i] = lines[size - 1 - i];lines[size - 1 - i] = temp;}}void map_lines::hmirror(){const int midpoint = map_width / 2;for (int i = 0, size = lines.size(); i < size; ++i){std::string &s = lines[i];for (int j = 0; j < midpoint; ++j){int c = s[j];s[j] = s[map_width - 1 - j];s[map_width - 1 - j] = c;}}}///////////////////////////////////////////////// map_def//void map_def::init(){name.clear();tags.clear();place.clear();depth.reset();orient = MAP_NONE;// Base chance; this is not a percentage.chance = 10;// The map designer must explicitly disallow these if unwanted.flags = MAPF_MIRROR_VERTICAL | MAPF_MIRROR_HORIZONTAL| MAPF_ROTATE;random_symbols.clear();map.clear();mons.clear();}bool map_def::is_minivault() const{return (orient == MAP_NONE);}void map_def::hmirror(){if (!(flags & MAPF_MIRROR_HORIZONTAL))return;#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Mirroring %s horizontally.", name.c_str());#endifmap.hmirror();switch (orient){case MAP_EAST: orient = MAP_WEST; break;case MAP_NORTHEAST: orient = MAP_NORTHWEST; break;case MAP_SOUTHEAST: orient = MAP_SOUTHWEST; break;case MAP_WEST: orient = MAP_EAST; break;case MAP_NORTHWEST: orient = MAP_NORTHEAST; break;case MAP_SOUTHWEST: orient = MAP_SOUTHEAST; break;default: break;}}void map_def::vmirror(){if (!(flags & MAPF_MIRROR_VERTICAL))return;#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Mirroring %s vertically.", name.c_str());#endifmap.vmirror();switch (orient){case MAP_NORTH: orient = MAP_SOUTH; break;case MAP_NORTHEAST: orient = MAP_SOUTHEAST; break;case MAP_NORTHWEST: orient = MAP_SOUTHWEST; break;case MAP_SOUTH: orient = MAP_NORTH; break;case MAP_SOUTHEAST: orient = MAP_NORTHEAST; break;case MAP_SOUTHWEST: orient = MAP_NORTHWEST; break;default: break;}}void map_def::rotate(bool clock){if (!(flags & MAPF_ROTATE))return;#define GMINM ((GXM) < (GYM)? (GXM) : (GYM))// Make sure the largest dimension fits in the smaller map bound.if (map.width() <= GMINM && map.height() <= GMINM){#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Rotating %s %sclockwise.",name.c_str(),!clock? "anti-" : "");#endifmap.rotate(clock);// Orientation shifts for clockwise rotation:const map_section_type clockrotate_orients[][2] = {{ MAP_NORTH, MAP_EAST },{ MAP_NORTHEAST, MAP_SOUTHEAST },{ MAP_EAST, MAP_SOUTH },{ MAP_SOUTHEAST, MAP_SOUTHWEST },{ MAP_SOUTH, MAP_WEST },{ MAP_SOUTHWEST, MAP_NORTHWEST },{ MAP_WEST, MAP_NORTH },{ MAP_NORTHWEST, MAP_NORTHEAST },};const int nrots = sizeof(clockrotate_orients)/ sizeof(*clockrotate_orients);const int refindex = !clock;for (int i = 0; i < nrots; ++i)if (orient == clockrotate_orients[i][refindex]){orient = clockrotate_orients[i][!refindex];break;}}}void map_def::normalise(){// Minivaults are padded out with floor tiles, normal maps are// padded out with rock walls.map.normalise(is_minivault()? '.' : 'x');}void map_def::resolve(){map.resolve( random_symbols );}void map_def::fixup(){normalise();resolve();}bool map_def::has_tag(const std::string &tagwanted) const{return !tags.empty() && !tagwanted.empty()&& tags.find(" " + tagwanted + " ") != std::string::npos;}///////////////////////////////////////////////////////////////////// mons_list//mons_list::mons_list(int nids, ...) : mons_ids(){va_list args;va_start(args, nids);for (int i = 0; i < nids; ++i)mons_ids.push_back( va_arg(args, int) );va_end(args);}mons_list::mons_list() : mons_ids(){}const std::vector<int> &mons_list::get_ids() const{return (mons_ids);}void mons_list::clear(){mons_ids.clear();}bool mons_list::add_mons(const std::string &s){const int mid = mons_by_name(s);if (mid != MONS_PROGRAM_BUG)mons_ids.push_back(mid);return (mid != MONS_PROGRAM_BUG);}int mons_list::mons_by_name(std::string name) const{lowercase(name);name = replace_all( name, "_", " " );// Special casery:if (name == "pandemonium demon")return (MONS_PANDEMONIUM_DEMON);if (name == "random" || name == "random monster")return (RANDOM_MONSTER);if (name == "any demon" || name == "demon" || name == "random demon")return (-100 - DEMON_RANDOM);if (name == "any lesser demon"|| name == "lesser demon" || name == "random lesser demon")return (-100 - DEMON_LESSER);if (name == "any common demon"|| name == "common demon" || name == "random common demon")return (-100 - DEMON_COMMON);if (name == "any greater demon"|| name == "greater demon" || name == "random greater demon")return (-100 - DEMON_GREATER);if (name == "small zombie")return (MONS_ZOMBIE_SMALL);if (name == "large zombie")return (MONS_ZOMBIE_LARGE);if (name == "small skeleton")return (MONS_SKELETON_SMALL);if (name == "large skeleton")return (MONS_SKELETON_LARGE);if (name == "spectral thing")return (MONS_SPECTRAL_THING);if (name == "small simulacrum")return (MONS_SIMULACRUM_SMALL);if (name == "large simulacrum")return (MONS_SIMULACRUM_LARGE);if (name == "small abomination")return (MONS_ABOMINATION_SMALL);if (name == "large abomination")return (MONS_ABOMINATION_LARGE);return (get_monster_by_name(name, true));}
# -*- Makefile -*- for Dungeon Crawl (linux)## Modified for Crawl Reference by $Author$ on $Date$#GAME = crawl# this file contains a list of the libraries.# it will make a variable called OBJECTS that contains all the librariesinclude makefile.objOBJECTS += libunix.oCXX = g++DELETE = rm -fCOPY = cpOS_TYPE = UNIX# Include path for curses or ncurses.INCLUDES = -I/usr/include/ncursesMCHMOD = 2755INSTALLDIR := /usr/games# If you're installing Crawl for multiple users, you *must* set this to a# valid path before building Crawl.DATADIR :=LIB = -lncursesINCLUDES := $(INCLUDES) -Iutil -I.CFWARN := -Wall -Wwrite-strings \-Wshadow -pedanticCFOTHERS := -fsigned-char -g -D$(OS_TYPE) $(EXTRA_FLAGS)ifneq ($(DATADIR),)CFOTHERS += '-DDATA_DIR_PATH="$(DATADIR)"'endifCFLAGS := $(INCLUDES) $(CFWARN) $(CFOTHERS)YCFLAGS := $(INCLUDES) $(CFOTHERS)# If you have lex and yacc, set DOYACC to y (lowercase y).DOYACC := yUTIL = util/LEX := lexYACC := bison -yYTABC := levcomp.tab.cYTABH := levcomp.tab.hOBJECTS := $(UTIL)levcomp.tab.o $(UTIL)levcomp.lex.o $(UTIL)levcomp.o \$(OBJECTS)ifeq ($(LEX),)DOYACC :=endififeq ($(YACC),)DOYACC :=endifGAME_DEPENDS := $(OBJECTS)SRC_PKG_BASE := stone_soupSRC_VERSION := $(shell egrep 'VERSION ".*"' version.h | \egrep -o '[0-9]\.[0-9](\.[0-9])?')PKG_SRC_DIR := $(SRC_PKG_BASE)-$(SRC_VERSION)-srcSRC_PKG_TAR := $(PKG_SRC_DIR).tbz2SRC_PKG_ZIP := $(PKG_SRC_DIR).zipPKG_TIDY_LIST := $(UTIL)*.o $(LEVCOMP) *.o \$(UTIL)*.tab.cc $(UTIL)*.tab.h $(UTIL)*.lex.cc *.ixxPKG_EXCLUDES := $(PWD)/misc/src-pkg-excludes.lst##########################################################################all: $(GAME)########################################################################### The level compiler#ifeq ($(DOYACC),y)prebuildyacc: $(UTIL)levcomp.tab.cc $(UTIL)levcomp.tab.h $(UTIL)levcomp.lex.cccp $^ prebuilt/$(UTIL)levcomp.tab.cc: $(UTIL)levcomp.yppcd $(UTIL) && $(YACC) -d -b levcomp levcomp.ypp \&& mv $(YTABC) levcomp.tab.cc$(UTIL)levcomp.lex.cc: $(UTIL)levcomp.lppcd $(UTIL) && $(LEX) -olevcomp.lex.cc levcomp.lppelse# Pull the level-compiler stuff up from prebuilt/$(UTIL)levcomp.tab.cc: prebuilt/levcomp.tab.cccp prebuilt/*.h $(UTIL)cp $< $@$(UTIL)levcomp.lex.cc: prebuilt/levcomp.lex.cccp $< $@endif##################################################################################################################################################### The actual build targets#install: $(GAME)$(COPY) $(GAME) ${INSTALLDIR}chmod ${MCHMOD} ${INSTALLDIR}/$(GAME)ifeq ($(DATADIR),)$(error DATADIR not set! Set DATADIR and run make clean install again)endifmkdir -p $(DATADIR)/datacp dat/*.des $(DATADIR)/dataclean:$(DELETE) *.o$(DELETE) $(UTIL)*.o$(DELETE) $(LEVCOMP)$(DELETE) $(UTIL)*.tab.cc $(UTIL)*.tab.c $(UTIL)*.tab.h $(UTIL)*.lex.cc$(DELETE) *.ixxdistclean: clean$(DELETE) bones.*$(DELETE) morgue.txt$(DELETE) scores$(DELETE) $(GAME)$(DELETE) *.sav$(DELETE) core$(DELETE) *.0*$(DELETE) *.lab$(GAME): $(GAME_DEPENDS)${CXX} ${LDFLAGS} $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB)chmod ${MCHMOD} $(GAME)debug: $(GAME_DEPENDS)${CXX} ${LDFLAGS} $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB)profile: $(GAME_DEPENDS)${CXX} -g -p ${LDFLAGS} $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB).cc.o:${CXX} ${CFLAGS} -c $<# [ds] Note we don't use the standard CFLAGS here; that's intentional, most# flex/bison combos I've tried don't produce code that passes the warnings# test.$(UTIL)%.o: $(UTIL)%.cc$(CXX) $(YCFLAGS) -o $@ -c $<.h.cc:touch $@############################################################################## Packaging a source tarball for release## To package, you *must* have lex and yacc to generate the intermediates.ifeq ($(DOYACC),y)package-source: distclean prebuildyacc pkgtidy removeold vlink pkgtarbz2 pkgzippkgtidy:$(DELETE) $(PKG_TIDY_LIST)removeold:if [ -f ../../$(SRC_PKG_TAR) ]; then $(DELETE) ../../$(SRC_PKG_TAR); fiif [ -f ../../$(SRC_PKG_ZIP) ]; then $(DELETE) ../../$(SRC_PKG_ZIP); fi# [ds] Existing directory names could produce a bad package!vlink:cd .. && WHERE=$$PWD && cd .. && \( [ -e $(PKG_SRC_DIR) ] || ln -sf $$WHERE $(PKG_SRC_DIR) )pkgtarbz2:cd ../.. && tar -ch --bzip2 -f $(SRC_PKG_TAR) \-X $(PKG_EXCLUDES) $(PKG_SRC_DIR)pkgzip:cd ../.. && zip -rq $(SRC_PKG_ZIP) $(PKG_SRC_DIR) \-x@$(PKG_EXCLUDES)endif
GAME = crawl# this file contains a list of the libraries.# it will make a variable called OBJECTS that contains all the librariesinclude makefile.objOBJECTS += libunix.oCXX = g++DELETE = rm -fCOPY = cpOS_TYPE = OSX
CFLAGS = -Wall -Werror -D$(OS_TYPE) $(EXTRA_FLAGS)MCHMOD = 711INSTALLDIR = /tmp/CRAWLTEST/testdevLIB = -lncurses -lstdc++
PROJECT = Crawl.xcodeprojGAME = Crawl
install: $(GAME)$(COPY) $(GAME) ${INSTALLDIR}${MCHMOD} ${INSTALLDIR}/$(GAME)
# Xcode handles dependencies, so install does _not_ have to depend on building.install:xcodebuild -project $(PROJECT) -target $(GAME) -configuration Release install
distclean:$(DELETE) *.o$(DELETE) bones.*$(DELETE) morgue.txt$(DELETE) scores$(DELETE) $(GAME)$(DELETE) *.sav$(DELETE) core$(DELETE) *.0*$(DELETE) *.lab
distclean: cleanrm -f bones.*rm -f morgue.txtrm -f scoresrm -f $(GAME)rm -f *.savrm -f corerm -f *.0*rm -f *.lab
CFLAGS = -Wall -Wwrite-strings -Wstrict-prototypes \-Wmissing-prototypes -Wmissing-declarations \-D$(OS_TYPE) $(EXTRA_FLAGS)
INSTALLDIR := $(OPATH)LIB = -lwinmm -staticCFWARN := -Wall -Wwrite-strings \-Wshadow \-Werror \-pedanticINCLUDES := -Iutil -I.CFOTHERS := -fsigned-char \-fstrict-aliasing \-pedantic \-D$(OS_TYPE) $(EXTRA_FLAGS) \-DWINMM_PLAY_SOUNDSCFLAGS := $(INCLUDES) $(CFWARN) $(CFOTHERS)YCFLAGS := $(INCLUDES) $(CFOTHERS)OBJECTS := $(OBJECTS) libw32c.o
LIB = -lwinmm -static -lpcre -lluacore -lluastd
UTIL = util/# If you don't have flex or bison, set DOYACC to N or empty.DOYACC := nLEX := flexYACC := bison -yYTABC := levcomp.tab.cYTABH := levcomp.tab.hifeq ($(LEX),)DOYACC :=endififeq ($(YACC),)DOYACC :=endif
# Do the levcomp stuff first because that's the most likely to fail.OBJECTS := levcomp.tab.o levcomp.lex.o levcomp.o \$(OBJECTS)OBJECTS := $(foreach file,$(OBJECTS),$(OPATH)/$(file))GAME_DEPENDS := prepare $(OBJECTS)##########################################################################
prepare:if not exist $(OPATH) mkdir $(OPATH)########################################################################### The level compiler#ifeq ($(DOYACC),y)# [ds] A plague on the broken copy command on Windoze.prebuildyacc: $(UTIL)levcomp.lex.cc $(UTIL)levcomp.tab.cc $(UTIL)levcomp.tab.h$(subst /,\,for %%f in ($^) do $(COPY) %%f prebuilt)$(UTIL)levcomp.tab.cc: $(UTIL)levcomp.ypp$(subst /,\, cd $(UTIL)) && $(YACC) -d -b levcomp levcomp.ypp$(subst /,\, cd $(UTIL)) && move $(YTABC) levcomp.tab.cc$(UTIL)levcomp.lex.cc: $(UTIL)levcomp.lpp$(subst /,\, cd $(UTIL) && $(LEX) -olevcomp.lex.cc levcomp.lpp)else$(UTIL)levcomp.tab.cc: prebuilt/levcomp.tab.cc$(subst /,\,$(COPY) prebuilt/*.h $(UTIL))$(subst /,\,$(COPY) $< $@)$(UTIL)levcomp.lex.cc: prebuilt/levcomp.lex.cc$(subst /,\,$(COPY) $< $@)endif##########################################################################
$(DELETE) *.o
$(DELETE) $(OPATH)\*.o$(subst /,\,$(DELETE) $(UTIL)*.o)$(subst /,\,$(DELETE) $(UTIL)*.exe)$(subst /,\,$(DELETE) $(UTIL)*.lex.cc)$(subst /,\,$(DELETE) $(UTIL)*.tab.cc)$(subst /,\,$(DELETE) $(UTIL)*.tab.h)$(subst /,\,$(DELETE) $(UTIL)*.tab.c)$(subst /,\,$(DELETE) *.ixx)
CFLAGS = -D$(OS_TYPE) $(EXTRA_FLAGS)LDFLAGS = -Bc:/djgpp/contrib/pdcurs22/libINSTALLDIR = c:\games\crawl
LIB =# If you don't have flex or bison, set DOYACC to N or empty.DOYACC := nLEX := flexYACC := bison -yINCLUDES := -Iutil -I.CFWARN := -Wall -Wwrite-strings -Wshadow -Werror -pedanticCFOTHERS := -D$(OS_TYPE) $(EXTRA_FLAGS) -fsigned-char -fstrict-aliasingCFLAGS := $(INCLUDES) $(CFWARN) $(CFOTHERS)YCFLAGS := $(INCLUDES) $(CFOTHERS)OBJECTS += libdos.oLDFLAGS =
install: $(APPNAME)$(COPY) $(APPNAME) ${INSTALLDIR}
########################################################################### The level compiler## [dshaligram] A million plagues on djgpp make! It doesn't want to use a# generic rule for $(UTIL)%.cc; it always uses the .cc.o: rule instead.LINC :=# [ds] If we're using the prebuilt include, we can't copy it around because# djgpp copy mangles the name irreparably.ifneq ($(DOYACC),y)LINC += -I prebuiltendif$(UTIL)levcomp.o: $(UTIL)levcomp.cc$(subst /,\,$(CXX) $(LINC) $(YCFLAGS) -o $@ -c $<)$(UTIL)levlex.o: $(UTIL)levlex.cc$(subst /,\,$(CXX) $(LINC) $(YCFLAGS) -o $@ -c $<)$(UTIL)levtab.o: $(UTIL)levtab.cc$(subst /,\,$(CXX) $(LINC) $(YCFLAGS) -o $@ -c $<)ifeq ($(DOYACC),y)$(UTIL)levtab.cc: $(UTIL)levcomp.ypp$(subst /,\,cd $(UTIL))$(YACC) -d -b levcomp levcomp.yppcopy $(YTABC) levtab.cccd ..# djgpp flex must not have a space between -o and its parameter, or no business# will result.$(UTIL)levlex.cc: $(UTIL)levcomp.lpp$(subst /,\,cd $(UTIL))$(LEX) -olevlex.cc levcomp.lppcd ..else$(UTIL)levtab.cc: prebuilt/levcom~2.cc$(subst /,\,$(COPY) $< $@)$(UTIL)levlex.cc: prebuilt/levcom~1.cc$(subst /,\,$(COPY) $< $@)endif##########################################################################
$(MAKE) $(OTHER) -f $(MAKEFILE) debug EXTRA_FLAGS='-g -DFULLDEBUG -DWIZARD'
$(MAKE) $(OTHER) -f $(MAKEFILE) DEBUG_CRAWL=y debug EXTRA_FLAGS='-g -DFULLDEBUG -DWIZARD'# [dshaligram] The individual makefile need not necessarily support# package-source; only makefile.unix does at the moment.package-source:$(MAKE) -f $(MAKEFILE) package-sourceprebuildyacc:$(MAKE) -f $(MAKEFILE) prebuildyacc
----------------------------------------------------------------------------- trapwalk.lua: (requires base.lua)-- (Thanks to JPEG <erinacea@hotmail.de> for this script.)---- Allows travel to cross traps provided you have sufficient HP to survive the-- trap.---- To use this, add this line to your init.txt:-- lua_file = lua/trapwalk.lua-- and add-- trapwalk_safe_hp = dart:15, needle:25, spear:50-- or similar to your init.txt.---- What it does:---- * Normally autotravel automatically avoids all traps-- * This script allows you to customize at which hp what type of trap is-- regarded as safe for autotravel---- IMPORTANT: trapwalk options must be defined *after* sourcing trapwalk.lua.----------------------------------------------------------------------------- Travel will cross certain traps if you have more than safe_hp hp.function ch_cross_trap(trap)if not options.trapwalk_safe_hp thenreturn falseendlocal opt = options.trapwalk_safe_hplocal hpstr_, _, hpstr = string.find(opt, trap .. "%s*:%s*(%d+)")if not hpstr thenreturn falseendlocal safe_hp = tonumber(hpstr)local hp = you.hp()-- finally compare current hp with safe limitreturn hp >= safe_hpend
// Returns true if user pressed Enter, false if user hit Escape.bool cancelable_get_line( char *buf, int len, int wrapcol = 80,input_history *mh = NULL );
// Returns zero if user entered text and pressed Enter, otherwise returns the// key pressed that caused the exit, usually Escape.//// If keyproc is provided, it must return 1 for normal processing, 0 to exit// normally (pretend the user pressed Enter), or -1 to exit as if the user// pressed Escapeint cancelable_get_line( char *buf,int len,int wrapcol = get_number_of_cols(),input_history *mh = NULL,int (*keyproc)(int &c) = NULL );
class cursor_control{public:cursor_control(bool cs) : cstate(cs) {_setcursortype(cs? _NORMALCURSOR : _NOCURSOR);}~cursor_control() {_setcursortype(cstate? _NOCURSOR : _NORMALCURSOR);}private:bool cstate;};// Reads lines of text; used internally by cancelable_get_line.class line_reader{public:line_reader(char *buffer, size_t bufsz,int wrap_col = get_number_of_cols());typedef int (*keyproc)(int &key);int read_line(bool clear_previous = true);std::string get_text() const;void set_input_history(input_history *ih);void set_keyproc(keyproc fn);protected:void cursorto(int newcpos);int process_key(int ch);void backspace();void killword();bool is_wordchar(int c);private:char *buffer;size_t bufsz;input_history *history;int start_x, start_y;keyproc keyfn;int wrapcol;// These are subject to change during editing.char *cur;int length;int pos;};
}void uppercase(std::string &s){/* yes, this is bad, but std::transform() has its own problems */for (unsigned int i = 0; i < s.size(); ++i)s[i] = toupper(s[i]);}void lowercase(std::string &s){for (unsigned int i = 0; i < s.size(); ++i)s[i] = tolower(s[i]);}std::string replace_all(std::string s,const std::string &tofind,const std::string &replacement){std::string::size_type start = 0;std::string::size_type found;while ((found = s.find_first_of(tofind, start)) != std::string::npos){s.replace( found, tofind.length(), replacement );start = found + replacement.length();}return (s);}int count_occurrences(const std::string &text, const std::string &s){int nfound = 0;std::string::size_type pos = 0;while ((pos = text.find(s, pos)) != std::string::npos){++nfound;pos += s.length();}return (nfound);
#define WX(x) ( ((x) - 1) % maxcol + 1 )#define WY(x,y) ( (y) + ((x) - 1) / maxcol )#define WC(x,y) WX(x), WY(x,y)#define GOTOXY(x,y) gotoxy( WC(x,y) )bool cancelable_get_line( char *buf, int len, int maxcol,input_history *mh )
int cancelable_get_line( char *buf, int len, int maxcol,input_history *mh, int (*keyproc)(int &ch) )
if (mh)mh->go_end();for ( ; ; ) {int ch = c_getch();switch (ch) {case CK_ESCAPE:return false;case CK_UP:case CK_DOWN:{if (!mh)break;const std::string *text = ch == CK_UP? mh->prev() : mh->next();if (text){int olen = length;length = text->length();if (length >= len)length = len - 1;memcpy(buf, text->c_str(), length);buf[length] = 0;GOTOXY(start, line);int clear = length < olen? olen - length : 0;wrapcprintf(maxcol, "%s%*s", buf, clear, "");pos = length;cur = buf + pos;GOTOXY(start + pos, line);}break;}case CK_ENTER:buf[length] = 0;if (mh && length)mh->new_input(buf);return true;case CONTROL('K'):{// Kill to end of lineint erase = length - pos;if (erase){length = pos;buf[length] = 0;wrapcprintf( maxcol, "%*s", erase, "" );GOTOXY(start + pos, line);}break;}case CK_DELETE:if (pos < length) {char *c = cur;while (c - buf < length) {*c = c[1];c++;}--length;GOTOXY( start + pos, line );buf[length] = 0;wrapcprintf( maxcol, "%s ", cur );GOTOXY( start + pos, line );}break;case CK_BKSP:if (pos) {--cur;char *c = cur;while (*c) {*c = c[1];c++;}--pos;--length;GOTOXY( start + pos, line );buf[length] = 0;wrapcprintf( maxcol, "%s ", cur );GOTOXY( start + pos, line );}break;case CK_LEFT:if (pos) {--pos;cur = buf + pos;GOTOXY( start + pos, line );}break;case CK_RIGHT:if (pos < length) {++pos;cur = buf + pos;GOTOXY( start + pos, line );}break;case CK_HOME:case CONTROL('A'):pos = 0;cur = buf + pos;GOTOXY( start + pos, line );break;case CK_END:case CONTROL('E'):pos = length;cur = buf + pos;GOTOXY( start + pos, line );break;default:if (isprint(ch) && length < len - 1) {if (pos < length) {char *c = buf + length - 1;while (c >= cur) {c[1] = *c;c--;}}*cur++ = (char) ch;++length;++pos;putch(ch);if (pos < length) {buf[length] = 0;wrapcprintf( maxcol, "%s", cur );}GOTOXY(start + pos, line);}break;}}
return reader.read_line();
// OK, this is really annoying. Borland C++ seems to define// basic_string::erase to take iterators, and basic_string::remove// to take size_t or integer. This is ass-backwards compared to// nearly all other C++ compilers. Crap. (GDL)//// Borland 5.5 does this correctly now... leaving the old code// around for now in case anyone needs it. -- bwr// #ifdef __BCPLUSPLUS__// str.remove( 0, str.find_first_not_of( " \t\n\r" ) );// str.remove( str.find_last_not_of( " \t\n\r" ) + 1 );// #else
////////////////////////////////////////////////////////////////////// formatted_string//formatted_string::formatted_string(const std::string &s): ops(){ops.push_back( s );}formatted_string::operator std::string() const{std::string s;for (int i = 0, size = ops.size(); i < size; ++i){if (ops[i] == FSOP_TEXT)s += ops[i].text;}return s;}
std::string formatted_string::tostring(int s, int e) const{std::string st;int size = ops.size();cap(s, size);cap(e, size);for (int i = s; i <= e && i < size; ++i){if (ops[i] == FSOP_TEXT)st += ops[i].text;}return st;}void formatted_string::display(int s, int e) const{int size = ops.size();if (!size)return ;cap(s, size);cap(e, size);for (int i = s; i <= e && i < size; ++i)ops[i].display();}void formatted_string::gotoxy(int x, int y){ops.push_back( fs_op(x, y) );}void formatted_string::textcolor(int color){ops.push_back(color);}void formatted_string::cprintf(const char *s, ...){char buf[1000];va_list args;va_start(args, s);vsnprintf(buf, sizeof buf, s, args);va_end(args);cprintf(std::string(buf));}void formatted_string::cprintf(const std::string &s){ops.push_back(s);}void formatted_string::fs_op::display() const{switch (type){case FSOP_CURSOR:{int cx = (x == -1? wherex() : x);int cy = (y == -1? wherey() : y);::gotoxy(cx, cy);break;}case FSOP_COLOUR:::textcolor(x);break;case FSOP_TEXT:::cprintf("%s", text.c_str());break;}}
}/////////////////////////////////////////////////////////////////////////// line_readerline_reader::line_reader(char *buf, size_t sz, int wrap): buffer(buf), bufsz(sz), history(NULL), start_x(0),start_y(0), keyfn(NULL), wrapcol(wrap), cur(NULL),length(0), pos(-1){}std::string line_reader::get_text() const{return (buffer);}void line_reader::set_input_history(input_history *i){history = i;}void line_reader::set_keyproc(keyproc fn){keyfn = fn;}void line_reader::cursorto(int ncx){int x = (start_x + ncx - 1) % wrapcol + 1;int y = start_y + (start_x + ncx - 1) / wrapcol;::gotoxy(x, y);}int line_reader::read_line(bool clear_previous){if (bufsz <= 0) return false;cursor_control coff(true);if (clear_previous)*buffer = 0;start_x = wherex();start_y = wherey();length = strlen(buffer);// Remember the previous cursor position, if valid.if (pos < 0 || pos > length)pos = length;cur = buffer + pos;if (length)wrapcprintf(wrapcol, "%s", buffer);if (pos != length)cursorto(pos);if (history)history->go_end();for ( ; ; ){int ch = c_getch();if (keyfn){int whattodo = (*keyfn)(ch);if (whattodo == 0){buffer[length] = 0;if (history && length)history->new_input(buffer);return (0);}else if (whattodo == -1){buffer[length] = 0;return (ch);}}int ret = process_key(ch);if (ret != -1)return (ret);}}void line_reader::backspace(){if (pos){--cur;char *c = cur;while (*c){*c = c[1];c++;}--pos;--length;cursorto(pos);buffer[length] = 0;wrapcprintf( wrapcol, "%s ", cur );cursorto(pos);}}bool line_reader::is_wordchar(int c){return isalnum(c) || c == '_' || c == '-';}void line_reader::killword(){if (!pos || cur == buffer)return;bool foundwc = false;while (pos){if (is_wordchar(cur[-1]))foundwc = true;else if (foundwc)break;backspace();}}int line_reader::process_key(int ch){switch (ch){case CK_ESCAPE:return (ch);case CK_UP:case CK_DOWN:{if (!history)break;const std::string *text =ch == CK_UP? history->prev() : history->next();if (text){int olen = length;length = text->length();if (length >= (int) bufsz)length = bufsz - 1;memcpy(buffer, text->c_str(), length);buffer[length] = 0;cursorto(0);int clear = length < olen? olen - length : 0;wrapcprintf(wrapcol, "%s%*s", buffer, clear, "");pos = length;cur = buffer + pos;cursorto(pos);}break;}case CK_ENTER:buffer[length] = 0;if (history && length)history->new_input(buffer);return (0);case CONTROL('K'):{// Kill to end of lineint erase = length - pos;if (erase){length = pos;buffer[length] = 0;wrapcprintf( wrapcol, "%*s", erase, "" );cursorto(pos);}break;}case CK_DELETE:if (pos < length){char *c = cur;while (c - buffer < length){*c = c[1];c++;}--length;cursorto(pos);buffer[length] = 0;wrapcprintf( wrapcol, "%s ", cur );cursorto(pos);}break;case CK_BKSP:backspace();break;case CONTROL('W'):killword();break;case CK_LEFT:if (pos){--pos;cur = buffer + pos;cursorto(pos);}break;case CK_RIGHT:if (pos < length){++pos;cur = buffer + pos;cursorto(pos);}break;case CK_HOME:case CONTROL('A'):pos = 0;cur = buffer + pos;cursorto(pos);break;case CK_END:case CONTROL('E'):pos = length;cur = buffer + pos;cursorto(pos);break;default:if (isprint(ch) && length < (int) bufsz - 1){if (pos < length){char *c = buffer + length - 1;while (c >= cur){c[1] = *c;c--;}}*cur++ = (char) ch;++length;++pos;putch(ch);if (pos < length){buffer[length] = 0;wrapcprintf( wrapcol, "%s", cur );}cursorto(pos);}break;}return (-1);
// lower casekey_to_command_table[(int) 'a'] = CMD_USE_ABILITY;key_to_command_table[(int) 'b'] = CMD_MOVE_DOWN_LEFT;key_to_command_table[(int) 'c'] = CMD_CLOSE_DOOR;key_to_command_table[(int) 'd'] = CMD_DROP;key_to_command_table[(int) 'e'] = CMD_EAT;key_to_command_table[(int) 'f'] = CMD_FIRE;key_to_command_table[(int) 'g'] = CMD_PICKUP;key_to_command_table[(int) 'h'] = CMD_MOVE_LEFT;key_to_command_table[(int) 'i'] = CMD_DISPLAY_INVENTORY;key_to_command_table[(int) 'j'] = CMD_MOVE_DOWN;key_to_command_table[(int) 'k'] = CMD_MOVE_UP;key_to_command_table[(int) 'l'] = CMD_MOVE_RIGHT;key_to_command_table[(int) 'm'] = CMD_DISPLAY_SKILLS;key_to_command_table[(int) 'n'] = CMD_MOVE_DOWN_RIGHT;key_to_command_table[(int) 'o'] = CMD_OPEN_DOOR;key_to_command_table[(int) 'p'] = CMD_PRAY;key_to_command_table[(int) 'q'] = CMD_QUAFF;key_to_command_table[(int) 'r'] = CMD_READ;key_to_command_table[(int) 's'] = CMD_SEARCH;key_to_command_table[(int) 't'] = CMD_THROW;key_to_command_table[(int) 'u'] = CMD_MOVE_UP_RIGHT;key_to_command_table[(int) 'v'] = CMD_EXAMINE_OBJECT;key_to_command_table[(int) 'w'] = CMD_WIELD_WEAPON;key_to_command_table[(int) 'x'] = CMD_LOOK_AROUND;key_to_command_table[(int) 'y'] = CMD_MOVE_UP_LEFT;key_to_command_table[(int) 'z'] = CMD_ZAP_WAND;// upper casekey_to_command_table[(int) 'A'] = CMD_DISPLAY_MUTATIONS;key_to_command_table[(int) 'B'] = CMD_RUN_DOWN_LEFT;key_to_command_table[(int) 'C'] = CMD_EXPERIENCE_CHECK;key_to_command_table[(int) 'D'] = CMD_BUTCHER;key_to_command_table[(int) 'E'] = CMD_EVOKE;key_to_command_table[(int) 'F'] = CMD_NO_CMD;key_to_command_table[(int) 'G'] = CMD_NO_CMD;key_to_command_table[(int) 'H'] = CMD_RUN_LEFT;key_to_command_table[(int) 'I'] = CMD_OBSOLETE_INVOKE;key_to_command_table[(int) 'J'] = CMD_RUN_DOWN;key_to_command_table[(int) 'K'] = CMD_RUN_UP;key_to_command_table[(int) 'L'] = CMD_RUN_RIGHT;key_to_command_table[(int) 'M'] = CMD_MEMORISE_SPELL;key_to_command_table[(int) 'N'] = CMD_RUN_DOWN_RIGHT;key_to_command_table[(int) 'O'] = CMD_DISPLAY_OVERMAP;key_to_command_table[(int) 'P'] = CMD_WEAR_JEWELLERY;key_to_command_table[(int) 'Q'] = CMD_QUIT;key_to_command_table[(int) 'R'] = CMD_REMOVE_JEWELLERY;key_to_command_table[(int) 'S'] = CMD_SAVE_GAME;key_to_command_table[(int) 'T'] = CMD_REMOVE_ARMOUR;key_to_command_table[(int) 'U'] = CMD_RUN_UP_RIGHT;key_to_command_table[(int) 'V'] = CMD_GET_VERSION;key_to_command_table[(int) 'W'] = CMD_WEAR_ARMOUR;key_to_command_table[(int) 'X'] = CMD_DISPLAY_MAP;key_to_command_table[(int) 'Y'] = CMD_RUN_UP_LEFT;key_to_command_table[(int) 'Z'] = CMD_CAST_SPELL;// controlkey_to_command_table[ (int) CONTROL('A') ] = CMD_TOGGLE_AUTOPICKUP;key_to_command_table[ (int) CONTROL('B') ] = CMD_OPEN_DOOR_DOWN_LEFT;key_to_command_table[ (int) CONTROL('C') ] = CMD_CLEAR_MAP;#ifdef ALLOW_DESTROY_ITEM_COMMANDkey_to_command_table[ (int) CONTROL('D') ] = CMD_DESTROY_ITEM;#elsekey_to_command_table[ (int) CONTROL('D') ] = CMD_NO_CMD;#endifkey_to_command_table[ (int) CONTROL('E') ] = CMD_FORGET_STASH;key_to_command_table[ (int) CONTROL('F') ] = CMD_SEARCH_STASHES;key_to_command_table[ (int) CONTROL('G') ] = CMD_INTERLEVEL_TRAVEL;key_to_command_table[ (int) CONTROL('H') ] = CMD_OPEN_DOOR_LEFT;key_to_command_table[ (int) CONTROL('I') ] = CMD_NO_CMD;key_to_command_table[ (int) CONTROL('J') ] = CMD_OPEN_DOOR_DOWN;key_to_command_table[ (int) CONTROL('K') ] = CMD_OPEN_DOOR_UP;key_to_command_table[ (int) CONTROL('L') ] = CMD_OPEN_DOOR_RIGHT;key_to_command_table[ (int) CONTROL('M') ] = CMD_NO_CMD;key_to_command_table[ (int) CONTROL('N') ] = CMD_OPEN_DOOR_DOWN_RIGHT;key_to_command_table[ (int) CONTROL('O') ] = CMD_EXPLORE;key_to_command_table[ (int) CONTROL('P') ] = CMD_REPLAY_MESSAGES;key_to_command_table[ (int) CONTROL('Q') ] = CMD_NO_CMD;key_to_command_table[ (int) CONTROL('R') ] = CMD_REDRAW_SCREEN;key_to_command_table[ (int) CONTROL('S') ] = CMD_MARK_STASH;key_to_command_table[ (int) CONTROL('T') ] = CMD_NO_CMD;key_to_command_table[ (int) CONTROL('U') ] = CMD_OPEN_DOOR_UP_LEFT;key_to_command_table[ (int) CONTROL('V') ] = CMD_NO_CMD;key_to_command_table[ (int) CONTROL('W') ] = CMD_FIX_WAYPOINT;key_to_command_table[ (int) CONTROL('X') ] = CMD_SAVE_GAME_NOW;key_to_command_table[ (int) CONTROL('Y') ] = CMD_OPEN_DOOR_UP_RIGHT;key_to_command_table[ (int) CONTROL('Z') ] = CMD_SUSPEND_GAME;// other printableskey_to_command_table[(int) '.'] = CMD_MOVE_NOWHERE;key_to_command_table[(int) '<'] = CMD_GO_UPSTAIRS;key_to_command_table[(int) '>'] = CMD_GO_DOWNSTAIRS;key_to_command_table[(int) '@'] = CMD_DISPLAY_CHARACTER_STATUS;key_to_command_table[(int) ','] = CMD_PICKUP;key_to_command_table[(int) ':'] = CMD_NO_CMD;key_to_command_table[(int) ';'] = CMD_INSPECT_FLOOR;key_to_command_table[(int) '!'] = CMD_SHOUT;key_to_command_table[(int) '^'] = CMD_DISPLAY_RELIGION;key_to_command_table[(int) '#'] = CMD_CHARACTER_DUMP;key_to_command_table[(int) '='] = CMD_ADJUST_INVENTORY;key_to_command_table[(int) '?'] = CMD_DISPLAY_COMMANDS;key_to_command_table[(int) '`'] = CMD_MACRO_ADD;key_to_command_table[(int) '~'] = CMD_MACRO_SAVE;key_to_command_table[(int) '&'] = CMD_WIZARD;key_to_command_table[(int) '"'] = CMD_LIST_JEWELLERY;// I'm making this both, because I'm tried of changing it// back to '[' (the character that represents armour on the map) -- bwrkey_to_command_table[(int) '['] = CMD_LIST_ARMOUR;key_to_command_table[(int) ']'] = CMD_LIST_ARMOUR;// This one also ended up backwards this time, so it's also going on// both now -- should be ')'... the same character that's used to// represent weapons.key_to_command_table[(int) ')'] = CMD_LIST_WEAPONS;key_to_command_table[(int) '('] = CMD_LIST_WEAPONS;key_to_command_table[(int) '\\'] = CMD_DISPLAY_KNOWN_OBJECTS;key_to_command_table[(int) '\''] = CMD_WEAPON_SWAP;// digitskey_to_command_table[(int) '0'] = CMD_NO_CMD;key_to_command_table[(int) '1'] = CMD_MOVE_DOWN_LEFT;key_to_command_table[(int) '2'] = CMD_MOVE_DOWN;key_to_command_table[(int) '3'] = CMD_MOVE_DOWN_RIGHT;key_to_command_table[(int) '4'] = CMD_MOVE_LEFT;key_to_command_table[(int) '5'] = CMD_REST;key_to_command_table[(int) '6'] = CMD_MOVE_RIGHT;key_to_command_table[(int) '7'] = CMD_MOVE_UP_LEFT;key_to_command_table[(int) '8'] = CMD_MOVE_UP;key_to_command_table[(int) '9'] = CMD_MOVE_UP_RIGHT;// keypadkey_to_command_table[KEY_A1] = CMD_MOVE_UP_LEFT;key_to_command_table[KEY_A3] = CMD_MOVE_UP_RIGHT;key_to_command_table[KEY_C1] = CMD_MOVE_DOWN_LEFT;key_to_command_table[KEY_C3] = CMD_MOVE_DOWN_RIGHT;key_to_command_table[KEY_HOME] = CMD_MOVE_UP_LEFT;key_to_command_table[KEY_PPAGE] = CMD_MOVE_UP_RIGHT;key_to_command_table[KEY_END] = CMD_MOVE_DOWN_LEFT;key_to_command_table[KEY_NPAGE] = CMD_MOVE_DOWN_RIGHT;key_to_command_table[KEY_B2] = CMD_REST;key_to_command_table[KEY_UP] = CMD_MOVE_UP;key_to_command_table[KEY_DOWN] = CMD_MOVE_DOWN;key_to_command_table[KEY_LEFT] = CMD_MOVE_LEFT;key_to_command_table[KEY_RIGHT] = CMD_MOVE_RIGHT;// other odd things// key_to_command_table[ 263 ] = CMD_OPEN_DOOR_LEFT; // backspace// these are invalid keys, but to help kludge running// pass them through unmolestedkey_to_command_table[128] = 128;key_to_command_table[(int) '*'] = '*';}int key_to_command(int keyin){bool is_userfunction(int key);if (is_userfunction(keyin))return keyin;return (key_to_command_table[keyin]);}
#ifndef __LIBDOS_H__#define __LIBDOS_H__void init_libdos();#endif
/** File: libdos.cc* Summary: Functions for DOS support.* Written by: Darshan Shaligram** Added for Crawl Reference by $Author: nlanza $ on $Date: 2006-09-26T03:22:57.300929Z $*/// Every .cc must include AppHdr or bad things happen.#include "AppHdr.h"#include <termios.h>void init_libdos(){struct termios charmode;tcgetattr (0, &charmode);// Ignore Ctrl-Ccharmode.c_lflag &= ~ISIG;tcsetattr (0, TCSANOW, &charmode);}
mitm[item].base_type = OBJ_UNASSIGNED;mitm[item].sub_type = 0;mitm[item].plus = 0;mitm[item].plus2 = 0;mitm[item].special = 0;mitm[item].quantity = 0;mitm[item].colour = 0;mitm[item].flags = 0;mitm[item].x = 0;mitm[item].y = 0;mitm[item].link = NON_ITEM;
mitm[item].clear();
/* Fill items with the items on a square.Squelched items (marked with =k) are ignored, unlessthe square contains *only* squelched items, in which case theyare included. If force_squelch is true, squelched items arenever displayed.*/static void item_list_on_square( std::vector<const item_def*>& items,int obj, bool force_squelch ) {const bool have_nonsquelched = (force_squelch ||has_nonsquelched_items(obj));/* loop through the items */while ( obj != NON_ITEM ) {/* add them to the items list if they qualify */if ( !have_nonsquelched || !invisible_to_player(mitm[obj]) )items.push_back( &mitm[obj] );obj = mitm[obj].link;}}/** Takes keyin as an argument because it will only display a long list of items* if ; is pressed.*/void item_check(char keyin){char item_show[50][50];char temp_quant[10];int counter = 0;int counter_max = 0;describe_floor();
std::string place = branch_level_name(item.orig_place);if (place.length() && place != "Pandemonium")place[0] = tolower(place[0]);return (place.find("level") == 0?"on " + place: "in " + place);
return prep_branch_level_name(item.orig_place);
strcpy(info, "Pick up ");if (mitm[o].base_type == OBJ_GOLD){char st_prn[20];itoa(mitm[o].quantity, st_prn, 10);strcat(info, st_prn);strcat(info, " gold piece");if (mitm[o].quantity > 1)strcat(info, "s");}else{it_name(o, DESC_NOCAP_A, str_pass);strcat(info, str_pass);}strcat(info, "\? (y,n,a,*,q)");
char buf[ITEMNAME_SIZE];item_name( mitm[o], DESC_NOCAP_A, buf );snprintf( info, INFO_SIZE, "Pick up %s? (y/n/a/*?g,/q)", buf );
if (!copy_item_to_grid( you.inv[item_dropped],you.x_pos, you.y_pos, quant_drop, true )){
const unsigned char my_grid = grd[you.x_pos][you.y_pos];if ( !grid_destroys_items(my_grid) &&!copy_item_to_grid( you.inv[item_dropped],you.x_pos, you.y_pos, quant_drop, true )) {
static std::string drop_menu_title( int menuflags, const std::string &oldt ) {std::string res = oldt;res.erase(0, res.find_first_not_of(" \n\t"));if (menuflags & MF_MULTISELECT)
std::string s_newweight;std::vector<MenuEntry*> se = menu->selected_entries();if (!se.empty()){int newweight = you.burden;for (int i = 0, size = se.size(); i < size; ++i){const item_def *item = static_cast<item_def *>( se[i]->data );newweight -= item_mass(*item) * se[i]->selected_qty;}snprintf(buf, sizeof buf, ">%d.%d", newweight / 10, newweight % 10);s_newweight = buf;}snprintf(buf, sizeof buf, "(Inv: %d.%d%s/%d.%d aum)",you.burden / 10, you.burden % 10,s_newweight.c_str(),cap / 10, cap % 10);return (buf);}static std::string drop_menu_title(const Menu *menu, const std::string &oldt){std::string res = drop_menu_invstatus(menu) + " " + oldt;if (menu->is_set( MF_MULTISELECT ))
snprintf( buf, sizeof buf, " (%lu%s turn%s)", (unsigned long) (s->size()),extraturns? "+" : "",s->size() > 1? "s" : "" );
snprintf( buf, sizeof buf, " (%lu%s turn%s)",(unsigned long) (s->size()),extraturns? "+" : "",s->size() > 1? "s" : "" );
if (!you.activity || selected.empty())selected = prompt_invent_items( "Drop which item?", -1,drop_menu_title,true, true, '$',&Options.drop_filter,drop_selitem_text );
items_for_multidrop = prompt_invent_items( "Drop what?",MT_DROP,-1,drop_menu_title,true, true, '$',&Options.drop_filter,drop_selitem_text,&items_for_multidrop );
}// Throw away invalid items; items usually go invalid because// of chunks rotting away.while (!selected.empty()// Don't look for gold in inventory&& selected[0].slot != PROMPT_GOT_SPECIAL&& !is_valid_item(you.inv[ selected[0].slot ]))selected.erase( selected.begin() );// Did the defunct item filter above deprive us of a drop target?if (!selected.empty()){drop_item( selected[0].slot, selected[0].quantity );// Forget the item we just droppedselected.erase( selected.begin() );}// If we still have items that want to be dropped, start the multiturn// activityyou.activity = selected.empty()? ACT_NONE : ACT_MULTIDROP;} // end drop()//---------------------------------------------------------------//// shift_monster//// Moves a monster to approximately (x,y) and returns true// if monster was moved.////---------------------------------------------------------------static bool shift_monster( struct monsters *mon, int x, int y ){bool found_move = false;int i, j;int tx, ty;int nx = 0, ny = 0;int count = 0;if (x == 0 && y == 0){// try and find a random floor space some distance awayfor (i = 0; i < 50; i++){tx = 5 + random2( GXM - 10 );ty = 5 + random2( GYM - 10 );int dist = grid_distance(x, y, tx, ty);if (grd[tx][ty] == DNGN_FLOOR && dist > 10)break;}if (i == 50)return (false);
for (j = -1; j <= 1; j++){tx = x + i;ty = y + j;if (tx < 5 || tx > GXM - 5 || ty < 5 || ty > GXM - 5)continue;// won't drop on anything but vanilla floor right nowif (grd[tx][ty] != DNGN_FLOOR)continue;if (mgrd[tx][ty] != NON_MONSTER)continue;if (tx == you.x_pos && ty == you.y_pos)continue;count++;if (one_chance_in(count)){nx = tx;ny = ty;found_move = true;}}}if (found_move){const int mon_index = mgrd[mon->x][mon->y];mgrd[mon->x][mon->y] = NON_MONSTER;mgrd[nx][ny] = mon_index;mon->x = nx;mon->y = ny;
drop_item( items_for_multidrop[0].slot,items_for_multidrop[0].quantity );items_for_multidrop.clear();you.turn_is_over = true;
// player about .1 points per turn, mutagenic randarts will give// about 1.5 points on average, so they can corrupt the player// quite quickly. Wielding one for a short battle is OK, which is
// player about .1 points per turn, mutagenic randarts will give// about 1.5 points on average, so they can corrupt the player// quite quickly. Wielding one for a short battle is OK, which is
// [ds] Be less harsh with glow mutation; Brent and Mark Mackey note// that the commented out random2(X) <= MC check was a bug. I've// uncommented it but dropped the roll sharply from 150. (Brent used// the original roll of 150 for 4.1.2, but I think players are// sufficiently used to beta 26's unkindness that we can use a lower// roll.)
/** File: itemname.cc* Summary: Misc functions.* Written by: Brent Ross** Change History (most recent first):** <1> -/--/-- BWR Created*/#ifndef ITEMPROP_H#define ITEMPROP_H#include "externs.h"void init_properties(void);// cursed:bool item_cursed( const item_def &item );bool item_known_cursed( const item_def &item );bool item_known_uncursed( const item_def &item );void do_curse_item( item_def &item );void do_uncurse_item( item_def &item );// ident:bool item_ident( const item_def &item, unsigned long flags );void set_ident_flags( item_def &item, unsigned long flags );void unset_ident_flags( item_def &item, unsigned long flags );// racial item and item descriptions:void set_equip_race( item_def &item, unsigned long flags );void set_equip_desc( item_def &item, unsigned long flags );unsigned long get_equip_race( const item_def &item );unsigned long get_equip_desc( const item_def &item );// helmet functions:void set_helmet_type( item_def &item, short flags );void set_helmet_desc( item_def &item, short flags );void set_helmet_random_desc( item_def &item );short get_helmet_type( const item_def &item );short get_helmet_desc( const item_def &item );bool is_helmet_type( const item_def &item, short val );// ego items:bool set_item_ego_type( item_def &item, int item_type, int ego_type );int get_weapon_brand( const item_def &item );int get_armour_ego_type( const item_def &item );int get_ammo_brand( const item_def &item );// armour functions:int armour_max_enchant( const item_def &item );bool armour_is_hide( const item_def &item, bool inc_made = false );bool armour_not_shiny( const item_def &item );int armour_str_required( const item_def &arm );equipment_type get_armour_slot( const item_def &item );bool jewellery_is_amulet( const item_def &item );bool check_jewellery_size( const item_def &item, size_type size );bool hide2armour( item_def &item );bool base_armour_is_light( const item_def &item );int fit_armour_size( const item_def &item, size_type size );bool check_armour_size( const item_def &item, size_type size );bool check_armour_shape( const item_def &item, bool quiet );// weapon functions:int weapon_rarity( int w_type );int cmp_weapon_size( const item_def &item, size_type size );bool check_weapon_tool_size( const item_def &item, size_type size );int fit_weapon_wieldable_size( const item_def &item, size_type size );bool check_weapon_wieldable_size( const item_def &item, size_type size );int fit_item_throwable_size( const item_def &item, size_type size );bool check_weapon_shape( const item_def &item, bool quiet, bool check_id = false );int weapon_ev_bonus( const item_def &wpn, int skill, size_type body, int dex,bool hide_hidden = false );int get_inv_wielded( void );int get_inv_hand_tool( void );int get_inv_in_hand( void );hands_reqd_type hands_reqd( const item_def &item, size_type size );hands_reqd_type hands_reqd(int base_type, int sub_type, size_type size);bool is_double_ended( const item_def &item );int double_wpn_awkward_speed( const item_def &item );bool is_demonic( const item_def &item );int get_vorpal_type( const item_def &item );int get_damage_type( const item_def &item );bool does_damage_type( const item_def &item, int dam_type );int weapon_str_weight( const item_def &wpn );int weapon_dex_weight( const item_def &wpn );int weapon_impact_mass( const item_def &wpn );int weapon_str_required( const item_def &wpn, bool half );skill_type weapon_skill( const item_def &item );skill_type weapon_skill( int wclass, int wtype );skill_type range_skill( const item_def &item );skill_type range_skill( int wclass, int wtype );// launcher and ammo functions:bool is_range_weapon( const item_def &item );bool is_range_weapon_type( weapon_type wtype );missile_type fires_ammo_type( const item_def &item );missile_type fires_ammo_type( weapon_type wtype );const char * ammo_name( const item_def &bow );bool is_throwable( const item_def &wpn );launch_retval is_launched( int being_id, const item_def &ammo, bool msg = false );// staff/rod functions:bool item_is_rod( const item_def &item );bool item_is_staff( const item_def &item );// ring functions:int ring_has_pluses( const item_def &item );// food functions:bool food_is_meat( const item_def &item );bool food_is_veg( const item_def &item );int food_value( const item_def &item );int food_turns( const item_def &item );bool can_cut_meat( const item_def &item );// generic item property functions:bool is_tool( const item_def &item );int property( const item_def &item, int prop_type );int item_mass( const item_def &item );size_type item_size( const item_def &item );bool is_colourful_item( const item_def &item );bool is_shield(const item_def &item);bool is_shield_incompatible(const item_def &weapon,const item_def *shield = NULL);#endif
/** File: itemprop.cc* Summary: Misc functions.* Written by: Brent Ross** Modified for Crawl Reference by $Author$ on $Date$** Change History (most recent first):** <1> -/--/-- BWR Created*/#include "AppHdr.h"#include "itemname.h"#include <ctype.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#ifdef DOS#include <conio.h>#endif#include "externs.h"#include "items.h"#include "itemprop.h"#include "macro.h"#include "mon-util.h"#include "notes.h"#include "player.h"#include "randart.h"#include "skills2.h"#include "stuff.h"#include "transfor.h"#include "view.h"// XXX: name strings in most of the following are currently unused!struct armour_def{armour_type id;const char *name;int ac;int ev;int mass;bool light;equipment_type slot;size_type fit_min;size_type fit_max;};// Note: the Little-Giant range is used to make armours which are very// flexible and adjustable and can be worn by any player character...// providing they also pass the shape test, of course.static int Armour_index[NUM_ARMOURS];static armour_def Armour_prop[NUM_ARMOURS] ={{ ARM_ANIMAL_SKIN, "animal skin", 2, 0, 100,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_ROBE, "robe", 2, 0, 60,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_BIG },{ ARM_LEATHER_ARMOUR, "leather armour", 3, -1, 150,true, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM },{ ARM_STUDDED_LEATHER_ARMOUR,"studded leather armour",4, -1, 180,true, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM },{ ARM_RING_MAIL, "ring mail", 4, -2, 250,false, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM },{ ARM_SCALE_MAIL, "scale mail", 5, -3, 350,false, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM },{ ARM_CHAIN_MAIL, "chain mail", 6, -4, 400,false, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM },{ ARM_BANDED_MAIL, "banded mail", 7, -5, 500,false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM },{ ARM_SPLINT_MAIL, "splint mail", 8, -5, 550,false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM },{ ARM_PLATE_MAIL, "plate mail", 10, -6, 650,false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM },{ ARM_CRYSTAL_PLATE_MAIL, "crystal plate mail", 14, -8, 1200,false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM },{ ARM_TROLL_HIDE, "troll hide", 2, -1, 220,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_TROLL_LEATHER_ARMOUR, "troll leather armour", 4, -1, 220,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_STEAM_DRAGON_HIDE, "steam dragon hide", 2, 0, 120,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_STEAM_DRAGON_ARMOUR, "steam dragon armour", 4, 0, 120,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_MOTTLED_DRAGON_HIDE, "mottled dragon hide", 2, -1, 150,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_MOTTLED_DRAGON_ARMOUR,"mottled dragon armour", 5, -1, 150,true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_SWAMP_DRAGON_HIDE, "swamp dragon hide", 3, -2, 200,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_SWAMP_DRAGON_ARMOUR, "swamp dragon armour", 5, -2, 200,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_DRAGON_HIDE, "dragon hide", 3, -3, 350,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_DRAGON_ARMOUR, "dragon armour", 6, -3, 350,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_ICE_DRAGON_HIDE, "ice dragon hide", 3, -3, 350,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_ICE_DRAGON_ARMOUR, "ice dragon armour", 6, -3, 350,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_STORM_DRAGON_HIDE, "storm dragon hide", 4, -5, 600,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_STORM_DRAGON_ARMOUR, "storm dragon armour", 8, -5, 600,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_GOLD_DRAGON_HIDE, "gold dragon hide", 5, -8, 1100,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_GOLD_DRAGON_ARMOUR, "gold dragon armour", 10, -8, 1100,false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT },{ ARM_CLOAK, "cloak", 1, 0, 40,true, EQ_CLOAK, SIZE_LITTLE, SIZE_BIG },{ ARM_GLOVES, "gloves", 1, 0, 20,true, EQ_GLOVES, SIZE_SMALL, SIZE_MEDIUM },{ ARM_HELMET, "helmet", 1, 0, 80,false, EQ_HELMET, SIZE_SMALL, SIZE_MEDIUM },{ ARM_CAP, "cap", 0, 0, 40,true, EQ_HELMET, SIZE_LITTLE, SIZE_LARGE },// Note that barding size is compared against torso so it currently// needs to fit medium, but that doesn't matter as much as race// and shapeshift status.{ ARM_BOOTS, "boots", 1, 0, 30,true, EQ_BOOTS, SIZE_SMALL, SIZE_MEDIUM },{ ARM_CENTAUR_BARDING, "centaur barding", 4, -2, 100,true, EQ_BOOTS, SIZE_MEDIUM, SIZE_MEDIUM },{ ARM_NAGA_BARDING, "naga barding", 4, -2, 100,true, EQ_BOOTS, SIZE_MEDIUM, SIZE_MEDIUM },// Note: shields use ac-value as sh-value, EV pen is used for heavy_shield{ ARM_BUCKLER, "buckler", 3, 0, 90,true, EQ_SHIELD, SIZE_LITTLE, SIZE_MEDIUM },{ ARM_SHIELD, "shield", 5, -1, 150,false, EQ_SHIELD, SIZE_SMALL, SIZE_BIG },{ ARM_LARGE_SHIELD, "large shield", 7, -2, 230,false, EQ_SHIELD, SIZE_MEDIUM, SIZE_GIANT },};struct weapon_def{int id;const char *name;int dam;int hit;int speed;int mass;int str_weight;skill_type skill;hands_reqd_type hands;size_type fit_size; // actual size is one size smallermissile_type ammo; // MI_NONE for non-launchersbool throwable;int dam_type;};static int Weapon_index[NUM_WEAPONS];static weapon_def Weapon_prop[NUM_WEAPONS] ={// Maces & Flails{ WPN_WHIP, "whip", 4, 2, 13, 30, 2,SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLASHING },{ WPN_CLUB, "club", 5, 3, 13, 50, 7,SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, true,DAMV_CRUSHING },{ WPN_HAMMER, "hammer", 7, 3, 13, 90, 7,SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, false,DAMV_CRUSHING },{ WPN_MACE, "mace", 8, 3, 14, 120, 8,SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, false,DAMV_CRUSHING },{ WPN_FLAIL, "flail", 9, 2, 15, 130, 8,SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, false,DAMV_CRUSHING },{ WPN_ANCUS, "ancus", 9, 2, 14, 120, 8,SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_CRUSHING },{ WPN_MORNINGSTAR, "morningstar", 10, -1, 15, 140, 8,SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_PIERCING | DAM_BLUDGEON },{ WPN_DEMON_WHIP, "demon whip", 10, 1, 13, 30, 2,SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLASHING },{ WPN_SPIKED_FLAIL, "spiked flail", 12, -2, 16, 190, 8,SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_PIERCING | DAM_BLUDGEON },{ WPN_EVENINGSTAR, "eveningstar", 12, -1, 15, 180, 8,SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_PIERCING | DAM_BLUDGEON },{ WPN_DIRE_FLAIL, "dire flail", 13, -3, 14, 240, 9,SK_MACES_FLAILS, HANDS_DOUBLE, SIZE_MEDIUM, MI_NONE, false,DAMV_PIERCING | DAM_BLUDGEON },{ WPN_GREAT_MACE, "great mace", 16, -4, 18, 270, 9,SK_MACES_FLAILS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_CRUSHING },{ WPN_GIANT_CLUB, "giant club", 18, -6, 19, 330, 10,SK_MACES_FLAILS, HANDS_TWO, SIZE_BIG, MI_NONE, false,DAMV_CRUSHING },{ WPN_GIANT_SPIKED_CLUB, "giant spiked club", 20, -7, 20, 350, 10,SK_MACES_FLAILS, HANDS_TWO, SIZE_BIG, MI_NONE, false,DAMV_PIERCING | DAM_BLUDGEON },// Short blades{ WPN_KNIFE, "knife", 3, 5, 10, 10, 1,SK_SHORT_BLADES, HANDS_ONE, SIZE_LITTLE, MI_NONE, false,DAMV_STABBING | DAM_SLICE },{ WPN_DAGGER, "dagger", 4, 6, 10, 20, 1,SK_SHORT_BLADES, HANDS_ONE, SIZE_LITTLE, MI_NONE, true,DAMV_STABBING | DAM_SLICE },{ WPN_QUICK_BLADE, "quick blade", 5, 6, 7, 50, 0,SK_SHORT_BLADES, HANDS_ONE, SIZE_LITTLE, MI_NONE, false,DAMV_STABBING | DAM_SLICE },{ WPN_SHORT_SWORD, "short sword", 6, 4, 11, 80, 2,SK_SHORT_BLADES, HANDS_ONE, SIZE_SMALL, MI_NONE, false,DAMV_SLICING | DAM_PIERCE },{ WPN_SABRE, "sabre", 7, 4, 12, 90, 2,SK_SHORT_BLADES, HANDS_ONE, SIZE_SMALL, MI_NONE, false,DAMV_SLICING | DAM_PIERCE },// Long swords{ WPN_FALCHION, "falchion", 8, 2, 13, 170, 4,SK_LONG_SWORDS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING }, // or perhaps DAMV_CHOPPING is more apt?{ WPN_LONG_SWORD, "long sword", 10, 1, 14, 160, 3,SK_LONG_SWORDS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING },{ WPN_SCIMITAR, "scimitar", 11, -1, 14, 170, 3,SK_LONG_SWORDS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING },{ WPN_KATANA, "katana", 13, 2, 13, 160, 3,SK_LONG_SWORDS, HANDS_HALF, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING },{ WPN_DEMON_BLADE, "demon blade", 13, -1, 15, 200, 4,SK_LONG_SWORDS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING },{ WPN_BLESSED_BLADE, "blessed blade", 14, 0, 14, 200, 4,SK_LONG_SWORDS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING },{ WPN_DOUBLE_SWORD, "double sword", 15, -2, 16, 220, 5,SK_LONG_SWORDS, HANDS_HALF, SIZE_MEDIUM, MI_NONE, false,DAMV_SLICING },{ WPN_GREAT_SWORD, "great sword", 16, -3, 17, 250, 6,SK_LONG_SWORDS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_SLICING },{ WPN_TRIPLE_SWORD, "triple sword", 19, -4, 19, 260, 6,SK_LONG_SWORDS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_SLICING },// Axes{ WPN_HAND_AXE, "hand axe", 7, 3, 13, 80, 6,SK_AXES, HANDS_ONE, SIZE_SMALL, MI_NONE, true,DAMV_CHOPPING },{ WPN_WAR_AXE, "war axe", 11, 0, 16, 180, 7,SK_AXES, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false,DAMV_CHOPPING },{ WPN_BROAD_AXE, "broad axe", 14, -2, 17, 230, 8,SK_AXES, HANDS_HALF, SIZE_MEDIUM, MI_NONE, false,DAMV_CHOPPING },{ WPN_BATTLEAXE, "battleaxe", 17, -4, 18, 250, 8,SK_AXES, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_CHOPPING },{ WPN_EXECUTIONERS_AXE, "executioner\'s axe", 20, -6, 20, 280, 9,SK_AXES, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_CHOPPING },// Polearms{ WPN_SPEAR, "spear", 6, 3, 12, 50, 3,SK_POLEARMS, HANDS_HALF, SIZE_SMALL, MI_NONE, true,DAMV_PIERCING },{ WPN_TRIDENT, "trident", 9, 2, 14, 160, 4,SK_POLEARMS, HANDS_HALF, SIZE_MEDIUM, MI_NONE, false,DAMV_PIERCING },{ WPN_DEMON_TRIDENT, "demon trident", 13, 0, 14, 160, 4,SK_POLEARMS, HANDS_HALF, SIZE_MEDIUM, MI_NONE, false,DAMV_PIERCING },{ WPN_HALBERD, "halberd", 13, -3, 16, 200, 5,SK_POLEARMS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_CHOPPING | DAM_PIERCE },{ WPN_SCYTHE, "scythe", 14, -4, 20, 220, 7,SK_POLEARMS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_SLICING },{ WPN_GLAIVE, "glaive", 15, -3, 18, 200, 6,SK_POLEARMS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_CHOPPING },{ WPN_LOCHABER_AXE, "lochaber axe", 18, -6, 20, 200, 8,SK_POLEARMS, HANDS_TWO, SIZE_LARGE, MI_NONE, false,DAMV_CHOPPING },{ WPN_QUARTERSTAFF, "quarterstaff", 9, 2, 12, 180, 7,SK_STAVES, HANDS_DOUBLE, SIZE_LARGE, MI_NONE, false,DAMV_CRUSHING },{ WPN_LAJATANG, "lajatang", 14, -3, 14, 200, 3,SK_STAVES, HANDS_DOUBLE, SIZE_LARGE, MI_NONE, false,DAMV_SLICING },// Range weapons// Notes:// - HANDS_HALF means a reloading time penalty if using shield// - damage field is used for bonus strength damage (string tension)// - slings get a bonus from dex, not str (as tension is meaningless)// - str weight is used for speed and applying dex to skill{ WPN_BLOWGUN, "blowgun", 0, 2, 10, 20, 0,SK_DARTS, HANDS_HALF, SIZE_LITTLE, MI_NEEDLE, false,DAMV_NON_MELEE },{ WPN_SLING, "sling", 0, 2, 11, 20, 1,SK_SLINGS, HANDS_HALF, SIZE_LITTLE, MI_STONE, false,DAMV_NON_MELEE },{ WPN_HAND_CROSSBOW, "hand crossbow", 3, 4, 15, 70, 5,SK_CROSSBOWS, HANDS_HALF, SIZE_SMALL, MI_DART, false,DAMV_NON_MELEE },{ WPN_CROSSBOW, "crossbow", 5, 4, 15, 150, 8,SK_CROSSBOWS, HANDS_TWO, SIZE_MEDIUM, MI_BOLT, false,DAMV_NON_MELEE },{ WPN_BOW, "bow", 4, 1, 11, 90, 2,SK_BOWS, HANDS_TWO, SIZE_MEDIUM, MI_ARROW, false,DAMV_NON_MELEE },{ WPN_LONGBOW, "longbow", 5, 0, 12, 120, 3,SK_BOWS, HANDS_TWO, SIZE_LARGE, MI_ARROW, false,DAMV_NON_MELEE },};struct missile_def{int id;const char *name;int dam;int mass;bool throwable;};static int Missile_index[NUM_MISSILES];static missile_def Missile_prop[NUM_MISSILES] ={{ MI_NEEDLE, "needle", 0, 1, false },{ MI_STONE, "stone", 4, 2, true },{ MI_DART, "dart", 5, 3, true },{ MI_ARROW, "arrow", 6, 5, false },{ MI_BOLT, "bolt", 8, 5, false },{ MI_LARGE_ROCK, "large rock", 20, 1000, true },};struct food_def{int id;const char *name;int value;int carn_mod;int herb_mod;int mass;int turns;};// NOTE: Any food with special random messages or side effects// currently only takes one turn to eat (except ghouls and chunks)...// if this changes then those items will have to have special code// (like ghoul chunks) to guarantee that the special thing is only// done once. See the ghoul eating code over in food.cc.static int Food_index[NUM_FOODS];static food_def Food_prop[NUM_FOODS] ={{ FOOD_MEAT_RATION, "meat ration", 5000, 500, -1500, 80, 4 },{ FOOD_SAUSAGE, "sausage", 1500, 150, -400, 40, 1 },{ FOOD_CHUNK, "chunk", 1000, 100, -500, 100, 3 },{ FOOD_BEEF_JERKY, "beef jerky", 800, 100, -250, 20, 1 },{ FOOD_BREAD_RATION, "bread ration", 4400, -1500, 750, 80, 4 },{ FOOD_SNOZZCUMBER, "snozzcumber", 1500, -500, 500, 50, 1 },{ FOOD_ORANGE, "orange", 1000, -350, 400, 20, 1 },{ FOOD_BANANA, "banana", 1000, -350, 400, 20, 1 },{ FOOD_LEMON, "lemon", 1000, -350, 400, 20, 1 },{ FOOD_PEAR, "pear", 700, -250, 300, 20, 1 },{ FOOD_APPLE, "apple", 700, -250, 300, 20, 1 },{ FOOD_APRICOT, "apricot", 700, -250, 300, 15, 1 },{ FOOD_CHOKO, "choko", 600, -200, 250, 30, 1 },{ FOOD_RAMBUTAN, "rambutan", 600, -200, 250, 10, 1 },{ FOOD_LYCHEE, "lychee", 600, -200, 250, 10, 1 },{ FOOD_STRAWBERRY, "strawberry", 200, -80, 100, 5, 1 },{ FOOD_GRAPE, "grape", 100, -40, 50, 2, 1 },{ FOOD_SULTANA, "sultana", 70, -30, 30, 1, 1 },{ FOOD_ROYAL_JELLY, "royal jelly", 4000, 0, 0, 55, 1 },{ FOOD_HONEYCOMB, "honeycomb", 2000, 0, 0, 40, 1 },{ FOOD_PIZZA, "pizza", 1500, 0, 0, 40, 1 },{ FOOD_CHEESE, "cheese", 1200, 0, 0, 40, 1 },};// Must call this functions early on so that the above tables can// be accessed correctly.void init_properties(void){int i;for (i = 0; i < NUM_ARMOURS; i++)Armour_index[ Armour_prop[i].id ] = i;for (i = 0; i < NUM_WEAPONS; i++)Weapon_index[ Weapon_prop[i].id ] = i;for (i = 0; i < NUM_MISSILES; i++)Missile_index[ Missile_prop[i].id ] = i;for (i = 0; i < NUM_FOODS; i++)Food_index[ Food_prop[i].id ] = i;}// Some convenient functions to hide the bit operations and create// an interface layer between the code and the data in case this// gets changed again. -- bwr//// Item cursed status functions://bool item_cursed( const item_def &item ){return (item.flags & ISFLAG_CURSED);}bool item_known_cursed( const item_def &item ){return ((item.flags & ISFLAG_KNOW_CURSE) && (item.flags & ISFLAG_CURSED));}bool item_known_uncursed( const item_def &item ){return ((item.flags & ISFLAG_KNOW_CURSE) && !(item.flags & ISFLAG_CURSED));}void do_curse_item( item_def &item ){item.flags |= ISFLAG_CURSED;}void do_uncurse_item( item_def &item ){item.flags &= (~ISFLAG_CURSED);}//// Item identification status://bool item_ident( const item_def &item, unsigned long flags ){return ((item.flags & flags) == flags);}void set_ident_flags( item_def &item, unsigned long flags ){bool known_before = fully_identified(item);item.flags |= flags;if ( !known_before && fully_identified(item) ) {/* make a note of it */if ( is_interesting_item(item) ) {char buf[ITEMNAME_SIZE];char buf2[ITEMNAME_SIZE];item_name( item, DESC_NOCAP_A, buf );strcpy(buf2, origin_desc(item).c_str());take_note(Note(NOTE_ID_ITEM, 0, 0, buf, buf2));}}}void unset_ident_flags( item_def &item, unsigned long flags ){item.flags &= (~flags);}//// Equipment race and description://unsigned long get_equip_race( const item_def &item ){return (item.flags & ISFLAG_RACIAL_MASK);}unsigned long get_equip_desc( const item_def &item ){return (item.flags & ISFLAG_COSMETIC_MASK);}void set_equip_race( item_def &item, unsigned long flags ){ASSERT( (flags & ~ISFLAG_RACIAL_MASK) == 0 );// first check for base-sub pairs that can't ever have racial typesswitch (item.base_type){case OBJ_WEAPONS:if (item.sub_type == WPN_GIANT_CLUB|| item.sub_type == WPN_GIANT_SPIKED_CLUB|| item.sub_type == WPN_KATANA|| item.sub_type == WPN_LAJATANG|| item.sub_type == WPN_SLING|| item.sub_type == WPN_KNIFE|| item.sub_type == WPN_QUARTERSTAFF|| item.sub_type == WPN_DEMON_BLADE|| item.sub_type == WPN_DEMON_WHIP|| item.sub_type == WPN_DEMON_TRIDENT){return;}break;case OBJ_ARMOUR:// not hides, dragon armour, crystal plate, or bardingif (item.sub_type >= ARM_DRAGON_HIDE&& item.sub_type <= ARM_SWAMP_DRAGON_ARMOUR&& item.sub_type != ARM_CENTAUR_BARDING&& item.sub_type != ARM_NAGA_BARDING){return;}break;case OBJ_MISSILES:if (item.sub_type == MI_STONE || item.sub_type == MI_LARGE_ROCK)return;break;default:return;}// check that item is appropriate for racial typeswitch (flags){case ISFLAG_ELVEN:if (item.base_type == OBJ_ARMOUR&& (item.sub_type == ARM_SPLINT_MAIL|| item.sub_type == ARM_BANDED_MAIL|| item.sub_type == ARM_PLATE_MAIL)){return;}break;case ISFLAG_DWARVEN:if (item.base_type == OBJ_ARMOUR&& (item.sub_type == ARM_ROBE|| item.sub_type == ARM_LEATHER_ARMOUR|| item.sub_type == ARM_STUDDED_LEATHER_ARMOUR)){return;}break;case ISFLAG_ORCISH:default:break;}item.flags &= ~ISFLAG_RACIAL_MASK; // delete previousitem.flags |= flags;}void set_equip_desc( item_def &item, unsigned long flags ){ASSERT( (flags & ~ISFLAG_COSMETIC_MASK) == 0 );item.flags &= ~ISFLAG_COSMETIC_MASK; // delete previousitem.flags |= flags;}//// These functions handle the description and subtypes for helmets/caps//short get_helmet_type( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR&& get_armour_slot( item ) == EQ_HELMET );return (item.plus2 & THELM_TYPE_MASK);}short get_helmet_desc( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR&& get_armour_slot( item ) == EQ_HELMET );return (item.plus2 & THELM_DESC_MASK);}void set_helmet_type( item_def &item, short type ){ASSERT( (type & ~THELM_TYPE_MASK) == 0 );ASSERT( item.base_type == OBJ_ARMOUR&& get_armour_slot( item ) == EQ_HELMET );// make sure we have the right sub_type (to get properties correctly)if (type == THELM_HELMET || type == THELM_HELM)item.sub_type = ARM_HELMET;// [dshaligram] FIXME: This is for when we import caps// else// item.sub_type = ARM_CAP;item.plus2 &= ~THELM_TYPE_MASK;item.plus2 |= type;}void set_helmet_desc( item_def &item, short type ){ASSERT( (type & ~THELM_DESC_MASK) == 0 );ASSERT( item.base_type == OBJ_ARMOUR&& get_armour_slot( item ) == EQ_HELMET );const int helmtype = get_helmet_type(item);if ((helmtype == THELM_CAP || helmtype == THELM_WIZARD_HAT)&& type > THELM_DESC_PLUMED)type = THELM_DESC_PLAIN;item.plus2 &= ~THELM_DESC_MASK;item.plus2 |= type;}bool is_hard_helmet(const item_def &item){return (item.base_type == OBJ_ARMOUR&& item.sub_type == ARM_HELMET&& (get_helmet_type(item) == THELM_HELM|| get_helmet_type(item) == THELM_HELMET));}void set_helmet_random_desc( item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR&& get_armour_slot( item ) == EQ_HELMET );item.plus2 &= ~THELM_DESC_MASK;if (is_hard_helmet(item))item.plus2 |= (random2(8) << 8);elseitem.plus2 |= (random2(5) << 8);}bool is_helmet_type( const item_def &item, short val ){if (item.base_type != OBJ_ARMOUR || get_armour_slot( item ) != EQ_HELMET)return (false);return (get_helmet_type( item ) == val);}//// Ego item functions://bool set_item_ego_type( item_def &item, int item_type, int ego_type ){if (item.base_type == item_type&& !is_random_artefact( item )&& !is_fixed_artefact( item )){item.special = ego_type;return (true);}return (false);}int get_weapon_brand( const item_def &item ){// Weapon ego types are "brands", so we do the randart lookup here.// Staves "brands" handled speciallyif (item.base_type != OBJ_WEAPONS)return (SPWPN_NORMAL);if (is_fixed_artefact( item )){switch (item.special){case SPWPN_SWORD_OF_CEREBOV:return (SPWPN_FLAMING);case SPWPN_STAFF_OF_OLGREB:return (SPWPN_VENOM);case SPWPN_VAMPIRES_TOOTH:return (SPWPN_VAMPIRICISM);default:return (SPWPN_NORMAL);}}else if (is_random_artefact( item )){return (randart_wpn_property( item, RAP_BRAND ));}return (item.special);}int get_ammo_brand( const item_def &item ){// no artefact arrows yet -- bwrif (item.base_type != OBJ_MISSILES || is_random_artefact( item ))return (SPMSL_NORMAL);return (item.special);}int get_armour_ego_type( const item_def &item ){// artefact armours have no ego type, must look up powers separatelyif (item.base_type != OBJ_ARMOUR|| (is_random_artefact( item ) && !is_unrandom_artefact( item ))){return (SPARM_NORMAL);}return (item.special);}//// Armour information and checking functions//bool hide2armour( item_def &item ){if (item.base_type != OBJ_ARMOUR)return (false);switch (item.sub_type){default:return (false);case ARM_DRAGON_HIDE:item.sub_type = ARM_DRAGON_ARMOUR;break;case ARM_TROLL_HIDE:item.sub_type = ARM_TROLL_LEATHER_ARMOUR;break;case ARM_ICE_DRAGON_HIDE:item.sub_type = ARM_ICE_DRAGON_ARMOUR;break;case ARM_MOTTLED_DRAGON_HIDE:item.sub_type = ARM_MOTTLED_DRAGON_ARMOUR;break;case ARM_STORM_DRAGON_HIDE:item.sub_type = ARM_STORM_DRAGON_ARMOUR;break;case ARM_GOLD_DRAGON_HIDE:item.sub_type = ARM_GOLD_DRAGON_ARMOUR;break;case ARM_SWAMP_DRAGON_HIDE:item.sub_type = ARM_SWAMP_DRAGON_ARMOUR;break;case ARM_STEAM_DRAGON_HIDE:item.sub_type = ARM_STEAM_DRAGON_ARMOUR;break;}return (true);} // end hide2armour()// Return the enchantment limit of a piece of armourint armour_max_enchant( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR );const int eq_slot = get_armour_slot( item );int max_plus = MAX_SEC_ENCHANT;if (eq_slot == EQ_BODY_ARMOUR || eq_slot == EQ_SHIELD)max_plus = MAX_ARM_ENCHANT;return (max_plus);}// doesn't include animal skin (only skins we can make and enchant)bool armour_is_hide( const item_def &item, bool inc_made ){ASSERT( item.base_type == OBJ_ARMOUR );switch (item.sub_type){case ARM_TROLL_LEATHER_ARMOUR:case ARM_DRAGON_ARMOUR:case ARM_ICE_DRAGON_ARMOUR:case ARM_STEAM_DRAGON_ARMOUR:case ARM_MOTTLED_DRAGON_ARMOUR:case ARM_STORM_DRAGON_ARMOUR:case ARM_GOLD_DRAGON_ARMOUR:case ARM_SWAMP_DRAGON_ARMOUR:return (inc_made);case ARM_TROLL_HIDE:case ARM_DRAGON_HIDE:case ARM_ICE_DRAGON_HIDE:case ARM_STEAM_DRAGON_HIDE:case ARM_MOTTLED_DRAGON_HIDE:case ARM_STORM_DRAGON_HIDE:case ARM_GOLD_DRAGON_HIDE:case ARM_SWAMP_DRAGON_HIDE:return (true);default:break;}return (false);}// used to distinguish shiny and embroideredbool armour_not_shiny( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR );switch (item.sub_type){case ARM_ROBE:case ARM_CLOAK:case ARM_GLOVES:case ARM_BOOTS:case ARM_NAGA_BARDING:case ARM_CENTAUR_BARDING:case ARM_CAP:case ARM_LEATHER_ARMOUR:case ARM_STUDDED_LEATHER_ARMOUR:case ARM_ANIMAL_SKIN:case ARM_TROLL_HIDE:case ARM_TROLL_LEATHER_ARMOUR:return (true);case ARM_HELMET:{const int helmtype = get_helmet_type(item);return (helmtype == THELM_CAP || helmtype == THELM_WIZARD_HAT);}default:break;}return (false);}int armour_str_required( const item_def &arm ){ASSERT (arm.base_type == OBJ_ARMOUR );int ret = 0;const equipment_type slot = get_armour_slot( arm );const int mass = item_mass( arm );switch (slot){case EQ_BODY_ARMOUR:ret = mass / 35;break;case EQ_SHIELD:ret = mass / 15;break;default:break;}return ((ret < STR_REQ_THRESHOLD) ? 0 : ret);}equipment_type get_armour_slot( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR );return (Armour_prop[ Armour_index[item.sub_type] ].slot);}bool jewellery_is_amulet( const item_def &item ){ASSERT( item.base_type == OBJ_JEWELLERY );return (item.sub_type >= AMU_RAGE);}bool check_jewellery_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_JEWELLERY );// Currently assuming amulets are always wearable (only needs// to be held over head or heart... giants can strap it on with// a bit of binder twine). However, rings need to actually fit// around the ring finger to work, and so the big cannot use them.return (size <= SIZE_LARGE || jewellery_is_amulet( item ));}// Returns the basic light status of an armour, ignoring things like the// elven bonus... you probably want is_light_armour() most times.bool base_armour_is_light( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR );return (Armour_prop[ Armour_index[item.sub_type] ].light);}// returns number of sizes offint fit_armour_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_ARMOUR );const size_type min = Armour_prop[ Armour_index[item.sub_type] ].fit_min;const size_type max = Armour_prop[ Armour_index[item.sub_type] ].fit_max;if (size < min)return (min - size); // -'ve means levels too smallelse if (size > max)return (max - size); // +'ve means levels too largereturn (0);}// returns true if armour fits size (shape needs additional verification)bool check_armour_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_ARMOUR );return (fit_armour_size( item, size ) == 0);}// Note that this function is used to check validity of equipment// coming out of transformations... so it shouldn't contain any// wield/unwield only checks like two-handed weapons and shield.bool check_armour_shape( const item_def &item, bool quiet ){ASSERT( item.base_type == OBJ_ARMOUR );const int slot = get_armour_slot( item );if (!player_is_shapechanged()){switch (slot){case EQ_BOOTS:switch (you.species){case SP_NAGA:if (item.sub_type != ARM_NAGA_BARDING){if (!quiet)mpr( "You can't wear that!" );return (false);}break;case SP_CENTAUR:if (item.sub_type != ARM_CENTAUR_BARDING){if (!quiet)mpr( "You can't wear that!" );return (false);}break;case SP_KENKU:if (!quiet){if (item.sub_type == ARM_BOOTS)mpr( "Boots don't fit your feet!" );elsempr( "You can't wear barding!" );}return (false);case SP_MERFOLK:if (player_in_water() && item.sub_type == ARM_BOOTS){if (!quiet)mpr( "You don't currently have feet!" );return (false);}// intentional fall-throughdefault:if (item.sub_type == ARM_NAGA_BARDING|| item.sub_type == ARM_CENTAUR_BARDING){if (!quiet)mpr( "You can't wear barding!" );return (false);}if (you.mutation[MUT_HOOVES] >= 2){if (!quiet)mpr( "You can't wear boots with hooves!" );return (false);}break;}break;case EQ_HELMET:if (item.sub_type == ARM_CAP|| get_helmet_type(item) == THELM_CAP|| get_helmet_type(item) == THELM_WIZARD_HAT)break;if (you.species == SP_KENKU){if (!quiet)mpr( "That helmet does not fit your head!" );return (false);}if (you.species == SP_MINOTAUR || you.mutation[MUT_HORNS]){if (!quiet)mpr( "You can't wear that with your horns!" );return (false);}break;case EQ_GLOVES:if (you.mutation[MUT_CLAWS] >= 3){if (!quiet)mpr( "You can't wear gloves with your huge claws!" );return (false);}break;case EQ_BODY_ARMOUR:// Cannot swim in heavy armourif (player_is_swimming() && !is_light_armour( item )){if (!quiet)mpr("You can't swim in that!");return (false);}// Draconians are human-sized, but have wings that cause problems// with most body armours (only very flexible fit allowed).if (player_genus( GENPC_DRACONIAN )&& !check_armour_size( item, SIZE_BIG )){if (!quiet)mpr( "That armour doesn't fit your wings." );return (false);}break;default:break;}}else{// Note: some transformation include all of the above as wellif (item.sub_type == ARM_NAGA_BARDING|| item.sub_type == ARM_CENTAUR_BARDING){if (!quiet)mpr( "You can't wear barding in your current form!" );return (false);}}// Note: This need to be checked after all the special cases// above, and in addition to shapechanged or not. This is// a simple check against the armour types that are forced off.// FIXME FIXME FIXME/*if (!transform_can_equip_type( slot )){if (!quiet)mpr( "You can't wear that in your current form!" );return (false);}*/return (true);}//// Weapon information and checking functions://// Checks how rare a weapon is. Many of these have special routines for// placement, especially those with a rarity of zero. Chance is out of 10.int weapon_rarity( int w_type ){switch (w_type){case WPN_CLUB:case WPN_DAGGER:return (10);case WPN_HAND_AXE:case WPN_MACE:case WPN_QUARTERSTAFF:return (9);case WPN_BOW:case WPN_FLAIL:case WPN_HAMMER:case WPN_SABRE:case WPN_SHORT_SWORD:case WPN_SLING:case WPN_SPEAR:return (8);case WPN_FALCHION:case WPN_LONG_SWORD:case WPN_MORNINGSTAR:case WPN_WAR_AXE:return (7);case WPN_BATTLEAXE:case WPN_CROSSBOW:case WPN_GREAT_SWORD:case WPN_SCIMITAR:case WPN_TRIDENT:return (6);case WPN_GLAIVE:case WPN_HALBERD:case WPN_BLOWGUN:return (5);case WPN_BROAD_AXE:case WPN_HAND_CROSSBOW:case WPN_SPIKED_FLAIL:case WPN_WHIP:return (4);case WPN_GREAT_MACE:return (3);case WPN_ANCUS:case WPN_DIRE_FLAIL:case WPN_SCYTHE:case WPN_LONGBOW:return (2);case WPN_GIANT_CLUB:case WPN_GIANT_SPIKED_CLUB:case WPN_LOCHABER_AXE:return (1);case WPN_DOUBLE_SWORD:case WPN_EVENINGSTAR:case WPN_EXECUTIONERS_AXE:case WPN_KATANA:case WPN_LAJATANG:case WPN_KNIFE:case WPN_QUICK_BLADE:case WPN_TRIPLE_SWORD:case WPN_DEMON_TRIDENT:case WPN_DEMON_WHIP:case WPN_DEMON_BLADE:case WPN_BLESSED_BLADE:// zero value weapons must be placed specially -- see make_item() {dlb}return (0);default:break;}return (0);} // end rare_weapon()int get_vorpal_type( const item_def &item ){int ret = DVORP_NONE;if (item.base_type == OBJ_WEAPONS)ret = (Weapon_prop[ Weapon_index[item.sub_type] ].dam_type & DAMV_MASK);return (ret);} // end vorpal_type()int get_damage_type( const item_def &item ){int ret = DAM_BASH;if (item.base_type == OBJ_WEAPONS)ret = (Weapon_prop[ Weapon_index[item.sub_type] ].dam_type & DAM_MASK);return (ret);} // end damage_type()bool does_damage_type( const item_def &item, int dam_type ){return (get_damage_type( item ) & dam_type);} // end does_damage_type()hands_reqd_type hands_reqd(int base_type, int sub_type, size_type size){item_def item;item.base_type = base_type;item.sub_type = sub_type;return hands_reqd(item, size);}// give hands required to wield weapon for a torso of "size"hands_reqd_type hands_reqd( const item_def &item, size_type size ){int ret = HANDS_ONE;int fit;bool doub = false;switch (item.base_type){case OBJ_STAVES:case OBJ_WEAPONS:// Merging staff with magical staves for consistency... doing// as a special case because we want to be very flexible with// these useful objects (we want spriggans and ogre magi to// be able to use them).if (item.base_type == OBJ_STAVES || item.sub_type == WPN_QUARTERSTAFF){if (size < SIZE_SMALL)ret = HANDS_TWO;else if (size > SIZE_LARGE)ret = HANDS_ONE;elseret = HANDS_HALF;break;}ret = Weapon_prop[ Weapon_index[item.sub_type] ].hands;// size is the level where we can use one hand for one endif (ret == HANDS_DOUBLE){doub = true;ret = HANDS_HALF;}// adjust handedness for size only for non-whip melee weaponsif (!is_range_weapon( item )&& item.sub_type != WPN_WHIP&& item.sub_type != WPN_DEMON_WHIP){fit = cmp_weapon_size( item, size );// Adjust handedness for non-medium races:// (XX values don't matter, see fit_weapon_wieldable_size)//// Spriggan Kobold Human Ogre Big Giant// Little 0 0 0 XX XX XX// Small +1 0 0 -2 XX XX// Medium XX +1 0 -1 -2 XX// Large XX XX 0 0 -1 -2// Big XX XX XX 0 0 -1// Giant XX XX XX XX 0 0// Note the stretching of double weapons for larger characters// by one level since they tend to be larger weapons.if (size < SIZE_MEDIUM && fit > 0)ret += fit;else if (size > SIZE_MEDIUM && fit < 0)ret += (fit + doub);}break;case OBJ_CORPSES: // unwieldyret = HANDS_TWO;break;case OBJ_ARMOUR: // barding and body armours are unwieldyif (item.sub_type == ARM_NAGA_BARDING|| item.sub_type == ARM_CENTAUR_BARDING|| get_armour_slot( item ) == EQ_BODY_ARMOUR){ret = HANDS_TWO;}break;default:break;}if (ret > HANDS_TWO)ret = HANDS_TWO;else if (ret < HANDS_ONE)ret = HANDS_ONE;return (static_cast< hands_reqd_type >( ret ));}bool is_double_ended( const item_def &item ){if (item.base_type == OBJ_STAVES)return (true);else if (item.base_type != OBJ_WEAPONS)return (false);return (Weapon_prop[ Weapon_index[item.sub_type] ].hands == HANDS_DOUBLE);}int double_wpn_awkward_speed( const item_def &item ){ASSERT( is_double_ended( item ) );const int base = property( item, PWPN_SPEED );return ((base * 30 + 10) / 20 + 2);}bool is_demonic( const item_def &item ){if (item.base_type == OBJ_WEAPONS){switch (item.sub_type){case WPN_DEMON_BLADE:case WPN_DEMON_WHIP:case WPN_DEMON_TRIDENT:return (true);default:break;}}return (false);} // end is_demonic()int weapon_str_weight( const item_def &wpn ){ASSERT (wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES);if (wpn.base_type == OBJ_STAVES)return (Weapon_prop[ Weapon_index[WPN_QUARTERSTAFF] ].str_weight);return (Weapon_prop[ Weapon_index[wpn.sub_type] ].str_weight);}int weapon_dex_weight( const item_def &wpn ){return (10 - weapon_str_weight( wpn ));}int weapon_impact_mass( const item_def &wpn ){ASSERT (wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES);return ((weapon_str_weight( wpn ) * item_mass( wpn ) + 5) / 10);}int weapon_str_required( const item_def &wpn, bool hand_half ){ASSERT (wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES);const int req = weapon_impact_mass( wpn ) / ((hand_half) ? 11 : 10);return ((req < STR_REQ_THRESHOLD) ? 0 : req);}// returns melee skill of itemskill_type weapon_skill( const item_def &item ){if (item.base_type == OBJ_WEAPONS && !is_range_weapon( item ))return (Weapon_prop[ Weapon_index[item.sub_type] ].skill);else if (item.base_type == OBJ_STAVES)return (SK_STAVES);// this is used to mark that only fighting applies.return (SK_FIGHTING);}// front function for the above when we don't have a physical item to checkskill_type weapon_skill( int wclass, int wtype ){item_def wpn;wpn.base_type = wclass;wpn.sub_type = wtype;return (weapon_skill( wpn ));} // end weapon_skill()// returns range skill of the itemskill_type range_skill( const item_def &item ){if (item.base_type == OBJ_WEAPONS && is_range_weapon( item ))return (Weapon_prop[ Weapon_index[item.sub_type] ].skill);else if (item.base_type == OBJ_MISSILES && item.sub_type == MI_DART)return (SK_DARTS);return (SK_RANGED_COMBAT);}// front function for the above when we don't have a physical item to checkskill_type range_skill( int wclass, int wtype ){item_def wpn;wpn.base_type = wclass;wpn.sub_type = wtype;return (range_skill( wpn ));} // end weapon_skill()// Calculate the bonus to melee EV for using "wpn", with "skill" and "dex"// to protect a body of size "body".int weapon_ev_bonus( const item_def &wpn, int skill, size_type body, int dex,bool hide_hidden ){ASSERT( wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES );int ret = 0;// Note: ret currently measured in halves (see skill factor)if (wpn.sub_type == WPN_WHIP || wpn.sub_type == WPN_DEMON_WHIP)ret = 3 + (dex / 5);else if (weapon_skill( wpn ) == SK_POLEARMS)ret = 2 + (dex / 5);// weapons of reaching are naturally a bit longer/flexierif (!hide_hidden || item_ident( wpn, ISFLAG_KNOW_TYPE )){if (get_weapon_brand( wpn ) == SPWPN_REACHING)ret += 1;}// only consider additional modifications if we have a positive base:if (ret > 0){// Size factors:// - large characters can't cover their flanks as well// - note that not all weapons are available to small charactersif (body > SIZE_LARGE)ret -= (4 * (body - SIZE_LARGE) - 2);else if (body < SIZE_MEDIUM)ret += 1;// apply skill (and dividing by 2)ret = (ret * (skill + 10)) / 20;// make sure things can't get too insaneif (ret > 8)ret = 8 + (ret - 8) / 2;}// Note: this is always a bonusreturn ((ret > 0) ? ret : 0);}static size_type weapon_size( const item_def &item ){ASSERT (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES);if (item.base_type == OBJ_STAVES)return (Weapon_prop[ Weapon_index[WPN_QUARTERSTAFF] ].fit_size);return (Weapon_prop[ Weapon_index[item.sub_type] ].fit_size);}// returns number of sizes offint cmp_weapon_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES );return (weapon_size( item ) - size);}// Returns number of sizes away from being a usable weaponint fit_weapon_wieldable_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES );const int fit = cmp_weapon_size( item, size );return ((fit < -2) ? fit + 2 : (fit > 1) ? fit - 1 : 0);}// Returns number of sizes away from being throwable... the window// is currently [size - 5, size - 1].int fit_item_throwable_size( const item_def &item, size_type size ){int ret = item_size( item ) - size;return ((ret >= 0) ? ret + 1 : (ret > -6) ? 0 : ret + 5);}// Returns true if weapon is usable as a tool// Note that we assume that tool usable >= wieldablebool check_weapon_tool_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES );// Staves are currently usable for everyone just to be nice.if (item.base_type == OBJ_STAVES || item.sub_type == WPN_QUARTERSTAFF)return (true);const int fit = cmp_weapon_size( item, size );return (fit >= -3 && fit <= 1);}// Returns true if weapon is usable as a weaponbool check_weapon_wieldable_size( const item_def &item, size_type size ){ASSERT( item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES );return (fit_weapon_wieldable_size( item, size ) == 0);}// Note that this function is used to check validity of equipment// coming out of transformations... so it shouldn't contain any// wield/unwield only checks like two-handed weapons and shield.// check_id is only used for descriptions, where we don't want to// give away any information the player doesn't have yet.bool check_weapon_shape( const item_def &item, bool quiet, bool check_id ){const int brand = get_weapon_brand( item );if ((!check_id || item_ident( item, ISFLAG_KNOW_TYPE ))&& ((item.base_type == OBJ_WEAPONS&& item.sub_type == WPN_BLESSED_BLADE)|| brand == SPWPN_HOLY_WRATH|| brand == SPWPN_DISRUPTION)&& (you.is_undead || you.species == SP_DEMONSPAWN)){if (!quiet)mpr( "This weapon will not allow you to wield it." );return (false);}// Note: this should always be done last, see check_armour_shape()// FIXME FIXME FIXME/*if (!transform_can_equip_type( EQ_WEAPON )){if (!quiet)mpr( "You can't wield anything in your current form!" );return (false);}*/return (true);}// Returns the you.inv[] index of our wielded weapon or -1 (no item, not wield)int get_inv_wielded( void ){return (player_weapon_wielded() ? you.equip[EQ_WEAPON] : -1);}// Returns the you.inv[] index of our hand tool or -1 (no item, not usable)// Note that we don't count armour and such as "tools" here because// this function is used to judge if the item will sticky curse to// our hands.int get_inv_hand_tool( void ){const int tool = you.equip[EQ_WEAPON];// FIXME/*if (tool == -1 || !is_tool( you.inv[tool] ))return (-1);if (you.inv[tool].base_type == OBJ_WEAPONS|| you.inv[tool].base_type == OBJ_STAVES){// assuring that bad "shape" weapons aren't in handASSERT( check_weapon_shape( you.inv[tool], false ) );if (!check_weapon_tool_size( you.inv[tool], player_size() ))return (-1);}*/return (tool);}// Returns the you.inv[] index of the thing in our hand... this is provided// as a service to specify that both of the above are irrelevant.// Do not use this for low level functions dealing with wielding directly.int get_inv_in_hand( void ){return (you.equip[EQ_WEAPON]);}//// Launcher and ammo functions://missile_type fires_ammo_type( const item_def &item ){if (item.base_type != OBJ_WEAPONS)return (MI_NONE);return (Weapon_prop[ Weapon_index[item.sub_type] ].ammo);}missile_type fires_ammo_type( weapon_type wtype ){item_def wpn;wpn.base_type = OBJ_WEAPONS;wpn.sub_type = wtype;return (fires_ammo_type(wpn));}bool is_range_weapon( const item_def &item ){return (fires_ammo_type( item ) != MI_NONE);}bool is_range_weapon_type( weapon_type wtype ){item_def wpn;wpn.base_type = OBJ_WEAPONS;wpn.sub_type = wtype;return (is_range_weapon( wpn ));}const char * ammo_name( const item_def &bow ){ASSERT( is_range_weapon( bow ) );const int ammo = fires_ammo_type( bow );return (Missile_prop[ Missile_index[ammo] ].name);}// returns true if item can be reasonably thrown without a launcherbool is_throwable( const item_def &wpn ){if (wpn.base_type == OBJ_WEAPONS)return (Weapon_prop[ Weapon_index[wpn.sub_type] ].throwable);else if (wpn.base_type == OBJ_MISSILES)return (Missile_prop[ Missile_index[wpn.sub_type] ].throwable);return (false);}// FIXME#if 0// decide if "being" is launching or throwing "ammo"launch_retval is_launched( int being_id, const item_def &ammo, bool msg ){ASSERT( being_id != MHITNOT );launch_retval ret = LRET_FUMBLED;const item_def * lnch = 0;int fit = 0;if (being_id == MHITYOU){const int wpn = get_inv_wielded();lnch = (wpn == -1) ? 0 : &you.inv[wpn];fit = fit_item_throwable_size( ammo, player_size() );}else // monster case{const int wpn = menv[being_id].inv[MSLOT_WEAPON];lnch = (wpn == NON_ITEM) ? 0 : &mitm[wpn];fit = fit_item_throwable_size( ammo, mons_size( menv[being_id].type ) );}if (lnch&& lnch->base_type == OBJ_WEAPONS&& is_range_weapon( *lnch )&& ammo.base_type == OBJ_MISSILES&& ammo.sub_type == fires_ammo_type( *lnch )){ret = LRET_LAUNCHED;}else if (is_throwable( ammo )){if (fit == 0)ret = LRET_THROWN;else{ret = LRET_FUMBLED;if (being_id == MHITYOU && msg){mpr( MSGCH_WARN, "It's difficult to throw such a%s object.",(fit > 0) ? " large" : (fit < 0) ? " small" : "n awkward" );}}}return (ret);}#endif//// Staff/rod functions://bool item_is_rod( const item_def &item ){return (item.base_type == OBJ_STAVES&& item.sub_type >= STAFF_SMITING && item.sub_type < STAFF_AIR);}bool item_is_staff( const item_def &item ){// Isn't De Morgan's law wonderful. -- bwrreturn (item.base_type == OBJ_STAVES&& (item.sub_type < STAFF_SMITING || item.sub_type >= STAFF_AIR));}//// Ring functions://// Returns number of pluses on jewellery (always none for amulets yet).int ring_has_pluses( const item_def &item ){ASSERT (item.base_type == OBJ_JEWELLERY);switch (item.sub_type){case RING_SLAYING:return (2);case RING_PROTECTION:case RING_EVASION:case RING_STRENGTH:case RING_INTELLIGENCE:case RING_DEXTERITY:return (1);default:break;}return (0);}//// Food functions://bool food_is_meat( const item_def &item ){ASSERT( is_valid_item( item ) && item.base_type == OBJ_FOOD );return (Food_prop[ Food_index[item.sub_type] ].carn_mod > 0);}bool food_is_veg( const item_def &item ){ASSERT( is_valid_item( item ) && item.base_type == OBJ_FOOD );return (Food_prop[ Food_index[item.sub_type] ].herb_mod > 0);}// returns food value for one turn of eatingint food_value( const item_def &item ){ASSERT( is_valid_item( item ) && item.base_type == OBJ_FOOD );const int herb = you.mutation[MUT_HERBIVOROUS];// XXX: this needs to be better merged with the mutation systemconst int carn = (you.species == SP_KOBOLD || you.species == SP_GHOUL) ? 3: you.mutation[MUT_CARNIVOROUS];const food_def &food = Food_prop[ Food_index[item.sub_type] ];int ret = food.value;ret += (carn * food.carn_mod);ret += (herb * food.herb_mod);return ((ret > 0) ? div_rand_round( ret, food.turns ) : 0);}int food_turns( const item_def &item ){ASSERT( is_valid_item( item ) && item.base_type == OBJ_FOOD );return (Food_prop[ Food_index[item.sub_type] ].turns);}bool can_cut_meat( const item_def &item ){return (does_damage_type( item, DAM_SLICE ));}// returns true if item counts as a tool for tool size comparisons and msgsbool is_tool( const item_def &item ){// Currently using OBJ_WEAPONS instead of can_cut_meat() as almost// any weapon might be an evocable artefact.return (item.base_type == OBJ_WEAPONS|| item.base_type == OBJ_STAVES|| (item.base_type == OBJ_MISCELLANY&& item.sub_type != MISC_RUNE_OF_ZOT));}//// Generic item functions://int property( const item_def &item, int prop_type ){switch (item.base_type){case OBJ_ARMOUR:if (prop_type == PARM_AC)return (Armour_prop[ Armour_index[item.sub_type] ].ac);else if (prop_type == PARM_EVASION)return (Armour_prop[ Armour_index[item.sub_type] ].ev);break;case OBJ_WEAPONS:if (prop_type == PWPN_DAMAGE)return (Weapon_prop[ Weapon_index[item.sub_type] ].dam);else if (prop_type == PWPN_HIT)return (Weapon_prop[ Weapon_index[item.sub_type] ].hit);else if (prop_type == PWPN_SPEED)return (Weapon_prop[ Weapon_index[item.sub_type] ].speed);break;case OBJ_MISSILES:if (prop_type == PWPN_DAMAGE)return (Missile_prop[ Missile_index[item.sub_type] ].dam);break;case OBJ_STAVES:if (prop_type == PWPN_DAMAGE)return (Weapon_prop[ Weapon_index[WPN_QUARTERSTAFF] ].dam);else if (prop_type == PWPN_HIT)return (Weapon_prop[ Weapon_index[WPN_QUARTERSTAFF] ].hit);else if (prop_type == PWPN_SPEED)return (Weapon_prop[ Weapon_index[WPN_QUARTERSTAFF] ].speed);break;default:break;}return (0);}int item_mass( const item_def &item ){int unit_mass = 0;switch (item.base_type){case OBJ_WEAPONS:unit_mass = Weapon_prop[ Weapon_index[item.sub_type] ].mass;break;case OBJ_ARMOUR:unit_mass = Armour_prop[ Armour_index[item.sub_type] ].mass;if (get_equip_race( item ) == ISFLAG_ELVEN){const int reduc = (unit_mass >= 25) ? unit_mass / 5 : 5;// truncate to the nearest 5 and reduce the item mass:unit_mass -= ((reduc / 5) * 5);unit_mass = MAXIMUM( unit_mass, 5 );}break;case OBJ_MISSILES:unit_mass = Missile_prop[ Missile_index[item.sub_type] ].mass;break;case OBJ_FOOD:unit_mass = Food_prop[ Food_index[item.sub_type] ].mass;break;case OBJ_WANDS:unit_mass = 100;break;case OBJ_UNKNOWN_I:unit_mass = 200; // labeled "books"break;case OBJ_SCROLLS:unit_mass = 20;break;case OBJ_JEWELLERY:unit_mass = 10;break;case OBJ_POTIONS:unit_mass = 40;break;case OBJ_UNKNOWN_II:unit_mass = 5; // labeled "gems"break;case OBJ_BOOKS:unit_mass = 70;break;case OBJ_STAVES:unit_mass = 130;break;case OBJ_ORBS:unit_mass = 300;break;case OBJ_MISCELLANY:switch (item.sub_type){case MISC_BOTTLED_EFREET:case MISC_CRYSTAL_BALL_OF_SEEING:case MISC_CRYSTAL_BALL_OF_ENERGY:case MISC_CRYSTAL_BALL_OF_FIXATION:unit_mass = 150;break;default:unit_mass = 100;break;}break;case OBJ_CORPSES:unit_mass = mons_weight( item.plus );if (item.sub_type == CORPSE_SKELETON)unit_mass /= 10;break;default:case OBJ_GOLD:unit_mass = 0;break;}return ((unit_mass > 0) ? unit_mass : 0);}// Note that this function, an item sizes in general aren't quite on the// same scale as PCs and monsters.size_type item_size( const item_def &item ){int size = SIZE_TINY;switch (item.base_type){case OBJ_WEAPONS:case OBJ_STAVES:size = Weapon_prop[ Weapon_index[item.sub_type] ].fit_size - 1;break;case OBJ_ARMOUR:size = SIZE_MEDIUM;switch (item.sub_type){case ARM_GLOVES:case ARM_HELMET:case ARM_CAP:case ARM_BOOTS:case ARM_BUCKLER:// tiny armourbreak;case ARM_SHIELD:size = SIZE_LITTLE;break;case ARM_LARGE_SHIELD:size = SIZE_SMALL;break;default: // body armours and bardingssize = SIZE_MEDIUM;break;}break;case OBJ_MISSILES:if (item.sub_type == MI_LARGE_ROCK)size = SIZE_SMALL;break;case OBJ_MISCELLANY:if (item.sub_type == MISC_PORTABLE_ALTAR_OF_NEMELEX){size = SIZE_SMALL;}break;case OBJ_CORPSES:// FIXME// size = mons_size( item.plus, PSIZE_BODY );size = SIZE_SMALL;break;default: // sundry tiny itemsbreak;}if (size < SIZE_TINY)size = SIZE_TINY;else if (size > SIZE_HUGE)size = SIZE_HUGE;return (static_cast<size_type>( size ));}// returns true if we might be interested in dumping the colourbool is_colourful_item( const item_def &item ){bool ret = false;switch (item.base_type){case OBJ_ARMOUR:if (item.sub_type == ARM_ROBE|| item.sub_type == ARM_CLOAK|| item.sub_type == ARM_CAP|| item.sub_type == ARM_NAGA_BARDING|| item.sub_type == ARM_CENTAUR_BARDING){ret = true;}break;default:break;}return (ret);}bool is_shield(const item_def &item){return item.base_type == OBJ_ARMOUR&& (item.sub_type == ARM_SHIELD|| item.sub_type == ARM_BUCKLER|| item.sub_type == ARM_LARGE_SHIELD);}// Returns true if the given item cannot be wielded with the given shield.// The currently equipped shield is used if no shield is passed in.bool is_shield_incompatible(const item_def &weapon, const item_def *shield){// If there's no shield, there's no problem.if (!shield && !(shield = player_shield()))return (false);hands_reqd_type hand = hands_reqd(weapon, player_size());return hand == HANDS_TWO&& !item_is_rod(weapon)&& !is_range_weapon(weapon);}
/* ************************************************************************ called from: beam - describe - fight - item_use - items - monstuff -* player* *********************************************************************** */int mass_item( const item_def &item );
bool item_not_ident( const item_def &item, unsigned long flags );void do_curse_item( item_def &item );void do_uncurse_item( item_def &item );void set_ident_flags( item_def &item, unsigned long flags );void unset_ident_flags( item_def &item, unsigned long flags );void set_equip_race( item_def &item, unsigned long flags );void set_equip_desc( item_def &item, unsigned long flags );unsigned long get_equip_race( const item_def &item );unsigned long get_equip_desc( const item_def &item );bool cmp_equip_race( const item_def &item, unsigned long val );bool cmp_equip_desc( const item_def &item, unsigned long val );void set_helmet_type( item_def &item, short flags );void set_helmet_desc( item_def &item, short flags );void set_helmet_random_desc( item_def &item );
/* ************************************************************************ called from: files - randart - shopping* *********************************************************************** */void make_name( unsigned char var1, unsigned char var2, unsigned char var3,char ncase, char buff[ITEMNAME_SIZE] );
int make_name( unsigned long seed, bool all_caps, char buff[ ITEMNAME_SIZE ] );
char id[4][50];int prop[4][50][3];FixedArray < int, 20, 50 > mss;
static bool is_random_name_space( char let );static bool is_random_name_vowel( char let);static const char *item_name_2(const item_def &item, char buff[ ITEMNAME_SIZE ], bool terse );
}// Some convenient functions to hide the bit operations and create// an interface layer between the code and the data in case this// gets changed again. -- bwrbool item_cursed( const item_def &item ){return (item.flags & ISFLAG_CURSED);}bool item_uncursed( const item_def &item ){return !(item.flags & ISFLAG_CURSED);}bool item_known_cursed( const item_def &item ){return ((item.flags & ISFLAG_KNOW_CURSE) && (item.flags & ISFLAG_CURSED));}bool item_known_uncursed( const item_def &item ){return ((item.flags & ISFLAG_KNOW_CURSE) && !(item.flags & ISFLAG_CURSED));}#if 0// currently unusedbool fully_identified( const item_def &item ){return ((item.flags & ISFLAG_IDENT_MASK) == ISFLAG_IDENT_MASK);
}bool item_not_ident( const item_def &item, unsigned long flags ){return ( !(item.flags & flags) );}void do_curse_item( item_def &item ){item.flags |= ISFLAG_CURSED;}void do_uncurse_item( item_def &item ){item.flags &= (~ISFLAG_CURSED);}void set_ident_flags( item_def &item, unsigned long flags ){item.flags |= flags;}void unset_ident_flags( item_def &item, unsigned long flags ){item.flags &= (~flags);}// These six functions might seem silly, but they provide a nice layer// for later changes to these systems. -- bwrunsigned long get_equip_race( const item_def &item ){return (item.flags & ISFLAG_RACIAL_MASK);}unsigned long get_equip_desc( const item_def &item ){return (item.flags & ISFLAG_COSMETIC_MASK);}bool cmp_equip_race( const item_def &item, unsigned long val ){return (get_equip_race( item ) == val);}bool cmp_equip_desc( const item_def &item, unsigned long val ){return (get_equip_desc( item ) == val);}void set_equip_race( item_def &item, unsigned long flags ){ASSERT( (flags & ~ISFLAG_RACIAL_MASK) == 0 );// first check for base-sub pairs that can't ever have racial typesswitch (item.base_type){case OBJ_WEAPONS:if (item.sub_type == WPN_GIANT_CLUB|| item.sub_type == WPN_GIANT_SPIKED_CLUB|| item.sub_type == WPN_KATANA|| item.sub_type == WPN_SLING|| item.sub_type == WPN_KNIFE|| item.sub_type == WPN_QUARTERSTAFF|| item.sub_type == WPN_DEMON_BLADE|| item.sub_type == WPN_DEMON_WHIP|| item.sub_type == WPN_DEMON_TRIDENT){return;}break;case OBJ_ARMOUR:if (item.sub_type >= ARM_DRAGON_HIDE){return;}break;case OBJ_MISSILES:if (item.sub_type == MI_STONE || item.sub_type == MI_LARGE_ROCK){return;}break;default:return;}// check that item is appropriate for racial typeswitch (flags){case ISFLAG_ELVEN:if (item.base_type == OBJ_ARMOUR&& (item.sub_type == ARM_SPLINT_MAIL|| item.sub_type == ARM_BANDED_MAIL|| item.sub_type == ARM_PLATE_MAIL)){return;}break;case ISFLAG_DWARVEN:if (item.base_type == OBJ_ARMOUR&& (item.sub_type == ARM_ROBE|| item.sub_type == ARM_LEATHER_ARMOUR)){return;}break;case ISFLAG_ORCISH:default:break;}item.flags &= ~ISFLAG_RACIAL_MASK; // delete previousitem.flags |= flags;}void set_equip_desc( item_def &item, unsigned long flags ){ASSERT( (flags & ~ISFLAG_COSMETIC_MASK) == 0 );item.flags &= ~ISFLAG_COSMETIC_MASK; // delete previousitem.flags |= flags;}short get_helmet_type( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );return (item.plus2 & THELM_TYPE_MASK);
short get_helmet_desc( const item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );return (item.plus2 & THELM_DESC_MASK);}void set_helmet_type( item_def &item, short type ){ASSERT( (type & ~THELM_TYPE_MASK) == 0 );ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );item.plus2 &= ~THELM_TYPE_MASK;item.plus2 |= type;}void set_helmet_desc( item_def &item, short type ){ASSERT( (type & ~THELM_DESC_MASK) == 0 );ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );item.plus2 &= ~THELM_DESC_MASK;item.plus2 |= type;}void set_helmet_random_desc( item_def &item ){ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );item.plus2 &= ~THELM_DESC_MASK;item.plus2 |= (random2(8) << 8);}bool cmp_helmet_type( const item_def &item, short val ){ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );return (get_helmet_type( item ) == val);}bool cmp_helmet_desc( const item_def &item, short val ){ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_HELMET );return (get_helmet_desc( item ) == val);}bool set_item_ego_type( item_def &item, int item_type, int ego_type ){if (item.base_type == item_type&& !is_random_artefact( item )&& !is_fixed_artefact( item )){item.special = ego_type;return (true);}return (false);}int get_weapon_brand( const item_def &item ){// Weapon ego types are "brands", so we do the randart lookup here.// Staves "brands" handled speciallyif (item.base_type != OBJ_WEAPONS)return (SPWPN_NORMAL);if (is_fixed_artefact( item )){switch (item.special){case SPWPN_SWORD_OF_CEREBOV:return (SPWPN_FLAMING);case SPWPN_STAFF_OF_OLGREB:return (SPWPN_VENOM);case SPWPN_VAMPIRES_TOOTH:return (SPWPN_VAMPIRICISM);default:return (SPWPN_NORMAL);}}else if (is_random_artefact( item )){return (randart_wpn_property( item, RAP_BRAND ));}return (item.special);}int get_ammo_brand( const item_def &item ){// no artefact arrows yet -- bwrif (item.base_type != OBJ_MISSILES || is_random_artefact( item ))return (SPMSL_NORMAL);return (item.special);}int get_armour_ego_type( const item_def &item ){// artefact armours have no ego type, must look up powers separatelyif (item.base_type != OBJ_ARMOUR|| (is_random_artefact( item ) && !is_unrandom_artefact( item ))){return (SPARM_NORMAL);}return (item.special);}bool item_is_rod( const item_def &item ){return (item.base_type == OBJ_STAVES&& item.sub_type >= STAFF_SMITING && item.sub_type < STAFF_AIR);}bool item_is_staff( const item_def &item ){// Isn't De Morgan's law wonderful. -- bwrreturn (item.base_type == OBJ_STAVES&& (item.sub_type < STAFF_SMITING || item.sub_type >= STAFF_AIR));}
char item_name( const item_def &item, char descrip, char buff[ ITEMNAME_SIZE ],bool terse )
// buff must be at least ITEMNAME_SIZE if non-NULL. If NULL, a static// item buffer will be used.const char *item_name( const item_def &item, char descrip,char *buff, bool terse )
char primary = item.special / 14;char secondary = item.special % 14;
int pqual = PQUAL(item.special);int pcolour = PCOLOUR(item.special);static const char *potion_qualifiers[] = {"", "bubbling ", "fuming ", "fizzy ", "viscous ", "lumpy ","smoky ", "glowing ", "sedimented ", "metallic ", "murky ","gluggy ", "oily ", "slimy ", "emulsified "};ASSERT( sizeof(potion_qualifiers) / sizeof(*potion_qualifiers)== PDQ_NQUALS );static const char *potion_colours[] = {"clear", "blue", "black", "silvery", "cyan", "purple","orange", "inky", "red", "yellow", "green", "brown", "pink","white"};ASSERT( sizeof(potion_colours) / sizeof(*potion_colours)== PDC_NCOLOURS );
strncat(buff,(primary == 0) ? "" :(primary == 1) ? "bubbling " :(primary == 2) ? "lumpy " :(primary == 3) ? "fuming " :(primary == 4) ? "smoky " :(primary == 5) ? "fizzy " :(primary == 6) ? "glowing " :(primary == 7) ? "sedimented " :(primary == 8) ? "metallic " :(primary == 9) ? "murky " :(primary == 10) ? "gluggy " :(primary == 11) ? "viscous " :(primary == 12) ? "oily " :(primary == 13) ? "slimy " :(primary == 14) ? "emulsified " : "buggy ", ITEMNAME_SIZE);
const char *qualifier =(pqual < 0 || pqual >= PDQ_NQUALS)? "bug-filled ": potion_qualifiers[pqual];
strncat(buff,(secondary == 0) ? "clear" :(secondary == 1) ? "blue" :(secondary == 2) ? "black" :(secondary == 3) ? "silvery" :(secondary == 4) ? "cyan" :(secondary == 5) ? "purple" :(secondary == 6) ? "orange" :(secondary == 7) ? "inky" :(secondary == 8) ? "red" :(secondary == 9) ? "yellow" :(secondary == 10) ? "green" :(secondary == 11) ? "brown" :(secondary == 12) ? "pink" :(secondary == 13) ? "white" : "buggy", ITEMNAME_SIZE);
const char *colour =(pcolour < 0 || pcolour >= PDC_NCOLOURS)? "bogus": potion_colours[pcolour];
else if (Options.show_uncursed&& item_not_ident( item, ISFLAG_KNOW_PLUSES ))
else if (Options.show_uncursed&& !terse&& (!ring_has_pluses(item)|| !item_ident(item, ISFLAG_KNOW_PLUSES))// If the item is worn, its curse status is known,// no need to belabour the obvious.&& get_equip_slot( &item ) == -1)
if (item_is_rod( item ) && item.sub_type != STAFF_STRIKING&& item_ident( item, ISFLAG_KNOW_TYPE )){strncat( buff, " (", ITEMNAME_SIZE );itoa( item.plus / ROD_CHARGE_MULT, tmp_quant, 10 );strncat( buff, tmp_quant, ITEMNAME_SIZE );strncat( buff, "/", ITEMNAME_SIZE );itoa( item.plus2 / ROD_CHARGE_MULT, tmp_quant, 10 );strncat( buff, tmp_quant, ITEMNAME_SIZE );strncat( buff, ")", ITEMNAME_SIZE );}
switch (item.base_type){case OBJ_ARMOUR:case OBJ_WEAPONS:case OBJ_MISSILES:return (prop[ item.base_type ][ item.sub_type ][ prop_type ]);
InvEntry *ie = dynamic_cast<InvEntry*>(me);MenuEntry *newme = new MenuEntry;std::string txt = item_name(*ie->item, DESC_PLAIN);newme->text = " " + txt;newme->quantity = 0;delete me;
case OBJ_STAVES:if (item_is_staff( item ))return (prop[ OBJ_WEAPONS ][ WPN_QUARTERSTAFF ][ prop_type ]);else if (prop_type == PWPN_SPEED) // item is rodreturn (10); // extra protection against speed 0elsereturn (0);default:return (0);}
return (newme);
int unit_mass = 0;if (item.base_type == OBJ_GOLD){unit_mass = 0;}else if (item.base_type == OBJ_CORPSES){unit_mass = mons_weight( item.plus );if (item.sub_type == CORPSE_SKELETON)unit_mass /= 2;}else{unit_mass = mss[ item.base_type ][ item.sub_type ];}return (unit_mass > 0 ? unit_mass : 0);}void init_properties(void){prop[OBJ_ARMOUR][ARM_ROBE][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_ROBE][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_ROBE] = 60;prop[OBJ_ARMOUR][ARM_LEATHER_ARMOUR][PARM_AC] = 2;prop[OBJ_ARMOUR][ARM_LEATHER_ARMOUR][PARM_EVASION] = -1;mss[OBJ_ARMOUR][ARM_LEATHER_ARMOUR] = 150;prop[OBJ_ARMOUR][ARM_RING_MAIL][PARM_AC] = 4;prop[OBJ_ARMOUR][ARM_RING_MAIL][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_RING_MAIL] = 300;prop[OBJ_ARMOUR][ARM_SCALE_MAIL][PARM_AC] = 5;prop[OBJ_ARMOUR][ARM_SCALE_MAIL][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_SCALE_MAIL] = 400;prop[OBJ_ARMOUR][ARM_CHAIN_MAIL][PARM_AC] = 6;prop[OBJ_ARMOUR][ARM_CHAIN_MAIL][PARM_EVASION] = -3;mss[OBJ_ARMOUR][ARM_CHAIN_MAIL] = 450;prop[OBJ_ARMOUR][ARM_SPLINT_MAIL][PARM_AC] = 8;prop[OBJ_ARMOUR][ARM_SPLINT_MAIL][PARM_EVASION] = -5;mss[OBJ_ARMOUR][ARM_SPLINT_MAIL] = 550;prop[OBJ_ARMOUR][ARM_BANDED_MAIL][PARM_AC] = 7;prop[OBJ_ARMOUR][ARM_BANDED_MAIL][PARM_EVASION] = -4;mss[OBJ_ARMOUR][ARM_BANDED_MAIL] = 500;prop[OBJ_ARMOUR][ARM_PLATE_MAIL][PARM_AC] = 9;prop[OBJ_ARMOUR][ARM_PLATE_MAIL][PARM_EVASION] = -5;mss[OBJ_ARMOUR][ARM_PLATE_MAIL] = 650;prop[OBJ_ARMOUR][ARM_DRAGON_HIDE][PARM_AC] = 2;prop[OBJ_ARMOUR][ARM_DRAGON_HIDE][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_DRAGON_HIDE] = 220;prop[OBJ_ARMOUR][ARM_TROLL_HIDE][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_TROLL_HIDE][PARM_EVASION] = -1;mss[OBJ_ARMOUR][ARM_TROLL_HIDE] = 180;prop[OBJ_ARMOUR][ARM_CRYSTAL_PLATE_MAIL][PARM_AC] = 16;prop[OBJ_ARMOUR][ARM_CRYSTAL_PLATE_MAIL][PARM_EVASION] = -8;mss[OBJ_ARMOUR][ARM_CRYSTAL_PLATE_MAIL] = 1200;prop[OBJ_ARMOUR][ARM_DRAGON_ARMOUR][PARM_AC] = 8;prop[OBJ_ARMOUR][ARM_DRAGON_ARMOUR][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_DRAGON_ARMOUR] = 220;prop[OBJ_ARMOUR][ARM_TROLL_LEATHER_ARMOUR][PARM_AC] = 3;prop[OBJ_ARMOUR][ARM_TROLL_LEATHER_ARMOUR][PARM_EVASION] = -1;mss[OBJ_ARMOUR][ARM_TROLL_LEATHER_ARMOUR] = 180;prop[OBJ_ARMOUR][ARM_ICE_DRAGON_HIDE][PARM_AC] = 2;prop[OBJ_ARMOUR][ARM_ICE_DRAGON_HIDE][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_ICE_DRAGON_HIDE] = 220;prop[OBJ_ARMOUR][ARM_ICE_DRAGON_ARMOUR][PARM_AC] = 9;prop[OBJ_ARMOUR][ARM_ICE_DRAGON_ARMOUR][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_ICE_DRAGON_ARMOUR] = 220;prop[OBJ_ARMOUR][ARM_STEAM_DRAGON_HIDE][PARM_AC] = 0;prop[OBJ_ARMOUR][ARM_STEAM_DRAGON_HIDE][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_STEAM_DRAGON_HIDE] = 120;prop[OBJ_ARMOUR][ARM_STEAM_DRAGON_ARMOUR][PARM_AC] = 3;prop[OBJ_ARMOUR][ARM_STEAM_DRAGON_ARMOUR][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_STEAM_DRAGON_ARMOUR] = 120;prop[OBJ_ARMOUR][ARM_MOTTLED_DRAGON_HIDE][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_MOTTLED_DRAGON_HIDE][PARM_EVASION] = -1;mss[OBJ_ARMOUR][ARM_MOTTLED_DRAGON_HIDE] = 150;prop[OBJ_ARMOUR][ARM_MOTTLED_DRAGON_ARMOUR][PARM_AC] = 5;prop[OBJ_ARMOUR][ARM_MOTTLED_DRAGON_ARMOUR][PARM_EVASION] = -1;mss[OBJ_ARMOUR][ARM_MOTTLED_DRAGON_ARMOUR] = 150;prop[OBJ_ARMOUR][ARM_STORM_DRAGON_HIDE][PARM_AC] = 2;prop[OBJ_ARMOUR][ARM_STORM_DRAGON_HIDE][PARM_EVASION] = -5;mss[OBJ_ARMOUR][ARM_STORM_DRAGON_HIDE] = 400;prop[OBJ_ARMOUR][ARM_STORM_DRAGON_ARMOUR][PARM_AC] = 10;prop[OBJ_ARMOUR][ARM_STORM_DRAGON_ARMOUR][PARM_EVASION] = -5;mss[OBJ_ARMOUR][ARM_STORM_DRAGON_ARMOUR] = 400;prop[OBJ_ARMOUR][ARM_GOLD_DRAGON_HIDE][PARM_AC] = 2;prop[OBJ_ARMOUR][ARM_GOLD_DRAGON_HIDE][PARM_EVASION] = -10;mss[OBJ_ARMOUR][ARM_GOLD_DRAGON_HIDE] = 1100;prop[OBJ_ARMOUR][ARM_GOLD_DRAGON_ARMOUR][PARM_AC] = 13;prop[OBJ_ARMOUR][ARM_GOLD_DRAGON_ARMOUR][PARM_EVASION] = -10;mss[OBJ_ARMOUR][ARM_GOLD_DRAGON_ARMOUR] = 1100;prop[OBJ_ARMOUR][ARM_ANIMAL_SKIN][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_ANIMAL_SKIN][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_ANIMAL_SKIN] = 100;prop[OBJ_ARMOUR][ARM_SWAMP_DRAGON_HIDE][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_SWAMP_DRAGON_HIDE][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_SWAMP_DRAGON_HIDE] = 200;prop[OBJ_ARMOUR][ARM_SWAMP_DRAGON_ARMOUR][PARM_AC] = 7;prop[OBJ_ARMOUR][ARM_SWAMP_DRAGON_ARMOUR][PARM_EVASION] = -2;mss[OBJ_ARMOUR][ARM_SWAMP_DRAGON_ARMOUR] = 200;prop[OBJ_ARMOUR][ARM_SHIELD][PARM_AC] = 0;prop[OBJ_ARMOUR][ARM_SHIELD][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_SHIELD] = 100;prop[OBJ_ARMOUR][ARM_CLOAK][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_CLOAK][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_CLOAK] = 20;prop[OBJ_ARMOUR][ARM_HELMET][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_HELMET][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_HELMET] = 80;prop[OBJ_ARMOUR][ARM_GLOVES][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_GLOVES][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_GLOVES] = 20;prop[OBJ_ARMOUR][ARM_BOOTS][PARM_AC] = 1;prop[OBJ_ARMOUR][ARM_BOOTS][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_BOOTS] = 40;prop[OBJ_ARMOUR][ARM_BUCKLER][PARM_AC] = 0;prop[OBJ_ARMOUR][ARM_BUCKLER][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_BUCKLER] = 50;prop[OBJ_ARMOUR][ARM_LARGE_SHIELD][PARM_AC] = 0;prop[OBJ_ARMOUR][ARM_LARGE_SHIELD][PARM_EVASION] = 0;mss[OBJ_ARMOUR][ARM_LARGE_SHIELD] = 250;
int i,j;
//jmf: made scrolls, jewellery and potions weigh less.mss[OBJ_SCROLLS][i] = 20;mss[OBJ_JEWELLERY][i] = 10;mss[OBJ_POTIONS][i] = 40;mss[OBJ_UNKNOWN_II][i] = 5; // "gems"mss[OBJ_BOOKS][i] = 70;
int idx_to_objtype[4] = { OBJ_WANDS, OBJ_SCROLLS,OBJ_JEWELLERY, OBJ_POTIONS };int idx_to_maxtype[4] = { NUM_WANDS, NUM_SCROLLS,NUM_JEWELLERY, NUM_POTIONS };
mss[OBJ_STAVES][i] = 130;mss[OBJ_ORBS][i] = 300;mss[OBJ_MISCELLANY][i] = 100;mss[OBJ_CORPSES][i] = 100;}// rods are lighter than stavesfor (i = STAFF_SMITING; i < STAFF_AIR; i++){mss[OBJ_STAVES][i] = 70;
for (i = 0; i < 4; i++) {for (j = 0; j < idx_to_maxtype[i]; j++) {if (id[i][j] == ID_KNOWN_TYPE) {item_def* ptmp = new item_def;if ( ptmp != 0 ) {ptmp->base_type = idx_to_objtype[i];ptmp->sub_type = j;ptmp->colour = 1;ptmp->quantity = 1;items.push_back(ptmp);}}}
// this is food, right?mss[OBJ_FOOD][FOOD_MEAT_RATION] = 80;mss[OBJ_FOOD][FOOD_BREAD_RATION] = 80;mss[OBJ_FOOD][FOOD_PEAR] = 20;mss[OBJ_FOOD][FOOD_APPLE] = 20;mss[OBJ_FOOD][FOOD_CHOKO] = 30;mss[OBJ_FOOD][FOOD_HONEYCOMB] = 40;mss[OBJ_FOOD][FOOD_ROYAL_JELLY] = 55;mss[OBJ_FOOD][FOOD_SNOZZCUMBER] = 50;mss[OBJ_FOOD][FOOD_PIZZA] = 40;mss[OBJ_FOOD][FOOD_APRICOT] = 15;mss[OBJ_FOOD][FOOD_ORANGE] = 20;mss[OBJ_FOOD][FOOD_BANANA] = 20;mss[OBJ_FOOD][FOOD_STRAWBERRY] = 5;mss[OBJ_FOOD][FOOD_RAMBUTAN] = 10;mss[OBJ_FOOD][FOOD_LEMON] = 20;mss[OBJ_FOOD][FOOD_GRAPE] = 5;mss[OBJ_FOOD][FOOD_SULTANA] = 3;mss[OBJ_FOOD][FOOD_LYCHEE] = 10;mss[OBJ_FOOD][FOOD_BEEF_JERKY] = 20;mss[OBJ_FOOD][FOOD_CHEESE] = 40;mss[OBJ_FOOD][FOOD_SAUSAGE] = 40;mss[OBJ_FOOD][FOOD_CHUNK] = 100;/* mss [OBJ_FOOD] [21] = 40;mss [OBJ_FOOD] [22] = 50;mss [OBJ_FOOD] [23] = 60;mss [OBJ_FOOD] [24] = 60;mss [OBJ_FOOD] [25] = 100; */mss[OBJ_MISCELLANY][MISC_BOTTLED_EFREET] = 250;mss[OBJ_MISCELLANY][MISC_CRYSTAL_BALL_OF_SEEING] = 200;mss[OBJ_MISCELLANY][MISC_CRYSTAL_BALL_OF_ENERGY] = 200;mss[OBJ_MISCELLANY][MISC_CRYSTAL_BALL_OF_FIXATION] = 200;// weapons: blunt weapons are first to help grouping them together// note: AC prop can't be 0 or less because of division.// If it's 1, makes no difference// NOTE: I have *removed* AC bit for weapons - just doesn't work// prop [x] [2] is speedprop[OBJ_WEAPONS][WPN_CLUB][PWPN_DAMAGE] = 5;prop[OBJ_WEAPONS][WPN_CLUB][PWPN_HIT] = 4; // helps to get past evasionprop[OBJ_WEAPONS][WPN_CLUB][PWPN_SPEED] = 12;mss[OBJ_WEAPONS][WPN_CLUB] = 50;prop[OBJ_WEAPONS][WPN_MACE][PWPN_DAMAGE] = 8;prop[OBJ_WEAPONS][WPN_MACE][PWPN_HIT] = 3; // helps to get past evasionprop[OBJ_WEAPONS][WPN_MACE][PWPN_SPEED] = 14;mss[OBJ_WEAPONS][WPN_MACE] = 140;prop[OBJ_WEAPONS][WPN_GREAT_MACE][PWPN_DAMAGE] = 16;prop[OBJ_WEAPONS][WPN_GREAT_MACE][PWPN_HIT] = -3;prop[OBJ_WEAPONS][WPN_GREAT_MACE][PWPN_SPEED] = 18;mss[OBJ_WEAPONS][WPN_GREAT_MACE] = 260;prop[OBJ_WEAPONS][WPN_FLAIL][PWPN_DAMAGE] = 9;prop[OBJ_WEAPONS][WPN_FLAIL][PWPN_HIT] = 2; // helps to get past evasionprop[OBJ_WEAPONS][WPN_FLAIL][PWPN_SPEED] = 15;mss[OBJ_WEAPONS][WPN_FLAIL] = 150;prop[OBJ_WEAPONS][WPN_SPIKED_FLAIL][PWPN_DAMAGE] = 12;prop[OBJ_WEAPONS][WPN_SPIKED_FLAIL][PWPN_HIT] = 1;prop[OBJ_WEAPONS][WPN_SPIKED_FLAIL][PWPN_SPEED] = 16;mss[OBJ_WEAPONS][WPN_SPIKED_FLAIL] = 170;prop[OBJ_WEAPONS][WPN_GREAT_FLAIL][PWPN_DAMAGE] = 17;prop[OBJ_WEAPONS][WPN_GREAT_FLAIL][PWPN_HIT] = -4;prop[OBJ_WEAPONS][WPN_GREAT_FLAIL][PWPN_SPEED] = 19;mss[OBJ_WEAPONS][WPN_GREAT_FLAIL] = 300;prop[OBJ_WEAPONS][WPN_DAGGER][PWPN_DAMAGE] = 3;prop[OBJ_WEAPONS][WPN_DAGGER][PWPN_HIT] = 6; // helps to get past evasionprop[OBJ_WEAPONS][WPN_DAGGER][PWPN_SPEED] = 11;mss[OBJ_WEAPONS][WPN_DAGGER] = 20;prop[OBJ_WEAPONS][WPN_KNIFE][PWPN_DAMAGE] = 2;prop[OBJ_WEAPONS][WPN_KNIFE][PWPN_HIT] = 0; // helps to get past evasionprop[OBJ_WEAPONS][WPN_KNIFE][PWPN_SPEED] = 11;mss[OBJ_WEAPONS][WPN_KNIFE] = 10;prop[OBJ_WEAPONS][WPN_MORNINGSTAR][PWPN_DAMAGE] = 10;prop[OBJ_WEAPONS][WPN_MORNINGSTAR][PWPN_HIT] = 2;prop[OBJ_WEAPONS][WPN_MORNINGSTAR][PWPN_SPEED] = 15;mss[OBJ_WEAPONS][WPN_MORNINGSTAR] = 150;prop[OBJ_WEAPONS][WPN_SHORT_SWORD][PWPN_DAMAGE] = 6;prop[OBJ_WEAPONS][WPN_SHORT_SWORD][PWPN_HIT] = 5;prop[OBJ_WEAPONS][WPN_SHORT_SWORD][PWPN_SPEED] = 12;mss[OBJ_WEAPONS][WPN_SHORT_SWORD] = 100;prop[OBJ_WEAPONS][WPN_LONG_SWORD][PWPN_DAMAGE] = 10;prop[OBJ_WEAPONS][WPN_LONG_SWORD][PWPN_HIT] = 3;prop[OBJ_WEAPONS][WPN_LONG_SWORD][PWPN_SPEED] = 14;mss[OBJ_WEAPONS][WPN_LONG_SWORD] = 160;prop[OBJ_WEAPONS][WPN_GREAT_SWORD][PWPN_DAMAGE] = 16;prop[OBJ_WEAPONS][WPN_GREAT_SWORD][PWPN_HIT] = -1;prop[OBJ_WEAPONS][WPN_GREAT_SWORD][PWPN_SPEED] = 17;mss[OBJ_WEAPONS][WPN_GREAT_SWORD] = 250;prop[OBJ_WEAPONS][WPN_FALCHION][PWPN_DAMAGE] = 8;prop[OBJ_WEAPONS][WPN_FALCHION][PWPN_HIT] = 2;prop[OBJ_WEAPONS][WPN_FALCHION][PWPN_SPEED] = 13;mss[OBJ_WEAPONS][WPN_FALCHION] = 130;prop[OBJ_WEAPONS][WPN_SCIMITAR][PWPN_DAMAGE] = 11;prop[OBJ_WEAPONS][WPN_SCIMITAR][PWPN_HIT] = 1;prop[OBJ_WEAPONS][WPN_SCIMITAR][PWPN_SPEED] = 14;mss[OBJ_WEAPONS][WPN_SCIMITAR] = 170;prop[OBJ_WEAPONS][WPN_HAND_AXE][PWPN_DAMAGE] = 7;prop[OBJ_WEAPONS][WPN_HAND_AXE][PWPN_HIT] = 2;prop[OBJ_WEAPONS][WPN_HAND_AXE][PWPN_SPEED] = 13;mss[OBJ_WEAPONS][WPN_HAND_AXE] = 110;prop[OBJ_WEAPONS][WPN_WAR_AXE][PWPN_DAMAGE] = 11;prop[OBJ_WEAPONS][WPN_WAR_AXE][PWPN_HIT] = 0;prop[OBJ_WEAPONS][WPN_WAR_AXE][PWPN_SPEED] = 16;mss[OBJ_WEAPONS][WPN_WAR_AXE] = 150;prop[OBJ_WEAPONS][WPN_BROAD_AXE][PWPN_DAMAGE] = 14;prop[OBJ_WEAPONS][WPN_BROAD_AXE][PWPN_HIT] = 1;prop[OBJ_WEAPONS][WPN_BROAD_AXE][PWPN_SPEED] = 17;mss[OBJ_WEAPONS][WPN_BROAD_AXE] = 180;prop[OBJ_WEAPONS][WPN_BATTLEAXE][PWPN_DAMAGE] = 17;prop[OBJ_WEAPONS][WPN_BATTLEAXE][PWPN_HIT] = -2;prop[OBJ_WEAPONS][WPN_BATTLEAXE][PWPN_SPEED] = 18;mss[OBJ_WEAPONS][WPN_BATTLEAXE] = 200;prop[OBJ_WEAPONS][WPN_SPEAR][PWPN_DAMAGE] = 5;prop[OBJ_WEAPONS][WPN_SPEAR][PWPN_HIT] = 3;prop[OBJ_WEAPONS][WPN_SPEAR][PWPN_SPEED] = 13;mss[OBJ_WEAPONS][WPN_SPEAR] = 50;prop[OBJ_WEAPONS][WPN_TRIDENT][PWPN_DAMAGE] = 9;prop[OBJ_WEAPONS][WPN_TRIDENT][PWPN_HIT] = -2;prop[OBJ_WEAPONS][WPN_TRIDENT][PWPN_SPEED] = 17;mss[OBJ_WEAPONS][WPN_TRIDENT] = 160;prop[OBJ_WEAPONS][WPN_DEMON_TRIDENT][PWPN_DAMAGE] = 15;prop[OBJ_WEAPONS][WPN_DEMON_TRIDENT][PWPN_HIT] = -2;prop[OBJ_WEAPONS][WPN_DEMON_TRIDENT][PWPN_SPEED] = 17;mss[OBJ_WEAPONS][WPN_DEMON_TRIDENT] = 160;prop[OBJ_WEAPONS][WPN_HALBERD][PWPN_DAMAGE] = 13;prop[OBJ_WEAPONS][WPN_HALBERD][PWPN_HIT] = -3;prop[OBJ_WEAPONS][WPN_HALBERD][PWPN_SPEED] = 19;mss[OBJ_WEAPONS][WPN_HALBERD] = 200;// sling// - the three properties are _not_ irrelevant here// - when something hits something else (either may be you)// in melee, these are used.prop[OBJ_WEAPONS][WPN_SLING][PWPN_DAMAGE] = 1;prop[OBJ_WEAPONS][WPN_SLING][PWPN_HIT] = -1;prop[OBJ_WEAPONS][WPN_SLING][PWPN_SPEED] = 11;mss[OBJ_WEAPONS][WPN_SLING] = 10;prop[OBJ_WEAPONS][WPN_BOW][PWPN_DAMAGE] = 2;prop[OBJ_WEAPONS][WPN_BOW][PWPN_HIT] = -3; // helps to get past evasionprop[OBJ_WEAPONS][WPN_BOW][PWPN_SPEED] = 11;mss[OBJ_WEAPONS][WPN_BOW] = 100;prop[OBJ_WEAPONS][WPN_BLOWGUN][PWPN_DAMAGE] = 1;prop[OBJ_WEAPONS][WPN_BLOWGUN][PWPN_HIT] = 0; // helps to get past evasionprop[OBJ_WEAPONS][WPN_BLOWGUN][PWPN_SPEED] = 10;mss[OBJ_WEAPONS][WPN_BLOWGUN] = 50;prop[OBJ_WEAPONS][WPN_CROSSBOW][PWPN_DAMAGE] = 2;prop[OBJ_WEAPONS][WPN_CROSSBOW][PWPN_HIT] = -1;prop[OBJ_WEAPONS][WPN_CROSSBOW][PWPN_SPEED] = 15;mss[OBJ_WEAPONS][WPN_CROSSBOW] = 250;prop[OBJ_WEAPONS][WPN_HAND_CROSSBOW][PWPN_DAMAGE] = 1;prop[OBJ_WEAPONS][WPN_HAND_CROSSBOW][PWPN_HIT] = -1;prop[OBJ_WEAPONS][WPN_HAND_CROSSBOW][PWPN_SPEED] = 15;mss[OBJ_WEAPONS][WPN_HAND_CROSSBOW] = 70;prop[OBJ_WEAPONS][WPN_GLAIVE][PWPN_DAMAGE] = 15;prop[OBJ_WEAPONS][WPN_GLAIVE][PWPN_HIT] = -3;prop[OBJ_WEAPONS][WPN_GLAIVE][PWPN_SPEED] = 18;mss[OBJ_WEAPONS][WPN_GLAIVE] = 200;// staff - hmmmprop[OBJ_WEAPONS][WPN_QUARTERSTAFF][PWPN_DAMAGE] = 7;prop[OBJ_WEAPONS][WPN_QUARTERSTAFF][PWPN_HIT] = 6;prop[OBJ_WEAPONS][WPN_QUARTERSTAFF][PWPN_SPEED] = 12;mss[OBJ_WEAPONS][WPN_QUARTERSTAFF] = 130;prop[OBJ_WEAPONS][WPN_SCYTHE][PWPN_DAMAGE] = 14;prop[OBJ_WEAPONS][WPN_SCYTHE][PWPN_HIT] = -4;prop[OBJ_WEAPONS][WPN_SCYTHE][PWPN_SPEED] = 22;mss[OBJ_WEAPONS][WPN_SCYTHE] = 230;// these two should have the same speed because of 2-h ogres.prop[OBJ_WEAPONS][WPN_GIANT_CLUB][PWPN_DAMAGE] = 15;prop[OBJ_WEAPONS][WPN_GIANT_CLUB][PWPN_HIT] = -5;prop[OBJ_WEAPONS][WPN_GIANT_CLUB][PWPN_SPEED] = 16;mss[OBJ_WEAPONS][WPN_GIANT_CLUB] = 750;prop[OBJ_WEAPONS][WPN_GIANT_SPIKED_CLUB][PWPN_DAMAGE] = 18;prop[OBJ_WEAPONS][WPN_GIANT_SPIKED_CLUB][PWPN_HIT] = -6;prop[OBJ_WEAPONS][WPN_GIANT_SPIKED_CLUB][PWPN_SPEED] = 17;mss[OBJ_WEAPONS][WPN_GIANT_SPIKED_CLUB] = 850;// these two should have the same speed because of 2-h ogres.prop[OBJ_WEAPONS][WPN_EVENINGSTAR][PWPN_DAMAGE] = 12;prop[OBJ_WEAPONS][WPN_EVENINGSTAR][PWPN_HIT] = 2;prop[OBJ_WEAPONS][WPN_EVENINGSTAR][PWPN_SPEED] = 15;mss[OBJ_WEAPONS][WPN_EVENINGSTAR] = 150;prop[OBJ_WEAPONS][WPN_QUICK_BLADE][PWPN_DAMAGE] = 5;prop[OBJ_WEAPONS][WPN_QUICK_BLADE][PWPN_HIT] = 6;prop[OBJ_WEAPONS][WPN_QUICK_BLADE][PWPN_SPEED] = 7;mss[OBJ_WEAPONS][WPN_QUICK_BLADE] = 100;prop[OBJ_WEAPONS][WPN_KATANA][PWPN_DAMAGE] = 13;prop[OBJ_WEAPONS][WPN_KATANA][PWPN_HIT] = 4;prop[OBJ_WEAPONS][WPN_KATANA][PWPN_SPEED] = 13;mss[OBJ_WEAPONS][WPN_KATANA] = 160;prop[OBJ_WEAPONS][WPN_EXECUTIONERS_AXE][PWPN_DAMAGE] = 20;prop[OBJ_WEAPONS][WPN_EXECUTIONERS_AXE][PWPN_HIT] = -4;prop[OBJ_WEAPONS][WPN_EXECUTIONERS_AXE][PWPN_SPEED] = 20;mss[OBJ_WEAPONS][WPN_EXECUTIONERS_AXE] = 320;prop[OBJ_WEAPONS][WPN_DOUBLE_SWORD][PWPN_DAMAGE] = 15;prop[OBJ_WEAPONS][WPN_DOUBLE_SWORD][PWPN_HIT] = 3;prop[OBJ_WEAPONS][WPN_DOUBLE_SWORD][PWPN_SPEED] = 16;mss[OBJ_WEAPONS][WPN_DOUBLE_SWORD] = 220;prop[OBJ_WEAPONS][WPN_TRIPLE_SWORD][PWPN_DAMAGE] = 19;prop[OBJ_WEAPONS][WPN_TRIPLE_SWORD][PWPN_HIT] = -1;prop[OBJ_WEAPONS][WPN_TRIPLE_SWORD][PWPN_SPEED] = 19;mss[OBJ_WEAPONS][WPN_TRIPLE_SWORD] = 300;prop[OBJ_WEAPONS][WPN_HAMMER][PWPN_DAMAGE] = 7;prop[OBJ_WEAPONS][WPN_HAMMER][PWPN_HIT] = 2;prop[OBJ_WEAPONS][WPN_HAMMER][PWPN_SPEED] = 13;mss[OBJ_WEAPONS][WPN_HAMMER] = 130;prop[OBJ_WEAPONS][WPN_ANCUS][PWPN_DAMAGE] = 9;prop[OBJ_WEAPONS][WPN_ANCUS][PWPN_HIT] = 1;prop[OBJ_WEAPONS][WPN_ANCUS][PWPN_SPEED] = 14;mss[OBJ_WEAPONS][WPN_ANCUS] = 160;prop[OBJ_WEAPONS][WPN_WHIP][PWPN_DAMAGE] = 3;prop[OBJ_WEAPONS][WPN_WHIP][PWPN_HIT] = 1; // helps to get past evasionprop[OBJ_WEAPONS][WPN_WHIP][PWPN_SPEED] = 14;mss[OBJ_WEAPONS][WPN_WHIP] = 30;prop[OBJ_WEAPONS][WPN_SABRE][PWPN_DAMAGE] = 7;prop[OBJ_WEAPONS][WPN_SABRE][PWPN_HIT] = 4;prop[OBJ_WEAPONS][WPN_SABRE][PWPN_SPEED] = 12;mss[OBJ_WEAPONS][WPN_SABRE] = 110;prop[OBJ_WEAPONS][WPN_DEMON_BLADE][PWPN_DAMAGE] = 13;prop[OBJ_WEAPONS][WPN_DEMON_BLADE][PWPN_HIT] = 2;prop[OBJ_WEAPONS][WPN_DEMON_BLADE][PWPN_SPEED] = 15;mss[OBJ_WEAPONS][WPN_DEMON_BLADE] = 200;prop[OBJ_WEAPONS][WPN_DEMON_WHIP][PWPN_DAMAGE] = 10;prop[OBJ_WEAPONS][WPN_DEMON_WHIP][PWPN_HIT] = 1;prop[OBJ_WEAPONS][WPN_DEMON_WHIP][PWPN_SPEED] = 14;mss[OBJ_WEAPONS][WPN_DEMON_WHIP] = 30;
prop[OBJ_MISSILES][MI_ARROW][PWPN_DAMAGE] = 2;prop[OBJ_MISSILES][MI_ARROW][PWPN_HIT] = 6;mss[OBJ_MISSILES][MI_ARROW] = 10;
// Used for: Pandemonium demonlords, shopkeepers, scrolls, random artefactsint make_name( unsigned long seed, bool all_cap, char buff[ ITEMNAME_SIZE ] ){char name[ITEMNAME_SIZE];int numb[17];
prop[OBJ_MISSILES][MI_DART][PWPN_DAMAGE] = 2;prop[OBJ_MISSILES][MI_DART][PWPN_HIT] = 4; //whatever - for hand crossbowmss[OBJ_MISSILES][MI_DART] = 5;
const int var1 = (seed & 0xFF);const int var2 = ((seed >> 8) & 0xFF);const int var3 = ((seed >> 16) & 0xFF);const int var4 = ((seed >> 24) & 0xFF);
// large rockprop[OBJ_MISSILES][MI_LARGE_ROCK][PWPN_DAMAGE] = 20;prop[OBJ_MISSILES][MI_LARGE_ROCK][PWPN_HIT] = 10;mss[OBJ_MISSILES][MI_LARGE_ROCK] = 1000;}
numb[0] = 373 * var1 + 409 * var2 + 281 * var3;numb[1] = 163 * var4 + 277 * var2 + 317 * var3;numb[2] = 257 * var1 + 179 * var4 + 83 * var3;numb[3] = 61 * var1 + 229 * var2 + 241 * var4;numb[4] = 79 * var1 + 263 * var2 + 149 * var3;numb[5] = 233 * var4 + 383 * var2 + 311 * var3;numb[6] = 199 * var1 + 211 * var4 + 103 * var3;numb[7] = 139 * var1 + 109 * var2 + 349 * var4;numb[8] = 43 * var1 + 389 * var2 + 359 * var3;numb[9] = 367 * var4 + 101 * var2 + 251 * var3;numb[10] = 293 * var1 + 59 * var4 + 151 * var3;numb[11] = 331 * var1 + 107 * var2 + 307 * var4;numb[12] = 73 * var1 + 157 * var2 + 347 * var3;numb[13] = 379 * var4 + 353 * var2 + 227 * var3;numb[14] = 181 * var1 + 173 * var4 + 193 * var3;numb[15] = 131 * var1 + 167 * var2 + 53 * var4;numb[16] = 313 * var1 + 127 * var2 + 401 * var3 + 337 * var4;
if (inv_count == 0){cprintf("You don't recognise anything yet!");if (getch() == 0)getch();goto putty;}textcolor(BLUE);cprintf(" You recognise:");textcolor(LIGHTGREY);lines++;for (i = 0; i < 4; i++){switch (i)
if (!has_space && i > 5 && i < len - 4&& (numb[(k + 10 * j) % 17] % 5) != 3)
case IDTYPE_WANDS:ft = OBJ_WANDS;max = NUM_WANDS;break;case IDTYPE_SCROLLS:ft = OBJ_SCROLLS;max = NUM_SCROLLS;break;case IDTYPE_JEWELLERY:ft = OBJ_JEWELLERY;max = NUM_JEWELLERY;break;case IDTYPE_POTIONS:ft = OBJ_POTIONS;max = NUM_POTIONS;break;
want_vowel = true;name[i] = ' ';
if (ki >= 'A' && ki <= 'z')
else if (len < 7|| i <= 2 || i >= len - 3|| is_random_name_space( name[i - 1] )|| (i > 1 && is_random_name_space( name[i - 2] ))|| (i > 2&& !is_random_name_vowel( name[i - 1] )&& !is_random_name_vowel( name[i - 2] )))
anything++;if (lines > 0)cprintf(EOL);lines++;cprintf(" ");yps = wherey();// item_name now requires a "real" item, so we'll create a tmpitem_def tmp;// = { ft, j, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };tmp.base_type = ft;tmp.sub_type = j;tmp.colour = 1;item_name( tmp, DESC_PLAIN, st_pass );cprintf(st_pass);inv_count--;if (wherey() != yps)lines++;
i--;continue;
if (ki == 0)ki = getch();#ifdef DOS_TERMputtext(35, 1, 80, 25, buffer);#endifreturn anything;}putty:#ifdef DOS_TERMputtext(35, 1, 80, 25, buffer);#endifreturn ki;} // end check_item_knowledge()// must be certain that you are passing the subtype// to an OBJ_ARMOUR and nothing else, or as they say,// "Bad Things Will Happen" {dlb}:bool hide2armour( unsigned char *which_subtype ){switch (*which_subtype){case ARM_DRAGON_HIDE:*which_subtype = ARM_DRAGON_ARMOUR;return true;case ARM_TROLL_HIDE:*which_subtype = ARM_TROLL_LEATHER_ARMOUR;return true;case ARM_ICE_DRAGON_HIDE:*which_subtype = ARM_ICE_DRAGON_ARMOUR;return true;case ARM_MOTTLED_DRAGON_HIDE:*which_subtype = ARM_MOTTLED_DRAGON_ARMOUR;return true;case ARM_STORM_DRAGON_HIDE:*which_subtype = ARM_STORM_DRAGON_ARMOUR;return true;case ARM_GOLD_DRAGON_HIDE:*which_subtype = ARM_GOLD_DRAGON_ARMOUR;return true;case ARM_SWAMP_DRAGON_HIDE:*which_subtype = ARM_SWAMP_DRAGON_ARMOUR;return true;case ARM_STEAM_DRAGON_HIDE:*which_subtype = ARM_STEAM_DRAGON_ARMOUR;return true;default:return false;}} // end hide2armour()void make_name(unsigned char var1, unsigned char var2, unsigned char var3,char ncase, char buff[ITEMNAME_SIZE]){char name[ ITEMNAME_SIZE ] = "";FixedVector < unsigned char, 15 > numb;int len;int i = 0;int nexty = 0;int j = 0;int x = 0;numb[0] = var1 * var2;numb[1] = var1 * var3;numb[2] = var2 * var3;numb[3] = var1 * var2 * var3;numb[4] = var1 + var2;numb[5] = var2 + var3;numb[6] = var1 * var2 + var3;numb[7] = var1 * var3 + var2;numb[8] = var2 * var3 + var1;numb[9] = var1 * var2 * var3 - var1;numb[10] = var1 + var2 + var2;numb[11] = var2 + var3 * var1;numb[12] = var1 * var2 * var3;numb[13] = var1 * var3 * var1;numb[14] = var2 * var3 * var3;for (i = 0; i < 15; i++){while (numb[i] >= 25)
else
numb[i] -= 25;}}
if ((len > 3 || i != 0)&& (numb[(k + 13 * j) % 17] % 7) <= 1&& (i < len - 2 || (i > 0 && !is_random_name_space(name[i - 1])))){const bool beg = ((i < 1) || is_random_name_space(name[i - 1]));const bool end = (i >= len - 2);
while (len > 14){len -= 8;}nexty = retbit(numb[4]);char k = 0;j = 0;for (i = 0; i < len; i++){j++;if (j >= 15){j = 0;k++;if (k > 9)break;}if (nexty == 1 || (i > 0 && !is_random_name_vowel(name[i]))){name[i] = retvow(numb[j]);if ((i == 0 || i == len - 1) && name[i] == 32)
switch (numb[(k + 11 * j) % 17] % num + first){// start, middlecase 0: strcat(name, "kl"); break;case 1: strcat(name, "gr"); break;case 2: strcat(name, "cl"); break;case 3: strcat(name, "cr"); break;case 4: strcat(name, "fr"); break;case 5: strcat(name, "pr"); break;case 6: strcat(name, "tr"); break;case 7: strcat(name, "tw"); break;case 8: strcat(name, "br"); break;case 9: strcat(name, "pl"); break;case 10: strcat(name, "bl"); break;case 11: strcat(name, "str"); i++; len++; break;case 12: strcat(name, "shr"); i++; len++; break;case 13: strcat(name, "thr"); i++; len++; break;// start, middle, endcase 14: strcat(name, "sm"); break;case 15: strcat(name, "sh"); break;case 16: strcat(name, "ch"); break;case 17: strcat(name, "th"); break;case 18: strcat(name, "ph"); break;case 19: strcat(name, "pn"); break;case 20: strcat(name, "kh"); break;case 21: strcat(name, "gh"); break;case 22: strcat(name, "mn"); break;case 23: strcat(name, "ps"); break;case 24: strcat(name, "st"); break;case 25: strcat(name, "sk"); break;case 26: strcat(name, "sch"); i++; len++; break;// middle, endcase 27: strcat(name, "ts"); break;case 28: strcat(name, "cs"); break;case 29: strcat(name, "xt"); break;case 30: strcat(name, "nt"); break;case 31: strcat(name, "ll"); break;case 32: strcat(name, "rr"); break;case 33: strcat(name, "ss"); break;case 34: strcat(name, "wk"); break;case 35: strcat(name, "wn"); break;case 36: strcat(name, "ng"); break;case 37: strcat(name, "cw"); break;case 38: strcat(name, "mp"); break;case 39: strcat(name, "ck"); break;case 40: strcat(name, "nk"); break;case 41: strcat(name, "dd"); break;case 42: strcat(name, "tt"); break;case 43: strcat(name, "bb"); break;case 44: strcat(name, "pp"); break;case 45: strcat(name, "nn"); break;case 46: strcat(name, "mm"); break;case 47: strcat(name, "kk"); break;case 48: strcat(name, "gg"); break;case 49: strcat(name, "ff"); break;case 50: strcat(name, "pt"); break;case 51: strcat(name, "tz"); break;case 52: strcat(name, "dgh"); i++; len++; break;case 53: strcat(name, "rgh"); i++; len++; break;case 54: strcat(name, "rph"); i++; len++; break;case 55: strcat(name, "rch"); i++; len++; break;// middle onlycase 56: strcat(name, "cz"); break;case 57: strcat(name, "xk"); break;case 58: strcat(name, "zx"); break;case 59: strcat(name, "xz"); break;case 60: strcat(name, "cv"); break;case 61: strcat(name, "vv"); break;case 62: strcat(name, "nl"); break;case 63: strcat(name, "rh"); break;case 64: strcat(name, "dw"); break;case 65: strcat(name, "nw"); break;case 66: strcat(name, "khl"); i++; len++; break;default:i--;break;}}else
}if (name[i] != 32 && name[i] < 30)name[i] += 65;if (name[i] > 96)name[i] -= 32;}break;case 3:for (i = 0; i < len + 0; i++){if (i != 0 && name[i] >= 65 && name[i] < 97){if (name[i - 1] == 32)name[i] += 32;}if (name[i] > 97)
else
if (name[i] < 30){if (i == 0 || (name[i] != 32 && name[i - 1] == 32))name[i] += 65;elsename[i] += 97;}}break;case 0:for (i = 0; i < len; i++){if (name[i] != 32 && name[i] < 30)name[i] += 97;}break;case 1:name[i] += 65;for (i = 1; i < len; i++){if (name[i] != 32 && name[i] < 30)name[i] += 97; //97;
case 0:strcat(name, "sh");break;case 1:strcat(name, "ch");break;case 2:strcat(name, "tz");break;case 3:strcat(name, "ts");break;case 4:strcat(name, "cs");break;case 5:strcat(name, "cz");break;case 6:strcat(name, "xt");break;case 7:strcat(name, "xk");break;case 8:strcat(name, "kl");break;case 9:strcat(name, "cl");break;case 10:strcat(name, "fr");break;case 11:strcat(name, "sh");break;case 12:strcat(name, "ch");break;case 13:strcat(name, "gh");break;case 14:strcat(name, "pr");break;case 15:strcat(name, "tr");break;case 16:strcat(name, "mn");break;case 17:strcat(name, "ph");break;case 18:strcat(name, "pn");break;case 19:strcat(name, "cv");break;case 20:strcat(name, "zx");break;case 21:strcat(name, "xz");break;case 23:strcat(name, "dd");break;case 24:strcat(name, "tt");break;case 25:strcat(name, "ll");break;//case 26: strcat(name, "sh"); break;//case 12: strcat(name, "sh"); break;//case 13: strcat(name, "sh"); break;default:i--;goto hello;
if (all_cap || i == 0 || buff[i - 1] == ' ')buff[i] = toupper( buff[i] );
switch (sed){case 0:return 0;case 1:return 4;case 2:return 8;case 3:return 14;case 4:return 20;case 5:return 24;case 6:return 32;}
bool is_interesting_item( const item_def& item ) {if ( is_random_artefact(item) ||is_unrandom_artefact(item) ||is_fixed_artefact(item) )return true;
return 0;} // end retvow()
char name[ITEMNAME_SIZE];item_name(item, DESC_PLAIN, name, false);std::string iname(name);for (unsigned i = 0; i < Options.note_items.size(); ++i)if (Options.note_items[i].matches(iname))return true;return false;}
char retbit(char sed){return (sed % 2);} // end retbit()
bool fully_identified( const item_def& item ) {long flagset = ISFLAG_IDENT_MASK;switch ( item.base_type ) {case OBJ_BOOKS:case OBJ_MISCELLANY:case OBJ_ORBS:case OBJ_SCROLLS:case OBJ_POTIONS:flagset = ISFLAG_KNOW_TYPE;break;case OBJ_FOOD:flagset = 0;break;case OBJ_WANDS:flagset = (ISFLAG_KNOW_TYPE | ISFLAG_KNOW_PLUSES);break;case OBJ_JEWELLERY:flagset = (ISFLAG_KNOW_CURSE | ISFLAG_KNOW_TYPE);if ( ring_has_pluses(item) )flagset |= ISFLAG_KNOW_PLUSES;break;default:break;}if ( is_random_artefact(item) ||is_fixed_artefact(item) ||is_unrandom_artefact(item) )flagset |= ISFLAG_KNOW_PROPERTIES;return item_ident( item, flagset );}
int armour_equip_slot(const item_def &item);
bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target = NULL);void inscribe_item();int launcher_shield_slowdown(const item_def &launcher,const item_def *shield);int launcher_final_speed(const item_def &launcher,const item_def *shield);
if (weapon.base_type != OBJ_WEAPONS && weapon.base_type == OBJ_STAVES&& you.equip[EQ_SHIELD] != -1)return false;
// If we don't have an actual weapon to check, return now.if (!weapon)return (true);for (int i = EQ_CLOAK; i <= EQ_AMULET; i++){if (you.equip[i] != -1 && &you.inv[you.equip[i]] == weapon){SAY(mpr("You are wearing that object!"));return (false);}}if (is_shield_incompatible(*weapon)){SAY(mpr("You can't wield that with a shield."));return (false);}// We don't have to check explicitly for staves - all staves are wieldable// by everyone.if (weapon->base_type != OBJ_WEAPONS)return (true);
&& (weapon.sub_type == WPN_GREAT_SWORD|| weapon.sub_type == WPN_TRIPLE_SWORD|| weapon.sub_type == WPN_GREAT_MACE|| weapon.sub_type == WPN_GREAT_FLAIL|| weapon.sub_type == WPN_BATTLEAXE|| weapon.sub_type == WPN_EXECUTIONERS_AXE|| weapon.sub_type == WPN_HALBERD|| weapon.sub_type == WPN_GLAIVE|| weapon.sub_type == WPN_GIANT_CLUB|| weapon.sub_type == WPN_GIANT_SPIKED_CLUB|| weapon.sub_type == WPN_SCYTHE))
&& (weapon->sub_type == WPN_GREAT_SWORD|| weapon->sub_type == WPN_TRIPLE_SWORD|| weapon->sub_type == WPN_GREAT_MACE|| weapon->sub_type == WPN_DIRE_FLAIL|| weapon->sub_type == WPN_BATTLEAXE|| weapon->sub_type == WPN_EXECUTIONERS_AXE|| weapon->sub_type == WPN_LOCHABER_AXE|| weapon->sub_type == WPN_HALBERD|| weapon->sub_type == WPN_GLAIVE|| weapon->sub_type == WPN_GIANT_CLUB|| weapon->sub_type == WPN_GIANT_SPIKED_CLUB|| weapon->sub_type == WPN_LONGBOW|| weapon->sub_type == WPN_SCYTHE)){SAY(mpr("That's too large for you to wield."));
}if (you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE){if (!can_equip( EQ_WEAPON )){mpr("You can't wield anything in your present form.");return (false);}
if (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS&& item_cursed( you.inv[you.equip[EQ_WEAPON]] )){mpr("You can't unwield your weapon to draw a new one!");
// Any general reasons why we can't wield a new object?if (!can_wield(NULL, true))
}for (int i = EQ_CLOAK; i <= EQ_AMULET; i++){if (item_slot == you.equip[i]){mpr("You are wearing that object!");return (false);}}if (you.inv[item_slot].base_type != OBJ_WEAPONS){if (you.inv[item_slot].base_type == OBJ_STAVES&& you.equip[EQ_SHIELD] != -1){mpr("You can't wield that with a shield.");return (false);}if (you.equip[EQ_WEAPON] != -1)unwield_item(you.equip[EQ_WEAPON]);you.equip[EQ_WEAPON] = item_slot;
else{if ((you.species < SP_OGRE || you.species > SP_OGRE_MAGE)&& mass_item( you.inv[item_slot] ) >= 500){mpr("That's too large and heavy for you to wield.");return (false);}
&& (you.inv[item_slot].sub_type == WPN_GREAT_SWORD|| you.inv[item_slot].sub_type == WPN_TRIPLE_SWORD|| you.inv[item_slot].sub_type == WPN_GREAT_MACE|| you.inv[item_slot].sub_type == WPN_GREAT_FLAIL|| you.inv[item_slot].sub_type == WPN_BATTLEAXE|| you.inv[item_slot].sub_type == WPN_EXECUTIONERS_AXE|| you.inv[item_slot].sub_type == WPN_HALBERD|| you.inv[item_slot].sub_type == WPN_GLAIVE|| you.inv[item_slot].sub_type == WPN_GIANT_CLUB|| you.inv[item_slot].sub_type == WPN_GIANT_SPIKED_CLUB|| you.inv[item_slot].sub_type == WPN_SCYTHE)){mpr("That's too large for you to wield.");return (false);
// Go ahead and wield the weapon.if (you.equip[EQ_WEAPON] != -1)unwield_item(you.equip[EQ_WEAPON], show_weff_messages);
if (hands_reqd_for_weapon( you.inv[item_slot].base_type,you.inv[item_slot].sub_type ) == HANDS_TWO_HANDED&& you.equip[EQ_SHIELD] != -1){mpr("You can't wield that with a shield.");return (false);}int weap_brand = get_weapon_brand( you.inv[item_slot] );if ((you.is_undead || you.species == SP_DEMONSPAWN)&& (!is_fixed_artefact( you.inv[item_slot] )&& (weap_brand == SPWPN_HOLY_WRATH|| weap_brand == SPWPN_DISRUPTION))){mpr("This weapon will not allow you to wield it.");you.turn_is_over = 1;return (false);}if (you.equip[EQ_WEAPON] != -1)unwield_item(you.equip[EQ_WEAPON]);you.equip[EQ_WEAPON] = item_slot;}
}static const char *shield_base_name(const item_def *shield){return (shield->sub_type == ARM_BUCKLER? "buckler": "shield");}static const char *shield_impact_degree(int impact){return (impact > 160? "severely " :impact > 130? "significantly " :impact > 110? "" :NULL);}static void warn_rod_shield_interference(const item_def &){const int leakage = rod_shield_leakage();const char *leak_degree = shield_impact_degree(leakage);// Any way to avoid the double entendre? :-)if (leak_degree)mprf(MSGCH_WARN,"Your %s %sreduces the effectiveness of your rod.",shield_base_name(player_shield()),leak_degree);}static void warn_launcher_shield_slowdown(const item_def &launcher){const int slowspeed =launcher_final_speed(launcher, player_shield()) * player_speed() / 100;const int normspeed =launcher_final_speed(launcher, NULL) * player_speed() / 100;// Don't warn the player unless the slowdown is real.if (slowspeed > normspeed){const char *slow_degree =shield_impact_degree(slowspeed * 100 / normspeed);if (slow_degree)mprf(MSGCH_WARN,"Your %s %sslows your rate of fire.",shield_base_name(player_shield()),slow_degree);}}// Warn if your shield is greatly impacting the effectiveness of your weapon?void warn_shield_penalties(){if (!player_shield())return;// Warnings are limited to rods and bows at the moment.const item_def *weapon = player_weapon();if (!weapon)return;if (item_is_rod(*weapon))warn_rod_shield_interference(*weapon);else if (is_range_weapon(*weapon))warn_launcher_shield_slowdown(*weapon);
switch (item.sub_type){case ARM_BUCKLER:case ARM_LARGE_SHIELD:case ARM_SHIELD:wh_equip = EQ_SHIELD;break;case ARM_CLOAK:wh_equip = EQ_CLOAK;break;case ARM_HELMET:wh_equip = EQ_HELMET;break;case ARM_GLOVES:wh_equip = EQ_GLOVES;break;case ARM_BOOTS:wh_equip = EQ_BOOTS;break;}return (wh_equip);
if (delay < 1)delay = 1;return (delay);
&& (you.inv[item].sub_type == ARM_SHIELD|| you.inv[item].sub_type == ARM_BUCKLER|| you.inv[item].sub_type == ARM_LARGE_SHIELD)// weapon is two-handed&& hands_reqd_for_weapon(you.inv[you.equip[EQ_WEAPON]].base_type,you.inv[you.equip[EQ_WEAPON]].sub_type) == HANDS_TWO_HANDED)
&& is_shield(you.inv[item])&& is_shield_incompatible(you.inv[you.equip[EQ_WEAPON]],&you.inv[item]))
else if (you.inv[item].sub_type == ARM_HELMET&& (cmp_helmet_type( you.inv[item], THELM_CAP )|| cmp_helmet_type( you.inv[item], THELM_WIZARD_HAT )))
else if (sub_type == ARM_HELMET&& (get_helmet_type(invitem) == THELM_CAP|| get_helmet_type(invitem) == THELM_WIZARD_HAT))
if ((you.inv[item].sub_type >= ARM_LEATHER_ARMOUR&& you.inv[item].sub_type <= ARM_PLATE_MAIL)|| (you.inv[item].sub_type >= ARM_GLOVES&& you.inv[item].sub_type <= ARM_BUCKLER)|| you.inv[item].sub_type == ARM_CRYSTAL_PLATE_MAIL|| (you.inv[item].sub_type == ARM_HELMET&& (cmp_helmet_type( you.inv[item], THELM_HELM )|| cmp_helmet_type( you.inv[item], THELM_HELMET ))))
if ((sub_type >= ARM_LEATHER_ARMOUR&& sub_type <= ARM_PLATE_MAIL)|| (sub_type >= ARM_GLOVES&& sub_type <= ARM_BUCKLER)|| sub_type == ARM_CRYSTAL_PLATE_MAIL|| (sub_type == ARM_HELMET&& (get_helmet_type(invitem) == THELM_HELM|| get_helmet_type(invitem) == THELM_HELMET)))
if ((you.inv[item].sub_type >= ARM_LEATHER_ARMOUR&& you.inv[item].sub_type <= ARM_PLATE_MAIL)|| you.inv[item].sub_type == ARM_GLOVES|| you.inv[item].sub_type == ARM_BOOTS|| you.inv[item].sub_type == ARM_SHIELD|| you.inv[item].sub_type == ARM_LARGE_SHIELD|| you.inv[item].sub_type == ARM_CRYSTAL_PLATE_MAIL|| (you.inv[item].sub_type == ARM_HELMET&& (cmp_helmet_type( you.inv[item], THELM_HELM )|| cmp_helmet_type( you.inv[item], THELM_HELMET ))))
if ((sub_type >= ARM_LEATHER_ARMOUR&& sub_type <= ARM_PLATE_MAIL)|| sub_type == ARM_GLOVES|| sub_type == ARM_BOOTS|| sub_type == ARM_SHIELD|| sub_type == ARM_LARGE_SHIELD|| sub_type == ARM_CRYSTAL_PLATE_MAIL|| (sub_type == ARM_HELMET&& (get_helmet_type(invitem) == THELM_HELM|| get_helmet_type(invitem) == THELM_HELMET)))
// Returns delay multiplier numerator (denominator should be 100) for the// launcher with the currently equipped shield.int launcher_shield_slowdown(const item_def &launcher, const item_def *shield){int speed_adjust = 100;if (!shield)return (speed_adjust);const int shield_type = shield->sub_type;hands_reqd_type hands = hands_reqd(launcher, player_size());switch (hands){default:case HANDS_ONE:case HANDS_HALF:speed_adjust = shield_type == ARM_BUCKLER ? 105 :shield_type == ARM_SHIELD ? 125 :150;break;case HANDS_TWO:speed_adjust = shield_type == ARM_BUCKLER ? 125 :shield_type == ARM_SHIELD ? 150 :200;break;}// Adjust for shields skill.if (speed_adjust > 100)speed_adjust -= ((speed_adjust - 100) * 5 / 10)* you.skills[SK_SHIELDS] / 27;return (speed_adjust);}// Returns the attack cost of using the launcher, taking skill and shields// into consideration. NOTE: You must pass in the shield; if you send in// NULL, this function assumes no shield is in use.int launcher_final_speed(const item_def &launcher, const item_def *shield){const int str_weight = weapon_str_weight( launcher );const int dex_weight = 10 - str_weight;const skill_type launcher_skill = range_skill( launcher );const int shoot_skill = you.skills[launcher_skill];const int bow_brand = get_weapon_brand( launcher );int speed_base = 10 * property( launcher, PWPN_SPEED );int speed_min = 70;int speed_stat = str_weight * you.strength + dex_weight * you.dex;// Reduce runaway bow overpoweredness.if (launcher_skill == SK_BOWS)speed_min = 60;if (shield){const int speed_adjust = launcher_shield_slowdown(launcher, shield);// Shields also reduce the speed cap.speed_base = speed_base * speed_adjust / 100;speed_min = speed_min * speed_adjust / 100;}int speed = speed_base - 4 * shoot_skill * speed_stat / 250;if (speed < speed_min)speed = speed_min;if (bow_brand == SPWPN_SPEED){// Speed nerf as per 4.1. Even with the nerf, bows of speed are the// best bows, bar none.speed = 2 * speed / 3;}return (speed);}// Determines if the end result of the combined launcher + ammo brands a// fire/frost beam.bool elemental_missile_beam(int launcher_brand, int ammo_brand){int element = (launcher_brand == SPWPN_FROST)+ (ammo_brand == SPMSL_ICE)- (launcher_brand == SPWPN_FLAME)- (ammo_brand == SPMSL_FLAME);return (element);}
static void throw_it(struct bolt &pbolt, int throw_2)
// Note: If dummy_target is non-NULL, throw_it fakes a bolt and calls// affect() on the monster's square.//// Return value is only relevant if dummy_target is non-NULL, and returns// true if dummy_target is hit.bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target)
// Making a copy of the item: changed only for venom launchersitem_def item = you.inv[throw_2];item.quantity = 1;item.slot = index_to_letter(item.link);origin_set_unknown(item);char str_pass[ ITEMNAME_SIZE ];mpr( STD_DIRECTION_PROMPT, MSGCH_PROMPT );message_current_target();
int slayDam = 0;
direction( thr, DIR_NONE, TARG_ENEMY );
if (dummy_target){thr.isValid = true;thr.isCancel = false;thr.tx = dummy_target->x;thr.ty = dummy_target->y;}else{mpr( STD_DIRECTION_PROMPT, MSGCH_PROMPT );message_current_target();direction( thr, DIR_NONE, TARG_ENEMY );}
return;
return (false);}// Must unwield before fire_beam() makes a copy in order to remove things// like temporary branding. -- bwrif (throw_2 == you.equip[EQ_WEAPON] && you.inv[throw_2].quantity == 1){unwield_item( throw_2 );you.equip[EQ_WEAPON] = -1;canned_msg( MSG_EMPTY_HANDED );
const int rc_skill = you.skills[SK_RANGED_COMBAT];const int item_base_dam = property( item, PWPN_DAMAGE );const int lnch_base_dam = property( launcher, PWPN_DAMAGE );const skill_type launcher_skill = range_skill( launcher );baseHit = property( launcher, PWPN_HIT );baseDam = lnch_base_dam + random2(1 + item_base_dam);// Slings are terribly weakened otherwiseif (lnch_base_dam == 0)baseDam = item_base_dam;
// this is deliberately confusing: the 'hit' value for// ammo is the _damage_ when used with a launcher. Geez.baseHit = 0;baseDam = property( item, PWPN_HIT );
// If we've a zero base damage + an elemental brand, up the damage// slightly so the brand has something to work with. This should// only apply to needles.if (!baseDam && elemental_missile_beam(bow_brand, ammo_brand))baseDam = 4;// [dshaligram] This is a horrible hack - we force beam.cc to consider// this beam "needle-like".if (wepClass == OBJ_MISSILES && wepType == MI_NEEDLE)pbolt.ench_power = AUTOMATIC_HIT;#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS,"Base hit == %d; Base damage == %d ""(item %d + launcher %d)",baseHit, baseDam,item_base_dam, lnch_base_dam);#endif
if (you.inv[you.equip[EQ_WEAPON]].sub_type == WPN_CROSSBOW){// extra time taken, as a percentage. range from 30 -> 12int extraTime = 30 - ((you.skills[SK_CROSSBOWS] * 2) / 3);
// [dshaligram] Throwing now two parts launcher skill, one part// ranged combat. Removed the old model which is... silly.shoot_skill = you.skills[launcher_skill];effSkill = (shoot_skill * 2 + rc_skill) / 3;
you.time_taken = (100 + extraTime) * you.time_taken;you.time_taken /= 100;}
const int speed = launcher_final_speed(launcher, player_shield());#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Final launcher speed: %d", speed);#endifyou.time_taken = speed * you.time_taken / 100;
// for all launched weapons, maximum effective specific skill// is twice throwing skill. This models the fact that no matter// how 'good' you are with a bow, if you know nothing about// trajectories you're going to be a damn poor bowman. Ditto// for crossbows and slings.switch (lnchType){case WPN_SLING:shoot_skill = you.skills[SK_SLINGS];break;case WPN_BOW:shoot_skill = you.skills[SK_BOWS];break;case WPN_BLOWGUN:shoot_skill = you.skills[SK_DARTS];break;case WPN_CROSSBOW:case WPN_HAND_CROSSBOW:shoot_skill = you.skills[SK_CROSSBOWS];break;default:shoot_skill = 0;break;}
// [dshaligram] Improving missile weapons:// - Remove the strength/enchantment cap where you need to be strong// to exploit a launcher bonus.// - Add on launcher and missile pluses to extra damage.
effSkill = you.skills[SK_THROWING] * 2 + 1;effSkill = (shoot_skill > effSkill) ? effSkill : shoot_skill;
// [dshaligram] This can get large...exDamBonus = lnchDamBonus + random2(1 + ammoDamBonus);exDamBonus = exDamBonus > 0? random2(exDamBonus + 1): -random2(-exDamBonus + 1);exHitBonus = lnchHitBonus > 0? random2(lnchHitBonus + 1): -random2(-lnchHitBonus + 1);
// capif (exDamBonus > (lnchDamBonus + 1) * 3)exDamBonus = (lnchDamBonus + 1) * 3;
// cap; reduced this cap, because we don't want to allow// the extremely-strong to quadruple the enchantment bonus.if (strbonus > lnchDamBonus + 1)strbonus = lnchDamBonus + 1;exDamBonus += strbonus;
baseHit += 2;exHitBonus = (3 * effSkill) / 2 + 6;exDamBonus = effSkill / 2 + 4;
baseHit++;exHitBonus += (3 * effSkill) / 2 + 6;// exDamBonus += effSkill * 2 / 3 + 4;dice_mult = dice_mult * (22 + random2(1 + effSkill)) / 22;if (lnchType == WPN_HAND_CROSSBOW){exHitBonus -= 2;dice_mult = dice_mult * 26 / 30;}
// all launched weapons get a tohit boost from throwing skill.exHitBonus += (3 * you.skills[SK_THROWING]) / 4;
if (bow_brand == SPWPN_VORPAL){// Vorpal brand adds 30% damage bonus. Increased from 25%// because at 25%, vorpal brand is completely inferior to// speed. At 30% it's marginally better than speed when// fighting monsters with very heavy armour.dice_mult = dice_mult * 130 / 100;}
if (item_not_ident( you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_PLUSES )&& random2(100) < shoot_skill)
if (item_ident(you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_PLUSES)){if ( !item_ident(you.inv[throw_2], ISFLAG_KNOW_PLUSES) &&random2(100) < rc_skill ){set_ident_flags( item, ISFLAG_KNOW_PLUSES );set_ident_flags( you.inv[throw_2], ISFLAG_KNOW_PLUSES );in_name( throw_2, DESC_NOCAP_A, str_pass);snprintf(info, INFO_SIZE, "You are firing %s.", str_pass);mpr(info);}}else if (random2(100) < shoot_skill)
// [dshaligram] The defined base damage applies only when used// for launchers. Hand-thrown stones and darts do only half// base damage. Yet another evil 4.0ism.if (wepClass == OBJ_MISSILES&& (wepType == MI_DART || wepType == MI_STONE))baseDam = div_rand_round(baseDam, 2);
exercise(SK_THROWING, 1);
exercise(SK_RANGED_COMBAT, 1);// ID checkif ( !item_ident(you.inv[throw_2], ISFLAG_KNOW_PLUSES) &&random2(100) < you.skills[SK_RANGED_COMBAT] ){set_ident_flags( item, ISFLAG_KNOW_PLUSES );set_ident_flags( you.inv[throw_2], ISFLAG_KNOW_PLUSES );in_name( throw_2, DESC_NOCAP_A, str_pass);snprintf(info, INFO_SIZE, "You are throwing %s.", str_pass);mpr(info);}
if (wepClass == OBJ_MISSILES && wepType == MI_NEEDLE){// Throwing needles is now seriously frowned upon; it's difficult// to grip a fiddly little needle, and not penalising it cheapens// blowguns.exHitBonus -= (30 - you.skills[SK_DARTS]) / 3;baseHit -= (30 - you.skills[SK_DARTS]) / 3;#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Needle base hit = %d, exHitBonus = %d",baseHit, exHitBonus);#endif}
// Must unwield before fire_beam() makes a copy in order to remove things// like temporary branding. -- bwrif (throw_2 == you.equip[EQ_WEAPON] && you.inv[throw_2].quantity == 1){unwield_item( throw_2 );you.equip[EQ_WEAPON] = -1;canned_msg( MSG_EMPTY_HANDED );}
if (item_slot == you.equip[EQ_LEFT_RING]|| item_slot == you.equip[EQ_RIGHT_RING]|| item_slot == you.equip[EQ_AMULET]){mpr("You've already put that on!");return (true);}if (item_slot == you.equip[EQ_WEAPON]){mpr("You are wielding that object.");return (false);}if (you.inv[item_slot].base_type != OBJ_JEWELLERY){//jmf: let's not take our inferiority complex out on players, eh? :-p//mpr("You're sadly mistaken if you consider that jewellery.")mpr("You can only put on jewellery.");return (false);}bool is_amulet = (you.inv[item_slot].sub_type >= AMU_RAGE);if (!is_amulet) // ie it's a ring{if (you.equip[EQ_GLOVES] != -1&& item_cursed( you.inv[you.equip[EQ_GLOVES]] )){mpr("You can't take your gloves off to put on a ring!");return (false);}if (you.inv[item_slot].base_type == OBJ_JEWELLERY&& you.equip[EQ_LEFT_RING] != -1&& you.equip[EQ_RIGHT_RING] != -1){// and you are trying to wear body you.equip.mpr("You've already put a ring on each hand.");return (false);}}else if (you.equip[EQ_AMULET] != -1){strcpy(info, "You are already wearing an amulet.");if (one_chance_in(20)){strcat(info, " And I must say it looks quite fetching.");}mpr(info);return (false);}int hand_used = 0;if (you.equip[EQ_LEFT_RING] != -1)hand_used = 1;if (you.equip[EQ_RIGHT_RING] != -1)hand_used = 0;if (is_amulet)hand_used = 2;else if (you.equip[EQ_LEFT_RING] == -1 && you.equip[EQ_RIGHT_RING] == -1){if (prompt_finger){mpr("Put on which hand (l or r)?", MSGCH_PROMPT);int keyin = get_ch();if (keyin == 'l')hand_used = 0;else if (keyin == 'r')hand_used = 1;else if (keyin == ESCAPE)return (false);else{mpr("You don't have such a hand!");return (false);}}else{// First ring goes on left hand if we're choosing automatically.hand_used = 0;}}you.equip[ EQ_LEFT_RING + hand_used ] = item_slot;
set_ident_type( item.base_type, item.sub_type, ident );if (ident == ID_KNOWN_TYPE)set_ident_flags( item, ISFLAG_EQ_JEWELLERY_MASK );if (item_cursed( item ))mprf("Oops, that %s feels deathly cold.",jewellery_is_amulet(item)? "amulet" : "ring");// cursed or not, we know that since we've put the ring onset_ident_flags( item, ISFLAG_KNOW_CURSE );mpr( item_name( item, DESC_INVENTORY_EQUIP ) );}static int prompt_ring_to_remove(int new_ring){const item_def &left = you.inv[ you.equip[EQ_LEFT_RING] ];const item_def &right = you.inv[ you.equip[EQ_RIGHT_RING] ];if (item_cursed(left) && item_cursed(right))
set_ident_type( you.inv[item_slot].base_type,you.inv[item_slot].sub_type, ident );
mprf("You're already wearing two cursed rings!");return (-1);}mesclr();mprf("Wearing %s.", in_name(new_ring, DESC_NOCAP_A));char lslot = index_to_letter(left.link),rslot = index_to_letter(right.link);mprf(MSGCH_PROMPT,"You're wearing two rings. Remove which one? (%c/%c/Esc)",lslot, rslot);mprf(" %s", item_name( left, DESC_INVENTORY ));mprf(" %s", item_name( right, DESC_INVENTORY ));int c;doc = getch();while (c != lslot && c != rslot && c != ESCAPE && c != ' ');mesclr();if (c == ESCAPE || c == ' ')return (-1);int eqslot = c == lslot? EQ_LEFT_RING : EQ_RIGHT_RING;return (you.equip[eqslot]);}// Assumptions:// you.inv[ring_slot] is a valid ring.// EQ_LEFT_RING and EQ_RIGHT_RING are both occupied, and ring_slot is not// one of the worn rings.//// Does not do amulets.static bool swap_rings(int ring_slot){// Ask the player which existing ring is persona non grata.int unwanted = prompt_ring_to_remove(ring_slot);if (unwanted == -1)return (false);if (!remove_ring(unwanted, false))return (false);start_delay(DELAY_JEWELLERY_ON, 1, ring_slot);return (true);}bool puton_item(int item_slot, bool prompt_finger){if (item_slot == you.equip[EQ_LEFT_RING]|| item_slot == you.equip[EQ_RIGHT_RING]|| item_slot == you.equip[EQ_AMULET]){mpr("You've already put that on!");return (true);}if (item_slot == you.equip[EQ_WEAPON]){mpr("You are wielding that object.");return (false);}if (you.inv[item_slot].base_type != OBJ_JEWELLERY){mpr("You can only put on jewellery.");return (false);
if (item_cursed( you.inv[item_slot] ))
if (!is_amulet) // ie it's a ring{if (you.equip[EQ_GLOVES] != -1&& item_cursed( you.inv[you.equip[EQ_GLOVES]] )){mpr("You can't take your gloves off to put on a ring!");return (false);}if (you.equip[EQ_LEFT_RING] != -1&& you.equip[EQ_RIGHT_RING] != -1)return swap_rings(item_slot);}else if (you.equip[EQ_AMULET] != -1)
snprintf( info, INFO_SIZE,"Oops, that %s feels deathly cold.", (is_amulet) ? "amulet": "ring" );mpr(info);
if (!remove_ring( you.equip[EQ_AMULET], true ))return (false);start_delay(DELAY_JEWELLERY_ON, 1, item_slot);// Assume it's going to succeed.return (true);
// cursed or not, we know that since we've put the ring onset_ident_flags( you.inv[item_slot], ISFLAG_KNOW_CURSE );
// First ring goes on left hand if we're choosing automatically.int hand_used = 0;if (you.equip[EQ_LEFT_RING] != -1)hand_used = 1;if (you.equip[EQ_RIGHT_RING] != -1)hand_used = 0;
char str_pass[ ITEMNAME_SIZE ];in_name( item_slot, DESC_INVENTORY_EQUIP, str_pass );mpr( str_pass );
if (is_amulet)hand_used = 2;else if (prompt_finger&& you.equip[EQ_LEFT_RING] == -1&& you.equip[EQ_RIGHT_RING] == -1){mpr("Put on which hand (l or r)?", MSGCH_PROMPT);int keyin = get_ch();if (keyin == 'l')hand_used = 0;else if (keyin == 'r')hand_used = 1;else if (keyin == ESCAPE)return (false);else{mpr("You don't have such a hand!");return (false);}}
bool remove_ring(int slot)
void jewellery_remove_effects(item_def &item){// The ring/amulet must already be removed from you.equip at this point.// Turn off show_uncursed before getting the item name, because this item// was just removed, and the player knows it's uncursed.bool old_showuncursed = Options.show_uncursed;Options.show_uncursed = false;mprf("You remove %s.", item_name(item, DESC_NOCAP_YOUR));Options.show_uncursed = old_showuncursed;switch (item.sub_type){case RING_FIRE:case RING_HUNGER:case RING_ICE:case RING_LIFE_PROTECTION:case RING_POISON_RESISTANCE:case RING_PROTECTION_FROM_COLD:case RING_PROTECTION_FROM_FIRE:case RING_PROTECTION_FROM_MAGIC:case RING_REGENERATION:case RING_SEE_INVISIBLE:case RING_SLAYING:case RING_SUSTAIN_ABILITIES:case RING_SUSTENANCE:case RING_TELEPORTATION:case RING_WIZARDRY:case RING_TELEPORT_CONTROL:break;case RING_PROTECTION:you.redraw_armour_class = 1;break;case RING_EVASION:you.redraw_evasion = 1;break;case RING_STRENGTH:modify_stat(STAT_STRENGTH, -item.plus, true);break;case RING_DEXTERITY:modify_stat(STAT_DEXTERITY, -item.plus, true);break;case RING_INTELLIGENCE:modify_stat(STAT_INTELLIGENCE, -item.plus, true);break;case RING_INVISIBILITY:// removing this ring effectively cancels all invisibility {dlb}if (you.invis)you.invis = 1;break;case RING_LEVITATION:// removing this ring effectively cancels all levitation {dlb}if (you.levitation)you.levitation = 1;break;case RING_MAGICAL_POWER:// dec_max_mp(9);break;case AMU_THE_GOURMAND:you.duration[DUR_GOURMAND] = 0;break;}if (is_random_artefact(item))unuse_randart(item);// must occur after ring is removed -- bwrcalc_mp();}bool remove_ring(int slot, bool announce)
}strcpy(info, "You remove ");in_name(you.equip[hand_used + 7], DESC_NOCAP_YOUR, str_pass);strcat(info, str_pass);strcat(info, ".");mpr(info);// I'll still use ring_wear_2 here.ring_wear_2 = you.equip[hand_used + 7];switch (you.inv[ring_wear_2].sub_type){case RING_FIRE:case RING_HUNGER:case RING_ICE:case RING_LIFE_PROTECTION:case RING_POISON_RESISTANCE:case RING_PROTECTION_FROM_COLD:case RING_PROTECTION_FROM_FIRE:case RING_PROTECTION_FROM_MAGIC:case RING_REGENERATION:case RING_SEE_INVISIBLE:case RING_SLAYING:case RING_SUSTAIN_ABILITIES:case RING_SUSTENANCE:case RING_TELEPORTATION:case RING_WIZARDRY:break;case RING_PROTECTION:you.redraw_armour_class = 1;break;case RING_EVASION:you.redraw_evasion = 1;break;case RING_STRENGTH:modify_stat(STAT_STRENGTH, -you.inv[ring_wear_2].plus, true);break;case RING_DEXTERITY:modify_stat(STAT_DEXTERITY, -you.inv[ring_wear_2].plus, true);break;case RING_INTELLIGENCE:modify_stat(STAT_INTELLIGENCE, -you.inv[ring_wear_2].plus, true);break;case RING_INVISIBILITY:// removing this ring effectively cancels all invisibility {dlb}if (you.invis)you.invis = 1;break;case RING_LEVITATION:// removing this ring effectively cancels all levitation {dlb}if (you.levitation)you.levitation = 1;break;case RING_MAGICAL_POWER:// dec_max_mp(9);break;case RING_TELEPORT_CONTROL:you.attribute[ATTR_CONTROL_TELEPORT]--;break;
// if you happen to be wielding the wand, its display might changeif (you.equip[EQ_WEAPON] == item_slot)you.wield_change = true;if ( you.inv[item_slot].plus < 1 ) {// it's an empty wand, inscribe it that waycanned_msg(MSG_NOTHING_HAPPENS);you.turn_is_over = true;if ( !item_ident(you.inv[item_slot], ISFLAG_KNOW_PLUSES) ) {if ( you.inv[item_slot].inscription.find("empty") ==std::string::npos ) {if ( !you.inv[item_slot].inscription.empty() )you.inv[item_slot].inscription += ' ';you.inv[item_slot].inscription += "[empty]";}}return;}
/*** HP CHANGE ***/void inscribe_item(){int item_slot;char buf[79];if (inv_count() < 1){mpr("You don't have anything to inscribe.");return;}item_slot = prompt_invent_item("Inscribe which item? ",MT_INVSELECT,OSEL_ANY );if (item_slot == PROMPT_ABORT){canned_msg( MSG_OK );return;}mpr( "Inscribe with what? ", MSGCH_PROMPT );get_input_line( buf, sizeof(buf) );you.inv[item_slot].inscription = std::string(buf);you.wield_change = true;}
pract = (one_chance_in(3) ? 1 : 0);create_monster( MONS_BEAST, ENCH_ABJ_IV, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );
int midx = create_monster( MONS_BEAST, ENCH_ABJ_IV,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );// avoid scumming; also prevents it from showing up on notesif ( midx != -1 )menv[midx].flags |= MF_CREATED_FRIENDLY;// no practice
int prompt_invent_item( const char *prompt, int type_expect,
public:const item_def *item;InvEntry( const item_def &i );std::string get_text() const;private:void add_class_hotkeys(const item_def &i);};class InvShowPrices {public:InvShowPrices(bool doshow = true);~InvShowPrices();};class InvMenu : public Menu{public:InvMenu(int mflags = MF_MULTISELECT): Menu(mflags), type(MT_INVSELECT), pre_select(NULL),title_annotate(NULL){}unsigned char getkey() const;void set_preselect(const std::vector<SelItem> *pre);void set_type(menu_type t);// Sets function to annotate the title with meta-information if needed.// If you set this, do so *before* calling set_title, or it won't take// effect.void set_title_annotator(invtitle_annotator fn);void set_title(MenuEntry *title);void set_title(const std::string &s);// Loads items into the menu. If "procfn" is provided, it'll be called// for each MenuEntry added.// NOTE: Does not set menu title, ever! You *must* set the title explicitlyvoid load_items(const std::vector<const item_def*> &items,MenuEntry *(*procfn)(MenuEntry *me) = NULL);// Loads items from the player's inventory into the menu, and sets the// title to the stock title. If "procfn" is provided, it'll be called for// each MenuEntry added, *excluding the title*.void load_inv_items(int item_selector = OSEL_ANY,MenuEntry *(*procfn)(MenuEntry *me) = NULL);std::vector<SelItem> get_selitems() const;// Returns vector of item_def pointers to each item_def in the given// vector. Note: make sure the original vector stays around for the lifetime// of the use of the item pointers, or mayhem results!static std::vector<const item_def*> xlat_itemvect(const std::vector<item_def> &);protected:bool process_key(int key);void do_preselect(InvEntry *ie);protected:menu_type type;const std::vector<SelItem> *pre_select;invtitle_annotator title_annotate;};int prompt_invent_item( const char *prompt,menu_type type,int type_expect,
unsigned char invent_select(int item_class_inv,int select_flags = MF_NOSELECT,std::string (*titlefn)( int menuflags,const std::string &oldt )= NULL,
unsigned char invent_select(// Use NULL for stock Inventory titleconst char *title = NULL,// MT_DROP allows the multidrop togglemenu_type type = MT_INVLIST,int item_selector = OSEL_ANY,int menu_select_flags = MF_NOSELECT,invtitle_annotator titlefn = NULL,
struct InvTitle : public MenuEntry
static void get_inv_items_to_show(std::vector<const item_def*> &v, int selector);InvTitle::InvTitle( Menu *mn, const std::string &title,invtitle_annotator tfn ): MenuEntry( title, MEL_TITLE ){m = mn;titlefn = tfn;}std::string InvTitle::get_text() const{return titlefn? titlefn( m, MenuEntry::get_text() ) :MenuEntry::get_text();}InvEntry::InvEntry( const item_def &i ) : MenuEntry( "", MEL_ITEM ), item( &i )
Menu *m;std::string (*titlefn)( int menuflags, const std::string &oldt );InvTitle( Menu *mn, const char *title,std::string (*tfn)( int menuflags, const std::string &oldt ) ): MenuEntry( title )
data = const_cast<item_def *>( item );char buf[ITEMNAME_SIZE];if (i.base_type == OBJ_GOLD)snprintf(buf, sizeof buf, "%d gold piece%s", i.quantity,(i.quantity > 1? "s" : ""));elseitem_name(i,in_inventory(i)?DESC_INVENTORY_EQUIP : DESC_NOCAP_A, buf, false);text = buf;if (i.base_type != OBJ_GOLD && in_inventory(i)){// FIXME: This is HORRIBLE! We're skipping the inventory letter prefix// which looks like this: "a - ".text = text.substr( 4 );add_hotkey(index_to_letter( i.link ));}else
private:static bool show_prices;static char temp_id[4][50];static void set_show_prices(bool doshow);
switch (i.base_type){case OBJ_GOLD:add_hotkey('$');break;case OBJ_MISSILES:add_hotkey('(');break;case OBJ_WEAPONS:add_hotkey(')');break;case OBJ_ARMOUR:add_hotkey('[');break;case OBJ_WANDS:add_hotkey('/');break;case OBJ_FOOD:add_hotkey('%');break;case OBJ_BOOKS:add_hotkey('+');add_hotkey(':');break;case OBJ_SCROLLS:add_hotkey('?');break;case OBJ_JEWELLERY:add_hotkey(i.sub_type >= AMU_RAGE? '"' : '=');break;case OBJ_POTIONS:add_hotkey('!');break;case OBJ_STAVES:add_hotkey('\\');add_hotkey('|');break;case OBJ_MISCELLANY:add_hotkey('}');break;case OBJ_CORPSES:add_hotkey('&');break;default:break;}}
data = const_cast<item_def *>( item );char buf[ITEMNAME_SIZE];if (i.base_type == OBJ_GOLD)snprintf(buf, sizeof buf, "%d gold piece%s", i.quantity,(i.quantity > 1? "s" : ""));elseitem_name(i,in_inventory(i)?DESC_INVENTORY_EQUIP : DESC_NOCAP_A, buf, false);text = buf;
memset(temp_id, 1, sizeof temp_id);}}
if (i.base_type != OBJ_GOLD){if (in_inventory(i)){text = text.substr( 4 ); // Skip the inventory letter.add_hotkey(index_to_letter( i.link ));}elseadd_hotkey(' '); // Dummy hotkey}else{// Dummy hotkey for gold.add_hotkey(' ');}add_class_hotkeys(i);
InvShowPrices::InvShowPrices(bool doshow){InvEntry::set_show_prices(doshow);}
std::string get_text() const
// Returns vector of item_def pointers to each item_def in the given// vector. Note: make sure the original vector stays around for the lifetime// of the use of the item pointers, or mayhem results!std::vector<const item_def*>InvMenu::xlat_itemvect(const std::vector<item_def> &v){std::vector<const item_def*> xlatitems;for (unsigned i = 0, size = v.size(); i < size; ++i)xlatitems.push_back( &v[i] );return (xlatitems);}void InvMenu::set_type(menu_type t){type = t;}void InvMenu::set_title_annotator(invtitle_annotator afn){title_annotate = afn;}void InvMenu::set_title(MenuEntry *t){Menu::set_title(t);}void InvMenu::set_preselect(const std::vector<SelItem> *pre){pre_select = pre;}void InvMenu::set_title(const std::string &s){std::string stitle = s;if (stitle.empty())
if (InvEntry::show_prices){int value = item_value(*item, temp_id, true);if (value > 0)snprintf(suffix, sizeof suffix," (%d gold)", value);}snprintf( buf, sizeof buf,"%c %c %s%s",hotkeys[0],(!selected_qty? '-' : selected_qty < quantity? '#' : '+'),text.c_str(),suffix );return (buf);
char title_buf[200];snprintf( title_buf, sizeof title_buf,"Inventory: %d.%d/%d.%d aum (%d%%, %d/52 slots)",you.burden / 10, you.burden % 10,cap / 10, cap % 10,(you.burden * 100) / cap,inv_count() );stitle = title_buf;
private:void add_class_hotkeys(const item_def &i)
set_title(new InvTitle(this, stitle, title_annotate));}void InvMenu::load_inv_items(int item_selector,MenuEntry *(*procfn)(MenuEntry *me)){std::vector<const item_def *> tobeshown;get_inv_items_to_show(tobeshown, item_selector);load_items(tobeshown, procfn);if (!item_count())
add_hotkey(')');break;case OBJ_ARMOUR:add_hotkey('[');break;case OBJ_WANDS:add_hotkey('/');break;case OBJ_FOOD:add_hotkey('%');break;case OBJ_BOOKS:add_hotkey('+');add_hotkey(':');break;case OBJ_SCROLLS:add_hotkey('?');break;case OBJ_JEWELLERY:add_hotkey(i.sub_type >= AMU_RAGE? '"' : '=');break;case OBJ_POTIONS:add_hotkey('!');
s = "You aren't carrying any weapons.";
if ((show_prices = doshow))
FixedVector< int, NUM_OBJECT_CLASSES > inv_class(0);for (int i = 0, count = mitems.size(); i < count; ++i)inv_class[ mitems[i]->base_type ]++;menu_letter ckey;std::vector<InvEntry*> items_in_class;for (int i = 0; i < NUM_OBJECT_CLASSES; ++i)
memset(temp_id, 1, sizeof temp_id);
if (!inv_class[i]) continue;add_entry( new MenuEntry( item_class_name(i), MEL_SUBTITLE ) );items_in_class.clear();for (int j = 0, count = mitems.size(); j < count; ++j){if (mitems[j]->base_type != i) continue;items_in_class.push_back( new InvEntry(*mitems[j]) );}if (Options.sort_menus)std::sort( items_in_class.begin(), items_in_class.end(),compare_menu_entries );for (unsigned int j = 0; j < items_in_class.size(); ++j){InvEntry *ie = items_in_class[j];// If there's no hotkey, provide one.if (ie->hotkeys[0] == ' ')ie->hotkeys[0] = ckey++;do_preselect(ie);add_entry( procfn? (*procfn)(ie) : ie );}
class InvShowPrices {public:InvShowPrices(bool doshow = true){InvEntry::set_show_prices(doshow);}~InvShowPrices(){InvEntry::set_show_prices(false);}};
void InvMenu::do_preselect(InvEntry *ie){if (!pre_select || pre_select->empty())return;
class InvMenu : public Menu
for (int i = 0, size = pre_select->size(); i < size; ++i)if (ie->item && ie->item == (*pre_select)[i].item){ie->selected_qty = (*pre_select)[i].quantity;break;}}std::vector<SelItem> InvMenu::get_selitems() const
public:InvMenu(int flags = MF_MULTISELECT) : Menu(flags) { }protected:bool process_key(int key);};
std::vector<SelItem> selected_items;for (int i = 0, count = sel.size(); i < count; ++i){InvEntry *inv = dynamic_cast<InvEntry*>(sel[i]);selected_items.push_back(SelItem(inv->hotkeys[0],inv->selected_qty,inv->item ) );}return (selected_items);}
unsigned char InvMenu::getkey() const{unsigned char mkey = lastch;// Fake an ESCAPE if the menu is empty.if (!item_count())mkey = ESCAPE;if (!isalnum(mkey) && mkey != '$' && mkey != '-' && mkey != '?'&& mkey != '*' && mkey != ESCAPE)mkey = ' ';return (mkey);}//////////////////////////////////////////////////////////////////////////////
}void populate_item_menu( Menu *menu, const std::vector<item_def> &items,void (*callback)(MenuEntry *me) ){FixedVector< int, NUM_OBJECT_CLASSES > inv_class;for (int i = 0; i < NUM_OBJECT_CLASSES; ++i)inv_class[i] = 0;for (int i = 0, count = items.size(); i < count; ++i)inv_class[ items[i].base_type ]++;menu_letter ckey;for (int i = 0; i < NUM_OBJECT_CLASSES; ++i){if (!inv_class[i]) continue;menu->add_entry( new MenuEntry( item_class_name(i), MEL_SUBTITLE ) );for (int j = 0, count = items.size(); j < count; ++j){if (items[j].base_type != i) continue;InvEntry *ie = new InvEntry( items[j] );ie->hotkeys[0] = ckey++;callback(ie);menu->add_entry( ie );}}
if (items.empty())return selected;FixedVector< int, NUM_OBJECT_CLASSES > inv_class;for (int i = 0; i < NUM_OBJECT_CLASSES; ++i)inv_class[i] = 0;for (int i = 0, count = items.size(); i < count; ++i)inv_class[ items[i]->base_type ]++;Menu menu;menu.set_title( new MenuEntry(title) );char ckey = 'a';for (int i = 0; i < NUM_OBJECT_CLASSES; ++i)
if (!items.empty())
if (!inv_class[i]) continue;menu.add_entry( new MenuEntry( item_class_name(i), MEL_SUBTITLE ) );for (int j = 0, count = items.size(); j < count; ++j){if (items[j]->base_type != i) continue;InvEntry *ie = new InvEntry( *items[j] );ie->hotkeys[0] = ckey;menu.add_entry( ie );ckey = ckey == 'z'? 'A' :ckey == 'Z'? 'a' :ckey + 1;}
InvMenu menu;menu.set_title(title);menu.load_items(items);menu.set_flags(noselect ? MF_NOSELECT : MF_MULTISELECT);menu.show();selected = menu.get_selitems();
menu.set_flags( MF_MULTISELECT | MF_SELECT_ANY_PAGE );std::vector< MenuEntry * > sel = menu.show();for (int i = 0, count = sel.size(); i < count; ++i){InvEntry *inv = (InvEntry *) sel[i];selected.push_back( SelItem( inv->hotkeys[0],inv->selected_qty,inv->item ) );}return selected;
return (selected);
}static void set_vectitem_classes(const std::vector<item_def*> &v,FixedVector<int, NUM_OBJECT_CLASSES> &fv){for (int i = 0; i < NUM_OBJECT_CLASSES; i++)fv[i] = 0;for (int i = 0, size = v.size(); i < size; i++)fv[ v[i]->base_type ]++;
FixedVector< int, NUM_OBJECT_CLASSES > inv_class2;for (int i = 0; i < NUM_OBJECT_CLASSES; i++)inv_class2[i] = 0;int inv_count = 0;for (int i = 0; i < ENDOFPACK; i++){if (you.inv[i].quantity){inv_class2[ you.inv[i].base_type ]++;inv_count++;}}if (!inv_count){menu.set_title( new MenuEntry( "You aren't carrying anything." ) );menu.show();return 0;}std::vector<item_def*> tobeshown;get_inv_items_to_show( tobeshown, item_selector );set_vectitem_classes( tobeshown, inv_class2 );if (tobeshown.size()){const int cap = carrying_capacity();
menu.load_inv_items(item_selector);menu.set_type(type);
char title_buf[200];snprintf( title_buf, sizeof title_buf,"Inventory: %d.%d/%d.%d aum (%d%%, %d/52 slots)",you.burden / 10, you.burden % 10,cap / 10, cap % 10,(you.burden * 100) / cap,inv_count );menu.set_title( new InvTitle( &menu, title_buf, titlefn ) );for (int i = 0; i < 15; i++){if (inv_class2[i] != 0){std::string s = item_class_name(i);menu.add_entry( new MenuEntry( s, MEL_SUBTITLE ) );
// Don't override title if there are no items.if (title && menu.item_count())menu.set_title(title);
for (int j = 0, size = tobeshown.size(); j < size; ++j){if (tobeshown[j]->base_type == i){menu.add_entry( new InvEntry( *tobeshown[j] ) );}} // end of j loop} // end of if inv_class2} // end of i loop.}else{std::string s;if (item_selector == -1)s = "You aren't carrying anything.";else{if (item_selector == OBJ_WEAPONS || item_selector == OSEL_WIELD)s = "You aren't carrying any weapons.";else if (item_selector == OBJ_MISSILES)s = "You aren't carrying any ammunition.";elses = "You aren't carrying any such object.";}menu.set_title( new MenuEntry( s ) );}
menu.show(true);
{for (int i = 0, count = sel.size(); i < count; ++i)items->push_back( SelItem( sel[i]->hotkeys[0],sel[i]->selected_qty ) );}
*items = menu.get_selitems();
int selmode = Options.drop_mode == DM_SINGLE?MF_SINGLESELECT | MF_EASY_EXIT | MF_ANYPRINTABLE :MF_MULTISELECT;
int selmode =Options.drop_mode == DM_SINGLE&& (!pre_select || pre_select->empty())?MF_SINGLESELECT | MF_EASY_EXIT | MF_ANYPRINTABLE :MF_MULTISELECT;
}static int digit_to_index( char digit, operation_types oper ) {int i;unsigned int j;char iletter = (char)(oper);for ( i = 0; i < ENDOFPACK; ++i ) {if (is_valid_item(you.inv[i])) {const std::string& r(you.inv[i].inscription);/* note that r.size() is unsigned */for ( j = 0; j + 2 < r.size(); ++j ) {if ( r[j] == '@' &&(r[j+1] == iletter || r[j+1] == '*') &&r[j+2] == digit ) {return i;}}}}return -1;}/* return true if user OK'd it (or no warning), false otherwise */static bool check_warning_inscriptions( const item_def& item,operation_types oper ){unsigned int i;char iletter = (char)(oper);char name[ITEMNAME_SIZE];char prompt[ITEMNAME_SIZE + 100];item_name(item, DESC_INVENTORY, name, false);strcpy( prompt, "Really choose ");strncat( prompt, name, ITEMNAME_SIZE );strcat( prompt, "?");const std::string& r(item.inscription);for ( i = 0; i + 1 < r.size(); ++i ) {if ( r[i] == '!' &&(r[i+1] == iletter || r[i+1] == '*') ) {return yesno(prompt, false, 'n');}}return true;
std::vector< SelItem > items;// pretend the player has hit '?' and setup state.keyin = invent_select( type_expect,MF_SINGLESELECT | MF_ANYPRINTABLE| MF_EASY_EXIT,NULL, &items );if (items.size()){if (count)*count = items[0].quantity;redraw_screen();mesclr( true );return letter_to_index( keyin );}need_getch = false;// Don't redraw if we're just going to display another listingneed_redraw = (keyin != '?' && keyin != '*');// A prompt is nice for when we're moving to "count" mode.need_prompt = (count != NULL && isdigit( keyin ));
need_prompt = need_getch = false;keyin = '?';
keyin = invent_select( keyin == '*'? OSEL_ANY : type_expect,MF_SINGLESELECT | MF_ANYPRINTABLE| MF_EASY_EXIT,NULL,&items );
keyin = invent_select(prompt,mtype,keyin == '*'? OSEL_ANY : type_expect,MF_SINGLESELECT | MF_ANYPRINTABLE| MF_EASY_EXIT,NULL,&items );
}return (ret);}void list_commands(bool wizard){const char *line;int j = 0;#ifdef DOS_TERMchar buffer[4800];window(1, 1, 80, 25);gettext(1, 1, 80, 25, buffer);#endifclrscr();// BCR - Set to screen length - 1 to display the "more" stringint moreLength = (get_number_of_lines() - 1) * 2;for (int i = 0; i < 500; i++){if (wizard)line = wizard_string( i );
// BCR - If we've reached the end of the screen, clearif (j == moreLength){gotoxy(2, j / 2 + 1);cprintf("More...");getch();clrscr();j = 0;}gotoxy( ((j % 2) ? 40 : 2), ((j / 2) + 1) );cprintf( line );j++;
// We're going to loop back up, so don't draw another prompt.need_prompt = false;
getch();#ifdef DOS_TERMputtext(1, 1, 80, 25, buffer);#endifreturn;} // end list_commands()const char *wizard_string( int i ){UNUSED( i );#ifdef WIZARDreturn((i == 10) ? "a : acquirement" :(i == 13) ? "A : set all skills to level" :(i == 15) ? "b : controlled blink" :(i == 20) ? "B : banish yourself to the Abyss" :(i == 30) ? "g : add a skill" :(i == 35) ? "G : remove all monsters" :(i == 40) ? "h/H : heal yourself (super-Heal)" :(i == 50) ? "i/I : identify/unidentify inventory":(i == 70) ? "l : make entrance to labyrinth" :(i == 80) ? "m/M : create monster by number/name":(i == 90) ? "o/%% : create an object" :(i == 100) ? "p : make entrance to pandemonium" :(i == 110) ? "x : gain an experience level" :(i == 115) ? "r : change character's species" :(i == 120) ? "s : gain 20000 skill points" :(i == 130) ? "S : set skill to level" :(i == 140) ? "t : tweak object properties" :(i == 150) ? "X : Receive a gift from Xom" :(i == 160) ? "z/Z : cast any spell by number/name":(i == 200) ? "$ : get 1000 gold" :(i == 210) ? "</> : create up/down staircase" :(i == 220) ? "u/d : shift up/down one level" :(i == 230) ? "~/\" : goto a level" :(i == 240) ? "( : create a feature" :(i == 250) ? "] : get a mutation" :(i == 260) ? "[ : get a demonspawn mutation" :(i == 270) ? ": : find branch" :(i == 280) ? "{ : magic mapping" :(i == 290) ? "^ : gain piety" :(i == 300) ? "_ : gain religion" :(i == 310) ? "\' : list items" :(i == 320) ? "? : list wizard commands" :(i == 330) ? "| : acquire all unrand artefacts" :(i == 340) ? "+ : turn item into random artefact" :(i == 350) ? "= : sum skill points": "");#elsereturn ("");#endif} // end wizard_string()const char *command_string( int i ){/** BCR - Command printing, case statement* Note: The numbers in this case indicate the order in which the* commands will be printed out. Make sure none of these* numbers is greater than 500, because that is the limit.** Arranged alpha lower, alpha upper, punctuation, ctrl.**/return((i == 10) ? "a : use special ability" :(i == 20) ? "d(#) : drop (exact quantity of) items" :(i == 30) ? "e : eat food" :(i == 40) ? "f : fire first available missile" :(i == 50) ? "i : inventory listing" :(i == 55) ? "m : check skills" :(i == 60) ? "o/c : open / close a door" :(i == 65) ? "p : pray" :(i == 70) ? "q : quaff a potion" :(i == 80) ? "r : read a scroll or book" :(i == 90) ? "s : search adjacent tiles" :(i == 100) ? "t : throw/shoot an item" :(i == 110) ? "v : view item description" :(i == 120) ? "w : wield an item" :(i == 130) ? "x : examine visible surroundings" :(i == 135) ? "z : zap a wand" :(i == 140) ? "A : list abilities/mutations" :(i == 141) ? "C : check experience" :(i == 142) ? "D : dissect a corpse" :(i == 145) ? "E : evoke power of wielded item" :(i == 150) ? "M : memorise a spell" :(i == 155) ? "O : overview of the dungeon" :(i == 160) ? "P/R : put on / remove jewellery" :(i == 165) ? "Q : quit without saving" :(i == 168) ? "S : save game and exit" :(i == 179) ? "V : version information" :(i == 200) ? "W/T : wear / take off armour" :(i == 210) ? "X : examine level map" :(i == 220) ? "Z : cast a spell" :(i == 240) ? ",/g : pick up items" :(i == 242) ? "./del: rest one turn" :(i == 250) ? "</> : ascend / descend a staircase" :(i == 270) ? "; : examine occupied tile" :(i == 280) ? "\\ : check item knowledge" :#ifdef WIZARD(i == 290) ? "& : invoke your Wizardly powers" :#endif(i == 300) ? "+/- : scroll up/down [level map only]" :(i == 310) ? "! : shout or command allies" :(i == 325) ? "^ : describe religion" :(i == 337) ? "@ : status" :(i == 340) ? "# : dump character to file" :(i == 350) ? "= : reassign inventory/spell letters" :(i == 360) ? "\' : wield item a, or switch to b" :#ifdef USE_MACROS(i == 380) ? "` : add macro" :(i == 390) ? "~ : save macros" :#endif(i == 400) ? "] : display worn armour" :(i == 410) ? "\" : display worn jewellery" :(i == 420) ? "Ctrl-P : see old messages" :#ifdef PLAIN_TERM(i == 430) ? "Ctrl-R : Redraw screen" :#endif(i == 440) ? "Ctrl-A : toggle autopickup" :(i == 450) ? "Ctrl-X : Save game without query" :
#ifdef ALLOW_DESTROY_ITEM_COMMAND(i == 451) ? "Ctrl-D : Destroy inventory item" :#endif(i == 453) ? "Ctrl-G : interlevel travel" :(i == 455) ? "Ctrl-O : explore" :#ifdef STASH_TRACKING(i == 456) ? "Ctrl-S : mark stash" :(i == 457) ? "Ctrl-E : forget stash" :(i == 458) ? "Ctrl-F : search stashes" :#endif(i == 460) ? "Shift & DIR : long walk" :(i == 465) ? "/ DIR : long walk" :(i == 470) ? "Ctrl & DIR : door; untrap; attack" :(i == 475) ? "* DIR : door; untrap; attack" :(i == 478) ? "Shift & 5 on keypad : rest 100 turns": "");} // end command_string()
return (ret);}
const std::string element_cols[] ={"fire", "ice", "earth", "electricity", "air", "poison", "water","magic", "mutagenic", "warp", "enchant", "heal", "holy", "dark","death", "necro", "unholy", "vehumet", "crystal", "blood", "smoke","slime", "jewel", "elven", "dwarven", "orcish", "gila", "floor","rock", "stone", "random"};
"plain", "prompt", "god", "duration", "danger", "warning", "food","recovery", "talk", "intrinsic_gain", "mutation", "monster_spell","monster_enchant", "monster_damage", "rotten_meat", "equipment","diagnostic",
"plain", "prompt", "god", "pray", "duration", "danger", "warning", "food","recovery", "sound", "talk", "intrinsic_gain", "mutation", "monster_spell","monster_enchant", "monster_damage", "monster_target","rotten_meat", "equipment", "floor", "multiturn", "diagnostic",
static int str_to_book( const std::string& str ){if ( str == "fire" || str == "flame" )return SBT_FIRE;if ( str == "cold" || str == "ice" )return SBT_COLD;if ( str == "summ" || str == "summoning" )return SBT_SUMM;if ( str == "random" )return SBT_RANDOM;return SBT_NO_SELECTION;}
if (clear_name)you.your_name[0] = '\0';Options.race = '\0';Options.cls = '\0';Options.weapon = WPN_UNKNOWN;Options.random_pick = false;Options.chaos_knight = GOD_NO_GOD;Options.death_knight = DK_NO_SELECTION;Options.priest = GOD_NO_GOD;
race = 0;cls = 0;weapon = WPN_UNKNOWN;book = SBT_NO_SELECTION;random_pick = false;chaos_knight = GOD_NO_GOD;death_knight = DK_NO_SELECTION;priest = GOD_NO_GOD;
// Option initializationOptions.activity_interrupts[ ACT_MULTIDROP ] =AI_HP_LOSS | AI_STAT_CHANGE | AI_TELEPORT;Options.activity_interrupts[ ACT_RUNNING ] =0xFFFF ^ AI_SEE_MONSTER;Options.activity_interrupts[ ACT_TRAVELING ] =0xFFFF ^ (AI_MESSAGE | AI_SEE_MONSTER);
for (int adelay = 0; adelay < NUM_DELAYS; ++adelay)for (int aint = 0; aint < NUM_AINTERRUPTS; ++aint)activity_interrupts[adelay][aint] = true;
reset_startup_options(clear_name);Options.prev_race = 0;Options.prev_cls = 0;Options.prev_ck = GOD_NO_GOD;Options.prev_dk = DK_NO_SELECTION;Options.prev_pr = GOD_NO_GOD;Options.prev_weapon = WPN_UNKNOWN;Options.prev_randpick = false;Options.remember_name = false;
const char *default_activity_interrupts[] = {"interrupt_armour_on = hp_loss, monster_attack","interrupt_armour_off = interrupt_armour_on","interrupt_drop_item = interrupt_armour_on","interrupt_jewellery_on = interrupt_armour_on","interrupt_memorise = interrupt_armour_on, stat","interrupt_butcher = interrupt_armour_on, teleport, stat","interrupt_passwall = interrupt_butcher","interrupt_multidrop = interrupt_butcher","interrupt_macro = interrupt_multidrop","interrupt_travel = interrupt_butcher, statue, hungry, burden, monster","interrupt_run = interrupt_travel, message","interrupt_rest = interrupt_run",
Options.autopickups = 0x0000;Options.verbose_dump = false;Options.detailed_stat_dump = true;Options.colour_map = false;Options.clean_map = false;Options.show_uncursed = true;Options.always_greet = false;Options.easy_open = true;Options.easy_armour = true;Options.easy_butcher = false;Options.easy_confirm = CONFIRM_SAFE_EASY;Options.easy_quit_item_prompts = false;Options.hp_warning = 10;Options.hp_attention = 25;Options.terse_hand = true;Options.auto_list = false;Options.delay_message_clear = false;Options.pickup_dropped = true;Options.travel_colour = true;Options.travel_delay = -1;Options.travel_stair_cost = 500;Options.travel_exclude_radius2 = 68;Options.show_waypoints = true;Options.item_colour = false;
// Stair ascents/descents cannot be interrupted, attempts to interrupt// the delay will just trash all queued delays, including travel."interrupt_ascending_stairs =","interrupt_descending_stairs =","interrupt_uninterruptible =","interrupt_autopickup =","interrupt_weapon_swap =",NULL};for (int i = 0; default_activity_interrupts[i]; ++i)read_option_line( default_activity_interrupts[i], false );}void game_options::clear_activity_interrupts(FixedVector<bool, NUM_AINTERRUPTS> &eints){for (int i = 0; i < NUM_AINTERRUPTS; ++i)eints[i] = false;}void game_options::set_activity_interrupt(FixedVector<bool, NUM_AINTERRUPTS> &eints,const std::string &interrupt){if (interrupt.find(interrupt_prefix) == 0){std::string delay_name = interrupt.substr( interrupt_prefix.length() );delay_type delay = get_delay(delay_name);if (delay == NUM_DELAYS){fprintf(stderr, "Unknown delay: %s\n", delay_name.c_str());return;}FixedVector<bool, NUM_AINTERRUPTS> &refints =activity_interrupts[delay];for (int i = 0; i < NUM_AINTERRUPTS; ++i)if (refints[i])eints[i] = true;
Options.easy_exit_menu = true;Options.dos_use_background_intensity = false;Options.assign_item_slot = SS_FORWARD;
activity_interrupt_type ai = get_activity_interrupt(interrupt);if (ai == NUM_AINTERRUPTS){fprintf(stderr, "Delay interrupt name \"%s\" not recognised.\n",interrupt.c_str());return;}
Options.macro_meta_entry = true;
eints[ai] = true;}void game_options::set_activity_interrupt(const std::string &activity_name,const std::string &interrupt_names,bool append_interrupts){const delay_type delay = get_delay(activity_name);if (delay == NUM_DELAYS){fprintf(stderr, "Unknown delay: %s\n", activity_name.c_str());return;}FixedVector<bool, NUM_AINTERRUPTS> &eints = activity_interrupts[ delay ];if (!append_interrupts)clear_activity_interrupts(eints);std::vector<std::string> interrupts = split_string(",", interrupt_names);for (int i = 0, size = interrupts.size(); i < size; ++i)set_activity_interrupt(eints, interrupts[i]);eints[AI_FORCE_INTERRUPT] = true;}void game_options::reset_options(){set_default_activity_interrupts();reset_startup_options();#ifdef SAVE_DIR_PATHsave_dir = SAVE_DIR_PATH;#elsesave_dir.clear();#endifplayer_name.clear();autopickup_on = true;autoprayer_on = false;fizzlecheck_on = false;prev_race = 0;prev_cls = 0;prev_ck = GOD_NO_GOD;prev_dk = DK_NO_SELECTION;prev_pr = GOD_NO_GOD;prev_weapon = WPN_UNKNOWN;prev_book = SBT_NO_SELECTION;prev_randpick = false;remember_name = false;#ifdef USE_ASCII_CHARACTERSchar_set = CSET_ASCII;#elsechar_set = CSET_IBM;#endifinit_char_table(char_set);// set it to the .crawlrc defaultautopickups = ((1L << 15) | // gold(1L << 6) | // scrolls(1L << 8) | // potions(1L << 10) | // books(1L << 7) | // jewellery(1L << 3) | // wands(1L << 4)); // foodverbose_dump = false;detailed_stat_dump = true;colour_map = true;clean_map = false;show_uncursed = true;always_greet = true;easy_open = true;easy_unequip = true;easy_butcher = true;easy_confirm = CONFIRM_SAFE_EASY;easy_quit_item_prompts = true;hp_warning = 10;hp_attention = 25;confirm_self_target = true;safe_autopickup = false;use_notes = true;note_skill_max = false;note_all_spells = false;note_hp_percent = 0;ood_interesting = 8;terse_hand = false;increasing_skill_progress = false;// [ds] Grumble grumble.auto_list = true;delay_message_clear = false;pickup_dropped = false;pickup_thrown = true;
travel_colour = true;travel_delay = 10;travel_stair_cost = 500;travel_exclude_radius2 = 68;sort_menus = false;tc_reachable = BLUE;tc_excluded = LIGHTMAGENTA;tc_exclude_circle = RED;tc_dangerous = CYAN;tc_disconnected = DARKGREY;show_waypoints = true;item_colour = true;// [ds] Default to jazzy colours.detected_item_colour = LIGHTGREEN;detected_monster_colour= LIGHTRED;easy_exit_menu = true;#ifdef DOSdos_use_background_intensity = false;#elsedos_use_background_intensity = true;#endifassign_item_slot = SS_FORWARD;macro_meta_entry = true;
Options.explore_stop = ES_ITEM | ES_STAIR | ES_SHOP | ES_ALTAR;Options.target_zero_exp = true;Options.target_wrap = false;Options.target_oos = true;Options.target_los_first = true;Options.dump_kill_places = KDO_ONE_PLACE;Options.dump_message_count = 4;Options.dump_item_origins = IODS_ARTIFACTS | IODS_RODS;Options.dump_item_origin_price = -1;
explore_stop = ES_ITEM | ES_STAIR | ES_SHOP | ES_ALTAR;safe_zero_exp = true;target_zero_exp = false;target_wrap = true;target_oos = true;target_los_first = true;dump_kill_places = KDO_ONE_PLACE;dump_message_count = 7;dump_item_origins = IODS_ARTIFACTS | IODS_RODS;dump_item_origin_price = -1;
Options.flush_input[ FLUSH_ON_FAILURE ] = true;Options.flush_input[ FLUSH_BEFORE_COMMAND ] = false;Options.flush_input[ FLUSH_ON_MESSAGE ] = false;Options.flush_input[ FLUSH_LUA ] = true;
flush_input[ FLUSH_ON_FAILURE ] = true;flush_input[ FLUSH_BEFORE_COMMAND ] = false;flush_input[ FLUSH_ON_MESSAGE ] = false;flush_input[ FLUSH_LUA ] = true;
//#ifdef USE_COLOUR_OPTSOptions.friend_brand = CHATTR_NORMAL;Options.heap_brand = CHATTR_NORMAL;Options.stab_brand = CHATTR_NORMAL;Options.may_stab_brand = CHATTR_NORMAL;Options.no_dark_brand = 0;//#endif
friend_brand = CHATTR_NORMAL;heap_brand = CHATTR_NORMAL;stab_brand = CHATTR_NORMAL;may_stab_brand = CHATTR_NORMAL;no_dark_brand = 0;
Options.banned_objects.clear();Options.stop_travel.clear();Options.sound_mappings.clear();Options.menu_colour_mappings.clear();Options.drop_filter.clear();
dump_order.clear();add_dump_fields("header,stats,misc,inventory,skills,""spells,mutations,messages,screenshot,kills,notes");
Options.named_options.clear();
banned_objects.clear();note_monsters.clear();note_messages.clear();autoinscriptions.clear();note_items.clear();note_skill_levels.clear();travel_stop_message.clear();sound_mappings.clear();menu_colour_mappings.clear();drop_filter.clear();map_file_name.clear();named_options.clear();
FILE *f;char name_buff[kPathLen];
const char* locations_data[][2] = {{ SysEnv.crawl_rc, "" },{ SysEnv.crawl_dir, "init.txt" },#ifdef MULTIUSER{ SysEnv.home, "/.crawlrc" },{ SysEnv.home, "init.txt" },#endif{ "", "init.txt" },#ifdef WIN32CONSOLE{ "", ".crawlrc" },{ "", "_crawlrc" },#endif{ NULL, NULL } // placeholder to mark end};
if (!runscript)you.your_name[0] = '\0';
FILE* f = NULL;char name_buff[kPathLen];// Check all possibilities for init.txtfor ( int i = 0; f == NULL && locations_data[i][1] != NULL; ++i ) {// Don't look at unset optionsif ( locations_data[i][0] != NULL ) {snprintf( name_buff, sizeof name_buff, "%s%s",locations_data[i][0], locations_data[i][1] );f = fopen( name_buff, "r" );}}
else if (SysEnv.home){// init.txt isn't such a good choice if we're looking in// the user's home directory, we'll use Un*x standardstrncpy(name_buff, SysEnv.home, kPathLen);name_buff[ kPathLen - 1 ] = '\0';// likely not to have a closing slash so we'll insert one...strncat(name_buff, "/.crawlrc", kPathLen);name_buff[ kPathLen - 1 ] = '\0';f = fopen(name_buff, "r");}
return "not found (~/.crawlrc missing)";#elsereturn "not found (init.txt missing from current directory)";
Options.prev_randpick = Options.random_pick;Options.prev_weapon = Options.weapon;Options.prev_pr = Options.priest;Options.prev_dk = Options.death_knight;Options.prev_ck = Options.chaos_knight;Options.prev_cls = Options.cls;Options.prev_race = Options.race;Options.prev_name = you.your_name;
game_options temp;FileLineInput fl(f);temp.read_options(fl, false);fclose(f);
reset_startup_options();
Options.prev_randpick = temp.random_pick;Options.prev_weapon = temp.weapon;Options.prev_pr = temp.priest;Options.prev_dk = temp.death_knight;Options.prev_ck = temp.chaos_knight;Options.prev_cls = temp.cls;Options.prev_race = temp.race;Options.prev_book = temp.book;Options.prev_name = temp.player_name;
&& key != "drop_filter" && key != "lua_file")
&& key != "travel_stop_message"&& key != "drop_filter" && key != "lua_file"&& key != "note_items" && key != "autoinscribe"&& key != "note_monsters" && key != "note_messages"&& key.find("cset") != 0 && key != "dungeon"&& key != "feature")
strncpy(you.your_name, field.c_str(), kNameLen);you.your_name[ kNameLen - 1 ] = '\0';
player_name = field;}else if (key == "char_set" || key == "ascii_display"){bool valid = true;if (key == "ascii_display"){char_set =read_bool(field, char_set == CSET_ASCII)?CSET_ASCII: CSET_IBM;valid = true;}else{if (field == "ascii")char_set = CSET_ASCII;else if (field == "ibm")char_set = CSET_IBM;else if (field == "dec")char_set = CSET_DEC;else{fprintf( stderr, "Bad character set: %s\n", field.c_str() );valid = false;}}if (valid)init_char_table(char_set);}else if (key == "default_autopickup"){// should autopickup default to on or off?autopickup_on = read_bool( field, autopickup_on );
else if (key == "remembered_monster_colour")
else if (key.find(interrupt_prefix) == 0){set_activity_interrupt(key.substr(interrupt_prefix.length()),field,plus_equal);}else if (key.find("cset") == 0){std::string cset = key.substr(4);if (!cset.empty() && cset[0] == '_')cset = cset.substr(1);char_set_type cs = NUM_CSET;if (cset == "ascii")cs = CSET_ASCII;else if (cset == "ibm")cs = CSET_IBM;else if (cset == "dec")cs = CSET_DEC;add_cset_override(cs, field);}else if (key == "feature" || key == "dungeon")
if (field == "real")Options.remembered_monster_colour = 0xFFFFU;else if (field == "auto")Options.remembered_monster_colour = 0;else {const int col = str_to_colour( field );if (col != -1)Options.remembered_monster_colour = col;elsefprintf( stderr, "Bad remembered_monster_colour -- %s\n",field.c_str());}
std::vector<std::string> defs = split_string(";", field);for (int i = 0, size = defs.size(); i < size; ++i)add_feature_override( defs[i] );
field.c_str() );}}else if (key == "ood_interesting"){ood_interesting = atoi( field.c_str() );}else if (key == "note_monsters"){append_vector(note_monsters, split_string(",", field));}else if (key == "note_messages"){append_vector(note_messages, split_string(",", field));}else if (key == "note_hp_percent"){note_hp_percent = atoi( field.c_str() );if (note_hp_percent < 0 || note_hp_percent > 100){note_hp_percent = 0;fprintf( stderr, "Bad HP note percentage -- %s\n",
Options.auto_list = read_bool( field, Options.auto_list );
safe_autopickup = read_bool( field, safe_autopickup );}else if (key == "use_notes"){use_notes = read_bool( field, use_notes );}else if (key == "note_skill_max"){note_skill_max = read_bool( field, note_skill_max );}else if (key == "note_all_spells"){note_all_spells = read_bool( field, note_all_spells );
append_vector(Options.banned_objects, split_string(",", field));
append_vector(banned_objects, split_string(",", field));}else if (key == "note_items"){append_vector(note_items, split_string(",", field));}else if (key == "autoinscribe"){std::vector<std::string> thesplit =split_string(":", field);autoinscriptions.push_back(std::pair<text_pattern,std::string>(thesplit[0],thesplit[1]));}else if (key == "map_file_name"){map_file_name = field;
else if (key == "note_skill_levels"){std::vector<std::string> thesplit = split_string(",", field);for ( unsigned i = 0; i < thesplit.size(); ++i ) {int num = atoi(thesplit[i].c_str());if ( num > 0 && num <= 27 ) {note_skill_levels.push_back(num);}else {fprintf(stderr, "Bad skill level to note -- %s\n",thesplit[i].c_str());continue;}}}
Options.pickup_dropped = read_bool(field, Options.pickup_dropped);
append_vector(fsim_kit, split_string(",", field));}else if (key == "fsim_rounds"){fsim_rounds = atol(field.c_str());if (fsim_rounds < 1000)fsim_rounds = 1000;if (fsim_rounds > 500000L)fsim_rounds = 500000L;}else if (key == "fsim_mons"){fsim_mons = field;}else if (key == "fsim_str"){fsim_str = atoi(field.c_str());}else if (key == "fsim_int"){fsim_int = atoi(field.c_str());}else if (key == "fsim_dex"){fsim_dex = atoi(field.c_str());
Options.travel_delay = atoi( field.c_str() );if (Options.travel_delay < -1)Options.travel_delay = -1;if (Options.travel_delay > 2000)Options.travel_delay = 2000;
travel_delay = atoi( field.c_str() );if (travel_delay < -1)travel_delay = -1;if (travel_delay > 2000)travel_delay = 2000;
Options.level_map_cursor_step = atoi( field.c_str() );if (Options.level_map_cursor_step < 1)Options.level_map_cursor_step = 1;if (Options.level_map_cursor_step > 50)Options.level_map_cursor_step = 50;
level_map_cursor_step = atoi( field.c_str() );if (level_map_cursor_step < 1)level_map_cursor_step = 1;if (level_map_cursor_step > 50)level_map_cursor_step = 50;
Options.travel_stair_cost = atoi( field.c_str() );if (Options.travel_stair_cost < 1)Options.travel_stair_cost = 1;else if (Options.travel_stair_cost > 1000)Options.travel_stair_cost = 1000;
macro_meta_entry = read_bool(field, macro_meta_entry);
Options.travel_exclude_radius2 = atoi( field.c_str() );if (Options.travel_exclude_radius2 < 0)Options.travel_exclude_radius2 = 0;else if (Options.travel_exclude_radius2 > 400)Options.travel_exclude_radius2 = 400;
travel_exclude_radius2 = atoi( field.c_str() );if (travel_exclude_radius2 < 0)travel_exclude_radius2 = 0;else if (travel_exclude_radius2 > 400)travel_exclude_radius2 = 400;
Options.item_colour = read_bool(field, Options.item_colour);
tc_exclude_circle =str_to_colour(field, tc_exclude_circle);}else if (key == "tc_dangerous"){tc_dangerous = str_to_colour(field, tc_dangerous);}else if (key == "tc_disconnected"){tc_disconnected = str_to_colour(field, tc_disconnected);
viewwindow = &viewwindow3;mapch = &mapchar3;mapch2 = &mapchar4;#ifdef UNIXcharacter_set = 0;#endif
Options.char_set = CSET_ASCII;init_char_table(Options.char_set);
//////////////////////////////////////////////////////////////////////////// game_optionsint game_options::o_int(const char *name, int def) const{int val = def;opt_map::const_iterator i = named_options.find(name);if (i != named_options.end()){val = atoi(i->second.c_str());}return (val);}long game_options::o_long(const char *name, long def) const{long val = def;opt_map::const_iterator i = named_options.find(name);if (i != named_options.end()){const char *s = i->second.c_str();char *es = NULL;long num = strtol(s, &es, 10);if (s != (const char *) es && es)val = num;}return (val);}bool game_options::o_bool(const char *name, bool def) const{bool val = def;opt_map::const_iterator i = named_options.find(name);if (i != named_options.end())val = read_bool(i->second, val);return (val);}std::string game_options::o_str(const char *name, const char *def) const{std::string val;opt_map::const_iterator i = named_options.find(name);if (i != named_options.end())val = i->second;else if (def)val = def;return (val);}int game_options::o_colour(const char *name, int def) const{std::string val = o_str(name);trim_string(val);tolower_string(val);int col = str_to_colour(val);return (col == -1? def : col);}
void hiscores_format_single( char *buffer, struct scorefile_entry &se );int hiscores_format_single_long( char *buffer, struct scorefile_entry &se,
void hiscores_format_single( char *buffer, const scorefile_entry &se );void hiscores_format_single_long( char *buffer, const scorefile_entry &se,
static bool hs_read(FILE *scores, struct scorefile_entry &dest);static void hs_parse_numeric(char *inbuf, struct scorefile_entry &dest);static void hs_parse_string(char *inbuf, struct scorefile_entry &dest);static void hs_copy(struct scorefile_entry &dest, struct scorefile_entry &src);static void hs_write(FILE *scores, struct scorefile_entry &entry);static void hs_nextstring(char *&inbuf, char *dest);
static bool hs_read(FILE *scores, scorefile_entry &dest);static void hs_parse_numeric(char *inbuf, scorefile_entry &dest);static void hs_parse_string(char *inbuf, scorefile_entry &dest);static void hs_write(FILE *scores, scorefile_entry &entry);static void hs_nextstring(char *&inbuf, char *dest, size_t bufsize);
static void hs_parse_generic_1(char *&inbuf, char *outbuf, const char *stopvalues);static void hs_parse_generic_2(char *&inbuf, char *outbuf, const char *continuevalues);
static void hs_parse_generic_1(char *&inbuf, char *outbuf, size_t outsz,const char *stopvalues);static void hs_parse_generic_2(char *&inbuf, char *outbuf, size_t outsz,const char *continuevalues);
char scratch[100];// Now that we have a long format, I'm starting to make this// more terse, in hopes that it will better fit. -- bwr// race_class_name overrides race & classif (se.race_class_name[0] == '\0'){snprintf( scratch, sizeof(scratch), "%s%s",get_species_abbrev( se.race ), get_class_abbrev( se.cls ) );}else{strcpy( scratch, se.race_class_name );}se.name[10]='\0';sprintf( buf, "%8ld %-10s %s-%02d%s", se.points, se.name,scratch, se.lvl, (se.wiz_mode == 1) ? "W" : "" );// get monster type & number, if applicableint mon_type = se.death_source;int mon_number = se.mon_num;// remember -- we have 36 characters (not including initial space):switch (se.death_type){case KILLED_BY_MONSTER:strcat( buf, " slain by " );// if death_source_name is non-null, override lookup (names might have// changed!)if (se.death_source_name[0] != '\0')strcat( buf, se.death_source_name );elsestrcat( buf, monam( mon_number, mon_type, true, DESC_PLAIN ) );break;case KILLED_BY_POISON://if (dam == -9999) strcat(buf, "an overload of ");strcat( buf, " succumbed to poison" );break;case KILLED_BY_CLOUD:if (se.auxkilldata[0] == '\0')strcat( buf, " engulfed by a cloud" );else{const int len = strlen( se.auxkilldata );// Squeeze out "a cloud of" if required. -- bwrsnprintf( scratch, sizeof(scratch), " engulfed by %s%s",(len < 15) ? "a cloud of " : "",se.auxkilldata );strcat( buf, scratch );}break;case KILLED_BY_BEAM:// keeping this short to leave room for the deep elf spellcasters:snprintf( scratch, sizeof(scratch), " %s by ",range_type_verb( se.auxkilldata ) );strcat( buf, scratch );// if death_source_name is non-null, override thisif (se.death_source_name[0] != '\0')strcat( buf, se.death_source_name );elsestrcat( buf, monam( mon_number, mon_type, true, DESC_PLAIN ) );break;/*case KILLED_BY_DEATHS_DOOR:// death's door running out - NOTE: This is no longer fatalstrcat(buf, " ran out of time");break;*/case KILLED_BY_LAVA:if (se.race == SP_MUMMY)strcat( buf, " turned to ash by lava" );elsestrcat( buf, " took a swim in lava" );break;case KILLED_BY_WATER:if (se.race == SP_MUMMY)strcat( buf, " soaked and fell apart" );elsestrcat( buf, " drowned" );break;// these three are probably only possible if you wear a ring// of >= +3 ability, get drained to 3, then take it off, or have a very// low abil and wear a -ve ring. or, as of 2.7x, mutations can cause this// Don't forget decks of cards (they have some nasty code for this) -- bwrcase KILLED_BY_STUPIDITY:strcat( buf, " died of stupidity" );break;case KILLED_BY_WEAKNESS:strcat( buf, " became too weak to continue" );break;case KILLED_BY_CLUMSINESS:strcat( buf, " slipped on a banana peel" );break;case KILLED_BY_TRAP:snprintf( scratch, sizeof(scratch), " triggered a%s trap",(se.auxkilldata[0] != '\0') ? se.auxkilldata : "" );strcat( buf, scratch );break;case KILLED_BY_LEAVING:strcat( buf, " got out of the dungeon alive" );break;case KILLED_BY_WINNING:strcat( buf, " escaped with the Orb!" );break;case KILLED_BY_QUITTING:strcat( buf, " quit the game" );break;case KILLED_BY_DRAINING:strcat( buf, " drained of all life" );break;case KILLED_BY_STARVATION:strcat( buf, " starved to death" );break;case KILLED_BY_FREEZING:strcat( buf, " froze to death" );break;case KILLED_BY_BURNING: // only sticky flamestrcat( buf, " burnt to a crisp" );break;case KILLED_BY_WILD_MAGIC:if (se.auxkilldata[0] == '\0')strcat( buf, " killed by wild magic" );else{const bool need_by = (strncmp( se.auxkilldata, "by ", 3 ) == 0);const int len = strlen( se.auxkilldata );// Squeeze out "killed" if we're getting a bit long. -- bwrsnprintf( scratch, sizeof(scratch), " %s%s%s",(len + 3 * (need_by) < 30) ? "killed" : "",(need_by) ? "by " : "",se.auxkilldata );strcat( buf, scratch );}break;case KILLED_BY_XOM: // only used for old Xom killsstrcat( buf, " killed for Xom's enjoyment" );break;case KILLED_BY_STATUE:strcat( buf, " killed by a statue" );break;case KILLED_BY_ROTTING:strcat( buf, " rotted away" );break;case KILLED_BY_TARGETTING:strcat( buf, " killed by bad targeting" );break;case KILLED_BY_SPORE:strcat( buf, " killed by an exploding spore" );break;case KILLED_BY_TSO_SMITING:strcat( buf, " smote by The Shining One" );break;case KILLED_BY_PETRIFICATION:strcat( buf, " turned to stone" );break;case KILLED_BY_SHUGGOTH:strcat( buf, " eviscerated by a hatching shuggoth" );break;case KILLED_BY_SOMETHING:strcat( buf, " died" );break;case KILLED_BY_FALLING_DOWN_STAIRS:strcat( buf, " fell down a flight of stairs" );break;case KILLED_BY_ACID:strcat( buf, " splashed by acid" );break;default:strcat( buf, " nibbled to death by software bugs" );break;} // end switchif (se.death_type != KILLED_BY_LEAVING && se.death_type != KILLED_BY_WINNING){if (se.level_type == LEVEL_ABYSS){strcat(buf, " (Abyss)");return;}else if (se.level_type == LEVEL_PANDEMONIUM){strcat(buf, " (Pan)");return;}else if (se.level_type == LEVEL_LABYRINTH){strcat(buf, " (Lab)");return;}else if (se.branch == BRANCH_VESTIBULE_OF_HELL){strcat(buf, " (Hell)"); // Gate? Vest?return;}else if (se.branch == BRANCH_HALL_OF_BLADES){strcat(buf, " (Blade)");return;}else if (se.branch == BRANCH_ECUMENICAL_TEMPLE){strcat(buf, " (Temple)");return;}snprintf( scratch, sizeof(scratch), " (%s%d)",(se.branch == BRANCH_DIS) ? "Dis " :(se.branch == BRANCH_GEHENNA) ? "Geh " :(se.branch == BRANCH_COCYTUS) ? "Coc " :(se.branch == BRANCH_TARTARUS) ? "Tar " :(se.branch == BRANCH_ORCISH_MINES) ? "Orc " :(se.branch == BRANCH_HIVE) ? "Hive " :(se.branch == BRANCH_LAIR) ? "Lair " :(se.branch == BRANCH_SLIME_PITS) ? "Slime " :(se.branch == BRANCH_VAULTS) ? "Vault " :(se.branch == BRANCH_CRYPT) ? "Crypt " :(se.branch == BRANCH_HALL_OF_ZOT) ? "Zot " :(se.branch == BRANCH_SNAKE_PIT) ? "Snake " :(se.branch == BRANCH_ELVEN_HALLS) ? "Elf " :(se.branch == BRANCH_TOMB) ? "Tomb " :(se.branch == BRANCH_SWAMP) ? "Swamp " : "DLv ",se.dlvl );strcat( buf, scratch );} // endif - killed by winningreturn;
std::string line = se.hiscore_line(scorefile_entry::DDV_ONELINE);strncpy(buf, line.c_str(), INFO_SIZE);buf[INFO_SIZE - 1] = 0;
char scratch[INFO_SIZE];int line_count = 1;// race_class_name could/used to override race & class// strcpy(scratch, se.race_class_name);// Please excuse the following bit of mess in the name of flavour ;)if (verbose){strncpy( scratch, skill_title( se.best_skill, se.best_skill_lvl,se.race, se.str, se.dex, se.god ),INFO_SIZE );snprintf( buf, HIGHSCORE_SIZE, "%8ld %s the %s (level %d",se.points, se.name, scratch, se.lvl );}else{snprintf( buf, HIGHSCORE_SIZE, "%8ld %s the %s %s (level %d",se.points, se.name, species_name(se.race, se.lvl),get_class_name(se.cls), se.lvl );}if (se.final_max_max_hp > 0) // as the other two may be negative{snprintf( scratch, INFO_SIZE, ", %d/%d", se.final_hp, se.final_max_hp );strncat( buf, scratch, HIGHSCORE_SIZE );if (se.final_max_hp < se.final_max_max_hp){snprintf( scratch, INFO_SIZE, " (%d)", se.final_max_max_hp );strncat( buf, scratch, HIGHSCORE_SIZE );}strncat( buf, " HPs", HIGHSCORE_SIZE );}strncat( buf, ((se.wiz_mode) ? ") *WIZ*" : ")"), HIGHSCORE_SIZE );hiscore_newline( buf, line_count );if (verbose){const char *const race = species_name( se.race, se.lvl );snprintf( scratch, INFO_SIZE, "Began as a%s %s %s",is_vowel(race[0]) ? "n" : "", race, get_class_name(se.cls) );strncat( buf, scratch, HIGHSCORE_SIZE );if (se.birth_time > 0){strncat( buf, " on ", HIGHSCORE_SIZE );hiscore_date_string( se.birth_time, scratch );strncat( buf, scratch, HIGHSCORE_SIZE );}strncat( buf, "." , HIGHSCORE_SIZE );hiscore_newline( buf, line_count );if (se.race != SP_DEMIGOD && se.god != -1){if (se.god == GOD_XOM){snprintf( scratch, INFO_SIZE, "Was a %sPlaything of Xom.",(se.lvl >= 20) ? "Favourite " : "" );strncat( buf, scratch, HIGHSCORE_SIZE );hiscore_newline( buf, line_count );}else if (se.god != GOD_NO_GOD){// Not exactly the same as the religon screen, but// good enough to fill this slot for now.snprintf( scratch, INFO_SIZE, "Was %s of %s%s",(se.piety > 160) ? "the Champion" :(se.piety >= 120) ? "a High Priest" :(se.piety >= 100) ? "an Elder" :(se.piety >= 75) ? "a Priest" :(se.piety >= 50) ? "a Believer" :(se.piety >= 30) ? "a Follower": "an Initiate",god_name( se.god ),(se.penance > 0) ? " (penitent)." : "." );strncat( buf, scratch, HIGHSCORE_SIZE );hiscore_newline( buf, line_count );}}}// get monster type & number, if applicableint mon_type = se.death_source;int mon_number = se.mon_num;bool needs_beam_cause_line = false;bool needs_called_by_monster_line = false;bool needs_damage = false;switch (se.death_type){case KILLED_BY_MONSTER:// GDL: here's an example of using final_hp. Verbiage could be better.// bwr: changed "blasted" since this is for meleesnprintf( scratch, INFO_SIZE, "%s %s",(se.final_hp > -6) ? "Slain by" :(se.final_hp > -14) ? "Mangled by" :(se.final_hp > -22) ? "Demolished by": "Annihilated by",(se.death_source_name[0] != '\0')? se.death_source_name: monam( mon_number, mon_type, true, DESC_PLAIN ) );strncat( buf, scratch, HIGHSCORE_SIZE );// put the damage on the weapon line if there is oneif (se.auxkilldata[0] == '\0')needs_damage = true;break;case KILLED_BY_POISON://if (dam == -9999) strcat(buf, "an overload of ");strcat( buf, "Succumbed to poison" );break;case KILLED_BY_CLOUD:if (se.auxkilldata[0] == '\0')strcat( buf, "Engulfed by a cloud" );else{snprintf( scratch, sizeof(scratch), "Engulfed by a cloud of %s",se.auxkilldata );strcat( buf, scratch );}needs_damage = true;break;case KILLED_BY_BEAM:if (isupper( se.auxkilldata[0] )) // already made (ie shot arrows){strcat( buf, se.auxkilldata );needs_damage = true;}else if (verbose && strncmp( se.auxkilldata, "by ", 3 ) == 0){// "by" is used for priest attacks where the effect is indirect// in verbose format we have another line for the monsterneeds_called_by_monster_line = true;snprintf( scratch, sizeof(scratch), "Killed %s", se.auxkilldata );strncat( buf, scratch, HIGHSCORE_SIZE );}else{// Note: This is also used for the "by" cases in non-verbose// mode since listing the monster is more imporatant.strcat( buf, "Killed from afar by " );// if death_source_name is non-null, override thisif (se.death_source_name[0] != '\0')strcat(buf, se.death_source_name);elsestrcat(buf, monam( mon_number, mon_type, true, DESC_PLAIN ));if (se.auxkilldata[0] != '\0')needs_beam_cause_line = true;}break;case KILLED_BY_LAVA:if (se.race == SP_MUMMY)strcat( buf, "Turned to ash by lava" );elsestrcat( buf, "Took a swim in molten lava" );break;case KILLED_BY_WATER:if (se.race == SP_MUMMY)strcat( buf, "Soaked and fell apart" );elsestrcat( buf, "Drowned" );break;case KILLED_BY_STUPIDITY:strcat( buf, "Forgot to breathe" );break;case KILLED_BY_WEAKNESS:strcat( buf, "Collapsed under their own weight" );break;case KILLED_BY_CLUMSINESS:strcat( buf, "Slipped on a banana peel" );break;case KILLED_BY_TRAP:snprintf( scratch, sizeof(scratch), "Killed by triggering a%s trap",(se.auxkilldata[0] != '\0') ? se.auxkilldata : "" );strcat( buf, scratch );needs_damage = true;break;case KILLED_BY_LEAVING:if (se.num_runes > 0)strcat( buf, "Got out of the dungeon" );elsestrcat( buf, "Got out of the dungeon alive!" );break;case KILLED_BY_WINNING:strcat( buf, "Escaped with the Orb" );if (se.num_runes < 1)strcat( buf, "!" );break;case KILLED_BY_QUITTING:strcat( buf, "Quit the game" );break;case KILLED_BY_DRAINING:strcat( buf, "Was drained of all life" );break;case KILLED_BY_STARVATION:strcat( buf, "Starved to death" );break;case KILLED_BY_FREEZING: // refrigeration spellstrcat( buf, "Froze to death" );needs_damage = true;break;case KILLED_BY_BURNING: // sticky flamestrcat( buf, "Burnt to a crisp" );needs_damage = true;break;case KILLED_BY_WILD_MAGIC:if (se.auxkilldata[0] == '\0')strcat( buf, "Killed by wild magic" );else{// A lot of sources for this case... some have "by" already.snprintf( scratch, sizeof(scratch), "Killed %s%s",(strncmp( se.auxkilldata, "by ", 3 ) != 0) ? "by " : "",se.auxkilldata );strcat( buf, scratch );}needs_damage = true;break;case KILLED_BY_XOM: // only used for old Xom killsstrcat( buf, "It was good that Xom killed them" );needs_damage = true;break;case KILLED_BY_STATUE:strcat( buf, "Killed by a statue" );needs_damage = true;break;case KILLED_BY_ROTTING:strcat( buf, "Rotted away" );break;case KILLED_BY_TARGETTING:strcat( buf, "Killed themselves with bad targeting" );needs_damage = true;break;case KILLED_BY_SPORE:strcat( buf, "Killed by an exploding spore" );needs_damage = true;break;case KILLED_BY_TSO_SMITING:strcat( buf, "Smote by The Shining One" );needs_damage = true;break;case KILLED_BY_PETRIFICATION:strcat( buf, "Turned to stone" );break;case KILLED_BY_SHUGGOTH:strcat( buf, "Eviscerated by a hatching shuggoth" );needs_damage = true;break;case KILLED_BY_SOMETHING:strcat( buf, "Died" );break;case KILLED_BY_FALLING_DOWN_STAIRS:strcat( buf, "Fell down a flight of stairs" );needs_damage = true;break;case KILLED_BY_ACID:strcat( buf, "Splashed by acid" );needs_damage = true;break;default:strcat( buf, "Nibbled to death by software bugs" );break;} // end switch// TODO: Eventually, get rid of "..." for cases where the text fits.if (verbose){bool done_damage = false; // paranoiaif (needs_damage && se.damage > 0){snprintf( scratch, INFO_SIZE, " (%d damage)", se.damage );strncat( buf, scratch, HIGHSCORE_SIZE );needs_damage = false;done_damage = true;}if ((se.death_type == KILLED_BY_LEAVING|| se.death_type == KILLED_BY_WINNING)&& se.num_runes > 0){hiscore_newline( buf, line_count );snprintf( scratch, INFO_SIZE, "... %s %d rune%s",(se.death_type == KILLED_BY_WINNING) ? "and" : "with",se.num_runes, (se.num_runes > 1) ? "s" : "" );strncat( buf, scratch, HIGHSCORE_SIZE );if (se.num_diff_runes > 1){snprintf( scratch, INFO_SIZE, " (of %d types)",se.num_diff_runes );strncat( buf, scratch, HIGHSCORE_SIZE );}if (se.death_time > 0&& !hiscore_same_day( se.birth_time, se.death_time )){strcat( buf, " on " );hiscore_date_string( se.death_time, scratch );strcat( buf, scratch );}strcat( buf, "!" );hiscore_newline( buf, line_count );}else if (se.death_type != KILLED_BY_QUITTING){hiscore_newline( buf, line_count );if (se.death_type == KILLED_BY_MONSTER && se.auxkilldata[0]){snprintf(scratch, INFO_SIZE, "... wielding %s", se.auxkilldata);strncat(buf, scratch, HIGHSCORE_SIZE);needs_damage = true;}else if (needs_beam_cause_line){strcat( buf, (is_vowel( se.auxkilldata[0] )) ? "... with an ": "... with a " );strcat( buf, se.auxkilldata );needs_damage = true;}else if (needs_called_by_monster_line){snprintf( scratch, sizeof(scratch), "... called down by %s",se.death_source_name );strncat( buf, scratch, HIGHSCORE_SIZE );needs_damage = true;}if (needs_damage && !done_damage){if (se.damage > 0){snprintf( scratch, INFO_SIZE, " (%d damage)", se.damage );strncat( buf, scratch, HIGHSCORE_SIZE );hiscore_newline( buf, line_count );}}}}if (se.death_type == KILLED_BY_LEAVING|| se.death_type == KILLED_BY_WINNING){// TODO: strcat "after reaching level %d"; for LEAVINGif (!verbose){if (se.num_runes > 0)strcat( buf, "!" );hiscore_newline( buf, line_count );}}else{if (verbose && se.death_type != KILLED_BY_QUITTING)strcat( buf, "..." );if (se.level_type == LEVEL_ABYSS)strcat( buf, " in the Abyss" );else if (se.level_type == LEVEL_PANDEMONIUM)strcat( buf, " in Pandemonium" );else if (se.level_type == LEVEL_LABYRINTH)strcat( buf, " in a labyrinth" );else{switch (se.branch){case BRANCH_ECUMENICAL_TEMPLE:strcat( buf, " in the Ecumenical Temple" );break;case BRANCH_HALL_OF_BLADES:strcat( buf, " in the Hall of Blades" );break;case BRANCH_VESTIBULE_OF_HELL:strcat( buf, " in the Vestibule" );break;case BRANCH_DIS:strcat( buf, " on Dis" );break;case BRANCH_GEHENNA:strcat( buf, " on Gehenna" );break;case BRANCH_COCYTUS:strcat( buf, " on Cocytus" );break;case BRANCH_TARTARUS:strcat( buf, " on Tartarus" );break;case BRANCH_ORCISH_MINES:strcat( buf, " on Orcish Mines" );break;case BRANCH_HIVE:strcat( buf, " on Hive" );break;case BRANCH_LAIR:strcat( buf, " on Lair" );break;case BRANCH_SLIME_PITS:strcat( buf, " on Slime Pits" );break;case BRANCH_VAULTS:strcat( buf, " on Vault" );break;case BRANCH_CRYPT:strcat( buf, " on Crypt" );break;case BRANCH_HALL_OF_ZOT:strcat( buf, " on Hall of Zot" );break;case BRANCH_SNAKE_PIT:strcat( buf, " on Snake Pit" );break;case BRANCH_ELVEN_HALLS:strcat( buf, " on Elven Halls" );break;case BRANCH_TOMB:strcat( buf, " on Tomb" );break;case BRANCH_SWAMP:strcat( buf, " on Swamp" );break;case BRANCH_MAIN_DUNGEON:strcat( buf, " on Dungeon" );break;}if (se.branch != BRANCH_VESTIBULE_OF_HELL&& se.branch != BRANCH_ECUMENICAL_TEMPLE&& se.branch != BRANCH_HALL_OF_BLADES){snprintf( scratch, sizeof(scratch), " Level %d", se.dlvl );strcat( buf, scratch );}}if (verbose && se.death_time&& !hiscore_same_day( se.birth_time, se.death_time )){strcat( buf, " on " );hiscore_date_string( se.death_time, scratch );strcat( buf, scratch );}strcat( buf, "." );hiscore_newline( buf, line_count );} // endif - killed by winningif (verbose){if (se.real_time > 0){char username[80] = "The";char tmp[80];#ifdef MULTIUSERif (se.uid > 0){struct passwd *pw_entry = getpwuid( se.uid );strncpy( username, pw_entry->pw_name, sizeof(username) );strncat( username, "'s", sizeof(username) );username[0] = toupper( username[0] );}#endifmake_time_string( se.real_time, tmp, sizeof(tmp) );snprintf( scratch, INFO_SIZE, "%s game lasted %s (%ld turns).",username, tmp, se.num_turns );strncat( buf, scratch, HIGHSCORE_SIZE );hiscore_newline( buf, line_count );}}return (line_count);
std::string line =se.hiscore_line(verbose?scorefile_entry::DDV_VERBOSE: scorefile_entry::DDV_NORMAL );strncpy(buf, line.c_str(), HIGHSCORE_SIZE);buf[HIGHSCORE_SIZE - 1] = 0;
}static void hs_init( struct scorefile_entry &dest ){// simple initdest.version = 0;dest.release = 0;dest.points = -1;dest.name[0] = '\0';dest.uid = 0;dest.race = 0;dest.cls = 0;dest.lvl = 0;dest.race_class_name[0] = '\0';dest.best_skill = 0;dest.best_skill_lvl = 0;dest.death_type = KILLED_BY_SOMETHING;dest.death_source = 0;dest.mon_num = 0;dest.death_source_name[0] = '\0';dest.auxkilldata[0] = '\0';dest.dlvl = 0;dest.level_type = 0;dest.branch = 0;dest.final_hp = -1;dest.final_max_hp = -1;dest.final_max_max_hp = -1;dest.str = -1;dest.intel = -1;dest.dex = -1;dest.damage = -1;dest.god = -1;dest.piety = -1;dest.penance = -1;dest.wiz_mode = 0;dest.birth_time = 0;dest.death_time = 0;dest.real_time = -1;dest.num_turns = -1;dest.num_diff_runes = 0;dest.num_runes = 0;}void hs_copy(struct scorefile_entry &dest, struct scorefile_entry &src){// simple field copy -- assume src is well constructed.dest.version = src.version;dest.release = src.release;dest.points = src.points;strcpy(dest.name, src.name);dest.uid = src.uid;dest.race = src.race;dest.cls = src.cls;dest.lvl = src.lvl;strcpy(dest.race_class_name, src.race_class_name);dest.best_skill = src.best_skill;dest.best_skill_lvl = src.best_skill_lvl;dest.death_type = src.death_type;dest.death_source = src.death_source;dest.mon_num = src.mon_num;strcpy( dest.death_source_name, src.death_source_name );strcpy( dest.auxkilldata, src.auxkilldata );dest.dlvl = src.dlvl;dest.level_type = src.level_type;dest.branch = src.branch;dest.final_hp = src.final_hp;dest.final_max_hp = src.final_max_hp;dest.final_max_max_hp = src.final_max_max_hp;dest.str = src.str;dest.intel = src.intel;dest.dex = src.dex;dest.damage = src.damage;dest.god = src.god;dest.piety = src.piety;dest.penance = src.penance;dest.wiz_mode = src.wiz_mode;dest.birth_time = src.birth_time;dest.death_time = src.death_time;dest.real_time = src.real_time;dest.num_turns = src.num_turns;dest.num_diff_runes = src.num_diff_runes;dest.num_runes = src.num_runes;
else if (strstr(inbuf, "eviscerated by a hatching") != NULL)se.death_type = KILLED_BY_SHUGGOTH;
else if (strstr(inbuf, "melted into a puddle") != NULL)se.death_type = KILLED_BY_MELTING;else if (strstr(inbuf, "bled to death") != NULL)se.death_type = KILLED_BY_BLEEDING;
// now, if we're still KILLED_BY_MONSTER, make sure that there is// a "killed by" somewhere, or else we're setting it to UNKNOWN.
// now, if we're still KILLED_BY_MONSTER, make sure that there is// a "killed by" somewhere, or else we're setting it to UNKNOWN.
}//////////////////////////////////////////////////////////////////////////// scorefile_entryscorefile_entry::scorefile_entry(int dam, int dsource, int dtype,const char *aux, bool death_cause_only){reset();init_death_cause(dam, dsource, dtype, aux);if (!death_cause_only)init();}scorefile_entry::scorefile_entry(){// Completely uninitialized, caveat user.reset();}void scorefile_entry::init_death_cause(int dam, int dsrc,int dtype, const char *aux){death_source = dsrc;death_type = dtype;damage = dam;// Set the default aux data value...// If aux is passed in (ie for a trap), we'll default to that.if (aux == NULL)auxkilldata[0] = 0;else{strncpy( auxkilldata, aux, ITEMNAME_SIZE );auxkilldata[ ITEMNAME_SIZE - 1 ] = 0;}// for death by monsterif ((death_type == KILLED_BY_MONSTER || death_type == KILLED_BY_BEAM)&& death_source >= 0 && death_source < MAX_MONSTERS){const monsters *monster = &menv[death_source];if (monster->type > 0 || monster->type <= NUM_MONSTERS){death_source = monster->type;mon_num = monster->number;// Previously the weapon was only used for dancing weapons,// but now we pass it in as a string through the scorefile// entry to be appended in hiscores_format_single in long or// medium scorefile formats.// It still isn't used in monam for anything but flying weapons// thoughif (death_type == KILLED_BY_MONSTER&& monster->inv[MSLOT_WEAPON] != NON_ITEM){// [ds] The highscore entry may be constructed while the player// is alive (for notes), so make sure we don't reveal info we// shouldn't.if (you.hp <= 0){#if HISCORE_WEAPON_DETAILset_ident_flags( mitm[monster->inv[MSLOT_WEAPON]],ISFLAG_IDENT_MASK );#else// changing this to ignore the pluses to keep it shortunset_ident_flags( mitm[monster->inv[MSLOT_WEAPON]],ISFLAG_IDENT_MASK );set_ident_flags( mitm[monster->inv[MSLOT_WEAPON]],ISFLAG_KNOW_TYPE );// clear "runed" description text to make shorter yetset_equip_desc( mitm[monster->inv[MSLOT_WEAPON]], 0 );#endif}// Setting this is redundant for dancing weapons, however// we do care about the above indentification. -- bwrif (monster->type != MONS_DANCING_WEAPON){it_name( monster->inv[MSLOT_WEAPON],DESC_NOCAP_A,info );strncpy( auxkilldata, info, ITEMNAME_SIZE );auxkilldata[ ITEMNAME_SIZE - 1 ] = 0;}}strcpy( info,monam( monster->number, monster->type, true, DESC_NOCAP_A,monster->inv[MSLOT_WEAPON] ) );strncpy( death_source_name, info, 40 );death_source_name[39] = 0;}}else{death_source = death_source;mon_num = 0;death_source_name[0] = 0;}}void scorefile_entry::reset(){// simple initversion = 0;release = 0;points = -1;name[0] = 0;uid = 0;race = 0;cls = 0;lvl = 0;race_class_name[0] = 0;best_skill = 0;best_skill_lvl = 0;death_type = KILLED_BY_SOMETHING;death_source = 0;mon_num = 0;death_source_name[0] = 0;auxkilldata[0] = 0;dlvl = 0;level_type = 0;branch = 0;final_hp = -1;final_max_hp = -1;final_max_max_hp = -1;str = -1;intel = -1;dex = -1;damage = -1;god = -1;piety = -1;penance = -1;wiz_mode = 0;birth_time = 0;death_time = 0;real_time = -1;num_turns = -1;num_diff_runes = 0;num_runes = 0;}void scorefile_entry::init(){// Score file entry version://// 4.0 - original versioned entry// 4.1 - added real_time and num_turn fields// 4.2 - stats and god infoversion = 4;release = 2;strncpy( name, you.your_name, sizeof name );name[ sizeof(name) - 1 ] = 0;#ifdef MULTIUSERuid = (int) getuid();#elseuid = 0;#endif// do points first.points = you.gold;points += (you.experience * 7) / 10;//if (death_type == KILLED_BY_WINNING) points += points / 2;//if (death_type == KILLED_BY_LEAVING) points += points / 10;// these now handled by giving player the value of their inventorychar temp_id[4][50];for (int d = 0; d < 4; d++){for (int e = 0; e < 50; e++)temp_id[d][e] = 1;}FixedVector< int, NUM_RUNE_TYPES > rune_array;num_runes = 0;num_diff_runes = 0;for (int i = 0; i < NUM_RUNE_TYPES; i++)rune_array[i] = 0;// Calculate value of pack and runes when character leaves dungeonif (death_type == KILLED_BY_LEAVING || death_type == KILLED_BY_WINNING){for (int d = 0; d < ENDOFPACK; d++){if (is_valid_item( you.inv[d] )){points += item_value( you.inv[d], temp_id, true );if (you.inv[d].base_type == OBJ_MISCELLANY&& you.inv[d].sub_type == MISC_RUNE_OF_ZOT){if (rune_array[ you.inv[d].plus ] == 0)num_diff_runes++;num_runes += you.inv[d].quantity;rune_array[ you.inv[d].plus ] += you.inv[d].quantity;}}}// Bonus for exploring different areas, not for collecting a// huge stack of demonic runes in Pandemonium (gold value// is enough for those). -- bwrif (num_diff_runes >= 3)points += ((num_diff_runes + 2) * (num_diff_runes + 2) * 1000);}// Players will have a hard time getting 1/10 of this (see XP cap):if (points > 99999999)points = 99999999;race = you.species;cls = you.char_class;race_class_name[0] = 0;lvl = you.experience_level;best_skill = ::best_skill( SK_FIGHTING, NUM_SKILLS - 1, 99 );best_skill_lvl = you.skills[ best_skill ];final_hp = you.hp;final_max_hp = you.hp_max;final_max_max_hp = you.hp_max + player_rotted();str = you.strength;intel = you.intel;dex = you.dex;god = you.religion;if (you.religion != GOD_NO_GOD){piety = you.piety;penance = you.penance[you.religion];}// main dungeon: level is simply leveldlvl = you.your_level + 1;switch (you.where_are_you){case BRANCH_ORCISH_MINES:case BRANCH_HIVE:case BRANCH_LAIR:case BRANCH_SLIME_PITS:case BRANCH_VAULTS:case BRANCH_CRYPT:case BRANCH_HALL_OF_BLADES:case BRANCH_HALL_OF_ZOT:case BRANCH_ECUMENICAL_TEMPLE:case BRANCH_SNAKE_PIT:case BRANCH_ELVEN_HALLS:case BRANCH_TOMB:case BRANCH_SWAMP:dlvl = you.your_level - you.branch_stairs[you.where_are_you - 10];break;case BRANCH_DIS:case BRANCH_GEHENNA:case BRANCH_VESTIBULE_OF_HELL:case BRANCH_COCYTUS:case BRANCH_TARTARUS:case BRANCH_INFERNO:case BRANCH_THE_PIT:dlvl = you.your_level - 26;break;}branch = you.where_are_you; // no adjustments necessary.level_type = you.level_type; // pandemonium, labyrinth, dungeon..birth_time = you.birth_time; // start time of gamedeath_time = time( NULL ); // end time of gameif (you.real_time != -1)real_time = you.real_time + (death_time - you.start_time);elsereal_time = -1;num_turns = you.num_turns;#ifdef WIZARDwiz_mode = (you.wizard ? 1 : 0);#elsewiz_mode = 0;#endif
std::string scorefile_entry::hiscore_line(death_desc_verbosity verbosity) const{std::string line = character_description(verbosity);line += death_description(verbosity);line += death_place(verbosity);line += game_time(verbosity);return (line);}std::string scorefile_entry::game_time(death_desc_verbosity verbosity) const{std::string line;if (verbosity == DDV_VERBOSE){if (real_time > 0){char username[80] = "The";char scratch[INFO_SIZE];char tmp[80];#ifdef MULTIUSERif (uid > 0){struct passwd *pw_entry = getpwuid( uid );strncpy( username, pw_entry->pw_name, sizeof(username) );strncat( username, "'s", sizeof(username) );username[0] = toupper( username[0] );}#endifmake_time_string( real_time, tmp, sizeof(tmp) );snprintf( scratch, INFO_SIZE, "%s game lasted %s (%ld turns).",username, tmp, num_turns );line += scratch;line += hiscore_newline_string();}}return (line);}const char *scorefile_entry::damage_verb() const{// GDL: here's an example of using final_hp. Verbiage could be better.// bwr: changed "blasted" since this is for meleereturn (final_hp > -6) ? "Slain" :(final_hp > -14) ? "Mangled" :(final_hp > -22) ? "Demolished" :"Annihilated";}const char *scorefile_entry::death_source_desc() const{if (death_type != KILLED_BY_MONSTER && death_type != KILLED_BY_BEAM)return ("");return (*death_source_name?death_source_name: monam( mon_num, death_source, true, DESC_PLAIN ) );}std::string scorefile_entry::damage_string(bool terse) const{char scratch[50];snprintf( scratch, sizeof scratch, "(%d%s)", damage,terse? "" : " damage" );return (scratch);}std::string scorefile_entry::strip_article_a(const std::string &s) const{if (s.find("a ") == 0)return (s.substr(2));else if (s.find("an ") == 0)return (s.substr(3));return (s);}std::string scorefile_entry::terse_missile_cause() const{std::string cause;std::string aux = auxkilldata;std::string monster_prefix = " by ";// We're looking for Shot with a%s %s by %s/ Hit by a%s %s thrown by %sstd::string::size_type by = aux.rfind(monster_prefix);if (by == std::string::npos)return ("???");std::string mcause = aux.substr(by + monster_prefix.length());mcause = strip_article_a(mcause);std::string missile;const std::string pre_post[][2] = {{ "Shot with a", " by " },{ "Hit by a", " thrown by " }};for (unsigned i = 0; i < sizeof(pre_post) / sizeof(*pre_post); ++i){if (aux.find(pre_post[i][0]) != 0)continue;std::string::size_type end = aux.rfind(pre_post[i][1]);if (end == std::string::npos)continue;int istart = pre_post[i][0].length();int nchars = end - istart;missile = aux.substr(istart, nchars);// Was this prefixed by "an"?if (missile.find("n ") == 0)missile = missile.substr(2);}if (missile.length())mcause += "/" + missile;return (mcause);}std::string scorefile_entry::terse_beam_cause() const{std::string cause = auxkilldata;if (cause.find("by ") == 0 || cause.find("By ") == 0)cause = cause.substr(3);return (cause);}std::string scorefile_entry::terse_wild_magic() const{return terse_beam_cause();}std::string scorefile_entry::terse_trap() const{std::string trap = *auxkilldata? std::string(auxkilldata) + " trap": "trap";if (trap.find("n ") == 0)trap = trap.substr(2);trim_string(trap);return (trap);}std::string scorefile_entry::single_cdesc() const{char scratch[INFO_SIZE];char buf[INFO_SIZE];if (!*race_class_name){snprintf( scratch, sizeof(scratch), "%s%s",get_species_abbrev( race ), get_class_abbrev( cls ) );}else{strncpy( scratch, race_class_name, sizeof scratch );scratch[ sizeof(scratch) - 1 ] = 0;}std::string scname = name;if (scname.length() > 10)scname = scname.substr(0, 10);snprintf( buf, sizeof buf,"%8ld %-10s %s-%02d%s", points, scname.c_str(),scratch, lvl, (wiz_mode == 1) ? "W" : "" );return (buf);}std::stringscorefile_entry::character_description(death_desc_verbosity verbosity) const{bool single = verbosity == DDV_TERSE || verbosity == DDV_ONELINE;if (single)return single_cdesc();bool verbose = verbosity == DDV_VERBOSE;char scratch[INFO_SIZE];char buf[INFO_SIZE];std::string desc;// Please excuse the following bit of mess in the name of flavour ;)if (verbose){strncpy( scratch, skill_title( best_skill, best_skill_lvl,race, str, dex, god ),INFO_SIZE );snprintf( buf, HIGHSCORE_SIZE, "%8ld %s the %s (level %d",points, name, scratch, lvl );desc = buf;}else{snprintf( buf, HIGHSCORE_SIZE, "%8ld %s the %s %s (level %d",points, name, species_name(race, lvl),get_class_name(cls), lvl );desc = buf;}if (final_max_max_hp > 0) // as the other two may be negative{snprintf( scratch, INFO_SIZE, ", %d/%d", final_hp, final_max_hp );desc += scratch;if (final_max_hp < final_max_max_hp){snprintf( scratch, INFO_SIZE, " (%d)", final_max_max_hp );desc += scratch;}desc += " HPs";}desc += wiz_mode? ") *WIZ*" : ")";desc += hiscore_newline_string();if (verbose){const char *const srace = species_name( race, lvl );snprintf( scratch, INFO_SIZE, "Began as a%s %s %s",is_vowel(*srace) ? "n" : "", srace, get_class_name(cls) );desc += scratch;if (birth_time > 0){desc += " on ";hiscore_date_string( birth_time, scratch );desc += scratch;}desc += ".";desc += hiscore_newline_string();if (race != SP_DEMIGOD && god != -1){if (god == GOD_XOM){snprintf( scratch, INFO_SIZE, "Was a %sPlaything of Xom.",(lvl >= 20) ? "Favourite " : "" );desc += scratch;desc += hiscore_newline_string();}else if (god != GOD_NO_GOD){// Not exactly the same as the religon screen, but// good enough to fill this slot for now.snprintf( scratch, INFO_SIZE, "Was %s of %s%s",(piety > 160) ? "the Champion" :(piety >= 120) ? "a High Priest" :(piety >= 100) ? "an Elder" :(piety >= 75) ? "a Priest" :(piety >= 50) ? "a Believer" :(piety >= 30) ? "a Follower": "an Initiate",god_name( god ),(penance > 0) ? " (penitent)." : "." );desc += scratch;desc += hiscore_newline_string();}}}return (desc);}std::string scorefile_entry::death_place(death_desc_verbosity verbosity) const{bool verbose = verbosity == DDV_VERBOSE;std::string place;if (death_type == KILLED_BY_LEAVING || death_type == KILLED_BY_WINNING)return ("");char scratch[ INFO_SIZE ];if (verbosity == DDV_ONELINE || verbosity == DDV_TERSE){snprintf( scratch, sizeof scratch, " (%s)",place_name(get_packed_place(branch, dlvl, level_type),false, true).c_str());return (scratch);}if (verbose && death_type != KILLED_BY_QUITTING)place += "...";// where did we die?std::string placename =place_name(get_packed_place(branch, dlvl, level_type),true, true);// add appropriate prefixif (placename.find("Level") == 0)place += " on ";elseplace += " in ";place += placename;if (verbose && death_time&& !hiscore_same_day( birth_time, death_time )){place += " on ";hiscore_date_string( death_time, scratch );place += scratch;}place += ".";place += hiscore_newline_string();return (place);}std::stringscorefile_entry::death_description(death_desc_verbosity verbosity) const{bool needs_beam_cause_line = false;bool needs_called_by_monster_line = false;bool needs_damage = false;bool terse = verbosity == DDV_TERSE;bool verbose = verbosity == DDV_VERBOSE;bool oneline = verbosity == DDV_ONELINE;char scratch[INFO_SIZE];std::string desc;if (oneline)desc = " ";switch (death_type){case KILLED_BY_MONSTER:if (terse)desc += death_source_desc();else if (oneline)desc += std::string("slain by ") + death_source_desc();else{snprintf( scratch, sizeof scratch, "%s by %s",damage_verb(),death_source_desc() );desc += scratch;}// put the damage on the weapon line if there is oneif (auxkilldata[0] == 0)needs_damage = true;break;case KILLED_BY_POISON:desc += terse? "poison" : "Succumbed to poison";break;case KILLED_BY_CLOUD:if (auxkilldata[0] == 0)desc += terse? "cloud" : "Engulfed by a cloud";else{snprintf( scratch, sizeof(scratch), "%scloud of %s",terse? "" : "Engulfed by a ",auxkilldata );desc += scratch;}needs_damage = true;break;case KILLED_BY_BEAM:if (oneline){// keeping this short to leave room for the deep elf spellcasters:snprintf( scratch, sizeof(scratch), "%s by ",range_type_verb( auxkilldata ) );desc += scratch;desc += death_source_desc();}else if (isupper( auxkilldata[0] )) // already made (ie shot arrows){// If terse we have to parse the information from the string.// Darn it to heck.desc += terse? terse_missile_cause() : auxkilldata;needs_damage = true;}else if (verbose && strncmp( auxkilldata, "by ", 3 ) == 0){// "by" is used for priest attacks where the effect is indirect// in verbose format we have another line for the monsterneeds_called_by_monster_line = true;snprintf( scratch, sizeof(scratch), "Killed %s", auxkilldata );desc += scratch;}else{// Note: This is also used for the "by" cases in non-verbose// mode since listing the monster is more imporatant.if (!terse)desc += "Killed from afar by ";desc += death_source_desc();if (*auxkilldata)needs_beam_cause_line = true;needs_damage = true;}break;case KILLED_BY_CURARE:desc += terse? "asphyx" : "Asphyxiated";break;case KILLED_BY_LAVA:if (terse)desc += "lava";else{if (race == SP_MUMMY)desc += "Turned to ash by lava";elsedesc += "Took a swim in molten lava";}break;case KILLED_BY_WATER:if (race == SP_MUMMY)desc += terse? "fell apart" : "Soaked and fell apart";elsedesc += terse? "drowned" : "Drowned";break;case KILLED_BY_STUPIDITY:desc += terse? "stupidity" : "Forgot to breathe";break;case KILLED_BY_WEAKNESS:desc += terse? "collapsed " : "Collapsed under their own weight";break;case KILLED_BY_CLUMSINESS:desc += terse? "clumsiness" : "Slipped on a banana peel";break;case KILLED_BY_TRAP:if (terse)desc += terse_trap();else{snprintf( scratch, sizeof(scratch), "Killed by triggering a%s trap",(*auxkilldata) ? auxkilldata : "" );desc += scratch;}needs_damage = true;break;case KILLED_BY_LEAVING:if (terse)desc += "left";else{if (num_runes > 0)desc += "Got out of the dungeon";elsedesc += "Got out of the dungeon alive";}break;case KILLED_BY_WINNING:desc += terse? "escaped" : "Escaped with the Orb";if (num_runes < 1)desc += "!";break;case KILLED_BY_QUITTING:desc += terse? "quit" : "Quit the game";break;case KILLED_BY_DRAINING:desc += terse? "drained" : "Was drained of all life";break;case KILLED_BY_STARVATION:desc += terse? "starvation" : "Starved to death";break;case KILLED_BY_FREEZING: // refrigeration spelldesc += terse? "frozen" : "Froze to death";needs_damage = true;break;case KILLED_BY_BURNING: // sticky flamedesc += terse? "burnt" : "Burnt to a crisp";needs_damage = true;break;case KILLED_BY_WILD_MAGIC:if (!*auxkilldata)desc += terse? "wild magic" : "Killed by wild magic";else{if (terse)desc += terse_wild_magic();else{// A lot of sources for this case... some have "by" already.snprintf( scratch, sizeof(scratch), "Killed %s%s",(strncmp( auxkilldata, "by ", 3 ) != 0) ? "by " : "",auxkilldata );desc += scratch;}}needs_damage = true;break;case KILLED_BY_XOM: // only used for old Xom killsdesc += terse? "xom" : "Killed for Xom's enjoyment";needs_damage = true;break;case KILLED_BY_STATUE:desc += terse? "statue" : "Killed by a statue";needs_damage = true;break;case KILLED_BY_ROTTING:desc += terse? "rotting" : "Rotted away";break;case KILLED_BY_TARGETTING:desc += terse? "shot self" : "Killed themselves with bad targeting";needs_damage = true;break;case KILLED_BY_SPORE:desc += terse? "spore" : "Killed by an exploding spore";needs_damage = true;break;case KILLED_BY_TSO_SMITING:desc += terse? "smote by Shining One" : "Smote by The Shining One";needs_damage = true;break;case KILLED_BY_PETRIFICATION:desc += terse? "petrified" : "Turned to stone";break;case KILLED_BY_MELTING:desc += terse? "melted" : " melted into a puddle";break;case KILLED_BY_BLEEDING:desc += terse? "bleeding" : " bled to death";break;case KILLED_BY_SOMETHING:if (auxkilldata)desc += auxkilldata;elsedesc += terse? "died" : "Died";needs_damage = true;break;case KILLED_BY_FALLING_DOWN_STAIRS:desc += terse? "fell downstairs" : "Fell down a flight of stairs";needs_damage = true;break;case KILLED_BY_ACID:desc += terse? "acid" : "Splashed by acid";needs_damage = true;break;default:desc += terse? "program bug" : "Nibbled to death by software bugs";break;} // end switchif (oneline && desc.length() > 2)desc[1] = tolower(desc[1]);// TODO: Eventually, get rid of "..." for cases where the text fits.if (terse){if (death_type == KILLED_BY_MONSTER && *auxkilldata){desc += "/";desc += strip_article_a(auxkilldata);needs_damage = true;}else if (needs_beam_cause_line)desc += "/" + terse_beam_cause();else if (needs_called_by_monster_line)desc += death_source_name;if (needs_damage && damage > 0)desc += " " + damage_string(true);}else if (verbose){bool done_damage = false; // paranoiaif (needs_damage && damage > 0){desc += " " + damage_string();needs_damage = false;done_damage = true;}if ((death_type == KILLED_BY_LEAVING|| death_type == KILLED_BY_WINNING)&& num_runes > 0){desc += hiscore_newline_string();snprintf( scratch, INFO_SIZE, "... %s %d rune%s",(death_type == KILLED_BY_WINNING) ? "and" : "with",num_runes, (num_runes > 1) ? "s" : "" );desc += scratch;if (num_diff_runes > 1){snprintf( scratch, INFO_SIZE, " (of %d types)",num_diff_runes );desc += scratch;}if (death_time > 0&& !hiscore_same_day( birth_time, death_time )){desc += " on ";hiscore_date_string( death_time, scratch );desc += scratch;}desc += "!";desc += hiscore_newline_string();}else if (death_type != KILLED_BY_QUITTING){desc += hiscore_newline_string();if (death_type == KILLED_BY_MONSTER && auxkilldata[0]){snprintf(scratch, INFO_SIZE, "... wielding %s", auxkilldata);desc += scratch;needs_damage = true;}else if (needs_beam_cause_line){desc += (is_vowel( auxkilldata[0] )) ? "... with an ": "... with a ";desc += auxkilldata;needs_damage = true;}else if (needs_called_by_monster_line){snprintf( scratch, sizeof(scratch), "... called down by %s",death_source_name );desc += scratch;needs_damage = true;}if (needs_damage && !done_damage && damage > 0)desc += " " + damage_string();if (needs_damage)desc += hiscore_newline_string();}}if (!oneline){if (death_type == KILLED_BY_LEAVING|| death_type == KILLED_BY_WINNING){// TODO: strcat "after reaching level %d"; for LEAVINGif (verbosity == DDV_NORMAL){if (num_runes > 0)desc += "!";}desc += hiscore_newline_string();}}if (terse){trim_string(desc);desc = strip_article_a(desc);}return (desc);}
// look for a butchering implement, prompting user if no obvious// options exist. Returns whether a weapon was switched.static bool find_butchering_implement() {// look for a butchering implement in your packfor (int i = 0; i < ENDOFPACK; ++i) {if (is_valid_item( you.inv[i] )&& can_cut_meat( you.inv[i] )&& you.inv[i].base_type == OBJ_WEAPONS&& item_known_uncursed(you.inv[i])&& item_ident( you.inv[i], ISFLAG_KNOW_TYPE )&& get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION&& can_wield( &you.inv[i] )){mpr("Switching to a butchering implement.");wield_weapon( true, i, false );
// Account for the weapon switch...we're doing this here// since the above switch may reveal information about the// weapon (curse status, ego type). So even if the// character fails to or decides not to butcher past this// point, they have achieved something and there should be// a cost.start_delay( DELAY_UNINTERRUPTIBLE, 1 );return true;}}// if we didn't swap above, then we still can't cut...let's call// wield_weapon() in the "prompt the user" way...// prompt for new weaponint old_weapon = you.equip[EQ_WEAPON];mpr( "What would you like to use?", MSGCH_PROMPT );wield_weapon( false );// let's see if the user did something...return (you.equip[EQ_WEAPON] != old_weapon);}
&& (you.species == SP_TROLL|| you.species == SP_GHOUL|| you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS|| you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON|| you.mutation[MUT_CLAWS]);
&& (you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS ||you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON ||(you.attribute[ATTR_TRANSFORMATION] == TRAN_NONE &&(you.species == SP_TROLL ||you.species == SP_GHOUL ||you.mutation[MUT_CLAWS])));
}if (barehand_butcher)can_butcher = true;else{if (you.equip[EQ_WEAPON] != -1){can_butcher = can_cut_meat( you.inv[you.equip[EQ_WEAPON]].base_type,you.inv[you.equip[EQ_WEAPON]].sub_type );}// Should probably check for cursed-weapons, bare hands and// non-weapons in hand here, but wield_weapon will be used for// this swap and it will do all that (although the player might// be annoyed with the excess prompt).if (Options.easy_butcher && !can_butcher){//mv: check for berserk firstif (you.berserker){mpr ("You are too berserk to search for a butchering knife!");return (false);}// We'll now proceed to look through the entire inventory for// choppers/slicers. We'll skip special weapons because// wielding/unwielding a foo of distortion would be disastrous.for (int i = 0; i < ENDOFPACK; ++i){if (is_valid_item( you.inv[i] )&& can_cut_meat( you.inv[i].base_type,you.inv[i].sub_type )&& you.inv[i].base_type == OBJ_WEAPONS&& item_known_uncursed(you.inv[i])&& item_ident( you.inv[i], ISFLAG_KNOW_TYPE )&& get_weapon_brand(you.inv[i])!= SPWPN_DISTORTION&& can_wield( you.inv[i] )){mpr("Switching to a butchering implement.");wpn_switch = true;wield_weapon( true, i, false );break;}}// if we didn't swap above, then we still can't cut... let's// call wield_weapon() in the "prompt the user" way...if (!wpn_switch){// prompt for new weaponmpr( "What would you like to use?", MSGCH_PROMPT );wield_weapon( false );// let's see if the user did something...if (you.equip[EQ_WEAPON] != old_weapon)wpn_switch = true;}}// weapon might have changed (to bare hands as well), we'll// update the can_butcher status accordingly (note: if we could// butcher with our bare hands we wouldn't be here) -- bwrif (wpn_switch && you.equip[EQ_WEAPON] != -1){can_butcher = can_cut_meat( you.inv[you.equip[EQ_WEAPON]].base_type,you.inv[you.equip[EQ_WEAPON]].sub_type );}}// Account for the weapon switch above if it happened... we're// doing this here since the above switch may reveal information// about the weapon (curse status, ego type). So even if the// character fails to or decides not to butcher past this point,// they have achieved something and there should be a cost.if (wpn_switch)start_delay( DELAY_UNINTERUPTABLE, 1, old_weapon );// check to see if the new implement is cursed - if so, set a// flag indicating this. If a player actually butchers anything,// this flag can be checked before switching back.int wpn = you.equip[EQ_WEAPON];if (wpn != -1&& you.inv[wpn].base_type == OBJ_WEAPONS&& item_cursed( you.inv[wpn] )){new_cursed = true;
if (you.equip[ EQ_GLOVES ] == -1)mpr("What, with your bare hands?");elsempr("You can't use your claws with your gloves on!");// Switching back to avoid possible bug where player can use// this to switch weapons in zero time.if (wpn_switch)weapon_switch( old_weapon );
mpr("You can't reach the floor from up here.");
// Switching back to avoid possible bug where player can use// this to switch weapons in zero time.if (wpn_switch && !new_cursed)weapon_switch( old_weapon );return (false);
// It makes more sense that you first find out if there's anything// to butcher, *then* decide to actually butcher it.// The old code did it the other way.if ( !can_butcher && you.berserker ) {mpr ("You are too berserk to search for a butchering knife!");return (false);
int objl = igrd[you.x_pos][you.y_pos];int hrg = 0;int counter = 0;while (objl != NON_ITEM){counter++;last_item = objl;hrg = mitm[objl].link;objl = hrg;items_here++;if (counter > 1000){error_message_to_player();if (wpn_switch && !new_cursed)weapon_switch( old_weapon );return (false);}}if (items_here == 1&& (mitm[igrd[you.x_pos][you.y_pos]].base_type == OBJ_CORPSES &&mitm[igrd[you.x_pos][you.y_pos]].sub_type == CORPSE_BODY)){strcpy(info, "Butcher ");it_name(igrd[you.x_pos][you.y_pos], DESC_NOCAP_A, str_pass);strcat(info, str_pass);strcat(info, "\?");mpr(info, MSGCH_PROMPT);unsigned char keyin = getch();
if ( (mitm[objl].base_type != OBJ_CORPSES) ||(mitm[objl].sub_type != CORPSE_BODY) )continue;
if (keyin == 0){getch();keyin = 0;}
// offer the possibility of butcheringit_name(objl, DESC_NOCAP_A, str_pass);snprintf(info, INFO_SIZE, "Butcher %s?", str_pass);int answer = yesnoquit( info, true, 'n', false );if ( answer == -1 )break;if ( answer == 0 )continue;if ( Options.easy_butcher && !can_butcher ) {
if (keyin != 'y' && keyin != 'Y'){if (wpn_switch && !new_cursed)weapon_switch( old_weapon );return (false);}int item_got = igrd[you.x_pos][you.y_pos];
// try to find a butchering implementwpn_switch = find_butchering_implement();const int wpn = you.equip[EQ_WEAPON];if ( wpn_switch ) {new_cursed =(wpn != -1) &&(you.inv[wpn].base_type == OBJ_WEAPONS) &&item_cursed( you.inv[wpn]);}// note that barehanded butchery would not reach this// stage, so if wpn == -1 the user selected '-' when// switching weaponsif (!wpn_switch || wpn == -1 || !can_cut_meat(you.inv[wpn])) {// still can't butcher. Early outif ( wpn == -1 ) {if (you.equip[EQ_GLOVES] == -1)mpr("What, with your bare hands?");elsempr("Your gloves aren't that sharp!");}elsempr("Maybe you should try using a sharper implement.");if ( !new_cursed && wpn_switch )start_delay( DELAY_WEAPON_SWAP, 1, old_weapon );return false;}// switched to a good butchering knifecan_butcher = true;}
if (you.duration[DUR_PRAYER]&& (you.religion == GOD_OKAWARU|| you.religion == GOD_MAKHLEB || you.religion == GOD_TROG)){offer_corpse(item_got);destroy_item(item_got);// XXX: need an extra turn here for weapon swapping?}else{int work_req = 3 - mitm[item_got].plus2;if (work_req < 0)work_req = 0;
if (you.duration[DUR_PRAYER] &&(you.religion == GOD_OKAWARU || you.religion == GOD_MAKHLEB ||you.religion == GOD_TROG)) {offer_corpse(objl);destroy_item(objl);}else {int work_req = 3 - mitm[objl].plus2;if (work_req < 0)work_req = 0;
you.turn_is_over = 1;return (true);} // end "if items_here == 1"else if (items_here > 1){last_item = NON_ITEM;o = igrd[you.x_pos][you.y_pos];for (k = 0; k < items_here; k++){if (mitm[o].base_type != OBJ_CORPSES|| mitm[o].sub_type != CORPSE_BODY){goto out_of_eating;}strcpy(info, "Butcher ");it_name(o, DESC_NOCAP_A, str_pass);strcat(info, str_pass);strcat(info, "\?");mpr(info, MSGCH_PROMPT);keyin = getch();if (keyin == 0){getch();keyin = 0;}if (keyin == 'q'){if (wpn_switch && !new_cursed)weapon_switch( old_weapon );return (false);}if (keyin == 'y'){item_got = o;if (barehand_butcher)mpr("You start tearing the corpse apart.");elsempr("You start hacking away.");if (you.duration[DUR_PRAYER]&& (you.religion == GOD_OKAWARU|| you.religion == GOD_MAKHLEB|| you.religion == GOD_TROG)){offer_corpse(item_got);destroy_item(item_got);// XXX: need an extra turn here for weapon swapping?}else{int work_req = 3 - mitm[item_got].plus2;if (work_req < 0)work_req = 0;start_delay( DELAY_BUTCHER, work_req, item_got );}if (wpn_switch && !new_cursed){// weapon_switch( old_weapon );// need to count the swap delay in this casestart_delay( DELAY_WEAPON_SWAP, 1, old_weapon );}you.turn_is_over = 1;return (true);}out_of_eating:if (is_valid_item( mitm[o] ))last_item = o;
static const char *chunk_flavour_phrase(bool likes_chunks){const char *phrase =likes_chunks? "tastes great." : "tastes terrible.";const int gourmand = you.duration[DUR_GOURMAND];if (gourmand >= GOURMAND_MAX)phrase =one_chance_in(8)? "tastes like chicken!": "tastes great.";else if (gourmand > GOURMAND_MAX * 75 / 100)phrase = "tastes very good.";else if (gourmand > GOURMAND_MAX * 50 / 100)phrase = "tastes good.";else if (gourmand > GOURMAND_MAX * 25 / 100)phrase = "is not very appetising.";
return (phrase);}void chunk_nutrition_message(int nutrition){int perc_nutrition = nutrition * 100 / CHUNK_BASE_NUTRITION;if (perc_nutrition < 15)mpr("That was extremely unsatisfying.");else if (perc_nutrition < 35)mpr("That was not very filling.");}static int chunk_nutrition(bool likes_chunks){int nutrition = CHUNK_BASE_NUTRITION;if (likes_chunks || you.hunger_state < HS_SATIATED)return (nutrition);const int gourmand =wearing_amulet(AMU_THE_GOURMAND)?you.duration[DUR_GOURMAND]: 0;int effective_nutrition =nutrition * (gourmand + GOURMAND_NUTRITION_BASE)/ (GOURMAND_MAX + GOURMAND_NUTRITION_BASE);#ifdef DEBUG_DIAGNOSTICSconst int epercent = effective_nutrition * 100 / nutrition;mprf(MSGCH_DIAGNOSTICS,"Gourmand factor: %d, chunk base: %d, effective: %d, %%: %d",gourmand,nutrition,effective_nutrition,epercent);#endifreturn (effective_nutrition);}static void say_chunk_flavour(bool likes_chunks){mprf("This raw flesh %s", chunk_flavour_phrase(likes_chunks));}
strcpy(info, "This raw flesh ");strcat(info, (likes_chunks) ? "tastes good.": "is not very appetising.");mpr(info);start_delay( DELAY_EAT, 2 );lessen_hunger( 1000, true );
{say_chunk_flavour(likes_chunks);const int nutrition = chunk_nutrition(likes_chunks);start_delay( DELAY_EAT, 2, nutrition );lessen_hunger( nutrition, true );
// last updated 12may2000 {dlb}/* ************************************************************************ called from: acr - misc* *********************************************************************** */#if 0void load( unsigned char stair_taken, bool moving_level,bool was_a_labyrinth, char old_level, bool want_followers,bool is_new_game, char where_were_you2 );#endif
std::string datafile_path(const std::string &basename);void check_savedir(std::string &dir);
char filename[1200];#ifdef SAVE_DIR_PATHsnprintf(filename, sizeof filename, SAVE_DIR_PATH "%s%d%s.%s",prefix, (int) getuid(), suffix, extension);
#ifdef MULTIUSERchar struid[20];snprintf( struid, sizeof struid, "%d", (int)getuid() );return std::string(struid);
snprintf(filename, sizeof filename, "%s%s.%s",prefix, suffix, extension);
return std::string();#endif}static bool is_uid_file(const std::string &name, const std::string &ext){std::string save_suffix = get_savedir_filename("", "", "");save_suffix += ext;
save_suffix = save_suffix.substr(Options.save_dir.length());std::string::size_type suffix_pos = name.find(save_suffix);return (suffix_pos != std::string::npos&& suffix_pos == name.length() - save_suffix.length()&& suffix_pos != 0#ifdef MULTIUSER// See verifyPlayerName() in newgame.cc&& !isdigit(name[suffix_pos - 1])
void make_filename( char *buf, const char *prefix, int level, int where,bool isLabyrinth, bool isGhost )
// Returns a full player struct read from the save.static player read_character_info(const std::string &savefile)
UNUSED( isGhost );
player fromfile;player backup = you;FILE *charf = fopen(savefile.c_str(), "rb");if (!charf)return fromfile;char majorVersion = 0;char minorVersion = 0;if (!determine_version(charf, majorVersion, minorVersion))goto done_reading_character;if (majorVersion != SAVE_MAJOR_VERSION)goto done_reading_character;restore_tagged_file(charf, TAGTYPE_PLAYER_NAME, minorVersion);fromfile = you;you = backup;
strcpy(suffix, (level < 10) ? "0" : "");itoa(level, lvl, 10);strcat(suffix, lvl);suffix[2] = where + 97;suffix[3] = '\0';
// Returns the names of all files in the given directory. Note that the// filenames returned are relative to the directory.static std::vector<std::string> get_dir_files(const std::string &dirname){std::vector<std::string> files;
#ifdef SAVE_DIR_PATHstrcpy(buf, SAVE_DIR_PATH);
while (dirent *entry = readdir(dir)){std::string name = entry->d_name;if (name == "." || name == "..")continue;files.push_back(name);}closedir(dir);return (files);}static bool file_exists(const std::string &name){FILE *f = fopen(name.c_str(), "r");const bool exists = !!f;if (f)fclose(f);return (exists);}// Low-tech existence check.static bool dir_exists(const std::string &dir){DIR *d = opendir(dir.c_str());const bool exists = !!d;if (d)closedir(d);return (exists);}static int create_directory(const char *dir){#if defined(MULTIUSER)return mkdir(dir, SHARED_FILES_CHMOD_PUBLIC | 0111);#elif defined(DOS)// djgpp doesn't seem to have mkdir.return (-1);#elsereturn mkdir(dir);
strncpy(finalprefix, prefix, kFileNameLen);finalprefix[kFileNameLen] = '\0';
static bool create_dirs(const std::string &dir){std::string sep = " ";sep[0] = FILE_SEPARATOR;std::vector<std::string> segments =split_string(sep.c_str(),dir,false,false);std::string path;for (int i = 0, size = segments.size(); i < size; ++i){path += segments[i];path += FILE_SEPARATOR;if (!dir_exists(path) && create_directory(path.c_str()))return (false);}return (true);}std::string datafile_path(const std::string &basename){std::string cdir = SysEnv.crawl_dir? SysEnv.crawl_dir : "";const std::string rawbases[] = {#ifdef DATA_DIR_PATHDATA_DIR_PATH,#elsecdir,#endif};
strcat(buf, ".");if (isLabyrinth)strcat(buf, "lab"); // temporary levelelsestrcat(buf, suffix);
for (unsigned b = 0, size = bases.size(); b < size; ++b){for (unsigned p = 0; p < sizeof(prefixes) / sizeof(*prefixes); ++p){std::string name = bases[b] + prefixes[p] + basename;if (file_exists(name))return (name);}}// Die horribly.fprintf(stderr, "Cannot find data file '%s' anywhere, aborting\n",basename.c_str());exit(1);return ("");}void check_savedir(std::string &dir){if (dir.empty())return;std::string sep = " ";sep[0] = FILE_SEPARATOR;dir = replace_all(dir, "/", sep);dir = replace_all(dir, "\\", sep);// Suffix the separator if necessaryif (dir[dir.length() - 1] != FILE_SEPARATOR)dir += FILE_SEPARATOR;if (!dir_exists(dir) && !create_dirs(dir)){fprintf(stderr, "Save directory \"%s\" does not exist ""and I can't create it.\n",dir.c_str());exit(1);}}// Given a simple (relative) name of a save file, returns the full path of// the file in the Crawl saves directory.std::string get_savedir_path(const std::string &shortpath){return (Options.save_dir + shortpath);
/** Returns a list of the names of characters that are already saved for the* current user.*/std::vector<player> find_saved_characters(){std::string searchpath = Options.save_dir;if (searchpath.empty())searchpath = ".";std::vector<std::string> allfiles = get_dir_files(searchpath);std::vector<player> chars;for (int i = 0, size = allfiles.size(); i < size; ++i){std::string filename = allfiles[i];#ifdef LOAD_UNPACKAGE_CMDif (!is_packed_save(filename))continue;
std::string basename =filename.substr(0,filename.length() - strlen(PACKAGE_SUFFIX));std::string zipname = get_savedir_path(basename);// This is the filename we actually read ourselves.filename = basename + ".sav";char cmd_buff[1024];snprintf( cmd_buff, sizeof(cmd_buff), UNPACK_SPECIFIC_FILE_CMD,zipname.c_str(),filename.c_str() );if (system(cmd_buff) != 0)continue;#endifif (is_save_file_name(filename)){player p = read_character_info(get_savedir_path(filename));if (p.is_valid())chars.push_back(p);}#ifdef LOAD_UNPACKAGE_CMD// If we unpacked the .sav file, throw it away now.unlink( get_savedir_path(filename).c_str() );#endif}std::sort(chars.begin(), chars.end());return (chars);}std::string get_savedir_filename(const char *prefix, const char *suffix,const char *extension, bool suppress_uid){std::string result = Options.save_dir;// Shorten string as appropriateresult += std::string(prefix).substr(0, kFileNameLen);// Technically we should shorten the string first. But if// MULTIUSER is set we'll have long filenames anyway. Caveat// emptor.if ( !suppress_uid )result += uid_as_string();result += suffix;if ( *extension ) {result += '.';result += extension;}#ifdef DOSuppercase(result);#endifreturn result;}std::string get_prefs_filename(){return get_savedir_filename("start", "ns", "prf");}std::string make_filename( const char *prefix, int level, int where,bool isLabyrinth, bool isGhost ){char suffix[4], lvl[5];strcpy(suffix, (level < 10) ? "0" : "");itoa(level, lvl, 10);strcat(suffix, lvl);suffix[2] = where + 97;suffix[3] = 0;return get_savedir_filename( prefix, "", isLabyrinth ? "lab" : suffix,isGhost );}
unsigned char foll_targ_1_x[8];unsigned char foll_targ_1_y[8];unsigned char foll_beh[8];unsigned char foll_att[8];int foll_sec[8];unsigned char foll_hit[8];unsigned char foll_ench[8][NUM_MON_ENCHANTS];unsigned char foll_flags[8];item_def foll_item[8][8];int itmf = 0;int ic = 0;int imn = 0;
make_filename( cha_fil, you.your_name, you.your_level, you.where_are_you,you.level_type != LEVEL_DUNGEON, false );
std::string cha_fil = make_filename( you.your_name, you.your_level,you.where_are_you,you.level_type != LEVEL_DUNGEON,false );
foll_class[following] = fmenv->type;foll_hp[following] = fmenv->hit_points;foll_hp_max[following] = fmenv->max_hit_points;foll_HD[following] = fmenv->hit_dice;foll_AC[following] = fmenv->armour_class;foll_ev[following] = fmenv->evasion;foll_speed[following] = fmenv->speed;foll_speed_inc[following] = fmenv->speed_increment;foll_targ_1_x[following] = fmenv->target_x;foll_targ_1_y[following] = fmenv->target_y;
follower f(*fmenv);
foll_beh[following] = fmenv->behaviour;foll_att[following] = fmenv->attitude;foll_sec[following] = fmenv->number;foll_hit[following] = fmenv->foe;for (j = 0; j < NUM_MON_ENCHANTS; j++){foll_ench[following][j] = fmenv->enchantment[j];fmenv->enchantment[j] = ENCH_NONE;}foll_flags[following] = fmenv->flags;fmenv->flags = 0;fmenv->type = -1;fmenv->hit_points = 0;fmenv->max_hit_points = 0;fmenv->hit_dice = 0;fmenv->armour_class = 0;fmenv->evasion = 0;mgrd[count_x][count_y] = NON_MONSTER;
followers.push_back(f);monster_cleanup(fmenv);
menv[following].type = foll_class[fmenv];menv[following].hit_points = foll_hp[fmenv];menv[following].max_hit_points = foll_hp_max[fmenv];menv[following].hit_dice = foll_HD[fmenv];menv[following].armour_class = foll_AC[fmenv];menv[following].evasion = foll_ev[fmenv];menv[following].speed = foll_speed[fmenv];
menv[following] = f.mons;
menv[following].behaviour = foll_beh[fmenv];menv[following].attitude = foll_att[fmenv];menv[following].number = foll_sec[fmenv];menv[following].foe = foll_hit[fmenv];for (j = 0; j < NUM_MON_ENCHANTS; j++)menv[following].enchantment[j]=foll_ench[fmenv][j];menv[following].flags = foll_flags[fmenv];menv[following].flags |= MF_JUST_SUMMONED;
// 4.0 initial genesis of saved format// 4.1 added attitude tag// 4.2 replaced old 'enchantment1' and with 'flags' (bitfield)// 4.3 changes to make the item structure more sane// 4.4 changes to the ghost save section// 4.5 spell and ability letter arrays// 4.6 inventory slots of items// 4.7 origin tracking for items// 4.8 widened env.map to 2 bytes
// 0.0 initial genesis of saved format// 0.1 added attitude tag// 0.2 replaced old 'enchantment1' and with 'flags' (bitfield)// 0.3 changes to make the item structure more sane// 0.4 changes to the ghost save section// 0.5 spell and ability letter arrays// 0.6 inventory slots of items// 0.7 origin tracking for items// 0.8 widened env.map to 2 bytes// 0.9 inscriptions (hp)// 0.10 Monster colour and spells separated from mons->number.
char charFile[kFileNameSize];#ifdef STASH_TRACKINGchar stashFile[kFileNameSize + 4];#endifchar killFile[kFileNameSize + 4];char travelCacheFile[kFileNameSize + 4];#ifdef CLUA_BINDINGSchar luaFile[kFileNameSize + 4];#endif#ifdef SAVE_PACKAGE_CMDchar cmd_buff[1024];char name_buff[kFileNameSize];snprintf( name_buff, sizeof(name_buff),SAVE_DIR_PATH "%s%d", you.your_name, (int) getuid() );snprintf( cmd_buff, sizeof(cmd_buff),SAVE_PACKAGE_CMD, name_buff, name_buff );#ifdef STASH_TRACKINGstrcpy(stashFile, name_buff);#endif#ifdef CLUA_BINDINGSstrcpy(luaFile, name_buff);#endifstrcpy(killFile, name_buff);strcpy(travelCacheFile, name_buff);snprintf( charFile, sizeof(charFile),"%s.sav", name_buff );#elsestrncpy(charFile, you.your_name, kFileNameLen);charFile[kFileNameLen] = 0;#ifdef STASH_TRACKINGstrcpy(stashFile, charFile);#endif#ifdef CLUA_BINDINGSstrcpy(luaFile, charFile);#endifstrcpy(killFile, charFile);strcpy(travelCacheFile, charFile);strcat(charFile, ".sav");#ifdef DOSstrupr(charFile);#ifdef STASH_TRACKINGstrupr(stashFile);#endif#ifdef CLUA_BINDINGSstrupr(luaFile);#endifstrupr(killFile);strupr(travelCacheFile);#endif#endif
strcat(stashFile, ".st");#endif#ifdef CLUA_BINDINGSstrcat(luaFile, ".lua");#endifstrcat(killFile, ".kil");strcat(travelCacheFile, ".tc");#ifdef STASH_TRACKINGFILE *stashf = fopen(stashFile, "wb");if (stashf){
/* Stashes */std::string stashFile = get_savedir_filename( you.your_name, "", "st" );FILE *stashf = fopen(stashFile.c_str(), "wb");if (stashf) {
clua.save(luaFile);#ifdef SHARED_FILES_CHMOD_PRIVATE// change mode; note that luaFile may not existchmod(luaFile, SHARED_FILES_CHMOD_PRIVATE);
/* lua */std::string luaFile = get_savedir_filename( you.your_name, "", "lua" );clua.save(luaFile.c_str());// note that luaFile may not existDO_CHMOD_PRIVATE(luaFile.c_str());
FILE *killf = fopen(killFile, "wb");if (killf){you.kills.save(killf);fclose(killf);#ifdef SHARED_FILES_CHMOD_PRIVATE// change mode (unices)chmod(killFile, SHARED_FILES_CHMOD_PRIVATE);#endif
/* notes */std::string notesFile = get_savedir_filename(you.your_name, "", "nts");FILE *notesf = fopen(notesFile.c_str(), "wb");if (notesf) {save_notes(notesf);fclose(notesf);DO_CHMOD_PRIVATE(notesFile.c_str());
if (saveFile == NULL){strcpy(info, "Unable to open \"");strcat(info, charFile );strcat(info, "\" for writing!");perror(info);end(-1);
std::string charFile = get_savedir_filename(you.your_name, "", "sav");FILE *charf = fopen(charFile.c_str(), "wb");if (!charf) {snprintf(info, INFO_SIZE, "Unable to open \"%s\" for writing!\n",charFile.c_str());perror(info);end(-1);
// 4.0 initial genesis of saved format// 4.1 changes to make the item structure more sane// 4.2 spell and ability tables// 4.3 added you.magic_contamination (05/03/05)// 4.4 added item originswrite_tagged_file( saveFile, 4, 4, TAGTYPE_PLAYER );
fclose(saveFile);
// 0.0 initial genesis of saved format// 0.1 changes to make the item structure more sane// 0.2 spell and ability tables// 0.3 added you.magic_contamination (05/03/05)// 0.4 added item origins// 0.5 added num_gifts// 0.6 inscriptionswrite_tagged_file( charf, SAVE_MAJOR_VERSION, 6, TAGTYPE_PLAYER );
if (system( cmd_buff ) != 0){
std::string basename = get_savedir_filename(you.your_name, "", "");char cmd_buff[1024];snprintf( cmd_buff, sizeof(cmd_buff),SAVE_PACKAGE_CMD, basename.c_str(), basename.c_str() );if (system( cmd_buff ) != 0) {
char char_f[kFileNameSize];char kill_f[kFileNameSize];char travel_f[kFileNameSize];#ifdef STASH_TRACKINGchar stash_f[kFileNameSize];#endif#ifdef CLUA_BINDINGSchar lua_f[kFileNameSize];#endif#ifdef SAVE_DIR_PATHsnprintf( char_f, sizeof(char_f),SAVE_DIR_PATH "%s%d", you.your_name, (int) getuid() );#elsestrncpy(char_f, you.your_name, kFileNameLen);char_f[kFileNameLen] = 0;#endifstrcpy(kill_f, char_f);strcpy(travel_f, char_f);#ifdef CLUA_BINDINGSstrcpy(lua_f, char_f);strcat(lua_f, ".lua");#endif#ifdef STASH_TRACKINGstrcpy(stash_f, char_f);strcat(stash_f, ".st");#endifstrcat(kill_f, ".kil");strcat(travel_f, ".tc");strcat(char_f, ".sav");#ifdef DOSstrupr(char_f);#ifdef STASH_TRACKINGstrupr(stash_f);#endifstrupr(kill_f);strupr(travel_f);#ifdef CLUA_BINDINGSstrupr(lua_f);#endif#endifFILE *restoreFile = fopen(char_f, "rb");if (restoreFile == NULL)
std::string charFile = get_savedir_filename(you.your_name, "", "sav");FILE *charf = fopen(charFile.c_str(), "rb");if (!charf )
FILE *stashFile = fopen(stash_f, "rb");if (stashFile){stashes.load(stashFile);fclose(stashFile);
std::string stashFile = get_savedir_filename( you.your_name, "", "st" );FILE *stashf = fopen(stashFile.c_str(), "rb");if (stashf) {stashes.load(stashf);fclose(stashf);
clua.execfile( lua_f );#endif // CLUA_BINDINGS
std::string luaFile = get_savedir_filename( you.your_name, "", "lua" );clua.execfile( luaFile.c_str() );#endifstd::string killFile = get_savedir_filename( you.your_name, "", "kil" );FILE *killf = fopen(killFile.c_str(), "rb");if (killf) {you.kills.load(killf);fclose(killf);}
FILE *travelFile = fopen(travel_f, "rb");if (travelFile){travel_cache.load(travelFile);fclose(travelFile);
std::string travelCacheFile = get_savedir_filename(you.your_name,"","tc");FILE *travelf = fopen(travelCacheFile.c_str(), "rb");if (travelf) {travel_cache.load(travelf);fclose(travelf);
FILE *killFile = fopen(kill_f, "rb");if (killFile){you.kills.load(killFile);fclose(killFile);
std::string notesFile = get_savedir_filename(you.your_name, "", "nts");FILE *notesf = fopen(notesFile.c_str(), "rb");if (notesf) {load_notes(notesf);fclose(notesf);
// translatememcpy( ghost.name, buf, 20 );for (int i = 0; i < 20; i++)ghost.values[i] = static_cast< unsigned short >( buf[i+20] );if (ghost.values[ GVAL_RES_FIRE ] >= 97)ghost.values[ GVAL_RES_FIRE ] -= 100;if (ghost.values[ GVAL_RES_COLD ] >= 97)ghost.values[ GVAL_RES_COLD ] -= 100;
return false; // if its not SAVE_MAJOR_VERSION, no idea!
// 4.0-4.3 old tagged savefile (values as unsigned char)// 4.4 new tagged savefile (values as signed short)write_tagged_file( gfile, 4, 4, TAGTYPE_GHOST );
// 0.0-0.3 old tagged savefile (values as unsigned char)// 0.4 new tagged savefile (values as signed short)write_tagged_file( gfile, SAVE_MAJOR_VERSION, 4, TAGTYPE_GHOST );
void you_attack(int monster_attacked, bool unarmed_attacks){struct monsters *defender = &menv[monster_attacked];
// returns random2(x) is random_factor is true, otherwise// the mean.static int maybe_random2( int x, bool random_factor ) {if ( random_factor )return random2(x);elsereturn x / 2;}// Returns the to-hit for your extra unarmed.attacks.// DOES NOT do the final roll (i.e., random2(your_to_hit)).static int calc_your_to_hit_unarmed() {
int damage_done = 0;bool hit = false;unsigned char stab_bonus = 0; // this is never negative {dlb}int temp_rand; // for probability determination {dlb}
your_to_hit = 13 + you.dex / 2 + you.skills[SK_UNARMED_COMBAT] / 2+ you.skills[SK_FIGHTING] / 5;if (wearing_amulet(AMU_INACCURACY))your_to_hit -= 5;if (you.hunger_state == HS_STARVING)your_to_hit -= 3;your_to_hit += slaying_bonus(PWPN_HIT);return your_to_hit;}// Calculates your to-hit roll. If random_factor is true, be// stochastic; if false, determinstic (e.g. for chardumps.)int calc_your_to_hit( int heavy_armour,bool hand_and_a_half_bonus,bool water_attack,bool random_factor ) {
#if DEBUG_DIAGNOSTICSchar st_prn[ 20 ];#endif
// if you can't see yourself, you're a little less acurate.if (you.invis && !player_see_invis())your_to_hit -= 5;// fighting contributionyour_to_hit += maybe_random2(1 + you.skills[SK_FIGHTING], random_factor);
FixedVector< char, RA_PROPERTIES > art_proprt;
// weapon skill contributionif (ur_armed) {if (wpn_skill != SK_FIGHTING) {your_to_hit += maybe_random2(you.skills[wpn_skill] + 1,random_factor);}}else { // ...you must be unarmedyour_to_hit +=(you.species == SP_TROLL || you.species == SP_GHOUL) ? 4 : 2;
// Probably over protective, but in this code we're going// to play it safe. -- bwrfor (int i = 0; i < RA_PROPERTIES; i++)art_proprt[i] = 0;
if (you.inv[ weapon ].base_type == OBJ_WEAPONS){your_to_hit += you.inv[ weapon ].plus;your_to_hit += property( you.inv[ weapon ], PWPN_HIT );if (get_equip_race(you.inv[ weapon ]) == ISFLAG_ELVEN&& player_genus(GENPC_ELVEN)){your_to_hit += (random_factor && coinflip() ? 2 : 1);}}else if (item_is_staff( you.inv[ weapon ] )){// magical staffyour_to_hit += property( you.inv[ weapon ], PWPN_HIT );}}// slaying bonusyour_to_hit += slaying_bonus(PWPN_HIT);// hunger penaltyif (you.hunger_state == HS_STARVING)your_to_hit -= 3;// armour penaltyyour_to_hit -= heavy_armour;#if DEBUG_DIAGNOSTICSint roll_hit = your_to_hit;#endif// hit rollyour_to_hit = maybe_random2(your_to_hit, random_factor);#if DEBUG_DIAGNOSTICSsnprintf( info, INFO_SIZE, "to hit die: %d; rolled value: %d",roll_hit, your_to_hit );mpr( info, MSGCH_DIAGNOSTICS );#endifif (hand_and_a_half_bonus)your_to_hit += maybe_random2(3, random_factor);if (ur_armed && wpn_skill == SK_SHORT_BLADES && you.sure_blade)your_to_hit += 5 +(random_factor ? random2limit( you.sure_blade, 10 ) :you.sure_blade / 2);// other stuffif (!ur_armed) {if ( you.confusing_touch )// just trying to touch is easier that trying to damageyour_to_hit += maybe_random2(you.dex, random_factor);switch ( you.attribute[ATTR_TRANSFORMATION] ) {case TRAN_NONE:break;case TRAN_SPIDER:your_to_hit += maybe_random2(10, random_factor);break;case TRAN_ICE_BEAST:your_to_hit += maybe_random2(10, random_factor);break;case TRAN_BLADE_HANDS:your_to_hit += maybe_random2(12, random_factor);break;case TRAN_STATUE:your_to_hit += maybe_random2(9, random_factor);break;case TRAN_SERPENT_OF_HELL:case TRAN_DRAGON:your_to_hit += maybe_random2(10, random_factor);break;case TRAN_LICH:your_to_hit += maybe_random2(10, random_factor);break;case TRAN_AIR:your_to_hit = 0;break;default:break;}
if (ev_pen < 0 && random2(you.skills[SK_ARMOUR]) < abs( ev_pen ))heavy_armour += random2( abs(ev_pen) );
if (ev_pen < 0 &&maybe_random2(you.skills[SK_ARMOUR], random_factor) < abs(ev_pen))heavy_armour += maybe_random2( abs(ev_pen), random_factor );
if (!ur_armed)heavy_armour *= (coinflip() ? 3 : 2);
if (!ur_armed) {if ( random_factor ) {heavy_armour *= (coinflip() ? 3 : 2);}// (2+3)/2else {heavy_armour *= 5;heavy_armour /= 2;}}return heavy_armour;}// Returns true if you hit the monster.bool you_attack(int monster_attacked, bool unarmed_attacks){struct monsters *defender = &menv[monster_attacked];int your_to_hit;int damage_done = 0;bool hit = false;unsigned char stab_bonus = 0; // this is never negative {dlb}int temp_rand; // for probability determination {dlb}const int weapon = you.equip[EQ_WEAPON];const bool ur_armed = (weapon != -1); // compacts code a bit {dlb}const bool bearing_shield = (you.equip[EQ_SHIELD] != -1);const int melee_brand = player_damage_brand();bool water_attack = false;char damage_noise[80], damage_noise2[80];char str_pass[ ITEMNAME_SIZE ];#if DEBUG_DIAGNOSTICSchar st_prn[ 20 ];#endifFixedVector< char, RA_PROPERTIES > art_proprt;if (ur_armed && you.inv[weapon].base_type == OBJ_WEAPONS&& is_random_artefact( you.inv[weapon] )){randart_wpn_properties( you.inv[weapon], art_proprt );}else{// Probably over protective, but in this code we're going// to play it safe. -- bwrfor (int i = 0; i < RA_PROPERTIES; i++)art_proprt[i] = 0;}const int heavy_armour = calc_heavy_armour_penalty(true);
// monster not a water creature&& monster_habitat( defender->type ) != DNGN_DEEP_WATER&& !mons_flag( defender->type, M_AMPHIBIOUS )// monster in water&& (grd[defender->x][defender->y] == DNGN_SHALLOW_WATER|| grd[defender->x][defender->y] == DNGN_DEEP_WATER)// monster not flying&& !mons_flies( defender ))
// monster not a water creature, but is in water&& monster_floundering(defender))
// preliminary to_hit modifications:your_to_hit = 15 + (calc_stat_to_hit_base() / 2);if (water_attack)your_to_hit += 5;if (wearing_amulet(AMU_INACCURACY))your_to_hit -= 5;// if you can't see yourself, you're a little less acurate.if (you.invis && !player_see_invis())your_to_hit -= 5;your_to_hit += random2(1 + you.skills[SK_FIGHTING]);
if (ur_armed){if (wpn_skill)your_to_hit += random2(you.skills[wpn_skill] + 1);}else // ...you must be unarmed{your_to_hit += (you.species == SP_TROLL|| you.species == SP_GHOUL) ? 4 : 2;
// new unified to-hit calculationyour_to_hit = calc_your_to_hit( heavy_armour, use_hand_and_a_half_bonus,water_attack, true );
if (ur_armed&& you.inv[ weapon ].base_type == OBJ_WEAPONS&& is_random_artefact( you.inv[ weapon ] ))
if (ur_armed &&you.inv[ weapon ].base_type == OBJ_WEAPONS &&is_random_artefact( you.inv[ weapon ] ) &&art_proprt[RAP_ANGRY] >= 1 &&random2(1 + art_proprt[RAP_ANGRY]))
if (ur_armed){if (you.inv[ weapon ].base_type == OBJ_WEAPONS){// there was some stupid conditional here that applied this// "if (plus >= 0)" and "else" that .. which is all// cases (d'oh!) {dlb}your_to_hit += you.inv[ weapon ].plus;your_to_hit += property( you.inv[ weapon ], PWPN_HIT );if (cmp_equip_race( you.inv[ weapon ], ISFLAG_ELVEN )&& player_genus(GENPC_ELVEN)){your_to_hit += (coinflip() ? 2 : 1);}}else if (item_is_staff( you.inv[ weapon ] )){/* magical staff */your_to_hit += property( you.inv[ weapon ], PWPN_HIT );}}your_to_hit += slaying_bonus(PWPN_HIT); // see: player.ccif (you.hunger_state == HS_STARVING)your_to_hit -= 3;your_to_hit -= heavy_armour;#if DEBUG_DIAGNOSTICSint roll_hit = your_to_hit;#endif// why does this come here and not later? {dlb}// apparently to give the following pluses more significance -- bwryour_to_hit = random2(your_to_hit);#if DEBUG_DIAGNOSTICSsnprintf( info, INFO_SIZE, "to hit die: %d; rolled value: %d",roll_hit, your_to_hit );mpr( info, MSGCH_DIAGNOSTICS );#endifif (use_hand_and_a_half_bonus)your_to_hit += random2(3);if (ur_armed && wpn_skill == SK_SHORT_BLADES && you.sure_blade)your_to_hit += 5 + random2limit( you.sure_blade, 10 );
// calculate damage
if ((your_to_hit >= defender->evasion || one_chance_in(30))|| ((defender->speed_increment <= 60|| defender->behaviour == BEH_SLEEP)&& !one_chance_in(10 + you.skills[SK_STABBING])))
if ((your_to_hit >= defender->evasion || one_chance_in(30)) ||((mons_is_paralysed(defender) || defender->behaviour == BEH_SLEEP)&& !one_chance_in(10 + you.skills[SK_STABBING])))
snprintf( info, INFO_SIZE, "You %s ", damage_noise);strcat(info, ptr_monam(defender, DESC_NOCAP_THE));strcat(info, ", but do no damage.");mpr(info);
if ( !ur_armed || melee_brand != SPWPN_VORPAL ){snprintf(info, INFO_SIZE, "You %s %s, but do no damage.",damage_noise, ptr_monam(defender, DESC_NOCAP_THE));mpr(info);}
&& (cmp_helmet_type( you.inv[you.equip[EQ_HELMET]], THELM_HELMET )|| cmp_helmet_type( you.inv[you.equip[EQ_HELMET]], THELM_HELM )))
&& (get_helmet_type(you.inv[you.equip[EQ_HELMET]]) == THELM_HELMET|| get_helmet_type(you.inv[you.equip[EQ_HELMET]]) == THELM_HELM))
if (cmp_helmet_desc( you.inv[you.equip[EQ_HELMET]], THELM_DESC_SPIKED )|| cmp_helmet_desc( you.inv[you.equip[EQ_HELMET]], THELM_DESC_HORNED ))
if (get_helmet_desc(you.inv[you.equip[EQ_HELMET]]) == THELM_DESC_SPIKED|| get_helmet_desc(you.inv[you.equip[EQ_HELMET]]) == THELM_DESC_HORNED)
const int con_block = 15 + attacker->hit_dice+ (10 * you.shield_blocks * you.shield_blocks);
// [dshaligram] Scaled back HD effect to 50% of previous, reduced// shield_blocks multiplier to 5.const int con_block =random2(15 + attacker->hit_dice / 2+ (5 * you.shield_blocks * you.shield_blocks));
// Factors for blockingconst int pro_block = player_shield_class() + (random2(you.dex) / 5);
// Factors for blocking:// [dshaligram] Added weighting for shields skill, increased dex bonus// from .2 to .25const int pro_block =random2(player_shield_class())+ (random2(you.dex) / 4)+ (random2(skill_bump(SK_SHIELDS)) / 4)- 1;
if (mons_to_hit >= defender->evasion|| ((defender->speed_increment <= 60|| defender->behaviour == BEH_SLEEP) && !one_chance_in(20)))
if (mons_to_hit >= defender->evasion ||((mons_is_paralysed(defender) || defender->behaviour == BEH_SLEEP)&& !one_chance_in(20)))
#ifdef SAVE_DIR_PATH// file name length has to be able to cover full paths -- bwrossconst int kNameLen = 30;const int kFileNameLen = 250;const int kFileNameSize = 5 + kFileNameLen;#elseconst int kNameLen = 30;const int kFileNameLen = 28;const int kFileNameSize = 5 + kFileNameLen;#endif
const int kFileNameLen = 250;
char beam_name[40];bool isBeam; // beams? (can hits multiple targets?)const char *aux_source; // source of KILL_MISC beams
std::string name;bool is_beam; // beams? (can hits multiple targets?)bool is_explosion;bool is_big_cloud; // expands into big_cloud at endpointbool is_enchant; // no block/dodge, but mag resistbool is_energy; // mostly energy/non-physical attackbool is_launched; // was fired from launcher?bool is_thrown; // was thrown from hand?bool target_first; // targeting by directionbool aimed_at_spot; // aimed at (x,y), should not crossstd::string aux_source; // source of KILL_MISC beams
bool isTracer; // is this a tracer?bool aimedAtFeet; // this was aimed at self!bool msgGenerated; // an appropriate msg was already mpr'dbool isExplosion; // explosion phase (as opposed to beam phase)bool smartMonster; // tracer firer can guess at other mons. resists?bool canSeeInvis; // tracer firer can see invisible?bool isFriendly; // tracer firer is enslaved or petint foeRatio; // 100* foe ratio (see mons_should_fire())
bool is_tracer; // is this a tracer?bool aimed_at_feet; // this was aimed at self!bool msg_generated; // an appropriate msg was already mpr'dbool in_explosion_phase; // explosion phase (as opposed to beam phase)bool smart_monster; // tracer firer can guess at other mons. resists?bool can_see_invis; // tracer firer can see invisible?bool is_friendly; // tracer firer is enslaved or petint foe_ratio; // 100* foe ratio (see mons_should_fire())public:// A constructor to try and fix some of the bugs that occur because// this struct never seems to be properly initialized. Definition// is over in beam.cc.bolt();void set_target(const dist &);
struct ray_def{double accx;double accy;double slope;// Quadrant 1: down-right// Quadrant 2: down-left// Quadrant 3: up-left// Quadrant 4: up-rightint quadrant;int x() const { return (int)(accx); }int y() const { return (int)(accy); }int advance(); // returns the direction taken (0,1,2)void advance_and_bounce();void regress();};
class runrest{public:int runmode;int mp;int hp;int x, y;FixedVector<run_check_dir,3> run_check; // array of grids to checkpublic:runrest();void initialise(int rdir, int mode);operator int () const;const runrest &operator = (int newrunmode);// Returns true if we're currently resting.bool is_rest() const;// Clears run state.void clear();// Stops running.void stop();// Take one off the rest counter.void rest();// Decrements the run counter. Identical to rest.void rundown();
// Checks if shift-run should be aborted and aborts the run if necessary.// Returns true if you were running and are now no longer running.bool check_stop_running();// Check if we've reached the HP/MP stop-rest conditionvoid check_hp();void check_mp();private:void set_run_check(int index, int compass_dir);bool run_grids_changed() const;};typedef std::vector<delay_queue_item> delay_queue_type;
ACTIVITY activity; // The current multiturn activity, usually set to ACT_NONEchar turn_is_over; // flag signaling that player has performed a timed action
bool turn_is_over; // flag signaling that player has performed a timed action
FixedVector< run_check_dir, 3 > run_check; // array of grids to checksigned char running; // Nonzero if running/traveling.
runrest running; // Nonzero if running/traveling.
formatted_string() : ops() { }formatted_string(const std::string &s);operator std::string() const;void display(int start = 0, int end = -1) const;std::string tostring(int start = 0, int end = -1) const;void cprintf(const char *s, ...);void cprintf(const std::string &s);void gotoxy(int x, int y);void textcolor(int color);
game_options();void reset_startup_options();void reset_options();
private:enum fs_op_type{FSOP_COLOUR,FSOP_CURSOR,FSOP_TEXT};
void read_option_line(const std::string &s, bool runscripts = false);void read_options(InitLineInput &, bool runscripts);
struct fs_op{fs_op_type type;int x, y;std::string text;fs_op(int color): type(FSOP_COLOUR), x(color), y(-1), text(){}fs_op(int cx, int cy): type(FSOP_CURSOR), x(cx), y(cy), text(){}fs_op(const std::string &s): type(FSOP_TEXT), x(-1), y(-1), text(s){}
public:std::string save_dir; // Directory where saves and bones go.
bool increasing_skill_progress; // skills go from 0-10 or 10-0bool confirm_self_target; // require confirmation before selftargetbool safe_autopickup; // don't autopickup when monsters visiblebool note_skill_max; // take note when skills reach new maxbool note_all_spells; // take note when learning any spellbool use_notes; // take (and dump) notesint note_hp_percent; // percentage hp for notetakingint ood_interesting; // how many levels OOD is noteworthy?
std::vector<text_pattern> note_monsters; // Interesting monstersstd::vector<text_pattern> note_messages; // Interesting messagesstd::vector<std::pair<text_pattern, std::string> > autoinscriptions;std::vector<text_pattern> note_items; // Objects to notestd::vector<int> note_skill_levels; // Skill levels to note
int tc_reachable; // Colour for squares that are reachableint tc_excluded; // Colour for excluded squares.int tc_exclude_circle; // Colour for squares in the exclusion radiusint tc_dangerous; // Colour for trapped squares, deep water, lava.int tc_disconnected;// Areas that are completely disconnected.
public:// Convenience accessors for the second-class options in named_options.int o_int(const char *name, int def = 0) const;long o_long(const char *name, long def = 0L) const;bool o_bool(const char *name, bool def = false) const;std::string o_str(const char *name, const char *def = NULL) const;int o_colour(const char *name, int def = LIGHTGREY) const;private:void set_default_activity_interrupts();void clear_activity_interrupts(FixedVector<bool, NUM_AINTERRUPTS> &eints);void set_activity_interrupt(FixedVector<bool, NUM_AINTERRUPTS> &eints,const std::string &interrupt);void set_activity_interrupt(const std::string &activity_name,const std::string &interrupt_names,bool append_interrupts);void add_dump_fields(const std::string &text);void do_kill_map(const std::string &from, const std::string &to);static const std::string interrupt_prefix;
public:scorefile_entry();scorefile_entry(int damage, int death_source, int death_type,const char *aux, bool death_cause_only = false);void init_death_cause(int damage, int death_source, int death_type,const char *aux);void init();void reset();enum death_desc_verbosity {DDV_TERSE,DDV_ONELINE,DDV_NORMAL,DDV_VERBOSE};std::string hiscore_line(death_desc_verbosity verbosity) const;std::string character_description(death_desc_verbosity) const;// Full description of death: Killed by an xyz wielding foostd::string death_description(death_desc_verbosity) const;std::string death_place(death_desc_verbosity) const;std::string game_time(death_desc_verbosity) const;private:std::string single_cdesc() const;std::string strip_article_a(const std::string &s) const;std::string terse_missile_cause() const;std::string terse_beam_cause() const;std::string terse_wild_magic() const;std::string terse_trap() const;const char *damage_verb() const;const char *death_source_desc() const;std::string damage_string(bool terse = false) const;
ACT_NONE = 0,ACT_MULTIDROP,ACT_RUNNING,ACT_TRAVELING,ACT_MACRO,
AI_FORCE_INTERRUPT = 0, // Forcibly kills any activity that can be// interrupted.AI_KEYPRESS,AI_FULL_HP, // Player is fully healedAI_FULL_MP, // Player has recovered all mpAI_STATUE, // Bad statue has come into viewAI_HUNGRY, // Hunger increasedAI_MESSAGE, // Message was displayedAI_HP_LOSS,AI_BURDEN_CHANGE,AI_STAT_CHANGE,AI_SEE_MONSTER,AI_MONSTER_ATTACKS,AI_TELEPORT,
AI_FORCE_INTERRUPT = 0, // Forcibly kills any activityAI_KEYPRESS = 0x01,AI_FULL_HP = 0x02, // Player is fully healedAI_FULL_MP = 0x04, // Player has recovered all mpAI_STATUE = 0x08, // Bad statue has come into viewAI_HUNGRY = 0x10, // Hunger increasedAI_MESSAGE = 0x20, // Message was displayedAI_HP_LOSS = 0x40,AI_BURDEN_CHANGE = 0x80,AI_STAT_CHANGE = 0x100,AI_SEE_MONSTER = 0x200,AI_TELEPORT = 0x400};enum AI_PAYLOAD{
BEAM_ACID, // 8BEAM_EXPLOSION = 10, // 10BEAM_SPORE, // 11BEAM_POISON_ARROW, // 12BEAM_HELLFIRE, // 13 - found 11jan2000 {dlb}BEAM_ENERGY = 17,BEAM_HOLY = 18, // 18 - aka beam of cleansing, golden flame
BEAM_ACID,BEAM_MIASMA,// BEAM_EXPLOSION, // 10 - use is_explosion, and BEAM of flavourBEAM_SPORE = 11,BEAM_POISON_ARROW,BEAM_HELLFIRE,BEAM_NAPALM,BEAM_STEAM, // 15BEAM_HELLFROST,BEAM_ENERGY,BEAM_HOLY, // 18 - aka beam of cleansing, golden flame
MSG_EMPTY_HANDED
MSG_EMPTY_HANDED,MSG_NOT_IN_PRESENT_FORM,MSG_TOO_CONFUSED,MSG_DISORIENTED,MSG_CANT_REACH};enum char_set_type{CSET_ASCII, // flat 7-bit ASCIICSET_IBM, // 8-bit ANSI/Code Page 437CSET_DEC, // 8-bit DEC, 0xE0-0xFF shifted for line drawing charsNUM_CSET
CMD_CLEAR_MAP
CMD_CLEAR_MAP,CMD_INSCRIBE_ITEM,CMD_TOGGLE_NOFIZZLE,CMD_TOGGLE_AUTOPRAYER,CMD_MAKE_NOTE,CMD_RESISTS_SCREEN,/* overmap commands */CMD_MAP_CLEAR_MAP,CMD_MAP_ADD_WAYPOINT,CMD_MAP_EXCLUDE_AREA,CMD_MAP_CLEAR_EXCLUDES,CMD_MAP_MOVE_LEFT,CMD_MAP_MOVE_DOWN,CMD_MAP_MOVE_UP,CMD_MAP_MOVE_RIGHT,CMD_MAP_MOVE_UP_LEFT,CMD_MAP_MOVE_DOWN_LEFT,CMD_MAP_MOVE_UP_RIGHT,CMD_MAP_MOVE_DOWN_RIGHT,CMD_MAP_JUMP_LEFT,CMD_MAP_JUMP_DOWN,CMD_MAP_JUMP_UP,CMD_MAP_JUMP_RIGHT,CMD_MAP_JUMP_UP_LEFT,CMD_MAP_JUMP_DOWN_LEFT,CMD_MAP_JUMP_UP_RIGHT,CMD_MAP_JUMP_DOWN_RIGHT,CMD_MAP_SCROLL_DOWN,CMD_MAP_SCROLL_UP,CMD_MAP_FIND_UPSTAIR,CMD_MAP_FIND_DOWNSTAIR,CMD_MAP_FIND_YOU,CMD_MAP_FIND_PORTAL,CMD_MAP_FIND_TRAP,CMD_MAP_FIND_ALTAR,CMD_MAP_FIND_EXCLUDED,CMD_MAP_FIND_F,CMD_MAP_FIND_WAYPOINT,CMD_MAP_FIND_STASH,CMD_MAP_GOTO_TARGET,CMD_MAP_EXIT_MAP,/* targeting commands */CMD_TARGET_DOWN_LEFT,CMD_TARGET_DOWN,CMD_TARGET_DOWN_RIGHT,CMD_TARGET_LEFT,CMD_TARGET_RIGHT,CMD_TARGET_UP_LEFT,CMD_TARGET_UP,CMD_TARGET_UP_RIGHT,CMD_TARGET_CYCLE_TARGET_MODE,CMD_TARGET_PREV_TARGET,CMD_TARGET_SELECT,CMD_TARGET_OBJ_CYCLE_BACK,CMD_TARGET_OBJ_CYCLE_FORWARD,CMD_TARGET_CYCLE_FORWARD,CMD_TARGET_CYCLE_BACK,CMD_TARGET_CENTER,CMD_TARGET_CANCEL,CMD_TARGET_OLD_SPACE,CMD_TARGET_FIND_TRAP,CMD_TARGET_FIND_PORTAL,CMD_TARGET_FIND_ALTAR,CMD_TARGET_FIND_UPSTAIR,CMD_TARGET_FIND_DOWNSTAIR,CMD_TARGET_FIND_YOU,CMD_TARGET_DESCRIBE,// [ds] Silently ignored, requests another round of input.CMD_NEXT_CMD
enum CORPSE_EFFECTS
enum conduct_type{DID_NECROMANCY = 1, // vamp/drain/pain wpns, Zong/CursesDID_UNHOLY, // demon wpns, demon spellsDID_ATTACK_HOLY,DID_ATTACK_FRIEND,DID_FRIEND_DIES,DID_STABBING,DID_POISON,DID_DEDICATED_BUTCHERY,DID_DEDICATED_KILL_LIVING,DID_DEDICATED_KILL_UNDEAD,DID_DEDICATED_KILL_DEMON,DID_DEDICATED_KILL_NATURAL_EVIL, // unusedDID_DEDICATED_KILL_WIZARD,DID_DEDICATED_KILL_PRIEST, // unused// [dshaligram] No distinction between killing Angels during prayer or// otherwise, borrowed from bwr 4.1.DID_KILL_ANGEL,DID_LIVING_KILLED_BY_UNDEAD_SLAVE,DID_LIVING_KILLED_BY_SERVANT,DID_UNDEAD_KILLED_BY_SERVANT,DID_DEMON_KILLED_BY_SERVANT,DID_NATURAL_EVIL_KILLED_BY_SERVANT, // unusedDID_ANGEL_KILLED_BY_SERVANT,DID_SPELL_MEMORISE,DID_SPELL_CASTING,DID_SPELL_PRACTISE,DID_SPELL_NONUTILITY, // unusedDID_CARDS,DID_STIMULANTS, // unusedDID_EAT_MEAT, // unusedDID_CREATED_LIFE, // unusedNUM_CONDUCTS};enum corpse_effect_type
DELAY_INTERUPTABLE = 100, // simple interuptable delayDELAY_UNINTERUPTABLE // simple uninteruptable delay
// [dshaligram] Shift-running, resting, travel and macros are now// also handled as delays.DELAY_RUN,DELAY_REST,DELAY_TRAVEL,DELAY_MACRO,DELAY_INTERRUPTIBLE, // simple interruptible delayDELAY_UNINTERRUPTIBLE, // simple uninterruptible delayNUM_DELAYS
enum DROP_MODE
// NOTE: The order of these is very important to their usage!// [dshaligram] If adding/removing from this list, also update view.cc!enum dungeon_char_type{DCHAR_WALL, // 0DCHAR_WALL_MAGIC,DCHAR_FLOOR,DCHAR_FLOOR_MAGIC,DCHAR_DOOR_OPEN,DCHAR_DOOR_CLOSED, // 5DCHAR_TRAP,DCHAR_STAIRS_DOWN,DCHAR_STAIRS_UP,DCHAR_ALTAR,DCHAR_ARCH, // 10DCHAR_FOUNTAIN,DCHAR_WAVY,DCHAR_STATUE,DCHAR_INVIS_EXPOSED,DCHAR_ITEM_DETECTED, // 15DCHAR_ITEM_ORB,DCHAR_ITEM_WEAPON,DCHAR_ITEM_ARMOUR,DCHAR_ITEM_WAND,DCHAR_ITEM_FOOD, // 20DCHAR_ITEM_SCROLL,DCHAR_ITEM_RING,DCHAR_ITEM_POTION,DCHAR_ITEM_MISSILE,DCHAR_ITEM_BOOK, // 25DCHAR_ITEM_STAVE,DCHAR_ITEM_MISCELLANY,DCHAR_ITEM_CORPSE,DCHAR_ITEM_GOLD,DCHAR_ITEM_AMULET, // 30DCHAR_CLOUD, // 31NUM_DCHAR_TYPES};enum drop_mode_type
DNGN_PERMADRY_FOUNTAIN = 210 // added (from dungeon.cc/maps.cc) 22jan2000 {dlb}
DNGN_PERMADRY_FOUNTAIN = 210, // added (from dungeon.cc/maps.cc) 22jan2000 {dlb}// Real terrain must all occur before 256 to guarantee it fits// into the unsigned char used for the grid!// There aren't really terrain, but they're passed in and used// to get their appearance character so I'm putting them here for now.DNGN_ITEM_ORB = 256,DNGN_INVIS_EXPOSED = 257,DNGN_ITEM_WEAPON = 258,DNGN_ITEM_ARMOUR = 259,DNGN_ITEM_WAND = 260,DNGN_ITEM_FOOD = 261,DNGN_ITEM_UNUSED_1 = 262,DNGN_ITEM_SCROLL = 263,DNGN_ITEM_RING = 264,DNGN_ITEM_POTION = 265,DNGN_ITEM_MISSILE = 266,DNGN_ITEM_BOOK = 267,DNGN_ITEM_UNUSED_2 = 268,DNGN_ITEM_STAVE = 269,DNGN_ITEM_MISCELLANY = 270,DNGN_ITEM_CORPSE = 271,DNGN_ITEM_GOLD = 272,DNGN_ITEM_AMULET = 273,DNGN_ITEM_DETECTED = 274,DNGN_CLOUD = 280,NUM_FEATURES, // for use in lookup table in view.ccDNGN_RANDOM,DNGN_START_OF_MONSTERS = 297 // don't go past here! see view.cc
DUR_REPEL_UNDEAD, // 25DUR_LAST_DUR, //jmf: for assertsNUM_DURATIONS = 30// set at 30 to prevent savefile incompatibilities 12mar2000{dlb}
DUR_REPEL_UNDEAD, // 25DUR_STUN,DUR_CUT, // 27DUR_GOURMAND, // 28NUM_DURATIONS = 30 // must be at least 30
enum ENCHANTMENT // menv[].enchantment[]
// various elemental colour schemes... used for abstracting random short lists// MUST match the order in initfile.cc or breakage results.enum element_type{EC_FIRE = 32, // fiery colours (must be first and > higest colour)EC_ICE, // icy coloursEC_EARTH, // earthy coloursEC_ELECTRICITY, // electrical side of airEC_AIR, // non-electric and general air magicEC_POISON, // used only for venom mage and stalker stuffEC_WATER, // used only for the elementalEC_MAGIC, // general magical effectEC_MUTAGENIC, // transmute, poly, radiation effectsEC_WARP, // teleportation and anything similarEC_ENCHANT, // magical enhancementsEC_HEAL, // holy healing (not necromantic stuff)EC_HOLY, // general "good" god effectsEC_DARK, // darknessEC_DEATH, // currently only assassin (and equal to EC_NECRO)EC_NECRO, // necromancy stuffEC_UNHOLY, // demonology stuffEC_VEHUMET, // vehumet's odd-ball coloursEC_CRYSTAL, // colours of crystalEC_BLOOD, // colours of bloodEC_SMOKE, // colours of smokeEC_SLIME, // colours of slimeEC_JEWEL, // colourfulEC_ELVEN, // used for colouring elf fabric itemsEC_DWARVEN, // used for colouring dwarf fabric itemsEC_ORCISH, // used for colouring orc fabric itemsEC_GILA, // gila monster coloursEC_FLOOR, // colour of the area's floorEC_ROCK, // colour of the area's rockEC_STONE, // colour of the area's stoneEC_RANDOM // any colour (except BLACK)};enum enchant_type
FLUSH_LUA, // flush when Lua wants us to
FLUSH_ON_WARNING_MESSAGE, // flush on MSGCH_WARN messagesFLUSH_ON_DANGER_MESSAGE, // flush on MSGCH_DANGER messagesFLUSH_ON_PROMPT, // flush on MSGCH_PROMPT messagesFLUSH_ON_UNSAFE_YES_OR_NO_PROMPT, // flush when !safe set to yesno()FLUSH_LUA, // flush when Lua wants to flush
GOOD_KILLED_LIVING = 1, // 1 - killed a living monster in god's nameGOOD_KILLED_UNDEAD, // 2 - killed an undead in god's nameGOOD_KILLED_DEMON, // 3 - killed a demon in god's nameGOOD_KILLED_ANGEL_I, // 4 - killed an angel (any time)GOOD_KILLED_ANGEL_II, // 5 - killed an angel in god's name// (all above pass HD of monster as pgain)GOOD_HACKED_CORPSE, // 6 - hacked up a corpse in god's nameGOOD_OFFER_STUFF, // 7 - offered inanimate stuff at an altarGOOD_OFFER_CORPSE, // as above,including at least one corpseGOOD_SLAVES_KILL_LIVING,// 9 - undead slaves killed a living thingGOOD_SERVANTS_KILL, // 10 - any servants kill anythingGOOD_CARDS, // 11 - cards (Nemelex)GOOD_KILLED_WIZARD,GOOD_KILLED_PRIEST,GOOD_POISON,GOOD_ATTACKED_FRIEND,NUM_GOOD_THINGS};
HANDS_ONE,HANDS_HALF,HANDS_TWO,
ISFLAG_RESERVED_1 = 0x00000200, // reserved (re-curses on wield?)ISFLAG_RESERVED_2 = 0x00000400, // reserved (heavy cursed?)ISFLAG_RESERVED_3 = 0x00000800, // reserved (perma-cursed?)
ISFLAG_RESERVED_1 = 0x00000200, // reservedISFLAG_RESERVED_2 = 0x00000400, // reservedISFLAG_RESERVED_3 = 0x00000800, // reserved
MI_EGGPLANT
MI_NONE // was MI_EGGPLANT... used for launch type detection};// properties of the monster class (other than resists/vulnerabilities)enum mons_class_flags{M_NO_FLAGS = 0,M_SPELLCASTER = (1<< 0), // any non-physical-attack powers,M_ACTUAL_SPELLS = (1<< 1), // monster is a wizard,M_PRIEST = (1<< 2), // monster is a priestM_FIGHTER = (1<< 3), // monster is skilled fighterM_FLIES = (1<< 4), // will crash to ground if paralysed?M_LEVITATE = (1<< 5), // ... but not if this is setM_INVIS = (1<< 6), // is created invisM_SEE_INVIS = (1<< 7), // can see invisM_SPEAKS = (1<< 8), // uses talking codeM_CONFUSED = (1<< 9), // monster is perma-confused,M_BATTY = (1<<10), // monster is battyM_SPLITS = (1<<11), // monster can splitM_AMPHIBIOUS = (1<<12), // monster can swim in water,M_THICK_SKIN = (1<<13), // monster has more effective AC,M_HUMANOID = (1<<14), // for GlamourM_COLD_BLOOD = (1<<15), // susceptible to coldM_WARM_BLOOD = (1<<16), // no effect currentlyM_REGEN = (1<<17), // regenerates quicklyM_BURROWS = (1<<18), // monster digs through rockM_EVIL = (1<<19), // monster vulnerable to holy spellsM_UNIQUE = (1<<20), // monster is a uniqueM_FROZEN = (1<<21), // XXX: Potentially ditchableM_SPECIAL_ABILITY = (1<<26), // XXX: eventually make these spells?M_COLOUR_SHIFT = (1<<27), // flag for element colour shiftersM_DCHAR_SYMBOL = (1<<28), // monster looks like a DCHAR terrainM_NO_SKELETON = (1<<29), // boneless corpsesM_NO_WOUNDS = (1<<30), // doesn't show would levelM_NO_EXP_GAIN = (1<<31) // worth 0 xp};enum mon_resist_flags{MR_NO_FLAGS = 0,// resistances// Notes:// - negative energy is mostly handled via mons_has_life_force()// - acid is handled mostly by genus (jellies) plus non-living// - asphyx-resistance replaces hellfrost resistance.MR_RES_ELEC = (1<< 0),MR_RES_POISON = (1<< 1),MR_RES_FIRE = (1<< 2),MR_RES_HELLFIRE = (1<< 3),MR_RES_COLD = (1<< 4),MR_RES_ASPHYX = (1<< 5),// vulnerabilitiesMR_VUL_ELEC = (1<< 6),MR_VUL_POISON = (1<< 7),MR_VUL_FIRE = (1<< 8),MR_VUL_COLD = (1<< 9),// melee armour resists/vulnerabilities// XXX: how to do combos (bludgeon/slice, bludgeon/pierce)MR_RES_PIERCE = (1<<10),MR_RES_SLICE = (1<<11),MR_RES_BLUDGEON = (1<<12),MR_VUL_PIERCE = (1<<13),MR_VUL_SLICE = (1<<14),MR_VUL_BLUDGEON = (1<<15)
MONS_DRACONIAN,MONS_BLACK_DRACONIAN,MONS_MOTTLED_DRACONIAN,MONS_YELLOW_DRACONIAN,MONS_GREEN_DRACONIAN, // 315MONS_PURPLE_DRACONIAN,MONS_RED_DRACONIAN,MONS_WHITE_DRACONIAN,MONS_PALE_DRACONIAN,MONS_DRACONIAN_CALLER, // 320MONS_DRACONIAN_MONK,MONS_DRACONIAN_ZEALOT,MONS_DRACONIAN_SHIFTER,MONS_DRACONIAN_ANNIHILATOR,MONS_DRACONIAN_KNIGHT, // 325MONS_DRACONIAN_SCORCHER,
MS_CONTROLLED_BLINK,MS_CONTROL_UNDEAD,MS_MIASMA, // 55MS_SUMMON_LIZARDS,MS_BLINK_OTHER,MS_DISPEL_UNDEAD,MS_HELLFROST,MS_POISON_ARROW, // 60MS_SUMMON_SMALL_MAMMALS,MS_SUMMON_MUSHROOMS,// XXX: before adding more monster versions of player spells we should// consider merging the two lists into one and just having monsters// fail to implement the ones that are impractical.
NAUGHTY_NECROMANCY = 1, // 1 - using necromancy (spell or device)NAUGHTY_UNHOLY, // 2 - using unholy stuff (call imp, summon things)NAUGHTY_KILLING, // 3 - killing in the name of a peaceful deityNAUGHTY_ATTACK_HOLY, // 4 - attacking holy thingsNAUGHTY_ATTACK_FRIEND, // 5 - attacking friendly thingsNAUGHTY_FRIEND_DIES, // 6 - allowing friendly things to dieNAUGHTY_BUTCHER, // 7 - butchering in the name of a peaceful deityNAUGHTY_STABBING, // 8 - stabbingNAUGHTY_SPELLCASTING, // 9 - spellcastingNAUGHTY_POISON, // 10 - poisoningNAUGHTY_STIMULANTS, //jmf: next three new, some not yet usedNAUGHTY_ATE_MEAT,NAUGHTY_CREATED_LIFE,NUM_NAUGHTY_THINGS};enum OBJECT_CLASSES // (unsigned char) mitm[].base_type{
enum ORBS
enum operation_types{OPER_WIELD = 'w',OPER_QUAFF = 'q',OPER_DROP = 'd',OPER_EAT = 'e',OPER_TAKEOFF = 'T',OPER_WEAR = 'W',OPER_PUTON = 'P',OPER_REMOVE = 'R',OPER_READ = 'r',OPER_MEMORISE = 'M',OPER_ZAP = 'z',OPER_THROW = 't',OPER_EXAMINE = 'v',OPER_ANY = 0};enum orb_type
enum POTIONS
enum player_size_type{PSIZE_BODY, // entire body size -- used for EV/size of targetPSIZE_TORSO, // torso only (hybrids -- size of parts that use equip)PSIZE_PROFILE // profile only (for stealth checks)};// [dshaligram] If you edit potion colours/descriptions, also update// itemname.cc.enum potion_description_colour_type{PDC_CLEAR,PDC_BLUE,PDC_BLACK,PDC_SILVERY,PDC_CYAN,PDC_PURPLE,PDC_ORANGE,PDC_INKY,PDC_RED,PDC_YELLOW,PDC_GREEN,PDC_BROWN,PDC_PINK,PDC_WHITE,PDC_NCOLOURS};// [dshaligram] If you edit potion colours/descriptions, also update// itemname.cc.enum potion_description_qualifier_type{PDQ_NONE,PDQ_BUBBLING,PDQ_FUMING,PDQ_FIZZY,PDQ_VISCOUS,PDQ_LUMPY,PDQ_SMOKY,PDQ_GLOWING,PDQ_SEDIMENTED,PDQ_METALLIC,PDQ_MURKY,PDQ_GLUGGY,PDQ_OILY,PDQ_SLIMY,PDQ_EMULSIFIED,PDQ_NQUALS};enum potion_type
enum RUNE_TYPES
enum run_mode_type{RMODE_INTERLEVEL = -3, // Interlevel travel (Ctrl+G)RMODE_EXPLORE = -2, // Exploring (Ctrl+O)RMODE_TRAVEL = -1, // Classic or Plain Old travelRMODE_NOT_RUNNING = 0, // must remain equal to 0RMODE_CONTINUE,RMODE_START,RMODE_REST_DURATION = 100};enum rune_type
};enum shout_type{S_SILENT, // silentS_SHOUT, // shoutS_BARK, // barkS_SHOUT2, // shout twiceS_ROAR, // roarS_SCREAM, // screamS_BELLOW, // bellow (?)S_SCREECH, // screechS_BUZZ, // buzzS_MOAN, // moanS_WHINE, // irritating whine (mosquito)S_CROAK, // frog croakS_GROWL, // for bearsS_HISS, // for snakes and lizardsNUM_SHOUTS,S_RANDOM
enum SKILLS
// These are often addressed relative to each other (esp. delta SIZE_MEDIUM)enum size_type{SIZE_TINY, // rat/batSIZE_LITTLE, // sprigganSIZE_SMALL, // halfling/kobold/gnomeSIZE_MEDIUM, // human/elf/dwarfSIZE_LARGE, // troll/ogreSIZE_BIG, // centaur/naga/large quadrupedsSIZE_GIANT, // giantSIZE_HUGE, // dragonNUM_SIZE_LEVELS,SIZE_CHARACTER // transformations that don't change size};// [dshaligram] If you add a new skill, update skills2.cc, specifically// the skills[] array and skill_display_order[]. New skills must go at the// end of the list or in the unused skill numbers. NEVER rearrange this enum or// move existing skills to new numbers; save file compatibility depends on this// order.enum skill_type
enum SPELL_TYPES //jmf: 24jul2000: changed from integer-list to bitfield
enum spflag_type{SPFLAG_NONE = 0x0000,SPFLAG_DIR_OR_TARGET = 0x0001, // use DIR_NONE targetingSPFLAG_TARGET = 0x0002, // use DIR_TARGET targetingSPFLAG_GRID = 0x0004, // use DIR_GRID targetingSPFLAG_DIR = 0x0008, // use DIR_DIR targetingSPFLAG_TARGETING_MASK = 0x000f, // used to test for targetingSPFLAG_HELPFUL = 0x0010, // TARG_FRIENDS usedSPFLAG_NOT_SELF = 0x0020, // aborts on isMeSPFLAG_UNHOLY = 0x0040 // counts at "unholy"};enum spret_type{SPRET_ABORT = 0, // should be left as 0SPRET_FAIL,SPRET_SUCCESS};enum spschool_flag_type
enum SYMBOLS // beam[].type - note that this (and its variants) also accepts values from other enums - confusing {dlb}
// beam[].type - note that this (and its variants) also accepts values from other enums - confusing {dlb}enum zap_symbol_type
DVORP_CRUSHING, // 0DVORP_SLICING,DVORP_PIERCING,DVORP_CHOPPING
VAULT_VAULT_1 = 0,VAULT_VAULT_2 = 1,VAULT_VAULT_3 = 2,VAULT_VAULT_4 = 3,VAULT_VAULT_5 = 4,VAULT_VAULT_6 = 5,VAULT_VAULT_7 = 6,VAULT_VAULT_8 = 7,VAULT_VAULT_9 = 8,VAULT_VAULT_10 = 9,VAULT_ORC_TEMPLE = 10,VAULT_FARM_AND_COUNTRY = 11,VAULT_FORT_YAKTAUR = 12,VAULT_BOX_LEVEL = 13,VAULT_MY_MAP = 14,VAULT_VESTIBULE_MAP = 50,VAULT_CASTLE_DIS = 51,VAULT_ASMODEUS = 52,VAULT_ANTAEUS = 53,VAULT_ERESHKIGAL = 54,VAULT_MNOLEG = 60,VAULT_LOM_LOBON = 61,VAULT_CEREBOV = 62,VAULT_GLOORX_VLOQ = 63,// VAULT_MOLLUSC = 64,VAULT_BEEHIVE = 80,VAULT_SLIME_PIT = 81,VAULT_BOTTOM_OF_VAULTS = 82,VAULT_HALL_OF_BLADES = 83,VAULT_HALL_OF_ZOT = 84,VAULT_TEMPLE = 85,VAULT_SNAKE_PIT = 86,VAULT_ELF_HALL = 87,VAULT_TOMB_1 = 88,VAULT_TOMB_2 = 89,VAULT_TOMB_3 = 90,VAULT_SWAMP = 91,VAULT_RANDOM = 100,VAULT_MINIVAULT_1 = 200,VAULT_MINIVAULT_2 = 201,VAULT_MINIVAULT_3 = 202,VAULT_MINIVAULT_4 = 203,VAULT_MINIVAULT_5 = 204,VAULT_MINIVAULT_6 = 205,VAULT_MINIVAULT_7 = 206,VAULT_MINIVAULT_8 = 207,VAULT_MINIVAULT_9 = 208,VAULT_MINIVAULT_10 = 209,VAULT_MINIVAULT_11 = 210,VAULT_MINIVAULT_12 = 211,VAULT_MINIVAULT_13 = 212,VAULT_MINIVAULT_14 = 213,VAULT_MINIVAULT_15 = 214,VAULT_MINIVAULT_16 = 215,VAULT_MINIVAULT_17 = 216,VAULT_MINIVAULT_18 = 217,VAULT_MINIVAULT_19 = 218,VAULT_MINIVAULT_20 = 219,VAULT_MINIVAULT_21 = 220,VAULT_MINIVAULT_22 = 221,VAULT_MINIVAULT_23 = 222,VAULT_MINIVAULT_24 = 223,VAULT_MINIVAULT_25 = 224,VAULT_MINIVAULT_26 = 225,VAULT_MINIVAULT_27 = 226,VAULT_MINIVAULT_28 = 227,VAULT_MINIVAULT_29 = 228,VAULT_MINIVAULT_30 = 229,VAULT_MINIVAULT_31 = 230,VAULT_MINIVAULT_32 = 231,VAULT_MINIVAULT_33 = 232,VAULT_MINIVAULT_34 = 233,VAULT_MINIVAULT_35 = 234,VAULT_RAND_DEMON_1 = 300,VAULT_RAND_DEMON_2 = 301,VAULT_RAND_DEMON_3 = 302,VAULT_RAND_DEMON_4 = 303,VAULT_RAND_DEMON_5 = 304,VAULT_RAND_DEMON_6 = 305,VAULT_RAND_DEMON_7 = 306,VAULT_RAND_DEMON_8 = 307,VAULT_RAND_DEMON_9 = 308};enum vorpal_damage_type{// Types of damage a weapon can do... currently assuming that anything// with BLUDGEON always does "AND" with any other specified types,// and and sets not including BLUDGEON are "OR".DAM_BASH = 0x0000, // non-melee weapon blugeoningDAM_BLUDGEON = 0x0001, // crushingDAM_SLICE = 0x0002, // slicing/choppingDAM_PIERCE = 0x0004, // stabbing/piercingDAM_WHIP = 0x0008, // whip slashing (no butcher)// These are used for vorpal weapon desc (don't set more than one)DVORP_NONE = 0x0000, // used for non-melee weaponsDVORP_CRUSHING = 0x1000,DVORP_SLICING = 0x2000,DVORP_PIERCING = 0x3000,DVORP_CHOPPING = 0x4000, // used for axesDVORP_SLASHING = 0x5000, // used for whipsDVORP_STABBING = 0x6000, // used for knives/daggers// These are shortcuts to tie vorpal/damage types for easy setting...// as above, setting more than one vorpal type is trouble.DAMV_NON_MELEE = DVORP_NONE | DAM_BASH, // launchersDAMV_CRUSHING = DVORP_CRUSHING | DAM_BLUDGEON,DAMV_SLICING = DVORP_SLICING | DAM_SLICE,DAMV_PIERCING = DVORP_PIERCING | DAM_PIERCE,DAMV_CHOPPING = DVORP_CHOPPING | DAM_SLICE,DAMV_SLASHING = DVORP_SLASHING | DAM_WHIP,DAMV_STABBING = DVORP_STABBING | DAM_PIERCE,DAM_MASK = 0x0fff, // strips vorpal specificationDAMV_MASK = 0xf000 // strips non-vorpal specification
if (you.is_undead || you.mutation[MUT_TORMENT_RESISTANCE])
// [dshaligram] Switched to using ouch() instead of dec_hp so that// notes can also track torment and activities can be interrupted// correctly.int hploss = 0;if (!player_res_torment()){// negative energy resistance can alleviate tormenthploss = you.hp * (50 - player_prot_life() * 5) / 100 - 1;if (hploss >= you.hp)hploss = you.hp - 1;if (hploss < 0)hploss = 0;}if (!hploss)
dec_hp((you.hp / 2) - 1, false);
const char *aux = "torment";if (caster < 0){switch (caster){case TORMENT_CARDS:case TORMENT_SPELL:aux = "Symbol of Torment";break;case TORMENT_SPWLD:// FIXME: If we ever make any other weapon / randart// eligible to torment, this will be incorrect.aux = "Sceptre of Torment";break;case TORMENT_SCROLL:aux = "scroll of torment";break;}caster = TORMENT_GENERIC;}ouch(hploss, caster,caster != TORMENT_GENERIC? KILLED_BY_MONSTER: KILLED_BY_SOMETHING,aux);
switch (skill){case SK_SLINGS:type_wanted = MI_STONE;break;case SK_BOWS:type_wanted = MI_ARROW;break;case SK_CROSSBOWS:type_wanted = MI_DART;for (int i = 0; i < ENDOFPACK; i++){// Assuming that crossbow in inventory means that they// want bolts for it (not darts for a hand crossbow)...// perhaps we should check for both and compare ammo// amounts on hand?if (is_valid_item( you.inv[i] )&& you.inv[i].base_type == OBJ_WEAPONS&& you.inv[i].sub_type == WPN_CROSSBOW){type_wanted = MI_BOLT;break;}}break;case SK_DARTS:type_wanted = MI_DART;for (int i = 0; i < ENDOFPACK; i++){if (is_valid_item( you.inv[i] )&& you.inv[i].base_type == OBJ_WEAPONS&& you.inv[i].sub_type == WPN_BLOWGUN){// Assuming that blowgun in inventory means that they// may want needles for it (but darts might also be// wanted). Maybe expand this... see above comment.if (coinflip())type_wanted = MI_NEEDLE;break;}}break;default:type_wanted = MI_DART;break;}
if (mitm[thing_created].base_type == BOOK_MINOR_MAGIC_I|| mitm[thing_created].base_type == BOOK_MINOR_MAGIC_II|| mitm[thing_created].base_type == BOOK_MINOR_MAGIC_III)
if (thing.base_type == BOOK_MINOR_MAGIC_I|| thing.base_type == BOOK_MINOR_MAGIC_II|| thing.base_type == BOOK_MINOR_MAGIC_III)
set_item_ego_type( mitm[thing_created], OBJ_ARMOUR, SPARM_NORMAL );
set_item_ego_type( thing, OBJ_ARMOUR, SPARM_NORMAL );}break;case ARM_NAGA_BARDING:case ARM_CENTAUR_BARDING:// make barding appropriateif (you.species == SP_NAGA )thing.sub_type = ARM_NAGA_BARDING;else if ( you.species == SP_CENTAUR )thing.sub_type = ARM_CENTAUR_BARDING;else {thing.sub_type = ARM_BOOTS;// Fix illegal ego typesif (get_armour_ego_type(thing) == SPARM_COLD_RESISTANCE ||get_armour_ego_type(thing) == SPARM_FIRE_RESISTANCE)set_item_ego_type(thing, OBJ_ARMOUR, SPARM_NORMAL);
case WAND_INVISIBILITY:case WAND_FIREBALL:case WAND_HEALING:charge_gain = 3;break;
// remove "empty" autoinscriptionconst char* empty_inscription = "[empty]";size_t p = wand.inscription.find(empty_inscription);if ( p != std::string::npos ) {// found it, delete itsize_t prespace = 0;if ( p != 0 && wand.inscription[p-1] == ' ' )prespace = 1;wand.inscription =wand.inscription.substr(0, p - prespace) +wand.inscription.substr(p + strlen(empty_inscription),std::string::npos);}switch (wand.sub_type){case WAND_INVISIBILITY:case WAND_FIREBALL:case WAND_HEALING:case WAND_HASTING:charge_gain = 3;break;
default:charge_gain = 8;break;
default:charge_gain = 8;break;}char str_pass[ ITEMNAME_SIZE ];item_name(wand, DESC_CAP_YOUR, str_pass);mprf("%s glows for a moment.", str_pass);wand.plus += 1 + random2avg( ((charge_gain - 1) * 3) + 1, 3 );if (wand.plus > charge_gain * 3)wand.plus = charge_gain * 3;
char str_pass[ ITEMNAME_SIZE ];in_name(you.equip[EQ_WEAPON], DESC_CAP_YOUR, str_pass);strcpy(info, str_pass);strcat(info, " glows for a moment.");mpr(info);
if (wand.plus2 <= MAX_ROD_CHARGE * ROD_CHARGE_MULT){wand.plus2 += ROD_CHARGE_MULT;
if (you.inv[you.equip[EQ_WEAPON]].plus > charge_gain * 3)you.inv[you.equip[EQ_WEAPON]].plus = charge_gain * 3;
work = true;}if (wand.plus < wand.plus2){wand.plus = wand.plus2;work = true;}if (!work)return (false);char str_pass[ITEMNAME_SIZE];item_name( wand, DESC_CAP_YOUR, str_pass );mprf("%s glows for a moment.", str_pass);}
/**************************************************** ** BEGIN PUBLIC FUNCTIONS ** ****************************************************/
static bool got_curare_roll(const int item_level){return one_chance_in(item_level > 27? 6 :item_level < 2 ? 15 :(364 - 7 * item_level) / 25);}static void place_altars(){int altar_chances[][2] = {// These are percentages{ BRANCH_MAIN_DUNGEON, 8 },{ BRANCH_DIS, 0 },{ BRANCH_GEHENNA, 0 },{ BRANCH_VESTIBULE_OF_HELL, 0 },{ BRANCH_COCYTUS, 0 },{ BRANCH_TARTARUS, 0 },{ BRANCH_INFERNO, 0 },{ BRANCH_THE_PIT, 0 },{ BRANCH_ORCISH_MINES, 20 },{ BRANCH_HIVE, 0 },{ BRANCH_LAIR, 5 },{ BRANCH_SLIME_PITS, 5 },{ BRANCH_VAULTS, 5 },{ BRANCH_CRYPT, 5 },{ BRANCH_HALL_OF_BLADES, 0 },{ BRANCH_HALL_OF_ZOT, 1 },{ BRANCH_ECUMENICAL_TEMPLE, 0 },{ BRANCH_SNAKE_PIT, 10 },{ BRANCH_ELVEN_HALLS, 8 },{ BRANCH_TOMB, 0 },{ BRANCH_SWAMP, 0 },{ BRANCH_CAVERNS, 0 },{ -1, -1 }};// No altars before level 5.if (you.your_level < 4)return;
for (int i = 0; altar_chances[i][0] != -1; ++i){if (player_in_branch( altar_chances[i][0] )){int prob = altar_chances[i][1];while (prob){if (random2(100) >= prob)break;#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Placing an altar");#endifplace_altar();// Reduce the chance and try to place another.prob /= 5;}break;}}}/*********************************************************************** builder() - kickoff for the dungeon generator.*********************************************************************/
// clear all properties except mitm.base_type <used in switch below> {dlb}:mitm[p].sub_type = 0;mitm[p].flags = 0;mitm[p].special = 0;mitm[p].plus = 0;mitm[p].plus2 = 0;mitm[p].x = 0;mitm[p].y = 0;mitm[p].link = NON_ITEM;mitm[p].slot = 0;mitm[p].orig_monnum = 0;mitm[p].orig_place = 0;
if (one_chance_in(5))set_weapon_special( p, SPWPN_PROTECTION );if (coinflip())set_weapon_special(p, (coinflip() ? SPWPN_FLAME: SPWPN_FROST));
set_weapon_special( p, (tmp < 375) ? SPWPN_FLAME :(tmp < 750) ? SPWPN_FROST :(tmp < 920) ? SPWPN_PROTECTION :(tmp < 980) ? SPWPN_VORPAL: SPWPN_SPEED );
set_item_ego_type( mitm[p], OBJ_ARMOUR, SPARM_PROTECTION );
{const int tmp = random2(1000);set_item_ego_type( mitm[p], OBJ_ARMOUR,(tmp < 40) ? SPARM_RESISTANCE :(tmp < 160) ? SPARM_FIRE_RESISTANCE :(tmp < 280) ? SPARM_COLD_RESISTANCE :(tmp < 400) ? SPARM_POISON_RESISTANCE :(tmp < 520) ? SPARM_POSITIVE_ENERGY: SPARM_PROTECTION );
switch (random2(3)){case 0:if (mitm[p].plus2 == TBOOT_BOOTS)set_item_ego_type(mitm[p], OBJ_ARMOUR, SPARM_RUNNING);break;case 1:set_item_ego_type(mitm[p], OBJ_ARMOUR, SPARM_LEVITATION);break;case 2:set_item_ego_type(mitm[p], OBJ_ARMOUR, SPARM_STEALTH);break;}
case ARM_NAGA_BARDING:case ARM_CENTAUR_BARDING:{const int tmp = random2(600)+ 200 * (mitm[p].sub_type != ARM_BOOTS);set_item_ego_type( mitm[p], OBJ_ARMOUR,(tmp < 200) ? SPARM_RUNNING :(tmp < 400) ? SPARM_LEVITATION :(tmp < 600) ? SPARM_STEALTH :(tmp < 700) ? SPARM_COLD_RESISTANCE: SPARM_FIRE_RESISTANCE );
// don't give top-tier wands before 5 HDif ( menv[mid].hit_dice < 5 ){// technically these wands will be undercharged, but it// doesn't really matterif ( mitm[thing_created].sub_type == WAND_FIRE )mitm[thing_created].sub_type = WAND_FLAME;if ( mitm[thing_created].sub_type == WAND_COLD )mitm[thing_created].sub_type = WAND_FROST;if ( mitm[thing_created].sub_type == WAND_LIGHTNING )mitm[thing_created].sub_type = (coinflip() ?WAND_FLAME : WAND_FROST);}
mitm[bp].quantity = 0; // set below if force_item, else we toss this item!mitm[bp].plus = 0;mitm[bp].plus2 = 0;mitm[bp].special = 0;mitm[bp].orig_place = 0;mitm[bp].orig_monnum = 0;
temp_rand = random2(8);mitm[bp].sub_type = ((temp_rand > 5) ? WPN_LONG_SWORD : // 2 in 8(temp_rand > 3) ? WPN_SHORT_SWORD : // 2 in 8(temp_rand > 2) ? WPN_SCIMITAR : // 1 in 8(temp_rand > 1) ? WPN_MACE : // 1 in 8(temp_rand > 0) ? WPN_BOW // 1 in 8: WPN_HAND_CROSSBOW); // 1 in 8
temp_rand = random2(100);mitm[bp].sub_type = ((temp_rand > 79) ? WPN_LONG_SWORD : // 20%(temp_rand > 59) ? WPN_SHORT_SWORD : // 20%(temp_rand > 45) ? WPN_SCIMITAR : // 14%(temp_rand > 31) ? WPN_MACE : // 14%(temp_rand > 18) ? WPN_BOW : // 13%(temp_rand > 5) ? WPN_HAND_CROSSBOW // 13%: WPN_LONGBOW); // 6%
temp_rand = random2(24);mitm[bp].sub_type = ((temp_rand > 19) ? WPN_GREAT_SWORD :// 16.67%(temp_rand > 15) ? WPN_LONG_SWORD : // 16.67%(temp_rand > 11) ? WPN_BATTLEAXE : // 16.67%(temp_rand > 7) ? WPN_WAR_AXE : // 16.67%(temp_rand > 5) ? WPN_GREAT_MACE : // 8.33%(temp_rand > 3) ? WPN_GREAT_FLAIL :// 8.33%(temp_rand > 1) ? WPN_GLAIVE : // 8.33%(temp_rand > 0) ? WPN_BROAD_AXE // 4.17%: WPN_HALBERD); // 4.17%
temp_rand = random2(25);mitm[bp].sub_type = ((temp_rand > 20) ? WPN_GREAT_SWORD : // 16%(temp_rand > 16) ? WPN_LONG_SWORD : // 16%(temp_rand > 12) ? WPN_BATTLEAXE : // 16%(temp_rand > 8) ? WPN_WAR_AXE : // 16%(temp_rand > 5) ? WPN_GREAT_MACE : // 12%(temp_rand > 3) ? WPN_DIRE_FLAIL : // 8%(temp_rand > 2) ? WPN_LOCHABER_AXE : // 4%(temp_rand > 1) ? WPN_GLAIVE : // 4%(temp_rand > 0) ? WPN_BROAD_AXE // 4%: WPN_HALBERD); // 4%
case MONS_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_WHITE_DRACONIAN:case MONS_GREEN_DRACONIAN:case MONS_PALE_DRACONIAN:case MONS_MOTTLED_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_YELLOW_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_DRACONIAN_SHIFTER:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_KNIGHT:
build_vaults(level_number, which_demon + 60);
const int vault =random_map_for_tag(pandemon_level_names[(int) which_demon]);ASSERT(vault != -1);if (vault == -1){fprintf(stderr, "Failed to find Pandemonium level %s!\n",pandemon_level_names[(int) which_demon]);exit(1);}build_vaults(level_number, vault);
build_minivaults(level_number, 300 + random2(9));
int vault = random_map_for_tag("pan");ASSERT( vault != -1 );if (vault == -1){fprintf(stderr, "Failed to build Pandemonium minivault!\n");exit(1);}build_minivaults(level_number, vault);
int subdepth = subdungeon_depth(you.where_are_you, level_number);const std::string name = level_name(subdepth);std::string altname;if (subdepth == branch_depth( branch_stair(you.where_are_you) ))altname = level_name(0);int vault = random_map_for_place(name);if (vault == -1)vault = random_map_for_place(altname);if (vault != -1){build_vaults(level_number, vault);// [dshaligram] XXX: Is link_items() needed for all vaults?link_items();return 1;}
case BRANCH_VAULTS:if (level_number == you.branch_stairs[STAIRS_VAULTS]+ branch_depth(STAIRS_VAULTS)){build_vaults(level_number, 82);return 1;}break;case BRANCH_HALL_OF_BLADES:if (level_number == you.branch_stairs[STAIRS_HALL_OF_BLADES]+ branch_depth(STAIRS_HALL_OF_BLADES)){build_vaults(level_number, 83);return 1;}break;case BRANCH_HALL_OF_ZOT:if (level_number == you.branch_stairs[STAIRS_HALL_OF_ZOT]+ branch_depth(STAIRS_HALL_OF_ZOT)){build_vaults(level_number, 84);return 1;}break;case BRANCH_ECUMENICAL_TEMPLE:if (level_number == you.branch_stairs[STAIRS_ECUMENICAL_TEMPLE]+ branch_depth(STAIRS_ECUMENICAL_TEMPLE)){build_vaults(level_number, 85);return 1;}break;case BRANCH_SNAKE_PIT:if (level_number == you.branch_stairs[STAIRS_SNAKE_PIT]+ branch_depth(STAIRS_SNAKE_PIT)){build_vaults(level_number, 86);return 1;}break;case BRANCH_ELVEN_HALLS:if (level_number == you.branch_stairs[STAIRS_ELVEN_HALLS]+ branch_depth(STAIRS_ELVEN_HALLS)){build_vaults(level_number, 87);return 1;}break;case BRANCH_TOMB:if (level_number == you.branch_stairs[STAIRS_TOMB] + 1){build_vaults(level_number, 88);return 1;}else if (level_number == you.branch_stairs[STAIRS_TOMB] + 2){build_vaults(level_number, 89);return 1;}else if (level_number == you.branch_stairs[STAIRS_TOMB] + 3){build_vaults(level_number, 90);return 1;}break;case BRANCH_SWAMP:if (level_number == you.branch_stairs[STAIRS_SWAMP]+ branch_depth(STAIRS_SWAMP)){build_vaults(level_number, 91);return 1;}break;
case BRANCH_DIS:if (level_number == 33){build_vaults(level_number, 51);return 1;}break;case BRANCH_GEHENNA:if (level_number == 33){build_vaults(level_number, 52);return 1;}break;case BRANCH_COCYTUS:if (level_number == 33){build_vaults(level_number, 53);return 1;}break;case BRANCH_TARTARUS:if (level_number == 33){build_vaults(level_number, 54);return 1;}break;
if (player_in_branch( BRANCH_DIS ))
int vault = random_map_for_place(level_name(subdungeon_depth(you.where_are_you, level_number)));if (vault == -1&& player_in_branch( BRANCH_MAIN_DUNGEON )&& level_number > 10 && level_number < 26 && one_chance_in(9))vault = random_map_for_depth(level_number);if (vault != -1)
env.trap[i].type = TRAP_AXE;
trap_type = TRAP_AXE;// Note we're boosting arrow trap numbers by moving it// down the list, and making spear and axe traps rarer.if (trap_type == TRAP_DART?random2(1 + level_number) > 2: one_chance_in(7))trap_type = TRAP_ARROW;
// Fill special room sr with monsters from the pit_list at density%...// then place a "lord of the pit" of lord_type at (lordx, lordy).static void fill_monster_pit( spec_room &sr,FixedVector<pit_mons_def, MAX_PIT_MONSTERS> &pit_list,int density, int lord_type, int lordx, int lordy ){int i, x, y;// make distribution cumulativefor (i = 1; i < MAX_PIT_MONSTERS; i++){// assuming that the first zero rarity is the end of the list:if (!pit_list[i].rare)break;pit_list[i].rare = pit_list[i].rare + pit_list[i - 1].rare;}const int num_types = i;const int rare_sum = pit_list[num_types - 1].rare;// calculate die_size, factoring in the density% of the pitconst int die_size = (rare_sum * 100) / density;#if DEBUG_DIAGNOSTICSfor (i = 0; i < num_types; i++){char buff[ ITEMNAME_SIZE ];const int delta = ((i > 0) ? pit_list[i].rare - pit_list[i - 1].rare: pit_list[i].rare);const float perc = (static_cast<float>( delta ) * 100.0)/ static_cast<float>( rare_sum );mprf( MSGCH_DIAGNOSTICS, "%6.2f%%: %s", perc,moname( pit_list[i].type, true, DESC_PLAIN, buff ) );}#endif// put the boss monster downif (lord_type != MONS_PROGRAM_BUG)mons_place( lord_type, BEH_SLEEP, MHITNOT, true, lordx, lordy );// place monsters and give them items {dlb}:for (x = sr.x1; x <= sr.x2; x++){for (y = sr.y1; y <= sr.y2; y++){// avoid the boss (or anyone else we may have dropped already)if (mgrd[x][y] != NON_MONSTER)continue;const int roll = random2( die_size );// density skip (no need to iterate)if (roll >= rare_sum)continue;
case MAP_NORTHWEST:v1x = 1;v2x = 40;v1y = 1;v2y = 35;initial_y++;dig_dir_x = 1;dig_dir_y = 0;break;
// Figure out which way we need to go to dig our way out of the vault.const bool x_edge =initial_x == place.x || initial_x == place.x + place.width - 1;const bool y_edge =initial_y == place.y || initial_y == place.y + place.height - 1;
case MAP_SOUTHEAST:v1x = 40;v2x = GXM;v1y = 35;v2y = GYM;initial_y--;dig_dir_x = 0;dig_dir_y = -1;break;
// Does this level require Dis treatment (metal wallification)?// XXX: Change this so the level definition can explicitly state what// kind of wallification it wants.const bool dis_wallify = place.map->has_tag("dis");v1x = place.x + 1;v1y = place.y + 1;v2x = place.x + place.width;v2y = place.y + place.height;
// Checks how rare a weapon is. Many of these have special routines for// placement, especially those with a rarity of zero. Chance is out of 10.static char rare_weapon(unsigned char w_type){// zero value weapons must be placed specially -- see items() {dlb}if (is_demonic(w_type))return 0;switch (w_type){case WPN_CLUB:case WPN_DAGGER:return 10;case WPN_HAND_AXE:case WPN_FALCHION:case WPN_MACE:case WPN_QUARTERSTAFF:return 9;case WPN_BOW:case WPN_FLAIL:case WPN_HAMMER:case WPN_SABRE:case WPN_SHORT_SWORD:case WPN_SLING:case WPN_SPEAR:return 8;case WPN_LONG_SWORD:case WPN_MORNINGSTAR:case WPN_WAR_AXE:return 7;case WPN_BATTLEAXE:case WPN_CROSSBOW:case WPN_GREAT_SWORD:case WPN_SCIMITAR:case WPN_TRIDENT:return 6;case WPN_GLAIVE:case WPN_HALBERD:case WPN_BLOWGUN:return 5;case WPN_BROAD_AXE:case WPN_HAND_CROSSBOW:case WPN_SPIKED_FLAIL:case WPN_WHIP:return 4;case WPN_GREAT_MACE:return 3;case WPN_ANCUS:case WPN_GREAT_FLAIL:case WPN_SCYTHE:return 2;case WPN_GIANT_CLUB:case WPN_GIANT_SPIKED_CLUB:return 1;// zero value weapons must be placed specially -- see items() {dlb}case WPN_DOUBLE_SWORD:case WPN_EVENINGSTAR:case WPN_EXECUTIONERS_AXE:case WPN_KATANA:case WPN_KNIFE:case WPN_QUICK_BLADE:case WPN_TRIPLE_SWORD:return 0;default:// should not happen now that calls are bounded by NUM_WEAPONS {dlb}return -1;}} // end rare_weapon()
static void place_spec_shop( int level_number,unsigned char shop_x, unsigned char shop_y,unsigned char force_s_type )
void place_spec_shop( int level_number,unsigned char shop_x, unsigned char shop_y,unsigned char force_s_type, bool representative )
static bool place_specific_trap(unsigned char spec_x, unsigned char spec_y,unsigned char spec_type)
static void jelly_pit(int level_number, spec_room &sr){FixedVector< pit_mons_def, MAX_PIT_MONSTERS > pit_list;const int lordx = sr.x1 + random2(sr.x2 - sr.x1);const int lordy = sr.y1 + random2(sr.y2 - sr.y1);for (int i = 0; i < MAX_PIT_MONSTERS; i++){pit_list[i].type = MONS_PROGRAM_BUG;pit_list[i].rare = 0;}#if DEBUG_DIAGNOSTICSmprf( MSGCH_DIAGNOSTICS, "Build: Jelly Pit" );#endifpit_list[0].type = MONS_OOZE;pit_list[0].rare = 27 - level_number / 5;pit_list[1].type = MONS_JELLY;pit_list[1].rare = 20;pit_list[2].type = MONS_BROWN_OOZE;pit_list[2].rare = 3 + level_number;pit_list[3].type = MONS_DEATH_OOZE;pit_list[3].rare = 2 + (2 * level_number) / 3;if (level_number >= 12){pit_list[4].type = MONS_AZURE_JELLY;pit_list[4].rare = 1 + (level_number - 12) / 3;}if (level_number >= 15){pit_list[5].type = MONS_ACID_BLOB;pit_list[5].rare = 1 + (level_number - 15) / 4;}fill_monster_pit( sr, pit_list, 90, MONS_PROGRAM_BUG, lordx, lordy );}bool place_specific_trap(unsigned char spec_x, unsigned char spec_y,unsigned char spec_type)
// every so often, we'll relax the OOD restrictions. Avoids// infinite loops (if we don't do this, things like creating
// every so often, we'll relax the OOD restrictions. Avoids// infinite loops (if we don't do this, things like creating
std::vector<dungeon_feature_type> features_by_desc(const text_pattern &pattern);inline int view2gridX(int vx){return (you.x_pos + vx - VIEW_CX);}inline int view2gridY(int vy){return (you.y_pos + vy - VIEW_CY);}inline int grid2viewX(int gx){return (gx - you.x_pos + VIEW_CX);}inline int grid2viewY(int gy){return (gy - you.y_pos + VIEW_CY);}
}/* safe version of direction */void direction( struct dist &moves, int restrict, int mode,bool confirm_fizzle ){while ( 1 ){direction2( moves, restrict, mode );if ( moves.isMe && Options.confirm_self_target == true &&mode != TARG_FRIEND ){if ( yesno("Really target yourself? ", false, 'n') )return;elsempr("Choose a better target.", MSGCH_PROMPT);}else if ( confirm_fizzle && !moves.isValid && Options.fizzlecheck_on ){if ( yesno("Really fizzle? ", false, 'n') )return;elsempr("Try again.", MSGCH_PROMPT);}else{return;}}
#ifdef WIZARDcase 'F':targChosen = true;mx = you.x_pos + cx - VIEW_CX;my = you.y_pos + cy - VIEW_CY;if (!in_bounds(mx, my))break;mid = mgrd[mx][my];if (mid == NON_MONSTER)break;mprf("Changing attitude of %s\n",ptr_monam(&menv[mid], DESC_PLAIN));menv[mid].attitude =menv[mid].attitude == ATT_HOSTILE?ATT_FRIENDLY: ATT_HOSTILE;describe_monsters( menv[ mid ].type, mid );redraw_screen();mesclr( true );// describe the cell again.describe_cell(view2gridX(cx), view2gridY(cy));break;#endif
if (newcx < 1) newcx = 1;if (newcx > 33) newcx = 33;if (newcy < 1) newcy = 1;if (newcy > 17) newcy = 17;
if (newcx < VIEW_SX) newcx = VIEW_SX;if (newcx > VIEW_EX) newcx = VIEW_EX;if (newcy < VIEW_SY) newcy = VIEW_SY;if (newcy > VIEW_EY) newcy = VIEW_EY;
}static bool is_shopstair(int x, int y){return (is_stair(grd[x][y]) || grd[x][y] == DNGN_ENTER_SHOP);}extern unsigned char (*mapch2) (unsigned char);static bool is_full_mapped(int x, int y){unsigned grid = grd[x][y];int envch = env.map[x - 1][y - 1];return (envch && envch == mapch2(grid));
static int surround_nonshopstair_count(int x, int y){int count = 0;for (int ix = -1; ix < 2; ++ix){for (int iy = -1; iy < 2; ++iy){int nx = x + ix, ny = y + iy;if (nx <= 0 || nx >= GXM || ny <= 0 || ny >= GYM)continue;if (is_full_mapped(nx, ny) && !is_shopstair(nx, ny))count++;}}return (count);}// For want of a better name...static bool clear_mapped(int x, int y){if (!is_full_mapped(x, y))return (false);if (is_shopstair(x, y))return (surround_nonshopstair_count(x, y) > 0);return (true);}
int trf; // used for trap type??switch (grd[mx][my])
std::vector<dungeon_feature_type> features;if (pattern.valid()){for (int i = 0; i < NUM_FEATURES; ++i){std::string fdesc = feature_description(i);if (fdesc.empty())continue;if (pattern.matches( fdesc ))features.push_back( dungeon_feature_type(i) );}}return (features);}std::string feature_description(int grid){switch (grid)
for (trf = 0; trf < MAX_TRAPS; trf++){if (env.trap[trf].x == mx&& env.trap[trf].y == my){break;}if (trf == MAX_TRAPS - 1){mpr("Error - couldn't find that trap.");error_message_to_player();break;}}switch (env.trap[trf].type){case TRAP_DART:return ("A dart trap.");case TRAP_ARROW:return ("An arrow trap.");case TRAP_SPEAR:return ("A spear trap.");case TRAP_AXE:return ("An axe trap.");case TRAP_TELEPORT:return ("A teleportation trap.");case TRAP_AMNESIA:return ("An amnesia trap.");case TRAP_BLADE:return ("A blade trap.");case TRAP_BOLT:return ("A bolt trap.");case TRAP_ZOT:return ("A Zot trap.");case TRAP_NEEDLE:return ("A needle trap.");default:mpr("An undefined trap. Huh?");error_message_to_player();break;}break;
return ("A trap.");
return ("");
}std::string feature_description(int mx, int my){int trf; // used for trap type??const int grid = grd[mx][my];std::string desc = feature_description(grid);switch (grid){case DNGN_TRAP_MECHANICAL:case DNGN_TRAP_MAGICAL:case DNGN_TRAP_III:for (trf = 0; trf < MAX_TRAPS; trf++){if (env.trap[trf].x == mx&& env.trap[trf].y == my){break;}if (trf == MAX_TRAPS - 1){mpr("Error - couldn't find that trap.");error_message_to_player();break;}}switch (env.trap[trf].type){case TRAP_DART:return ("A dart trap.");case TRAP_ARROW:return ("An arrow trap.");case TRAP_SPEAR:return ("A spear trap.");case TRAP_AXE:return ("An axe trap.");case TRAP_TELEPORT:return ("A teleportation trap.");case TRAP_AMNESIA:return ("An amnesia trap.");case TRAP_BLADE:return ("A blade trap.");case TRAP_BOLT:return ("A bolt trap.");case TRAP_ZOT:return ("A Zot trap.");case TRAP_NEEDLE:return ("A needle trap.");default:mpr("An undefined trap. Huh?");error_message_to_player();break;}break;case DNGN_ENTER_SHOP:return (shop_name(mx, my));default:break;}return (desc);
description += "It inflicts extra damage upon your enemies. ";
if (is_range_weapon(item)){description += "Any ";description += ammo_name( item );description += " fired from it inflicts extra damage.";}else{description += "It inflicts extra damage upon your enemies. ";}
if (item.plus2 == TBOOT_NAGA_BARDING)description += "A special armour made for Nagas, ""to wear over their tails. ";else if (item.plus2 == TBOOT_CENTAUR_BARDING)description += "An armour made for centaurs, ""to wear over their equine half. ";elsedescription += "A pair of sturdy boots. ";
description += "A pair of boots.";
description +="Casting a spell from it consumes no food, and will not fail.$";
if (item.sub_type != STAFF_STRIKING)description +="$$It uses its own mana reservoir for casting spells, and ""recharges automatically by channeling mana from its ""wielder.";
break;case SPELL_SHUGGOTH_SEED:description += "implants a shuggoth seed, the larval parasitic form ""of the fearsome shuggoth, in a living host. The ""shuggoth seed will draw life from its host and then ""hatch, whereupon a fully grown shuggoth will burst ""from the unfortunate host's chest. ";
case MONS_DRACONIAN:case MONS_RED_DRACONIAN:case MONS_WHITE_DRACONIAN:case MONS_GREEN_DRACONIAN:case MONS_PALE_DRACONIAN:case MONS_MOTTLED_DRACONIAN:case MONS_BLACK_DRACONIAN:case MONS_YELLOW_DRACONIAN:case MONS_PURPLE_DRACONIAN:case MONS_DRACONIAN_SHIFTER:case MONS_DRACONIAN_SCORCHER:case MONS_DRACONIAN_ZEALOT:case MONS_DRACONIAN_ANNIHILATOR:case MONS_DRACONIAN_CALLER:case MONS_DRACONIAN_MONK:case MONS_DRACONIAN_KNIGHT:{description += "A ";
const int subsp = draco_subspecies( &menv[which_mons] );switch (subsp){case MONS_DRACONIAN: description += "brown "; break;case MONS_BLACK_DRACONIAN: description += "black "; break;case MONS_MOTTLED_DRACONIAN: description += "mottled "; break;case MONS_YELLOW_DRACONIAN: description += "yellow "; break;case MONS_GREEN_DRACONIAN: description += "green "; break;case MONS_PURPLE_DRACONIAN: description += "purple "; break;case MONS_RED_DRACONIAN: description += "red "; break;case MONS_WHITE_DRACONIAN: description += "white "; break;case MONS_PALE_DRACONIAN: description += "pale "; break;default:break;}description += "scaled humanoid with wings.";break;}
case MONS_ORANGE_STATUE:description += "An intricately carved statue of glittering orange ""crystal. Its eyes fix on yours with a piercing gaze.";break;case MONS_SILVER_STATUE:description += "A beautiful statue of silver. Its eyes ""glow with an otherworldly radiance.";break;
int hspell_pass[6] = { MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL,MS_NO_SPELL, MS_NO_SPELL, MS_NO_SPELL };int msecc = ((class_described == MONS_HELLION) ? MST_BURNING_DEVIL :(class_described == MONS_PANDEMONIUM_DEMON) ? MST_GHOST: menv[ which_mons ].number);mons_spell_list(msecc, hspell_pass);
const monster_spells &hspell_pass = menv[which_mons].spells;
"can gain a variety of powers useful in the fight against the evil, but must" EOL"abstain from the use of necromancy and other forms of unholy magic." EOL"Zin appreciates long-standing faith as well as sacrifices of valued objects." EOL;
"can gain blessings on their weapons and a variety of powers useful in the" EOL"fight against the evil, but must abstain from the use of necromancy and other" EOL"forms of unholy magic. Zin appreciates long-standing faith as well as " EOL"sacrifices of valued objects.";
"against evil. Followers may be granted with the ability to summarily dispense" EOL"the wrath of heaven, but must never use any form of evil magic and should" EOL"fight honourably. The Shining One appreciates long-standing persistence in " EOL"the endless crusade, as well as the dedicated destruction of unholy creatures.";
"against evil. Followers may be granted blessings on their weapons and the " EOL"ability to summarily dispense the wrath of heaven, but must never use any " EOL"form of evil magic and should fight honourably. The Shining One appreciates" EOL"long-standing persistence in the endless crusade, as well as the dedicated " EOL"destruction of unholy creatures.";
snprintf( info, INFO_SIZE,"%s %s watches over you during prayer." EOL,god_name(which_god),(you.piety >= 150) ? "carefully": // > 4/5(you.piety >= 90) ? "often" : // > 2/3"sometimes" // less than 2:3);cprintf(info);
penance_ability = true; // suppress "none" latercprintf( "%s %s watches over you during prayer." EOL,god_name(which_god),(you.piety >= 150) ? "carefully": // > 4/5(you.piety >= 90) ? "often" : // > 2/3"sometimes"); // less than 2:3
bool is_run_delay(int delay);const char *activity_interrupt_name(activity_interrupt_type ai);activity_interrupt_type get_activity_interrupt(const std::string &);const char *delay_name(int delay);delay_type get_delay(const std::string &);void perform_activity();void interrupt_activity( activity_interrupt_type ai,const activity_interrupt_data &a= activity_interrupt_data() );
#include "travel.h"extern std::vector<SelItem> items_for_multidrop;static void armour_wear_effects(const int item_inv_slot);static void handle_run_delays(const delay_queue_item &delay);static void handle_macro_delay();// Returns true if this delay can act as a parent to other delays, i.e. if// other delays can be spawned while this delay is running. If is_parent_delay// returns true, new delays will be pushed immediately to the front of the// delay in question, rather than at the end of the queue.static bool is_parent_delay(int delay){// Interlevel travel can do upstairs/downstairs delays.// Lua macros can in theory perform any of the other delays,// including travel; in practise travel still assumes there can be// no parent delay.return (delay == DELAY_TRAVEL || delay == DELAY_MACRO);}
static void push_delay(const delay_queue_item &delay){for (delay_queue_type::iterator i = you.delay_queue.begin();i != you.delay_queue.end();++i){if (is_parent_delay( i->type )){you.delay_queue.insert(i, delay);return;}}you.delay_queue.push_back( delay );}static void pop_delay(){if (!you.delay_queue.empty())you.delay_queue.erase( you.delay_queue.begin() );}static void clear_pending_delays(){while (you.delay_queue.size() > 1)you.delay_queue.pop_back();}
you.delay_queue.push( delay );
switch ( delay.type ) {case DELAY_ARMOUR_ON:mpr("You start putting on your armour.", MSGCH_MULTITURN_ACTION);break;case DELAY_ARMOUR_OFF:mpr("You start removing your armour.", MSGCH_MULTITURN_ACTION);break;case DELAY_MEMORISE:mpr("You start memorising the spell.", MSGCH_MULTITURN_ACTION);break;case DELAY_PASSWALL:mpr("You begin to meditate on the wall.", MSGCH_MULTITURN_ACTION);break;default:break;}push_delay( delay );
case DELAY_INTERUPTABLE:// always stopable by definition...
case DELAY_RUN:case DELAY_REST:case DELAY_TRAVEL:case DELAY_MACRO:// Always interruptible.pop_delay();// Keep things consistent, otherwise disturbing phenomena can occur.// Note that runrest::stop() will turn around and call stop_delay()// again, but that's okay because the delay is already popped off// the queue.if (is_run_delay(delay.type) && you.running)stop_running();// There's no special action needed for macros - if we don't call out// to the Lua function, it can't do damage.break;case DELAY_INTERRUPTIBLE:// always stoppable by definition...
// First check cases where delay may no longer be valid:// XXX: need to handle passwall when monster digs -- bwrif (delay.type == DELAY_BUTCHER)
if (delay.type == DELAY_MACRO){handle_macro_delay();return;}// First check cases where delay may no longer be valid:// XXX: need to handle passwall when monster digs -- bwrif (delay.type == DELAY_BUTCHER){// A monster may have raised the corpse you're chopping up! -- bwr// Note that a monster could have raised the corpse and another// monster could die and create a corpse with the same ID number...// However, it would not be at the player's square like the// original and that's why we do it this way. Note that// we ignore the conversion to skeleton possibility just to// be nice. -- bwrif (is_valid_item( mitm[ delay.parm1 ] )&& mitm[ delay.parm1 ].base_type == OBJ_CORPSES&& mitm[ delay.parm1 ].x == you.x_pos&& mitm[ delay.parm1 ].y == you.y_pos )
// A monster may have raised the corpse you're chopping up! -- bwr// Note that a monster could have raised the corpse and another// monster could die and create a corpse with the same ID number...// However, it would not be at the player's square like the// original and that's why we do it this way. Note that// we ignore the conversion to skeleton possiblity just to// be nice. -- bwrif (is_valid_item( mitm[ delay.parm1 ] )&& mitm[ delay.parm1 ].base_type == OBJ_CORPSES&& mitm[ delay.parm1 ].x == you.x_pos&& mitm[ delay.parm1 ].y == you.y_pos){// mark work done on the corpse in case we stop -- bwrmitm[ delay.parm1 ].plus2++;
// special < 100 is the rottenness checkif ( (mitm[delay.parm1].special < 100) &&(delay.parm2 >= 100) ) {mpr("The corpse rots.", MSGCH_ROTTEN_MEAT);delay.parm2 = 99; // don't give the message twice
// Handle delay:if (delay.duration > 0)
// Throw away invalid items; items usually go invalid because// of chunks rotting away.while (!items_for_multidrop.empty()// Don't look for gold in inventory&& items_for_multidrop[0].slot != PROMPT_GOT_SPECIAL&& !is_valid_item(you.inv[ items_for_multidrop[0].slot ]))items_for_multidrop.erase( items_for_multidrop.begin() );if ( items_for_multidrop.empty() )
delay.duration--;
switch ( delay.type ){case DELAY_ARMOUR_ON:in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass );snprintf( info, INFO_SIZE,"You continue putting on %s.", str_pass );mpr(info, MSGCH_MULTITURN_ACTION);break;case DELAY_ARMOUR_OFF:in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass );snprintf( info, INFO_SIZE,"You continue taking off %s.", str_pass );mpr(info, MSGCH_MULTITURN_ACTION);break;case DELAY_BUTCHER:mpr("You continue butchering the corpse.",MSGCH_MULTITURN_ACTION);break;case DELAY_MEMORISE:mpr("You continue memorising.", MSGCH_MULTITURN_ACTION);break;case DELAY_PASSWALL:mpr("You continue meditating on the rock.",MSGCH_MULTITURN_ACTION);break;case DELAY_MULTIDROP:drop_item( items_for_multidrop[0].slot,items_for_multidrop[0].quantity );items_for_multidrop.erase( items_for_multidrop.begin() );break;default:break;
else
delay.duration--;}else{switch (delay.type){case DELAY_AUTOPICKUP:break;case DELAY_WEAPON_SWAP:weapon_switch( delay.parm1 );break;case DELAY_JEWELLERY_ON:puton_ring( delay.parm1, false );break;case DELAY_ARMOUR_ON:armour_wear_effects( delay.parm1 );break;case DELAY_ARMOUR_OFF:
switch (delay.type)
in_name( delay.parm1, DESC_NOCAP_YOUR, str_pass );snprintf( info, INFO_SIZE, "You finish taking off %s.", str_pass );mpr(info);const equipment_type slot =get_armour_slot( you.inv[delay.parm1] );if (slot == EQ_BODY_ARMOUR)
case DELAY_AUTOPICKUP:break;
you.equip[EQ_BODY_ARMOUR] = -1;}else{switch (slot){case EQ_SHIELD:if (delay.parm1 == you.equip[EQ_SHIELD])you.equip[EQ_SHIELD] = -1;break;case EQ_CLOAK:if (delay.parm1 == you.equip[EQ_CLOAK])you.equip[EQ_CLOAK] = -1;break;case EQ_HELMET:if (delay.parm1 == you.equip[EQ_HELMET])you.equip[EQ_HELMET] = -1;break;case EQ_GLOVES:if (delay.parm1 == you.equip[EQ_GLOVES])you.equip[EQ_GLOVES] = -1;break;case EQ_BOOTS:if (delay.parm1 == you.equip[EQ_BOOTS])you.equip[EQ_BOOTS] = -1;break;default:break;}}unwear_armour( delay.parm1 );you.redraw_armour_class = 1;you.redraw_evasion = 1;break;}case DELAY_EAT:mpr( "You finish eating." );// For chunks, warn the player if they're not getting much// nutrition.if (delay.parm1)chunk_nutrition_message(delay.parm1);break;
mpr( "Your icy armour melts away.", MSGCH_DURATION );you.redraw_armour_class = 1;you.duration[DUR_ICY_ARMOUR] = 0;
case DNGN_ROCK_WALL:case DNGN_STONE_WALL:case DNGN_METAL_WALL:case DNGN_GREEN_CRYSTAL_WALL:case DNGN_WAX_WALL:case DNGN_SILVER_STATUE:case DNGN_ORANGE_CRYSTAL_STATUE:ouch(1 + you.hp, 0, KILLED_BY_PETRIFICATION);break;case DNGN_SECRET_DOOR: // oughtn't happencase DNGN_CLOSED_DOOR: // open the doorgrd[ pass_x ][ pass_y ] = DNGN_OPEN_DOOR;break;default:break;
you.equip[EQ_SHIELD] = delay.parm1;break;case ARM_CLOAK:you.equip[EQ_CLOAK] = delay.parm1;break;case ARM_HELMET:you.equip[EQ_HELMET] = delay.parm1;break;case ARM_GLOVES:you.equip[EQ_GLOVES] = delay.parm1;break;case ARM_BOOTS:you.equip[EQ_BOOTS] = delay.parm1;break;
}break;case DELAY_BUTCHER:strcpy( info, "You finish " );strcat( info, (you.species == SP_TROLL|| you.species == SP_GHOUL) ? "ripping": "chopping" );strcat( info, " the corpse into pieces." );mpr( info );turn_corpse_into_chunks( mitm[ delay.parm1 ] );if (you.berserker && you.berserk_penalty != NO_BERSERK_PENALTY){mpr("You enjoyed that.");you.berserk_penalty = 0;}break;case DELAY_DROP_ITEM:// Note: checking if item is droppable is assumed to// be done before setting up this delay... this includes// quantity (delay.parm2). -- bwr// Make sure item still exists.if (!is_valid_item( you.inv[ delay.parm1 ] ))break;// Must handle unwield_item before we attempt to copy// so that temporary brands and such are cleared. -- bwrif (delay.parm1 == you.equip[EQ_WEAPON]){unwield_item( delay.parm1 );you.equip[EQ_WEAPON] = -1;canned_msg( MSG_EMPTY_HANDED );}if (!copy_item_to_grid( you.inv[ delay.parm1 ],you.x_pos, you.y_pos, delay.parm2,true )){mpr("Too many items on this level, not dropping the item.");}else{quant_name( you.inv[ delay.parm1 ], delay.parm2,DESC_NOCAP_A, str_pass );snprintf( info, INFO_SIZE, "You drop %s.", str_pass );mpr(info);dec_inv_item_quantity( delay.parm1, delay.parm2 );}break;case DELAY_ASCENDING_STAIRS:up_stairs();untag_followers();break;case DELAY_DESCENDING_STAIRS:down_stairs( false, delay.parm1 );untag_followers();break;case DELAY_INTERRUPTIBLE:case DELAY_UNINTERRUPTIBLE:// these are simple delays that have no effect when completebreak;default:mpr( "You finish doing something." );break;}you.wield_change = true;print_stats(); // force redraw of the statsyou.turn_is_over = true;pop_delay();}}static void armour_wear_effects(const int item_slot){item_def &arm = you.inv[item_slot];set_ident_flags(arm, ISFLAG_EQ_ARMOUR_MASK );mprf("You finish putting on %s.", item_name(arm, DESC_NOCAP_YOUR));const equipment_type eq_slot = get_armour_slot(arm);if (eq_slot == EQ_BODY_ARMOUR){you.equip[EQ_BODY_ARMOUR] = item_slot;
ego = get_armour_ego_type( you.inv[ delay.parm1 ] );if (ego != SPARM_NORMAL){switch (ego){case SPARM_RUNNING:strcpy(info, "You feel quick");strcat(info, (you.species == SP_NAGA|| you.species == SP_CENTAUR) ? "." : " on your feet.");mpr(info);break;
if (you.duration[DUR_ICY_ARMOUR] != 0){mpr( "Your icy armour melts away.", MSGCH_DURATION );you.redraw_armour_class = 1;you.duration[DUR_ICY_ARMOUR] = 0;}}else{switch (eq_slot){case EQ_SHIELD:if (you.duration[DUR_CONDENSATION_SHIELD]){mpr( "Your icy shield evaporates.", MSGCH_DURATION );you.duration[DUR_CONDENSATION_SHIELD] = 0;}you.equip[EQ_SHIELD] = item_slot;break;case EQ_CLOAK:you.equip[EQ_CLOAK] = item_slot;break;case EQ_HELMET:you.equip[EQ_HELMET] = item_slot;break;case EQ_GLOVES:you.equip[EQ_GLOVES] = item_slot;break;case EQ_BOOTS:you.equip[EQ_BOOTS] = item_slot;break;default:break;}}
case SPARM_FIRE_RESISTANCE:mpr("You feel resistant to fire.");break;
int ego = get_armour_ego_type( arm );if (ego != SPARM_NORMAL){switch (ego){case SPARM_RUNNING:mprf("You feel quick%s.",(you.species == SP_NAGA || you.species == SP_CENTAUR)? "" : " on your feet");break;
if (you.inv[ delay.parm1 ].sub_type < ARM_SHIELD|| you.inv[ delay.parm1 ].sub_type > ARM_LARGE_SHIELD){you.equip[EQ_BODY_ARMOUR] = -1;}else{switch (you.inv[ delay.parm1 ].sub_type){case ARM_BUCKLER:case ARM_LARGE_SHIELD:case ARM_SHIELD:if (delay.parm1 == you.equip[EQ_SHIELD])you.equip[EQ_SHIELD] = -1;break;
you.redraw_armour_class = 1;you.redraw_evasion = 1;}
case ARM_CLOAK:if (delay.parm1 == you.equip[EQ_CLOAK])you.equip[EQ_CLOAK] = -1;break;
static command_type get_running_command() {if ( kbhit() ) {stop_running();return CMD_NO_CMD;}if ( is_resting() ) {you.running.rest();return CMD_MOVE_NOWHERE;}return direction_to_command( you.running.x, you.running.y );}
case ARM_HELMET:if (delay.parm1 == you.equip[EQ_HELMET])you.equip[EQ_HELMET] = -1;break;
static void handle_run_delays(const delay_queue_item &delay){// Handle inconsistencies between the delay queue and you.running.// We don't want to send the game into a deadlock.if (!you.running){pop_delay();return;}
case ARM_GLOVES:if (delay.parm1 == you.equip[EQ_GLOVES])you.equip[EQ_GLOVES] = -1;break;
command_type cmd = CMD_NO_CMD;switch (delay.type){case DELAY_REST:case DELAY_RUN:cmd = get_running_command();break;case DELAY_TRAVEL:cmd = travel();break;}
unwear_armour( delay.parm1 );
// If you.running has gone to zero, and the run delay was not// removed, remove it now. This is needed to clean up after// find_travel_pos() function in travel.cc.if (!you.running && is_run_delay(current_delay_action()))pop_delay();}
if (pass_x != 0 && pass_y != 0){
// Returns true if the delay should be interrupted, false if the user function// had no opinion on the matter, -1 if the delay should not be interrupted.static int userdef_interrupt_activity( const delay_queue_item &idelay,activity_interrupt_type ai,const activity_interrupt_data &at ){#ifdef CLUA_BINDINGSconst int delay = idelay.type;lua_State *ls = clua.state();if (!ls || ai == AI_FORCE_INTERRUPT)return (true);// Kludge: We have to continue to support ch_stop_run. :-(if (is_run_delay(delay) && you.running && ai == AI_SEE_MONSTER){bool stop_run = false;if (clua.callfn("ch_stop_run", "M>b",(const monsters *) at.data, &stop_run)){if (stop_run)return (true);// No further processing.return (-1);}// If we get here, ch_stop_run wasn't defined, fall through to the// other handlers.}const char *interrupt_name = activity_interrupt_name(ai);const char *act_name = delay_name(delay);
switch (grd[ pass_x ][ pass_y ]){case DNGN_ROCK_WALL:case DNGN_STONE_WALL:case DNGN_METAL_WALL:case DNGN_GREEN_CRYSTAL_WALL:case DNGN_WAX_WALL:case DNGN_SILVER_STATUE:case DNGN_ORANGE_CRYSTAL_STATUE:ouch(1 + you.hp, 0, KILLED_BY_PETRIFICATION);break;
bool ran = clua.callfn("c_interrupt_activity", "1:ssA",act_name, interrupt_name, &at);if (ran){// If the function returned nil, we want to cease processing.if (lua_isnil(ls, -1)){lua_pop(ls, 1);return (-1);}
//jmf: hmm, what to do. kill the monster? (seems too powerful)// displace the monster? randomly teleport the monster?// This seems fair: try to move the monster, but if not// able to, then kill it.int mon = mgrd[ pass_x ][ pass_y ];if (mon != NON_MONSTER){monster_blink( &menv[ mon ] );
#endifreturn (false);}
// recheck square for monstermon = mgrd[ pass_x ][ pass_y ];if (mon != NON_MONSTER)monster_die( &menv[ mon ], KILL_YOU, 0 );}
// Returns true if the activity should be interrupted, false otherwise.static bool should_stop_activity(const delay_queue_item &item,activity_interrupt_type ai,const activity_interrupt_data &at){int userd = userdef_interrupt_activity(item, ai, at);
const unsigned char grid = grd[ you.x_pos ][ you.y_pos ];if ((grid == DNGN_LAVA || grid == DNGN_DEEP_WATER)&& !player_is_levitating()){if (you.species == SP_MERFOLK && grid == DNGN_DEEP_WATER){mpr("You fall into the water and return ""to your normal form.");merfolk_start_swimming();}else{fall_into_a_pool( true, grid );redraw_screen();}}}}break;
return (ai == AI_FORCE_INTERRUPT ||(Options.activity_interrupts[item.type][ai]));}
case DELAY_BUTCHER:strcpy( info, "You finish " );strcat( info, (you.species == SP_TROLL|| you.species == SP_GHOUL) ? "ripping": "chopping" );
void interrupt_activity( activity_interrupt_type ai,const activity_interrupt_data &at ){const int delay = current_delay_action();if (delay == DELAY_NOT_DELAYED)return;
if (you.berserker && you.berserk_penalty != NO_BERSERK_PENALTY)
// Check the other queued delays; the first delay that is interruptible// will kill itself and all subsequent delays. This is so that a travel// delay stacked behind a delay such as stair/autopickup will be killed// correctly by interrupts that the simple stair/autopickup delay ignores.for (int i = 1, size = you.delay_queue.size(); i < size; ++i){const delay_queue_item &it = you.delay_queue[i];if (should_stop_activity(it, ai, at)){// Do we have a queued run delay? If we do, flush the delay queue// so that stop running Lua notifications happen.for (int j = i; j < size; ++j){if (is_run_delay( you.delay_queue[j].type ))
case DELAY_DROP_ITEM:// Note: checking if item is dropable is assumed to// be done before setting up this delay... this includes// quantity (delay.parm2). -- bwr
// Non-run queued delays can be discarded without any processing.you.delay_queue.erase( you.delay_queue.begin() + i,you.delay_queue.end() );break;}}}
// Make sure item still exists.if (!is_valid_item( you.inv[ delay.parm1 ] ))break;
static const char *activity_interrupt_names[] ={"force", "keypress", "full_hp", "full_mp", "statue","hungry", "message", "hp_loss", "burden", "stat","monster", "monster_attack", "teleport"};
// Must handle unwield_item before we attempt to copy// so that temporary brands and such are cleared. -- bwrif (delay.parm1 == you.equip[EQ_WEAPON]){unwield_item( delay.parm1 );you.equip[EQ_WEAPON] = -1;canned_msg( MSG_EMPTY_HANDED );}
const char *activity_interrupt_name(activity_interrupt_type ai){ASSERT( sizeof(activity_interrupt_names)/ sizeof(*activity_interrupt_names) == NUM_AINTERRUPTS );
if (!copy_item_to_grid( you.inv[ delay.parm1 ],you.x_pos, you.y_pos, delay.parm2 )){mpr("Too many items on this level, not dropping the item.");}else{quant_name( you.inv[ delay.parm1 ], delay.parm2,DESC_NOCAP_A, str_pass );
if (ai == NUM_AINTERRUPTS)return ("");
case DELAY_INTERUPTABLE:case DELAY_UNINTERUPTABLE:// these are simple delays that have no effect when completebreak;
static const char *delay_names[] ={"not_delayed", "eat", "armour_on", "armour_off", "jewellery_on","memorise", "butcher", "autopickup", "weapon_swap", "passwall","drop_item", "multidrop", "ascending_stairs", "descending_stairs", "run","rest", "travel", "macro", "interruptible", "uninterruptible",};
const char *delay_name(int delay){ASSERT( sizeof(delay_names) / sizeof(*delay_names) == NUM_DELAYS );if (delay < 0 || delay >= NUM_DELAYS)return ("");return delay_names[delay];}
// this is the size of the border around the playing area (see in_bounds())#define BOUNDARY_BORDER 1// Now some defines about the actual play area:// Note: these boundaries are exclusive for the zone the player can move/dig,// and are inclusive for the area that we display on the map.// Note: that the right (bottom) boundary is one smaller here.#define X_BOUND_1 BOUNDARY_BORDER#define X_BOUND_2 (GXM - BOUNDARY_BORDER)#define X_WIDTH (X_BOUND_2 - X_BOUND_1 + 1)#define Y_BOUND_1 BOUNDARY_BORDER#define Y_BOUND_2 (GYM - BOUNDARY_BORDER)#define Y_WIDTH (Y_BOUND_2 - Y_BOUND_1 + 1)// these mark the center zone where the player moves without shifting#define ABYSS_SHIFT_RADIUS 10#define X_ABYSS_1 (X_BOUND_1 + ABYSS_SHIFT_RADIUS)#define X_ABYSS_2 (GXM - X_ABYSS_1)#define X_ABYSS_WIDTH (X_ABYSS_2 - X_ABYSS_1 + 1)#define X_ABYSS_CENTER (X_ABYSS_1 + X_ABYSS_WIDTH / 2)#define Y_ABYSS_1 (Y_BOUND_1 + ABYSS_SHIFT_RADIUS)#define Y_ABYSS_2 (GYM - Y_ABYSS_1)#define Y_ABYSS_WIDTH (Y_ABYSS_2 - Y_ABYSS_1 + 1)#define Y_ABYSS_CENTER (Y_ABYSS_1 + Y_ABYSS_WIDTH / 2)#define LOS_SX 8#define LOS_EX 25#define LOS_SY 1#define LOS_EY 17#define VIEW_SX 1#define VIEW_EX 33#define VIEW_SY 1#define VIEW_EY 17#define VIEW_WIDTH (VIEW_EX - VIEW_SX + 1)#define VIEW_HEIGHT (VIEW_EY - VIEW_SY + 1)#define VIEW_Y_DIFF (((VIEW_EX - VIEW_SX + 1) - (VIEW_EY - VIEW_SY + 1)) / 2)
// Maximum charge level for rods#define MAX_ROD_CHARGE 17#define ROD_CHARGE_MULT 100// Should never exceed 255 - durations are saved as single bytes.#define GOURMAND_MAX 200#define GOURMAND_NUTRITION_BASE 20#define CHUNK_BASE_NUTRITION 1000// This value is used to mark immune levels of MR#define MAG_IMMUNE 5000// This is the damage amount used to signal insta-death#define INSTANT_DEATH -9999// grids that monsters can see#define MONSTER_LOS_RANGE 8// most items allowed in a shop#define MAX_SHOP_ITEMS 16// sound level standards// mininum is the base, we add mult * radius to it:#define SL_EXPLODE_MIN 10#define SL_EXPLODE_MULT 10// #define SL_BOW 3#define SL_TRAP_CLICK 3#define SL_HISS 6#define SL_BUZZ 6#define SL_GROWL 8#define SL_MOAN 8#define SL_SPLASH 8#define SL_CREAK 8#define SL_CROAK 8#define SL_BARK 10#define SL_YELL 10#define SL_TRAP_JAM 12#define SL_SHRIEK 12#define SL_ROAR 15#define SL_DIG 15#define SL_NOISY_WEAPON 20#define SL_HORN 25#define SL_NOISE_SCROLL 30#define SL_THUNDER 30#define SL_PROJECTED_NOISE 30#define SL_EARTHQUAKE 30#define SL_TRAP_ZOT 30// Maximum enchantment on weapons/armour/secondary armours// Note: use armour_max_enchant(item) to get the correct limit for item#define MAX_WPN_ENCHANT 5#define MAX_ARM_ENCHANT 5#define MAX_SEC_ENCHANT 2#define NUM_STAVE_ADJ 9
#define ENVF_FLAGS 0xFF00U#define ENVF_DETECT_MONS 0x0100U#define ENVF_DETECT_ITEM 0x0200U// This square is known because of detect-creatures/detect-items#define ENVF_DETECTED 0x0800U#define ENVF_COLOR(x) (((x) >> 12) & 0xF)
if (grd[you.x_pos][you.y_pos] == DNGN_FLOOR){strcpy(info, "An altar grows from the floor ");strcat(info,(you.species == SP_NAGA || you.species == SP_CENTAUR)? "before you!" : "at your feet!");mpr(info);grd[you.x_pos][you.y_pos] = dvar1;}else{do{dvar[0] = 10 + random2(GXM - 20);dvar[1] = 10 + random2(GYM - 20);}while (grd[dvar[0]][dvar[1]] != DNGN_FLOOR);grd[dvar[0]][dvar[1]] = dvar1;mpr( "You sense divine power!" );}
snprintf( info, INFO_SIZE, "An altar grows from the floor %s!",(you.species == SP_NAGA || you.species == SP_CENTAUR)? "before you" : "at your feet");mpr(info);grd[you.x_pos][you.y_pos] = dvar1;
int mon = -1;for (int i = 0; i < NUM_MONSTERS; i++){moname( i, true, DESC_PLAIN, obj_name );ptr = strstr( strlwr(obj_name), strlwr(specs) );if (ptr != NULL){mpr( obj_name );if (ptr == obj_name){// we prefer prefixes over partial matchesmon = i;break;}elsemon = i;}}
#ifdef WIZARDstatic int create_fsim_monster(int mtype, int hp){const int mi =create_monster( mtype, 0, BEH_HOSTILE, you.x_pos, you.y_pos,MHITNOT, 250 );if (mi == -1)return (mi);monsters *mon = &menv[mi];mon->hit_points = mon->max_hit_points = hp;return (mi);}static skill_type fsim_melee_skill(const item_def *item){skill_type sk = SK_UNARMED_COMBAT;if (item)sk = weapon_skill(*item);return (sk);}static void fsim_set_melee_skill(int skill, const item_def *item){you.skills[fsim_melee_skill(item)] = skill;you.skills[SK_FIGHTING] = skill * 15 / 27;}static void fsim_set_ranged_skill(int skill, const item_def *item){you.skills[range_skill(*item)] = skill;you.skills[SK_RANGED_COMBAT] = skill * 15 / 27;}static void fsim_item(FILE *out,bool melee,const item_def *weap,int wskill, unsigned long damage,long iterations, long hits,int maxdam, unsigned long time){double hitdam = hits? double(damage) / hits : 0.0;int avspeed = (int) (time / iterations);fprintf(out, " %2d | %3ld%% | %5.2f | %5.2f | %5.2f | %3d | %2ld\n",wskill,100 * hits / iterations,double(damage) / iterations,hitdam,double(damage) * player_speed() / avspeed / iterations,maxdam,time / iterations);}static bool fsim_ranged_combat(FILE *out, int wskill, int mi,const item_def *item, int missile_slot){monsters &mon = menv[mi];unsigned long cumulative_damage = 0L;unsigned long time_taken = 0L;long hits = 0L;int maxdam = 0;const int thrown = missile_slot == -1? get_fire_item_index() : missile_slot;if (thrown == ENDOFPACK || thrown == -1){mprf("No suitable missiles for combat simulation.");return (false);}fsim_set_ranged_skill(wskill, item);no_messages mx;const long iter_limit = Options.fsim_rounds;const int hunger = you.hunger;for (long i = 0; i < iter_limit; ++i){mon.hit_points = mon.max_hit_points;bolt beam;you.time_taken = player_speed();if (throw_it(beam, thrown, &mon))hits++;you.hunger = hunger;time_taken += you.time_taken;int damage = (mon.max_hit_points - mon.hit_points);cumulative_damage += damage;if (damage > maxdam)maxdam = damage;}fsim_item(out, false, item, wskill, cumulative_damage,iter_limit, hits, maxdam, time_taken);return (true);}static bool fsim_melee_combat(FILE *out, int wskill, int mi,const item_def *item){monsters &mon = menv[mi];unsigned long cumulative_damage = 0L;unsigned long time_taken = 0L;long hits = 0L;int maxdam = 0;fsim_set_melee_skill(wskill, item);no_messages mx;const long iter_limit = Options.fsim_rounds;const int hunger = you.hunger;for (long i = 0; i < iter_limit; ++i){mon.hit_points = mon.max_hit_points;you.time_taken = player_speed();if (you_attack(mi, true))hits++;you.hunger = hunger;time_taken += you.time_taken;int damage = (mon.max_hit_points - mon.hit_points);cumulative_damage += damage;if (damage > maxdam)maxdam = damage;}fsim_item(out, true, item, wskill, cumulative_damage, iter_limit, hits,maxdam, time_taken);return (true);}static bool debug_fight_simulate(FILE *out, int wskill, int mi, int miss_slot){int weapon = you.equip[EQ_WEAPON];const item_def *iweap = weapon != -1? &you.inv[weapon] : NULL;if (iweap && iweap->base_type == OBJ_WEAPONS&& is_range_weapon(*iweap))return fsim_ranged_combat(out, wskill, mi, iweap, miss_slot);elsereturn fsim_melee_combat(out, wskill, mi, iweap);}static const item_def *fsim_weap_item(){const int weap = you.equip[EQ_WEAPON];if (weap == -1)return NULL;return &you.inv[weap];}static std::string fsim_wskill(){const item_def *iweap = fsim_weap_item();return iweap && iweap->base_type == OBJ_WEAPONS&& is_range_weapon(*iweap)?skill_name( range_skill(*iweap) ) :iweap? skill_name( fsim_melee_skill(iweap) ) :skill_name( SK_UNARMED_COMBAT );}static std::string fsim_weapon(int missile_slot){char item_buf[ITEMNAME_SIZE];if (you.equip[EQ_WEAPON] != -1){const item_def &weapon = you.inv[ you.equip[EQ_WEAPON] ];item_name(weapon, DESC_PLAIN, item_buf, true);if (is_range_weapon(weapon)){const int missile =missile_slot == -1? get_fire_item_index() :missile_slot;if (missile < ENDOFPACK){std::string base = item_buf;base += " with ";in_name(missile, DESC_PLAIN, item_buf, true);return (base + item_buf);}}}else{strncpy(item_buf, "unarmed", sizeof item_buf);}return (item_buf);}static std::string fsim_time_string(){time_t curr_time = time(NULL);struct tm *ltime = localtime(&curr_time);if (ltime){char buf[100];snprintf(buf, sizeof buf, "%4d%02d%02d/%2d:%02d:%02d",ltime->tm_year + 1900,ltime->tm_mon + 1,ltime->tm_mday,ltime->tm_hour,ltime->tm_min,ltime->tm_sec);return (buf);}return ("");}static void fsim_mon_stats(FILE *o, const monsters &mon){char buf[ITEMNAME_SIZE];fprintf(o, "Monster : %s\n",moname(mon.type, true, DESC_PLAIN, buf));fprintf(o, "HD : %d\n", mon.hit_dice);fprintf(o, "AC : %d\n", mon.armour_class);fprintf(o, "EV : %d\n", mon.evasion);}static void fsim_title(FILE *o, int mon, int ms){char buf[ITEMNAME_SIZE];fprintf(o, CRAWL " version " VERSION "\n\n");fprintf(o, "Combat simulation: %s %s vs. %s (%ld rounds) (%s)\n",species_name(you.species, you.experience_level),you.class_name,moname(menv[mon].type, true, DESC_PLAIN, buf),Options.fsim_rounds,fsim_time_string().c_str());fprintf(o, "Experience: %d\n", you.experience_level);fprintf(o, "Strength : %d\n", you.strength);fprintf(o, "Intel. : %d\n", you.intel);fprintf(o, "Dexterity : %d\n", you.dex);fprintf(o, "Base speed: %d\n", player_speed());fprintf(o, "\n");fsim_mon_stats(o, menv[mon]);fprintf(o, "\n");fprintf(o, "Weapon : %s\n", fsim_weapon(ms).c_str());fprintf(o, "Skill : %s\n", fsim_wskill().c_str());fprintf(o, "\n");fprintf(o, "Skill | Accuracy | Av.Dam | Av.HitDam | Eff.Dam | Max.Dam | Av.Time\n");}static int cap_stat(int stat){return (stat < 1 ? 1 :stat > 127 ? 127 :stat);}static bool debug_fight_sim(int mindex, int missile_slot){FILE *ostat = fopen("fight.stat", "a");if (!ostat){// I'm not sure what header provides errno on djgpp,// and it's insufficiently important for a wizmode-only// feature.#ifndef DOSmprf("Can't write fight.stat: %s", strerror(errno));#endifreturn (false);}bool success = true;FixedVector<unsigned char, 50> skill_backup = you.skills;int ystr = you.strength,yint = you.intel,ydex = you.dex;int yxp = you.experience_level;for (int i = SK_FIGHTING; i < NUM_SKILLS; ++i)you.skills[i] = 0;you.experience_level = Options.fsim_xl;if (you.experience_level < 1)you.experience_level = 1;if (you.experience_level > 27)you.experience_level = 27;you.strength = cap_stat(Options.fsim_str);you.intel = cap_stat(Options.fsim_int);you.dex = cap_stat(Options.fsim_dex);fsim_title(ostat, mindex, missile_slot);for (int wskill = 0; wskill <= 27; ++wskill){mesclr();mprf("Calculating average damage for %s at skill %d",fsim_weapon(missile_slot).c_str(), wskill);if (!debug_fight_simulate(ostat, wskill, mindex, missile_slot))goto done_combat_sim;fflush(ostat);// Not checking in the combat loop itself; that would be more responsive// for the user, but slow down the sim with all the calls to kbhit().if (kbhit() && getch() == 27){success = false;mprf("Canceling simulation\n");goto done_combat_sim;}}you.skills = skill_backup;you.strength = ystr;you.intel = yint;you.dex = ydex;you.experience_level = yxp;mprf("Done fight simulation with %s", fsim_weapon(missile_slot).c_str());done_combat_sim:fprintf(ostat, "-----------------------------------\n\n");fclose(ostat);return (success);}int fsim_kit_equip(const std::string &kit){int missile_slot = -1;char item_buf[ITEMNAME_SIZE];std::string::size_type ammo_div = kit.find("/");std::string weapon = kit;std::string missile;if (ammo_div != std::string::npos){weapon = kit.substr(0, ammo_div);missile = kit.substr(ammo_div + 1);trim_string(weapon);trim_string(missile);}for (int i = 0; i < ENDOFPACK; ++i){if (!is_valid_item(you.inv[i]))continue;in_name(i, DESC_PLAIN, item_buf, true);if (std::string(item_buf).find(weapon) != std::string::npos){if (i != you.equip[EQ_WEAPON]){wield_weapon(true, i, false);if (i != you.equip[EQ_WEAPON])return -100;}break;}}if (!missile.empty()){for (int i = 0; i < ENDOFPACK; ++i){if (!is_valid_item(you.inv[i]))continue;in_name(i, DESC_PLAIN, item_buf, true);if (std::string(item_buf).find(missile) != std::string::npos){missile_slot = i;break;}}}return (missile_slot);}// Writes statistics about a fight to fight.stat in the current directory.// For fight purposes, a punching bag is summoned and given lots of hp, and the// average damage the player does to the p. bag over 10000 hits is noted,// advancing the weapon skill from 0 to 27, and keeping fighting skill to 2/5// of current weapon skill.void debug_fight_statistics(bool use_defaults){int punching_bag = get_monster_by_name(Options.fsim_mons);if (punching_bag == -1 || punching_bag == MONS_PROGRAM_BUG)punching_bag = MONS_WORM;int mindex = create_fsim_monster(punching_bag, 500);if (mindex == -1){mprf("Failed to create punching bag");return;}if (!use_defaults){debug_fight_sim(mindex, -1);goto fsim_mcleanup;}for (int i = 0, size = Options.fsim_kit.size(); i < size; ++i){int missile = fsim_kit_equip(Options.fsim_kit[i]);if (missile == -100){mprf("Aborting sim on %s", Options.fsim_kit[i].c_str());goto fsim_mcleanup;}if (!debug_fight_sim(mindex, missile))break;}fsim_mcleanup:monster_die(&menv[mindex], KILL_DISMISSED, 0);}static int find_trap_slot(){for (int i = 0; i < MAX_TRAPS; ++i){if (env.trap[i].type == TRAP_UNASSIGNED)return (i);}return (-1);}void debug_make_trap(){char requested_trap[80];int trap_slot = find_trap_slot();trap_type trap = TRAP_UNASSIGNED;int gridch = grd[you.x_pos][you.y_pos];if (trap_slot == -1){mpr("Sorry, this level can't take any more traps.");return;}if (gridch != DNGN_FLOOR){mpr("You need to be on a floor square to make a trap.");return;}mprf(MSGCH_PROMPT, "What kind of trap? ");get_input_line( requested_trap, sizeof( requested_trap ) );if (!*requested_trap)return;strlwr(requested_trap);for (int t = TRAP_DART; t < NUM_TRAPS; ++t){if (strstr(requested_trap,trap_name(trap_type(t)))){trap = trap_type(t);break;}}if (trap == TRAP_UNASSIGNED){mprf("I know no traps named \"%s\"", requested_trap);return;}place_specific_trap(you.x_pos, you.y_pos, trap);mprf("Created a %s trap, marked it undiscovered",trap_name(trap));// Also tell travel that its world-view must change.travel_init_new_level();}static const char *shop_types[] = {"weapon","armour","antique weapon","antique armour","antiques","jewellery","wand","book","food","distillery","scroll","general"};void debug_make_shop(){char requested_shop[80];int gridch = grd[you.x_pos][you.y_pos];bool have_shop_slots = false;int new_shop_type = SHOP_UNASSIGNED;bool representative = false;if (gridch != DNGN_FLOOR){mpr("Insufficient floor-space for new Wal-Mart.");return;}for (int i = 0; i < MAX_SHOPS; ++i){if (env.shop[i].type == SHOP_UNASSIGNED){have_shop_slots = true;break;}}if (!have_shop_slots){mpr("There are too many shops on this level.");return;}mprf(MSGCH_PROMPT, "What kind of shop? ");get_input_line( requested_shop, sizeof( requested_shop ) );if (!*requested_shop)return;strlwr(requested_shop);for (unsigned i = 0; i < sizeof(shop_types) / sizeof (*shop_types); ++i){if (strstr(requested_shop, shop_types[i])){new_shop_type = i;break;}}if (new_shop_type == SHOP_UNASSIGNED){mprf("Bad shop type: \"%s\"", requested_shop);return;}representative = !!strchr(requested_shop, '*');place_spec_shop(you.your_level, you.x_pos, you.y_pos,new_shop_type, representative);link_items();mprf("Done.");}void debug_set_stats(){char buf[80];mprf(MSGCH_PROMPT, "Enter values for Str, Int, Dex (space separated): ");if (cancelable_get_line(buf, sizeof buf))return;int sstr = you.strength,sdex = you.dex,sint = you.intel;sscanf(buf, "%d %d %d", &sstr, &sint, &sdex);you.max_strength = you.strength = cap_stat(sstr);you.max_dex = you.dex = cap_stat(sdex);you.max_intel = you.intel = cap_stat(sint);you.redraw_strength = true;you.redraw_dexterity = true;you.redraw_intelligence = true;}#endif
############################################################################### Random vaults and minivaults; special levels (including V:8!) should go to# splev.des. Do NOT put special levels here, or they could be selected when the# game looks for random vaults.## key:# x - DNGN_ROCK_WALL# X - DNGN_PERMAROCK_WALL -> should always be undiggable! -- bwr# c - DNGN_STONE_WALL# v - DNGN_METAL_WALL# b - DNGN_GREEN_CRYSTAL_WALL# a - DNGN_WAX_WALL# . - DNGN_FLOOR# + - DNGN_CLOSED_DOOR# = - DNGN_SECRET_DOOR# @ - entry point - must be on outside and on a particular side - see templates# w - water# l - lava# >< - extra stairs - you can leave level by these but will never be placed on# them from another level# }{ - stairs 82/86 - You must be able to reach these from each other# )( - stairs 83/87# ][ - stairs 84/88# I - orcish idol (does nothing)# ^ - random trap## A - Vestibule gateway (opened by Horn). Can also be put on other levels for# colour, where it won't do anything.# B - Altar. These are assigned specific types (eg of Zin etc) in dungeon.cc,# in order.# C - Random Altar.# F - Typically a Granite Statue, but may be Orange or Silver (1 in 100)# G - Granite statue (does nothing)# H - orange crystal statue (attacks mind)# S - Silver statue (summons demons). Avoid using (rare).# T - Water fountain# U - Magic fountain# V - Permanently dry fountain## Statues can't be walked over and are only destroyed by disintegration## $ - gold# % - normal item# * - higher level item (good)# | - acquirement-level item (almost guaranteed excellent)# O - place an appropriate rune here# P - maybe place a rune here (50%)# R - honeycomb (2/3) or royal jelly (1/3)# Z - the Orb of Zot## 0 - normal monster# 9 - +5 depth monster# 8 - (+2) * 2 depth monster (aargh!). Can get golden dragons and titans# this way.# 1-7 - monster array monster# used to allocate specific monsters for a vault.# is filled with RANDOM_MONSTER if monster not specified## note that a lot of the vaults are in there mainly to add some interest to the# scenery, and are not the lethal treasure-fests you find in Angband# (not that there's anything wrong with that)## Guidelines for creating new vault maps:## [ds] If your map is not a minivault, make sure the side(s) that form the# border have a rock wall padding at least 6 deep. For instance, if your map# is ORIENT: north, you must have a 6 deep border of rock wall (or any# other kind of wall) along the northern, eastern, and western edges of the# map. If you're doing a fullscreen map (encompass), you must pad all around# the map with 6 layers of wall.## Basically you can just let your creativity run wild. You do not have# to place all of the stairs unless the level is full screen, in which# case you must place all except the extra stairs (> and <). The <> stairs# can be put anywhere and in any quantities but do not have to be there. Any# of the other stairs which are not present in the vault will be randomly# placed outside it. Also generally try to avoid rooms with no exit.## You can use the templates below to build vaults. The entry point '@' must be# present (except full-screen vaults where it must not) and be on the same# side of the vault as it is on the template, but can be anywhere along that# side.## I think that's all. Have fun!## ps - remember to add one to the monster array value when placing monsters# on each map (it is 1-7, not 0-6) {dlb}## [dshaligram] All vaults MUST have an ORIENT: attribute; if there's no# ORIENT: attribute, the vault is considered to be a minivault, which is# usually not what you want.###############################################################################default-depth: 1-27NAME: vault_1ORIENT: northMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....x........x........x.................................xxxxxxxxxxxxxxxxxxxxxx|=8...x........+........x......x....x1...x2...x2...x3...x...xxxxxxxxxxxxxxxxxxxx|x....x........x........x....................................xxxxxxxxxxxxxxxxxxxxxxxxx+xxx+xxxxxxxxxxxxxx..................................xxxxxxxxxxxxxxxxxxxx.......x.................+...................................8xxxxxxxxxxxxxxxxxx.......x.................x..................................xxxxxxxxxxxxxxxxxxxx.......+........3........xx+xx................................xxxxxxxxxxxxxxxxxx.......x.................x...x..x....x1...x2...x2...x3...x...xxxxxxxxxxxxxxxxxxx.......x.................x...x.............................xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........................x.S.x...xxxxxx..................|||||xxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxx...x...x......xxxxxx..................||xxxxxxxxxxxxxxxxxx....x...$$$$x****.999x...x...x.........xxxxxx.................xxxxxxxxxxxxxxxxxx....+...$$$$x****....x...x...+............xxxxxx.........8....xxxxxxxxxxxxxxxxxx....x...$$$$x****....+...x...x...............xxxxxx...........xxxxxxxxxxxxxxxxxx....x...$$$$x****....x...x999x..................xxxxxx........xxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxx...x...xxx...................xxxxxx.....xxxxxxxxxxxxxxxxxx.........................x...xxxxxx...................xxxxxx..xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxx+xxxxxxx+xxxx...xxxxxx+xxxxxxxx+xxxxxxxx+xxxxxxx=xxxxxxxxxxxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxxxxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxxxxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxxxxxxxxxxx....1....x...2...x...3...x...x....3....x....2...x......1......xxxxxxxxxxxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxxxxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxxxxxxxxxxx.........x.......x.......x...x.........x........x.............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: shapeshifter, shapeshifter, glowing shapeshifter############################################################################### A cell vaultNAME: vault_2ORIENT: northwestMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccccccccccccccccccccxxxxxxxxccw......^......w......^......wcxxxxxxxxcc.ccccccccccccc.ccccccccccccc.cxxxxxxxxcc.c....c.c....c.c....c.c....c.cxxxxxxxxcc.c.8..+.c....c.c....+.c..9.c.cxxxxxxxxcc.c....c.+..9.c.c.9..c.+....c.cxxxxxxxxcc.c....c.c....c.c....c.c....c.cxxxxxxxxcc.cccccc.cccccc.cccccc.cccccc.cxxxxxxxxcc^c....c.c....c.c....c.c....c.cxxxxxxxxcc.c....c.c....c.c....+.c....c.cxxxxxxxxcc.c8...+.+..8.c.c.8..c.+....c.cxxxxxxxxcc.c....c.c....c.c....c.c....c.cxxxxxxxxcc.cccccc.cccccc.cccccc.cccccc.cxxxxxxxxcc.c....c.c....c.c....c.c....c.cxxxxxxxxcc.c....+.c....c.c.0..c.c....c.cxxxxxxxxcc.c..9.c.+.8..c^c....+.+.0..c.cxxxxxxxxcc.c....c.c....c.c....c.c....c.cxxxxxxxxcc.cccccc.cccccc.cccccc.cccccc.cxxxxxxxxcc.c....c.c....c.c....c.c....c.cxxxxxxxxcc.c.0..+.+.0..c.c....+.+....c.cxxxxxxxxcc.c....c.c....c.c.0..c.c.8..c.cxxxxxxxxcc.cccccc.c....c.c....c.cccccc.cxxxxxxxxcc.c....c.cccccc.cccccc.c....c^cxxxxxxxxcc.c....c.c....c.c..9.+.+....c.cxxxxxxxxcc.c.0..+.+....c.c9...c.c.0..c.cxxxxxxxxcc.c....c.c.8..c.c....c.c....c.cxxxxxxxxcc.cccccc^cccccc.cccccc^cccccc.cxxxxxxxxccw.......Twwwwc.cwwwwT.......wcxxxxxxxxcccccccccccccccc.cccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxc@cxxxxxxxxxxxxxxENDMAP############################################################################### A little maze vaultNAME: vault_3ORIENT: northeastMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx900x..............x..........xxxxxxxxxxx999x.xxxxxxxxxxxx.x.xxxxxxxx.xxxxxxxxxxx000x.x............x.x......x.xxxxxxxxxxxx.xx.xxxxxxxxxxxxxx.x.xxxx.x.xxxxxxxxxxxx.x..............xx.x.88|x.x.xxxxxxxxxxxx.x.x.xxxxxxxxxx.xx.xxxxxx.x.xxxxxxxxxxxx.x.x.x........x...........x.xxxxxxxxxxxx.x.x.x.xxxxxx.xxxxxxxxxxxxx.xxxxxxxxxxxx.xxx.x.x$$$$x...............xxxxxxxxxxxx.....x.x$$$$x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.x$$$$x...............xxxxxxxxxxx........x$$$$x.xxxxxxxxxxxxx.xxxxxxxxxxx.xxxxxx.xxxx.x.............x.xxxxxxxxxxx.xxxxxx.xxxx.xxxxxxxxxxxxx.x.xxxxxxxxxxx.x.......xxx.x...........x.x.xxxxxxxxxxx.x.xxxxx.....x.x.xxxxx...x.x.xxxxxxxxxxx.x.x999xxxxxxx.x.x***x...x.x.xxxxxxxxxxx.x.x889........x.x|||xxxxx.x.xxxxxxxxxxx.x.x899x.xxxxx.x.x***xxxxx.x.xxxxxxxxxxx.x.xxxxx.xxxxx.x.xx.xxxxxx.x.xxxxxxxxxxx.x..........xx.x.xx........x.xxxxxxxxxxx.xxxxxxx.xx.xx.x.xxxxx.xxxxx.xxxxxxxxxxx.xxx000x.xx.xx.x.x$$$x.xxxxx.xxxxxxxxxxx|||x000x.x$$$x.x.x$$$x%%x%%%.xxxxxxxxxxx|||x000..x$8$x.x.x$$$x%%x%8%xxxxxxxxxxxx|||xxxxxxx$$$x.x..$$$xxxx%%%xxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxENDMAP############################################################################### thingy vault.NAME: vault_4ORIENT: southwestFLAGS: no_rotateMAPxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxx......0...0......xxxxxxxxxxxxxxxxxxxx.......................xxxxxxxxxxxxxxxxx.........0...0.........xxxxxxxxxxxxxxxx8......0.........0......8xxxxxxxxxxxxxxxx.........0...0.........xxxxxxxxxxxxxxxxx.......................xxxxxxxxxxxxxxxxxx........0...0........xxxxxxxxxxxxxxxxxxxxxxxx...........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...............xxxxxxxxxxxxxxxxxxxxxxx8.................8xxxxxxxxxxxxxxxxxxxxxxxx.............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx999xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAP############################################################################### hourglass vault.NAME: vault_5ORIENT: southeastFLAGS: no_rotateMAPxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................xxxxxxxxxxxxxxxxxxxxxx...................xxxxxxxxxxxxxxxxxxxxx...................xxxxxxxxxxxxxxxxxxxxxx.................xxxxxxxxxxxxxxxxxxxxxxx.................xxxxxxxxxxxxxxxxxxxxxxx.................xxxxxxxxxxxxxxxxxxxxxxxx...............xxxxxxxxxxxxxxxxxxxxxxxxx...............xxxxxxxxxxxxxxxxxxxxxxxxxx.............xxxxxxxxxxxxxxxxxxxxxxxxxxxx.....8.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...999...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx00000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx===xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...........xxxxxxxxxxxxxxxxxxxxxxxxxxxx......|......xxxxxxxxxxxxxxxxxxxxxxxxxx...............xxxxxxxxxxxxxxxxxxxxxxxxx...............xxxxxxxxxxxxxxxxxxxxxxxx........$........xxxxxxxxxxxxxxxxxxxxxxx.......$$$.......xxxxxxxxxxxxxxxxxxxxxxx....$$$$$$$$$....xxxxxxxxxxxxxxxxxxxxxx$$$$$$$$$$$$$$$$$$$xxxxxxxxxxxxxxxxxxxxx$$$$$$$$$$$$$$$$$$$xxxxxxxxxxxxxxxxxxxxxx$$$$$$$$$$$$$$$$$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAP########################################################################### A more Angbandy vaultNAME: vault_6ORIENT: northeastMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccccccccccccccccccccxxxxxxxxc*******cc..9...cc.+8c0c*c.c*c8cxxxxxxxxc******cc..cc..cc..cc0c.c.c.c8ccxxxxxxxxc*****cc..cc..cc..cc.c$c.c.c8c.cxxxxxxxxc****cc9.cc..cc8.cc|c.c|c.c*c0ccxxxxxxxxc***cc..cc..cc..cc.c.c.c.c.c.c$cxxxxxxxxc**cc..cc8.cc..cc.c*c.c.c.c.c.ccxxxxxxxxc+cc9.cc..cc..cc.c.c.c.c*c.c.c.cxxxxxxxxc^c..cc..cc..cc.c$c.c.c.c.c.c*ccxxxxxxxxc...cc..cc..cc.c.c.c9c$c.c.c.c9cxxxxxxxxc..cc..cc..cc$c.c.c*c.c.c.c9c9ccxxxxxxxxc.cc..cc..cc.c.c|c.c.c.c.c$c.c9cxxxxxxxxccc..cc..cc.c.c.c.c.c.c.c.c.cc+cxxxxxxxxcc..cc..cc.c*c.c.c.c.c.c$c.cc..cxxxxxxxxc0.cc..cc.c.c.c.c8c.c*c.c.cc0.ccxxxxxxxxc.cc..cc*c.c.c.c.c$c.c.c.cc..cccxxxxxxxxc^c..cc.c.c9c.c.c.c.c.c.cc..cc.cxxxxxxxxc0..cc$c.c.c*c0c.c.c.c.cc..cc.0cxxxxxxxxc..cc.c.c9c.c.c.c$c.c.cc.9cc...cxxxxxxxxc.cc9c.c.c.c.c.c.c.c.cc..cc..c^cxxxxxxxxccc.c.c$c.c.c.c.c.c$cc..cc..cc^cxxxxxxxxcc$c.c.c.c.c$c.c0c.cc..cc..cc..cxxxxxxxxc.c.c.c.c.c.c.c.c.cc9.cc..cc..ccxxxxxxxxcc.c8c.c.c$c.c.c.cc..cc..cc0.cccxxxxxxxxc.c$c.c$c0c.c.c.cc..cc..cc..cc$cxxxxxxxxcc.c.c.c.c.c*c.cc..cc..cc..cc$$cxxxxxxxxc.c.c.c.c.c.c.cc..cc0.cc..cc$$$cxxxxxxxxcc.c.c.c.c.c$cc..cc..cc..cc$$$$cxxxxxxxxc.c.c.c.c.c.cc.8.^..cc....+$$$$cxxxxxxxxcccc@cccccccccccccccccccccccccccxxxxxxxxENDMAP############################################################################# four-leaf vaultNAME: vault_7ORIENT: northwestMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........^..^.........xxxxxxxxxxxxxxxxx...xxxxxxxx..xxxxxxxx...xxxxxxxxxxxxxxx...xxxxxxxxx..xxxxxxxxx...xxxxxxxxxxxxx...xx$*....xx..xx....$$xx...xxxxxxxxxxx...xx$*$....xx..xx....$*$xx...xxxxxxxxxx..xx*$*$....xx..xx....*$$$xx..xxxxxxxxxx..xx$$$.00..xx..xx..00.*$*xx..xxxxxxxxxx..xx....09..xx..xx..90....xx..xxxxxxxxxx..xx......+xx....xx+......xx..xxxxxxxxxx..xx......x^......^x......xx..xxxxxxxxxx..xxxxxxxxx........xxxxxxxxx..xxxxxxxxxx..xxxxxxxx..........xxxxxxxx..xxxxxxxxxx..............TT..............xxxxxxxxxx..............TT..............xxxxxxxxxx..xxxxxxxx..........xxxxxxxx..xxxxxxxxxx..xxxxxxxxx........xxxxxxxxx..xxxxxxxxxx..xx......x^......^x......xx..xxxxxxxxxx..xx......+xx....xx+......xx..xxxxxxxxxx..xx....09..xx..xx..90....xx..xxxxxxxxxx..xx$$*.00..xx..xx..00.*$$xx..xxxxxxxxxx..xx*$*$....xx..xx....*$$*xx..xxxxxxxxxx...xx*$*....xx..xx....$$$xx...xxxxxxxxxxx...xx*$....xx..xx....*$xx...xxxxxxxxxxxxx...xxxxxxxxx..xxxxxxxxx...xxxxxxxxxxxxxxx...xxxxxxxx..xxxxxxxx...xxxxxxxxxxxxxxxxx..^................^..xxxxxxxxxxxxxxxxxxxxxxxxxxxx^^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx++xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxENDMAP############################################################################# Cross-vaultNAME: vault_8ORIENT: northwestMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............xxxxxxxxxxxxxxxxxxxxxxxxx..................xxxxxxxxxxxxxxxxxxxx......................xxxxxxxxxxxxxxxxx..........w..w..........xxxxxxxxxxxxxxx........wwww++wwww........xxxxxxxxxxxxxx......wwwvvv^^vvvwww......xxxxxxxxxxxxx......wwwwv.9..9.vwwww......xxxxxxxxxxxx.....wwwwwv......vwwwww.....xxxxxxxxxxxx....wwwwwvv......vvwwwww....xxxxxxxxxxx....wwwwwvv........vvwwwww....xxxxxxxxxx....wwvvvv....vv....vvvvww....xxxxxxxxxx...wwwv......vvvv......vwww...xxxxxxxxxx...wwwv....vv8vv8vv....vwww...xxxxxxxxxx..wwwwv...vvvv||vvvv...vwwww..xxxxxxxxxx^^wwwwv...vvvv||vvvv...vwwww^^xxxxxxxxxx..wwwwv....vv8vv8vv....vwwww..xxxxxxxxxx...wwwv......vvvv......vwww...xxxxxxxxxx...wwwvvvv....vv....vvvvwww...xxxxxxxxxx....wwwwwvv........vvwwwww....xxxxxxxxxxx...wwwwwwvv......vvwwwwww...xxxxxxxxxxxx....wwwwwwv......vwwwwww....xxxxxxxxxxxx.....wwwwwv......vwwwww.....xxxxxxxxxxxxx.....wwwwvvvvvvvvwwww.....xxxxxxxxxxxxxx.......wwwwwwwwwwww.......xxxxxxxxxxxxxxx.........wwwwww.........xxxxxxxxxxxxxxxxx.........^..^.........xxxxxxxxxxxxxxxxxxxx.......x++x.......xxxxxxxxxxxxxxxxxxxxxxxxx...xx..xx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..@.xxxxxxxxxxxxxxENDMAP############################################################################# Another thingy vaultNAME: vault_9ORIENT: southeastMAPxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxx.....^...............^.....xxxxxxxxxxxx..bb..xxxxxxxxxxxxxxxxx..bb..xxxxxxxxxxx..b...xxxxxxxxxxxxxxxxx...b..xxxxxxxxxxx...b..xxxxbbbbbbbbbxxxx..b...xxxxxxxxxxx..bb..xxbbb.......bbbxx..bb..xxxxxxxxxxx......xxb....9.9....bxx......xxxxxxxxxxx..bb..xbb..%$$$$$%..bbx..bb..xxxxxxxxxxx...b..xb..0%$***$%0..bx..b...xxxxxxxxxxx..b...xb..0%$*H*$%0..bx...b..xxxxxxxxxxx...b..xb..0%$***$%0..bx..b...xxxxxxxxxxx..b...xb...%$$$$$%...bx...b..xxxxxxxxxxx...b..xbb.900000009.bbx..b...xxxxxxxxxxx..b...xxb...........bxx...b..xxxxxxxxxxx..bb..xxbbb..9.9..bbbxx..bb..xxxxxxxxxxx......xxxxbbbb.bbbbxxxx......xxxxxxxxxxx..bb..xxxxxxxb=bxxxxxxx..bb..xxxxxxxxxxx..b...xxxxxxxx=xxxxxxxx...b..xxxxxxxxxxx...b..xxxxxxxx^xxxxxxxx..b...xxxxxxxxxxx..b....xxxxxxx=xxxxxxx....b..xxxxxxxxxxx...b...^.............^...b...xxxxxxxxxxx..b....xxxxxxxxxxxxxxx....b..xxxxxxxxxxx..bb..xxxxxxxxxxxxxxxxx..bb..xxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAP############################################################################# Impenetrable vaultNAME: vault_10ORIENT: southeastMAP..............@................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxx.....cccccccccccccccc..........xxxxxxxxx.....c[^...........9cc.........xxxxxxxxx.....c^xxxxx=xxxxxx..cc........xxxxxxxxx.....c.x9..^^^...9xx..cc.......xxxxxxxxx.....c.x.xxx=xxxx..xx..cc......xxxxxxxxx.....c.x^x$$$$$$xx..xx.9c......xxxxxxxxx.....c.=^=$*|||*$xx..xx.c......xxxxxxxxx.....c.x^xx$*|||*$xx.9x.c......xxxxxxxxx.....c.x9.xx$*|||*$xx^x.c......xxxxxxxxx.....c.xx..xx$*|||*$=^=.c......xxxxxxxxx.....c9.xx..xx$$$$$$x^x.c......xxxxxxxxx.....cc..xx..xxxx=xxx.x.c......xxxxxxxxx......cc..xx9...^^^..9x.c......xxxxxxxxx.......cc..xxxxxx=xxxxx^c......xxxxxxxxx........cc9...........^]c......xxxxxxxxx.........cccccccccccccccc......xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAP########################################################################## Orc templeNAME: orc_templeORIENT: southwestFLAGS: no_rotateMAPxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4.4xxxxxxxxxxxxxxxxxxxxxxxx**..........x414x..........**xxxxxxxxxxx**..........x4.4x..........**xxxxxxxxxxx............+...+....4.......xxxxxxxxxxx....4..4....x...x............xxxxxxxxxxx............x...x.......4....xxxxxxxxxxx............xx.xx............xxxxxxxxxxx...4......xxxx+xxxx......6...xxxxxxxxxxx........xxx.......xxx........xxxxxxxxxxxxx...xxxx..2.....2..xxxx...xxxxxxxxxxxxxxxx+xxxx.............xxxx+xxxxxxxxxxxxxxxx...xxx.............xxx...xxxxxxxxxxxxx......x...............x......xxxxxxxxxxx..4...x...2...I...2...x...5..xxxxxxxxxxx......x...............x......xxxxxxxxxxx...4..xx.............xx..5...xxxxxxxxxxx$......x....2...2....x......$xxxxxxxxxxx$6..5..xx.....3.....xx.5...7$xxxxxxxxxxx$$$.....xxx.......xxx.....$$$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: orc warlord, orc priest, orc high priest, orc warrior, orc wizardMONS: orc knight, orc sorcerer############################################################################## Matthew Ludivico (my_map)NAME: my_mapORIENT: southwest# The hell hounds can be deadly at lower levels.DEPTH: 18-27MAPxxxxxxxxxx.@.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxx.^^..........................xxxxxxxxxxxx.^^xx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.^...11....xxxxxxxx..xxxxxxxxxxxxxxxxxxxx..x.1..6..xxx........xx..xxxxxxxxxxxxxxxx.xxxxxxxxx...vvvvv...x...xxxxxxxxxxx6..1...x.........+1..v.......xxxxxxxxxxx..1....x.........vvvvv........xxxxxxxxxx..5...xx......................xxxxxxxxxxxxxxx^++...........vvvvvvv....xxxxxxxxxxxxxxx^xx...xx=xx...vv$%$vvvvv.xxxxxxxxxxxxxxx^x...xxv1vxx...vvv*2...v.xxxxxxxxxxxxxxx^x..vvvv7.vvvv...vv.vv+v^xxxxxxxxxx..xxx^..vvvb....bvvv...vvv^...xxxxxxxxxx%%.xx..vvvvb....bvvvv.......xxxxxxxxxxxxx.....vvbbb......bbbvv.....xxxxxxxxxxxxxxx....vvb....66....bvvxxxxxxxxxxxxxxxxxxxxxxxvvvb..llllll..bvvvxxxxxxxxxxxxxxxxxvvvvvvvvb..ll45ll..bvvvvvvvvxxxxxxxxxxxxccc***+== .l3.2.l..cccccccccxxxxxxxxxxxxccc+cccbb....ll....c..$$$$+$*cxxxxxxxxxxcc|||cbb...3llll2...cc%*%*c$|cxxxxxxxxxxcccccccbbbbbbbbbbbccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: hell hound, necromancer, wizard, orange demon, rotting devilMONS: hell knight, great orb of eyes############################################################################ Farm and country (Matthew Ludivico)NAME: farm_and_countryORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................................xxxxxxxx}.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............xxxxxx....xxx.......xx...........xxxx..]xxxxxxxxxxxxxxxxxxxxxxxx***x...........xxx..xxx............xxxx...........xx..xxxxxxxxxxxxxxxxxxxxxxxxxx|*$=...xx.xxxxxxx....xxxxxxxxxx......xx................xxxxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxx......3..xxx.................x..........xxxxxxxxxxxxxxxxxxxxxxxxxxx......x........x......xx.........w...................xxxxxxxxxxxxxxxxxxxx)......xx...xxx.....xxx......x........www3....3.............xxxxxxxxxxxxxxxxxxxxx=xxxxxxxxxxx...xxxxxxxxx..xxx.....wwwww....%%%.............xxxxxxxxxxxxxxxxxxx......xxx.......xx.xxxx.x...xxxxxxxwwwwwww..5%%%..........xx.xxxxxxxxxxxxxxxxxx.........x..xxxxxxxx.....x........3wwwwwwwww..%%%........xxx..xxxxxxxxxxxxxxxxxx....5...xx..x.xxxxx.....xxx........wwwwwwwww..%%%..........xx.xxxxxxxxxxxxxxxxxxxx.....xxx..xx..xx........xxxxxxxxxwwwwwwwww..............xxx.xxxxxxxxxxxxxxxxxxx........x..x...............xx..xxxxwwwwwwwwwwwwww............xxxxxxxxxxxxxxxxxx.............................x.....xxwwwwww3wwwwww............xxxxxxxxxxxxxxxxxxxx...x...........5.....7...............ww.......ww.....44....xxxxxxxxxxxxxxxxxxxwxx..xx.....622...2.26...6.2...22.6...62..2..226ww.....44xx...xxxxxxxxxxxxxxxxxxwwxxxx......2....2.22....2..2...2.2.......22...2ww....xxxx..xxxxxxxxxxxxxxxxxxxxwwwwxxx......2...2.2.2...2.22..2.22...22.2.2..22ww.....xxx....xxxxxxxxxxxxxxxxxxwwwwwx....4..2...2...........22...277..2..2.2.22ww...........xxxxxxxxxxxxxxxxxxxwwwwwxx....42..2....22.4..2..2...2.4..2.22..22.2ww............xxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.wwwwwwwwwwwww..2.........xxxxxxxxxxxxxxxxxxwwwwwxx.....62....2.26...62.2.2..26...6...22..26..............xxxxxxxxxxxxxxxxxxwwwww.........................................................xxxxxxxxxxxxxxxxxxwwwwwxx....222.2.22..2.7.......7..............................xxxxxxxxxxxxxxxxxxwwwww...........ccccccc+ccccccc...ccc......cc+ccc...xxxxx.....xxxxxxxxxxxxxxxxxxwwwwwxx.........c$$*.c$$5$+.5.c...+5c......c%%%%c......xxx3...xxxxxxxxxxxxxxxxxxwwwwwx....2.....c$.c+cccccc.%.c...ccc......c%%%%c....xxxxx....xxxxxxxxxxxxxxxxxxwwwwwx..........c..c..........c............cccccc......xxx....xxxxxxxxxxxxxxxxxxwwxxxxxxx.......ccccc+ccccccccc.........................xx....xxxxxxxxxxxxxxxxxxwxx.....xxxx........c...c.................2...................xxxxxxxxxxxxxxxxxxxx.........xxxx...........2....xxxx...........................xxxxxxxxxxxxxxxxxx..............xxxx..........xxxx..x...........................xxxxxxxxxxxxxxxxxx.................xxxxx++xxxxx.....xx............xx...x........xxxxxxxxxxxxxxxxxx.....................c..c..........xxxxx..........xxxxx.......xxxxxxxxxxxxxxxxxx.......cccc..........c..c...cccc......xxx...........x.........xxxxxxxxxxxxxxxxxx.......c..c..........c++c...c..c........xxx.........x.........xxxxxxxxxxxxxxxxxx.......c..c..........c..c...c..c..........xxx.................xxxxxxxxxxxxxxxxxx....cccc++cccccccccccc++ccccc..ccccccc......xxx...............xxxxxxxxxxxxxxxxxx....c..........1.....................c........xxx.............xxxxxxxxxxxxxxxxxx.cccc.....w....w....%1.....w.....%...c..........xxx...........xxxxxxxxxxxxxxxxxx.c1.+....www..www..%%%....www...%%%1.c...........xxxxxxxxx....xxxxxxxxxxxxxxxxxx.cccc.....w....w....%......w.....%...c..................xxx...xxxxxxxxxxxxxxxxxx....c.......5........................c....................xxxxxxxxxxxxxxxxxxxxxx....ccc....%%%%%....cccccccccccccccccc........................xxxxxxxxxxxxxxxxxx......cc...........cc.........................................xxxxxxxxxxxxxxxxxx.......cccccc+cccccc..........................................xxxxxxxxxxxxxxxxxx........cc.......cc...........................................xxxxxxxxxxxxxxxxxx.........cc.....cc.....................cccccccccccccccccccccccxxxxxxxxxxxxxxxxxx..........ccc+ccc......................c......vvv.............xxxxxxxxxxxxxxxxxx..........ccc.c........................c......v5+...vvvvv.....xxxxxxxxxxxxxxxxxx..........ccc.c........................c......vvv...v.5.v.....xxxxxxxxxxxxxxxxxxccccccccccccc.ccc......................c............v..5v.....xxxxxxxxxxxxxxxxxx..........c.....cccccccccccccccccccccccccccc..........vv+vv...xxxxxxxxxxxxxxxxxx..........c............................+................5111..xxxxxxxxxxxxxxxxxx..........c.{([.c......................+................5.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: death yak, plant, griffon, killer bee, ogre, oklob plantMONS: wandering mushroom############################################################################## Fort Yaktaur (Matthew Ludivico)NAME: fort_yaktaurORIENT: southeastMAP.........@....wwwwwwwwwwwwwwwwwxxxxxxxxx.ccccc.......ww....wwww....wwwwxxxxxxxxx.c$c%c......ww.ccccccccc.......xxxxxxxxx.c+c+c......ww.c.%$....ccccccccxxxxxxxxx.c...+......ww.c*.115..c$$+|*|cxxxxxxxxx.c1..c.....ww..c...55+ccc+cxx=cxxxxxxxxx.ccccc.....ww..ccccccc....c|=*cxxxxxxxxx............ww.......c5...cxx=cxxxxxxxxx....6.ccccc.ww.w...2.+51..c|1.cxxxxxxxxx....63+...c..wwww..21+51..c2.2cxxxxxxxxx....6.ccccc..wwwwww..c5...cc+ccxxxxxxxxx............wwwwwww..c........cxxxxxxxxx............wwwwwww..ccccccccccxxxxxxxxx...........ww1w..www...........xxxxxxxxx.......566.www.....www.........xxxxxxxxx.........1ww....ccccc..........xxxxxxxxx.....566.w......+...c..........xxxxxxxxx.........www....ccccc..........xxxxxxxxx...........ww............wwwwwwxxxxxxxxx.......3....wwwww......www.....xxxxxxxxx......666.......ww...www.......xxxxxxxxx.....cc+cc.......wwwww.........xxxxxxxxx.....c...c.....................xxxxxxxxx.....ccccc.....................xxxxxxxxx...............................xxxxxxxxx...............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: yaktaur, death yak, minotaur, randomMONS: yak, gnoll, random######################################################################### box level (John Savard)#NAME: box_levelORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................xx.............x...................^.........xxxxxxxxxxxxxxxxxx.................xx...xxxxxx....x.xxxxxxx.xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.................xx...xx.0......x.x........x......x.........x.xxxxxxxxxxxxxxxxxx..$..............xx...xx........x.x........x.....%x.x..*..xxx.xxxxxxxxxxxxxxxxxx......................xx........x.x........x.xxxxxx.x.....x...xxxxxxxxxxxxxxxxxx......................xx....%...x.x........x.x......xxxxxxx.x.xxxxxxxxxxxxxxxxxx.................xx...xx........x.x........x.x.xxxxxx.......x.xxxxxxxxxxxxxxxxxx.................xx...xx........x.x..{.....x.x..............x.xxxxxxxxxxxxxxxxxx.............0...xx...xxxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.................xx...........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxx}x.........................>=........xxxxxxxxxxxxxxxxxx..................x...xxx.x.xxx+xxxxxxxxxxxxxxxx+xxxxx........xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxx..x...xxx.x.x0...x..0..............0.x........xxxxxxxxxxxxxxxxxx..x............x..x...xxx.x.x....x...................x........xxxxxxxxxxxxxxxxxx....xxxxxxxxx..x..x...xxx.x.x....x...................x......8*xxxxxxxxxxxxxxxxxx..x.x....0..x..x..x...xxx...x...%x...................x......*|xxxxxxxxxxxxxxxxxx..x.x..........x..x...xxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..x.x*......x..x..x..........x...........0...x...%............xxxxxxxxxxxxxxxxxx..x.xxxxxxxxx..x..=..........x.xxxxxxxxxxxxx.x................xxxxxxxxxxxxxxxxxx..x......0.....xxxxxxx.......x.x...x...x...x.x................xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxx..0....x...x.x.x.x.x.x.x......0.........xxxxxxxxxxxxxxxxxx..........^.........xx.......x.x.x.x.x.x.x...+................xxxxxxxxxxxxxxxxxxcccccccccccccccccc..xx.......x.x$x...x...xxxxx................xxxxxxxxxxxxxxxxxxc...........9....c..xx.......x.x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc......c............xx.......x.x.x...x..0.....................xxxxxxxxxxxxxxxxxxc.....|c............xx.......x.x.x.x.x........................xxxxxxxxxxxxxxxxxxc...........9....c..xx.......x.x...x.x........................xxxxxxxxxxxxxxxxxxcccccccccccccccccc..xx.......x.xxxxx.x........................xxxxxxxxxxxxxxxxxx....................xx.......x.x.....=....................*...xxxxxxxxxxxxxxxxxx....................xx.......x.x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......x.x.x...........................(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx.x$x..xxxx.xxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx...............................x.x..x.......................x.xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.x..x.xxxxxxxxxxxxx.........x.xxxxxxxxxxxxxxxxxx.............)xxx................x..x.xxxxxxxxxxxxx.........x.xxxxxxxxxxxxxxxxxx..............xxx.xxxxxxxxxxxxxxxx..x.xxxxxxxxxxxxx.........x.xxxxxxxxxxxxxxxxxx..............xxx...................x.x...........xxxxx+xxxxx.xxxxxxxxxxxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x..$........x.........x.xxxxxxxxxxxxxxxxxx......9.......xxxxxxxxxxxxxxxxxxxxxxx.x...........x........%x.xxxxxxxxxxxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x.0.........x0........x.xxxxxxxxxxxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x.......$...x.........x.xxxxxxxxxxxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.x...........xxxxxxxxxxx.xxxxxxxxxxxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxx.x...........xxxxxxxxxxxxxxxxxx..............xxxxxxxxxxxxxxxxxxxxxxx.............x...........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.xxxxxxx=xxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxx.....xx.................xxxxxxxxxxx.......x........x.....x....xxxxxxxxxxxxxxxxxx....0xx.................xxxxxxxxxxx.%.....x.0......x...0.x....xxxxxxxxxxxxxxxxxx.....xx.9...............xxxxxxxxxxx.......x........x.%...x..$.xxxxxxxxxxxxxxxxxx.....xx.................xxxxxxxxxxx.......x........x.....x....xxxxxxxxxxxxxxxxxx.....xx.................xxxxxxxxxxx.......x........x.....x..0.xxxxxxxxxxxxxxxxxx....0xx.................xxxxxxxxxxx.......x$.......x.....x....xxxxxxxxxxxxxxxxxx]....xx................*xxxxxxxxxxx......[x........x.....x$...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAP############################################################################### Minivaults################################################################################ NOTE: *Cannot* place 8,9 or 0 monsters in branch vaults which neither use the# normal mons_level function or are around level 35, or generation will crash.## [dshaligram] Minivaults were traditionally drawn after rotating the vault by# 90 degrees anticlockwise. Under the new dungeon vault handling, the map may# be freely rotated and mirrored to any position (20061105).## Minivaults are traditionally 12x12 (hardcoded limitation in dungeon.cc). Under# the new rules they can be any size, but the smaller the better. I'd recommend# no larger than 35x30 or so.## NOTE: Minivaults must NOT have an ORIENT: attribute. Including an ORIENT:# attribute makes the map a normal vault, and mayhem can result.NAME: minivault_1MAP..............xxxx=xxx...xx..x...xx..x....x...x..x...x....x..xx.x*x.x.=..=.x.x*x.xx..x....x...x..x...x....x..xx...x..xx...xxx=xxxx..............ENDMAP###################################NAME: minivault_2MAP..............xxxx.xxxx...xx.....xx...x.......x...x.......x.......C.......x.......x...x.......x...xx.....xx...xxxx.xxxx.........................ENDMAP###################################NAME: minitemple# More common than the others.CHANCE: 20MAP.............cccccccccc..cccccccccc..cBcBcBcBcc..G.c.c.c.Bc..........Bc..........Bc..G.c.c.c.Bc..cBcBcBcBcc..cccccccccc..cccccccccc.............ENDMAP###################################NAME: minivault_4MAP................xwxx......xxxwwxwx....xwwwwwwx...xwwxwwxwxx..xwwwwwwwwx..xwwxwwwxww..xxwwwwwwxx...wwwwxwwx....xxxwwxxw......xxww................ENDMAP###################################NAME: minivault_5MAP.............x.xxxxxxxx..x.x......x..x.x.xxxx.x..x.x.x**x.x..x.x.x**x.x..x.x.xx.x.x..x.x....x.x..x.xxxxxx.x..x........x..xxxxxxxxxx.............ENDMAP#################################### Wizard's laboratoryNAME: minivault_6MAP.............ccccccc+cc..c........c..c........c..c..1.....c..c........c..cc+ccccccc..c***c3232c..c|**+2223c..c||*c3322c..cccccccccc.............ENDMAPMONS: wizard, small abomination, large abomination#################################### Beehive minivaultNAME: minivault_7MAP................aaaa......a2a2aaaa....aaRa3a2a...aa2aRa2aaa..a3aRa1aRa2..aa3aRaRa2a..aaa2a2a3aa...a3aRa2aa.....aa2aa2a......aaaa................ENDMAPMONS: queen bee, killer bee, killer bee larva#################################### Lava pondNAME: minivault_8MAPx.x.x.x.x.x..c.c.c.c.c.xx...l1l...c..c.llllll..xx.lllllll1c..c.llFGll..xx..llGFll.c..c1lllllll.xx..llllll.c..c...l1l...xx.c.c.c.c.c..x.x.x.x.x.xENDMAPMONS: molten gargoyle#################################### Evil zooNAME: minivault_9DEPTH: 15-27MAP.............==========..==========..==========..===8888===..===8998===..===8998===..===8888===..==========..==========..==========.............ENDMAP###################################NAME: minivault_10MAP.............xxxx..xxxx..x**x..x**x..x**+..+**x..xx+x..x+xx..........................xx+x..x+xx..x**+..+**x..x**x..x**x..xxxx..xxxx.............ENDMAP#################################### Multicoloured onionNAME: minivault_11MAP.............+xxxxxxxx+..x........x..x.+cccc+.x..x.c....c.x..x.c.bb.c.x..x.c.bb.c.x..x.c....c.x..x.+cccc+.x..x........x..+xxxxxxxx+.............ENDMAP#################################### Closed-box minivaultNAME: minivault_12MAP.............xxxxxxxxxx..x>9$9$9$<x..x.$9$9$.$x..x$.****$.x..x.$*||*.$x..x$.*||*$.x..x.$****.$x..x$9$9$9$.x..x<$9$9$9>x..xxxxxxxxxx.............ENDMAP#################################### Little trap spiralNAME: minivault_13MAP.............xxxxxxxxxx..=.^x..=.9x..x.$=.^x..x..xxxxxxxx=x..x.8+|0x8.x..x8$x.|x..x..xx=xxxx=xx..x.9=^.x..x..x..x.^=9.x..xxxxxxxxxx.............ENDMAP#################################### Water crossNAME: minivault_14MAP.............wwwww.wwww..wwwww.wwww..wwwww.wwww..wwwww.wwww........wwww..wwww........wwww.wwwww..wwww.wwwww..wwww.wwwww..wwww.wwwww.............ENDMAP#################################### Lava pondNAME: minivault_15MAP............................lll........vvlvv......lv|*|vl.....ll*S*ll.....lv|*|vl......vvlvv........lll.........................................ENDMAP###################################NAME: minivault_16MAP..............................................................................S.................................................................ENDMAP###################################NAME: minivault_17MAP.................................................................F..............................................................................ENDMAP###################################NAME: minivault_18MAP.................................................................H..............................................................................ENDMAP###################################NAME: minivault_19MAP.............xx......xx..xxx....xxx...xxx..xxx.....xxxxxx.......xxxx........xxxx.......xxxxxx.....xxx..xxx...xxx....xxx..xx......xx.............ENDMAP###################################NAME: minivault_20MAP.............xxxx..xxxx..x........x..x..xxxx..x..x.x....x.x....x.x9.x......x.9x.x....x.x....x.x..x..xxxx..x..x........x..xxxx..xxxx.............ENDMAP###################################NAME: minivault_21MAP.............^xxxxxxxx^..x........x..x.cccccc.x..x.c|..<c.x..x.c.**.c.x..x.c.**.c.x..x.c>..|c.x..x.cccccc.x..x........x..^xxxxxxxx^.............ENDMAP###################################NAME: minivault_22MAP.................xx........xxxxxx.....x^x..x^x....xx.xx.xx...xx.x$$x.xx..xx.x$$x.xx...xx.xx.xx....x^x..x^x.....xxxxxx........xx.................ENDMAP###################################NAME: minivault_23MAPx.x.x.x.x.x..x.x.x.x.x.xx.x.x.x.x.x..x.x.x.x.x.xx.x.x.x.x.x..x.x.x.x.x.xx.x.x.x.x.x..x.x.x.x.x.xx.x.x.x.x.x..x.x.x.x.x.xx.x.x.x.x.x..x.x.x.x.x.xENDMAP###################################NAME: minivault_24MAP................xxxx........xxxx........xxxx.....xxxx.x.xxx..xxx.x.xxxx..xxxx.x.xxx..xxx.x.xxxx.....xxxx........xxxx........xxxx................ENDMAP###################################NAME: minivault_25MAP.............xx+xxxxxxx..x........x..x........+..x........x..x........x..x........x..x........x..+........x..x........x..xxxxxxx+xx.............ENDMAP###################################NAME: minivault_26MAPc..........c.c...cc...c...c..cc..c.....c....c.......c..c.....cc..cc..cc..cc..cc..cc.....c..c.......c....c.....c..cc..c...c...cc...c.c..........cENDMAP###################################NAME: minivault_27MAP.............x.xxxxxxxx..x........x..xxxxxxxx.x..x........x..x.xxxxxxxx..x........x..xxxxxxxx.x..x........x..x.xxxxxxxx.........................ENDMAP###################################NAME: minivault_28MAP.............xxxx.xxxx...x.......x...x..999..x...x.9...9.x.....9.I.9.....x.9...9.x...x..999..x...x.......x...xxxx.xxxx..........................ENDMAP#################################### AnthillNAME: minivault_29MAP.3......3......x.xx.x.2..xxx2xxxxx...xxxx42xxx2..2xx243432x3.xx421424xx.3xx423242x...x2x3243xxx..x2xx42422x...xxxxxxxx2....x2xxxx3...3.......33.ENDMAPMONS: queen ant, soldier ant, giant ant, ant larva#################################### Solitary fountainNAME: minivault_30MAP.................................................................?..............................................................................ENDMAPSYMBOL: TUV#################################### jmf: Multi-god temple thingNAME: multi_god_templeMAP.............=xxxxxxxx=..x9......9x..xT......Tx..x..C..C..x..xT......Tx..xxxxxxxxxx..xxx$$$$xxx..xx8....8xx...xx....xx.....xG..Gx...............ENDMAP#################################### jmf: Another multi-god temple thingNAME: multi_god_temple2MAP..............vvvvvvvv...vv......vv..v..x..x..v..v.Cx..xC.v..v..x..x..v..vT8x..x8Tv..vvvx==xvvv....Gx99xG......+*99*+......GxxxxG...............ENDMAP############################################################################## Pandemonium lesser demon vaults############################################################################## Pandemonium demon vaults are selected by tag. They must have the tag "pan",# or they won't even be considered. Tags are case-sensitive.## Tagging these levels also ensures they won't be generated in the main# dungeon.NAME: rand_demon_1TAGS: panMONS: pandemonium demon, random, random, random, random, randomMAP.............xx.xx.x.xx...x.x..x.x....x.x..x.x....x.x..x.x....x.x..x.x....x.x1.x.x....x.x..x.x....x.x..x.x....x.x..x.x...xx.x.xx.xx.............ENDMAP###################################NAME: rand_demon_2TAGS: panMONS: pandemonium demon, greater demon, common demonMONS: common demon, random, randomMAP.............xxxxxxxx3x..3.....xx.x..xxxxxx4x.x..xx4x..xx.x..x.x.22.x.x..x.x.12.x.x..x.xx..x4xx..x.x4xxxxxx..x.xx.....3..x3xxxxxxxx.............ENDMAP###################################NAME: rand_demon_3TAGS: panMONS: pandemonium demon, common demon, common demonMAP.............x.x.x3x.x....x.x3x3x.x..x.x.x2x.x....x3x2x2x3x..x3x2x1x2x3...x3x2x2x3x..x.x.x2x3x....x.x3x3x.x..x.x.x3x.x....x.x.x.x.x.............ENDMAP###################################NAME: rand_demon_4TAGS: panMONS: pandemonium demon, any demon, any demonMAP.............xxxxxxxxx...x$=*=3=|x...xxxxxxx=x...x2=3=2x|x...x=xxxxx=x...x3=*x1=Px...x=x=xxxxx...x*x2=3=2=...xxxxxxxxx..........................ENDMAP###################################NAME: rand_demon_5TAGS: panMONS: pandemonium demon, any demon, any demonMAP...............xxxxxx.....xx....xx...xx......xx..x..3232..x..x..2|P3..x..x..3P|2..x..x..2123..x..xx......xx...xx....xx.....xxxxxx...............ENDMAP###################################NAME: rand_demon_6TAGS: panMONS: pandemonium demon, any demon, any demonMAP..............................2..................3....................2......1...............................2.......3..........................ENDMAP###################################NAME: rand_demon_7TAGS: panMONS: pandemonium demon, any demon, greater demonMAP.............xxx....xxx..x|xx=xxx|x..xx=....=xx...x.x==x.x....x.=12=.=....=.=23=.x....x.x==x.x...xx=....=xx..x|xxx=xx|x..xxx....xxx.............ENDMAP###################################NAME: rand_demon_8TAGS: panMONS: pandemonium demon, greater demon, any demonMAP................xxxxxxx...xxx....1x..xx..2....x..x........x..xx.......x...xx33..2.x.....33...xx......x...x....F..xx.xx........xxx...............ENDMAP###################################NAME: rand_demon_9TAGS: panMONS: pandemonium demon, any demon, greater demonMAP.............xxxxxxxxxx..x2=3=3=3xx..x=xxxxxx2x..x3x^^^^x=x..x=x^P^^x2x..x3x^^1^x=x..x=x^^^^x3x..x2xxxx=x=x..xx2=2=3x3x..xxxxxxxx=x.............ENDMAP
############################################################################### splev.des: special levels definitions.## If you want to define random vaults and minivaults, they should go# to vaults.des.## key:# x - DNGN_ROCK_WALL# X - DNGN_PERMAROCK_WALL -> should always be undiggable! -- bwr# c - DNGN_STONE_WALL# v - DNGN_METAL_WALL# b - DNGN_GREEN_CRYSTAL_WALL# a - DNGN_WAX_WALL# . - DNGN_FLOOR# + - DNGN_CLOSED_DOOR# = - DNGN_SECRET_DOOR# @ - entry point - must be on outside and on a particular side - see templates# w - water# l - lava# >< - extra stairs - you can leave level by these but will never be placed on# them from another level# }{ - stairs 82/86 - You must be able to reach these from each other# )( - stairs 83/87# ][ - stairs 84/88# I - orcish idol (does nothing)# ^ - random trap## A - Vestibule gateway (opened by Horn). Can also be put on other levels for# colour, where it won't do anything.# B - Altar. These are assigned specific types (eg of Zin etc) in dungeon.cc,# in order.# C - Random Altar.# F - Typically a Granite Statue, but may be Orange or Silver (1 in 100)# G - Granite statue (does nothing)# H - orange crystal statue (attacks mind)# S - Silver statue (summons demons). Avoid using (rare).# T - Water fountain# U - Magic fountain# V - Permanently dry fountain## Statues can't be walked over and are only destroyed by disintegration## $ - gold# % - normal item# * - higher level item (good)# | - acquirement-level item (almost guaranteed excellent)# O - place an appropriate rune here# P - maybe place a rune here (50%)# R - honeycomb (2/3) or royal jelly (1/3)# Z - the Orb of Zot## 0 - normal monster# 9 - +5 depth monster# 8 - (+2) * 2 depth monster (aargh!). Can get golden dragons and titans# this way.# 1-7 - monster array monster# used to allocate specific monsters for a vault.# is filled with RANDOM_MONSTER if monster not specified## note that a lot of the vaults are in there mainly to add some interest to the# scenery, and are not the lethal treasure-fests you find in Angband# (not that there's anything wrong with that)## Guidelines for creating new vault maps:## [ds] If your map is not a minivault, make sure the side(s) that form the# border have a rock wall padding at least 6 deep. For instance, if your map# is ORIENT: north, you must have a 6 deep border of rock wall (or any# other kind of wall) along the northern, eastern, and western edges of the# map. If you're doing a fullscreen map (encompass), you must pad all around# the map with 6 layers of wall.## Basically you can just let your creativity run wild. You do not have# to place all of the stairs unless the level is full screen, in which# case you must place all except the extra stairs (> and <). The <> stairs# can be put anywhere and in any quantities but do not have to be there. Any# of the other stairs which are not present in the vault will be randomly# placed outside it. Also generally try to avoid rooms with no exit.## You can use the templates below to build vaults. The entry point '@' must be# present (except full-screen vaults where it must not) and be on the same# side of the vault as it is on the template, but can be anywhere along that# side.## I think that's all. Have fun!## ps - remember to add one to the monster array value when placing monsters# on each map (it is 1-7, not 0-6) {dlb}## [dshaligram] All special levels MUST have an ORIENT: attribute; if there's# no ORIENT: attribute, the level is considered to be a minivault, which is# usually not what you want.## Special levels are selected either by PLACE: (for most special levels) or# TAGS: (for the Pandemonium demon lords). If you want to define alternate# levels, duplicate the selector and use different names. For instance, to# define an alternate Vestibule level, you could use something like this:## NAME: vestibule_of_hell_alternate# PLACE: Hell## To define an alternate level for Cerebov, you could do:## NAME: cerebov_alternate# TAGS: cerebov## You can also use CHANCE: to control the weight a level is assigned. For# instance, if you want to make cerebov_alternate five times more likely than# the standard cerebov level, you'd do:## NAME: cerebov_alternate# TAGS: cerebov# CHANCE: 50## (The default weight is 10 if CHANCE: is omitted.)###############################################################################NAME: vestibule_of_hellPLACE: HellORIENT: encompass# [dshaligram] If modifying the Vestibule, ensure that:## * The portal to Dis is surrounded by floor squares and nothing but floor# squares.# * The portal to Tartarus is surrounded only by floor, doors of any kind, and# at least one rock wall.# * The portal to Gehenna is surrounded by nothing but floor and at least one# lava square.# * The portal to Cocytus is surrounded by nothing but floor and at least one# water square.## If you don't do this, the portals will not be unbarred correctly when# Geryon's horn is sounded.MAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxvvvvvvvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..v.....v..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....v.....v.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........v.....v........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........v..A..v..........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............v.....v............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.............v.....v.............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............vvv+vvv..............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxxxxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxxxxxxxxxxxxxx.......................................................xxxxxxxxxxxxxxxxxxxxxxxxx.......................................................xxxxxxxxxxxxxxxxxxxxxxxx.........................................................xxxxxxxxxxxxxxxxxxxxxxx............................{............................xxxxxxxxxxxxxxxxxxxxxxx.........................................................xxxxxxxxxxxxxxxxxxxxxx...l.l.....................................................xxxxxxxxxxxxxxxxxxxxx..l.l.l.l..................................................xxxxxxxxxxxxxxxxxxxxx.l.l.l.l.l.................................................xxxxxxxxxxxxxxxxxxxx.l.l.l.l.l...................................................xxxxxxxxxxxxxxxxxxxl.l.l.l.l.l..................................................xxxxxxxxxxxxxxxxxxx.l.l.l.A.l.l.................}1].............................=Axxxxxxxxxxxxxxxxxl.l.l.l.l.l.l.................)..............................xxxxxxxxxxxxxxxxxxx.l.l.l.l.l.l.................................................xxxxxxxxxxxxxxxxxxxx.l.l.l.l.l.l...............................................xxxxxxxxxxxxxxxxxxxxx..l.l.l.l..................................................xxxxxxxxxxxxxxxxxxxxx.....l.l...................................................xxxxxxxxxxxxxxxxxxxxxx......................[...........(......................xxxxxxxxxxxxxxxxxxxxxxx.........................................................xxxxxxxxxxxxxxxxxxxxxxx.........................................................xxxxxxxxxxxxxxxxxxxxxxxx.......................................................xxxxxxxxxxxxxxxxxxxxxxxxx.......................................................xxxxxxxxxxxxxxxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxxxxxxxxxxxxxxx.....................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxx...................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....................wwwww........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..................wwwwwwww.....................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............wwwwwwwwwwwww..................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...........w..wwww..wwwww..w...............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........w...ww.....ww..wwwww...........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........ww......ww....wwwwwwwww.......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........ww....wwww...wwwwwwwwww.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........ww....ww....wwwwwwwwwww...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........wwww.......wwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......wwwwwww....wwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...wwwwwwwwwwAwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: GeryonMONS: random, random, random, random, random, random############################################################################## Dispater's castle - rest of level filled up with plan_4 (irregular city)#NAME: castle_disPLACE: Dis:7TAGS: disORIENT: northMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxxxxxxxxxxv..............................................................vxxxxxxxxxxxxxxxxv..vvvvvvvvv........................................vvvvvvvvv..vxxxxxxxxxxxxxxxxv..v3.....|v........................................v|.....2v..vxxxxxxxxxxxxxxxxv..v.vv+vvvv.v.v.v.v.v.v.v.v.v..v.v.v.v.v.v.v.v.v.v.vvvv+vv.v..vxxxxxxxxxxxxxxxxv..v.v.....vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.....v.v..vxxxxxxxxxxxxxxxxv..v|v.....+$$v$$+$$v||vvvvvvvvvvvvvvvvv$$$$v4.4.v$$v.....v|v..vxxxxxxxxxxxxxxxxv..vvvv+vvvv$$+$$v$$+||v...............v$$$$+.4.4+$$v+vv+vvvv..vxxxxxxxxxxxxxxxxv....vv.vvvvvvvvvvvvvvvv.v..v..v..v..v.v$$$$v4.4.v$$+||v.vv5...vxxxxxxxxxxxxxxxxv...vvv................v...............vvvvvvvvvvvvvvvvv.vvv...vxxxxxxxxxxxxxxxxv...5vv................+...............+.................vv....vxxxxxxxxxxxxxxxxv...vvv+vvvvvvvvvvvvvvvv.v..v..v..v..v.vvvvvvvvvvvvvvvvv.vvv...vxxxxxxxxxxxxxxxxv....vv..v.+$$$$$v.....v...............vvvvvvvvvvvvvvvvv.vv5...vxxxxxxxxxxxxxxxxv...vvv..v.v$$$$$v.....v...............vv|$|$|vv|$|$|$vv.vvv...vxxxxxxxxxxxxxxxxv...5vv..v.vvvvvvv.....vvvvv.......vvvvvv$|$|$++$|$|$|vv.vv....vxxxxxxxxxxxxxxxxv...vvv..v...............v.vvvv+vvvvvvvvvvvvvvvvvvvvv+vv.vvv...vxxxxxxxxxxxxxxxxv....vvv+v..........vvvvv.4vvv...vvvvvvvvvvvvvvvvvvvv+vv.vv5...vxxxxxxxxxxxxxxxxv...vvv..v.v..v..v....2vvv+vv5...5vvvvvvv.4.4.vv.4.4.4vv.vvv...vxxxxxxxxxxxxxxxxv...5vv.................vv|vvv...vvvvv.++4.4.4++4.4.4.vv.vv....vxxxxxxxxxxxxxxxxv...vvv.................1vOvv5...5vvvv.vvvvvvvvvvvvvvvvv.vvv...vxxxxxxxxxxxxxxxxv....vv.................vv|vvv...vvvvv.vvvvvvvvvvvvvvvvv.vv5...vxxxxxxxxxxxxxxxxv...vvv.v..v..v..v....3vvv+vv5...5vvvv...................vvv...vxxxxxxxxxxxxxxxxv...5vv.............vvvvv.4vvv...vvvvvvvvvvvvvvvvvvvvvvv.vv....vxxxxxxxxxxxxxxxxv..vvvv+vvvv.............v.vv5...5vvvvvvvvvvvvvvvvvvvvvv+vvvv..vxxxxxxxxxxxxxxxxv..v|v.....vvvvvvvvvvvvvvvvvvv...vvvvvvvvvvvvvvvvvvvv.....v|v..vxxxxxxxxxxxxxxxxv..v.v.....vvvvvvvvvvvvvvvvvvvv+vvvvvvvvvvvvvvvvvvvvv.....v.v..vxxxxxxxxxxxxxxxxv..v.vv+vvvv5.............5.........5..............5vvvv+vv.v..vxxxxxxxxxxxxxxxxv..v2.....|v........................................v|.....3v..vxxxxxxxxxxxxxxxxv..vvvvvvvvv........................................vvvvvvvvv..vxxxxxxxxxxxxxxxxv............................{.[.(.............................vxxxxxxxxENDMAPMONS: Dispater, Fiend, Ice Fiend, iron devil, metal gargoyleMONS: random, random############################################################################## Asmodeus#NAME: asmodeusPLACE: Geh:7ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxx....xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxx................................xxxxxx....xxxxxxxxxxxxxxxxxxxxxxx.x.xxxxx.........................................xxx....xxxxxxxxxxxxxxxxxxxxxxxx....xx.....................4......................xx...xxxxxxxxxxxxxxxxxxxxxxxx......x......................llllllllllllll.........x..xxxxxxxxxxxxxxxxxxxxxxxxx..xx..................lllllllllllllllllllllllll........xxxxxxxxxxxxxxxxxxxxxxxx...xxx....0..........llllllllllllllllllllllllll........xx...xxxxxxxxxxxxxxxxxxx....xxx.............llllllllllllllllllllllllllll..............xxxxxxxxxxxxxxxxxxx....xx...........lllllllllllllllllllllllllllll...............xxxxxxxxxxxxxxxxxxxxx..............llllllllllllllllllllllllllllll...2..xx...0...xxxxxxxxxxxxxxxxxxxxxx...........lllllllllllllllllll.......llllll......xx......xxxxxxxxxxxxxxxxxxxxxxxx.......llllllllllllllllll............llllll.............xxxxxxxxxxxxxxxxxxxxxxxxx......lllllllll..........4.........4.lllllll..........xxxxxxxxxxxxxxxxxxxxx...xx...ll3lllll......4...................llllllll......x.xxxxxxxxxxxxxxxxxxxxx.......lllll.l................................llll.......xxxxxxxxxxxxxxxxxxxxxxxx..4..llllll...cccccccc+c+c+c+c+c+c+c+c+c+c....lll......xxxxxxxxxxxxxxxxxxxxxxxxxx..lllllll..4.c.....c....................c....llll.....xxxxxxxxxxxxxxxxxxxxxxxxx...llllll.....c.V.V.+....0.....3.....0...c.....llll....x..xxxxxxxxxxxxxxxxxxxxx...llllll...l..c.....c....................c....lllll........xxxxxxxxxxxxxxxxxxxxx...lllll..ll..c..5..cccccccccccccccccccccc.4..llllll........xxxxxxxxxxxxxxxxxxx...lllll..llll.c.....c...............c....c....lllllll.......xxxxxxxxxxxxxxxxxxx...lllll..llll.c.V.V.c.......0.......c....c....lllllll.......xxxxxxxxxxxxxxxxxxxx...lllll..lll.c.....+...............+....c...lllllll........xxxxxxxxxxxxxxxxxxxxx..lllll...ll.cccccccccc....0.......c....c...llllllll........xxxxxxxxxxxxxxxxxxx...lllll..4...c|$$||$$|c............c.0..c...llllllll........xxxxxxxxxxxxxxxxxx...lllll.......c$$$$$$$$cccccccccccccc....c...lllllll.........xxxxxxxxxxxxxxxxxx...lllll.......c$$|2|$$|c..0.........+....c...lllllll........xxxxxxxxxxxxxxxxxxxx.lllllll......c|$$$$$$$c........9...c....c....llllllll.....xxxxxxxxxxxxxxxxxxxxx.lllllll......c$|$|$$|$c+ccccccccccccccccc....lllllll......xxxxxxxxxxxxxxxxxxxxx..llllll......cccccccc+c.....9.......c.........llllll......x.xxxxxxxxxxxxxxxxxxx..lllllll.....c$$$$$$+3c.....8...3...c.....4...llllll........xxxxxxxxxxxxxxxxxxx..llllllll....c$$$$$$c.c.....9.......c..ll....llllll.........xxxxxxxxxxxxxxxxxxx...llllll..4..c$$2$$$c.ccccccccccccc+c.lll...lllllll...0....xxxxxxxxxxxxxxxxxxxxx..llllll.....c$$$$$$c..+............c.ll...lllllll..........xxxxxxxxxxxxxxxxxxxx..llllllll...ccccccccc+cccccccccccccc.....lllllll...........xxxxxxxxxxxxxxxxxxxxx..llllllll.........cc..........cc........lllllll.......x..xxxxxxxxxxxxxxxxxxxxxxx.llllllllll.......ccc.........cc......lllllllll.......xxxxxxxxxxxxxxxxxxxxxxx....lllllllllll...4...cc.....2.2.cc....llllllllll.4.......xxxxxxxxxxxxxxxxxxxxx....4.lllllllllllll....cccccccc+cccc..lllllllllll.....xx....xxxxxxxxxxxxxxxxxxxxx.....llllllllllllll...cccccccc+cccc..llllllllll......xx....xxxxxxxxxxxxxxxxxxxxxx.....lllllllllllllll..cc......cc...lllllllllll...........xxxxxxxxxxxxxxxxxxxxxxx.....llllllllllllll...ccO1....cc.4..lllllllll...........xxxxxxxxxxxxxxxxxxxxxxxxx.....lllllllllllll...cc......cc....lllllllll.......xx.xxxxxxxxxxxxxxxxxxxxxxxxxx.......llllllllllll..cccccccccc...lllllllll........xxxxxxxxxxxxxxxxxxxxxxxxxx.........llllllllllllll.cccccccccc.lllllllllll.......xxxxxxxxxxxxxxxxxxxxxxxxxxxx....0...llllllllllllll............lllllllll....0....xxxxxxxxxxxxxxxxxxxxxxxxxxxx.......4.lllllllllllllll..4....lllllllll...........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........llllllllllllll....lllllll....4.....x........xxxxxxxxxxxxxxxxxxxxxxxxxx...xx.........lllllllllllllllll...................xx{xxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xx................lllllll.....................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxx.................xxxxxx......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxx...xxx......xxxxxxxxxx.......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(xxxxxxxxxxxx[xxxxx...xxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: Asmodeus, Fiend, Balrug, molten gargoyleMONS: Serpent of Hell, random, random############################################################################# Antaeus; bottom of Cocytus. This needs work.#NAME: antaeusPLACE: Coc:7ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cccccccccccc..cccccccccccc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....ccccccccccccc2.ccccccccccccc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc..........................cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc............................cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwwwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwwwwwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwwwwwwwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww.......3..........3.......ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww............................ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww....cccccccccccccccccccccc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww....cccccccccccccccccccccccc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww....cc......................cc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxx....cc...ww....cc...T................T...cc....ww...cc....xxxxxxxxxxxxxxxxxxxxx....cc...ww....cc..........wwwwww..........cc....ww...cc....xxxxxxxxxxxxxxxxxxx....cc...ww....cc.......wwwwwwwwwwwwww.......cc....ww...cc....xxxxxxxxxxxxxxxxxx....cc...ww...cc.....wwwwwwwwwwwwwwwwwwww.....cc...ww...cc....xxxxxxxxxxxxxxxxxx....cc..www..cc....wwwwwwwwwccccccwwwwwwwww....cc..www..cc....xxxxxxxxxxxxxxxxxx....cc..www.cc....wwwwwwwwccc2O12cccwwwwwwww....cc.www..cc....xxxxxxxxxxxxxxxxxx....cc..www.cc...wwwwwwwwcc2+....+2ccwwwwwwww...cc.www..cc....xxxxxxxxxxxxxxxxxx....cc..www.cc...wwwwwwwwcc+cc++cc+ccwwwwwwww...cc.www..cc....xxxxxxxxxxxxxxxxxx....cc..www..c..wwwwwwwwwc|||c..c$$$cwwwwwwwww..c..www..cc....xxxxxxxxxxxxxxxxxx....cc..wwww.c.wwwwwwwwwwc|||c..c$$$cwwwwwwwwww.c.wwww..cc....xxxxxxxxxxxxxxxxxx....cc..wwww.c.wwwwwwwwwwcc||c..c$$ccwwwwwwwwww.c.wwww..cc....xxxxxxxxxxxxxxxxxx....cc..wwww.c.wwwwwwwwwwwcccc++ccccwwwwwwwwwww.c.wwww..cc....xxxxxxxxxxxxxxxxxx....cc..www..c..wwwwwwwwwwwwww..wwwwwwwwwwwwww..c..www..cc....xxxxxxxxxxxxxxxxxx....cc..www.cc...wwwwwwwwwwwwwwwwwwwwwwwwwwww...cc.www..cc....xxxxxxxxxxxxxxxxxx....cc..www.cc....wwwwwwwwwwwwwwwwwwwwwwwwwww...cc.www..cc....xxxxxxxxxxxxxxxxxx....cc..www.cc....wwwwwwwwwwwwwwwwwwwwwwwwww....cc.www..cc....xxxxxxxxxxxxxxxxxx....cc..www..cc....wwwwwwwwwwwwwwwwwwwwwwww....cc..www..cc....xxxxxxxxxxxxxxxxxx....cc...ww...cc.....wwwwwwwwwwwwwwwwwwww.....cc...ww...cc....xxxxxxxxxxxxxxxxxx....cc...ww....cc.......wwwwwwwwwwwwww.......cc....ww...cc....xxxxxxxxxxxxxxxxxxx....cc...ww....cc..........wwwwww..........cc....ww...cc....xxxxxxxxxxxxxxxxxxxxx....cc...ww....cc...T................T...cc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxx....cc...ww....cc......................cc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww....ccccccccccc..ccccccccccc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww....cccccccccc2.cccccccccc....ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww............................ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...ww..........................ww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwwww..wwwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwwww..wwwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc...wwwwwwwwwww..wwwwwwwwwww...cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc............................cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cc..........................cc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cccccccccccccccccccccccccccc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....cccccccccccccccccccccccccc....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........{.(.[...........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: Antaeus, Ice Fiend, ice dragonMONS: random, random, random, random############################################################################### Ereshkigal (Tartarus)#NAME: ereshkigalPLACE: Tar:7ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx.................cccc..........ccc............................xxxxxxxxxxxxxxxxxx.............ccccc..cccc.....ccc.cccc.........................xxxxxxxxxxxxxxxxxx...........ccc.........ccccccc.....cc.........................xxxxxxxxxxxxxxxxxx.........ccc.......2............V..cc.........................xxxxxxxxxxxxxxxxxx........cc4........................cc...........xxxxxxxx......xxxxxxxxxxxxxxxxxx........cc44xxx==xxx...............cc..........xx......xx.....xxxxxxxxxxxxxxxxxx........ccxxx......xxx.......ccc++ccc.........xx........xx....xxxxxxxxxxxxxxxxxx........cxx..........xxx.....ccc44ccc.........x..........x....xxxxxxxxxxxxxxxxxx........cx............xx....cccc44cc.........xx..........xx...xxxxxxxxxxxxxxxxxx.......ccx.G........G.xxx7ccc..c44c..........x.....|......x...xxxxxxxxxxxxxxxxxx.......cxx............xxxcc..................x......7.....x...xxxxxxxxxxxxxxxxxx......ccx..............xxc...................xx..........xx...xxxxxxxxxxxxxxxxxx......ccx..G........G..xxc..x.........x.......x..........x....xxxxxxxxxxxxxxxxxx......ccx..............xcc....................xx........xx....xxxxxxxxxxxxxxxxxx.......cxx............xxc......................xx......xx.....xxxxxxxxxxxxxxxxxx.......ccx.F........F.xcc.......................xxxxxxxx......xxxxxxxxxxxxxxxxxx........cx............xc......................................xxxxxxxxxxxxxxxxxx........cxx....17....xxc....x.........x.......................xxxxxxxxxxxxxxxxxx........ccxxx......xxxcc......................................xxxxxxxxxxxxxxxxxx........cccc=xxxxxx=cccc......................................xxxxxxxxxxxxxxxxxx........cc||cccccccc||cc......................................xxxxxxxxxxxxxxxxxx.........cc||||O|||||cc.......................................xxxxxxxxxxxxxxxxxx..........cccccccccccc......x.........x............V..........xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx...........................................xx$$$$xxx|||||xx...xxxxxxxxxxxxxxxxxx.......V........V...........x.........x....xx$$$$xxx|||||xx...xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx...........................................xx44444xx22222xx...xxxxxxxxxxxxxxxxxx.......xxxxxxxxx+xxxxxxxxx.................xx44444xx22222xx...xxxxxxxxxxxxxxxxxx.......x3.2..........3...x..x.........x..xxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx.......x.x.x.x.x.x.x.x.x.x.................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx.......x...2.3..4..5..4..x......................=.......xxx...xxxxxxxxxxxxxxxxxx.......xx.x.x.x.x.x.x.x.xx......................=.......xxx...xxxxxxxxxxxxxxxxxx.......x..65..3..6.6...5.x.................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx.......x.x.x.x.x.x.x.x.x.x..x.........x..xxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx.......x...4...3.....4...x.................xx.....xx555555x...xxxxxxxxxxxxxxxxxx.......xx=xxxxx.x.xxxxxxxx.................xx.....xx555555x...xxxxxxxxxxxxxxxxxx.......x$$$$$$x.25.x$$$||x.................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx.......x$x$$x$xx.x.x$x$x|x.................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx.......x||||||x.556=$$$||x..x.........x....xx$$xx56565xx$|x...xxxxxxxxxxxxxxxxxx.......xxxxxxxxxxxxxxxxxxx.................xx$$xx65656xx|7x...xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx...........................................xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx........(...........................................[.........xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................{...............................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: Ereshkigal, necrophage, wraith, shadow, small zombieMONS: small skeleton, Shadow Fiend############################################################################ mnoleg.## NOTE: The Pandemonium demonlord levels are requested by tag; if you change# the tag, also update dungeon.cc.## You can define alternate levels for a Pandemonium lord by using the same# TAGS: and a different NAME:#NAME: mnolegTAGS: mnolegORIENT: northeastMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................2............xxxxxxxxxx.....2........................xxxxxxxxxx..cccccccc...ccccccc..ccccccc.xxxxxxxxxx..ccccccccc.2.ccccccc..cccccc.xxxxxxxxxx..cccccccccc...ccccccc..ccccc.xxxxxxxxxx..ccccccccccc.1.ccccccc..cccc.xxxxxxxxxx2.cccccccccc.2..Occccccc2.ccc.xxxxxxxxxx..ccccccccc.....ccccccccc..cc.xxxxxxxxxx..cccccccc...c...ccccccccc..c.xxxxxxxxxx..ccccccc...ccc...ccccccccc...xxxxxxxxxx..cccccc...ccccc...ccccccccc..xxxxxxxxxx..ccccc...ccccccc...ccccccccc.xxxxxxxxxx..cccc...ccccccccc...ccccccc..xxxxxxxxxx..ccc.2.ccccccccccc.2.ccccc...xxxxxxxxxx..cc.....ccccccccccc...ccc....xxxxxxxxxx..c...c...ccccccccccc...c.2...xxxxxxxxxx.....ccc.2.ccccccccccc......c.xxxxxxxxxx....ccccc...ccccccccccc....cc.xxxxxxxxxx.2.ccccccc...ccccccccccc..ccc.xxxxxxxxxx.................2.......cccc.xxxxxxxxxx...c..ccccccc.ccccccc...ccccc.xxxxxxxxxx..ccc......2c.c2cccc...cccccc.xxxxxxxxxx.ccccc..ccc.c.c2ccc.2.ccccccc.xxxxxxxxxx.cccccc..cc.c.c.cc...cccccccc.xxxxxxxxxx.ccccccc..c.c.c.c...ccccccccc.xxxxxxxxxx.cccccccc...c.c....cccccccccc.xxxxxxxxxx.ccccccccc..c.c...ccccccccccc.xxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: Mnoleg, neqoxecMONS: random, random, random, random, random######################################################################## lom_lobon#NAME: lom_lobonTAGS: lom_lobonORIENT: northMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwww.......wwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwbbbwwwwwww.......wwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwbbbbbbbbbbbwwwwww.........wwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwbbbbwwwwwwwwwbbbbwwwwww.........wwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwbbbbbbbbwwwwwwwwwwwwwwwbbbwwwww...........wwwwwxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwbbbb......bbbwwwwwwwwwwww...bbwwwww.............wwwxxxxxxxxxxxxxxxxxxxxxxxxwwwbbb...........bbbwwwwww........bbwwwww.............wwxxxxxxxxxxxxxxxxxxxxxxxwwwbb...............bbwwww..........bwwwwww.............wwxxxxxxxxxxxxxxxxxxxxxxwwbb........1O.......bbww...........bbwwww..............wwxxxxxxxxxxxxxxxxxxxxxwwwb...................bw......2......bwww.....U....2.....wwxxxxxxxxxxxxxxxxxxxxwwbb...................bb.............bww.................wwxxxxxxxxxxxxxxxxxxxxwwbb..3................bbb............bbw..............4..wwxxxxxxxxxxxxxxxxxxxwwbbb...................b.b............4....................wwxxxxxxxxxxxxxxxxxxwwbwbb.................bb.......U......4..........U..........wxxxxxxxxxxxxxxxxxxwwbwwbb...............bb..b............bbw..............4.....xxxxxxxxxxxxxxxxxxwwbbwwbbb...........bbb..bb............bwww...................xxxxxxxxxxxxxxxxxxwwwbwwwwb..b..2..bbbb....b.............bwww...................xxxxxxxxxxxxxxxxxxxwwbwwww...bbbbbbb.......bw.....3.....bbwwww...U.....3.......xxxxxxxxxxxxxxxxxxxxwwbbww.................bbww........wwbwwwww.................xxxxxxxxxxxxxxxxxxxxwwwbbw................bbwwwww....wwwbbwwww..................xxxxxxxxxxxxxxxxxxxxwwwwbb...4...U........bwwwwwwwwwwwwbbwww....................xxxxxxxxxxxxxxxxxxxxxwwwwbbb...........bbbbbwwwwwwwwwbbbwww....................xxxxxxxxxxxxxxxxxxxxxxwwwwwwbbbb.....bbbbwwwbbbbwwwbbbbwwww....................xxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwbbbbbbbwwwwwwwwwbbbbbwwwww......4.....4........xxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww......................xxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwww.......................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwww........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwww......................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...@.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: Lom Lobon, giant orange brain, rakshasa, wizardMONS: random, random, random############################################################################## cerebovNAME: cerebovTAGS: cerebovORIENT: northeast# you might not want to teleport too much on this level - unless you can# reliably teleport away again.MAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...............................xxxxxxxxx.............vvvvv.............xxxxxxxxx.............v$$$v.............xxxxxxxxx.............v|||v.............xxxxxxxxx.............v$$$v.............xxxxxxxxx.vvvvv...vvvvvvvvvvvvv...vvvvv.xxxxxxxxx.v|$|vvvvv...........vvvvv$|$v.xxxxxxxxx.v$|$v.....vvvvvvvvv.....v|$|v.xxxxxxxxx.v|$|v.vvvvvvvvOvvvvvvvv.v$|$v.xxxxxxxxx.vvvvv.vvvvvv..3..vvvvvv.vvvvv.xxxxxxxxx...v...vv.....vvv.....vv...v...xxxxxxxxx...v.vvvv....vv1vv....vvvv.v...xxxxxxxxx...v.vv......v...v......vv.v...xxxxxxxxx...v.vvvv.............vvvv.v...xxxxxxxxx...v...vv..2.......2..vv...v...xxxxxxxxx.vvvvv.vv..2.......2..vv.vvvvv.xxxxxxxxx.v|$|v.vv.............vv.v$|$v.xxxxxxxxx.v|$|v.vv...vv...vv...vv.v$|$v.xxxxxxxxx.v|$|v.vv...vv+++vv...vv.v$|$v.xxxxxxxxx.vvvvv.vvvvvvv...vvvvvvv.vvvvv.xxxxxxxxx....v..vvvvvvv...vvvvvvv..v....xxxxxxxxx....vv...................vv....xxxxxxxxx.....vv.vvvvv..2..vvvvv.vv.....xxxxxxxxx......vvv|||v.....v$$$vvv......xxxxxxxxx........v|$|vv...vv$|$v........xxxxxxxxx........v|||v.....v$$$v........xxxxxxxxx........vvvvv.....vvvvv........xxxxxxxxx...............................xxxxxxxxx...............@...............xxxxxxxxxENDMAPMONS: Cerebov, Balrug, Pit FiendMONS: random, random, random, random############################################################################### Gloorx VloqNAME: gloorx_vloqTAGS: gloorx_vloqORIENT: southwestMAPxxxxxxxxxxxxxxxxxxxxxxx@.xxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxx..............................xxxxxxxxxx..............................xxxxxxxxxx.x.x.x.x.x.x.x..x.x.x.x.x.x.x.xxxxxxxxxx..............................xxxxxxxxxx.x.xxxx=xxxxxxxxxxxx=xxxxxx.x.xxxxxxxxxx...xx....................xx...xxxxxxxxxx.x.x..ccccc..4..4..ccccc..x.x.xxxxxxxxxx...x.cc.3............3.cc.x...xxxxxxxxxx.x.x.c..ccccc.cc.ccccc..c.x.x.xxxxxxxxxx...x.c.cc.....cc.....cc.c.x...xxxxxxxxxx.x.x.c.c.2...cccc...2.c.c.x.x.xxxxxxxxxx...x...c...ccc..ccc...c...=...xxxxxxxxxx.x.x.3.....2..1O..2.....3.x.x.xxxxxxxxxx...=...c...ccc..ccc...c...x...xxxxxxxxxx.x.x.c.c.2...cccc...2.c.c.x.x.xxxxxxxxxx...x.c.cc.....cc.....cc.c.x...xxxxxxxxxx.x.x.c..ccccc.cc.ccccc..c.x.x.xxxxxxxxxx...x.cc.3............3.cc.x...xxxxxxxxxx.x.x..ccccc..4..4..ccccc..=.x.xxxxxxxxxx...xx....................xx...xxxxxxxxxx.x.xxxx=xxxx=xxxxxxxx=xxxxx.x.xxxxxxxxxx..............................xxxxxxxxxx.x.x.x.x.x.x.x..x.x.x.x.x.x.x.xxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: Gloorx Vloq, Executioner, demonic crawler, shadow demonMONS: random, random, random############################################################################# Hive:4 beehiveNAME: beehivePLACE: Hive:4ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaaRaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaRa2aaR1RaaRa2aaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaRa2a3R3aRaRaRaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaRaRaRaaa3aaa3aRa.a.aaaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaRa.aRa2a2a2a2aRaRa.a.a3aaaaaaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4aaaaaaaaa.aaRaRaa2aa2aaRaaa.aa3a33aaaaaaaaaa.44xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.4aaaaaaa.222a3a.aaaRaaa.aaa.R3aa3a3aaaaaaaa.....4xxxxxxxxxxxxxxxxxxxxxxxxxxxxx....aaaaaaa.aRa.a3aRaRa.a3a.a.a.a.aRa2aaaaaa....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...aaaaaa3a3a.a.a.a3aRa2aRa3a.a.aRaRa.aaaaa...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...aa2aRa3a3a3aRa.a3a.a.a.a.a.a.a.a3a.aaa...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...aaa.a.a.a2a.aaa.aRaRa2a.a2a3a.a2aaaa..T..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....a2a.a2a.aRaaaaa3a.a.aaa3a3a3a3a.a.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.4...aaRRaa.a2a.a3a3a3a.aaa.a.aRa.a.aa..4.......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......a.a.aaa.a3a.a.a.a.aaa2a.a2a.a.aRaa.....4...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....aa3a2aaa.a.a.a3a3a3a3aRaaa.a2a.a2aa........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...aaaa.a2aRa.a.a2aaa.a.a.a.aaa.a.aaaa.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..aaa.a.a.a.a.a.a.aaa2a.a3a2a.a2aaa.....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.aaaa3a.a2aRa.a.aaaRa.a.aa.a.aaa....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...aaaaRa.a3a3a.a.a.aaa.aa.aa....4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........aa.a2a.a.aaa2aa.aa.aaa....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....4.....a.a2a2a.a2a.a2a.......4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.............a.a.a.a.a.a.....4....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............4..a.a.a......4...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................a.a.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....4...T............xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................T.........xxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......4.....................xxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............xx...............xxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............xxxxx........4......xxxx..4....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..T..........xxx................xxxxx...T.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............xxx........T.........xxx........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....4........xx....................x..........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...............x.x...xxx...............xx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........4...........xxx..................xxxxxxxxxxxxxxxxxxaaaaaxxxxxxxxxxxxxx.....4.....................4......4...........4...xxxxxxxxxxaa5a5aaxxxxxxxxxxxxx.................................................wwwwwwwwxxxa5*|*5axxxxxxxxxxxxx............x...x...T.....xxxx.................wwwwwwwwwwwwxaa*|*aaxxxxxxxxxxxxxx.........xx.............xxxxx................wwwwwwwwwwwwwwxaa5aaxxxxxxxxxxxxxxxx.......x..................xxx....4..........wwwwwwwwwwwwwwwxa5axxxxxxxxxxxxxxxxx.....xxx...4...........................xxxx.4wwwwwwwwwwwwwwwa=axxxxxxxxxxxxxxxxxx..xxx.............xx....(.........xxxxxxxx....wwwwwwwwwwwwwwaaxxxxxxxxxxxxxxxxxxxxxx.............xxxx..................xxxx......wwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxx....{..}..xxxxxx..]......xxx...........4.wwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........xxx........xxxxxx....4....wwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..[.xxx........xxx)....wwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: queen bee, killer bee, killer bee larva, plant, yellow waspMONS: random, random############################################################################# Vault:8 last level of the vaults -- dungeon.cc will change all these 'x's#NAME: vaults_vaultPLACE: Vault:8ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxx..x.........................x....xxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxx..x.xxxxxxxxxxx..xxxxxxxxxx.x....xxxxx.................xxxxx..xxxxxxxxxxxxxxxxxx..x.x*.*.*.*.*x..x........x.x....xxx..........8..........xxx..xxxxxxxxxxxxxxxxxx..x.x.*.*.*.*.x..x........x.x....xxx.....................xxx..xxxxxxxxxxxxxxxxxx..x.x*.*.*.*.*x..x...||...x.x....xx......9........9.......xx..xxxxxxxxxxxxxxxxxx..x.x.*.*.*.*.x..x...||...x.x....xx.......................xx..xxxxxxxxxxxxxxxxxx..x.x*.*.*.*.*x..x...||...x.x....xx......xxxxxxxxxxx......xx..xxxxxxxxxxxxxxxxxx..x.x.*.*.*.*.x..x........x.x....xx......x.........x......xx..xxxxxxxxxxxxxxxxxx..x.x*.*.*.*.*+..+........x.x....xx....xxx..........xx....xx..xxxxxxxxxxxxxxxxxx..x.x.*.*.*.*.xxxxxxxxxxxxx.x....xx.9..x....xxxxx....x..8.xx..xxxxxxxxxxxxxxxxxx..x.xxxxxxxxxxx9998.........x....xx....x...xx$$$xx...x....xx..xxxxxxxxxxxxxxxxxx..x...........899xxxxxxxxxx.x....xx....x..xx$***$xx..x....xx..xxxxxxxxxxxxxxxxxx..x.xxxxxxxxxxx99x........x.x....xx....x..x$$*|*$$x..x....xx..xxxxxxxxxxxxxxxxxx..x.x.....|...x88x.$$$$$$.x.x....xx..8.x..xx$***$xx..x....xx..xxxxxxxxxxxxxxxxxx..x.x.|..|..|.x..x.$$$$$$.x.x....xx....x....x$$$xx...x..9.xx..xxxxxxxxxxxxxxxxxx..x.x.........x..x.$$$$$$.x.x....xx....xxx..xxxxx..xxx....xx..xxxxxxxxxxxxxxxxxx..x.x.|..|..|.x..x.$$$$$$.x.x....xx......x.........x......xx..xxxxxxxxxxxxxxxxxx..x.x.........x..x.$$$$$$.x.x....xx......xxxxxxxxxxx......xx..xxxxxxxxxxxxxxxxxx..x.x|..|..|..x..x.$$$$$$.x.x....xxx.....................xxx..xxxxxxxxxxxxxxxxxx..x.x.........x..+........x.x....xxx......9.........9....xxx..xxxxxxxxxxxxxxxxxx..x.xxxxxxxxx+x..xxxxxxxxxx.xx.11....xx................xxxxx..xxxxxxxxxxxxxxxxxx..x...........x..x...........x1111...xxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxx..1....1..xxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxx..........................xx1..(}..1..........................xxxxxxxxxxxxxxxxxx...........................11.[..{.11.........................xxxxxxxxxxxxxxxxxx............................1..])..1..........................xxxxxxxxxxxxxxxxxx.............................1....1...........................xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx.....1111..x.xxx.xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.....11..........................x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x|x.x.x.x.x................................x..xxxxxxxxxxxxxxxxxx..xx.x|x.x.x.x.x.x.x.x.x.x.x.....x.........................x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x9x.x.x.x.x.x..........8..........9........x..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x..9......................x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x.x.x|x.x.x.x....x.........................x..xxxxxxxxxxxxxxxxxx..xx.x8x.x.x|x.x.x.x.x.x.x.xx....x..............9...9......x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x9x.x.x.x.x.x.x.x.x...........8..................x..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x..9......................x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x.x|x.x9x.x.x....x.........................x..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x...................9.....x..xxxxxxxxxxxxxxxxxx..x.x.x9x.x.x.x.x.x.x.x.x.x.x....x....9......8.............x..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x9x.x.x.x.x.xx....x.........................x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x.x.x.x.x.x.x....x.........................x..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x.x.x.x.x.x.xx....x.......9......9..........x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x.x.x8x.x.x.x....x.....................8...x..xxxxxxxxxxxxxxxxxx..xx.x8x.x.x.x.x.x.x.x.x.x.xx....x.....................||.|x..xxxxxxxxxxxxxxxxxx..x.x|x.x.x.x.x.x.x|x.x.x.x.x....x.....................|...x..xxxxxxxxxxxxxxxxxx..xx.x.x.x.x.x.x8x.x.x.x.x.xx....x......8..................x..xxxxxxxxxxxxxxxxxx..x.x.x.x.x.x.x.x.x.x.x.x.x.x....x..........8..8...8.....||x..xxxxxxxxxxxxxxxxxx..xO.x.x.x.x.x.x.x.x.x.x|x.xx....x.....................|.||x..xxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: vault guardMONS: random, random, random, random, random, random############################################################################# snake_pitNAME: snake_pitPLACE: Snake:5ORIENT: southwest# Rotation makes this look really bad if the console font is not square.FLAGS: no_rotate# Hey, this looks a bit like a face ...MAPxxxxxxxxxxxxxxxxxxxxxxx..@.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.............xxxxxxxxxxxxxxxxxxxxxx....x.............x..xxxxxxxxxxxxxxxxx....2.x.............x.2..xxxxxxxxxxxxxx.....2.x....x.....x..x..3.xxxxxxxxxxxxxx.....22x.............xx.2..xxxxxxxxxxxxx.......xx..x........xx..3..xxxxxxxxxxxx.....x23.xx....T...xxx.44...xxxxxxxxxxxx......4.4.x.........x.333....xxxxxxxxxxx......3.x4...x.......4x4.....xxxxxxxxxxx.......3.......x.............xxxxxxxxxxx..c......3.........x.......c.xxxxxxxxxx...cc...................3..cc.xxxxxxxxxx...cc..........4.4.........cc.xxxxxxxxxx...cc...3...x........2.....cc.xxxxxxxxxx...cc.........1...1.......cc..xxxxxxxxxxx..cc.....1.....1.....1..ccc.xxxxxxxxxxxx...ccc..................cc..xxxxxxxxxxxx....cccc....3333333.....cc..xxxxxxxxxxxx.....ccccccc...........cc...xxxxxxxxxxxx........cccccccO...ccccc....xxxxxxxxxxxxx........cccccccccccccc....xxxxxxxxxxxxxx.........cccccccccccc.....xxxxxxxxxxxxxxxx.......................xxxxxxxxxxxxxxxxxxxx..................xxxxxxxxxxxxxxxxxxxxxxxxxxx.......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: greater naga, naga, naga mage, naga warriorMONS: random, random, random############################################################################# elf_hallNAME: elf_hallPLACE: Elf:7ORIENT: northwestFLAGS: no_rotateMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxcc*|*|*|**|||||c$ccxxxxxxxxxxxxxxxxxxxxcc*$*|*|*|*|||||c$$ccxxxxxxxxxxxxxxxxxxcc*$|*$***$$|||||c|$$ccxxxxxxxxxxxxxxxxcc*$*|**ccccccccccc$$$$ccxxxxxxxxxxxxxxxc*|*$*$ccc.....2..c+$|$$cxxxxxxxxxxxxxxxc$*$*ccc...........c$$$$cxxxxxxxxxxxxxxxc||**cc...5.......4cc$|$cxxxxxxxxxxxxxxxc*$$cc........3..ccccccccxxxxxxxxxxxxxxxc$+ccc.....2....cc.....5cxxxxxxxxxxxxxxxc$c....5.......cc.......cxxxxxxxxxxxxxxxccc......5....cc..2....ccxxxxxxxxxxxxxxxxxc..........cc.......ccxxxxxxxxxxxxxxxxxcc..1..U..........4..ccxxxxxxxxxxxxxxxxcc.....................ccxxxxxxxxxxxxxxxc...........3...........cxxxxxxxxxxxxxxxc.......2.......3.......cxxxxxxxxxxxxxxxc..2................2..5cxxxxxxxxxxxxxxxc......x.........x......cxxxxxxxxxxxxxxxc.....xx.........xx.....cxxxxxxxxxxxxxxxc2...xxx....1....xxx.4..cxxxxxxxxxxxxxxxc..xxxx...........xxxx..cxxxxxxxxxxxxxxxc.xxx.....cc.cc.....xxx.cxxxxxxxxxxxxxxxc.x.....cccc.cccc.....x.cxxxxxxxxxxxxxxxc.3...cccxxc.cxxccc.3...cxxxxxxxxxxxxxxxc...cccxxxxc.cxxxxccc...cxxxxxxxxxxxxxxxc.cccxxxxxxc.cxxxxxxccc.cxxxxxxxxxxxxxxxcccxxxxxxxxc.cxxxxxxxxcccxxxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxENDMAPMONS: deep elf high priest, deep elf demonologistMONS: deep elf annihilator, deep elf sorcererMONS: deep elf death mageMONS: random, random############################################################################### slime_pitNAME: slime_pitPLACE: Slime:$ORIENT: encompass# Slime pit take is reduced pending an increase in difficulty of this# subdungeon. -- bwrMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx....(................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....................ccc..ccc............]......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...................cccc2ccccc...................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...................cc*cc..cc*cc....................xxxxxxxxxxxxxxxxxxxxxxxxxxxxx..................cc***cc4c***cc..................xxxxxxxxxxxxxxxxxxxxxxxxxxxxx..................cc*|*cc..cc*|*cc..................xxxxxxxxxxxxxxxxxxxxxxxxxxxx.................cc*|P|*c4cc*|P|*cc.................xxxxxxxxxxxxxxxxxxxxxxxxxxxx.................cc**|*cc..cc*|**cc....................xxxxxxxxxxxxxxxxxxxxxxxx..................ccc**c|cc4c|c**ccc...................xxxxxxxxxxxxxxxxxxxxxxxxx..................cccccccc..cccccccc....................xxxxxxxxxxxxxxxxxxxxxxx...................c.4.c.4.1..4.c.4.c.....................xxxxxxxxxxxxxxxxxxxxxx...................2.c.4.c..3.c.4.c.2.....................xxxxxxxxxxxxxxxxxxxxxx..........)........cccccccc..cccccccc.....................xxxxxxxxxxxxxxxxxxxxxx...................ccc**c|cc4c|c**ccc.....................xxxxxxxxxxxxxxxxxxxxx....................cc**|*cc..cc*|**cc....................xxxxxxxxxxxxxxxxxxxxxx....................cc*|P|*c4cc*|P|*cc....................xxxxxxxxxxxxxxxxxxxxxx.....................cc*|*cc..cc*|*cc....................xxxxxxxxxxxxxxxxxxxxxxxx.....................cc***cc4c***cc.....................xxxxxxxxxxxxxxxxxxxxxxxxx.....................cc*cc..cc*cc......................xxxxxxxxxxxxxxxxxxxxxxxxxx.....................cccc2ccccc......................xxxxxxxxxxxxxxxxxxxxxxxxxxxx.....................ccc..ccc.......................xxxxxxxxxxxxxxxxxxxxxxxxxxxx...........................................[.........xxxxxxxxxxxxxxxxxxxxxxxxxx......................................................xxxxxxxxxxxxxxxxxxxxxxxxxx..............................................xxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxx...........................................xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxx..........................................xxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx......................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.............................}......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx............................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...........{........xxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: royal jelly, acid blob, great orb of eyesMONS: random, random, random, random############################################################################### The Hall of BladesNAME: hall_of_bladesPLACE: BladeORIENT: northMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxccc....cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.....cccxxxxxxxxxxxxxxxxcc......cc...cc...cc...cc...cc...cc...cc...cc...cc...cc.......ccxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc..........c..............c..............c..............c......cxxxxxxxxxxxxxxxxc.........ccc............ccc............ccc............ccc.....cxxxxxxxxxxxxxxxxc........ccccc..........ccccc..........ccccc..........ccccc....cxxxxxxxxxxxxxxxxc.........ccc............ccc............ccc...........ccccc....cxxxxxxxxxxxxxxxxc..........c..............c..............c.............ccc.....cxxxxxxxxxxxxxxxxc......................................................ccc.....cxxxxxxxxxxxxxxxxc.......................................................c......cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc.......................................................c......cxxxxxxxxxxxxxxxxc......................................................ccc.....cxxxxxxxxxxxxxxxxc..........c..............c..............c.............ccc.....cxxxxxxxxxxxxxxxxc.........ccc............ccc............ccc...........ccccc....cxxxxxxxxxxxxxxxxc........ccccc..........ccccc..........ccccc..........ccccc....cxxxxxxxxxxxxxxxxc.........ccc............ccc............ccc............ccc.....cxxxxxxxxxxxxxxxxc..........c..............c..............c..............c......cxxxxxxxxxxxxxxxxc..............................................................cxxxxxxxxxxxxxxxxc.......cc...cc...cc...cc...cc...cc...cc...cc...cc...cc.......ccxxxxxxxxxxxxxxxxcc.....cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.cccc.....cccxxxxxxxxxxxxxxxxccc...ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxcccc.............................cccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccc.@.cccccccccccccccccccccccccccccccxxxxxxxxENDMAPMONS: dancing weaponMONS: random, random, random, random, random, random############################################################################### hall_of_ZotNAME: hall_of_ZotPLACE: Zot:5ORIENT: northMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxcccc..............ccccxxxxxxxxxxxxxxxxxcccc............ccccxxxxxxxxxxxxxxxxxxxxcc....................cccxxxxxxxxxxxxxccc..................ccxxxxxxxxxxxxxxxxxxcc...........3...........ccxxxxxxxxxxxcc...........3.........ccxxxxxxxxxxxxxxxxxc..8......................cXXXXXXXXXXXc....................8..cxxxxxxxxxxxxxxxxxc...................8.....XXX...1...XXX....8..................cxxxxxxxxxxxxxxxxxcc........................XX..1...1..XX......................ccxxxxxxxxxxxxxxxxxxcc.......................X1.........1X.....................ccxxxxxxxxxxxxxxxxxxxxcc.....4....2..............1..Z..1............2....4.....ccxxxxxxxxxxxxxxxxxxxxcc.......................X1.........1X.....................ccxxxxxxxxxxxxxxxxxxcc........................XX..1...1..XX......................ccxxxxxxxxxxxxxxxxxc...................8.....XXX...1...XXX....8..................cxxxxxxxxxxxxxxxxxc...8.....................cXXXXXXXXXXXc...................8...cxxxxxxxxxxxxxxxxxcc..........8............ccccccccccccccc..........8..........ccxxxxxxxxxxxxxxxxxxcc....................ccccccccccccccccccc..................ccxxxxxxxxxxxxxxxxxxxxcc................ccccccccccccccccccccccccc..............ccxxxxxxxxxxxxxxxxxxxxxxccF111FcccccccccccccccccccccccccccccccccccccccccccF111Fccxxxxxxxxxxxxxxxxxxxxxxcc................^^1.ccccccccccccccccc.1^^..............ccxxxxxxxxxxxxxxxxxxxxcc.................cc1...ccccccccccccc...1cc...............ccxxxxxxxxxxxxxxxxxxcc.............8.....ccc...ccccccccccc...ccc...8.............ccxxxxxxxxxxxxxxxxxc....8................ccc...............ccc...........8...8...cxxxxxxxxxxxxxxxxxc.......8.....8...8...cxcc.............ccxc...................cxxxxxxxxxxxxxxxxxc.....................cxxc.............cxxc.......8...........cxxxxxxxxxxxxxxxxxc.....................cxxcc.1...1...1.ccxxc............8....8.cxxxxxxxxxxxxxxxxxc.......8....8.....8..cxxxc...........cxxxc....8..............cxxxxxxxxxxxxxxxxxc.....................cxxcc...........ccxxc..........8........cxxxxxxxxxxxxxxxxxcc...5...............ccxxc.............cxxcc..............8..ccxxxxxxxxxxxxxxxxxxcc........8........ccxxcc.............ccxxcc....8....5.....ccxxxxxxxxxxxxxxxxxxxxcc...............ccxxxc...............cxxxcc.............ccxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccxxxxcccccccc@ccccccccxxxxcccccccccccccccxxxxxxxxxxxENDMAPMONS: Orb Guardian, Killer Klown, electric golem, orb of fireMONS: ancient lichMONS: random, random########################################################################### Ecumenical templeNAME: templePLACE: TempleORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc............<............cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...........................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.............................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...............................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.....................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.......................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.........................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...........................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.............................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...............................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.................................................cxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...................................................cxxxxxxxxxxxxxxxxxxxxxxxxxcc..........................B..........................cxxxxxxxxxxxxxxxxxxxxxxxcc.......................................................cxxxxxxxxxxxxxxxxxxxxxcc.....................B.............B.....................cxxxxxxxxxxxxxxxxxxxcc...........................................................cxxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.................B.........................B.................cxxxxxxxxxxxxxxxxxc..............................T..............................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc..............B...............................B..............cxxxxxxxxxxxxxxxxxc(....................T.................T....................{cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc.............................................................cxxxxxxxxxxxxxxxxxc................B...........................B................cxxxxxxxxxxxxxxxxxcc...........................................................ccxxxxxxxxxxxxxxxxxxcc............................T............................ccxxxxxxxxxxxxxxxxxxxxcc.......................................................ccxxxxxxxxxxxxxxxxxxxxxxcc.....................................................ccxxxxxxxxxxxxxxxxxxxxxxxxcc...................................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxcc.................................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...............B................B..............ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.............................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.....................B.....................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.........................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.......................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.....................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...............................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.............................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...........................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc............[............ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAP############################################################################### Tomb:1NAME: tomb_1PLACE: Tomb:1ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(.............................[..............................{xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..........ccccccccccccccccccccccccccccccccccccccccccc.........xxxxxxxxxxxxxxxxxx..........ccccccccccccccccccccccccccccccccccccccccccc.........xxxxxxxxxxxxxxxxxx..........cc..........................^............cc.........xxxxxxxxxxxxxxxxxx..........cc.........^....................^........cc.........xxxxxxxxxxxxxxxxxx..........cc..ccccccccccccccccccccccccccccccccccc..cc.........xxxxxxxxxxxxxxxxxx..........cc..c....^....^..c................c.^)c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..ccccccccc.c..3.............c.^.c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c222c111c.c...............5c..^c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c2c222c.^.c......2.........+cccc..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..ccccccccccc..........3......5..c.^cc.........xxxxxxxxxxxxxxxxxx..........cc..c.................................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..........................3......c..cc.........xxxxxxxxxxxxxxxxxx..........cc^.cccccccccccccc.......2............c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c............c....................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c............c.................3..c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..cccccccc..c..........2.........c^5cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c.^.c11c..c....................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c.c.c11c..c...3................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c^c.11cc..c..............2.....c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c.cccccc..c.......2............c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c..^..^...c.................2..c..cc.........xxxxxxxxxxxxxxxxxx..........cc5^c..ccccccccccc....................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c.................................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c.................................c..cc.........xxxxxxxxxxxxxxxxxx..........cc..cccccccccccccc..^.^..cccccccccccccc..cc.........xxxxxxxxxxxxxxxxxx..........cc..c...........ccc+++++ccc........^..c.^cc.........xxxxxxxxxxxxxxxxxx..........cc..c.^.....^...cc.2...2.cc......^....c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..ccccccc..cc.F...F.cc..ccccccc..c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..cc.322c..cc.......cc..c22..cc..c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..c].c22c..cc.......cc..c22c.}c^.c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c..cccc..c.^cc.G...G.cc..c3.cccc..c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c.....^..c..cc.......cc.^c........c..cc.........xxxxxxxxxxxxxxxxxx..........cc..c........c..cc.......cc..c....^...c..cc.........xxxxxxxxxxxxxxxxxx..........cc^.cccccccccc..cc.G...G.cc..cccccccccc.^cc.........xxxxxxxxxxxxxxxxxx..........cc......^.......cc.......cc..........^...cc.........xxxxxxxxxxxxxxxxxx..........cc...........^..cc.......cc.....^........cc.........xxxxxxxxxxxxxxxxxx..........cccccccccccccccccc.G...G.cccccccccccccccccc.........xxxxxxxxxxxxxxxxxx..........cccccccccccccccccc.......cccccccccccccccccc.........xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx.............................G...G............................xxxxxxxxxxxxxxxxxx...........................4.......4..........................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx...........................4..V.V..4..........................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx...........................4.......4..........................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxx..............................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: mummy, guardian mummy, mummy priest, sphinx, greater mummyMONS: random, random################################################################################ Tomb:2NAME: tomb_2PLACE: Tomb:2# Can be rotated!ORIENT: encompassMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc{...c......c.....3....c........c.......ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.....^c^........^c......2^c.......ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c...2.^+..2.....2^+^..2....+.......ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.3.^c^.....c^.........c^2.....^c^......ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...^+^.....c..........c........c...2...ccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccc+ccccccccccccccccccccccccccccccc....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc..^.c.............................c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.............................c..3.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c..ccc4.................4ccc..c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c..ccc...................ccc..c..2.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c..ccc.........1.........ccc..c)..}ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.3..c..ccc.....2.......2.....ccc..cccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.............................c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.............................c^2..ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c........c...........c........+....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc]...c.............................c^2..ccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccc.....3........(........3.....c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.............................c.^.^ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...^c........c...........c........ccc+cccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....+.............................c..^.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...^c.............................c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c..ccc.....2.......2.....ccc..c..2.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccc..ccc.........1.........ccc..c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c..ccc...................ccc..c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...^+..ccc4.................4ccc..c2...ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.............................c....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccc.............................c..2.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....c.............................ccc+cccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc....+cccc+ccccccccccccccc+ccccccccc.^.^ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.1.^^.c.^..c............c^.......c.3...ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...2..c.1..c.....1.1....c.....2..c.....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc......c....c..1......1.^c..2.....c...2.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc..3...c.1..c...1...1..1^+........c.....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc......c....c[...........c.......3c.....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: mummy, guardian mummy, mummy priest, greater mummyMONS: random, random, random############################################################################## Tomb:3NAME: tomb_3PLACE: Tomb:3ORIENT: encompass# Unless you have a square aspect ratio, Tomb:3 looks utterly lame when# rotated.FLAGS: no_rotateMAPxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccc.............................cccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc...............cccccc..............ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc...............cccccccc..............cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc.......4......ccccO4cccc......4......cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc............cccc......cccc...........cccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc............cccc........cccc...........ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc............cccc........cccc...........ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...........cccc..444444..cccc..........ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.......................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.......................................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.................222222................ccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc................223322...............cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc...3............223322............3..cccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc...............222222..............ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc....2..........................2...ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccc....2......................2....cccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccc............................cccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccc+ccc..................ccc+ccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccc....cc................cc....cccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccc.......cc22222222222222cc......$cccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc....^.....cc............cc..^.....$ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc.^.........cc..........cc.....^.^.$ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc$...^...^..^.cc........cc..........$$cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc$$$...........cc222222cc.^........$$$cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc|$$$...........c......c.....^...$$$$$cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc||$$$$...^.....c......c^......$$$$$$$cccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc|||||$$.....^..c......c......$$$$$$$$cccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc|||||$........c......c...^.$$$$$$$$ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccc||||$$..^....c......c.....$$$$$$$cccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccc||||$.......c......c.....$$$$$$ccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccc|||$$....^.c......c.^.^$$$$$$cccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccc|||$^....cc..{...cc...$$$$$ccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxccccccccc||$.....cc...(..cc..$$$$$cccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccc|$...cccc..[...cccc$$$$ccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: mummy, guardian mummy, mummy priest, greater mummyMONS: random, random############################################################################## Swamp:5NAME: swampPLACE: Swamp:5ORIENT: southeast# NB - most of the 'x's here will be set to water in dungeon.ccMAPxxxxxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc3.2..ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.1.3.2.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxccc....1.1cccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc.1.32....ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc...3..1.3ccxxxxxxxxxxxxxxxxxxxxxxxxxxxcc2.1.3..2.ccxxxxxxxxxxxxxxxxxxxxxxxxxxxccc33..1..cccxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccc3O3ccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxENDMAPMONS: swamp dragon, swamp drake, hydraMONS: random, random, random, random
" levdes.vim:"" Basic Vim syntax highlighting for Dungeon Crawl Stone Soup level design" (.des) files.if version < 600syntax clearelseif exists("b:current_syntax")finishendifsyn case matchsetlocal iskeyword+=:setlocal iskeyword+=-syn keyword desDeclarator NAME: ORIENT: DEPTH: PLACE: MONS: FLAGS: SYMBOL: default-depth: TAGS: CHANCE:syn keyword desOrientation encompass north south east west northeast northwest southeast southwestsyn match desComment "^\s*#.*$"syn keyword desMapBookend MAP ENDMAP containedsyn match desMapFloor /\./ containedsyn match desMapWall /x/ containedsyn match desMapDoor /[+=]/ containedsyn match desMapStoneWall /c/ containedsyn match desMapCrystalWall /b/ containedsyn match desMapMetalWall /v/ containedsyn match desMapWaxWall /a/ containedsyn match desMapMonst /[0-9]/ containedsyn match desMapGold /\$/ containedsyn match desMapLava /l/ containedsyn match desMapWater /w/ containedsyn match desMapEntry /@/ containedsyn match desMapTrap /\^/ containedsyn match desMapValuable /[R%*|]/ containedsyn match desMapRune /[PO]/ containedsyn match desMapOrb /Z/ containedsyn cluster desMapElements contains=desMapBookend,desMapWall,desMapFloorsyn cluster desMapElements add=desMapMonst,desMapCrystalWall,desMapGoldsyn cluster desMapElements add=desMapLava,desMapMetalWall,desMapDoorsyn cluster desMapElements add=desMapStoneWall,desMapWater,desMapTrapsyn cluster desMapElements add=desMapEntry,desMapWaxWallsyn cluster desMapElements add=desMapRune,desMapOrb,desMapValuablesyn region desMap start=/^\s*\<MAP\>\s*$/ end=/^\s*\<ENDMAP\>\s*$/ contains=@desMapElements keependhi link desDeclarator Statementhi link desMapBookend Statementhi link desComment Commenthi link desMap Stringhi link desOrientation Typehi desMapWall guifg=darkgrey term=bold gui=boldhi desMapCrystalWall guifg=#009040 term=bold gui=boldhi desMapStoneWall guifg=black gui=boldhi desMapMetalWall guifg=#004090 term=bold gui=boldhi desMapWaxWall guifg=#a0a000 gui=boldhi desMapFloor guifg=#008000hi desMapMonst guifg=redhi desMapLava guifg=red gui=boldhi desMapTrap guifg=red gui=boldhi desMapWater guifg=lightbluehi desMapGold guifg=#c09000hi desMapDoor guifg=brown gui=boldhi desMapEntry guifg=black guibg=white gui=boldhi desMapValuable guifg=darkgreen gui=boldhi desMapRune guifg=orange gui=boldhi desMapOrb guibg=gold guifg=blacksyn sync minlines=45
static void cmdhelp_showline(int index, const MenuEntry *me){static_cast<formatted_string *>(me->data)->display();}static int cmdhelp_keyfilter(int keyin){switch (keyin){case CK_DOWN:case '+':case '=':return ('>');case CK_UP:case '-':case '_':return ('<');case 'x':return (CK_ESCAPE);default:return (keyin);}}static bool cmdhelp_textfilter(const std::string &tag){#ifdef STASH_TRACKINGif (tag == "s")return (true);#endif#ifdef WIZARDif (tag == "wiz")return (true);#endifreturn (false);}static const char *level_map_help ="<h>Level Map ('<w>X</w><h>' in main screen):\n""<w>Esc</w> : leave level map (also Space)\n""<w>Dir.</w>: move cursor\n""<w>/ Dir.</w>, <w>Shift-Dir.</w>: move cursor far\n""<w>+</w>/<w>-</w> : scroll level map up/down\n""<w>.</w> : travel (also Enter and , and ;)\n"" (moves cursor to last travel\n"" destination if still on @)\n""<w><<</w>/<w>></w> : cycle through up/down stairs\n""<w>^</w> : cycle through traps\n""<w>Tab</w> : cycle through shops and portals\n""<w>X</w> : cycle through travel eXclusions\n""<w>W</w> : cycle through waypoints\n""<w>I</w> : cycle through stashes\n""<w>Ctrl-X</w> : set travel eXclusion\n""<w>Ctrl-E</w> : Erase all travel exclusions\n""<w>Ctrl-W</w> : set Waypoint\n""<w>Ctrl-C</w> : Clear level and main maps\n";static void show_keyhelp_menu(const std::vector<formatted_string> &lines){Menu cmd_help;// Set flags, and don't use easy exit.cmd_help.set_flags(MF_NOSELECT | MF_ALWAYS_SHOW_MORE | MF_NOWRAP,false);// FIXME: Allow for hiding Page down when at the end of the listing, ditto// for page up at start of listing.cmd_help.set_more(formatted_string::parse_string("<cyan>[ + : Page down. - : Page up."" Esc/x exits.]"));cmd_help.f_drawitem = cmdhelp_showline;cmd_help.f_keyfilter = cmdhelp_keyfilter;std::vector<MenuEntry*> entries;for (unsigned i = 0, size = lines.size(); i < size; ++i){MenuEntry *me = new MenuEntry;me->data = new formatted_string(lines[i]);entries.push_back(me);cmd_help.add_entry(me);}cmd_help.show();for (unsigned i = 0, size = entries.size(); i < size; ++i)delete static_cast<formatted_string*>( entries[i]->data );}void show_levelmap_help(){std::vector<std::string> lines =split_string("\n", level_map_help, false, true);std::vector<formatted_string> formatted_lines;for (int i = 0, size = lines.size(); i < size; ++i)formatted_lines.push_back(formatted_string::parse_string(lines[i], true, cmdhelp_textfilter));show_keyhelp_menu(formatted_lines);}void list_commands(bool wizard){if (wizard){list_wizard_commands();return;}// 2 columns, split at column 40.column_composer cols(2, 41);// Page size is number of lines - one line for --more-- prompt.cols.set_pagesize(get_number_of_lines() - 1);cols.add_formatted(0,"<h>Movement:\n""To move in a direction or to attack, use\n""the numpad (try Numlock both off and on)\n""or vi keys:\n"" <w>1 2 3 y k u\n"" \\|/ \\|/\n"" <w>4</w>-<w>5</w>-<w>6</w>"" <w>h</w>-<w>.</w>-<w>l</w>\n"" /|\\ /|\\\n"" <w>7 8 9 b j n\n",true, true, cmdhelp_textfilter);cols.add_formatted(0,"<h>Rest/Search:\n""<w>5</w> (numpad), <w>.</w>, <w>s</w>, <w>Del</w>: ""rest one turn and\n"" search adjacent squares.\n""<w>Shift-5</w> (numpad), <w>5</w>: rest until HP/MP are\n""full or something found or 100 turns over\n",true, true, cmdhelp_textfilter);cols.add_formatted(0,"<h>Dungeon Interaction and Information:\n""<w>o</w>/<w>c</w> : Open/Close door\n""<w><<</w>/<w>></w> : use staircase (<w><<</w> also enters shop)\n""<w>;</w> : examine occupied tile\n""<w>x</w> : eXamine surroundings/targets\n""<w>X</w> : eXamine level map\n""<w>O</w> : show dungeon Overview\n",true, true, cmdhelp_textfilter);cols.add_formatted(0,"<h>Item Interaction (inventory):\n""<w>v</w> : View item description\n""<w>{</w> : inscribe item\n""<w>t</w> : Throw/shoot an item\n""<w>f</w> : Fire first available missile\n""<w>q</w> : Quaff a potion\n""<w>e</w> : Eat food (but tries floor first)\n""<w>z</w> : Zap a wand\n""<w>r</w> : Read a scroll or book\n""<w>M</w> : Memorise a spell from a book\n""<w>w</w> : Wield an item ( - for none)\n""<w>'</w> : wield item a, or switch to b\n""<w>E</w> : Evoke power of wielded item\n""<w>W</w> : Wear armour\n""<w>T</w> : Take off armour\n""<w>P</w> : Put on jewellery\n""<w>R</w> : Remove jewellery\n",true, true, cmdhelp_textfilter);cols.add_formatted(0,"<h>Other Gameplay Actions:\n""<w>a</w> : use special Ability\n""<w>p</w> : Pray\n""<w>Z</w> : cast a spell\n""<w>!</w> : shout or command allies\n",true, true, cmdhelp_textfilter);cols.add_formatted(0,"<h>In-game Toggles:\n""<w>Ctrl-A</w> : toggle Autopickup\n""<w>Ctrl-V</w> : toggle auto-prayer\n""<w>Ctrl-T</w> : toggle spell fizzle check\n",true, true, cmdhelp_textfilter);cols.add_formatted(0,level_map_help,true, true, cmdhelp_textfilter);cols.add_formatted(1,"<h>Extended Movement:\n""<w>Ctrl-G</w> : interlevel travel\n""<w>Ctrl-O</w> : auto-explore\n""<w>Ctrl-W</w> : set Waypoint\n""<w>/ Dir., Shift-Dir.</w>: long walk\n""<w>* Dir., Ctrl-Dir.</w> : untrap, attack\n"" without move, open door\n",true, true, cmdhelp_textfilter, 45);cols.add_formatted(1,"<h>Game Saving and Quitting:\n""<w>S</w> : Save game and exit \n""<w>Q</w> : Quit without saving\n""<w>Ctrl-X</w> : save game without query\n",true, true, cmdhelp_textfilter, 45);cols.add_formatted(1,"<h>Player Character Information:\n""<w>@</w> : display character status\n""<w>[</w> : display worn armour\n""<w>\"</w> : display worn jewellery\n""<w>C</w> : display experience info\n""<w>^</w> : show religion screen\n""<w>A</w> : show Abilities/mutations\n""<w>\\</w> : show item knowledge\n""<w>m</w> : show skill screen\n""<w>i</w> : show Inventory list\n""<w>%</w> : show resistances\n",true, true, cmdhelp_textfilter, 45);cols.add_formatted(1,"<h>Item Interaction (floor):\n""<w>,</w> : pick up items (also <w>g</w>) \n"" (press twice for pick up menu) \n""<w>d</w> : Drop an item\n""<w>d#</w>: Drop exact number of items \n""<w>D</w> : Dissect a corpse \n""<w>e</w> : Eat food from floor \n""<w>z</w> : Zap a wand \n""<w>r</w> : Read a scroll or book \n""<w>M</w> : Memorise a spell from a book \n""<w>w</w> : Wield an item ( - for none) \n""<w>'</w> : wield item a, or switch to b \n""<w>E</w> : Evoke power of wielded item\n",true, true, cmdhelp_textfilter);cols.add_formatted(1,"<h>Non-Gameplay Commands / Info\n""<w>V</w> : display Version information\n""<w>Ctrl-P</w> : show Previous messages\n""<w>Ctrl-R</w> : Redraw screen\n""<w>Ctrl-C</w> : Clear main and level maps\n""<w>#</w> : dump character to file\n""<w>:</w> : add note to dump file\n""<w>`</w> : add macro\n""<w>~</w> : save macros\n""<w>=</w> : reassign inventory/spell letters\n",true, true, cmdhelp_textfilter);cols.add_formatted(1,"<?s><h>Stash Management Commands:\n""<?s><w>Ctrl-S</w> : mark Stash\n""<?s><w>Ctrl-E</w> : Erase stash (ignore square)\n""<?s><w>Ctrl-F</w> : Find (in stashes and shops)\n",true, true, cmdhelp_textfilter);cols.add_formatted(1,"<h>Targeting, Surroundings ('<w>x</w><h>' in main):\n"" <w>x</w> : stop targeting (also <w>Esc</w> and <w>Space</w>)\n"" <w>+</w> : cycle monsters forward\n"" <w>-</w> : cycle monsters backward\n"" <w>*</w> : cycle objects forward (also ')\n"" <w>/</w> : cycle objects backward (also ;)\n"" <w>.</w> : choose target/move (also Enter)\n"" <w>?</w> : describe monster under cursor\n""<w><<</w>/<w>></w> : cycle through up/down stairs\n",true, true, cmdhelp_textfilter);cols.add_formatted(1,"<h>Shortcuts in Lists (like multidrop):\n""<w>(</w>/<w>)</w> : selects all missiles/hand weapons\n""<w>%</w>/<w>&</w> : selects all food/carrion\n""<w>+</w>/<w>?</w> : selects all books/scrolls\n""<w>/</w>/<w>\\</w> : selects all wands/staves\n""<w>!</w>/<w>\"</w> : selects all potions/jewellry\n""<w>[</w>/<w>}</w> : selects all armour/misc. items\n""<w>,</w>/<w>-</w> : global select/deselect\n""<w>*</w> : invert selection\n",true, true, cmdhelp_textfilter);show_keyhelp_menu(cols.formatted_lines());}static void list_wizard_commands(){const char *line;int j = 0;#ifdef DOS_TERMchar buffer[4800];window(1, 1, 80, 25);gettext(1, 1, 80, 25, buffer);#endifclrscr();// BCR - Set to screen length - 1 to display the "more" stringint moreLength = (get_number_of_lines() - 1) * 2;for (int i = 0; i < 500; i++){line = wizard_string( i );if (strlen( line ) != 0){// BCR - If we've reached the end of the screen, clearif (j == moreLength){gotoxy(2, j / 2 + 1);cprintf("More...");getch();clrscr();j = 0;}gotoxy( ((j % 2) ? 40 : 2), ((j / 2) + 1) );cprintf( "%s", line );j++;}}getch();#ifdef DOS_TERMputtext(1, 1, 80, 25, buffer);#endifreturn;} // end list_commands()static const char *wizard_string( int i ){UNUSED( i );#ifdef WIZARDreturn((i == 10) ? "a : acquirement" :(i == 13) ? "A : set all skills to level" :(i == 15) ? "b : controlled blink" :(i == 20) ? "B : banish yourself to the Abyss" :(i == 30) ? "g : add a skill" :(i == 35) ? "G : remove all monsters" :(i == 40) ? "h/H : heal yourself (super-Heal)" :(i == 50) ? "i/I : identify/unidentify inventory":(i == 70) ? "l : make entrance to labyrinth" :(i == 80) ? "m/M : create monster by number/name":(i == 90) ? "o/% : create an object" :(i == 100) ? "p : make entrance to pandemonium" :(i == 110) ? "x : gain an experience level" :(i == 115) ? "r : change character's species" :(i == 120) ? "s : gain 20000 skill points" :(i == 130) ? "S : set skill to level" :(i == 140) ? "t : tweak object properties" :(i == 150) ? "X : Receive a gift from Xom" :(i == 160) ? "z/Z : cast any spell by number/name":(i == 200) ? "$ : get 1000 gold" :(i == 210) ? "</> : create up/down staircase" :(i == 220) ? "u/d : shift up/down one level" :(i == 230) ? "~/\" : goto a level" :(i == 240) ? "( : create a feature" :(i == 250) ? "] : get a mutation" :(i == 260) ? "[ : get a demonspawn mutation" :(i == 270) ? ": : find branch" :(i == 280) ? "{ : magic mapping" :(i == 290) ? "^ : gain piety" :(i == 300) ? "_ : gain religion" :(i == 310) ? "\' : list items" :(i == 320) ? "? : list wizard commands" :(i == 330) ? "| : acquire all unrand artefacts" :(i == 340) ? "+ : turn item into random artefact" :(i == 350) ? "= : sum skill points": "");#elsereturn ("");#endif} // end wizard_string()#ifdef OBSOLETE_COMMAND_HELPstatic const char *command_string( int i ){/** BCR - Command printing, case statement* Note: The numbers in this case indicate the order in which the* commands will be printed out. Make sure none of these* numbers is greater than 500, because that is the limit.** Arranged alpha lower, alpha upper, punctuation, ctrl.**/return((i == 10) ? "a : use special ability" :(i == 20) ? "d(#) : drop (exact quantity of) items" :(i == 30) ? "e : eat food" :(i == 40) ? "f : fire first available missile" :(i == 50) ? "i : inventory listing" :(i == 55) ? "m : check skills" :(i == 60) ? "o/c : open / close a door" :(i == 65) ? "p : pray" :(i == 70) ? "q : quaff a potion" :(i == 80) ? "r : read a scroll or book" :(i == 90) ? "s : search adjacent tiles" :(i == 100) ? "t : throw/shoot an item" :(i == 110) ? "v : view item description" :(i == 120) ? "w : wield an item" :(i == 130) ? "x : examine visible surroundings" :(i == 135) ? "z : zap a wand" :(i == 140) ? "A : list abilities/mutations" :(i == 141) ? "C : check experience" :(i == 142) ? "D : dissect a corpse" :(i == 145) ? "E : evoke power of wielded item" :(i == 150) ? "M : memorise a spell" :(i == 155) ? "O : overview of the dungeon" :(i == 160) ? "P/R : put on / remove jewellery" :(i == 165) ? "Q : quit without saving" :(i == 168) ? "S : save game and exit" :(i == 179) ? "V : version information" :(i == 200) ? "W/T : wear / take off armour" :(i == 210) ? "X : examine level map" :(i == 220) ? "Z : cast a spell" :(i == 240) ? ",/g : pick up items" :(i == 242) ? "./del: rest one turn" :(i == 250) ? "</> : ascend / descend a staircase" :(i == 270) ? "; : examine occupied tile" :(i == 280) ? "\\ : check item knowledge" :#ifdef WIZARD(i == 290) ? "& : invoke your Wizardly powers" :#endif(i == 300) ? "+/- : scroll up/down [level map only]" :(i == 310) ? "! : shout or command allies" :(i == 325) ? "^ : describe religion" :(i == 337) ? "@ : status" :(i == 340) ? "# : dump character to file" :(i == 350) ? "= : reassign inventory/spell letters" :(i == 360) ? "\' : wield item a, or switch to b" :(i == 370) ? ": : make a note" :#ifdef USE_MACROS(i == 380) ? "` : add macro" :(i == 390) ? "~ : save macros" :#endif(i == 400) ? "] : display worn armour" :(i == 410) ? "\" : display worn jewellery" :(i == 415) ? "{ : inscribe an item" :(i == 420) ? "Ctrl-P : see old messages" :#ifdef PLAIN_TERM(i == 430) ? "Ctrl-R : Redraw screen" :#endif(i == 440) ? "Ctrl-A : toggle autopickup" :(i == 445) ? "Ctrl-M : toggle autoprayer" :(i == 447) ? "Ctrl-T : toggle fizzle" :(i == 450) ? "Ctrl-X : Save game without query" :#ifdef ALLOW_DESTROY_ITEM_COMMAND(i == 451) ? "Ctrl-D : Destroy inventory item" :#endif(i == 453) ? "Ctrl-G : interlevel travel" :(i == 455) ? "Ctrl-O : explore" :#ifdef STASH_TRACKING(i == 456) ? "Ctrl-S : mark stash" :(i == 457) ? "Ctrl-E : forget stash" :(i == 458) ? "Ctrl-F : search stashes" :#endif(i == 460) ? "Shift & DIR : long walk" :(i == 465) ? "/ DIR : long walk" :(i == 470) ? "Ctrl & DIR : door; untrap; attack" :(i == 475) ? "* DIR : door; untrap; attack" :(i == 478) ? "Shift & 5 on keypad : rest 100 turns": "");} // end command_string()#endif // OBSOLETE_COMMAND_HELP
// Giving away chunk type information is spoily./*static int food_chunktype(lua_State *ls){LUA_ITEM(item, 1);if (item && item->base_type == OBJ_FOOD && item->sub_type == FOOD_CHUNK){int mons_type = item->plus;int chunk_type = mons_corpse_thingy(mons_type);const char *schunktype = "unknown";switch (chunk_type){case CE_HCL:case CE_MUTAGEN_GOOD:case CE_MUTAGEN_BAD:case CE_MUTAGEN_RANDOM:schunktype = "mutagenic";break;case CE_POISONOUS:schunktype = "poisonous";break;case CE_CONTAMINATED:schunktype = "contaminated";break;case CE_CLEAN:schunktype = "clean";break;}lua_pushstring(ls, schunktype);}elselua_pushnil(ls);return (1);}*/
{ "increasing_skill_progress", &Options.increasing_skill_progress, option_hboolean },{ "confirm_self_target", &Options.confirm_self_target, option_hboolean },{ "safe_autopickup", &Options.safe_autopickup, option_hboolean },{ "note_skill_max", &Options.note_skill_max, option_hboolean },{ "use_notes", &Options.use_notes, option_hboolean },
// last updated 12may2000 {dlb}/* ************************************************************************ called from: acr - ouch* *********************************************************************** */bool dump_char( const char fname[30], bool show_prices );
bool dump_char(const std::string &fname,bool show_prices,bool full_id = false);
static bool dump_show_prices = false;static bool dump_full_id = false;static void sdump_header(const std::string §ion, std::string &text);static void sdump_stats(const std::string §ion, std::string &text);static void sdump_location(const std::string §ion, std::string &text);static void sdump_religion(const std::string §ion, std::string &text);static void sdump_burden(const std::string §ion, std::string &text);static void sdump_hunger(const std::string §ion, std::string &text);static void sdump_transform(const std::string §ion, std::string &text);static void sdump_misc(const std::string §ion, std::string &text);static void sdump_notes(const std::string §ion, std::string &text);static void sdump_inventory(const std::string §ion, std::string &text);static void sdump_skills(const std::string §ion, std::string &text);static void sdump_spells(const std::string §ion, std::string &text);static void sdump_mutations(const std::string §ion, std::string &text);static void sdump_messages(const std::string §ion, std::string &text);static void sdump_screenshot(const std::string §ion, std::string &text);static void sdump_kills(const std::string §ion, std::string &text);static void sdump_newline(const std::string §ion, std::string &text);static void sdump_separator(const std::string §ion, std::string &text);#ifdef CLUA_BINDINGSstatic void sdump_lua(const std::string §ion, std::string &text);#endifstatic bool write_dump(const std::string &fname, const std::string &text,bool full_id);static void dump_stats2( std::string & text, bool calc_unid);static void dump_stats( std::string & text );struct dump_section_handler{const char *name;void (*handler)(const std::string §ion, std::string &text);};static dump_section_handler dump_handlers[] = {{ "header", sdump_header },{ "stats", sdump_stats },{ "location", sdump_location },{ "religion", sdump_religion },{ "burden", sdump_burden },{ "hunger", sdump_hunger },{ "transform", sdump_transform },{ "misc", sdump_misc },{ "notes", sdump_notes },{ "inventory", sdump_inventory },{ "skills", sdump_skills },{ "spells", sdump_spells },{ "mutations", sdump_mutations },{ "messages", sdump_messages },{ "screenshot", sdump_screenshot },{ "kills", sdump_kills },// Conveniences for the .crawlrc artist.{ "", sdump_newline },{ "-", sdump_separator },#ifdef CLUA_BINDINGS{ NULL, sdump_lua }#else{ NULL, NULL }#endif};static void dump_section(const std::string §ion, std::string &text){for (int i = 0; ; ++i){if (!dump_handlers[i].name || section == dump_handlers[i].name){if (dump_handlers[i].handler)(*dump_handlers[i].handler)(section, text);break;}}}
// Defined in view.ccextern unsigned char (*mapch2) (unsigned char);
bool dump_char(const std::string &fname, bool show_prices, bool full_id){// start with enough room for 100 80 character linesstd::string text;text.reserve(100 * 80);dump_show_prices = show_prices;dump_full_id = full_id;for (int i = 0, size = Options.dump_order.size(); i < size; ++i){const std::string §ion = Options.dump_order[i];dump_section(section, text);}return write_dump(fname, text, full_id);}static void sdump_header(const std::string &, std::string &text){text += " " CRAWL " version " VERSION " character file.\n\n";}static void sdump_stats(const std::string &, std::string &text){if (Options.detailed_stat_dump)dump_stats2(text, dump_full_id);elsedump_stats(text);}static void sdump_burden(const std::string &, std::string &text){switch (you.burden_state){case BS_OVERLOADED:text += "You are overloaded with stuff.\n";break;case BS_ENCUMBERED:text += "You are encumbered.\n";break;}}static void sdump_hunger(const std::string &, std::string &text){text += std::string("You are ") + hunger_level() + ".\n\n";}static void sdump_transform(const std::string &, std::string &text){if (you.attribute[ATTR_TRANSFORMATION]){switch (you.attribute[ATTR_TRANSFORMATION]){case TRAN_SPIDER:text += "You are in spider-form.";break;case TRAN_BLADE_HANDS:text += "Your hands are blades.";break;case TRAN_STATUE:text += "You are a stone statue.";break;case TRAN_ICE_BEAST:text += "You are a creature of crystalline ice.";break;case TRAN_DRAGON:text += "You are a fearsome dragon!";break;case TRAN_LICH:text += "You are in lich-form.";break;case TRAN_SERPENT_OF_HELL:text += "You are a huge, demonic serpent!";break;case TRAN_AIR:text += "You are a cloud of diffuse gas.";break;}text += "\n\n";}}
// ========================================================================// Internal Functions// ========================================================================
static void sdump_misc(const std::string &s, std::string &text){sdump_location(s, text);sdump_religion(s, text);sdump_burden(s, text);sdump_hunger(s, text);sdump_transform(s, text);}
// fillstring() is a hack to get around a missing constructor in// Borland C++ implementation of the STD basic_string. Argh!!!static std::string fillstring(size_t strlen, char filler)
static void sdump_newline(const std::string &s, std::string &text)
return s;
#ifdef CLUA_BINDINGS// Assume this is an arbitrary Lua function name, call the function and// dump whatever it returns.static void sdump_lua(const std::string &s, std::string &text){std::string luatext;clua.callfn(s.c_str(), ">s", &luatext);text += luatext;
//---------------------------------------------------------------//// dump_screenshot//// Grabs a screenshot and appends the text into the given std::string,// using several ugly hacks in the process.//---------------------------------------------------------------static void dump_screenshot( std::string &text )
static void sdump_messages(const std::string &, std::string &text)
}FixedVector < char, 1500 > buffy; //[800]; //392];int bufcount = 0;unsigned short ch, color;int count_x, count_y;// Urg, ugly screen capture. CVS Crawl may have a better way of doing this,// but until the next release...for (count_y = (you.y_pos - 8); (count_y < you.y_pos + 9); count_y++){bufcount += 8;for (count_x = (you.x_pos - 8); (count_x < you.x_pos + 9); count_x++){if (count_x == you.x_pos && count_y == you.y_pos){extern unsigned char your_sign;ch = your_sign;}else{unsigned int object = env.show[count_x - you.x_pos + 9][count_y - you.y_pos + 9];get_non_ibm_symbol(object, &ch, &color);}buffy[bufcount++] = (char) ch;}bufcount += 8;
int maxbuf = bufcount;bufcount = 0;for (count_y = 0; count_y < 17; count_y++){for (count_x = 0; count_x < 33; count_x++){if (count_x + you.x_pos - 17 < 3|| count_y + you.y_pos - 9 < 3|| count_x + you.x_pos - 14 > (GXM - 3)|| count_y + you.y_pos - 9 > (GYM - 3)){buffy[bufcount++] = ' ';continue;}if (count_x >= 8 && count_x <= 24 && count_y >= 0&& count_y <= 16 && buffy[bufcount] != 0){bufcount++;continue;}unsigned char envc = (unsigned char)env.map[count_x + you.x_pos - 17][count_y + you.y_pos - 9];if (envc){// If it's printable, use it directly.if (envc < 127 && envc >= 32)ch = envc;else{// Otherwise get what's on the grid and get an ASCII// character for that.unsigned int object = grd[count_x + you.x_pos - 16][count_y + you.y_pos - 8];
}
// Special case secret doors so that monsters that open// doors out of hero's LOS don't reveal the secret door in// the dumpif (envc == mapch2(DNGN_SECRET_DOOR))object = DNGN_SECRET_DOOR;get_non_ibm_symbol(object, &ch, &color);}buffy[bufcount++] = (char) ch;}else{buffy[bufcount++] = ' ';}}}if (bufcount > maxbuf) maxbuf = bufcount;while (maxbuf > 0 && (!buffy[maxbuf - 1] || buffy[maxbuf - 1] == ' '))--maxbuf;// 33 columns and a null terminator. More hardcoding. :-(char buf[34];char *s = buf;bool leadblanks = true;for (int i = 0; i < maxbuf; ){*s++ = buffy[i]? buffy[i] : ' ';++i;if (!(i % 33) || i >= maxbuf){*s = 0;while (s > buf && *--s == ' ')*s = 0;if (s == buf && !*s && leadblanks)continue;leadblanks = false;text += buf;text += EOL;s = buf;}}
static void sdump_screenshot(const std::string &, std::string &text){text += screenshot();text += "\n\n";
text += EOL EOL;
text += "\n" "\n";}static void sdump_notes(const std::string &, std::string& text){if ( note_list.size() == 0 || Options.use_notes == false )return;text += "\nNotes\n| Turn |Location | Note\n";text += "--------------------------------------------------------------\n";for ( unsigned i = 0; i < note_list.size(); ++i ) {text += describe_note(note_list[i]);text += "\n";}text += "\n";
if (you.level_type != LEVEL_DUNGEON || you.your_level != -1)text += "You are ";if (you.level_type == LEVEL_PANDEMONIUM)text += "in Pandemonium";else if (you.level_type == LEVEL_ABYSS)text += "in the Abyss";else if (you.level_type == LEVEL_LABYRINTH)text += "in a labyrinth";else if (you.where_are_you == BRANCH_DIS)text += "in Dis";else if (you.where_are_you == BRANCH_GEHENNA)text += "in Gehenna";else if (you.where_are_you == BRANCH_VESTIBULE_OF_HELL)text += "in the Vestibule of Hell";else if (you.where_are_you == BRANCH_COCYTUS)text += "in Cocytus";else if (you.where_are_you == BRANCH_TARTARUS)text += "in Tartarus";else if (you.where_are_you == BRANCH_INFERNO)text += "in the Inferno";else if (you.where_are_you == BRANCH_THE_PIT)text += "in the Pit";else if (you.where_are_you == BRANCH_ORCISH_MINES)text += "in the Mines";else if (you.where_are_you == BRANCH_HIVE)text += "in the Hive";else if (you.where_are_you == BRANCH_LAIR)text += "in the Lair";else if (you.where_are_you == BRANCH_SLIME_PITS)text += "in the Slime Pits";else if (you.where_are_you == BRANCH_VAULTS)text += "in the Vaults";else if (you.where_are_you == BRANCH_CRYPT)text += "in the Crypt";else if (you.where_are_you == BRANCH_HALL_OF_BLADES)text += "in the Hall of Blades";else if (you.where_are_you == BRANCH_HALL_OF_ZOT)text += "in the Hall of Zot";else if (you.where_are_you == BRANCH_ECUMENICAL_TEMPLE)text += "in the Ecumenical Temple";else if (you.where_are_you == BRANCH_SNAKE_PIT)text += "in the Snake Pit";else if (you.where_are_you == BRANCH_ELVEN_HALLS)text += "in the Elven Halls";else if (you.where_are_you == BRANCH_TOMB)text += "in the Tomb";else if (you.where_are_you == BRANCH_SWAMP)text += "in the Swamp";
if (you.your_level == -1&& you.where_are_you == BRANCH_MAIN_DUNGEON&& you.level_type == LEVEL_DUNGEON)text += "You escaped";
//---------------------------------------------------------------//// dump_religion////---------------------------------------------------------------static void dump_religion( std::string & text )
static void sdump_religion(const std::string &, std::string & text)
if (spell_line.length() > 57)spell_line = spell_line.substr(0, 57);for (int i = spell_line.length(); i < 58; i++){spell_line += ' ';}
for (int i = spell_line.length(); i < 41; ++i )spell_line += ' ';int spell_p = calc_spell_power( spell, true );spell_line += ( (spell_p > 100) ? "Enormous" :(spell_p > 90) ? "Huge" :(spell_p > 80) ? "Massive" :(spell_p > 70) ? "Major" :(spell_p > 60) ? "Impressive" :(spell_p > 50) ? "Reasonable" :(spell_p > 40) ? "Moderate" :(spell_p > 30) ? "Adequate" :(spell_p > 20) ? "Mediocre" :(spell_p > 10) ? "Minor": "Negligible");for (int i = spell_line.length(); i < 56; ++i )spell_line += ' ';
//---------------------------------------------------------------//// dump_kills////---------------------------------------------------------------static void dump_kills( std::string & text )
static void sdump_kills(const std::string &, std::string & text)
//---------------------------------------------------------------//// dump_mutations////---------------------------------------------------------------static void dump_mutations( std::string & text )
static void sdump_mutations(const std::string &, std::string & text)
//---------------------------------------------------------------//// dump_char//// Creates a disk record of a character. Returns true if the// character was successfully saved.////---------------------------------------------------------------bool dump_char( const char fname[30], bool show_prices ) // $$$ a try block?
static bool write_dump(const std::string &fname,const std::string &text,bool full_id)
std::string text;// start with enough room for 100 80 character linestext.reserve(100 * 80);text += " Dungeon Crawl version " VERSION " character file.";text += EOL;text += EOL;if (Options.detailed_stat_dump)dump_stats2(text, show_prices);elsedump_stats(text);dump_location(text);dump_religion(text);switch (you.burden_state){case BS_OVERLOADED:text += "You are overloaded with stuff.";text += EOL;break;case BS_ENCUMBERED:text += "You are encumbered.";text += EOL;break;}text += "You are ";text += hunger_level();text += ".";text += EOL;text += EOL;if (you.attribute[ATTR_TRANSFORMATION]){switch (you.attribute[ATTR_TRANSFORMATION]){case TRAN_SPIDER:text += "You are in spider-form.";break;case TRAN_BLADE_HANDS:text += "Your hands are blades.";break;case TRAN_STATUE:text += "You are a stone statue.";break;case TRAN_ICE_BEAST:text += "You are a creature of crystalline ice.";break;case TRAN_DRAGON:text += "You are a fearsome dragon!";break;case TRAN_LICH:text += "You are in lich-form.";break;case TRAN_SERPENT_OF_HELL:text += "You are a huge, demonic serpent!";break;case TRAN_AIR:text += "You are a cloud of diffuse gas.";break;}text += EOL;text += EOL;}dump_inventory(text, show_prices);char tmp_quant[20];text += EOL;text += EOL;text += " You have ";itoa( you.exp_available, tmp_quant, 10 );text += tmp_quant;text += " experience left.";dump_skills(text);dump_spells(text);dump_mutations(text);text += EOL;text += EOL;dump_screenshot(text);text += EOL EOL;dump_kills(text);
if (strcmp(fname, "morgue.txt") != 0){strncat(file_name, ".txt", kPathLen);#ifdef STASH_TRACKINGstrncat(stash_file_name, ".lst", kPathLen);stashes.dump(stash_file_name);#endif}#ifdef STASH_TRACKINGelse{// Grr. Filename is morgue.txt, it needs to be morgue.lstint len = strlen(stash_file_name);stash_file_name[len - 3] = 'l';stash_file_name[len - 2] = 's';// Fully identified stash dump.stashes.dump(stash_file_name, true);}#endif
size_t begin = 0;size_t end = text.find(EOL);while (end != std::string::npos){end += strlen(EOL);size_t len = end - begin;fwrite(text.c_str() + begin, len, 1, handle);begin = end;end = text.find(EOL, end);}
fputs(text.c_str(), handle);
static void set_resist_dump_color( const char* data ) {while ( *data && *data != ':' )++data;if ( *data == 0 )return;++data;int pluscount = 0;while ( *data ) {if ( *data == '+' )++pluscount;if ( *data == 'x' )--pluscount;++data;}switch ( pluscount ) {case 3:case 2:textcolor(LIGHTGREEN);break;case 1:textcolor(GREEN);break;case -1:textcolor(RED);break;case -2:case -3:textcolor(LIGHTRED);break;default:textcolor(LIGHTGREY);break;}}void resists_screen() {#ifdef DOS_TERMchar dosbuffer[4000];gettext( 1, 1, 80, 25, dosbuffer );window( 1, 1, 80, 25 );#endifclrscr();textcolor(LIGHTGREY);char buffer[24*3][45];get_full_detail(&buffer[0][0], false);for (int line = 0; line < 24; ++line ) {for ( int block = 0; block < 3; ++block ) {const int idx = block * 24 + line;if ( buffer[idx][0] ) {gotoxy( block == 2 ? 53 : block * 32 + 1, line+1 );/* FIXME - hack - magic number 14 */if ( block != 0 && line < 14 )set_resist_dump_color(buffer[idx]);cprintf("%s", buffer[idx] );textcolor(LIGHTGREY);}}}getch();#ifdef DOS_TERMputtext(1, 1, 80, 25, dosbuffer);window(1, 1, 80, 25);#endifredraw_screen();}
static int bounce(int &step1, int &step2, int w1, int w2, int &n1, int &n2,int l1, int l2, int &t1, int &t2, bool topBlocked, bool sideBlocked);static bool fuzzyLine(int nx, int ny, int &tx, int &ty, int lx, int ly,int stepx, int stepy, bool roundX, bool roundY);
static bool beam_is_blockable( struct bolt &pbolt ){// BEAM_ELECTRICITY is added here because chain lighting is not// a true beam (stops at the first target it gets to and redirects// from there)... but we don't want it shield blockable.return (!pbolt.is_beam && !pbolt.is_explosion&& pbolt.flavour != BEAM_ELECTRICITY);}// simple animated flash from Rupert Smith (and expanded to be more generic):void zap_animation( int colour, const monsters *mon, bool force ){int x = you.x_pos, y = you.y_pos;// default to whatever colour magic is todayif (colour == -1)colour = element_colour( EC_MAGIC );if (mon){if (!force && !player_monster_visible( mon ))return;x = mon->x;y = mon->y;}if (!see_grid( x, y ))return;const int drawx = x - you.x_pos + 18;const int drawy = y - you.y_pos + 9;if (drawx > 8 && drawx < 26 && drawy > 0 && drawy < 18){textcolor( colour );gotoxy( drawx, drawy );putch( SYM_ZAP );#ifdef UNIXupdate_screen();#endifdelay(50);}}
// special front function for zap_animation to interpret enchantment flavoursstatic void ench_animation( int flavour, const monsters *mon, bool force ){const int elem = (flavour == BEAM_HEALING) ? EC_HEAL :(flavour == BEAM_PAIN) ? EC_UNHOLY :(flavour == BEAM_DISPEL_UNDEAD) ? EC_HOLY :(flavour == BEAM_POLYMORPH) ? EC_MUTAGENIC :(flavour == BEAM_TELEPORT|| flavour == BEAM_BANISH|| flavour == BEAM_BLINK) ? EC_WARP: EC_ENCHANT;zap_animation( element_colour( elem ), mon, force );}
pbolt.obviousEffect = false;pbolt.isBeam = false; // default for all beams.pbolt.isTracer = false; // default for all player beams
pbolt.obvious_effect = false;pbolt.is_beam = false; // default for all beams.pbolt.is_tracer = false; // default for all player beams
snprintf( info, INFO_SIZE, "%s%s (%d,%d) to (%d,%d): ty=%d col=%d flav=%d hit=%d dam=%dd%d",(pbolt.isBeam) ? "beam" : "missile",(pbolt.isTracer) ? " tracer" : "",pbolt.source_x, pbolt.source_y,pbolt.target_x, pbolt.target_y,pbolt.type, pbolt.colour, pbolt.flavour,pbolt.hit, pbolt.damage.num, pbolt.damage.size );mpr( info, MSGCH_DIAGNOSTICS );
if (pbolt.flavour != BEAM_LINE_OF_SIGHT){mprf( MSGCH_DIAGNOSTICS,"%s%s%s (%d,%d) to (%d,%d): ty=%d col=%d flav=%d hit=%d dam=%dd%d",(pbolt.is_beam) ? "beam" : "missile",(pbolt.is_explosion) ? "*" :(pbolt.is_big_cloud) ? "+" : "",(pbolt.is_tracer) ? " tracer" : "",pbolt.source_x, pbolt.source_y,pbolt.target_x, pbolt.target_y,pbolt.type, pbolt.colour, pbolt.flavour,pbolt.hit, pbolt.damage.num, pbolt.damage.size );}
pbolt.aimedAtFeet = false;pbolt.msgGenerated = false;pbolt.isExplosion = false;roundY = false;roundX = false;
pbolt.aimed_at_feet =(pbolt.target_x == pbolt.source_x) &&(pbolt.target_y == pbolt.source_y);pbolt.msg_generated = false;ray_def ray;
// check for aim at feetif (dx == 0 && dy == 0){pbolt.aimedAtFeet = true;stepx = 0;stepy = 0;tx = pbolt.source_x;ty = pbolt.source_y;}else{if (abs(dx) >= abs(dy)){stepx = (dx > 0) ? 100 : -100;stepy = 100 * dy / (abs(dx));roundY = true;}else{stepy = (dy > 0) ? 100 : -100;stepx = 100 * dx / (abs(dy));roundX = true;}}
if ( !pbolt.aimed_at_feet )ray.advance();
nx = wx + stepx;ny = wy + stepy;if (roundY){tx = nx / 100;ty = (ny + 50) / 100;}if (roundX){ty = ny / 100;tx = (nx + 50) / 100;}// check that tx, ty are valid. If not, set to last// x,y and break.if (tx < 0 || tx >= GXM || ty < 0 || ty >= GYM){tx = lx;ty = ly;break;}
tx = ray.x();ty = ray.y();
// BEGIN fuzzy line algorithmfuzzyOK = fuzzyLine(nx,ny,tx,ty,lx,ly,stepx,stepy,roundX,roundY);if (!fuzzyOK){// BEGIN bounce caseif (!isBouncy(pbolt)){tx = lx;ty = ly;break; // breaks from line tracing}sideBlocked = false;topBlocked = false;// BOUNCE -- guaranteed to return reasonable tx, ty.// if it doesn't, we'll quit in the next if stmt anyway.if (roundY){if ( grd[lx + stepx / 100][ly] < MINMOVE)sideBlocked = true;if (dy != 0){if ( grd[lx][ly + (stepy>0?1:-1)] < MINMOVE)topBlocked = true;}
// BEGIN bounce caseif (!isBouncy(pbolt, grd[tx][ty])) {ray.regress();tx = ray.x();ty = ray.y();break; // breaks from line tracing}
rangeRemaining -= bounce(stepx, stepy, wx, wy, nx, ny,lx, ly, tx, ty, topBlocked, sideBlocked);}else{if ( grd[lx][ly + stepy / 100] < MINMOVE)sideBlocked = true;
// bouncedo {ray.regress();ray.advance_and_bounce();--rangeRemaining;} while ( rangeRemaining > 0 &&grid_is_solid(grd[ray.x()][ray.y()]) );
// in this case, don't affect the cell - players// /monsters have no chance to dodge or block such// a beam, and we want to avoid silly messages.
// in this case, don't affect the cell - players and// monsters have no chance to dodge or block such// a beam, and we want to avoid silly messages.
hurted = 0;}else{// early out for tracer/no side effectsif (!doFlavouredEffects)return (hurted);if (mons_res_poison( monster ) <= 0)poison_monster( monster, YOU_KILL(pbolt.thrower) );if (one_chance_in( 3 + 2 * mons_res_negative_energy(monster) )){struct bolt beam;beam.flavour = BEAM_SLOW;mons_ench_f2( monster, beam );}}break;
if (mons_holiness(monster->type) == MH_NATURAL|| mons_holiness(monster->type) == MH_NONLIVING|| mons_holiness(monster->type) == MH_PLANT|| mons_holiness(monster->type) == MH_HOLY)
if (mons_is_unholy( monster )){if (doFlavouredEffects)simple_monster_message( monster, " writhes in agony!" );hurted = (hurted * 3) / 2;}else if (!mons_is_evil( monster ))
// degree is ignored.static void slow_monster(monsters *mon, int degree){bolt beam;beam.flavour = BEAM_SLOW;mons_ench_f2(mon, beam);}// Returns true if the curare killed the monster.bool curare_hits_monster( const bolt &beam,monsters *monster,bool fromPlayer,int levels ){const bool res_poison = mons_res_poison(monster);bool mondied = false;poison_monster(monster, fromPlayer, levels, false);if (!mons_res_asphyx(monster)){int hurted = roll_dice(2, 6);// Note that the hurtage is halved by poison resistance.if (res_poison)hurted /= 2;if (hurted){simple_monster_message(monster, " appears to choke.");if ((monster->hit_points -= hurted) < 1){const int thrower = YOU_KILL(beam.thrower) ?KILL_YOU_MISSILE : KILL_MON_MISSILE;monster_die(monster, thrower, beam.beam_source);mondied = true;}}if (!mondied)slow_monster(monster, levels);}// Deities take notice.if (fromPlayer)did_god_conduct( DID_POISON, 5 + random2(3) );return (mondied);}
* note that beam properties must be set, as the tracer will take them* into account, as well as the monster's intelligence.
* note that beam properties must be set, as the tracer will take them* into account, as well as the monster's intelligence.
// can always see one square awayif (dist <= 1)return (true);// currently we limit the range to 8if (dist > MONSTER_LOS_RANGE)return (false);// Note that we are guaranteed to be within the player LOS range,// so fallback is unnecessary.ray_def ray;return find_ray( sx, sy, tx, ty, false, ray );}
// at present, only non-enchantment eletrcical beams bounce.if (beam.beam_name[0] != '0' && beam.flavour == BEAM_ELECTRICITY)return (true);
if (beam.name[0] == '0')return false;if (beam.flavour == BEAM_ELECTRICITY && gridtype != DNGN_METAL_WALL)return true;if ( (beam.flavour == BEAM_FIRE || beam.flavour == BEAM_COLD) &&(gridtype == DNGN_GREEN_CRYSTAL_WALL) )return true;
if (strcmp(beam.beam_name, "orb of electricity") == 0|| strcmp(beam.beam_name, "metal orb") == 0|| strcmp(beam.beam_name, "great blast of cold") == 0)
if (beam.name == "orb of electricity"|| beam.name == "metal orb"|| beam.name == "great blast of cold")
case MI_NEEDLE: chance = 6 + you.skills[SK_THROWING] / 6; break;case MI_STONE: chance = 3 + you.skills[SK_THROWING] / 4; break;case MI_DART: chance = 2 + you.skills[SK_THROWING] / 6; break;case MI_ARROW: chance = 2 + you.skills[SK_THROWING] / 4; break;case MI_BOLT: chance = 2 + you.skills[SK_THROWING] / 5; break;
case MI_NEEDLE:chance = (get_ammo_brand(*item) == SPMSL_CURARE? 3 : 6);break;case MI_STONE: chance = 4; break;case MI_DART: chance = 3; break;case MI_ARROW: chance = 4; break;case MI_BOLT: chance = 4; break;
}// somewhat complicated BOUNCE function// returns # of times beam bounces during routine (usually 1)//// step 1 is always the step value from the stepping direction.#define B_HORZ 1#define B_VERT 2#define B_BOTH 3static int bounce(int &step1, int &step2, int w1, int w2, int &n1, int &n2,int l1, int l2, int &t1, int &t2, bool topBlocked, bool sideBlocked){int bounceType = 0;int bounceCount = 1;if (topBlocked) bounceType = B_HORZ;if (sideBlocked) bounceType = B_VERT;if (topBlocked && sideBlocked){// check for veritcal bounce onlyif ((w2 + step2 - 50)/100 == (w2 - 50)/100)bounceType = B_VERT;elsebounceType = B_BOTH;}switch (bounceType){case B_VERT: // easiestn1 = w1;n2 = w2 + step2;step1 = -step1;t1 = n1 / 100;t2 = (n2 + 50)/100;// check topif (t2 != n2/100 && topBlocked)t2 = n2/100;break;case B_HORZ: // a little trickyif (step2 > 0)n2 = (100 + 200*(w2/100)) - (w2 + step2);elsen2 = (100 + 200*((w2 - 50)/100)) - (w2 + step2);n1 = w1 + step1;t1 = n1 /100;t2 = (n2 + 50) / 100;step2 = -step2;break;case B_BOTH:// vertical:n1 = w1;t1 = l1;t2 = l2;// horizontal:if (step2 > 0)n2 = (100 + 200*(w2/100)) - (w2 + step2);elsen2 = (100 + 200*((w2 - 50)/100)) - (w2 + step2);// reverse both directionsstep1 =- step1;step2 =- step2;bounceCount = 2;break;default:bounceCount = 0;break;}return (bounceCount);
static bool fuzzyLine(int nx, int ny, int &tx, int &ty, int lx, int ly,int stepx, int stepy, bool roundX, bool roundY)
// Returns true if the beam hits the player, fuzzing the beam if necessary// for monsters without see invis firing tracers at the player.static bool found_player(const bolt &beam, int x, int y)
bool fuzzyOK = false;int fx, fy; // fuzzy x,y// BEGIN fuzzy line algorithmfx = tx;fy = ty;if (roundY){// try upfy = (ny + 100) / 100;// check for monotonicif (fy != ty && ((stepy>0 && fy >= ly)|| (stepy<0 && fy <= ly)))fuzzyOK = true;// see if up try is blockedif (fuzzyOK && grd[tx][fy] < MINMOVE)fuzzyOK = false;// try downif (!fuzzyOK)fy = ny / 100;// check for monotonicif (fy != ty && ((stepy>0 && fy >= ly)|| (stepy<0 && fy <= ly)))fuzzyOK = true;if (fuzzyOK && grd[tx][fy] < MINMOVE)fuzzyOK = false;}if (roundX){// try upfx = (nx + 100) / 100;// check for monotonicif (fx != tx && ((stepx>0 && fx >= lx)|| (stepx<0 && fx <= lx)))fuzzyOK = true;// see if up try is blockedif (fuzzyOK && grd[fx][ty] < MINMOVE)fuzzyOK = false;// try downif (!fuzzyOK)fx = nx / 100;// check for monotonicif (fx != tx && ((stepx>0 && fx >= lx)|| (stepx<0 && fx <= lx)))fuzzyOK = true;if (fuzzyOK && grd[fx][ty] < MINMOVE)fuzzyOK = false;}// END fuzzy line algorithmif (fuzzyOK){tx = fx;ty = fy;}
const bool needs_fuzz = beam.is_tracer && !beam.can_see_invis&& you.invis;const int dist = needs_fuzz? 2 : 0;
// affects a single cell.// returns the amount of extra range 'used up' by this beam// during the affectation.//// pseudo-code://// 1. If wall, and wall affecting non-tracer, affect the wall.// 1b. If for some reason the wall-affect didn't make it into// a non-wall, return affect_wall()// 2. for non-tracers, produce cloud effects affect_place_clouds()// 3. if cell holds player, affect player affect_player()// 4. if cell holds monster, affect monster affect_monster()// 5. return range used affectation.static int affect(struct bolt &beam, int x, int y)
int affect(struct bolt &beam, int x, int y)
if (beam_term_on_target(beam) && !beam.isExplosion)
// Done this way so that poison blasts affect the target once (via// place_cloud) and explosion spells only affect the target once// (during the explosion phase, not an initial hit during the// beam phase).if (!beam.is_big_cloud&& (!beam.is_explosion || beam.in_explosion_phase)){rangeUsed += affect_player( beam );}if (beam_term_on_target(beam, x, y))
if (targ_grid == DNGN_ORCISH_IDOL || (targ_grid >= DNGN_SILVER_STATUE&& targ_grid <= DNGN_STATUE_39))
if (targ_grid == DNGN_ORCISH_IDOL|| targ_grid == DNGN_SILVER_STATUE|| targ_grid == DNGN_GRANITE_STATUE|| targ_grid == DNGN_ORANGE_CRYSTAL_STATUE)
ouch( dam, beam.beam_source, KILLED_BY_WILD_MAGIC, beam.aux_source );
ouch( dam, beam.beam_source, KILLED_BY_WILD_MAGIC,beam.aux_source.c_str() );}}// [ds] Apply a fuzz if the monster lacks see invisible and is trying to target// an invisible player. This makes invisibility slightly more powerful.static bool fuzz_invis_tracer(bolt &beem){// Did the monster have a rough idea of where you are?int dist = grid_distance(beem.target_x, beem.target_y,you.x_pos, you.y_pos);// No, ditch this.if (dist > 2)return (false);// Apply fuzz now.int xfuzz = random_range(-2, 2),yfuzz = random_range(-2, 2);const int newx = beem.target_x + xfuzz,newy = beem.target_y + yfuzz;if (in_bounds(newx, newy)&& (newx != beem.source_x|| newy != beem.source_y)){beem.target_x = newx;beem.target_y = newy;
// XXX: note the cheat to allow for ME_ALERT to target the player...// replace this with a time since alert system, rather than just// peeking to see if the character is still there. -- bwrif (beam.canSeeInvis || !you.invis|| (you.x_pos == beam.target_x && you.y_pos == beam.target_y))
if (beam.can_see_invis || !you.invis|| fuzz_invis_tracer(beam))
const int hit = random2( beam.hit * 5+ 10 * you.shield_blocks * you.shield_blocks );
// [dshaligram] beam.hit multiplier lowered to 3 - was 5.// In favour of blocking, dex multiplier changed to .25// (was .2), added shield skill into the equation with a// skill bump.const int hit = random2( beam.hit * 3+ 5 * you.shield_blocks * you.shield_blocks );
snprintf( info, INFO_SIZE, "The %s %s you!",beam.beam_name, (beam.isExplosion ? "engulfs" : "hits") );mpr( info );
const bool engulfs = (beam.is_explosion || beam.is_big_cloud);mprf( "The %s %s you!",beam.name.c_str(), (engulfs) ? "engulfs" : "hits" );
// simple cases for scroll burnsif (beam.flavour == BEAM_LAVA || stricmp(beam.beam_name, "hellfire") == 0)scrolls_burn( burn_power, OBJ_SCROLLS );
// simple cases for scroll burns FIXMEif (beam.flavour == BEAM_LAVA || beam.name == "hellfire")expose_player_to_element(BEAM_LAVA, burn_power);
}}else if ((beam.flavour == BEAM_DISINTEGRATION || beam.flavour == BEAM_NUKE)&& mons_is_statue(mons_type)){if (!silenced(you.x_pos, you.y_pos)){if (!see_grid( mon->x, mon->y ))mpr("You hear a hideous screaming!", MSGCH_SOUND);elsempr("The statue screams as its substance crumbles away!",MSGCH_SOUND);}else{if (see_grid( mon->x, mon->y ))mpr("The statue twists and shakes as its substance ""crumbles away!");
if (mons_friendly(mon) && YOU_KILL(beam.thrower))naughty(NAUGHTY_ATTACK_FRIEND, 5);
if (YOU_KILL( beam.thrower )){if (mons_friendly( mon ))did_god_conduct( DID_ATTACK_FRIEND, 5 );if (mons_holiness( mon ) == MH_HOLY)did_god_conduct( DID_ATTACK_HOLY, mon->hit_dice );}
// For example, if a fire giant (power 16) threw a// fireball at another fire giant, and it only took// 1/3 damage, then power of 5 would be applied to
// For example, if a fire giant (power 16) threw a// fireball at another fire giant, and it only took// 1/3 damage, then power of 5 would be applied to
// but did you do enough damage to piss them off?if (hurt_final > mon->hit_dice / 3){naughty(NAUGHTY_ATTACK_FRIEND, 5);behaviour_event( mon, ME_ANNOY, MHITYOU );}
if (mons_friendly(mon))did_god_conduct( DID_ATTACK_FRIEND, 5 );if (mons_holiness( mon ) == MH_HOLY)did_god_conduct( DID_ATTACK_HOLY, mon->hit_dice );
strcpy(info, "The ");strcat(info, beam.beam_name);strcat(info, beam.isExplosion?" engulfs ":" hits ");if (player_monster_visible( &menv[tid] ))strcat(info, ptr_monam(mon, DESC_NOCAP_THE));elsestrcat(info, "something");strcat(info, ".");mpr(info);
mprf("The %s %s %s.",beam.name.c_str(),engulfs? "engulfs" : "hits",player_monster_visible(&menv[tid])?ptr_monam(mon, DESC_NOCAP_THE): "something");
if (mons_is_mimic( mon->type ))
bool wake_mimic = true;if (beam.name.find("curare") != std::string::npos){if (curare_hits_monster( beam, mon, YOU_KILL(beam.thrower), 2 ))wake_mimic = false;}if (wake_mimic && mons_is_mimic( mon->type ))
}////////////////////////////////////////////////////////////////////////////// bolt// A constructor for bolt to help guarantee that we start clean (this has// caused way too many bugs). Putting it here since there's no good place to// put it, and it doesn't do anything other than initialize it's members.//// TODO: Eventually it'd be nice to have a proper factory for these things// (extended from setup_mons_cast() and zapping() which act as limited ones).bolt::bolt() : range(0), rangeMax(0), type(SYM_ZAP), colour(BLACK),flavour(BEAM_MAGIC), source_x(0), source_y(0), damage(0,0),ench_power(0), hit(0), target_x(0), target_y(0),thrower(KILL_MISC), ex_size(0), beam_source(MHITNOT), name(),is_beam(false), is_explosion(false), is_big_cloud(false),is_enchant(false), is_energy(false), is_launched(false),is_thrown(false), target_first(false), aimed_at_spot(false),aux_source(), obvious_effect(false), fr_count(0), foe_count(0),fr_power(0), foe_power(0), is_tracer(false),aimed_at_feet(false), msg_generated(false),in_explosion_phase(false), smart_monster(false),can_see_invis(false), is_friendly(false), foe_ratio(0){ }void bolt::set_target(const dist &d){if (!d.isValid)return;target_x = d.tx;target_y = d.ty;if (d.isEndpoint)aimed_at_spot = true;
void (*viewwindow) (char, bool);/* these are all defined in view.cc: */extern unsigned char (*mapch) (unsigned char);extern unsigned char (*mapch2) (unsigned char);unsigned char mapchar(unsigned char ldfk);unsigned char mapchar2(unsigned char ldfk);unsigned char mapchar3(unsigned char ldfk);unsigned char mapchar4(unsigned char ldfk);/*Function pointers are used to make switching between Unix and DOS char setspossible as a runtime option (command-line -c)*/// these two are defined in view.cc. What does the player look like?// (changed for shapechanging)extern unsigned char your_sign;extern unsigned char your_colour;
static void move_player(char move_x, char move_y);static void open_door(char move_x, char move_y);
static void move_player(int move_x, int move_y);static void open_door(int move_x, int move_y, bool check_confused = true);static void start_running( int dir, int mode );static void close_door(int move_x, int move_y);static void init_io();static void prep_input();static void input();static void middle_input();static void world_reacts();static command_type get_next_cmd();typedef int keycode_type;static keycode_type get_next_keycode();static command_type keycode_to_command( keycode_type key );
// This function creates "equivalence classes" so that undiscovered// traps and secret doors aren't running stopping points.static char base_grid_type( char grid )
// Set up the running variables for the current run.static void start_running( int dir, int mode )
// Or secret doors (which currently always look like rock walls):if (grid == DNGN_SECRET_DOOR)return (DNGN_ROCK_WALL);
static bool recharge_rod( item_def &rod, bool wielded ){if (!item_is_rod(rod) || rod.plus >= rod.plus2 || !enough_mp(1, true))return (false);
// Set up the front facing array for detecting terrain based stopsstatic void set_run_check( int index, int dir ){you.run_check[index].dx = Compass[dir].x;you.run_check[index].dy = Compass[dir].y;
int rate = ((charge + 1) * ROD_CHARGE_MULT) / 10;rate *= (10 + skill_bump( SK_EVOCATIONS ));rate = div_rand_round( rate, 100 );
// Get the compass point to the left/right of intended travel:const int left = (dir - 1 < 0) ? 7 : (dir - 1);const int right = (dir + 1 > 7) ? 0 : (dir + 1);// Record the direction and starting tile type for later reference:set_run_check( 0, left );set_run_check( 1, dir );set_run_check( 2, right );
return (true);
if (env.cgrid[you.x_pos + you.run_x][you.y_pos + you.run_y] != EMPTY_CLOUD)return (true);if (mgrd[you.x_pos + you.run_x][you.y_pos + you.run_y] != NON_MONSTER)return (true);for (int i = 0; i < 3; i++)
const int wielded = you.equip[EQ_WEAPON];if (wielded != -1)
you.time_taken = player_speed();#ifdef UNIXupdate_screen();#elsewindow( 1, 1, 80, get_number_of_lines() );#endiftextcolor(LIGHTGREY);set_redraw_status( REDRAW_LINE_2_MASK | REDRAW_LINE_3_MASK );print_stats();
if ( you_are_delayed() ) {world_reacts();return;}
else{#ifdef STASH_TRACKINGif (Options.stash_tracking)stashes.update_visible_stashes(Options.stash_tracking == STM_ALL?StashTracker::ST_AGGRESSIVE :StashTracker::ST_PASSIVE);#endifhandle_delay();
if (you_are_delayed())keyin = '.';else if (you.activity){keyin = 128;you.turn_is_over = 0;perform_activity();}else{if (you.running < 0) // Travel and exploretravel(&keyin, &move_x, &move_y);
// [dshaligram] If get_next_cmd encountered a Lua macro binding, your turn// may be ended by the first invoke of the macro.if (!you.turn_is_over && cmd != CMD_NEXT_CMD)process_command( cmd );
if (you.running > 0){keyin = 128;move_x = you.run_x;move_y = you.run_y;if (kbhit()){stop_running();goto gutch;}if (you.run_x == 0 && you.run_y == 0){you.running--;keyin = '.';}}else if (!you.running){
if ( you.turn_is_over ) {
gutch:flush_input_buffer( FLUSH_BEFORE_COMMAND );keyin = getch_with_command_macros();}
static int toggle_flag( bool* flag, const char* flagname ) {char buf[INFO_SIZE];*flag = !(*flag);sprintf( buf, "%s is now %s.", flagname,(*flag) ? "on" : "off" );mpr(buf);return *flag;}
mesclr();
static void go_upstairs() {if (grd[you.x_pos][you.y_pos] == DNGN_ENTER_SHOP) {shop();return;}else if ((grd[you.x_pos][you.y_pos] < DNGN_STONE_STAIRS_UP_I|| grd[you.x_pos][you.y_pos] > DNGN_ROCK_STAIRS_UP)&& (grd[you.x_pos][you.y_pos] < DNGN_RETURN_FROM_ORCISH_MINES|| grd[you.x_pos][you.y_pos] >= 150)) {mpr( "You can't go up here!" );return;}
#ifdef UNIX// Kludging running and opening as two character sequences// for Unix systems. This is an easy way out... all the// player has to do is find a termcap and numlock setting// that will get curses the numbers from the keypad. This// will hopefully be easy.
tag_followers(); // only those beside us right now can followstart_delay( DELAY_ASCENDING_STAIRS,1 + (you.burden_state > BS_UNENCUMBERED) );}
// Translate keypad codes into command enumskeyin = key_to_command(keyin);#else// Old DOS keypad supportif (keyin == 0) // ALT also works - see ..\KEYTEST.CPP{keyin = getch();switch (keyin){case 'O': move_x = -1; move_y = 1; break;case 'P': move_x = 0; move_y = 1; break;case 'I': move_x = 1; move_y = -1; break;case 'H': move_x = 0; move_y = -1; break;case 'G': move_x = -1; move_y = -1; break;case 'K': move_x = -1; move_y = 0; break;case 'Q': move_x = 1; move_y = 1; break;case 'M': move_x = 1; move_y = 0; break;
if ((grd[you.x_pos][you.y_pos] < DNGN_ENTER_LABYRINTH|| grd[you.x_pos][you.y_pos] > DNGN_ROCK_STAIRS_DOWN)&& grd[you.x_pos][you.y_pos] != DNGN_ENTER_HELL&& ((grd[you.x_pos][you.y_pos] < DNGN_ENTER_DIS|| grd[you.x_pos][you.y_pos] > DNGN_TRANSIT_PANDEMONIUM)&& grd[you.x_pos][you.y_pos] != DNGN_STONE_ARCH)&& !(grd[you.x_pos][you.y_pos] >= DNGN_ENTER_ORCISH_MINES&& grd[you.x_pos][you.y_pos] < DNGN_RETURN_FROM_ORCISH_MINES)) {mpr( "You can't go down here!" );return;}
case 119: open_door(-1, -1); move_x = 0; move_y = 0; break;case 141: open_door( 0, -1); move_x = 0; move_y = 0; break;case 132: open_door( 1, -1); move_x = 0; move_y = 0; break;case 116: open_door( 1, 0); move_x = 0; move_y = 0; break;case 118: open_door( 1, 1); move_x = 0; move_y = 0; break;case 145: open_door( 0, 1); move_x = 0; move_y = 0; break;case 117: open_door(-1, 1); move_x = 0; move_y = 0; break;case 115: open_door(-1, 0); move_x = 0; move_y = 0; break;
tag_followers(); // only those beside us right now can followstart_delay( DELAY_DESCENDING_STAIRS,1 + (you.burden_state > BS_UNENCUMBERED),you.your_level );}
case 76:case 'S':keyin = '.';goto get_keyin_again;}
static void experience_check() {snprintf( info, INFO_SIZE, "You are a level %d %s %s.",you.experience_level,species_name(you.species,you.experience_level),you.class_name);mpr(info);
keyin = 128;}#endif}
if (you.experience_level < 27) {int xp_needed = (exp_needed(you.experience_level+2)-you.experience)+1;snprintf( info, INFO_SIZE,"Level %d requires %ld experience (%d point%s to go!)",you.experience_level + 1,exp_needed(you.experience_level + 2) + 1,xp_needed,(xp_needed > 1) ? "s" : "");mpr(info);
#ifndef UNIXget_keyin_again:#endif //jmf: just stops an annoying gcc warning
if (you.real_time != -1) {const time_t curr = you.real_time + (time(NULL) - you.start_time);char buff[200];
if (is_userfunction(keyin)){run_macro(get_userfunction(keyin));keyin = 128;}switch (keyin){case CONTROL('Y'):case CMD_OPEN_DOOR_UP_RIGHT:open_door(-1, -1); move_x = 0; move_y = 0; break;
make_time_string( curr, buff, sizeof(buff) );
case CONTROL('U'):case CMD_OPEN_DOOR_UP_LEFT:open_door( 1, -1); move_x = 0; move_y = 0; break;
mpr( info );}#ifdef DEBUG_DIAGNOSTICSif (wearing_amulet(AMU_THE_GOURMAND))mprf(MSGCH_DIAGNOSTICS, "Gourmand charge: %d",you.duration[DUR_GOURMAND]);#endif}
case CONTROL('H'):case CMD_OPEN_DOOR_LEFT:open_door(-1, 0); move_x = 0; move_y = 0; break;
case CMD_OPEN_DOOR_UP_RIGHT: open_door(-1, -1); break;case CMD_OPEN_DOOR_UP: open_door( 0, -1); break;case CMD_OPEN_DOOR_UP_LEFT: open_door( 1, -1); break;case CMD_OPEN_DOOR_RIGHT: open_door( 1, 0); break;case CMD_OPEN_DOOR_DOWN_RIGHT: open_door( 1, 1); break;case CMD_OPEN_DOOR_DOWN: open_door( 0, 1); break;case CMD_OPEN_DOOR_DOWN_LEFT: open_door(-1, 1); break;case CMD_OPEN_DOOR_LEFT: open_door(-1, 0); break;
case 'b': case CMD_MOVE_DOWN_LEFT: move_x = -1; move_y = 1; break;case 'j': case CMD_MOVE_DOWN: move_y = 1; move_x = 0; break;case 'u': case CMD_MOVE_UP_RIGHT: move_x = 1; move_y = -1; break;case 'k': case CMD_MOVE_UP: move_y = -1; move_x = 0; break;case 'y': case CMD_MOVE_UP_LEFT: move_y = -1; move_x = -1; break;case 'h': case CMD_MOVE_LEFT: move_x = -1; move_y = 0; break;case 'n': case CMD_MOVE_DOWN_RIGHT: move_y = 1; move_x = 1; break;case 'l': case CMD_MOVE_RIGHT: move_x = 1; move_y = 0; break;
case CMD_MOVE_DOWN_LEFT: move_player(-1, 1); break;case CMD_MOVE_DOWN: move_player( 0, 1); break;case CMD_MOVE_UP_RIGHT: move_player( 1, -1); break;case CMD_MOVE_UP: move_player( 0, -1); break;case CMD_MOVE_UP_LEFT: move_player(-1, -1); break;case CMD_MOVE_LEFT: move_player(-1, 0); break;case CMD_MOVE_DOWN_RIGHT: move_player( 1, 1); break;case CMD_MOVE_RIGHT: move_player( 1, 0); break;
#ifdef UNIXif (!running && !opening)start_running( RDIR_REST, 100 );else{search_around();move_x = 0;move_y = 0;you.turn_is_over = 1;}#endif
case CMD_RUN_DOWN_LEFT:start_running( RDIR_DOWN_LEFT, RMODE_START );break;case CMD_RUN_DOWN:start_running( RDIR_DOWN, RMODE_START );break;case CMD_RUN_UP_RIGHT:start_running( RDIR_UP_RIGHT, RMODE_START );break;case CMD_RUN_UP:start_running( RDIR_UP, RMODE_START );break;case CMD_RUN_UP_LEFT:start_running( RDIR_UP_LEFT, RMODE_START );break;case CMD_RUN_LEFT:start_running( RDIR_LEFT, RMODE_START );break;case CMD_RUN_DOWN_RIGHT:start_running( RDIR_DOWN_RIGHT, RMODE_START );break;case CMD_RUN_RIGHT:start_running( RDIR_RIGHT, RMODE_START );
case 'B': case CMD_RUN_DOWN_LEFT:start_running( RDIR_DOWN_LEFT, 2 ); break;case 'J': case CMD_RUN_DOWN:start_running( RDIR_DOWN, 2 ); break;case 'U': case CMD_RUN_UP_RIGHT:start_running( RDIR_UP_RIGHT, 2 ); break;case 'K': case CMD_RUN_UP:start_running( RDIR_UP, 2 ); break;case 'Y': case CMD_RUN_UP_LEFT:start_running( RDIR_UP_LEFT, 2 ); break;
case 'L': case CMD_RUN_RIGHT:start_running( RDIR_RIGHT, 2 ); break;#ifdef UNIX// taken care of via key -> command mapping#else// Old DOS keypad supportcase '1': start_running( RDIR_DOWN_LEFT, 2 ); break;case '2': start_running( RDIR_DOWN, 2 ); break;case '9': start_running( RDIR_UP_RIGHT, 2 ); break;case '8': start_running( RDIR_UP, 2 ); break;case '7': start_running( RDIR_UP_LEFT, 2 ); break;case '4': start_running( RDIR_LEFT, 2 ); break;case '3': start_running( RDIR_DOWN_RIGHT, 2 ); break;case '6': start_running( RDIR_RIGHT, 2 ); break;case '5': start_running( RDIR_REST, 100 ); break;#endifcase CONTROL('A'):case CMD_TOGGLE_AUTOPICKUP:autopickup_on = !autopickup_on;strcpy(info, "Autopickup is now ");strcat(info, (autopickup_on) ? "on" : "off");strcat(info, ".");mpr(info);
case CMD_TOGGLE_NOFIZZLE:toggle_flag( &Options.fizzlecheck_on, "Fizzle confirmation" );break;case CMD_MAKE_NOTE:make_user_note();
case '<':case CMD_GO_UPSTAIRS:if (grd[you.x_pos][you.y_pos] == DNGN_ENTER_SHOP){shop();break;}else if ((grd[you.x_pos][you.y_pos] < DNGN_STONE_STAIRS_UP_I|| grd[you.x_pos][you.y_pos] > DNGN_ROCK_STAIRS_UP)&& (grd[you.x_pos][you.y_pos] < DNGN_RETURN_FROM_ORCISH_MINES|| grd[you.x_pos][you.y_pos] >= 150)){mpr( "You can't go up here!" );break;}
tag_followers(); // only those beside us right now can followstart_delay( DELAY_ASCENDING_STAIRS,1 + (you.burden_state > BS_UNENCUMBERED) );break;
case CMD_GO_UPSTAIRS: go_upstairs(); break;case CMD_GO_DOWNSTAIRS: go_downstairs(); break;case CMD_DISPLAY_OVERMAP: display_overmap(); break;case CMD_OPEN_DOOR: open_door(0, 0); break;case CMD_CLOSE_DOOR: close_door(0, 0); break;
case '>':case CMD_GO_DOWNSTAIRS:if ((grd[you.x_pos][you.y_pos] < DNGN_ENTER_LABYRINTH|| grd[you.x_pos][you.y_pos] > DNGN_ROCK_STAIRS_DOWN)&& grd[you.x_pos][you.y_pos] != DNGN_ENTER_HELL&& ((grd[you.x_pos][you.y_pos] < DNGN_ENTER_DIS|| grd[you.x_pos][you.y_pos] > DNGN_TRANSIT_PANDEMONIUM)&& grd[you.x_pos][you.y_pos] != DNGN_STONE_ARCH)&& !(grd[you.x_pos][you.y_pos] >= DNGN_ENTER_ORCISH_MINES&& grd[you.x_pos][you.y_pos] < DNGN_RETURN_FROM_ORCISH_MINES)){mpr( "You can't go down here!" );break;}tag_followers(); // only those beside us right now can followstart_delay( DELAY_DESCENDING_STAIRS,1 + (you.burden_state > BS_UNENCUMBERED),you.your_level );break;case 'O':case CMD_DISPLAY_OVERMAP:display_overmap();break;case 'o':case CMD_OPEN_DOOR:open_door(0, 0);break;case 'c':case CMD_CLOSE_DOOR:close_door(0, 0);break;case 'd':
case 'I':case CMD_OBSOLETE_INVOKE:// We'll leave this message in for a while. Eventually, this// might be some special for of inventory command, or perhaps// actual god invocations will be split to here from abilities. -- bwrmpr( "This command is now 'E'voke wielded item.", MSGCH_WARN );break;case 'E':
// [ds] Waypoints can be added from the level-map, and we need Ctrl+F for// nobler things. Who uses waypoints, anyway?// Update: Appears people do use waypoints. Reinstating, on CONTROL('W').// This means Ctrl+W is no longer a wizmode trigger, but there's// always '&'. :-)
// [ds] Waypoints can be added from the level-map, and we need// Ctrl+F for nobler things. Who uses waypoints, anyway?// Update: Appears people do use waypoints. Reinstating, on// CONTROL('W'). This means Ctrl+W is no longer a wizmode// trigger, but there's always '&'. :-)
snprintf( info, INFO_SIZE, "You are a level %d %s %s.", you.experience_level,species_name(you.species,you.experience_level), you.class_name);mpr(info);if (you.experience_level < 27){int xp_needed = (exp_needed(you.experience_level+2) - you.experience) + 1;snprintf( info, INFO_SIZE, "Level %d requires %ld experience (%d point%s to go!)",you.experience_level + 1,exp_needed(you.experience_level + 2) + 1,xp_needed,(xp_needed > 1) ? "s" : "");mpr(info);}else{mpr( "I'm sorry, level 27 is as high as you can go." );mpr( "With the way you've been playing, I'm surprised you got this far." );}if (you.real_time != -1){const time_t curr = you.real_time + (time(NULL) - you.start_time);char buff[200];make_time_string( curr, buff, sizeof(buff) );snprintf( info, INFO_SIZE, "Play time: %s (%ld turns)",buff, you.num_turns );mpr( info );}
experience_check();
// New Unix keypad stuffif (running){int dir = -1;// XXX: ugly hack to interface this with the new running code. -- bwrfor (int i = 0; i < 8; i++){if (Compass[i].x == move_x && Compass[i].y == move_y){dir = i;break;}}
update_screen();#elsewindow( 1, 1, 80, get_number_of_lines() );#endif
if (move_x != 0 || move_y != 0)move_player(move_x, move_y);else if (you.turn_is_over) // we did something other than move/attackdo_berserk_no_combat_penalty();
set_redraw_status( REDRAW_LINE_2_MASK | REDRAW_LINE_3_MASK );print_stats();}
viewwindow(1, false);return;}if (you.num_turns != -1)you.num_turns++;//if (random2(10) < you.skills [SK_TRAPS_DOORS] + 2) search_around();stealth = check_stealth();#if 0// too annoying for regular diagnosticssnprintf( info, INFO_SIZE, "stealth: %d", stealth );mpr( info, MSGCH_DIAGNOSTICS );#endifif (you.special_wield != SPWLD_NONE)special_wielded();if (one_chance_in(10)){// this is instantaneousif (player_teleport() > 0 && one_chance_in(100 / player_teleport()))you_teleport2( true );else if (you.level_type == LEVEL_ABYSS && one_chance_in(30))you_teleport2( false, true ); // to new area of the Abyss
if (you.duration[DUR_GOURMAND] < GOURMAND_MAX && coinflip())you.duration[DUR_GOURMAND]++;
if (you.duration[DUR_SHUGGOTH_SEED_RELOAD] > 0) //jmf: addedyou.duration[DUR_SHUGGOTH_SEED_RELOAD]--;if (you.duration[DUR_INFECTED_SHUGGOTH_SEED] > 1)you.duration[DUR_INFECTED_SHUGGOTH_SEED]--;else if (you.duration[DUR_INFECTED_SHUGGOTH_SEED] == 1){//jmf: use you.max_hp instead? or would that be too evil?you.duration[DUR_INFECTED_SHUGGOTH_SEED] = 0;mpr("A horrible thing bursts from your chest!", MSGCH_WARN);ouch(1 + you.hp / 2, 0, KILLED_BY_SHUGGOTH);make_shuggoth(you.x_pos, you.y_pos, 1 + you.hp / 2);}
int chance = 10 + you.mutation[MUT_BERSERK] * 25+ (wearing_amulet( AMU_RAGE ) ? 10 : 0)+ (player_has_spell( SPELL_BERSERKER_RAGE ) ? 5 : 0);
int chances[4];chances[0] = 10;chances[1] = you.mutation[MUT_BERSERK] * 25;chances[2] = (wearing_amulet( AMU_RAGE ) ? 10 : 0);chances[3] = (player_has_spell( SPELL_BERSERKER_RAGE ) ? 5 : 0);const char* reasons[4] = {"You struggle, and manage to stay standing.","Your mutated body refuses to collapse.","You feel your neck pulse as blood rushes through your body.","Your mind masters your body."};const int chance = chances[0] + chances[1] + chances[2] + chances[3];
if (you.berserk_penalty == NO_BERSERK_PENALTY|| (you.religion == GOD_TROG && you.piety > random2(150))|| !one_chance_in( chance ))
else if ( you.religion == GOD_TROG && you.piety > random2(150) &&!player_under_penance() )mpr("Trog's vigour flows through your veins.");else if ( !one_chance_in(chance) )
mpr("You are exhausted.");
// Survived the probabilistic check.// Figure out why.int cause = random2(chance); // philosophically speaking...int i;for ( i = 0; i < 4; ++i ){if ( cause < chances[i] ){// only print a reason if it actually existsif ( reasons[i][0] != 0 )mpr(reasons[i]);break;}elsecause -= chances[i];}if (i == 4)mpr("Oops. Couldn't find a reason. Well, lucky you.");
if (grd[you.x_pos][you.y_pos] == DNGN_LAVA|| grd[you.x_pos][you.y_pos] == DNGN_DEEP_WATER|| grd[you.x_pos][you.y_pos] == DNGN_SHALLOW_WATER){if (you.species == SP_MERFOLK&& grd[you.x_pos][you.y_pos] != DNGN_LAVA){mpr("You dive into the water and return to your normal form.");merfolk_start_swimming();}if (grd[you.x_pos][you.y_pos] != DNGN_SHALLOW_WATER)fall_into_a_pool(true, grd[you.x_pos][you.y_pos]);}
// re-enter the terrain:move_player_to_grid( you.x_pos, you.y_pos, false, true, true );
}/* Perhaps we should write functions like: update_repel_undead(),update_liquid_flames(), and so on. Even better, we could have avector of callback functions (or objects) which get installedat some point.*/static void world_reacts() {bool its_quiet; //jmf: for silence messagesif (you.num_turns != -1)you.num_turns++;//if (random2(10) < you.skills [SK_TRAPS_DOORS] + 2) search_around();stealth = check_stealth();
#if 0// too annoying for regular diagnosticssnprintf( info, INFO_SIZE, "stealth: %d", stealth );mpr( info, MSGCH_DIAGNOSTICS );#endifif (you.special_wield != SPWLD_NONE)special_wielded();if (one_chance_in(10)){// this is instantaneousif (player_teleport() > 0 && one_chance_in(100 / player_teleport()))you_teleport2( true );else if (you.level_type == LEVEL_ABYSS && one_chance_in(30))you_teleport2( false, true ); // to new area of the Abyss}if (env.cgrid[you.x_pos][you.y_pos] != EMPTY_CLOUD)in_a_cloud();decrement_durations();
// There used to be signs of intent to have statues as some sort// of more complex state machine... I'm boiling them down to bare// basics for now. -- bwrif (Visible_Statue[ STATUE_SILVER ]){interrupt_activity( AI_STATUE );if ((!you.invis && one_chance_in(3)) || one_chance_in(5)){char wc[30];weird_colours( random2(256), wc );snprintf(info, INFO_SIZE, "The silver statue's eyes glow %s.", wc);mpr( info, MSGCH_WARN );create_monster( summon_any_demon((coinflip() ? DEMON_COMMON: DEMON_LESSER)),ENCH_ABJ_V, BEH_HOSTILE,you.x_pos, you.y_pos,MHITYOU, 250 );}Visible_Statue[ STATUE_SILVER ] = 0;}
if (Visible_Statue[ STATUE_ORANGE_CRYSTAL ]){interrupt_activity( AI_STATUE );if ((!you.invis && coinflip()) || one_chance_in(4)){mpr("A hostile presence attacks your mind!", MSGCH_WARN);miscast_effect( SPTYP_DIVINATION, random2(15), random2(150), 100,"an orange crystal statue" );}Visible_Statue[ STATUE_ORANGE_CRYSTAL ] = 0;}
static command_type get_next_cmd() {if (Options.autoprayer_on && you.duration[DUR_PRAYER] == 0 &&just_autoprayed == false && you.religion != GOD_NO_GOD &&grid_altar_god( grd[you.x_pos][you.y_pos] ) == GOD_NO_GOD &&i_feel_safe()){just_autoprayed = true;about_to_autopray = false;return CMD_PRAY;}if ( just_autoprayed && you.duration[DUR_PRAYER] == 0 ){/* oops */mpr("Autoprayer failed, deactivating.", MSGCH_WARN);Options.autoprayer_on = false;}just_autoprayed = false;if ( Options.autoprayer_on && about_to_autopray &&you.religion != GOD_NO_GOD &&you.duration[DUR_PRAYER] == 0 ){mpr("Autoprayer not resuming prayer.", MSGCH_WARN);about_to_autopray = false;}#if DEBUG_DIAGNOSTICS// save hunger at start of round// for use with hunger "delta-meter" in output.ccyou.old_hunger = you.hunger;#endif#if DEBUG_ITEM_SCANdebug_item_scan();#endifkeycode_type keyin = get_next_keycode();if (is_userfunction(keyin)){run_macro(get_userfunction(keyin));return (CMD_NEXT_CMD);}return keycode_to_command(keyin);}/* for now, this is an extremely yucky hack */command_type keycode_to_command( keycode_type key ) {switch ( key ) {case 'b': return CMD_MOVE_DOWN_LEFT;case 'h': return CMD_MOVE_LEFT;case 'j': return CMD_MOVE_DOWN;case 'k': return CMD_MOVE_UP;case 'l': return CMD_MOVE_RIGHT;case 'n': return CMD_MOVE_DOWN_RIGHT;case 'u': return CMD_MOVE_UP_RIGHT;case 'y': return CMD_MOVE_UP_LEFT;case 'a': return CMD_USE_ABILITY;case 'c': return CMD_CLOSE_DOOR;case 'd': return CMD_DROP;case 'e': return CMD_EAT;case 'f': return CMD_FIRE;case 'g': return CMD_PICKUP;case 'i': return CMD_DISPLAY_INVENTORY;case 'm': return CMD_DISPLAY_SKILLS;case 'o': return CMD_OPEN_DOOR;case 'p': return CMD_PRAY;case 'q': return CMD_QUAFF;case 'r': return CMD_READ;case 's': return CMD_SEARCH;case 't': return CMD_THROW;case 'v': return CMD_EXAMINE_OBJECT;case 'w': return CMD_WIELD_WEAPON;case 'x': return CMD_LOOK_AROUND;case 'z': return CMD_ZAP_WAND;case 'B': return CMD_RUN_DOWN_LEFT;case 'H': return CMD_RUN_LEFT;case 'J': return CMD_RUN_DOWN;case 'K': return CMD_RUN_UP;case 'L': return CMD_RUN_RIGHT;case 'N': return CMD_RUN_DOWN_RIGHT;case 'U': return CMD_RUN_UP_RIGHT;case 'Y': return CMD_RUN_UP_LEFT;case 'A': return CMD_DISPLAY_MUTATIONS;case 'C': return CMD_EXPERIENCE_CHECK;case 'D': return CMD_BUTCHER;case 'E': return CMD_EVOKE;case 'F': return CMD_NO_CMD;case 'G': return CMD_NO_CMD;case 'I': return CMD_NO_CMD;case 'M': return CMD_MEMORISE_SPELL;case 'O': return CMD_DISPLAY_OVERMAP;case 'P': return CMD_WEAR_JEWELLERY;case 'Q': return CMD_QUIT;case 'R': return CMD_REMOVE_JEWELLERY;case 'S': return CMD_SAVE_GAME;case 'T': return CMD_REMOVE_ARMOUR;case 'V': return CMD_GET_VERSION;case 'W': return CMD_WEAR_ARMOUR;case 'X': return CMD_DISPLAY_MAP;case 'Z': return CMD_CAST_SPELL;case '.': return CMD_MOVE_NOWHERE;case '<': return CMD_GO_UPSTAIRS;case '>': return CMD_GO_DOWNSTAIRS;case '@': return CMD_DISPLAY_CHARACTER_STATUS;case '%': return CMD_RESISTS_SCREEN;case ',': return CMD_PICKUP;case ':': return CMD_MAKE_NOTE;case ';': return CMD_INSPECT_FLOOR;case '!': return CMD_SHOUT;case '^': return CMD_DISPLAY_RELIGION;case '#': return CMD_CHARACTER_DUMP;case '=': return CMD_ADJUST_INVENTORY;case '?': return CMD_DISPLAY_COMMANDS;case '~': return CMD_MACRO_ADD;case '&': return CMD_WIZARD;case '"': return CMD_LIST_JEWELLERY;case '{': return CMD_INSCRIBE_ITEM;case '[': return CMD_LIST_ARMOUR;case ']': return CMD_LIST_ARMOUR;case ')': return CMD_LIST_WEAPONS;case '(': return CMD_LIST_WEAPONS;case '\\': return CMD_DISPLAY_KNOWN_OBJECTS;case '\'': return CMD_WEAPON_SWAP;case '0': return CMD_NO_CMD;#ifdef UNIXcase '1': return CMD_MOVE_DOWN_LEFT;case '2': return CMD_MOVE_DOWN;case '3': return CMD_MOVE_DOWN_RIGHT;case '4': return CMD_MOVE_LEFT;case '5': return CMD_REST;case '6': return CMD_MOVE_RIGHT;case '7': return CMD_MOVE_UP_LEFT;case '8': return CMD_MOVE_UP;case '9': return CMD_MOVE_UP_RIGHT;#elsecase '1': return CMD_RUN_DOWN_LEFT;case '2': return CMD_RUN_DOWN;case '3': return CMD_RUN_DOWN_RIGHT;case '4': return CMD_RUN_LEFT;case '5': return CMD_REST;case '6': return CMD_RUN_RIGHT;case '7': return CMD_RUN_UP_LEFT;case '8': return CMD_RUN_UP;case '9': return CMD_RUN_UP_RIGHT;#endifcase CONTROL('B'): return CMD_OPEN_DOOR_DOWN_LEFT;case CONTROL('H'): return CMD_OPEN_DOOR_LEFT;case CONTROL('J'): return CMD_OPEN_DOOR_DOWN;case CONTROL('K'): return CMD_OPEN_DOOR_UP;case CONTROL('L'): return CMD_OPEN_DOOR_RIGHT;case CONTROL('N'): return CMD_OPEN_DOOR_DOWN_RIGHT;case CONTROL('U'): return CMD_OPEN_DOOR_UP_LEFT;case CONTROL('Y'): return CMD_OPEN_DOOR_UP_RIGHT;case CONTROL('A'): return CMD_TOGGLE_AUTOPICKUP;case CONTROL('C'): return CMD_CLEAR_MAP;case CONTROL('D'): return CMD_NO_CMD;case CONTROL('E'): return CMD_FORGET_STASH;case CONTROL('F'): return CMD_SEARCH_STASHES;case CONTROL('G'): return CMD_INTERLEVEL_TRAVEL;case CONTROL('I'): return CMD_NO_CMD;case CONTROL('M'): return CMD_NO_CMD;case CONTROL('O'): return CMD_EXPLORE;case CONTROL('P'): return CMD_REPLAY_MESSAGES;case CONTROL('Q'): return CMD_NO_CMD;case CONTROL('R'): return CMD_REDRAW_SCREEN;case CONTROL('S'): return CMD_MARK_STASH;case CONTROL('T'): return CMD_TOGGLE_NOFIZZLE;case CONTROL('V'): return CMD_TOGGLE_AUTOPRAYER;case CONTROL('W'): return CMD_FIX_WAYPOINT;case CONTROL('X'): return CMD_SAVE_GAME_NOW;case CONTROL('Z'): return CMD_SUSPEND_GAME;default: return CMD_NO_CMD;}}#ifdef UNIXstatic keycode_type numpad2vi(keycode_type key){if (key >= '1' && key <= '9'){const char *vikeys = "bjnh.lyku";return keycode_type(vikeys[key - '1']);}return (key);}#endifkeycode_type get_next_keycode() {keycode_type keyin;flush_input_buffer( FLUSH_BEFORE_COMMAND );keyin = getch_with_command_macros();#ifdef UNIX// Kludging running and opening as two character sequences// for Unix systems. This is an easy way out... all the// player has to do is find a termcap and numlock setting// that will get curses the numbers from the keypad. This// will hopefully be easy./* can we say yuck? -- haranp */if (keyin == '*'){keyin = getch();// return control-keykeyin = CONTROL(toupper(numpad2vi(keyin)));}else if (keyin == '/'){keyin = getch();// return shift-keykeyin = toupper(numpad2vi(keyin));}#else// Old DOS keypad supportif (keyin == 0){/* FIXME haranp - hackiness */const char DOSidiocy[10] = { "OPQKSMGHI" };const char DOSunidiocy[10] = { "bjnh.lyku" };const int DOScontrolidiocy[9] = {117, 145, 118, 115, 76, 116, 119, 141, 132};keyin = getch();for (int j = 0; j < 9; ++j ) {if (keyin == DOSidiocy[j]) {keyin = DOSunidiocy[j];break;}if (keyin == DOScontrolidiocy[j]) {keyin = CONTROL(toupper(DOSunidiocy[j]));break;}}}#endifmesclr();return keyin;}static void middle_input() {if (Options.stash_tracking)stashes.update_visible_stashes(Options.stash_tracking == STM_ALL?StashTracker::ST_AGGRESSIVE :StashTracker::ST_PASSIVE);}
return;}if (new_targ_grid == DNGN_LAVA&& you.duration[DUR_CONDENSATION_SHIELD] > 0){mpr("Your icy shield dissipates!", MSGCH_DURATION);you.duration[DUR_CONDENSATION_SHIELD] = 0;you.redraw_armour_class = 1;}if ((new_targ_grid == DNGN_LAVA|| new_targ_grid == DNGN_DEEP_WATER|| new_targ_grid == DNGN_SHALLOW_WATER)&& !player_is_levitating()){if (you.species == SP_MERFOLK && new_targ_grid != DNGN_LAVA){mpr("You stumble into the water and return to your normal form.");merfolk_start_swimming();}if (new_targ_grid != DNGN_SHALLOW_WATER)fall_into_a_pool( false, new_targ_grid );you.turn_is_over = 1;do_berserk_no_combat_penalty();
apply_berserk_penalty = true;
you_attack( targ_monst, true );you.turn_is_over = 1;// we don't want to create a penalty if there isn't// supposed to be oneif (you.berserk_penalty != NO_BERSERK_PENALTY)you.berserk_penalty = 0;attacking = true;}break_out:if (targ_grid == DNGN_LAVA && you.duration[DUR_CONDENSATION_SHIELD] > 0){mpr("Your icy shield dissipates!", MSGCH_DURATION);you.duration[DUR_CONDENSATION_SHIELD] = 0;you.redraw_armour_class = 1;}// Handle dangerous tilesif ((targ_grid == DNGN_LAVA|| targ_grid == DNGN_DEEP_WATER|| targ_grid == DNGN_SHALLOW_WATER)&& !attacking && !player_is_levitating() && moving){// Merfold automatically enter deep water... every other case// we ask for confirmation.if (you.species == SP_MERFOLK && targ_grid != DNGN_LAVA){// Only mention diving if we just entering the water.if (!player_in_water()){mpr("You dive into the water and return to your normal form.");merfolk_start_swimming();}}else if (targ_grid != DNGN_SHALLOW_WATER){bool enter = yesno("Do you really want to step there?", false, 'n');
// we don't want to create a penalty if there isn't// supposed to be oneif (you.berserk_penalty != NO_BERSERK_PENALTY)you.berserk_penalty = 0;
if (targ_grid == DNGN_UNDISCOVERED_TRAP&& random2(you.skills[SK_TRAPS_DOORS] + 1) > 3){strcpy(info, "Wait a moment, ");strcat(info, you.your_name);strcat(info, "! Do you really want to step there?");mpr(info, MSGCH_WARN);more();you.turn_is_over = 0;
you.time_taken *= player_movement_speed();you.time_taken /= 10;move_player_to_grid(targ_x, targ_y, true, false, swap);
i = trap_at_xy( targ_x, targ_y );if (i != -1)grd[ targ_x ][ targ_y ] = trap_category(env.trap[i].type);return;}you.x_pos += move_x;you.y_pos += move_y;if (targ_grid == DNGN_SHALLOW_WATER && !player_is_levitating())
// Returning the random trap scans as a way to get more use from the// skill and acute mutations.if (you.mutation[MUT_ACUTE_VISION] >= 2|| (!you.mutation[MUT_BLURRY_VISION]&& random2(100) <stat_mult(you.intel, skill_bump(SK_TRAPS_DOORS))))
if (you.species != SP_MERFOLK){if (one_chance_in(3) && !silenced(you.x_pos, you.y_pos)){mpr("Splash!");noisy( 10, you.x_pos, you.y_pos );}you.time_taken *= 13 + random2(8);you.time_taken /= 10;if (old_grid != DNGN_SHALLOW_WATER){mpr( "You enter the shallow water. ""Moving in this stuff is going to be slow." );if (you.invis)mpr( "And don't expect to remain undetected." );}}else if (old_grid != DNGN_SHALLOW_WATER&& old_grid != DNGN_DEEP_WATER){mpr("You return to your normal form as you enter the water.");merfolk_start_swimming();}
search_around();
you.time_taken *= player_movement_speed();you.time_taken /= 10;you.turn_is_over = 1;item_check(0);if (targ_grid >= DNGN_TRAP_MECHANICAL&& targ_grid <= DNGN_UNDISCOVERED_TRAP){if (targ_grid == DNGN_UNDISCOVERED_TRAP){i = trap_at_xy(you.x_pos, you.y_pos);if (i != -1)grd[ you.x_pos ][ you.y_pos ] = trap_category(env.trap[i].type);trap_known = false;}else{trap_known = true;}i = trap_at_xy( you.x_pos, you.y_pos );if (i != -1){if (player_is_levitating()&& trap_category(env.trap[i].type) == DNGN_TRAP_MECHANICAL){goto out_of_traps; // can fly over mechanical traps}
if (targ_grid == DNGN_CLOSED_DOOR && (Options.easy_open || you.running < 0))open_door(move_x, move_y);else if (targ_grid <= MINMOVE)
if (targ_grid == DNGN_CLOSED_DOOR && Options.easy_open)open_door(move_x, move_y, false);else if (targ_solid)
unsigned short get_packed_place( unsigned char branch, int subdepth,char level_type ){unsigned short place = (unsigned short)( (branch << 8) | subdepth );if (level_type == LEVEL_ABYSS || level_type == LEVEL_PANDEMONIUM|| level_type == LEVEL_LABYRINTH)place = (unsigned short) ( (level_type << 8) | 0xFF );return place;}unsigned short get_packed_place(){return get_packed_place( you.where_are_you,subdungeon_depth(you.where_are_you, you.your_level),you.level_type );}
// Takes a packed 'place' and returns a compact stringified place name.// XXX: This is done in several other places; a unified function to// describe places would be nice.std::string short_place_name(unsigned short place){unsigned char branch = (unsigned char) ((place >> 8) & 0xFF);int lev = place & 0xFF;const char *s;bool level_num = false;if (lev == 0xFF){switch (branch){case LEVEL_ABYSS:s = "Abyss";break;case LEVEL_PANDEMONIUM:s = "Pan";break;case LEVEL_LABYRINTH:s = "Lab";break;default:s = "Buggy Badlands";break;}}else{switch (branch){case BRANCH_VESTIBULE_OF_HELL:s = "Hell";break;case BRANCH_HALL_OF_BLADES:s = "Blade";break;case BRANCH_ECUMENICAL_TEMPLE:s = "Temple";break;default:level_num = true;s = (branch == BRANCH_DIS) ? "Dis:" :(branch == BRANCH_GEHENNA) ? "Geh:" :(branch == BRANCH_COCYTUS) ? "Coc:" :(branch == BRANCH_TARTARUS) ? "Tar:" :(branch == BRANCH_ORCISH_MINES) ? "Orc:" :(branch == BRANCH_HIVE) ? "Hive:" :(branch == BRANCH_LAIR) ? "Lair:" :(branch == BRANCH_SLIME_PITS) ? "Slime:" :(branch == BRANCH_VAULTS) ? "Vault:" :(branch == BRANCH_CRYPT) ? "Crypt:" :(branch == BRANCH_HALL_OF_ZOT) ? "Zot:" :(branch == BRANCH_SNAKE_PIT) ? "Snake:" :(branch == BRANCH_ELVEN_HALLS) ? "Elf:" :(branch == BRANCH_TOMB) ? "Tomb:" :(branch == BRANCH_SWAMP) ? "Swamp:" : "D:";break;}}std::string pl = s;if (level_num){char buf[20];snprintf(buf, sizeof buf, "%d", lev);pl += buf;}return pl;}
#if 0#if MSVC >= 1100typedef std::reverse_iterator<const_iterator, const TYPE> const_reverse_iterator;typedef std::reverse_iterator<iterator, TYPE> reverse_iterator;#elsetypedef std::reverse_iterator<const_iterator> const_reverse_iterator;typedef std::reverse_iterator<iterator> reverse_iterator;#endif#endif
// ----- Access -----TYPE& operator[](unsigned long index) {ASSERT(index < SIZE); return mData[index];}const TYPE& operator[](unsigned long index) const {ASSERT(index < SIZE); return mData[index];}TYPE& front() {ASSERT(SIZE > 0); return mData[0];}const TYPE& front() const {ASSERT(SIZE > 0); return mData[0];}
// ----- Access -----TYPE& operator[](unsigned long index) {ASSERT(index < SIZE); return mData[index];}const TYPE& operator[](unsigned long index) const {ASSERT(index < SIZE); return mData[index];}TYPE& front() {ASSERT(SIZE > 0); return mData[0];}const TYPE& front() const {ASSERT(SIZE > 0); return mData[0];}
TYPE& back() {ASSERT(SIZE > 0); return mData[SIZE - 1];}const TYPE& back() const {ASSERT(SIZE > 0); return mData[SIZE - 1];}TYPE* buffer() {return mData;}const TYPE* buffer() const {return mData;}
TYPE& back() {ASSERT(SIZE > 0); return mData[SIZE - 1];}const TYPE& back() const {ASSERT(SIZE > 0); return mData[SIZE - 1];}TYPE* buffer() {return mData;}const TYPE* buffer() const {return mData;}
// reverse_iterator rbegin() {return reverse_iterator(this->end());}// const_reverse_iterator rbegin() const {return const_reverse_iterator(this->end());}// reverse_iterator rend() {return reverse_iterator(this->begin());}// const_reverse_iterator rend() const {return const_reverse_iterator(this->begin());}
void init(TYPE def);
7B352EA00B00183400CABB32 /* mapdef.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7B352E9D0B00183400CABB32 /* mapdef.cc */; };7B352EA10B00183400CABB32 /* mapdef.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7B352E9E0B00183400CABB32 /* mapdef.h */; };7BBC4A060B0F782800F27D45 /* levcomp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7B352EEC0B001F4200CABB32 /* levcomp.cc */; };7BBC4A070B0F783C00F27D45 /* levcomp.lpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B352ED10B001B9E00CABB32 /* levcomp.lpp */; };7BBC4A080B0F783C00F27D45 /* levcomp.ypp in Sources */ = {isa = PBXBuildFile; fileRef = 7B352ED20B001B9E00CABB32 /* levcomp.ypp */; };7BC222E70ABBB286003A7D9A /* itemprop.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BC222E50ABBB286003A7D9A /* itemprop.cc */; };7BC222E80ABBB286003A7D9A /* itemprop.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7BC222E60ABBB286003A7D9A /* itemprop.h */; };7BD75A350AC214A200B74F6E /* notes.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BD75A330AC214A200B74F6E /* notes.cc */; };7BD75A360AC214A200B74F6E /* notes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7BD75A340AC214A200B74F6E /* notes.h */; };
7B237E110A8EC9D000580F30 /* wpn-misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "wpn-misc.h"; sourceTree = "<group>"; };7B237E120A8EC9D000580F30 /* wpn-misc.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "wpn-misc.cc"; sourceTree = "<group>"; };
7B352E9D0B00183400CABB32 /* mapdef.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mapdef.cc; sourceTree = "<group>"; };7B352E9E0B00183400CABB32 /* mapdef.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mapdef.h; sourceTree = "<group>"; };7B352ED10B001B9E00CABB32 /* levcomp.lpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.lex; name = levcomp.lpp; path = util/levcomp.lpp; sourceTree = "<group>"; };7B352ED20B001B9E00CABB32 /* levcomp.ypp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; name = levcomp.ypp; path = util/levcomp.ypp; sourceTree = "<group>"; };7B352EEC0B001F4200CABB32 /* levcomp.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = levcomp.cc; path = util/levcomp.cc; sourceTree = "<group>"; };7B352F1F0B00232500CABB32 /* splev.des */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = splev.des; path = dat/splev.des; sourceTree = "<group>"; };7B352F200B00232500CABB32 /* vaults.des */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = vaults.des; path = dat/vaults.des; sourceTree = "<group>"; };7BC222E50ABBB286003A7D9A /* itemprop.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = itemprop.cc; sourceTree = "<group>"; };7BC222E60ABBB286003A7D9A /* itemprop.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = itemprop.h; sourceTree = "<group>"; };7BD75A330AC214A200B74F6E /* notes.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = notes.cc; sourceTree = "<group>"; };7BD75A340AC214A200B74F6E /* notes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = notes.h; sourceTree = "<group>"; };
7B237DE50A8EC9D000580F30 /* maps.h */,7B237DE60A8EC9D000580F30 /* maps.cc */,7B237DE70A8EC9D000580F30 /* mon-pick.h */,7B237DE80A8EC9D000580F30 /* mon-pick.cc */,7B237DE90A8EC9D000580F30 /* misc.h */,7B237DEA0A8EC9D000580F30 /* insult.h */,7B237DEB0A8EC9D000580F30 /* insult.cc */,7B237DEC0A8EC9D000580F30 /* initfile.h */,7B237DED0A8EC9D000580F30 /* overmap.h */,7B237DEE0A8EC9D000580F30 /* overmap.cc */,7B237DEF0A8EC9D000580F30 /* output.h */,7B237DF00A8EC9D000580F30 /* item_use.h */,7B237DF10A8EC9D000580F30 /* initfile.cc */,7B237DF20A8EC9D000580F30 /* hiscores.h */,7B237DF30A8EC9D000580F30 /* hiscores.cc */,7B237DF40A8EC9D000580F30 /* travel.h */,7B237DF50A8EC9D000580F30 /* travel.cc */,7B237DF60A8EC9D000580F30 /* lev-pand.h */,7B237DF70A8EC9D000580F30 /* lev-pand.cc */,7B237DF80A8EC9D000580F30 /* items.h */,7B237DF90A8EC9D000580F30 /* newgame.cc */,7B237DFA0A8EC9D000580F30 /* mutation.h */,7B237DFB0A8EC9D000580F30 /* mutation.cc */,7B237DFC0A8EC9D000580F30 /* misc.cc */,7B237DFD0A8EC9D000580F30 /* message.h */,7B237DFE0A8EC9D000580F30 /* mon-util.h */,7B237DFF0A8EC9D000580F30 /* mon-util.cc */,7B237E000A8EC9D000580F30 /* it_use3.h */,7B237E010A8EC9D000580F30 /* it_use3.cc */,7B237E020A8EC9D000580F30 /* it_use2.h */,7B237E030A8EC9D000580F30 /* itemname.cc */,7B237E040A8EC9D000580F30 /* command.cc */,7B237E050A8EC9D000580F30 /* describe.h */,7B237E060A8EC9D000580F30 /* spl-util.h */,7B237E070A8EC9D000580F30 /* spl-util.cc */,7B237E080A8EC9D000580F30 /* randart.h */,7B237E090A8EC9D000580F30 /* randart.cc */,7B237E0A0A8EC9D000580F30 /* player.h */,7B237E0B0A8EC9D000580F30 /* player.cc */,7B237E0C0A8EC9D000580F30 /* effects.h */,
7B352EF00B001F5B00CABB32 /* Crawl */,7B352E950B0017CF00CABB32 /* Levcomp */,7B352EF30B001FA700CABB32 /* Shared */,);name = Source;sourceTree = "<group>";};1AB674ADFE9D54B511CA2CBB /* Products */ = {isa = PBXGroup;children = (8DD76FB20486AB0100D96B5E /* crawl */,);name = Products;sourceTree = "<group>";};7B237F120A8ECCDE00580F30 /* Libraries */ = {isa = PBXGroup;children = (7B237F140A8ECD2E00580F30 /* libncurses.5.dylib */,);name = Libraries;sourceTree = "<group>";};7B352E950B0017CF00CABB32 /* Levcomp */ = {isa = PBXGroup;children = (7B352EEC0B001F4200CABB32 /* levcomp.cc */,7B352ED10B001B9E00CABB32 /* levcomp.lpp */,7B352ED20B001B9E00CABB32 /* levcomp.ypp */,);name = Levcomp;sourceTree = "<group>";};7B352EF00B001F5B00CABB32 /* Crawl */ = {isa = PBXGroup;children = (
7B237E0E0A8EC9D000580F30 /* files.cc */,7B237E0F0A8EC9D000580F30 /* direct.cc */,7B237E100A8EC9D000580F30 /* dungeon.h */,7B237E110A8EC9D000580F30 /* wpn-misc.h */,7B237E120A8EC9D000580F30 /* wpn-misc.cc */,7B237E130A8EC9D000580F30 /* view.h */,7B237E140A8EC9D000580F30 /* view.cc */,7B237E150A8EC9D000580F30 /* spl-book.cc */,7B237E160A8EC9D000580F30 /* spells4.h */,7B237E170A8EC9D000580F30 /* spells4.cc */,7B237E180A8EC9D000580F30 /* spells3.h */,7B237E190A8EC9D000580F30 /* macro.h */,7B237E1A0A8EC9D000580F30 /* debug.h */,7B237E1B0A8EC9D000580F30 /* direct.h */,7B237E1C0A8EC9D000580F30 /* decks.h */,7B237E1D0A8EC9D000580F30 /* stuff.h */,7B237E1E0A8EC9D000580F30 /* stuff.cc */,7B237E1F0A8EC9D000580F30 /* stash.h */,7B237E200A8EC9D000580F30 /* stash.cc */,7B237E210A8EC9D000580F30 /* transfor.h */,7B237E220A8EC9D000580F30 /* transfor.cc */,7B237E230A8EC9D000580F30 /* tags.h */,7B237E240A8EC9D000580F30 /* tags.cc */,7B237E250A8EC9D000580F30 /* libutil.h */,7B237E260A8EC9D000580F30 /* item_use.cc */,
7B237E290A8EC9D000580F30 /* abl-show.h */,7B237E280A8EC9D000580F30 /* abyss.cc */,7B237E650A8EC9D000580F30 /* abyss.h */,
7B237E2E0A8EC9D000580F30 /* spl-cast.h */,7B237E2F0A8EC9D000580F30 /* spl-cast.cc */,7B237E300A8EC9D000580F30 /* spl-book.h */,7B237E310A8EC9D000580F30 /* output.cc */,7B237E320A8EC9D000580F30 /* ouch.h */,7B237E330A8EC9D000580F30 /* ouch.cc */,7B237E340A8EC9D000580F30 /* newgame.h */,7B237E350A8EC9D000580F30 /* message.cc */,7B237E360A8EC9D000580F30 /* menu.h */,7B237E370A8EC9D000580F30 /* menu.cc */,7B237E380A8EC9D000580F30 /* macro.cc */,7B237E390A8EC9D000580F30 /* shopping.cc */,7B237E3A0A8EC9D000580F30 /* religion.h */,7B237E3B0A8EC9D000580F30 /* religion.cc */,7B237E3C0A8EC9D000580F30 /* spells3.cc */,7B237E3D0A8EC9D000580F30 /* spells2.h */,7B237E3E0A8EC9D000580F30 /* spells2.cc */,7B237E3F0A8EC9D000580F30 /* mstuff2.cc */,7B237E400A8EC9D000580F30 /* monstuff.h */,7B237E410A8EC9D000580F30 /* monstuff.cc */,7B237E420A8EC9D000580F30 /* monspeak.h */,7B237E430A8EC9D000580F30 /* delay.h */,
7B237E2A0A8EC9D000580F30 /* chardump.cc */,7B237E2B0A8EC9D000580F30 /* chardump.h */,7B237E590A8EC9D000580F30 /* cloud.cc */,7B237E580A8EC9D000580F30 /* cloud.h */,7B237E570A8EC9D000580F30 /* clua.cc */,7B237E560A8EC9D000580F30 /* clua.h */,7B237E040A8EC9D000580F30 /* command.cc */,
7B237E450A8EC9D000580F30 /* spells1.h */,7B237E460A8EC9D000580F30 /* spells1.cc */,7B237E470A8EC9D000580F30 /* skills2.h */,7B237E480A8EC9D000580F30 /* skills2.cc */,
7B237E680A8EC9D000580F30 /* debug.cc */,7B237E1A0A8EC9D000580F30 /* debug.h */,
7B237E4B0A8EC9D000580F30 /* monspeak.cc */,7B237E4C0A8EC9D000580F30 /* monplace.h */,7B237E4D0A8EC9D000580F30 /* monplace.cc */,7B237E4E0A8EC9D000580F30 /* Kills.h */,7B237E4F0A8EC9D000580F30 /* Kills.cc */,7B237E500A8EC9D000580F30 /* files.h */,7B237E510A8EC9D000580F30 /* fight.h */,
7B237E050A8EC9D000580F30 /* describe.h */,7B237E0F0A8EC9D000580F30 /* direct.cc */,7B237E1B0A8EC9D000580F30 /* direct.h */,7B237E670A8EC9D000580F30 /* dungeon.cc */,7B237E100A8EC9D000580F30 /* dungeon.h */,
7B237E560A8EC9D000580F30 /* clua.h */,7B237E570A8EC9D000580F30 /* clua.cc */,7B237E580A8EC9D000580F30 /* cloud.h */,7B237E590A8EC9D000580F30 /* cloud.cc */,
7B237DF30A8EC9D000580F30 /* hiscores.cc */,7B237DF20A8EC9D000580F30 /* hiscores.h */,7B237DF10A8EC9D000580F30 /* initfile.cc */,7B237DEC0A8EC9D000580F30 /* initfile.h */,7B237DEB0A8EC9D000580F30 /* insult.cc */,7B237DEA0A8EC9D000580F30 /* insult.h */,7B237E610A8EC9D000580F30 /* invent.cc */,7B237E600A8EC9D000580F30 /* invent.h */,7B237E5F0A8EC9D000580F30 /* it_use2.cc */,7B237E020A8EC9D000580F30 /* it_use2.h */,7B237E010A8EC9D000580F30 /* it_use3.cc */,7B237E000A8EC9D000580F30 /* it_use3.h */,7B237E260A8EC9D000580F30 /* item_use.cc */,7B237DF00A8EC9D000580F30 /* item_use.h */,7B237E030A8EC9D000580F30 /* itemname.cc */,7B237E5B0A8EC9D000580F30 /* itemname.h */,7BC222E50ABBB286003A7D9A /* itemprop.cc */,7BC222E60ABBB286003A7D9A /* itemprop.h */,
7B237E5B0A8EC9D000580F30 /* itemname.h */,7B237E5C0A8EC9D000580F30 /* skills.h */,7B237E5D0A8EC9D000580F30 /* skills.cc */,7B237E5E0A8EC9D000580F30 /* shopping.h */,7B237E5F0A8EC9D000580F30 /* it_use2.cc */,7B237E600A8EC9D000580F30 /* invent.h */,7B237E610A8EC9D000580F30 /* invent.cc */,7B237E620A8EC9D000580F30 /* libutil.cc */,7B237E630A8EC9D000580F30 /* libunix.h */,
7B237DF80A8EC9D000580F30 /* items.h */,7B237E4F0A8EC9D000580F30 /* Kills.cc */,7B237E4E0A8EC9D000580F30 /* Kills.h */,7B237DF70A8EC9D000580F30 /* lev-pand.cc */,7B237DF60A8EC9D000580F30 /* lev-pand.h */,
7B237E650A8EC9D000580F30 /* abyss.h */,7B237E660A8EC9D000580F30 /* delay.cc */,7B237E670A8EC9D000580F30 /* dungeon.cc */,7B237E680A8EC9D000580F30 /* debug.cc */,7B237E690A8EC9D000580F30 /* mt19937ar.h */,7B237E6A0A8EC9D000580F30 /* mt19937ar.cc */,
7B237E630A8EC9D000580F30 /* libunix.h */,7B237E620A8EC9D000580F30 /* libutil.cc */,7B237E250A8EC9D000580F30 /* libutil.h */,7B237E380A8EC9D000580F30 /* macro.cc */,7B237E190A8EC9D000580F30 /* macro.h */,7B237DE60A8EC9D000580F30 /* maps.cc */,7B237DE50A8EC9D000580F30 /* maps.h */,7B237E370A8EC9D000580F30 /* menu.cc */,7B237E360A8EC9D000580F30 /* menu.h */,7B237E350A8EC9D000580F30 /* message.cc */,7B237DFD0A8EC9D000580F30 /* message.h */,7B237DFC0A8EC9D000580F30 /* misc.cc */,7B237DE90A8EC9D000580F30 /* misc.h */,7B237DE80A8EC9D000580F30 /* mon-pick.cc */,7B237DE70A8EC9D000580F30 /* mon-pick.h */,7B237DFF0A8EC9D000580F30 /* mon-util.cc */,7B237DFE0A8EC9D000580F30 /* mon-util.h */,7B237E4D0A8EC9D000580F30 /* monplace.cc */,7B237E4C0A8EC9D000580F30 /* monplace.h */,7B237E4B0A8EC9D000580F30 /* monspeak.cc */,7B237E420A8EC9D000580F30 /* monspeak.h */,7B237E410A8EC9D000580F30 /* monstuff.cc */,7B237E400A8EC9D000580F30 /* monstuff.h */,7B237E3F0A8EC9D000580F30 /* mstuff2.cc */,
7B237E6A0A8EC9D000580F30 /* mt19937ar.cc */,7B237E690A8EC9D000580F30 /* mt19937ar.h */,7B237DFB0A8EC9D000580F30 /* mutation.cc */,7B237DFA0A8EC9D000580F30 /* mutation.h */,7B237DF90A8EC9D000580F30 /* newgame.cc */,7B237E340A8EC9D000580F30 /* newgame.h */,7BD75A330AC214A200B74F6E /* notes.cc */,7BD75A340AC214A200B74F6E /* notes.h */,7B237E330A8EC9D000580F30 /* ouch.cc */,7B237E320A8EC9D000580F30 /* ouch.h */,7B237E310A8EC9D000580F30 /* output.cc */,7B237DEF0A8EC9D000580F30 /* output.h */,7B237DEE0A8EC9D000580F30 /* overmap.cc */,7B237DED0A8EC9D000580F30 /* overmap.h */,7B237E0B0A8EC9D000580F30 /* player.cc */,7B237E0A0A8EC9D000580F30 /* player.h */,7B237E090A8EC9D000580F30 /* randart.cc */,7B237E080A8EC9D000580F30 /* randart.h */,7B237E3B0A8EC9D000580F30 /* religion.cc */,7B237E3A0A8EC9D000580F30 /* religion.h */,7B237E390A8EC9D000580F30 /* shopping.cc */,7B237E5E0A8EC9D000580F30 /* shopping.h */,7B237E5D0A8EC9D000580F30 /* skills.cc */,7B237E5C0A8EC9D000580F30 /* skills.h */,7B237E480A8EC9D000580F30 /* skills2.cc */,7B237E470A8EC9D000580F30 /* skills2.h */,7B237E460A8EC9D000580F30 /* spells1.cc */,7B237E450A8EC9D000580F30 /* spells1.h */,7B237E3E0A8EC9D000580F30 /* spells2.cc */,7B237E3D0A8EC9D000580F30 /* spells2.h */,7B237E3C0A8EC9D000580F30 /* spells3.cc */,7B237E180A8EC9D000580F30 /* spells3.h */,7B237E170A8EC9D000580F30 /* spells4.cc */,7B237E160A8EC9D000580F30 /* spells4.h */,7B237E150A8EC9D000580F30 /* spl-book.cc */,7B237E300A8EC9D000580F30 /* spl-book.h */,7B237E2F0A8EC9D000580F30 /* spl-cast.cc */,7B237E2E0A8EC9D000580F30 /* spl-cast.h */,7B237E070A8EC9D000580F30 /* spl-util.cc */,7B237E060A8EC9D000580F30 /* spl-util.h */,7B237E200A8EC9D000580F30 /* stash.cc */,7B237E1F0A8EC9D000580F30 /* stash.h */,7B237E1E0A8EC9D000580F30 /* stuff.cc */,7B237E1D0A8EC9D000580F30 /* stuff.h */,7B237E240A8EC9D000580F30 /* tags.cc */,7B237E230A8EC9D000580F30 /* tags.h */,7B237E220A8EC9D000580F30 /* transfor.cc */,7B237E210A8EC9D000580F30 /* transfor.h */,7B237DF50A8EC9D000580F30 /* travel.cc */,7B237DF40A8EC9D000580F30 /* travel.h */,7B237E140A8EC9D000580F30 /* view.cc */,7B237E130A8EC9D000580F30 /* view.h */,
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;GCC_WARN_MISSING_PARENTHESES = YES;GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;GCC_WARN_PEDANTIC = YES;GCC_WARN_SHADOW = YES;GCC_WARN_SIGN_COMPARE = YES;GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;GCC_WARN_MISSING_PARENTHESES = YES;GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;GCC_WARN_PEDANTIC = YES;GCC_WARN_SHADOW = YES;GCC_WARN_SIGN_COMPARE = YES;GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;GCC_WARN_MISSING_PARENTHESES = YES;GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;GCC_WARN_PEDANTIC = YES;GCC_WARN_SHADOW = YES;GCC_WARN_SIGN_COMPARE = YES;GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
// =========================================================================// System Defines// =========================================================================// Define plain_term for Unix and dos_term for DOS and EMX.#if defined(LINUX)
// OS X's Terminal.app has color handling problems; dark grey is// especially bad, so we'll want to remap that. OS X is otherwise// Unix-ish, so we shouldn't need other special handling.#if defined(OSX)
#define USE_UNIX_SIGNALS#elif defined(SOLARIS)#define UNIX#define USE_UNIX_SIGNALS#elif defined(BSD)#define UNIX#elif defined(OSX)#define UNIX// Darkgrey is a particular problem in Terminal.app.
#elif defined(HPUX)#define UNIX#define USE_UNIX_SIGNALS// Under HP-UX it's typically easier to use ncurses than try and// get the colour curses library to work. -- bwr#define CURSES_INCLUDE_FILE <ncurses.h>
// macintosh is predefined on all the common Mac compilers#elif defined(macintosh)#define PLAIN_TERM#define HAS_NAMESPACES 1#define EOL "\r"#define CHARACTER_SET A_ALTCHARSET#include <string>#include "libmac.h"
#define FILE_SEPARATOR '/'
#define SAVE_DIR_PATH ""
// #define SAVE_DIR_PATH ""// Define DATA_DIR_PATH to the directory where level-description (.des)// files are stored. NOTE: If you're installing Crawl for a real multiuser// system, you MUST do this. The directory must exist on the filesystem.
//// #define SAVE_PACKAGE_CMD "/usr/bin/zip -m -q -j -1 %s.zip %s.*"// #define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip -d" SAVE_DIR_PATH// #define PACKAGE_SUFFIX ".zip"
#define SAVE_PACKAGE_CMD "/usr/bin/zip -m -q -j -1 %s.zip %s.*"#ifdef SAVE_DIR_PATH#define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip -d" SAVE_DIR_PATH#else#define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip"#endif#ifdef SAVE_PACKAGE_CMD// This is used to unpack specific files from the archive.#define UNPACK_SPECIFIC_FILE_CMD LOAD_UNPACKAGE_CMD " %s"#endif